Posts

Showing posts from April, 2014

Meteor - Adding a favourite/like user accounts -

i have page display list users. current user "is_teacher" able 'like' individual users in list. likes visible teacher. thought best way add likes: string in collection , store students_id code must way off because not working. can checkout i've done let me know i'm going wrong. path: schemas.js schema.userprofile = new simpleschema({ likes: { type: [string], optional: true } }); path: sudentlist.html <template name="studentlist"> {{#each student}} {{#if like}} <button class="like">unlike</button> {{else}} <button class="like">like</button> {{/if}} {{/each}} </template> path: studentlist.js template.studentlist.helpers({ like: function() { return meteor.users.findone({likes: this._id}); } }); template.studentlist.events({ 'click #like':function(event,template) { var student = this._...

php - CakePHP multiple time and condition with price not working -

i have query in cakephp , not working. have record in db when remove inner price condition return result not working price. select `car`.`id`, `car`.`title`, `car`.`description`, `car`.`image`, `car`.`state`, `car`.`state_code`, `car`.`city`, `car`.`zipcode`, `car`.`person_name`, `car`.`email`, `car`.`phone`, `car`.`mobile`, `car`.`ad_type`, `car`.`ad_status`, `car`.`make`, `car`.`model`, `car`.`year`, `car`.`conditiion`, `car`.`transmision`, `car`.`color`, `car`.`fuel`, `car`.`body`, `car`.`doors`, `car`.`mileage`, `car`.`price`, `car`.`accessories`, `car`.`security`, `car`.`created`, `car`.`user_id` `portal_carsnew`.`cars` `car` `car`.`ad_status` = '1' , `car`.`make` = 'ferrari' , `car`.`model` = '458 italia' , `car`.`state` = 'new york' , `car`.`city` = 'albany' , ((`car`.`price` < 95000) , (`car`.`price` > 0)) order `car`.`id` desc limit 10 use cakephp find method ...

python - Django Rest Framework user authentication -

i have following code. i using django rest framework. i want allow users register. send email address, password, username post. i feel not using django rest framework correctly. can guys please me code below? what's best way structure adhere django rest framework principles? also, form below invalid ... how post error message back? @api_view(['post']) def user_login(request): profile = request.post if ('id' not in profile or 'email_address' not in profile or 'oauth_secret' not in profile): return response( status=status.http_204_no_content) identifier = profile['id'] email_address = profile['email_address'] oauth_secret = profile['oauth_secret'] firstname = none if 'first_name' in profile: firstname = profile['first_name'] lastname = none if 'last_name' in profile: lastname = profile['last_name'] bio = none if 'bio' in profile: bio = profi...

Why is this graph showing up twice in R Markdown? -

Image
```{r scatterplot, fig.width=14, fig.height=14, echo=false, results="hide"} histogram( ~factor( format(df_ian$newdate,"%b"), levels = c("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec") ) | factor( format(newdate,"'%y") ), data=df_ian, layout=(c(3,6)), main="flood counts year , month", ylab="flood count", xlab="year" ) ``` when knit, histogram show twice. missing here? @hrbrmstr correct, cannot reproduce problem. because of that, cannot advance suspect: plotting histogram every factor of second argument of function. consider simple dataset: dt <- data.frame(gender = rep(c("male", "female"), c(4, 2) ), trans = rep(c("car", "bus", "bike"), c(3, 2, 1) )) library(lattice) hist...

Displaying a linked list in java -

i'm working on assignment need create linked list given template. each new node created, need print out updated list. however, until point, i've been stumped on how print out linked list. can figure out doing wrong? have prints out number has been created, followed blank space, instead of entire list point. numberlist.java import java.util.*; public class numberlist { private node head; public numberlist() { } public void insertathead(int x) { node newnode = new node(x); if (head == null) head = newnode; else { newnode.setnext(head); head = newnode; } } public void insertattail(int x) { } public void insertinorder(int x) { } public string tostring() { node tmp = head; string result = ""; while (tmp.getnext() != null) { result += tmp.tostring() + " "; } return result; } //--------------------- // test methods //------------...

javascript - Vue.js Failed to resolve filter: key -

i following tutorial https://laracasts.com/series/search-as-a-service/episodes/2 , got stuck on following error [vue warn]: invalid expression. generated function body: scope.keyup:scope.search [vue warn]: failed resolve filter: key shown in console. this code. <input type="text" v-model="query" v-on="keyup: search | key 'enter'"> <div class="results"> <article v-for="movie in movies"> <h2> @{{ movie.name }}</h2> <h4> @{{ movie.rating }}</h4> </article> </div> </div> <script src="http://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.17/vue.js"></script> <script> new vue ({ el: 'body', data: { query: '' , movies: [] }, ...

embedded - Error (10170): Verilog HDL syntax error at final_lab.sv(46) near text "default"; expecting "end" -

hello getting following error in verilog , don't know why can't seem figure out. please error : error (10170): verilog hdl syntax error @ final_lab.sv(46) near text "default"; expecting "end" code module final_lab (clock_50, sw, ledr, key, hex5, hex4, hex3, hex2, hex1,hex0); input logic clock_50; input logic [6:1] sw; input logic [3:0] key; output logic [9:0] ledr; output logic [6:0] hex5, hex4, hex3, hex2, hex1, hex0; logic [6:1] whatwehave; logic reset; logic keyone , keythree; assign whatwehave = 6'b000000; always_comb begin if (whatwehave[6:1] == sw[6:1]) begin keythree = 0; keyone = 0; whatwehave = whatwehave; end else if (whatwehave[6:1] < sw[6:1]) begin whatwehave = whatwehave+1; keythree = 1; keyone = 0; end else if (whatwe...

node.js - How to create Facebook's app to add an overlay to profile picture? -

where start if want create facebook app add overlay profile picture? i have seen many changing profile picture support digital india or pray french profile pictures how it? right way know of through this, https://www.facebook.com/fbcameraeffects/learn/ it's rolling out might not available until then. if else knows of way through api i'd love know well.

postgresql - Postgres dynamic sql and list result -

i used execute(for dynamic sql) , setof(result returning list), wrong :( create table test select 1 id, 'safd' data1,'sagd' data2 union select 2 id, 'hdfg' data1,'sdsf' data2; create or replace function test2(a varchar) returns setof record $body$ declare x record; begin x in execute loop return next x; end loop; return; end; $body$ language 'plpgsql' volatile; select * test2('select * test'); you have know in advance structure of returned record select * test2('select * test') s(a int, b text, c text); | b | c ---+------+------ 1 | safd | sagd 2 | hdfg | sdsf or if returned set set of test table use akash's proposed solution.

Session Duration in ASP.NET C# -

i new asp.net , trying find session duration page load time time click button end session. trying use datetime , timespan, problem datetime value generated in 1 event cannot accessed in other event. '// code using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; namespace webapplication17 { public partial class webform1 : system.web.ui.page { //datetime tstart, tnow, tend; protected void page_load(object sender, eventargs e) { } // button start session public void begin_click(object sender, eventargs e) { datetime tstart = datetime.now; sesstart.text = tstart.tostring(); } // display present time in updatepanel using ajax timer protected void timer1_tick(object sender, eventargs e) { datetime tnow = datetime.now; prestime.text = tnow.tostring(); } // button end session public void end_click(o...

Android Studio: there is a Exclamation mark in SDK Update Sites -

Image
when open android sdk in android studio: name url !glass development kit, google inc https://dl-ssl.google.com/glass/gdk/addon.xml now wanna know "!" before glass development kit, google inc ,does impact project? this issue reported recently, describing same problem you're having, , what's said on thread, looks fixed already. if you're using android studio 2.0 preview, that's problem. try update android studio , should disappear. by way, doesn't seems problem @ all, if don't update, should work fine.

Java pattern for extending list for gui usage -

i have non-gui-component internally maintains list of objects, creating/deleting elements needed. this class's internal list should it's own swing jtable based view drag/drop resorting , deleting abilities. view should automatically updated if element added list inside non-gui-component. should list of non-gui-component made new class extending abstracttablemodel , used such, or there pattern in java allows me keep non-gui-component gui-agnostic , achieve goal?

routes - ruby on rails myprofile page -

i want create profile page users signing let's user registered, profile link should be website.com/profile/username and on views/profile/index.html.erb each user should see own profile , edit form_for guess far have profiles_controller.rb , profile.rb model , resources :profiles for routes.rb best way that? if wanna username need use slug. example below id version. profile controller def show @profile = profile.find(params[:id]) end routes: get 'profile/:id' => 'profile#show' for :slug version, url this: http://localhost:3000/profiles/**username** routes: resources :profiles, param: :slug profiles_controller def show end private def set_profile @profile = profile.find_by_username(params[:slug]) end or can use gem https://github.com/norman/friendly_id

scala - value toDF is not a member of org.apache.spark.rdd.RDD -

i've read issue in other posts , still don't know i'm doing wrong. in principle, adding these 2 lines: val sqlcontext = new org.apache.spark.sql.sqlcontext(sc) import sqlcontext.implicits._ should have done trick error persists this build.sbt: name := "pickacustomer" version := "1.0" scalaversion := "2.11.7" librarydependencies ++= seq("com.databricks" %% "spark-avro" % "2.0.1", "org.apache.spark" %% "spark-sql" % "1.6.0", "org.apache.spark" %% "spark-core" % "1.6.0") and scala code is: import scala.collection.mutable.map import scala.collection.immutable.vector import org.apache.spark.rdd.rdd import org.apache.spark.sparkcontext import org.apache.spark.sparkcontext._ import org.apache.spark.sparkconf import org.apache.spark.sql._ object foo{ def reshuffle_rdd(rawtext: rdd[string]): rdd[map[string, (vector[(double, double, s...

javascript - ajax been skipped when called again? -

ok, ajax follow: $.ajax({ url: "checkout/getcartfromclient/", contenttype: 'application/json; charset=utf-8', datatype: 'json', type: "post", data: json.stringify(list), which send cart items localstorage server, when user edit items, manage update localstorage correctly , when sending again server, ajax called skipped , server don't have updated cart version !? the issue ajax call work once, second, third time been skipped !? is ajax call under separate function, if not put in function like: function updatecart(list){ $.ajax({ url: "checkout/getcartfromclient/", contenttype: 'application/json; charset=utf-8', datatype: 'json', type: "post", data: json.stringify(list), success: function(response){ //do stuff }, error:function(err){ //get error } }) debugging: -- check data in list i...

Handling multiple exceptions in Python -

i want handle different exceptions in such way there common handling exception and additional specific handling subprocess.calledprocesserror . this: try: check_output(shlex.split(rsync_cmd)) except calledprocessexception e: # stuff # common exception handling except exception e: # same common handling i don't want duplicate code end code: try: check_output(shlex.split(rsync_cmd)) except exception e: if isinstance(e, calledprocesserror) , e.returncode == 24: # stuff # common handling what's best practice run specific code 1 exception and run common code exceptions @ same time? you may check error not against class, tuple of classes. in each branch may check specific properties. try: n=0/0 except (ioerror, importerror) e: print(1) except (nameerror) e: print(2) traceback (most recent call last): file "<input>", line 2, in <module> n=0/0 ...

javascript - how to trigger a print request to clients machine using jquery -

here in, have nested divs..in images generate dynamically ...this html code ..my problem if click print button corresponding image need printed. <div id="outputtemp" style="display:none"> <div id="rightoutputimgae"> <div id="rightimgid" class="rightimg" rel="tooltip" content=" <img src='jqe13/image/1.jpg' class='tooltip-image'/> "> <div id="outputimageid" class="outputimage"> <img src="jqe13/image/1.jpg" alt="right bottom image"></div> </div> <ul> <li id="outcheckbox"><input name="outcheck" type="checkbox"></li> <li id="outedit"> <a href="#"><img src="jqe13/image/edit_s.png" alt="edit" title="edit"> </a></li> <l...

hadoop - Twitter Data Analysis using mahout -

i have collected twitter data using flume current research project. thinking of extracting texts these flumedata files. want mahout text clustering on these tweets. can suggest me how able ? so far , i have used flume collect twitter data i parsed data using hive , constructed table tweets consisting of text tweets. hive -e 'select * tweets' > sample.txt , gives me tweets text document. i used hive here parse data .. there other way of doing this? cos concern split tweets multiple text documents can perform mahout text clustering.

typescript - Angular2: mouse event handling (movement relative to current position) -

my user should able move (or rotate) object mouse in canvas. when mouse events occur screen coordinates used calculate delta (direction , length) last event. nothing special... mousedown (get first coordinate) mousemove (get nth coordinate, calculate deltaxy, move object deltaxy) mouseup (same step 2 , stop mousemove , mouseup event handling) after chain of events should possible repeat same action. this outdated example works expected, after removing torx calls. here delta first coordinate determined: github.com:rx-draggable here effort adapt code example: @component({ selector: 'home', providers: [scene], template: '<canvas #canvas id="3dview"></canvas>' }) export class home { @viewchild('canvas') canvas: elementref; private scene: scene; private mousedrag = new eventemitter(); private mouseup = new eventemitter<mouseevent>(); private mousedown = new eventemitter<mouseevent>(); private mo...

HTML frameset not loading properly second time in IE11 -

i have html page frameset loading selected record in table in ie11. if go previous page, select second record open not reloading selected data (showing opened data). no js issues in ie console. here code: <html> <head> </head> <frameset rows="98,35," frameborder="no" framespacing="0"> <frame scrolling="no" src="explorerhead.jsp" name="headframe" noresize> <frame scrolling="no" src="submenu.jsp" name="menuframe" noresize> <frameset id="parentframeset" rows=",85%" frameborder="no" framespacing="0"> <frame src="buttonhead.jsp" name="buttonframe" scrolling="yes" frameborder="0" noresize> <frame src="tablebody.jsp" name="browseframe" scrolling="yes" frameborder="0" noresize> ...

android - About Image click Issue -

i have question image click issue: i using parallax effect sticky, in viewpager not working on clicking. requirement if user clicks on that,then should redirect page.i using this link that. i using viewpager instead of imageview , viewpager has image sliding. thats not working.i getting array of images. any idea wrong ? thanks. code: public class mainactivity extends actionbaractivity { private textview stickyview; private listview listview; private view heroimageview; private view stickyviewspacer; private int max_rows = 20; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); /* initialise list view, hero image, , sticky view */ listview = (listview) findviewbyid(r.id.listview); heroimageview = findviewbyid(r.id.heroimageview); stickyview = (textview) findviewbyid(r.id.stickyview); heroimageview.setonclicklistener(new onclicklistener() { ...

c++ - ORB compute bug: it removes all keypoints with a small image -

Image
i have small image 50x50. find orb keypoints with: (notice have change default param of patchsize 31 14 keypoints detected): orbfeaturedetector det(500,1.2f,8,14,0,2,0,14); //> (from 31 14) orbdescriptorextractor desc; det.detect(image,kp) //> kp.size() 50 keypoints now if pass keypoints orb.compute keypoints erased. desc.compute(image,kp,kpdesc); //> kp.size() == 0 this mean after have called .compute method has deleted keypoints. the image using this: i believe sort of bug. can confirm? using opencv 2.4.5 no not bug. the problem orbdescriptorextractor doesn't know have changed param in featuredetector. have set right params again: orbfeaturedetector det(500,1.2f,8,14,0,2,0,14); //> (from 31 14) orbdescriptorextractor desc(500,1.2f,8,14,0,2,0,14);

FTP connect in Bluemix PHP -

i came understanding ftp connect or ftp related methods not work in bluemix. there twerk or method should include or prefer make php application work in bluemix. if not possible, there other service providers bluemix can use host php application ? for outcoming communication on port: 21 shouldn't have issues in bluemix. opened. instead, incoming communication on ftp port blocked. (you can use http , https port) bluemix platform service (paas) based on cloud foundry. makes no sense enable port 21 incoming traffic. , should same other platform service based on cf.

CRM Plugin Serverconnection missing reference -

Image
i using sample code crm samples come sdk , error keeps showing. how add serverconnection missing reference? @ loss find add it? or namespace belongs to? this connection code crm online hope serve: clientcredentials credentials = new clientcredentials(); credentials.username.username = username; credentials.username.password = password; credentials.windows.clientcredential = credentialcache.defaultnetworkcredentials; uri organizationuri = new uri(crmserverurl); uri homerealmuri = null; using (organizationserviceproxy serviceproxy = new organizationserviceproxy(organizationuri, homerealmuri, credentials, null)) { crmsvc = (iorganizationservice)serviceproxy; }

javascript - How to dynamically change the value of the <a> 'download' field in HTML? -

i have following: author<input type="text" name="author" id="authortxt"><br> filename<input type="text" name="filename" id="filenametxt"><br> email<input type="text" name="email" id="email"> <img id="saveicon" src="interface/saveicon0.png" onmouseover="this.src='./interface/saveicon1.png'" onmouseout="this.src='./interface/saveicon0.png'" /> <img id="cancelicon" src="interface/cancelicon0.png" onmouseover="this.src='./interface/cancelicon1.png'" onmouseout="this.src='./interface/cancelicon0.png'" /> <a id="download" download="testjson-r.json">download</a> i need filename of download set 'filename' field. simplest way of doing this? try use .at...

ios - change UIButton text with another UIButton text (swift) -

Image
my question how change uibutton 's title uibutton 's title. have 3 buttons , want exchange title button 1 , 3 each other when click on button 2. look @ image , understand. how can that? i think it's simple. just preserve 1 of text button in string , replace clicking on button. let title1 = btn1.titlelabel!.text btn1.settitle(btn2.titlelabel!.text, forstate: uicontrolstate.normal) btn2.settitle(title1, forstate: uicontrolstate.normal) learn , apply code! hope helps you.

sitecore8 - Sitecore custom personalisation rules based on external API data -

we have requirement create personalisation rules based on data external api. an example of implementation not find reason. depend on speed of external api call , reuse of data , cost of call. there multiple solutions. think geo ip, (with provider) or mobile device detector. sitecore-mobile-device-detector a time ago on user group meeting there demo external fitbit data the, worked in following way, data 1 time in session , store in profile, in custom analytics contact facet , create rules based on contact facet. see links in slides how personalize sitecore site fitbit data

java - JTextField keep filling the space of the JMenuBar -

im trying add buttons , textfields jmenubar , after set jtextfield's preferredsize, jtextfield keeps on filling space on jmenubar. note: jmenubar added using method - public static void setjpanelmenubar(jpanel parent, jpanel child, jmenubar menubar) { parent.removeall(); parent.setlayout(new borderlayout()); jrootpane root = new jrootpane(); parent.add(root, borderlayout.center); root.setjmenubar(menubar); root.getcontentpane().add(child); parent.putclientproperty("root", root); //if need later } the code allows me add jmenubar in jpanel. now on jmenubar code. jmenubar x = jmenubar1; x.removeall(); jtextfield searchbar = txtsearch; jtextfield searchbar2 = new jtextfield(); searchbar2.setpreferredsize(new dimension(10,20)); x.add(lblsearch); x.add(searchbar); x.add(btnsearch); x.add(box.createhorizontalglue()); x.add(searchb...

sql server - sql update for dynamic row number -

i working on asp.net webapi project. 1 functionality of project requirement update craft type. craft table contains columns crafttypekey, crafttypename , crafttypedescription. need update columns crafttypename , crafttypedescription. problem face is, number of rows provided ui dynamic. can array (or list). using sql stored procedure perform db update operations. using sp updates 1 row of table , calls sp in loop till elements updated. problem of approach if having update error(for reason) in between loop, having no way inform ui part, occurred error while updation. last row update status provided ui client(in json format.) need update web api output number of rows updated , number of rows update failure occured. the code used perform db update follows. alter procedure [dbo].[usp_updatecrafttype] @orgkey int, @crafttypekey int, @crafttypename varchar(50), @crafttypedescription varchar(128) begin set nocount on; declare @rowcount1 begin update [...

scanf - identifying characters from an input file in C -

i have input file looks this: 5 (2,3) (1,4) (1,3) (3,4) (4,5) the first number number of ordered pairs. i'm trying scan in each x in (x,y) in array x[i] , , same y digit y[i] . tried use fscanf take each line , put array, set x[i]=array[1] , set y[i]=array[3] each i , think going on array[0] not equal '( ' each time scanned in. simplest way scan in x , y in (x,y) x[i]=x , y[i]=y each ordered pair? if numbers in pairs integers, can scan them loop: int i, res, x[number], y[number]; (i = 0; < number; i++) { if (scanf(" (%d ,%d )", &x[i], &y[i]) != 2) { printf("invalid input\n"); exit(1); } } the initial space in format consume whitespace characters, such linefeed left in input stream previous scanf . as suggested kemyland, other spaces after %d ignore spaces between number , , , ) characters. ignoring spaces before numbers done %d format. should not add 1 after ) because ins...

java - Link Parent and Child entities Hibernate JA -

i have struggled way relate role entity user entity in java hibernate. have user entity has list of role entities. want relate them if user deleted role entities have user deleted cascade or like. i started off @onetomany ( user ) & manytoone ( role ) relationship between 2 entities, when delete user set column contained user in role table null . suggested relationship @manytomany caused illegal attempt map non collection @onetomany, @manytomany or @collectionofelements have yet resolve. hence ask best way achieve desired relationship between user , role before go far down rabbit hole. please note: in example role more of permission, users can have same permission linked username. in table below can see digby.tyson has same role reed.robert no. 7, if digby deleted role on reed should remain user.java @serializedname("userrole") @expose // @onetomany(mappedby = "user", fetch = fetchtype.eager, cascade = cascadetype.all, orphanrem...

office365 - Unable to refresh data for reports based on on-premise database (Gateway not working) -

Image
i have created reports referencing on-premise sql server database via power bi gateway. have created refresh schedule these reports. the reports refreshing correctly till recently, somehow reports not refreshing now. tried investigate issue, , first step verified , confirmed gateway still , running. when tried check refresh schedule of reports, found controls in "gateway connection" tab stuck , not responding. happening existing reports, tried creating new report , still showing same. doesn't proceed after waiting half hour. please see screenshot. could please assist possible? his issue makes product of no use honestly. unable refresh (manual scheduled) report @ all.!!! i have posted on community.microsoft.com, waiting response since 1 week. thanks nirman you can try re-installing gateway, there may changes in power bi azure need latest power bi gateway installed. make sure uninstall upgrade may not work, in case had re-install after uninstal...

codeigniter - CI Event Calendar not showing current month data until clicking next/prev -

with code below ci calendar working fine view data database, when click next/prev. first time when calendar open default current month , doesn't show data database, cause in ulr after controller name there no year, month parameter. can't find missed actually. controller: class my_calendar extends ci_controller { public function __construct() { parent::__construct(); $this->load->model('logindatamodel'); $this->load->model('my_calmodel'); } public function showcal($year=null, $month=null){ $user_data['userinfo'] = $this->logindatamodel->login_data(); $data['calendar']=$this->my_calmodel->generate($year,$month); $this->load->view('common/header', $user_data); $this->load->view('common/menu', $user_data); $this->load->view('my_calendar',$data); $this->load->view('common/footer...

java - Executors.newFixedThreadPool() - how expensive is this operation -

i have requirement need process tasks current live shows . scheduled tasks , runs every minute. at given minute, there can number of live shows (though number cannot large, approx max 10 ). there more 20 functionalities needs done live shows. or 20 worker classes there , doing there job . let first functionality, there 5 shows, after few minutes shows reduced 2, again after few minutes shows increase 7 . currently doing this, int totalshowscount = getcurrentshowscount(); executorservice executor = executors.newfixedthreadpool(showids.size()); the above statements gets executed every minute. problem statement 1.) how expensive above operation be..??. creating fixedthreadpool @ every given minute. 2.) can optimize solution, should use fixed thread pool, (10), , maybe 3 or 5 or 6 or number of threads getting utilized @ given minute. can create fixed thread pool @ worker level, , maintain , utilize that. fyi, using java8, if better approach available. ...

robotframework - How to handle error Positional argument after varargs in RF? -

i’m trying create user keyword “create list of list” create list of list has 2 lists arguments. when run this, shows error “ creating user keyword 'create list of list' failed: positional argument after varargs .” *** test cases *** sample test case [tags] test @{list1}= create list b c d @{list2}= create list 1 2 3 4 @{listoflist}= create list of list @{list1} @{list2} *** keywords *** create list of list [arguments] @{list1} @{list2} log hello world any suggestions helpful. rf version used: 2.8.7 when passing 2 lists keyword, want pass list , not individual elements of list. reference list object, use $ rather @ : *** test cases *** sample test case ... @{listoflist}= create list of list ${list1} ${list2} *** keywords *** create list of list [arguments] ${list1} ${list2} ...

php - how to get all available user search records from twitter API using laravel -

i working on twitter api ( https://api.twitter.com/1.1/users/search.json ). when request user records using request getting first page of records in json first 20 records want records of specific name enter. how extend request , store them in database public function gettwitter() { $settings = array( 'oauth_access_token' => "xxxxxxxxxxxxxx", 'oauth_access_token_secret' => "xxxxxxxxxxxxxxxx", 'consumer_key' => "xxxxxxxxxxxxxxxxxxxxx", 'consumer_secret' => "xxxxxxxxxxxxxxxxxxxxxxx", ); $url = 'https://api.twitter.com/1.1/users/search.json'; $getfield = '?q=name search'; $requestmethod = 'get'; $twitter = new twitterapiexchange($settings); $users = $twitter->setgetfield($getfield) ->buildoauth($url, $requestmethod) ->performrequest(); $us...

Is there some way to include the folder name in a Netbeans template? -

i working on large project in netbeans written in php. folders in ./modules/ share name namespace used in file. actually, easy auto-include namespace identical directory structure. how should format template picks folder name , uses in namespace declaration?

php - Form posted values depends on textbox input length -

i have 2 php files: form.php , noform.php in form.php have: <span style="position:relative; left:10px;"><input type="text" id="fname" name="fname"> <span style="position:relative; left:155px;"><input type="text" id="gname" name="gname"> </span></span> <hr> <span style="position:relative; left:10px;">family name <span style="position:relative; left:242px;">given name</span></span> <br> when submit form, in noform.php values $_post method. then, in noform.php have: <div id="familyname" style="position:relative; left:10px; float:left;"><?php echo $_post['fname'];?></div> <span style="position:relative; left:350px;"><div id="givenname"><?php echo $_post['gname'];?></div></span> <hr> <span style=...

mysql - Unknown column 'G.Id' in 'on clause' -

i getting sql error (1054): unknown column 'g.id' in 'on clause' . what wrong , how can solved? select e.id, e.nome, a.login username, e.departamento, e.funcao, e.telefone, e.fax, e.email, a.previlegio perfil, g.nome grupos g, equipa e inner join acesso on a.id = e.idacesso inner join grupos_has_equipa h on h.grupos_id = g.id e.id = '1977' , h.grupo_principal = "sim" you cannot mix implicit , explicit joins in single query. so solution rewrite from grupos g, equipa e part from grupos g inner join equipa e ps: don't see join condition ties e , g tables. bet you're getting cartesian product result.

android - Cross platform native games with Visual Studio -

please note looked through of visual studio documentation optimum solution couldn't find info :-) i going develop new game , time want use c++ , visual studio. game run on ios , android , desktop. work on mac book pro , run windows , os x on computer simultaneously (with of vmware workstation). the game run on opengl es of other frameworks (sfml). i'm trying gather information on how setup solution , how should use platforms specific apis. i assume have use opengl es application (android, ios) game , shared library (android, ios) game engine code. now comes question, should put platform specific implementations including not limited to: in-app billing android in-app purchases ios chartboost/adcolony sdk android , ios some ios-only features implemented in obj-c code basically need find way setup projects in visual studio. think need set this: game engine project (shared library): hold game engine code that'll shared on platforms (let's assume io...

php - Ignoring autoloader in certain files -

i have function below autoloads classes before registering them new classes. function __autoload($controller){ $ce = explode('\\', $controller); require root . '/app/base/classes/' . end($ce) . '/class.' . end($ce) . '.php'; } how can ignore autoloader 1 class? reason behind because installed package , class file directory class files in... try require package file containing class need, before calling new oneclass() . for example, if have [root]/app/base/classes/oneclass/class.oneclass.php alongside [root]/app/custom/packages/oneclass.php , may: require root . '/app/custom/packages/oneclass.php'; $class = new oneclass(); // instance of /app/custom/packages/oneclass.php but best solution using namespaces , described in psr-0 , psr-4 recommendations. and when use namespaces, , have correct directory/file structure/names, , have correctly described namespaces inside classes: $my_class = new \app\...

php - Ajax record not rendered completely cakephp -

i have ajax generated cakephp 2.0 paginated record. each time try click next go next page, missing link error. it works if record generated without ajax. appcontroller class appcontroller extends controller { public $helpers = array('session'); public $components = array( 'session','requesthandler', 'email','image','cookie', 'auth' => array( 'loginredirect' => array( 'controller' => 'users', 'action' => 'index' ), 'logoutredirect' => array( 'controller' => 'compass', 'action' => 'index', 'home' ), 'autherror' => 'did think allowed see that?', 'authenticate' => array( 'form' => array( 'passwordhasher' => '...

bash - Printing file content on one line -

i'm lost trying thought straightforward : read file line line , output on 1 line. i'm using bash on rhel. consider simple test case file (test.in) following content: one 2 3 4 i want have script reads files , outputs: one 2 3 4 done i tried (test.sh): cat test.in | while read in; printf "%s " "$in" done echo "done" the result looks like: # ./test.sh foure done # it seems printf causes cursor jump first position on same line after %s. issues holds when doing echo -e "$in \c" . any ideas? you can use: echo -- $(<test.in); echo 'done' 1 2 3 4 done

Windows Phone image not visible -

i have problem: i'm creating first app in windows phone platform , put image files in folder assets/images usual when run application not recognize images , don't see images. my image format png. on ios , android don't have problem. please, can me ? thanks. here how able handle issue in alloy project android , windows phone. 1.paste png files (large.png) in 'assets/android/images' folder , 'assets/windows/images' folder. access images in code follows. "#large": { image: 'images/large.png', height: ti.ui.size, width: ti.ui.fill } "#large[platform=android]": { image: '../../images/large.png' }

lua - TCP load balancing and rerouting based on first few bytes -

i have made game clients connect central server tcp connection. in first 6 bytes send version number "00.00.01" of client protocol. based on version want route/proxy tcp connection different servers different version of game running. basically client-1 version 00.00.01 should connect server-1 , client 2 version 00.00.02 should connect server-2 for load balancing checked haproxy lua support couldn't find solution. kind of solution exist in nginx? what best practices around? why not have game know hostname connect to? can use dns , virtual hosting manage physical machine ends mapping to.

Android studio get time from my timer, in order to get distance -

i have created timer, , works well. , wanna use timer, lets say, every 5 seconds, location of user. , test if method works or not. put oxy++ (field in mainactivity) in it, , see if runs in every 5secs. , got problem. public class mapsactivity extends baseactivity /*implements locationlistener*/{ int oxy = 0; private int isreset = 1; private textview texttimer; private button startbutton; private button pausebutton; private button resetbutton; private long starttime = 0l; private handler myhandler = new handler(); long timeinmillies = 0l; long timeswap = 0l; long finaltime = 0l; private string[] navmenutitles; private typedarray navmenuicons; private googlemap mmap; private button testbtn; double x; double y; double j; double k; float dis; textview txt; location locationa; location locationb; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maps); setupmapifneeded(); texttimer ...

node.js - How to add dependency to package.json later -

in application have installed few node modules using below command npm install <modulename> i forgot mention "--save" save dependency list package.json file. now update dependencies in package.json file without updating file manually . idea how can done ? you can run same command again, specifying --save flag , automatically included in package.json . problem version of package can updated newer version, may specify specific version of app: npm --save app@1.0.1 . alternatively can modify package.json include dependency: "dependencies": { "module: "*" }

php - Replace all dot only in string, but not in numeric values -

i want replace occurrence of dot (.) in string not digits or numeric value. have given example string : 10.10.2015 11.30 09/2007 83 hello.how.are.you $.### output : 10.10.2015 11.30 09/2007 83 hello how $ ### i tried using preg_replace in php use non-capturing lookbehind group test if previous character digit or not $string = '10.10.2015 11.30 09/2007 83 hello.how.are.you $.###'; $result = preg_replace('/(?<=[^\d])\./', ' ', $string); var_dump($result); explanation (?<=[^\d])\. -------- -- ^ ^ | | | ------------------ escape `.` we're working literal | dot rather "any character" | ----------------------- preceding non-digit character don't include in replace group

rest - Creating Simple MVC based Web Application using Node.js -

i beginner in node.js , wanted make small mvc based web app using node.js have decent knowledge of mvc model. can please give me resource link/reference gives step step explanation new node.js. thank you. you need understand 3w (what-why-when) using mvc in app. example - folder web app in nodejs : build complete mvc website expressjs in here , example here /public /images /javascripts /stylesheets /routes /index.js /user.js /views /index.hjs /app.js /package.json another instruction mvc detail in nodejs mvc web framework node.js designed make express easier use. can see in here

math - instancing modules verilog -

i have created 2 verilog modules instance in third module. inputs of third module feed first, , outputs of first inputs of second module , outputs of second module outputs of overall module, if show example of how in generic manner appreciated. art it's easy this: module 1 (input i, output o); assign o = i; endmodule module 2 (input i, output o); assign o = i; endmodule module top (input i, output o); wire w; 1 inst1 (.i(i), .o(w)); 2 inst2 (.i(w), .o(o)); endmodule http://www.edaplayground.com/x/2mca by default, inputs , outputs wires. can connect them straight module inputs , outputs. need 1 or more internal wires internal connection(s).

oracle - Sum Listagg in a query -

i trying sum values listagg query made. expected result should this select legal_entity_id, sum(0 + 0 + 0 + 1) grandtotals v_vba_ddcr_main legal_entity_id=6012346 , rownum=1 group legal_entity_id | legal_entity_id | grandtotals 1| 6012346 | 1 my listagg goes select listagg(nvl2(fldnm,0,1) , '+ ') within group (order fldnm) le_merge_ddc_mapping the purpose of query count number of null fields in row. created table containing list of fields needs checked null values. result : fld1 + fld2 + fld3 + fld4 = 0 + 0 + 0 + 1 so wrote query this: select legal_entity_id, sum(select listagg(nvl2(fldnm,0,1) , '+ ') within group (order fldnm) le_merge_ddc_mapping) grandtotals v_vba_ddcr_main legal_entity_id=6000132 group legal_entity_id however, getting error ora-00936: missing expression. not sure if oracle allows sum of listagg function. appreciated. your select listagg(nvl2(fldnm,0,1) , '+ ')... query strin...

javascript - Looping through JSON to place markers on a Google map -

i trying generate google map using jquery , javascript. values latitude , longitude stored in json file. when user clicks state name needs generated. the problem code graph getting genrated index[0] . loop not working appropriately. graph new york generated points nepal rather new york. here code: for (var in data.universitylist) { var lat = data.universitylist[i].lat; var lng = data.universitylist[i].lng; var map = new google.maps.map(document.getelementbyid('map'), { center: { lat: lat, lng: lng }, scrollwheel: false, zoom: 8 }); var marker = new google.maps.marker({ map: map, position: { lat: lat, lng: lng }, title: 'hello world!' }); }; the json file: var data = { "universitylist": [{ "name": "columbia university", "city": "new york", ...