Posts

Showing posts from April, 2014

cassandra - Slicing over partition rows using tuple operation in CQL -

i trying understand behavior of tuple operator clustering keys. here trying do: create table sampletable (a int,b int,c int, d int, e int, primary key((a,b,c),d,e)); insert sampletable(a,b,c,d,e) values(1,1,1,1,1); insert sampletable(a,b,c,d,e) values(1,1,1,1,1); insert sampletable(a,b,c,d,e) values(1,1,1,1,2); insert sampletable(a,b,c,d,e) values(1,1,2,1,1); insert sampletable(a,b,c,d,e) values(1,1,2,1,2); insert sampletable(a,b,c,d,e) values(1,1,2,2,3); insert sampletable(a,b,c,d,e) values(1,1,2,1,2); insert sampletable(a,b,c,d,e) values(1,1,1,2,3); cqlsh:mapro> select * sampletable; | b | c | d | e ---+---+---+---+--- 1 | 1 | 1 | 1 | 1 1 | 1 | 1 | 1 | 2 1 | 1 | 1 | 2 | 3 1 | 1 | 2 | 1 | 1 1 | 1 | 2 | 1 | 2 1 | 1 | 2 | 2 | 3 (6 rows) -- query1 cqlsh:mapro> select * sampletable a=1 , b=1 , c in (1,2) , (d,e)<(2,3); | b | c | d | e ---+---+---+---+---

c++ - Releasing memory with std::move()? -

