Posts

Showing posts from March, 2013

javascript - Last dropdown not working base on previous dropdown -

i have list of dropdowns base off previous one. pull data based on selection of previous selection , populate next dropdown. using same code, reason, not working on last one. here javascript: $(document).ready( function() { $("#order").change(function() { $(this).after('<div id="loader"><img src="img/ajax-loader.gif" alt="loading subcategory" /></div>'); $.get('loadfamilies.php?order=' + $(this).val(), function(data) { $("#family").html(data); $('#loader').slideup(200, function() { $(this).remove(); }); }); }); $("#family").change(function() { $(this).after('<div id="loader"><img src="img/ajax-loader.gif" alt="loading subcategory" /></div>'); $.get('loadsubfamilies.php?family=' + $(this).val(), function(data)...

twitter bootstrap - html modal in javascript -

i'm using display modal. <script> mousetrap.bind('j e f f r e y enter', function() { $('#mymodal').modal('show') }); </script> normally button used. <a data-toggle="modal" class="btn btn-info" href="remote.html" data-target="#mymodal">click me !</a> is there way modal html page , call using javascript? you can send ajax request html code modal, append document. <script> var $modal = undefined; mousetrap.bind('j e f f r e y enter', function() { if($modal === undefined) { $.get('path/to/modal.html', function(data)){ if($modal === undefined) { $modal = $(data); $('body').append($modal); } $modal.modal('show'); }); return; }...

c - Segmentation fault in program using command line arguments -

i'm trying write program finds largest , smallest of 10 numbers. to use program, must use command line argument -l numbers determine largest number, same command -s smallest numbers. however, when don't enter command @ all, , try run program, receive segmentation fault. not sure went wrong. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { int i; int min,max,num; char *argv1 = argv[1]; char *small = "-s"; char *large = "-l"; min=max=0; if (0==strcmp(argv1, small)) { (i=2; i<argc; i++) { num=atoi(argv[i]); if(i==2) { min=num; } else { if(min>num)min=num; } } printf("the smallest number %d\n",min); } else if (0==strcmp(argv1, large)) { (i=2; i<argc; i++) { num=ato...

android - do I need a server for a live chat system on my app -

i need make live chat app. absolutely 100% need server or there way it. i'm on low budget thanks! yes need server develop live chat system. if use apple's default apns (apple push notification service) or google's gcm (google cloud messaging), have use own server send message or notification. have learn or hire develop server side application. nodejs can used develop chat system fast. may try https://www.heroku.com/ testing purpose it's free extent.

Eclipse get method list with subword -

Image
i'm using eclipse method list feature navigation triggered ctrl + o shortcut. in addition, there filter performs exact method name match. can annoying if out property , don't start oder set. can adjusted perform subword matching? performed code recommenders? thank you! i found solution problem on site . being able list method quick outline view contain index, use *index search term.

php - Error running Process in symfony -

i have following simple command: $process = new process("php /users/name/sites/app/app/../bin/console cache:clear --env=prod"); $process->run(); when try run gives me: string(153) " parse error: parse error in /users/name/sites/app/vendor/symfony/symfony/src/symfony/component/dependencyinjection/container.php on line 278 " what wrong? looks using symfony 3.0 has "finally" https://github.com/symfony/symfony/blob/3.0/src/symfony/component/dependencyinjection/container.php#l282 php 5.5 , later has support "finally" in try/catch blocks. http://php.net/manual/en/language.exceptions.php and looks php version less 5.5, upgrade php version > 5.5 , work

mapreduce - CouchDB view - reduce / group duplicate key values to array -

i've got view on couch db, outputs data in format: {"rows":[ {"key":["partner1","voucher type 1"],"value":true}, {"key":["partner1","voucher type 2"],"value":true}, {"key":["partner2","voucher type 1"],"value":true}, {"key":["partner3","voucher type 1"],"value":true}, {"key":["partner4","voucher type 1"],"value":true} ]} what i'm trying 'group' partner | voucher type, in example above, return like: partner1: ["voucher type 1", "voucher type 2"] partner2: ["voucher type 1"] partner3: ["voucher type 1"] partner4: ["voucher type 1"] currently, map reduce functions this: map: function( emit([doc.partnername, doc.vouchertype], 1); } reduce: function(keys, values) { return true; } i'm q...

c - Behavior of program changes depending on where fork is called -

i working on little program getting familliar pipes , file descriptors , spent lot of time debugging problem not make sense. i spent ton of time thinking misunderstood file descriptors when program behaving differently depending on used fork. int main(void) { int fid; int p[2]; pipe(p); char buf[20]; fid = fork(); if (fid==0){ close(p[1]); dup2(p[0],0); close(p[0]); execlp("cat","cat",(char *)null); } else{ close(p[0]); dup2(p[1],1); close(p[1]); execlp("ls","ls",(char *)null); } return 0; } gives me expected output of whats in directory. ls out put gets piped cat. if move fork line above pipe(p); wont output. don't understand why happens? so you're wondering why works: pipe(p); fid = fork(); and doesn't: fid = fork(); pipe(p); the reason pretty straightforward: in first case, process creates pipe, splits 2 (and both processes have access pipe). in second case, process...

java - Having only one of two custom cells (row and section) show ripple ListSelector -

at moment, have listview uses 2 custom xml cells, standard row, , section row break rows categories. both use backgrounds, ripple selection appear, used: android:drawselectorontop="true" but causes unselectable section rows display ripple effect when clicked upon. wish keep ripple effect standard rows, not section rows. possible? thank you. found answer after time. in customlistadpater, part codes checks type row (standard, section) added couple of lines seen below: convertview.setonclicklistener(null); convertview.setonlongclicklistener(null); convertview.setlongclickable(false); so looks like: viewholder maintext = new viewholder(); convertview = minflater.inflate(r.layout.custom_section_row, parent, false); convertview.setonclicklistener(null); convertview.setonlongclicklistener(null); convertview.setlongclickable(false); maintext.textview = (textview) convertview.findviewbyid(r.id.textseparator); maintext.textview.settext("wednesday, 10...

jquery - Incorrect padding when scrolled down -

the logo on page loses correct padding when scrolled down or up? here's site have : element.style { padding-top: 27px; padding-bottom: 27px; } in scrollpage() function in script.js file comment or edit 0 values follow lines: $('.navbar-brand').css({ 'padding-top': 19 + "px", 'padding-bottom': 19 + "px" });

maven - mvn compile: Unable to find package java.lang -

i have maven-compiler-plugin settings below: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> <compilerarguments> <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath> </compilerarguments> </configuration> </plugin> when executing mvn compile , reports unable find package java.lang in classpath or bootclasspath . find java.lang package in /library/java/javavirtualmachines/jdk1.8/contents/home/jre/lib/rt.jar : java/lang/thread$uncaughtexceptionhandler.class java/lang/threadgroup.class java/lang/runnable.class java/lang/thread.class java/lang/ref/finalizer.class java/lang/ref/phantomreference.class java/lang/ref/finalreference.class java/lang/ref/weakre...

google chrome - Sites freeze after win 10 install and no flash -

i have peculiar issue sites facebook, gmail, netflix, hulu hanging up. there 2 issues think might related though can't sure. 1) first videos on youtube, hulu, netflix, etc., hang @ instances. start playing after multiple refreshes, might revert either playing no sound, or not playing @ once paused few minutes. @ first thought due videocard driver issue upgraded driver. have nvidia geforce 610m driver version 10.18.13.6191. did not fix it. 2) shortly after, chrome , firefox experienced issues of freezing on websites, (facebook, gmail, youtube, twitter) @ point flash player kept crashing. after day of rummaging around, uninstalled flash computer , disabled on chrome. although crash errors no longer appear, sites listed above still hang -- in chrome. , forget hulu , netflix. @ end of wits. solution? all happened after installed windows 10 recently. i had such problem google-chrome , solution disabling use hardware acceleration when available in settings.

android - SMS is not getting send -

my sms not getting send , below code , have used code @ 2 places, @ 1 place not going after "sending message" toast , @ other place shows generic failure.kindly help.thanks in advance. string phoneno = "9712930869"; string message = "hi!"; sendsms(phoneno, message); //---sends sms message device--- private void sendsms(string phonenumber, string message) { /* pendingintent pi = pendingintent.getactivity(this, 0,new intent(this, test.class), 0); smsmanager sms = smsmanager.getdefault(); sms.sendtextmessage(phonenumber, null, message, pi, null); */ string sent = "sms_sent"; string delivered = "sms_delivered"; pendingintent sentpi = pendingintent.getbroadcast(this, 0,new intent(sent), 0); pendingintent deliveredpi = pendingintent.getbroadcast(this, 0, new intent(delivered), 0); //---when sms has been sent--- registerreceiver(new broadcastreceiver(){ @override pu...

jQuery .delay does not delay -

how can set html of element, wait 2 seconds, set html else? example: $("div").html("clicked").delay(2000).html("2 seconds have passed"); what happens: div gets "2 seconds have passed" off bat, instead of saying "clicked" 2 seconds, displaying "2 seconds have passed". do need like, .delay(2000, function() { $("div").html("2 seconds have passed"); }) ? live example here: http://jsbin.com/ufayusu/1/edit thanks! $.delay used delay animations in queue, not halt execution. try this: settimeout(function() {       // after 2 seconds }, 2000);

add subitems in listview in android -

i have listvew , add subitem listview code public class mycustomlistview extends activity { /** called when activity first created. */ listview lv; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.custom_list_view); lv=(listview) this.findviewbyid(r.id.lvvv); simpleadapter adapter = new simpleadapter(this,list, r.layout.custom_row_view,new string[] {"pen","color"}, new int[] {r.id.text1, r.id.text3} ); populatelist(); lv.setadapter(adapter); } static final arraylist<hashmap<string,string>> list = new arraylist<hashmap<string,string>>(); private void populatelist() { hashmap<string,string> temp = new hashmap<string,string>(); temp.put("pen","mont blanc"); temp.put("color", "black"); list.add(temp); hashmap<string,string...

c# - Identify the clicked node in the treeview node collection -

i have treeview. composed "i" parent nodes, , "j" child nodes. need identify "i,j" node clicked user. can node text show below, need identify node inside treeview node collection. how can that? private void treeview1_nodemousedoubleclick(object sender, treenodemouseclickeventargs e) { listview1.items.add(e.node.text); } for example: let's have tree 5 parents , each parent has 10 child nodes. click on first child node located in third parent. need receive (i,j) pair in case, (2,0). renan you can use index property of treenode position in treenodecollection . try this: private void treeview1_nodemousedoubleclick(object sender, treenodemouseclickeventargs e) { treenode parent = e.node.parent; string = parent == null ? "no parent" : parent.index; listview1.items.add(string.format("{0}:{1}",i,e.node.index); } note : suppose want show "no parent" when parent null . can handle in case (such ...

How Google Chrome's chrome://tracing implemented? -

is specific x86_* cpu? or applicable all? what library/3rd_party code used make work? finally understood how about://tracing works without digging source code. http://www.chromium.org/developers/how-tos/trace-event-profiling-tool/tracing-event-instrumentation explains more details chrome's tracing. actually manually added instrumentation points inserted source developers. #include <base/debug/trace_event.h> above header contains abstractions ease that.

javascript - Preventing relative require calls from modules in a specific folder -

this sound odd, i'd modules in specific directory able require resources out of node_modules , not other part of application. in specific directory: require('fs') -- should work require('../../something') -- denied require('./another') -- denied is remotely possible in node? you make module that'll act require-proxy: module.exports.require2 = function() { if (arguments[0][0] !== '.') { return require.apply(this, arguments); } else { throw new error('can\'t require relative modules'); } } of course, opt-in developers: var require2 = require('require2'); var fs = require2('fs'); //everything's var fss = require2('./fss'); //throws error kind of similar idea thlorenz's proxyquire .

actionscript 3 - Is there really no interface class available for YouTube Chromless AS3 player? -

looking @ google's youtube api examples find things this: // hold api player instance once initialized. var player:object; var loader:loader = new loader(); loader.contentloaderinfo.addeventlistener(event.init, onloaderinit); loader.load(new urlrequest("http://www.youtube.com/apiplayer?version=3")); // , inside according event handler: player = loader.content; do expect use plain objects relying on dynamic binding, having no syntax highlighting, getting no compiler errors when mistype etc.?! c'mon should have made chromeless player implement simple interface , should have published class type our objects interface. seems didn't. and that's not end of it... function onplayerstatechange(event:event):void { // event.data contains event parameter, new player state trace("player state:", object(event).data); } look @ event examples - casting object data property without compiler error due dynamic binding? sad code. so questi...

How to set Zoom level of generated pdf using abcpdf? -

i exporting image pdf using abcpdf. works fine generated pdf default zoom level not 100%,i.e. around 52.9%. there way set/define default zoom level of pdf, when open pdf, default zoom level should 100%. thanks in advance. setinfo function : to open @ 200% zoom onto current page: thedoc.setinfo(thedoc.root, "/openaction", "[ " + thedoc.page.tostring() +" 0 r /xyz null null 2 ]")

c# - After setting selectedindex, click on control with mouse shows wrong item -

the engineers requested combobox numbers 500 -500 (negative numbers listed @ bottom, not alphabetical). they requested being able type in number in combo jump correct item. problem: type in "44", tab away. click on control mouse , can see "449" selected. here complete code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace combotest { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { (int = 500; > -500; i--) { combobox1.items.add(i.tostring()); } } private void combobox1_leave(object sender, eventargs e) { combobox1.selectedindex = combobox1.findstring...

validation - Implement validator in Eclipse -

i trying implement validation in eclipse. work has many little projects serve customize our product various customers. since there ton of developers trying find way enforce various standards , best practices. for example, have many xml configurations want validate. built-in validators ensure files well-formed , follow schema, add validations such checking java class referenced in xml exists on classpath. example validating java class implementing interface not have object variables (i.e. code needs operate on parameters , not maintain state). it appears there 2 ways add validation. first through builder adds markers. second through stand-alone validation. however, not building anything, , have not found useful tutorials or examples on validation (does not help.eclipse.org being moved , unavailable). when right-click test project , select "validate" message stating there error during validation, , test message not show in problem view. however, there no errors in ecl...

raytracing - obfuscated C++ Translation: float&, two for loops -

i reading hacker news , this article came up. contains raytracer code written on of business card. decided academic challenge translate c++ python, there's few concepts i'm stuck on. first, function comes up: i t(v o,v d,f& t,v& n){...} translated int tracer(vector o, vector d, float& t, vector& n){...} float& mean? know in other places & used == case here? can in c++? second, noticed these 3 lines: for(i k=19;k--;) //for each columns of objects for(i j=9;j--;) //for each line on columns if(g[j]&1<<k){ i know << bit shift, , assume & == . loops 1 loop in other? finally, line: v p(13,13,13); not quite sure does. create class labeled p extends v (vector) defaults of 13,13,13? these dumb questions, want see if can understand , searching didn't come anything. thank in advance! what float& mean? here, & means "reference", argument passed reference. i know in other pla...

Finding PID's of Virtual Machine in openstack -

i working on openstack , want monitor virtual machines cpu usage. want find pids through parent (central) openstack instance. used ps aux | grep and did receive output. want confirm if correct pid. way can check this? or other way find pid's of virtual machine? update. command not work . gives me pid change. not constant. thank you well libvirt has interfaces this. here's python extracts data datastructures you: #!/usr/bin/env python # modules import subprocess import traceback import commands import signal import time import sys import re import os import getopt import pprint try: import libvirt except: print "no libvirt detected" sys.exit(0) xml.dom.minidom import parsestring global instances global virt_conn global tick global virt_exist def virtstats(): global virt_exist global virt_conn global instances cpu_stats = [] if virt_exist == true: if virt_conn == none: print 'failed o...

android - Proguard return with error code 1 proguard.ParseException -

i tried export android project apk, , while building got error on console, cycled through google, didn't find error this: [2013-09-24 18:09:42 - google] proguard returned error code 1. see console [2013-09-24 18:09:42 - google] proguard.parseexception: expecting jar or directory name before '-include' in argument number 3 [2013-09-24 18:09:42 - google] @ proguard.configurationparser.readnextword(configurationparser.java:1133) [2013-09-24 18:09:42 - google] @ proguard.configurationparser.parseclasspathargument(configurationparser.java:249) [2013-09-24 18:09:42 - google] @ proguard.configurationparser.parse(configurationparser.java:130) [2013-09-24 18:09:42 - google] @ proguard.proguard.main(proguard.java:484) and proguard.cfg file: -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep public class * extends android.app.activity...

MySQL: can't insert a record because a foreign key issue -

Image
i have schema when i'm trying add new isp_share record error although isp table has record id=3 what problem? from documentation http://dev.mysql.com/doc/refman/5.0/en/create-table-foreign-keys.html the parent , child tables must use same storage engine..corresponding columns in foreign key , referenced key must have similar data types also check of other tables.

sql - PostgreSQL: Select only the first record per id based on sort order -

for following query need select first record lowest shape_type value (ranges 1 10). if have knowledge on how postgresql, please help. time. select g.geo_id, gs.shape_type schema.geo g join schema.geo_shape gs on (g.geo_id=gs.geo_id) order gs.shape_type asc; postgresql have nice syntax types of queries - distinct on : select distinct on ( expression [, ...] ) keeps first row of each set of rows given expressions evaluate equal. distinct on expressions interpreted using same rules order (see above). note "first row" of each set unpredictable unless order used ensure desired row appears first. so query becomes: select distinct on(g.geo_id) g.geo_id, gs.shape_type schema.geo g join schema.geo_shape gs on (g.geo_id=gs.geo_id) order g.geo_id, gs.shape_type asc; in general ansi-sql syntax (in rdbms window functions , common table expression, switched subquery) be: with cte ( select row_number() over(partition g.ge...

ios - CGRectIntersects ball collision issue (it 'eats' the ball) -

my issue here when use cgrectintersects (rect,rect) ball i'm using ends inside of paddle, being eternally stuck. happens computer paddles, , player paddles. the objective of have paddle reverse ball direction on "y-axis" or "x-axis" depending on hit box hits on paddle. i post methods have tried fixing (none had particularly result). first method tried fix (uncommented parts) using 'hit boxes'. put 3 empty uiimageviews onto each paddle represent top/bottom, , right/left. 'hit boxes' cgrectintersects on different uiimageviews. has been effective far. i have tried use "invisible barriers" reflect ball. these commented out parts under "// invisible barrier method". these worked okay, ball got stuck sometimes, couldn't hit sides / corner of paddle correctly. the original cgrectintersects method. take ball , reflect fine (until @ high-speeds) reflect ball if hit ends of paddle. don't want do. since can't po...

liferay - How to get image using structure and template to get title,small and large image -

i using liferay 6.1.20. structure variable demo_image : type document , media here template code. not fetching uuid or groupid url ! #set ($dllocalservice = $servicelocator.findservice("com.liferay.portlet.documentlibrary.service.dlapplocalservice")) #set ($url = $getterutil.getstring($demo_image.getdata())) #set ($uuid = $getterutil.getstring($httputil.getparameter($url, "uuid", false))) #set ($groupid = $getterutil.getlong($httputil.getparameter($url, "groupid", false))) #set ($imageobj = $dllocalservice.getfileentrybyuuidandgroupid($uuid,$groupid)) #set ($imagesmallid = $imageobj.getsmallimageid()) #set ($imagelargeid = $imageobj.getlargeimageid()) #set ($imagetitle = $imageobj.gettitle()) #set ($imagedescription = $imageobj.getdescription()) #set ($urllargeimage = "/documents/imagelargeid") #set ($urlsmallimage = "/documents/imagesmallid") $imagetitle <a href="$urllargeimage"><img src="$urlsmallimage...

tombstone - standalone compaction in cassandra -

i new cassandra, plz excuse if find question not worthy. i trying test behavior of cassandra(1.2.5) cluster, have set column ttl 1 day. after day able confirm data being not available, want verify standalone compaction happening , cleaning space occupied tombstones when using default tombstone_threshold i.e 20%. so question - how make sure stand alone compaction happening? , there way know how size disk space freed in process. there logs reading compaction type , work done compaction? if insert little data (im talking 5-10 rows) easy track whats going on via sstable2json tool gives 'raw' view of sstable stores. detailed statistics ks/cf use nodetool status can see each node's load . datacenter: datacenter1 ======================= status=up/down |/ state=normal/leaving/joining/moving -- address load tokens owns (effective) host id rack un 127.0.0.1 90.87 kb 256 100.0% a0a2...22ff rack1

c# - how to load .rpt file from specific folder -

i using access database ,and vs2010,i trying load crystal report getting error line ,what wrong server how should write rptdoc.load(server.mappath("c:/users/monika/documents/visual studio 2010/projects/sonorepo/sonorepo/report/patientcrystalreport.rpt")); server code private void viewreport_load(object sender, eventargs e) { reportdocument rptdoc = new reportdocument(); patientdataset ds = new patientdataset(); // .xsd file name datatable dt = new datatable(); // set name of data table dt.tablename = "patient crystal report "; dt = getallpatients(); //this function located below function ds.tables[0].merge(dt); //getting error here // .rpt file path below rptdoc.load(server.mappath("c:/users/monika/documents/visual studio 2010/projects/sonorepo/sonorepo/report/patientcrystalreport.rpt")); //set dataset r...

php - Mageto - Filter Category Navigation in tree like state -

i created code filter product collection categories. making own left side block using following code. i have work perfect filtering, having hard time rendering display. the level 2 categories work fine , show top level category 1 top level category 2 once selected shows sub categories , sub categories.. sub category of 1 sub sub category of ^^^ sub sub category of ^^^ sub sub category of ^^^ sub sub sub category of ^^^ sub category of 1 sub sub category of ^^^ sub sub category of ^^^ sub sub category of ^^^ sub sub sub category of ^^^ i need break down first level did. best method? <?php $root_category_id = mage::app()->getstore()->getrootcategoryid(); $filtercategoryid = mage::app()->getrequest()->getparam('cat'); $products = mage::getsingleton('catalogsearch/advanced')->getproductcollection(); $catids = array(); if (isset($products)) foreach ($pro...

android - Generate number of Edit Text by storing andretrieve each value -

i want generate number of edittext column wise store , retrieve each value . anyone can me ? i hope may resolve problem. edittext[] etxt = new edittext[size]; edittext et; //generate , set values for(int i=0;i<size;i++) { et = new edittext(this); et.settext(""+i) et.setid(i); etxt[i] = et; //add item view //yourview.addview(etxt[i]); } need add view //get values for(int s=0;s<etxt.lenght;s++) { etxt[s] = et; log.i("test","value: "+etxt[i].gettext().tostring()); }

javascript - Issue with jQuery hide() using Firefox -

i have problem hide() function on page making. @ moment, selected div layer not hiding. it works fine in safari , chrome, unfortunately not in firefox :-( the page here in context: http://www.upreach.org.uk/undergraduates/partners.php , here's code: $(document).ready(function(){ $('div.partner-employers').not('div#start').hide(); $("a.employers").click(function(){ $("a.employers").css("font-weight", "normal"); $(this).css("font-weight", "bold"); var myelement2 = $(this).attr("href") $(myelement2).fadein("fast"); event.preventdefault(); $(".partner-employers:visible").not(myelement2).hide(); }); }); ...and html: <a href="#1" class="employers">1</a><br/> <a href="#2" class="employers">2</a><br/...

ruby - Rails: Outputting translation in link_to() method -

so have link_to method requires body argument populated translated material. for example: link_to('translated material', '/dashboard') i have set in en.yml (for example) has: en: dashboard: 'dashboard' and in typical situation need translation do, example, this: <%= t :dashboard %> this works great. however, how place link_to() method so: link_to(*insert :dashboard translated text here*, '/dashboard') i'm sure it's simple formatting, still learning nuances of ror! just put together: link_to(t('dashboard'), dashboard_path) btw. preferred use named routes. not use strings urls.

this - Merging javascript callbacks, soundmanager2 and waveform.js -

i'm attempting build audio player using soundmanager2, soundcloud stream, , waveform.js ( http://waveformjs.org/ ). player working, trying callback waveform.js run along side own callbacks (to update time etc) proving more difficult. waveform.js provides method returns object containing callbacks soundmanager2's whileplaying , whileloading objects. can merge in, removes own callbacks. i have tried call waveform.js callback functions directly, whileplaying: function(){ waveformobj.optionsforsyncedstream().whileplaying; updatetime(); } but gives errors along lines of canvas: attempt set strokestyle or fillstyle value neither string, canvasgradient, or canvaspattern ignored. this.context.fillstyle = this.innercolor; generated within method of waveform.js. i'm guessing resolution of this have tried using .apply no avail. any advice on getting going appreciated. update when soundmanager object created, takes number of options, of callbacks ...

Can I build an array using a loop in Ruby? -

i started learning ruby/rails, , trying write program builds array, formats new array. it works second while , and, if have array built, second part works well. there leaving out? chap = [] page = [] linewidth = 80 x = 0 n = chap.length.to_i puts 'chapter?' chapter = gets.chomp while chapter != '' chap.push chapter puts 'page?' pg = gets.chomp page.push pg puts 'chapter?' chapter = gets.chomp end puts ('table of contents').center linewidth puts '' while x < n puts ('chapter ' + (x+1).to_s + ' ' + chap[x]).ljust(linewidth/2) +(' page ' + page[x]).rjust(linewidth/2) x = x + 1 end thanks help! simple pilot error: called n = chap.length.to_i too early. have length of chap list after put things in it. move line here: ... puts 'chapter?' chapter = gets.chomp end n = chap.length.to_i puts ('table of contents').center linewidth and works fine....

c# - Are SqlDataSource wild cards pageable -

i using visual studio 2010, c#, sqldatasource . have database of different types of recipes. have encountered problem when use where clause wildcards. i can query database , display recipes in pageable , sortable gridview or listview if use standard query select * postedrecipes the problem happens when use wildcard query such select recipename postedrecipes recipename '%' + @recipename + '%' group recipename if database has 100 recipes 30 sandwich recipes, example, , search on "sand" 30 sandwich recipes displayed. if page size set 30, , there 30 sandwich recipes, 30 recipes displayed, not sortable. the problem not in getting where wildcards work, rather having results pageable , sortable. if page size changed 10, 10 sandwich recipes displayed indicator there 2 more pages available. if 2nd or 3rd page clicked, page blank. if "sort" clicked, page returns blank. using visual studio, not necessary me add code behind above re...

java - XPathExpressionException on xpath -

i'm tring data these xml : <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.alternative.thy.com/" xmlns:req="http://www.thy.com/ws/requestheader" xmlns:ns="http://www.opentravel.org/ota/2003/05"> <soapenv:header/> <soapenv:body> <ser:gs> <!--optional:--> <requestheader> <!--optional:--> <req:clientcode>kl7mu</req:clientcode> <!--optional:--> <req:clientusername>blabla</req:clientusername> </requestheader> </ser:gs> </soapenv:body> to clientusername write soapmessage message = context.getmessage(); outputstream os = new bytearrayoutputstream(); message.writeto(os); string xpath = "////requestheader/req:clientusername"; xpath xpath = xpathfactory.newinst...

objective c - Add Subview to MKCircleRenderer, iOS 7 -

in ios 6 used add uiimageview mkcircleview , animate in way: uiimage* img = [uiimage imagenamed:@"orangecircle.png"]; imageview = [[uiimageview alloc] initwithimage:img]; imageview.frame = cgrectmake(0, 0, 0, 0); imageview.alpha=0.7f; [self addsubview:imageview]; since mkcircleview has been deprecated, using mkcirclerenderer can't add anymore subview . is there way add uiimageview mkcirclerenderer ?

php - Moving wordpress from server to localhost -

i have followed second procedure described in article move wordpress installation server localhost, start using git. browsed localhost got lots of errors, started fixing them , right whenever visit local site url redirects me localhost/wordpress-website-bouwen giving me object not found page. have got idea why happens? should error? hey remember running this. check out link, should solve problems - search , replace 2 basically, wordpress saves many of references images, links etc in db. result, when migrate database on new host (be locally or otherwise), wordpress going reference web url stored in database. what search , replace asks current standard url , asks put in new one. example if on site gimmemychicken.com , move locally want put gimmemychicken.com in current url , in new url input, put localhost . all have take search , replace file -> place somewhere in directory -> navigate in browser -> , fill out required info. as side note: after sr2 run...

excel - Macro to Change Dates and Generate Spreadsheet on Website -

there website routinely use generate spreadsheet. items on website "start date" field, "end date" field, , "go" button. after enter date range , click "go" downloads .cfm file, click open excel, excel warns file has different extension , verifies it's not corrupted , click open , have data need , there have macro maniupulate needed. i'm looking automate steps: go website change start date change end date click go click open file agree open different extension the macro i've used before data website copies , pastes data visible on specific url , follows. manipulate url on input spreadsheet manipulate data. dim addws worksheet set addws = sheets.add(before:=sheets("input")) addws.name = "website data" dim myurl string myurl = worksheets("input").range("g4") worksheets("website data").querytables.add(connection:= _ "url;" & myurl, _ destination:=range(...

Why I can't create a class named "Case" on PHP -

class case { // class body } it's because "case" word reserved switch statement? workarounds? ideas? because case reserved word . reserved words can not used constants, function names, class names , etc. try avoid that.

css - Why does bootstrap use translate3d for their .nav-collapse -

a recent ios 7.0 bug resulted in nav menu not showing... has lead me question. why bootstrap use translate3d on mobile styles collapsable menu? @media (max-width: 480px) { .nav-collapse { -webkit-transform: translate3d(0, 0, 0); } } i had override menu show on ios7. @media (max-width: 480px) { .nav-collapse { -webkit-transform: none; } } this forces element rendered on separate compositing layer in gpu, making animations faster. for more information, see here

egl - Apportable - How do I run OpenGL on a background thread? -

i of rendering on background thread. currently, have working on ios using caeagllayer in uiview subclass, , doing of opengl spin-up on background thread (including binding layer via...: [context renderbufferstorage:gl_renderbuffer fromdrawable:layer]; ...) however, when try on android, apportable compatibility layer triggers errors in egl because trying use egl surface thread...: 09-24 12:25:04.667 2622-2661/com.apportable.spin e/eglhelper﹕ eglswapbuffers returned 12301. tid=1535 09-24 12:25:04.677 2622-2661/com.apportable.spin w/adreno200-egl﹕ <qegldrvapi_eglswapbuffers:3415>: egl_bad_surface how can rendering on bg thread? there apportable thread documentation (e.g. android ui thread used run ios main thread? or separate thread?) create view caeagllayer , create eaglcontext on main thread create shared eaglcontext s used background threads via sharegroup values primary context make shared contexts current on background threads be careful using ...

How can I fold the nth and (n+1)th elements into a new list in Scala? -

let's have list(1,2,3,4,5) , want list(3,5,7,9), is, sums of element , previous (1+2, 2+3,3+4,4+5) i tried making 2 lists: val list1 = list(1,2,3,4) val list2 = (list1.tail ::: list(0)) // 2,3,4,5,0 (n0_ <- list1; n1th_ <- list2) yield (n0_ + n1_) but combines elements each other cross product, , want combine elements pairwise. i'm new functional programming , thought i'd use map() can't seem so. list(1, 2, 3, 4, 5).sliding(2).map(_.sum).to[list] job. docs: def sliding(size: int): iterator[seq[a]] groups elements in fixed size blocks passing "sliding window" on them (as opposed partitioning them, done in grouped.)

solr - langid UpdateRequestProcessor only mapping first field -

i trying use solr's langid updaterequestprocessor. here config: <updaterequestprocessorchain name="languages"> <processor class="solr.langdetectlanguageidentifierupdateprocessorfactory"> <lst name="invariants"> <str name="langid.fl">focus, expertise, platforms, partners, participation, additional</str> <str name="langid.whitelist">en,fr</str> <str name="langid.fallback">en</str> <str name="langid.langfield">detectedlang</str> <bool name="langid.map">true</bool> <bool name="langid.map.keeporig">false</bool> </lst> </processor> <processor class="solr.runupdateprocessorfactory" /> </updaterequestprocessorchain> my fields this: <fields> <field name=...

How do I find the beginning of data packet on serial port in C#? -

i receive data serial port, , data packet structure looks this: [src] [size] [dest] [data] [xor checksum] sometime data packet split in half, meaning receive partially. how find when data packet starts since there no data packet delimiter?

c# - Reading XML nested node values -

having issue grabbing values in xml file structure followed <configuration> <settings> <add key="folder" value = "c:\...." /> </settings> </configuration> i want able read value folder. string val = string.empty; foreach (xelement element in xelement.load(file).elements("configuration")) { foreach (xelement element2 in element.elements("settings")) { if (element2.name.equals("folder")) { val = element2.attribute(key).value; break; } } } return val; the name of element isn't folder ... that's value of key attribute. note you've used xelement.load , element is configuration element - asking elements("configuration") give empty collection. either load xdocument instead, or assume you're on ...

ibm mq - MQ Explorer stops displaying most information -

after using mq explorer 7.5 on ubuntu 12 add jms connection factories , jms destination decided stop displaying 2 queues , subsidiary info new jms information. tried few things work again: stopping queue manager/restarting, rebooting etc. reinstalling mq explorer without luck. i can status on "empty" queues folder , shows me 2 queues; each has "queue monitoring" set off. relevant? can set on ? am stuck mq explorer display , manage jms objects (there doesn't seem documentation how use command line jms objects) ? more detail: so created objects using following: define qlocal (queue_from) define qlocal (queue_to) set authrec profile(queue_from) objtype(queue) principal('bsmith') authadd(put,get) set authrec profile(queue_to) objtype(queue) principal('bsmith') authadd(put,get) set authrec objtype(qmgr) principal('bsmith') authadd(connect) define channel (channel1) chltype (svrconn) trptype (tcp) set chlauth(channel1) type(ad...