Posts

Showing posts from August, 2015

mesos - apache marathon: my docker image keeps failing -

im following steps on here i've created json file such: { "id": "/myjavabuild-2", "cmd": null, "cpus": 1, "mem": 1024, "disk": 0, "instances": 1, "container": { "type": "docker", "volumes": [], "docker": { "image": "hub.docker.com/eugenepark3/myjavabuild", "network": "host", "privileged": false, "parameters": [], "forcepullimage": false } }, "portdefinitions": [ { "port": 10001, "protocol": "tcp", "labels": {} } ], "uris": [ "file:///etc/docker.tar.gz" ], "fetch": [ { "uri": "file:///etc/docker.tar.gz", "extract": true, "executable": false, ...

Add an android library to the default list of libraries in Studio/SDK -

Image
so first of all, clear doubts, know how add library android project. question here that, want add library list of default libraries in android studio. let me explain example. let's want add glide library project. firstly, have go glide github page , then, there copy compile 'com.github.bumptech.glide:glide:3.7.0' text , paste in in build.gradle file . android studio download library on internet. every time want use glide library in of project, have this. want , that, want include specific libary glide in default list of libraries available me so here, want include library project, can use it, in of projects. in advance, reading. there way add library every new project/module automatically. there folder templates in android studio directory. for: ..\android studio\plugins\android\lib\templates\gradle-projects\newandroidmodule\root in directory there file: build.gradle.tfl modify according needs. example: dependencies { <#if dependencylist...

Python 3.5: Web-scraping with Stripping html codes -