says have class standard container: class library{ std::vector<book> books; public: void putonfire(){ books.clear(); } }; the usual way clear container "clear", code not "stl compliant" many containers (by third parties) may not have "clear" method. however, if have move semantics use std::move right? void putonfire(){ auto p = std::move(books); //books cleared when p out of scope } this write generic possible code works not stl container "clear" method. std::move leaves moved-from object in valid unspecified state. in particular might stay way before, while might work implementation of stl, not work third-party containers. (and might break @ point in future when implementation of stl changes due update)

php - Redirect to a homepage cakephp 3 -

i've followed articles tutorial cakephp 3 website , created website http://i.imgur.com/jmh1pwv.png now there add article, delete article , edit article actions. when delete article redirect me http://localhost:8888/test/articles/delete/14 here delete code. public function delete($id) { $this->request->allowmethod(['post', 'delete']); $article = $this->articles->get($id); if ($this->articles->delete($article)) { $this->flash->success(__('the article id: {0} has been deleted.', h($id))); return $this->redirect(['action' => 'index']); } } the same happening add , edit. now stays on blank page( http://i.imgur.com/tdcbxzz.png ). return $this->redirect(['action' => 'index']); line suppose redirect homepage i.e on index in routes.php i've defined route router::connect('/', array('controller&#

Want to Store SQLite Database Permanently -

this question has answer here: is there limit size of sqlite database? 3 answers now, developing 1 web application , create,insert , select every query did javascript , have large size of sqlite database. want store database permanently. when clear browser history entire database loss. now, need solution. there way rectify problem. in advance every database in sqlite consists of 1 or more "pages". within single database, every page same size, different database can have page sizes powers of 2 between 512 , 65536, inclusive. maximum size of database file 2147483646 pages. @ maximum page size of 65536 bytes, translates maximum database size of approximately 1.4e+14 bytes (140 terabytes, or 128 tebibytes, or 140,000 gigabytes or 128,000 gibibytes). this particular upper bound untested since developers not have access hardware capable of reaching lim

Warning: json_encode(): type is unsupported, encoded as null in couchbase -

i have installed couchbase on remote linux machine, , want access on windows using php scripts. using putty on windows 7. my code below: if(extension_loaded('couchbase')) { $cluster = new couchbasecluster('http://23.99.27.188:8091'); $bucket = $cluster->openbucket('beer-sample'); $get = $bucket->get('demo'); echo json_encode($get); } else { echo "error"; } but gives error: warning: json_encode(): type unsupported, encoded null in c:\xampp\htdocs\couchbase\index.php on line 28

asp.net - Best way to run scheduled tasks -

today have built console application running scheduled tasks our asp.net website. think approach bit error prone , difficult maintain. how execute scheduled task (in windows/iis/asp.net environment) update: examples of tasks: sending email email-queue in database removing outdated objects database retrieving stats google adwords , fill table in database. all of tasks (which need scheduled) website kept within website , called special page. wrote simple windows service calls page every often. once page runs returns value. if know there more work done, run page again, right away, otherwise run in little while. has worked me , keeps task logic web code. before writing simple windows service, used windows scheduler call page every x minutes. another convenient way run use monitoring service pingdom . point http check page runs service code. have page return results can used trigger pingdom send alert messages when isn't right.

php - symfony entity form type with related data -

i have created form in symfony2 form type , used entity type user choose his/her address this: $builder->add('sladdress', 'entity', array( 'class' => 'myclass\userbundle\entity\useraddresses', 'property' => 'address', 'label' => 'label.your_addresses_list', 'translation_domain' => 'labels', 'mapped' => false )); i have useraddresses entity has manytoone relation users entity , saves user's addresses. problem remains should sladdress type loads addresses that's owned user?(by default sladdress form field loads of addresses exist in entity) fast way? i found solution , should use 'query_builder' argument of symfony form types this: $builder->add('sladdress', 'entity', array('class' => 'myclass\userbundle\entity\useraddresses', 'property' => 'address', 'label' =>

image processing - How to concatenate 3 histograms on the same graph in Matlab -

Image
i have calculated 3 histograms rgb image using imhist function in matlab, 1 each channel. want plot these histograms on same graph, instance, histogram first (red) channel stretches on x axis 0 255, histogram second channel stretches 256 511, , histogram third channel stretches 512 767. how can this? assuming uint8 precision, each call imhist give 256 x 1 vector, , can concatenate these single 768 x 1 vector. after, call bar histc flag. assuming have image stored in im , this: red = imhist(im(:,:,1)); green = imhist(im(:,:,2)); blue = imhist(im(:,:,3)); h = [red; green; blue]; bar(h, 'histc'); as example, using onion.png image that's part of image processing toolbox: im = imread('onion.png'); this image looks like: using above code plot concatenated histogram produces graph:

android - Go to another activity before inserting from gallery -

maybe asked before couldn't find in question. anyway able insert image gallery. want before inserting image , want go activity , let user add descriptions insert image( instagram when inserting image, when uploading image takes activity insert details) this code: public void opengallery() { // intent gallery = new intent(intent.action_pick, // android.provider.mediastore.images.media.internal_content_uri); //startactivityforresult(gallery, pick_image); intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_get_content); intent.putextra("crop", "true"); intent.putextra("aspectx", 0); intent.putextra("aspecty", 0); intent.putextra("outputx", 200); intent.putextra("outputy", 150); intent.putextra("return-data", true); startactivityforresult( intent.createchooser(intent, &qu

I need access to variables both in php and the page's javascript -

i working on php/javascript web application must perform many calculations using many values input user. there several pages of inputs, , calculations using values input on previous pages everywhere. i have been passing entered values between pages using $_post , , storing them use in serialized class saved $_session variable. 1 obvious way pass values php page use javascript populate page hidden form elements. javascript use data , modify necessary, pass values via post . i may have many such hidden elements, , can't think way slow down pages. there better way store data between pages? cookies? thanks! sh search ajax in google. it's technic helps javascript communicate php. first hard learn syntax watching videos youtube fine.

iphone - Ambiguous use of "value" while implementing UIStepper -

i trying implement simple stepper reflects value onto label. while using "int(sender.value)" getting error "ambiguous use of value" // viewcontroller.swift // stepper // // created prabhu konchada on 19/06/15. // copyright (c) 2015 prabhu. rights reserved. // import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var steppervalue: uilabel! @iboutlet weak var outputlabel: uilabel! override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func steppertap(sender: anyobject) { self.outputlabel.text = string(int(sender.value).description) } } you can follows : @iboutlet var lblstep: uilabel! @ibaction func steppressed(sender: uistepper) { lblstep.text = sender.value.description }

javascript - Animate whole App with AngularJS, not talking about specific element -

i'm new angularjs, trying find best way (the angular way) of animating app, i've been reading th nganimate (i understant basic of how works) not i'm looking for, base case: i have homepage (imagine google landing page brand logo + google image + input search , button, white background). when click search , results div of search moves upper righ, @ same time background fades revealing map covers whole page , shows markers according results. results shown in card container (material design card ui like), card appears if click on each result (from result card or marker). if change search term previous cards dissapear. additional actions make side columns revealed , change disposition of layout too. my whole mess if define single controller each part of app, events in parts changes disposition of other parts of views related app, dont know how organize cases , animations related. hope made myself clear problem. sad part tutorials , guides i've found specific , limit

ios - Error bridging Obj-C code and Swift: method "U" provided by method "Z" conflicts with optional requirement method "X" in protocol "Y" -

the goal incorporate pbjvision , objective-c library capturing photos , videos, swift app. unfortunately, seeing error: objective-c method 'vision:capturedvideo:error:' provided method 'vision(:capturedvideo:error:)' conflicts optional requirement method 'vision(:capturedvideo:error:)' in protocol 'pbjvisiondelegate' here's delegate method triggering error: func vision(vision: pbjvision, capturedvideo: nsdictionary, error: nserror) { println("encountered error during recording \(error)") println("captured video") } it seems problem patched while ago , on new version (i.e., changes mentioned incorporated) , still seeing error. why happening, , how can fix this? it's matter of translating objective-c swift. objective-c declaration looks this: - (void)vision:(pbjvision *)vision capturedphoto:(nullable nsdictionary *)photodict error:(nullable nserror *)error; therefore, match it, declaratio

ios - How do I resize a constrained imageView, inside a table cell, in swift? -

i have table view controller image view, inside prototype cell, has various size/location constraints on it. want setup programatic view constraints but, because cell built , reloaded within "cellforrowatindexpath" function i'm not sure how set (i'm not sure declare original constraints can update .constant when each cell reloaded). for coming across this: solution create iboutlet, within uitableviewcell. then, when cell built, within cellforrowatindexpath, call animation: cell.itemrightspace.constant = 100 cell.item1.layoutifneeded() uiview.animatewithduration(0.75, delay: 0.3, options: nil, animations: { () -> void in cell.progress1rightspace.constant = 0 cell.progress1.layoutifneeded() }) { (isfinished) -> void in }`

php - Google Translate API Text to speech - setting encoding for non-roman characters -

Image
i'm using google translate's unofficial text-to-speech api (i've posted more info on here ). the api endpoint looks like: https://translate.google.com/translate_tts?ie=utf-8&tl=en&q=hello%20world making traditional api requests words, no-access-control-origin , 404 blocks. around this, i've followed the php script in blog strips out referrer before making request (more info on attempts here ). i'm able english work, need work chinese. unfortunately, when pass in 你好, voice seems narrate gibberish. however, if add directly browser, narrates perfectly. https://translate.google.com/translate_tts?ie=utf-8&tl=zh-cn&q=你好 html : <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <audio controls="controls" autoplay="autoplay" style="display:none;"> <source src=&

main - Is there any difference between String... args and String[] args in Java? -

this question has answer here: difference fn(string… args) vs fn(string[] args) 6 answers what difference between string... args , string[] args in java? i'm new java programming. can plz tell me what's difference between ( string....args ) & ( string [] args ) if i'll use first 1 in place of second........does make difference? string... args declare method expects variable number of string arguments. number of arguments can @ all: including zero. string[] args , equivalent string args[] declare method expects 1 argument: array of strings. one difference might not spring out observations in second case (but not first) caller may have reference array. in both cases method works args array of strings, if things swap array elements not visible caller if string... args form used. if have void x(string...args) method, can call x(&qu

math - Parametric Equation of a Circle in VB.NET -

private sub autoset(angle integer, radius double) dim degrees integer = angle * (math.pi / 180) 'radius strength of shot * 4, due aiming circle being ~400 pixels dim setx double = (radius * 4) * (math.cos(angle)) dim sety double = (radius * 4) * (math.cos(angle)) 'dim sety double = (radius * 4) * (math.sin(angle)) 'center tank dim tankx double = tankicon.location.x '- 10 dim tanky double = tankicon.location.y '- 5 dim clickx integer = tankx + setx dim clicky integer = tanky - sety graphics.fromimage(mainimageframe.image).fillrectangle(brushes.blue, clickx, clicky, 10, 10) mainimageframe.refresh() metrolabel3.text = setx metrolabel4.text = sety end sub private sub metrobutton1_click(sender object, e eventargs) handles metrobutton1.click autoset(angletrackbar.value, powertrackbar.value) end sub since i'm not allowed post screen shot, here link screenshot of actual code: http://i.imgur.com/af

MATLAB, extracting and saving values in a vector between 0 and 5, then 5 and 10, and so on -

i have column vector of values between 0 , 180. i'm looking way extract values columns between 0 , 5, values between 5 , 10 , on 180, , save these cell array. i'm aware can use sort of technique: range = data(5 <= data & data <= 10) but seems little long winded write out each range the straightforward approach wrap code loop, this: maxvalue = 180; data = randperm(maxvalue); %//some dummy data binsize = 5; numbins = maxvalue / binsize; ranges = cell(1, numbins); = 1:numbins ranges{i} = data(binsize * (i - 1) <= data & data <= binsize * i); end

linux - Trying to use awk to print a column but says print not found -

so trying homework , having lot of issues. first script have written in unix/linux. right trying print out few columns free command , use awk grab columns need. every time try this, bash: print command not found. command trying use: free | awk `{print $3}` i have tried without {}. so when finished example: total free memory: xx mb xx filled in of course result. any appreciated. thanks. update: okay don't use backticks work. whole command end saying: total free memory: xx mb the command have far is: echo "current free memory: " | free -m | awk '{print $3}' i want 1 column row intersection. you should go field 4. suggest using awk , sed you. here suggestion : freem="$(free -m | awk '{print $4}' | sed -n '2p')" echo "total free memory: $freem mb" where $4 columns want , 2p line want. before writing script, check result in command line.

php - recursive function inside for loop -

i m trying create html in controller instead of js. there array unknown depth of arrays. $tree = $repo->childrenhierarchy(); and function reads array , returns string of html values array elements. public function recursive($tree) { $html = ""; foreach ($tree $t) { $html = $html . '<li> <span><i class="fa fa-lg fa-minus-circle"></i>' . $t['title'] . '</span>'; if ($t['__children'] != null) { $html = $html . '<ul>'; $this->recursive($t['__children']); $html = $html . '</ul>'; } else { $html = $html . '</li>'; } return $html; } my problem cant hold total string because everytime function calls var html initialised, need hold string global cant figure how. there shouldnt wrong storing v

java - I need help passing an array and calling basic methods on it -

i'm new programming , java, , i'm trying write simple bubble sorting algorithm. might in bit on head; i'm not far along in oracle's java tutorials. trouble i'm having isn't bubble sorting itself, in creating array , printing before sorted. here have far: public class bubblesort { public bubblesort(int size) { // creates array int[] items = new int[size]; } public void fillarray(int[] a) { // fill array random ints (int i=0; i<(a.length-1); i++) { a[i] = java.util.random.nextint(50); } } public void printarray(int[] a) { (int i=0; i<a.length; i++) { system.out.print(a[i] + " "); } } public void bubblesortalgorithm() { // bubble sorting algorithm goes here } public static void main(string[] args) { bubblesort bubblesort = new bubblesort(20); bubblesort.fillarray(items); bubblesort.pr

java.lang.ClassNotFoundException: org.opensaml.DefaultBootstrap -

i using opensaml authenticate saml response identity provider (idp). first step, converting dom response idp opensaml xmlobject. using following code: base64 base64 = new base64(); byte[] base64decodedresponse = base64.decode(responsemessage); bytearrayinputstream = new bytearrayinputstream(base64decodedresponse); documentbuilderfactory documentbuilderfactory = documentbuilderfactory.newinstance(); documentbuilderfactory.setnamespaceaware(true); documentbuilder docbuilder = documentbuilderfactory.newdocumentbuilder(); document document = docbuilder.parse(is); element element = document.getdocumentelement(); unmarshallerfactory unmarshallerfactory = configuration.getunmarshallerfactory(); unmarshaller unmarshaller = unmarshallerfactory.getunmarshaller(element); if (unmarshaller == null) throw new illegalstateexception("could not obtain saml unmarshaller"); xmlobject obj = unmarshaller.unmarshall(element); if (obj == null || !(obj instanceof response)) throw

sqlplus - Installing rlwrap on linux - without root permission -

i trying install rlwrap. not have root permissions. i did following install rlwrap using steps mentioned online : gunzip rlwrap*.gz tar -xvf rlwrap*.tar cd rlwrap ./configure make make check make install but in last step when "make install", error /usr/bin/install: cannot create regular file `/usr/local/bin/rlwrap': read-only file system make[2]: *** [install-binprograms] error 1 i tried "sudo make install", still same error. what options install rlwrap? thanks in order install without root permissions, need configure follows: ./configure --prefix=$home after 'make install' install rlwrap in $home/bin (above info install file in root folder of rlwrap)

How to drop a collection in MongoDB? -

what best way drop collection in mongodb? i using following: db.collection.drop() as described in the manual : db.collection.drop() removes collection database. method removes indexes associated dropped collection. method provides wrapper around drop command. but how can drop command line? so either of these valid ways it: mongo <dbname> --eval 'db.<collection>.drop()' db.<collection>.drop() this way tested it, creating database mytest collection hello . create db mytest : > use mytest switched db mytest create collection hello : > db.createcollection("hello") { "ok" : 1 } show collections there: > db.getcollectionnames() [ "hello", "system.indexes" ] insert dummy data: > db.hello.insert({'a':'b'}) writeresult({ "ninserted" : 1 }) make sure inserted: > db.hello.find() { "_id" : objectid("55849b22317df91fe

javascript - Stop Progress Bar After 10 seconds | CPU % 80 -

i have progress bar , increase value 0 100% in 10 seconds. want stop every process after 10 seconds. when uncomment below code cpu going 80% - 90%. think after 100% still works. var start = new date(); var maxtime = 10000; var maxtimesec = 10; var timeoutval = math.floor( maxtime/100 ); animateupdate(); function updateprogress(percentage, second) { $('#timerprogress').css("width", percentage + "%"); $('#timercountdown').text(percentage + "%" + second + "sec"); } function islogined(){ userid = $("#userinfo").attr("data-user") ; userid = parseint(userid); var logined = false; if(userid > 0){ logined = true; } return logined; } function animateupdate() { var = new date(); var timediff = now.gettime() - start.gettime(); var sec = maxtimesec - math.round( (tim

sql/sybase varchar length -

so trying make code document. if put 01234567890 , 1234567890 on table, should stay there. when put 12345667890 , table, number different like: 1234566789 (the 0 gone!) plus length must 11. if can me/understand me, thank you. create table doctors( fullname varchar(35) not null, document varchar(11) not null, salary bigint null, homeaddress varchar(35) null, phone bigint not null, cellphone bigint not null, speciality varchar(20) not null, birthdate date not null, gradedate date not null, workingdate date not null, constraint pk primary key (document) , check(document between '0' , '99999999999'), constraint validcellphone check (cellphone between 3000000000 , 3029999999 or cellphone between 3100000000 , 3129999999 or cellphone between 3150000000 , 3169999999), constraint validspeciality check (speciality in('medicina general','ginecologia','traumatologia','pediatria')),

Long Android TextView pushes other views off-screen -

i've got 2 textviews side-by-side. textview1 has varying length of text, , textview2 says "+#". when textview1 gets long however, pushes textview2 off screen. ideas how fix this? here's layout code: <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleline="true" android:ellipsize="end" android:textsize="13sp"/> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleline="true" android

javascript - Can anyone help me to use the enter key to execute this program? -

i have created small program pulls youtube api allows search random video whatever title enter when prompted. have working except, able hit enter key on keyboard run search. assume fix simple onkeydown event, have tried implement few ways , seems break every time. i'm not sure if because way calling onclicklistener or what. appreciated. $('#searchterm').keydown(function(e){ if(e.keycode == 13){ search(); } });

scala - Spark implicit RDD conversion doesn't work -

i have seems similar issue spark sorting of delimited data , accepted solution not resolve issue me. i'm trying apply combinebykey on simple rdd: package foo import org.apache.spark._ import org.apache.spark.sparkconf import org.apache.spark.sparkcontext._ object hellotest { def main(args: array[string]) { val sparkconf = new sparkconf().setappname("test") val sc = new sparkcontext(sparkconf) val input = sc.textfile("/path/to/test.txt") val result = input.combinebykey( (v) => (v, 1), (acc: (int, int), v) => (acc._1 + v, acc._2 + 1), (acc1: (int, int), acc2: (int, int)) => (acc1._1 + acc2._1, acc1._2 + acc2._2) ).map{ case (key, value) => (key, value._1 / value._2.tofloat) } result.collectasmap().map(println(_)) sc.stop() } } i (unique) following error while compiling: $ scalac -cp /path/to/scala-2.10/spark-

javascript - react-router link not receiving router in context -

i'm using react , react-router create single page javascript application. each page it's own component. on 1 page able create link component , works intended. on page following error: warning: failed context types: required context `router` not specified in `link`. uncaught typeerror: cannot read property 'makehref' of undefined here file set routes: http://pastebin.com/wben9bzw here component link works (in teamrow component): http://pastebin.com/hjg2d43m here component link doesn't work (line 31): http://pastebin.com/pwb7j8mk i logged contexts throughout app examine them , time isn't empty object in app component. doing wrong in teampage component link isn't working? how come context empty in homepage component link works? try changing require to // remove react-router require var {link} = require('react-router'); or // keep react-router require var link = reactrouter.link;

Streaming output (mp3) from a javax/jetty servlet -

i've found few examples jersey: jersey rest support resume/media streaming but need example how stream audio jetty servlet. i've tried writing file raw response, , while play browser, can't seek, or skip middle of song. i think have use http range header somehow, not sure how.

How does iOS and Xcode link custom frameworks -

i have project includes custom frameworks, these custom frameworks include custom frameworks. here's sample structure, bullets included frameworks: app frameworka frameworkb frameworkc frameworka frameworkc frameworkb frameworkc since frameworka , frameworkb link frameworkc, along app using frameworks a, b, , c; linked or framework copied in multiple places? does increase size of app? in example frameworkc has assets, if it's copied multiple times wouldn't unnecessarily duplicate data? or there better way? ios frameworks collection of header files , fat static archive library. ios not support frameworks containing shared libraries. a fat static archive library collection of multi-architecture object files, object files can extracted needed linker create executable artifact. ios executables self contained executables (except system libraries shared objects). fat archives can examined lipo. cd frameworka.framework lipo -info fram

javascript - jasvascript call functions from different scripts -

i have 2 different script tags,can call function second..like this <script> var = something; . . . <td onclick="myfunc("+something+")"></td> </script> <script> function myfunc(data){..} </script> yes, can. functions @ global level. here example: <script type="text/javascript"> function hi() { alert('hi'); } </script> <script type="text/javascript"> hi(); </script> this indeed result in popup "hi". jsfiddle: http://jsfiddle.net/we8pb7md/

boost - How to get a general function pointer as a private member of a C++ class? -

in game i'm making, there triggers. when trigger collides anything, happen; if door trigger, player moved new area. if it's explosion trigger, , explosion happens. chair trigger may make player sit down. i don't want subclass each , every trigger. each 1 shares enough important info, , each activate using common interface. difference between them routine called on collision. the problem functions may have differing signatures. for example, move player function requires few things. void move_player(environment *new_env, player *player, int new_x, int new_y) but explosion trigger may be void explode() i need class accepts move_player , explode . here's think pseudo code should like class trigger { public: trigger(function_pointer f) { fp = f; } void activate() { fp(); } private: func_pointer fp; } i thinking initializing/using this. auto f = std::bind(move_player, new_environment, my_player, 0, 0); trigger tigger

css - Bootstrap NavBar non-collapsable input field -

Image
i have nav bar input field , couple links want links collapsed. i'm trying work few hours no success. it doesn't stay on single row what want this desktop | [brand name] [input field___________________________(search)] [button] [button] | mobile | [brand name] [input field (search)] [#] | |---------------------------------------------| | button | | button | http://www.bootply.com/g1jjxemqa0# another atempt http://www.bootply.com/n3raobttyd take @ this: https://jsfiddle.net/9l3b08zf/ if change size of result grid, see how link jump form side bottom. i have used bootstrap grid achieve this. <div class="row"> <div class="col-md-6 search"> <form class="navbar-form" role="search" method="get" id="search-form" name="search-form"> <div class="input-group&qu

osx - kevent & USB serial ports -

i'm having trouble using kevent on mac usb serial console. i've narrowed down to: #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <sys/event.h> #include <sys/ioctl.h> #include <termios.h> #define device "/dev/cu.usbserial-0011111d" int main() { int kqueue_fd = kqueue(); if (kqueue_fd < 0) { printf("failed open kqueue\n"); return -1; } int device_fd = open(device, o_rdwr | o_nonblock | o_noctty); if (device_fd < 0) { printf("failed open device: %s\n", device); return -1; } printf("opened %d\n", device_fd); enum { max_events = 1 }; struct kevent events[max_events]; ev_set(&events[0], device_fd, evfilt_read, ev_add, 0, 0, null); int r = kevent(kqueue_fd, events, 1, null

php - Laravel - Guzzle not returning any data even though URL is correct -

i trying return json data third party api - http://postcodes.io/ . have in controller: $client = new client(); $request = $client ->get('https://api.postcodes.io/postcodes/'.input::get('postcode')); $statuscode = $request->getstatuscode(); if ($statuscode >= 200 && $statuscode < 300) { $json = response::json($request); // returns json decoded array of data. } i'm trying return postcode information such: https://api.postcodes.io/postcodes/ox495nu if dd($request) , printed out, 200 status code no data associated it: jsonresponse {#245 ▼ #jsonoptions: 0 #data: "{}" #callback: null #encodingoptions: 15 +headers: responseheaderbag {#242 ▶} #content: "{}" #version: "1.0" #statuscode: 200 #statustext: "ok" #charset: null } any why happening appreciated. what seeing raw response guzzle , needs formatted. simple way $response->

php - I can't get to the success block of my jquery function -

i little stuck on jquery function below. here situation: 1) php returns valid json - can test when change $_post $_get , manually pass through data url. 2) function below works correctly right $.ajax part. 3) function returns ready state 0 let me know if need anymore data. days of going on stack overflow , other forums has helped insight, can not seem fix in instance. //html <form class="login-form" method="post"> <input type="text" id="name" name="name" value="" placeholder="username" required="yes"> <input type="password" id="pwd" name="pwd" value="" placeholder="password" required="yes"> <input type="submit" id="login" name="login" value="login" class="loginbutton" > </form> //javascript $('#login')

c# - Remove Duplicate XML Records -

i wanted remove duplicate records in xml far unable unsure of how can go doing this, here xml , can see there 4 duplicate records. want remove itemgrp node due having same rateclass element in itemgrp node <?xml version="1.0" encoding="utf-8" ?> <fare_1 xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <fare_1_details xmlns="http://xml.someplace"> <itemgrp> <itemnb> <itemnumberdetails> <number>01</number> </itemnumberdetails> </itemnb> <farequalifitem> <additionalfaredetails> <rateclass>dt21p</rateclass> </additionalfaredetails> <discountdetails> <farequalifier>725</farequalifier> </discountdetails> </farequalifitem> </itemgrp> <itemgrp> <itemnb> <itemnumberdetails&g

java - ClassNotFoundException: EnvironmentCapable -

any suggestions how resolve spring mvc error? error configuring application listener of classerror configuring application listener of class org.springframework.web.context.contextloaderlistener java.lang.noclassdeffounderror: org/springframework/core/env/environmentcapable @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(classloader.java:631) @ java.lang.classloader.defineclass(classloader.java:615) @ java.security.secureclassloader.defineclass(secureclassloader.java:141) @ org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:2733) //[redacted trace] caused by: java.lang.classnotfoundexception: org.springframework.core.env.environmentcapable @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1645) @ org.apache.catalina.loader.webappclassloader.loadclass(w

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

i have several vm's around world, identical , same python code (and same library version of pika 0.9.13). 1 of them failing because of handshake_timeout: =error report==== 17-jun-2015::12:27:07 === closing amqp connection <0.290.0> (yy.yy.yy.yy:47232 -> xx.xx.xx.xx:5672): {handshake_timeout,handshake} that taken rabbitmq log, in client code see like error:pika.adapters.base_connection:connection xx.xx.xx.xx:5672 failed: timeout unhandled exception in thread started <function listen_for_start_download_message @ 0x1e5bcf8> i have tested connection telnet following guide: http://rubybunny.info/articles/troubleshooting.html i increased handshake_timeout 40000 milliseconds , ssl_handshake_timeout 20000 milliseconds , error persists, ping rabbitmq server machine little bit higher in other machines nothing abnormal (136ms). has found similar problem sometime or can recommend way test rabbitmq connection? i'm not sure if solution problem in case pr

Query keeps giving error Access '13 -

Image
i have query , isnt working correctly, knowledge says should be! erd: table 'meetingen': table 'patienten': the query have: with result running: so, strange thing here is; datum(date) between 5/1/2015 , 5/31/2015 should give persons table 'meetingen' date in may. result is, 'adres', 'postcode' , 'patientnr' 'patienten'. tryed everything... sees it? edit made 1 stupid mistake, m.patientnr = m.patientnr, changed p.patientnr = m.patientnr witch gives following error: between 5/1/2015 , 5/31/2015 should give persons table 'meetingen' date in may that appears case in results. of dates either 5/1/2015 or 5/30/2015 , in selected range. but result is, 'adres', 'postcode' , 'patientnr' 'patienten'. yes, because columns on table. else expect them come from? if columns existed on both tables query result in error indicating couldn't determine colu

ios - How can I get into a row if it is selected in Xcode6.1.1 in -

i'm trying row, when selected of method 'tableview:didselectrowatindexpath:'. specifically, have small dictionary , purpose selected row show details word taken google. prepared class purpose , called definitionviewcontroller. here method wrote purpose: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ definitionviewcontroller *dvc = [[definitionviewcontroller alloc] init]; dvc.word = [self wordatindexpath:indexpath]; [self.navigationcontroller pushviewcontroller:dvc animated:yes]; [dvc release]; } my problem is, doesn't response when clicked on row. however, tried insert alert method, worked perfectly. problem somewhere there, can't figure out is. i'm using xcode 6.1.1, , used storyboard have tableview. hope can me that! problem solved. found on internet,and link here: http://www.techotopia.com/index.php/implementing_ios_8_tableview_navigation_using_storyboards_in_xcode_6_and_swift

asp.net - Why always selectedindexchanged is firing when i click on checklistbox dropdownlist in c#? -

ti have 1 checklistbox dropdownlist firing when click on dropdown.but not selecting of listing in dropdown.how fix that. <asp:dropdowncheckboxes id="ddcbproductstockitem" runat="server" autopostback="true" enableviewstate="true" usebuttons="false" useselectallnode="true" cssclass="form-control" onselectedindexchanged="ddcbproductstockitem_selectedindexchanged"> <style selectboxwidth="200" dropdownboxboxwidth="200" dropdownboxboxheight="130" /> <texts selectboxcaption="select item" /> </asp:dropdowncheckboxes> in cs page, if (!ispostback) { binditem(); } try setting autopostback="false" "autopostback == true && usebuttons == false - no action buttons ( 'ok/cancel' ) displayed, postback occurs whenever user leaves expanded drop down clicking outside it."

dropzone.js isn't starting to transfer files even with autoProcessQueue set to true -

i've set simple dropzone form accept images following settings: <form action="/upload" method="post" class='dropzone' id='assetadd' enctype="multipart/form-data"></form> <script> dropzone.options.assetadd = { uploadmultiple: false, maxfiles: 1, maxfilesize: 10, acceptedfiles: "image/*,*.jpg,*.gif,*.png"}; </script> however while can select image files , when see thumbnail , no errors in javascript console transfer never begins. this mistake cost me 4 productive hours, hope can others end in same trap. problem comes misconfiguration of acceptedfiles , correct configuration should be: acceptedfiles: "image/*,.jpg,.gif,.png" a reference why can seen in source of dopzone (on line #176 ): a file extension starting stop character (u+002e). (e.g.: ".jpg,.png,.doc") ( source ) file extensions must start . , not work wildcard selectors on comm

javascript - Node.JS TCP STUN server not receiving connection from RTCPeerConnection -

i've been doing localized testing on webkitrtcpeerconnection in chrome 43, , running local tcp server in node.js receive stun packets peers. client code (for local testing) follows: // chrome var iceservers = { iceservers: [{ url: "stun:localhost:8080" }] }, optional = { optional: [{ dtlssrtpkeyagreement: true }, { rtpdatachannels: true }] }, peer1 = new webkitrtcpeerconnection(iceservers, optional), peer2 = new webkitrtcpeerconnection(iceservers, optional); peer1.createoffer(function(offer) { peer1.setlocaldescription(offer); peer2.setremotedescription(offer); peer2.createanswer(function(answer) { peer1.setremotedescription(answer); }); }); my node.js tcp socket server meant receive stun packet , log now. tcp stun server outlined in rfc 5389 . here's code it: var net = require('net'), options = { allowhalfopen: true }, port = 8080,

r - How to change levels of a variable that is a factor? -

i have data contains numerical values letters, have j = c( 5 , 6, 7, 6, 7,12 , missing , 6 ,7 8, missing , n/a, n/a, 5, 6) i know saved factor number of levels. wanted change n/a 0 numerical value, don't know how that. have used simple commands not let me, data larger have given can not manually. any appreciated. the gotcha' factors assignment of value position in vector requires value in levels of factor attribute. can augment acceptable values in 'levels' levels<- -function. > j = factor( c( 5 , 6, 7, 6, 7,12 , 'missing' , 6 ,7, 8, 'missing' , 'n/a', 'n/a', 5, 6) # notice corrected code since didn't enclose character values in quotes # ,,,, , seemed missing comma > levels(j) <- c(levels(j), 0) # append levels; keep initial order. > j[j=='n/a'] <- 0 > j [1] 5 6 7 6 7 12 missing 6 [9] 7 8 missing 0 0 5 6

javascript - Angularjs: View not updating list after POST -

i working on small angularjs app user profile management app. the problem having adding users dynamically. when enter user data, post's local server have setup, have refresh page see new user in users list i dont want have refresh. -yes i've tried $scope.apply() after running post function something noticing angular batarang (debugging tool), scope updating fine, there blank spot or 'null' value new user should be. here controllers: usersapp.controller('userlistcontroller', [ '$scope', 'userservice', function($scope, userservice) { $scope.userslist = userservice.userslist; $scope.users = userservice.users; $scope.user = userservice.user; }]); usersapp.controller('addusercontroller', function($scope, $window, dataresources, userservice) { $scope.addnew = function addnew(newuser) { $scope.userslist = userservice.userslist; var firstname = newuser.firstname; var lastname = newuser.lastname; va

excel - Disable Windows Security Certificate verification pop up window in IE while running VBA script -

i have vba code access specified link , and acquires html text calculation purposes using ie9. every time when access link, prompted confirm security certificate clicking "ok" in pop window. i have access link several times, therefore tedious click ok every time. there way automatically without messing ie settings? here code: set obj = createobject("internetexplorer.application") obj.visible = false tempurl = "https://......." obj.navigate tempurl application.wait now() + timevalue("0:00:00") ' wait few seconds while obj.busy = true application.wait now() + timevalue("0:00:01") doevents loop ' set document set item = obj.document application.wait now() + timevalue("0:00:01") ' document text bodyhtml = item.body.innertext obj.application.quit bodyhtml variant. i need automatically accept certificate. there 1 certificate choose from. maybe there way detect

javascript - Update Form Hidden Field Value wit button ID? -

i have bunch of popover buttons open same form. need button id value hidden field inside form. html buttons: <a type="button" class="pop" data-toggle="popover" id="1">button 1</a> <a type="button" class="pop" data-toggle="popover" id="2">button 2</a> <a type="button" class="pop" data-toggle="popover" id="3">button 3</a> ... popover form: <div id="popover-content" class="hide"> <form> <input name="name" type="hidden" value="buttonidvalue"> ... popover js: $('.pop').popover({ html : true, content: function() { return $("#popover-content").html(); } }); you can access element triggered popover this within function bound content . update code be: $('.pop').popover({ h

c# - Memory dump using Ping .net -

i'm trying ping server in windows forms application when program running, have memory dump on computer. very, strange. in method have: private void checkserver() { this.txresponse.text = ""; ipaddress ipadress = ipaddress.parse("anadress"); ping ping = new ping(); pingreply pingtoreply = ping.send(ipadress); if (pingtoreply.status == ipstatus.success) txresponse.text = pingtoreply.status.tostring(); } i don't understand going on. i'm using visual studio 2012 .net framework 4.5 on windows 8.if necessary more information, please let me know. verify parsing of ip address successful; otherwise check surrounding processing outside of checkserver method.

Python how to join cross platform paths -

if have json directory structure lists paths in mac format ()i.e. "/0000_test/video.mp4" , want join c:\\ mac format, there way this? so on windows path returned c:\\0000_test\video.mp4" i have tried os.path.join no avail you can use os.path.join , os.path.normpath >>> os.path.normpath(os.path.join('c:', '/0000_test/video.mp4')) 'c:\\0000_test\\video.mp4' normpath take care of normalizing path in platform specific manner.

php - Bootstrap of Zend Module is not loading -

i new in working zend facing problem past 2 days. have searched lot still can not find solution. possible duplicate of zend module bootstrap not load still can not solve problem. in user module working perfect meaning models dbtables controllers bootstrap. i want add user relevant routes user module bootstrap can add them application bootstrap not want make large file. i have in application/modules/user/bootstrap.php class user_bootstrap extends zend_application_module_bootstrap { protected function _initrouter() { //does not work think should work echo 'joo'; exit; } } as far know bootsrap of modules run every time when run application in case doesn't seems working. update: in application/configs/application.ini: [production] phpsettings.display_startup_errors = 0 phpsettings.display_errors = 0 includepaths.library = application_path "/../library" bootstrap.path = application_path "/bootstrap.php"