i scraping web content stuck problem. after series of processing strip scope want, cannot strip html code make plain text in list. have tried using function of replace, re.compile , join (try change list text stripping). doesn't work designed string or pops out errors when running. could give me hint how that. example, want output following code change from <p class="course-d-title">instructor</p> to instructor . import tkinter tk import re def test(): bs4 import beautifulsoup import urllib.request urllib.parse import urljoin '''for layer 0''' url_text = 'http://www.scs.cuhk.edu.hk/en/part-time/accounting-and-finance/accounting-and-finance/fundamental-accounting/162-610441-01' resp = urllib.request.urlopen(url_text) soup = beautifulsoup(resp, from_encoding=resp.info().get_param('charset')) = soup.find_all('p') k=0 item in a[:]: if 'instruc...

xml - Spring : java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index; -

i'm developing spring my pom.xml <properties> <spring.version>4.0.2.release</spring.version> <hibernate.version>4.3.4.final</hibernate.version> <jdk.version>1.8</jdk.version> <version.servlet-api>3.0.1</version.servlet-api> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <name>springdev</name> <dependencies> <dependency> <groupid>javax.servlet</groupid> <artifactid>servlet-api</artifactid> <version>2.5</version> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>${spring.version}</version> </depen...

python 2.7 - TypeError in Countvectorizer scikit-learn: Expected string or buffer -

i trying solve classification problem. when feed text countvectorizer gives error: expected string or buffer. is wrong dataset contains message mixture of number , word special character in message. sample how message following: 0 have not received gifts ordered ok 1 hth wells idyll mcgill kooky bbc.co 2 test test test 1 test 3 test 4 hello reward points 5 hi, can koovs coupons or vouchers here... here code used classification: import pandas pd sklearn.feature_extraction.text import countvectorizer df = pd.read_excel('training_data.xlsx') x_train = df.message print x_train.shape map_class_label = {'checkin':0, 'greeting':1,'more reward options':2,'noclass':3, 'other':4,'points':5, 'referral points':6,'snapbill':7, 'thanks':8...

docusignapi - Sender View Generated Lock -

we have following scenario: 1. user first accesses envelope through sender view generated api. 2. user accesses envelope through sender view again within short period of time. we receive following error: edit_lock_not_lock_owner is there way can release lock through api? if you're seeing " lockedbyapp ", believe you'll need wait lock expire ( lockeduntildatetime ) -- lock cannot deleted. for more detailed information, see answer here: how remove lock created 'sender view'?

Camel Spring cxf restful web service issue -

hi trying consume cxf spring based web service using camel. getting below error on server start severe: context initialization failed org.apache.camel.runtimecamelexception: org.apache.cxf.service.factory.serviceconstructionexception @ org.apache.camel.util.objecthelper.wrapruntimecamelexception(objecthelper.java:1680) @ org.apache.camel.spring.springcamelcontext.onapplicationevent(springcamelcontext.java:138) @ org.apache.camel.spring.camelcontextfactorybean.onapplicationevent(camelcontextfactorybean.java:340) @ org.springframework.context.event.simpleapplicationeventmulticaster.invokelistener(simpleapplicationeventmulticaster.java:163) @ org.springframework.context.event.simpleapplicationeventmulticaster.multicastevent(simpleapplicationeventmulticaster.java:136) @ org.springframework.context.support.abstractapplicationcontext.publishevent(abstractapplicationcontext.java:381) @ org.springframework.context.support.abstractapplicationcontext.publisheven...

html - CSS background image no-repeat only working in Firefox -

.myclass{ background-image: url('http://image.flaticon.com/icons/svg/34/34164.svg'); background-repeat: no-repeat; background-size:contain; background-position: 1.5%; } all rows (tr) of table have class myclass: <tr class="myclass"> in firefox image displayed in cells of first column of table in chrome , opera cells of table have background image. make sure shows in first column in chrome , opera well? here html: <table> <tr class="myclass"> <th>company</th> <th>contact</th> <th>country</th> </tr> <tr class="myclass"> <td>alfreds futterkiste</td> <td>maria anders</td> <td>germany</td> </tr> </table> set this .myclass td:first-child { background-image: url('http://image.flaticon.com/icons/svg/34/34164.svg'); background-repeat: no-repeat; background-size:contain;...

VSTS Database Dacpac release has failure when deploying the package, but the deployment status said succeed -

vsts database dacpac release has failure when deploying package, deployment status said succeed. is there way fix can see deployment fails @ status?right if don't @ log, think deployment good. below see in release log, deployment status still succeed: 2016-08-23t21:24:52.2672666z analyzing deployment plan (complete) 2016-08-23t21:24:52.2682666z updating database (start) 2016-08-23t21:24:56.1344991z error occurred while batch being executed. 2016-08-23t21:24:56.1435001z updating database (failed) 2016-08-23t21:24:56.1575000z *** not deploy package. 2016-08-23t21:24:56.1575000z warning sql72015: type column principalinvestigator in table [dbo].[study] nvarchar (120) null being changed nvarchar (60) null. data loss occur. 2016-08-23t21:24:56.1575000z error sql72014: .net sqlclient data provider: msg 50000, level 16, state 127, line 6 rows detected. schema update terminating because data loss might occur. 2016-08-23t21:24:56.1575000z error sql72045: script exe...

sql - ORACLe PROCEDURE - AUTHID allowed only in schema level -

while trying create table via procedure, facing error error(73,9): pls-00157: authid allowed on schema-level programs procedure bckup authid current_user statusmsg varchar2(400); begin --backup records execute immediate 'create table schemaname.tabname select pgm.* xyz pgm, ijk prf prf.col1=pgm.col1 , prf.id in(select id tab2)'; commit; exception when others statusmsg :='sql errror code ' || sqlcode|| ' -error- ' ||sqlerrm; dbms_output.put_line('error : ' || statusmsg); end bckup; your procedure seems part of package. in package, can set invoker rights ( authid current_user ) @ package level. cannot set each individual procedure. either move invoker rights package level: create or replace package pkg authid current_user procedure bckup; -- more types, procedures , functions end pkg; create or replace package body pkg procedure bckup statusmsg varchar2(400); begin --backu...

Why my app info empty about Draw, Process, Execute adb shell dumpsys gfxinfo -

i used, adb shell dumpsys gfxinfo why app info empty draw, process, execute adb shell dumpsys gfxinfo? dont understand why empty stats. me pls. ** graphics info pid 3213 [com.kabam.marvelbattle] ** recent displaylist operations save cliprect drawdisplaylist drawpatch save cliprect translate drawpatch drawdisplaylist drawtext restoretocount drawdisplaylist restoretocount drawrect drawpatch drawpatch drawtext drawdisplaylist drawdisplaylist drawdisplaylist drawrect save cliprect drawdisplaylist drawpatch save cliprect translate drawpatch drawdisplaylist drawrect drawtext restoretocount drawdisplaylist restoretocount drawrect drawpatch drawpatch drawrect drawtext setupshader drawrect resetshader drawdisplaylist drawdisplaylist drawdisplaylist drawdisplaylist drawcolor drawrect drawcolor caches: current memory usage / total memory usage (bytes): texturecache...

android - Clear previous responses in main activity -

i have simple form in main activity. on submitting form, activity 2 starts. when go main activity (by clicking on button), want clear responses. when assign id widget, , activity or fragment stop, onsavestate called widget save actual value , show when come activity. so, clean edittext when came activity you'll have manually, suggest in onrestart function according activity life cycle

tkinter - How can a file.py containing grid() can be imported properly into a file.py containing pack()? -

this main file import file file1 from tkinter import* import random import time tk=tk() tk.title("app manager") tk.resizable(0,0) tk.wm_attributes("-topmost",1) canvas=canvas(tk,width=460,height=500,bg='black',bd=0,highlightthickness=0) canvas.create_text(230,50,text="app manager",font=('bold',50),fill="gold") canvas.pack() tk.update() class ball: def __init__(self,canvas,color): self.canvas=canvas self.id=canvas.create_oval(0,0,15,15,fill=color) self.canvas.move(self.id,100,100) start=[-4,-3,-2,-1,1,2,3,4] random.shuffle(start) self.x=start[0] self.y=-4 self.canvas_height=self.canvas.winfo_height() self.canvas_width=self.canvas.winfo_width() def draw(self): self.canvas.move(self.id,self.x,self.y) pos=self.canvas.coords(self.id) if pos[1]<=0: self.y=4 if pos[3]>=self.canvas_height: self...

jQuery Datatables use function as ajax data source instead of path or url -

how use functions data source ajax datatables? i'm using in electron application built in database i'm calling function, writing results data.json file, , using file source: populatedata(); //gets data db , writes output data.json let table = $('#acctransaction').datatable({ dom: 'bfrtip', select: { style: 'single' }, ajax: '../data.json', ... instead, more efficient if call db function directly it's not working....not valid url. let table = $('#acctransaction').datatable({ dom: 'bfrtip', select: { style: 'single' }, ajax: getdata(), ... i realize can make source 'data: newdata,' loose ablility call table.ajax.reload setinterval( function () { table.ajax.reload( null, false ); // user paging not reset on reload console.log('reloading..') }, 3000 ); how use functions data source ajax datatables instead of url...

gruntjs - What does the @ symbol in '@*/grunt-*' glob pattern mean? -

what @ symbol in '@*/grunt-*' glob pattern mean? require('load-grunt-tasks')(grunt, {pattern: ['grunt-*', '@*/grunt-*']}); from load-grunt-tasks ( https://github.com/sindresorhus/load-grunt-tasks ) doc. the @ isn't weird glob syntax - it's matching directories begin @ . that particular glob pattern added scoped npm packages supported - package scopes prefixed @ .

javascript - override default angularjs error messages - "Required" "Invalid" -

i have input field, have show error messages , not working.. error messages not shown. <div class="form-group grouped"> <div> <label for="card-routingnumber">number:</label> <input name="cr" ng-model="card.rn" type="number" pattern="[0-9]*" id="card-rn" class="form-control" validate-on="submit" required /> <span class="help-block" ng-show"form.cr.$error.required">field empty</span> </div> </div> when click on submit, need show error message if input empty.. when try... says "required" add "novalidate" attribute form.

boost - adding a shared_ptr object on a weak_ptr container -

my class based on boost::asio tutorial. this class has private ctor, derived enable_shared_from_this. its static member function return shared_ptr object created. i want store pointers on list of weak_ptr, list don't need worry life time, either prolong it. the caller tcp_serve instantiate tcp_connection create method: tcp_server: tcp_connection::pointer new_connection = tcp_connection::create(acceptor_.get_io_service()); tcp_connection: public: typedef boost::shared_ptr<tcp_connection> pointer; static pointer create(boost::asio::io_service& io_service) { return pointer(new tcp_connection(io_service)); } private: tcp_connection(boost::asio::io_service& io_service) : _socket(io_service), _timer(io_service) { } i trying create list on tcp_server, tried many different kind of types, can't rightly added object list: std::list<std::weak_ptr<tcp_connection>> connections; connections.push_back(new_connection);...

bnd - A Docker image for running enRoute OSGi framework? -

i want try , run enroute inside docker container cannot seem find docker images. can suggest location of image? osgi enroute uses bndtools . there can export bndrun file executable jar (see base tutorial , deploying ). therefore need have java 8 image. non-trivial task because oracle rather annoying concerning copyrights there on ggtools/java8 image. therefore, run osgi enroute executable jar on docker, can use following dockerfile: from ggtools/java8 maintainer pkriens@gmail.com cmd java -jar test.jar add test.jar test.jar you can build , run follows: $ ls dockerfile test.jar $ docker build . $ docker images repository tag image id created size <none> <none> 491dc47dbee6 minute ago 174.8 mb <none> ...

c - EADDRINUSE Address already in use avoidable? -

i testing socket class have written wraps linux socket api. in test function following: create server socket bind/listen connect new socket accept on new socket send data between them recv , send. call shutdown(shut_wr) on both sides call recv on both sides, , 0 return value call close on 3 sockets i repeat these 8 steps again. i find intermittantly on bind in second iteration of steps eaddrinuse. i of impression possible perform orderly shutdown in such fashion avoidable. aware of so_reuseaddr - possible orderly shutdown , block until port available again?

regex - Replace string by matching using regular expression python -

original string: necessary information leave comment unnecessary information required string: necessary information i have multiple strings in above mentioned 'original string' format. want remove 'leave comment' , 'unnecessary information'. since 'leave comment' common in string can build regular expression on that? , use in string.replace( string , pattern ) the pattern here regular expression. how can write re this? >>> s 'necessary information leave comment unnecessary information' >>> re.sub(r'\sleave comment.*', '', s) 'necessary information'

php - Error with __Call on magento -

i can't figure out, i have method on class like: public function __call($closure, $args){ return call_user_func_array($this->{$closure}->bindto($this),$args); } this works on local server on magento, when try use on server returns me following error: fatal error: call undefined method closure::bindto() in i tried adding var_dump variables, have correct values. any ideas? closure::bindto exists in php 5.4 or newer only. check php version. http://php.net/manual/en/closure.bindto.php

javascript - How to not update database if $_POST value is empty? -

i have been having problems form of website of mine. form values equal corresponding $_post values, parameters used updating database. i not want empty form values updated. however, don't want of input areas obligatory. that means able update specific content, not needing type values in input areas not want update. i'm having problems this, however. empty form values being uploaded, values in database being changed blank values. i've looked tutorials in , on internet, , (functional) ones turn input boxes obligatory. not how intend work, doesn't fit. i think best way this, , not sure, change, through javascript, "name" attribute of input areas blank when submit button set if values equal empty or null. not know how this, nor know if possible, or best way. here current code on matter: (first, form javascript) <script> function validade(){ var formid = document.getelementbyid("configform"); var allinputs = formid.getelemen...

sql server - Need to have LIKE and specific code in one sql -

in following, getting patients have visited department 2 , have diagnosis_code in starting 'e11.' . i group of patients have specific code 'i10'. how can code here both groups. create column each. e11. 'diab'. i10 'hyper', in addition other columns showing. patient can have had both of these btw. select vouchers.billing_date, vouchers.voucher_id, vwgenpatapptinfo.appt_status, vwgenpatapptinfo.appt_sched_department_id, vwgenpatinfo.patient_first_name, vwgenpatinfo.patient_last_name, vouchers.patient_id, diagnosis_codes.diagnosis_code ((ntier_70751.pm.service_diagnoses service_diagnoses inner join ntier_70751.pm.services services on service_diagnoses.service_id=services.service_id) inner join ntier_70751.pm.diagnosis_codes diagnosis_codes on service_diagnoses.diagnosis_code_id=diagnosis_codes.diagnosis_code_id) inner join ((ntier_70751.pm.vwgenpatapptinfo vwgenpatapptinfo ...

javascript - How do I call a function within ajax using codeigniter to update -

i want call model function within ajax update data should in database. my main function controller: function m_addr(){ $this->load->view('m_add_view'); } this other function in controller 1 want call m_add_view edit data in database ajax while remaining in m_add_view. what thinking should execute function m_update without leaving m_add_view view not have reload page. function m_update($id, $text, $column_name){ $data = array('text'=>$text); $this->db->where('id', $id); $this->db->update($column_name, $data); } this code have far update is: function edit_data(id, text, column_name){ $.ajax({ url:"<?php echo base_url(); ?>control/m_update", method:"post", data:{ id:id, text:text, column_name:column_name }, datatype:"text", success:function(data){ /*alert(data);*/ $...

android - Storing data in Firebase -

i have trouble storing data in firebase. want store link , date (from previous fragment) in firebase database. i can store link date not seem stored in database on click of fab. appreciated , relevant code below: public class details extends appcompatactivity { private static final string key_link = "link"; requestqueue requestqueue; public static final int connection_timeout = 10000; public static final int read_timeout = 15000; private recyclerview rv; private cardview cardview; floatingactionbutton fab; private boolean ischecked = true; private list<detail> detaillist = new arraylist<>(); private vibrator vib; private firebase firebaseref; private static final string firebase_url = "https://athenajs.firebaseio.com"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_details); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupp...

ember.js - Ember DS.RecordArray filter items -

i getting records in route model call, in 1 of components want show subset of records. doing calling models.filter(somefilter) . problem filter returns array not ds.recordarray , when action causes model removed store, array not updated , component model not removed. does know how either create filter returns ds.recordarray or convert existing array ds.recordarray . // routes/index.js route.extend({ model() { return this.store.findall('user'); } }); //index.hbs {{some-component users=model}} //some-component.js component.extend({ filteredusers: ember.computed(function() { return this.get('users').filter(...); }) }); //some-component.hbs {{#each filteredusers |user| {{other-component user=user}} {{/each}} filteredusers: ember.computed(function() { return this.get('users').filter(...); }) this executed once.so whenever users property changed filteredusers not recalculated not date. in case need introduce depend...

Skip specific rows using read.csv in R -

i wish skip 1st , 3rd rows of csv file when importing file data frame in r. in original file headers on line 2. using skip argument in read.csv can skip 1st line , set header argument true still have 3rd line original file in data frame. can suggest how skip multiple specific rows in r, below able cobble together? can pass vector skip argument specifying exact rows ignore? prach <- read.csv("rsran104_-_prach_propagation_delay-plmn-day-rsran_ru50ep1_reports_rsran104_xml-2016_08_23-21_33_03__604.csv", header = true, sep = ",", stringsasfactors = false, skip = 1) one way using 2 read.csv commands, first 1 reads headers , second 1 data: headers = read.csv(file, skip = 1, header = f, nrows = 1, as.is = t) df = read.csv(file, skip = 3, header = f) colnames(df)= headers i've created following text file test this: do not read a,b,c previous line headers 1,2,3 4,5,6 the result is: > df b c 1 1 2 3 2 4 5 6

angularjs - issue with ngPattern -

i trying design nifty expiration date input on credit card checkout form automatically insert " / " between expiration month , year while user typing. model no longer picks input value since have introduced ngpattern validation input. angular allows model pick input value once validation has succeeded. makes nifty feature not work due code. can find way around this. below code. html <input ng-keyup="checkout.updateexp()" class="form-control" type="text" maxlength="7" placeholder="mm / yy" required autocomplete="off" name="exp" ng-pattern="/\d{2}\s\/\s\d{2}/" ng-model="checkout.cf.exp"> controller function vm.updateexp = function(){ var separator=" / "; //add separator if(vm.cf.exp.length==2){//-----> cannot process since ngpattern makes exp undefined till pattern met vm.cf.exp = vm.cf.exp.substring(0,2) + separator; } //remove ...

javascript - How fetch json data in React -

i new in react , i'm learning on official website tutorial help. so, have structure in app: -js -notes.js -comment.json index.html notes.js have next code: var commentbox = react.createclass({ loadcommentsfromserver: function() { $.ajax({ url: this.props.url, datatype: 'json', cache: false, success: function(data) { this.setstate({data: data}); }.bind(this), error: function(xhr, status, err) { console.error(this.props.url, status, err.tostring()); }.bind(this) }); }, getinitialstate: function() { return {data: []}; }, componentdidmount: function () { this.loadcommentsfromserver(); setinterval(this.loadcommentsfromserver, this.props.pollinterval); }, render: function(){ return ( <div classname="commentbox"> <h1>comments<...

swift - Auth0 on iOS: Error Domain=com.auth0 Can't find connection name to use for authentication -

i receiving error when trying connect auth0 ios sdk: error domain=com.auth0 code=18 "authentication failed" userinfo={nslocalizeddescription=authentication failed, nslocalizedfailurereason=can't find connection name use authentication} here code: let client : a0apiclient = a0lock.sharedlock().apiclient() client.signupwithemail(emailtextfield.text!, password: passwordtextfield.text!, loginonsuccess: true, parameters: nil, success: { (profile: a0userprofile?, tokeninfo: a0token?) in }) { (nserror) in print(nserror) } i'm assuming have set connection inside parameters variable, how do that? couldn't find reference code in documentation. thanks! found it: let parameters = a0authparameters(dictionary: [a0parameterconnection : "username-password-authentication"])

css - JQuery Mobile Grid behavior different between local and JSBin -

edit: turned out caused nbsp's in source html. i'm leaving question in hope might else solve same problem. jquery mobile's grid feature not working correctly when serve locally or open file. the test code i've pasted @ bottom of message works correctly in jsbin. blocks line no vertical offsets. here's jsbin link , link image of output. http://jsbin.com/bocubeqaza/1/edit?html,output https://drive.google.com/file/d/0bxfysp3qjvxxukgzeupbme9kcw8/view?usp=sharing serving file locally, however, produces vertical offset in right element of each group of blocks. here's link output code (which has no local dependencies) when viewed locally. https://drive.google.com/open?id=0bxfysp3qjvxxvkz3czfactdjowm (sorry image links; so's imgur uploader doesn't google drive links , don't have alternate public location screen grabs) i've tried obvious things clearing browser cache , restarting it. moreover, misbehavior reproducible when serve deskt...

c# - NHibernate mapping bag with keys from property of a property -

i have following structure: public class version { public status status; } public class status { action action; area area; public ilist<version> versions } public class action { public int id; } public class area { public int id; } and map list of versions bag, might mapping wrong way. here parte of status.hbm.xml file maps list: <bag name="versions" cascade="save-update" inverse="true" lazy="true" generic="true" order-by="num_version desc"> <key> <column name="id_action"></column> <column name="id_area"></column> </key> <one-to-many class="version" /> </bag> id_action , id_area foreign keys status , property of version . need reference status on bag mapping? how supposed map case? thank you i able find problem: mapping used on answer correct. however, needed inverse orde...

python POST with file - convert from RAW data -

i have been trying thing work days, no luck. have worked through majority of issues, @ new error , don't know why. i have read multiple posts, , asked few questions along way, stumped , seems nothing search helps. here scenario: i need log website (let's call site_a) , pull report next, need log separate website (site_b) can upload report with site_b, required log in, session id, use session id upload file this done api https post calls... (yes, api requires post everything). site_a works - log in , pull data, gives me xml file. file converted csv file, due site_b accepting .csv. site_b however, giving me errors. using burp, able intercept raw data of test api published company. raw data looks (some data removed): post /api/import http/1.1 host: hosturl accept: application/json, text/javascript, */*; q=0.01 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br x-requested-with: xmlhttprequest content-type: multipart/form-data; boundary=-----...

c# - Parse dynamic JSON -

i using c# , json.net 9.0.1 i have following json { "lineups": [ { "55": { "id": "55", "game_id": "1", "player_id": "55", "jersey_number": "78" }, "56": { "id": "56", "game_id": "1", "player_id": "56", "jersey_number": "77" }, "57": { "id": "57", "game_id": "1", "player_id": "57", "jersey_number": "76" } } ] } all of array items of type player. how can parse json each item "55", "56", "57" stored in ...

javascript - When space is removed in a string of input text everything on right should be erased -

so have input box deals hashtags. ex: #abc #abcd #abcde if user decides delete space in between of words, in right should erased. ex: "#abc#abcd #abcde" should not happen in input field. instead input field should automatically update "#abc" any idea? sorry thought code might not help. anyway. $("#post_search").keyup(function () { $("#post_top_searches").show(); var ht = $('#post_search_input').val(); $("#search_display").empty(); var inputarr = ht.split(' '); var arrlen = (object.keys(inputarr).length); var newcount = (ht.match(/\s/g) || []).length; if (newcount < currentwhitespacecount) { var str = $('#post_search_input').val() var newstr = "#"; if (newcount === 0) { if (((str.match(new regexp("#", "g")) || []).length) > 1) { (var = 1, len = str.length; <= len; i++) { if (str[i] === "#") { ...

MySql VIEW remove subquery in FROM condition -

im newbie sql , im trying create views buts mysql yell error error 1349 (hy000): view's select contains subquery in clause how can remove subquery in condition , same results in view? select actual, curr, case when actual > anterior 'raise' when actual < anterior 'drop' else 'nothing' end 'status' ( select o.i_price actual, o.i_currency curr, ( select i.i_price info i.i_article_id = 1 , i.i_insert < o.i_insert order i.i_insert desc limit 1 ) anterior info o o.i_article_id = 1 order o.i_insert desc limit 1 ) q you cannot use dinamica subquery during creation of view should create proper view subquery create view my_q select o.i_price actual, o.i_currency curr, ( select i.i_p...

apache - Rewriting URL's with and without trailing slash -

i'm @ wits end on , don't understand apache (like, @ all) or care to. i'm attempting able visit site going url in 2 ways: example.com/page example.com/page/ both using page.html data source. i've been told use multiviews (which enabling did nothing). i've seen done mod_rewrite. current .htaccess not work. options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / ## hide .php extension external redirection: rewritecond %{the_request} ^[a-z]{3,}\s/+([^.]+)\.html [nc] rewriterule ^ /%1/ [r,nc,l] ## internally redirect .php extension: rewritecond %{document_root}/$1.html -f rewriterule ^(.+?)/?$ /$1.html [l]

javascript - How to send and recive content using ajax and php -

i try send data server ajax (pure js) , want send on request body know how in jquery: $.ajax({ url: 'someurl', data: 'foo' }); what mean how can send data server jquert when useing ajax method data attribute in pure js ? also, how in php data? know laravel need do request::getcontent(); (if remember right) dont know how data in php thanks in terms of sending ajax request via javascript without relying on jquery, that's pretty broad question. should review documentation here . a simple example // old compatibility code, no longer needed. if (window.xmlhttprequest) { // mozilla, safari, ie7+ ... httprequest = new xmlhttprequest(); } else if (window.activexobject) { // ie 6 , older httprequest = new activexobject("microsoft.xmlhttp"); } httprequest.open('post', url); httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); var data = /* data here */ httprequest.s...

python - How to pass commands to gcc through cx_Freeze -

how pass commands gcc through cx_freeze 'disutils.core.setup()' arguments? specifically, want .exe file use relative paths in traceback messages, rather path build .exe file here setup.py file: setup( name="test", packages=['test'], package_data={'': ['*.py', '*.txt', '*.sample', '*.mo', 'readme.rst']}, options={"build_exe": { "icon": r"test\resources\test.ico", "compressed": true, "create_shared_zip": true, "copy_dependent_files": true, "include_files": [ ('test/i18n/', 'i18n/'), ('test/resources/', 'resources/'), ('test/client.conf.sample', 'client.conf.sample'), ], "excludes": [ 'urllib.sys', 'urllib._sre', 'urllib.array', 'urllib._locale', 'urlli...

java - Android Google Places: Not returning selected place -

followed tutorial here. http://www.startingandroid.com/google-places-api-tutorial-for-android/ however, when searching in search bar, selecting 1 suggested list , pressing pick location button, map displays user's current location , not place he/she selected. can provide solution this? mainactivity.java public class mainactivity extends appcompatactivity { private placepicker.intentbuilder builder; private placesautocompleteadapter mplacesadapter; private button pickerbtn; private autocompletetextview mylocation; private static final int place_picker_flag = 1; private static final latlngbounds bounds_greater_sydney = new latlngbounds( new latlng(-34.041458, 150.790100), new latlng(-33.682247, 151.383362)); protected googleapiclient mgoogleapiclient; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mgoogleapiclient = new googleapiclient.builder(this) .addapi(p...

performance - Allocate and free memory VS. allocate first, process only for each time -

i'm trying write robot hardware's serial communication part. , have desktop pc motherboard, no memory restrictions (8gb ram, i3 cpu etc.) program communicates microcontroller via usb (fullspeed) or serial 115200 baudrate. i'm confused problem's smallness. have 20 30 methods they're using communication function. which 1 more effective processing fast? 1 instance of function running @ same time. define first, use everytime; ... private: struct timespec ctv1, ctv2; double time_diff; int serial_write_ret; int ret_val; ... int mserial::genandsend_setint32command() { gensum ( stm_buf_t ); sem_wait ( &serial_mutex ); // somefunctions(); sem_post ( &serial_mutex ); return ret_val; } or allocate , deallocate everytime; int mserial::genandsend_setint32command() { gensum ( stm_buf_t ); struct timespec ctv1, ctv2; double time_diff = .0; int serial_write_ret; int ret_val = timeout_error_in_serial; ...