Posts

Showing posts from August, 2012

Google TTS API: Encoding GET request with PHP -

--- solved --- problem solved. solution simple: file_get_contents("http://translate.google.com/translate_tts?tl=de&q=".urlencode($str)."&ie=utf-8") to coming here search engine: make sure set file charset utf-8, include ie=utf-8 parameter url, urlencode string. should fine then. original post was: i have problem making php send correctly encoded request google tts api. $str='this german string contains crazy umlaute ä (like in häuser) or ü (like in Übermensch). sehr deutsch halt.'; file_get_contents("http://translate.google.com/translate_tts?tl=de&q=".$str."&ie=utf-8"); all included php files encoded in utf-8 (no byte order marks). google tts returns me mp3 file spells "umlaute" not Übermensch, a~1/4bermensch. problem has nothing client side. i think google expecting ascii string, might problem? when type line browser manually however, spells correctly. see also: stackoverflow - google tts

jsf 2 - p:commandButton with immediate=true -

what action taken when declare immediate="true" in command button? documentation says boolean value determines phaseid of action event, when true actions processed @ "apply request values", when false @ "invoke application" phase. however, don't understand it. can please explain this? jsf lifecycle contains 6 phases, are: restore view apply request values process validations update model values invoke application render response if command button has immediate="true" , phases 'process validations' , 'update model values' skipped. therefore, convertions , validations not processed , attributes in managed bean not updated. however, if uiinput in form has immediate="true", value converted, validated , updated in managed bean, because happen in 'apply request values' phase. one example of when might use button immediate="true" case of 'cancel' button.

java - Parsed data display in JTable -

i new java. have display xml parsed data parent nodes on jtabbedpane , child nodes in jtable respective jtabbedpane. parsing have used sax parser , data displayed in 3 jtextarea, have created tabbedpane , displayed hardcoded string title not able set jtable values. public class jtabledisplay { public jtabledisplay() { jframe frame = new jframe("jtable test display"); jpanel panel = new jpanel(); panel.setlayout(new borderlayout()); jtable table = new jtable(); jscrollpane tablecontainer = new jscrollpane(table); panel.add(tablecontainer, borderlayout.center); frame.getcontentpane().add(panel); frame.pack(); frame.setvisible(true); } public static void main(string[] args) { new jtabledisplay(); } } this sample create jtable after have arrange parsed data in. it there. not showing data. to make table visible, try defining columns , rows table via constructor

visual studio 2012 - Developing applications for Windows Embedded Compact 2013 -

today stumbled on application builder ce 2013 in microsoft's download center. of description, pack should able develop apps target windows embedded compact 2013 visual studio 2012. after downloading , installing application builder found new framework assemblies in c:\program files (x86)\reference assemblies\microsoft\framework\windowsembeddedcompact\v3.9 , there no project templates targeting embedded compact 2013 in visual studio 2012. i tried create blank winforms or wpf project , retarget 3.9, doesn't seem possible well. there no online templates installed. how create cf 3.9 application using visual studio 2012? all can here sigh. here's state of things of writing (mid may, 2013) , change in coming weeks and/or months. the application builder not ship device templates. templates, instead, shipped device sdk. yes, different in past. means any device development, you'll need sdk. windows embedded compact 2013 not publicly available, no 1

javascript - Accessing Object's Data Via Another Variable Name -

it's super late , mind blanking right now, let's have variable filename , it's storing name of variable marker . variable marker array , contains object & property position: new google.maps.latlng(42.2550,-114.3221) . i've been stupidly trying access via filename.position of course returns undefined, since it's searching literal filename 'position' property not exist. but how pull marker.position using filename ? there nifty jquery trick for, uh, 'resolving' variable contents? i'm brain fried. know i've done before. if it's possible in script, can store data not in variable, in property of object (usually it's more convenient use global one). example var myobj = {}; myobj.marker = new google.maps.latlng(42.2550,-114.3221); // or else then able property using variable this: myobj[filename].position in case recomment check myobj[filename] existance using typeof structure, make sure such property ex

css - how to make leaflet map height variable -

in application making div of map as <div id="map" style="height: 610px; width:100%"></div> but make map responsive want make height 100%, if make height: 100% not working. how can make height variable width map can seen on device. demo : http://jsfiddle.net/ccyp6/ if change height & width of map not map. you need set parent elements height: 100%; first html, body { height: 100%; } demo demo (this won't work no parent height defined) explanation: why need that? when specify element's height in % 1st question arises is: 100% of what? default, div has height of 0px , 100% div won't work, setting parent elements height 100%; work.

access individual elements from a list of pow and symbol sympy python -

i'm trying access individual elements in long list of symbols, , 1 of pow types generated using sympy, here how come out in console: x00 x01 x10 x11 x00 x10 x20 x00 x01 x02 x03 x00 x01 x10 x02 x11 x12 x00 x01 x10 x11 x20 x21 x00 x10 x20 x30 the pow generated using = (ymat[0])**(nvec[0]-mvec[0]) #alpha term: mu^(n-k) nv in range (1, nvariables): = a* (ymat[nv]**(nvec[nv]-mvec[nv])) and symbols using: mstr = str(mvec[0]) #beta term: x^k mm in range(1, len(mvec)): mstr = mstr + str(mvec[mm]) b = symbol('x'+mstr) i've tried using indexation in python such a[1] error message: typeerror: 'symbol' object not support indexing or typeerror: 'pow' object not support indexing does know how access individual elements such (1x00) symbols compare equal name (and assumptions, doesn't using those), recreate same symbol making 1 sa

multidimensional array - Fortran FFTW with strides ''Matlab-like'' -

i newbie in fortran, , trying transform matlab code efficiently .f i using fftw3 package , need ffts strides complex complex. e.g. 2 dimensions out of 3d array should transformed. what in matlab fft(fft(u,[],2),[],3) where u(nx,ny,nz) 3d matrix. i can in fortran via looping slower matlabs ffts in below; call dfftw_plan_dft_2d(planf,nx,nz,inf,outf,fftw_forward,fftw_measure) l=1,nx; call dfftw_execute_dft_(planf,f(l,:,:),fh(l,:,:)); end fft_many solution problem strides can used, couldn't work somehow. help? this link 'c' of fftw's advanced complex ffts;

flash - Flex warning Data binding will not be able to detect assignments to "layout" -

i got code: ... <fx:declarations> <s:animate id="toright" target="{cp.layout}"> <s:simplemotionpath property="horizontalscrollposition" valuefrom="{cp.layout.horizontalscrollposition}" valueto="{cp.layout.horizontalscrollposition+42}"/> </s:animate> </fx:declarations> .... .... <s:list id="cp" horizontalscrollpolicy="off" itemrenderer="com.mrenderer" horizontalcenter="1" verticalcenter="1" change="changeevt(event)" borderalpha="0" width="458" height="65" initialize="initlist();" > ..... i use animation smoothing move arrows in list. but got warnings: data binding not able detect assignments "layout". i know layout not bindable in list. not custom class. how can prevent that? so you're using animate effect

How to publish my web site using visual studio professional edition 2012? -

Image
i want publish website using microsoft visual studio professional 2012 in pc getting following screen following steps,build->publish website attached screenshot above"publish web" when try publish website in colleague pc getting following screen attached screenshot above "publish web site". difference between these two?how "publish web site" type of screen in pc instead of "publish web" screen. help? install web matrix on colleagues computer , try

iphone - cellForRowAtIndexPath nil during unit tests -

i'm trying write unit test uses tableview, , i'm having trouble accessing cells. this nil: - (void)testdidendeditingupdatesliftrecords { textviewcell *cell = (textviewcell *) [tableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; despite fact set data source in setup - (void)setup { [super setup]; source = [[mydatasource alloc] init]; tableview = [[uitableview alloc] init]; [tableview setdatasource:source]; what as docs say, uitableview method cellforrowatindexpath: returns "an object representing cell of table or nil if cell not visible or indexpath out of range." thus, if cell not visible on tableview, method return nil . note, method should not confused tableview:cellforrowatindexpath: method implement in our uitableviewdatasource . names confusingly similar.

.net - Extracting messages from SQL Server Service Broker -

how extract messages sql server service broker please? i'm using nservicebus. i have messages in sql server service broker queue i'm not sure how process them. many thanks, this code you. declare @messagetype sysname declare @conversationhandle uniqueidentifier declare @handle uniqueidentifier declare @messagebody nvarchar(max) declare @conversation_group_id uniqueidentifier ; waitfor( conversation group @conversation_group_id [updatereceivequeue] ); waitfor ( receive top(1) @messagetype=message_type_name, @messagebody=message_body, @conversationhandle=conversation_handle [updatereceivequeue] conversation_group_id = @conversation_group_id ),timeout 2000; print @messagebody please use link more information.

jQuery .animate easing issues -

i'm having trouble .animate function in jquery , mixing easing. the following works; $("#panelone").mouseover(function() { $("#paneltwo").stop(true, false).animate({ marginleft: "420px"}, 150 ); }); but doesn't; $("#panelone").mouseover(function() { $("#paneltwo").stop(true, false).animate({ marginleft: "420px"}, 150, 'easeoutquint' ); }); i'm not sure i'm doing wrong, it's going blindingly obvious, i've never used easing or jqueryui before, i'm pretty lost! edit: i'm referencing jqueryui here; http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js your code seems work fine. make sure you've download jquery-ui effect included. check under effects here: http://jqueryui.com/download/

Exception before the program starts c# -

Image
i have project runs fine, loads, runs , completes, when set visual studio in debug mode, when switch release, hell breaks loose. program not enter main method, becouse when put console.readline in there, program still crashes. have put whole program in try catch block becouse doesnt enter main not catch anything. have tried seach on internet find nothing usefull. going on here? this pops right after press f5: http://i.stack.imgur.com/vb3xu.png http://i.stack.imgur.com/mscci.png the exception window see somthing thrown inside program, not there? right click on soltuion , select properties. click on configuration properties , configuration manager in release section, make sure projects set build (ticked) (sorry ugly picture)

opencv - Printing the pixel values of YUV image -

when convert image yuv rgb cant value of y when try printing pixels. value 377 , when cast integer 255. presume incorrect. there better way or rather correct way print values of yuv image pixels. actually priting values (int)src.at<vec3b>(j,i).val[0]= 255 , src.at<vec3b>(j,i).val[0] = 377 also on note, y combination of rgb calculated constants according note. confused how value of y. this problem of opencv. opencv not gracefully handle (scale) yuv or hsv color spaces uchar format. vec3b have 3-channel uchar , , ranges [0;255]. the solution use matrix type. cv::mat3f have 3-channel floating point image. values correctly converted cvtcolor function. can mat3f mat3b assignment. another solution uses less memory may mat3s , mat3w types, if supported cvtcolor.

java - Facebook Application To Post To A Fan Page -

i trying make simple application on facebook. there 1 user using this, me. say have 10 photos upload everyday, thought i'll make application take every image in directory , upload page. fan page assume "x" i started out making app in developer.facebook.com, "x app". got facebook4j library , tried posting status page, using manage_pages permission. i stuck @ many ends in attempt , wanted ensure right way it, or doing enitrely wrong perhaps? there complete answer question here (even needed source code). however, if need automatically, create php script take n new photos directory, upload them facebook fan page , moving or deleting them when online. then use crontab on server call script everyday @ chosen hour.

asp.net mvc 3 - Stop Menu showing on log-in page -

i developing asp.net mvc 3 application , have referenced [authorise] method show log-in on entry. although stops use of top menu (at moment standard "home "index") still visible , wish hide them log-on screen. any appreciated. thank in advance. chri3 try this @if(user.identity.isauthenticated) { <div>code menu</div> }

Keep form data after errors on basic Shopify contact form -

i have added basic contact form described in shopify documentation . my code: {% form 'contact' %} {% if form.posted_successfully? %} <div class="successform feedback"> <p>thanks contacting us. we'll possible.</p> </div> {% endif %} {% if form.errors %} <div class="errorform feedback"> <p>sorry, unable submit inquiry because contained {{ form.errors | size | pluralize: 'an error', 'a few errors' }}.<br/>please correct following , submit again:</p> {% field in form.errors %} <p><strong>the {{ field | capitalize | replace: 'body', 'comments / questions' }} field {{ form.errors.messages[field] }}.</strong></p> {% endfor %} </div> {% endif %} <div id="contactformwrapper"> <h3>personal details</h3> <ul> <li> <label>first name:</label> <input type="text

java - Remove space/border/margin of JTabbedPane -

image jtabbedpane http://img850.imageshack.us/img850/7339/immaginedya.png how can remove selected margin of jtabbedpane ? :( since nimbus l&f based on synth l&f guess have load custom synth style tabbed pane tab area custom insets specified (in case smaller left/right insets). you can read styling synth here: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html i guess style file (you can name whatever - e.g. style.xml ) should this: <synth> <style id="tabareastyle"> <insets top="0" left="0" right="0" bottom="0" /> </style> <bind style="tabareastyle" type="region" key="tabbedpanetabarea" /> </synth> i found key tabbedpanetabarea looking synthtabbedpaneui source code. loading style: final nimbuslookandfeel lookandfeel = new nimbuslookandfeel (); lookandfeel.load ( myclass.class.getresource ( "st

.net - Notify running Windows app when line is inserted in sql table -

i need have windows application (that writing) somehow information new record has been added sql table. sql server ms sql server 2008, , windows app .net 4 app. sql server , running app on different computers, constants in equation. best way notification running app? i decided create clr trigger, opens tcpclient connection, parameters stored in config table. app creates tcplistener object , waits clr trigger send data. seems working well.

android - Button is not clickable -

i have button "savestats" seems not accept clicking. on emulator there no animation of clicking. i have tried clean , restart eclipse, didnt work. i have checkbox widget works fine, button dont work. here code: thank helping :) button savestats; checkbox agecheck, heightcheck, weightcheck, fatcheck; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.set_personal_data); savestats = (button) findviewbyid(r.id.savestats); agecheck = (checkbox) findviewbyid(r.id.checkboxage); heightcheck = (checkbox) findviewbyid(r.id.checkboxheight); weightcheck = (checkbox) findviewbyid(r.id.checkboxweight); fatcheck = (checkbox) findviewbyid(r.id.checkboxfat); savestats.setonclicklistener(this); agecheck.setonclicklistener(this); heightcheck.setonclicklistener(this); weightcheck.setonclicklistener(this); fatcheck

java - how to bootstrap Spring in a JbossWS-CXF web service deployed in jboss AS 7.2 -

tldr @ bottom: as per jbossws-cxf user guide , web service, web.xml should contain following <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <servlet> <servlet-name>mywebservice</servlet-name> <servlet-class>com.sgb.mywebservice</servlet-class> </servlet> <servlet-mapping> <servlet-name>mywebservice</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> jboss expects descriptor file named jboss-cxf.xml in web-inf directory (instead of cxf.xml) should contain jaxws:endpoint tag so: <beans xmlns='http://www.springframework.org/schema/beans'

osx mountain lion - Why is brew doctor stalling on mdfind? -

the problem i've been having issues homebrew, thought i'd run brew doctor , it's stalling on mdfind. brew --config hangs on mdfind after outputting following: homebrew_version: 0.9.4 origin: https://github.com/mxcl/homebrew head: c2cc58163b54a9ea2ee56febfc722396079c5b9a homebrew_prefix: /usr/local homebrew_cellar: /usr/local/cellar cpu: quad-core 64-bit sandybridge os x: 10.8.3-x86_64 xcode: 4.6.2 clt: 4.6.0.0.1.1365549073 llvm-gcc: build 2336 clang: 4.2 build 425 brew update seems work: $ brew update up-to-date. i can install things: $ brew install rsnapshot ==> downloading http://rsnapshot.org/downloads/rsnapshot-1.3.1.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/cellar/rsnapshot/1.3.1 --mandir=/usr/local/c ==> make install 🍺 /usr/local/cellar/rsnapshot/1.3.1: 12 files, 356k, built in 4 seconds and work: $ rsnapshot rsnapshot 1.3.1 usage: rsnapshot [-vtxqvd] [-c

ruby - Logging in Rails, is there any performance hit? -

rails comes bundled ruby's logger class in standard library. available log levels are: :debug , :info , :warn , :error , , :fatal . i wondering if add extensive logging in rails application log level set :debug development , testing, there performance impact when running in production logging turned-off or set @ higher level, such config.log_level = :fatal ? the short answer logging have performance impact, particularly when logging disk. however, there few subtleties. firstly, using :debug level have greater performance penalty :fatal , far greater number of strings being evaluated , written log output (e.g. disk). another potential pitfall if have many calls in code: logger.debug = "my string debug #{variable}" there performance impact if allowed output level doesn't include debug. reason ruby has evaluate these strings, includes instantiating heavy string object , interpolating variables, , takes time. therefore, it's recommended pa

Eclipse cannot connect to remote git server via ssh egit funny refname [remote rejected] -

i have set git repository through gerrit . trying push local repository remote 1 created gerrit (ssh linux box). have imported rsa keys both gerrit , eclipse set repository settings. when try , push upstream /refs/for/master: head [remote rejected] repository ssh://<username>@<ip address>:<port>/<repository name> funny refname what 'funny refname` , how can secure connection within eclipse? a "funny refname" git's way of saying ref name trying push invalid. you seem have following configuration in remote section (in .git/config ): push = head:/refs/for/master it should instead be: push = head:refs/for/master

Javascript image 360 view script only working on certain pages -

on online shop have products have "view 360" button can see part of product spinning , control mouse. i have tried configure on website on page example: http://oakandrattan.com/rattan-dining-sets/4-6-or-8-seater-la-round-table-set as can see when click on "view 360" displays first image in range of images used create 360. believe there wrong way have used javascript on page have tested out on basic test page can seen here: http://oakandrattan.com/spin/test.html i cannot figure out have done wrong on actual product page. thank-you help. thank-you pointing me in right direction. cannot believe missed this: didn't put "/" @ start of spin.js src meaning trying reach wrong url.

c# - Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions -

error line; modelmetadata metadata = modelmetadata.fromlambdaexpression<t, object>(columnproperty, phtml.viewdata); model public class menuauths : entitybase { [bsonignoreifnull] [bsonrepresentation(bsontype.objectid)] public string menuid { get; set; } [bsondefaultvalue(false)] public bool allownew { get; set; } } cshtml; new column<lsdatamodels.menuauths> { columnproperty = c => c.menuid }, new column<lsdatamodels.menuauths> { columnproperty = c => c.allownew}, this line work new column<lsdatamodels.menuauths> { columnproperty = c => c.menuid } line have error new column<lsdatamodels.menuauths> { columnproperty = c => c.allownew}, i can try property type change bool? , bool , nulable<bool> error has been continue. remove [bsondefaultvalue(false)] attribute nothing change. what can do? edit: error templates can used field access, property access, single-dimension array index, or si

math - prolog: rule to check pythagorean triplet? -

prolog keeps saying 'no' me.... :( i very new prolog, have basic question: so i'm trying produce simple rule checks if 3 numbers constitute length of sides of right-angle triangle, this: addup(x,y,z) :- x y+z. /* works*/ pythag(h,a,b) :- (h*h) (a*a) + (b*b). /*this doesn't work*/ for testing, 'addup' rule appear work.... believe there issue left-hand side of 'is' in program, following test seems indicate this: in interactive mode can whether 2 sum of 1 , 1, , says yes: | ?- 2 1+1. yes but if switch left , right hand sides; says no: | ?- 1+1 2. no can provide correct version of pythag rule above ? version info follows: gnu prolog 1.3.0 daniel diaz copyright (c) 1999-2007 daniel diaz | ?- my prolog knowledge old, believe problem prolog evaluates right side of is so try: pythag(h,a,b) :- z h*h, z (a*a) + (b*b).

c# - WPF, points are different to RenderTargetBitmap -

my problem int32rect points different ones in canvas. attempted use dpi suggested solution other problems not figure out how use it. private void bttnexportfb_click(object sender, routedeventargs e) { rendertargetbitmap rtb = new rendertargetbitmap((int)maincanvas.actualwidth, (int)maincanvas.actualheight, 96d, 96d, system.windows.media.pixelformats.default); rtb.render(maincanvas); croppedbitmap crop = new croppedbitmap(rtb, new int32rect((int)(173 ), (int)(360), (int)(353 ), (int)(540 ))); bitmapencoder pngencoder = new pngbitmapencoder(); pngencoder.frames.add(bitmapframe.create(crop)); using (var fs = system.io.file.openwrite("logo.bmp")) { pngencoder.save(fs); } } -update- on canvas rectangle created positions of interect32, has different area @ rtb.

c++ - Simulation Class Design -

i'm looking simulations complicated initial conditions user. i'm writing class a member variables need initialized user before running a.solve() results stored in file. initialization rather complicated , requires several temporary data structures no longer needed after initialization. so, wrote class called class initializer stores reference object of class a . code this: class { friend class initializer; private: // member variables storing state of system public: void solve(); ... }; class initializer { private: a& // other data structures used in initialization ... public: // functions called user set initialization ... initialize(); // after called, ready solve }; int main(...) { a; initializer init(a); // call functions on init initialize system ... init.initialize(); a.solve(); return 0; } but seems data structures in init live on stack entire program. prevent that, o

html - Using jQuery to narrow down a multiple select box -

i have multiple select box on page contains many options. can pain scroll through find option need want have input box when user starts typing in it hides options in select box don't match text. now bit of duplicate there solution here: narrow down select options text search using jquery however doesn't quite want seems not work on multiple select boxes. can suggest modification such will?

cocoa touch - How do I programmatically draw to a display in iOS? -

i have method of drawing screen has many benefits application except small issue doesn't work... @ all. i have ios program uiimageview widget , i'm trying programmatically draw looks black when run program. outlet declaration in header file: @interface testviewcontroller : uiviewcontroller @property (weak, nonatomic) iboutlet uiimageview *imageview; @end ...and implementation: @implementation testviewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. uigraphicsbeginimagecontextwithoptions(cgsizemake(400, 400), yes, 0.0); cgcontextref context = uigraphicsgetcurrentcontext(); cgfloat colour[] = { 1, 0, 0, 1 }; cgcontextsetfillcolor(context, colour); cgcontextfillrect(context, cgrectmake(0, 0, 400, 400)); self.imageview.image = uigraphicsgetimagefromcurrentimagecontext(); [self.imageview setneedsdisplay]; uigraphicsendimagecontext(); } - (void)didreceivememorywar

java - infinite loop database check -

i'm using jdbc, need check database against changing values. what have infinite loop running, inner loop iterating on changing values, , each iteration checking against database. public void runinbg() { //this method called thread while(true) { while(els.haselements()) { test el = (test)els.next(); string sql = "select * test id = '" + el.getid() + "'"; record r = db.gettestrecord(sql);//this function makes connection, executequery etc...and return record object values if(r != null) { //do } } } } i'm think isn't best way. the other way i'm thinking reverse, keep iterating on database. update thank feedback regarding timers, don't think solve problem. once change occurs in database need process results instantaneously against changing values ("els" example code). even if database not change still has check against changing values. update 2 ok, int

java - UDP client/server chat -

i planning make java chat messenger. facing problem. client side cannot send message until receives message server side program. how fix this? i have different code server side , client side. client side program. datagrampacket send_packet = new datagrampacket(send_data, send_data.length, ipaddress, 5020); client_socket.send(send_packet); datagrampacket dpacket = new datagrampacket(recv_data, recv_data.length); client_socket.receive(dpacket); string msg = new string(dpacket.getdata(),0,dpacket.getlength()); system.out.println("aman2: \n" + msg);

c# - MonoTouch.Dialog Overriding GetCell? -

in mt.dialog source class has this: public override uitableviewcell getcell (uitableview tableview, monotouch.foundation.nsindexpath indexpath) { ...... } in class: public class basedialogviewcontroller : dialogviewcontroller how override public override uitableviewcell getcell this doesn't work: public override getcell .... thanks note: trying implement: http://fastchicken.co.nz/2012/05/20/earnest-debrief-visual-styles-in-ios-apps-uiappearence-custom-sections-in-monotouch-dialog/ dialogviewcontroller not have getcell method. public class basedialogviewcontroller : dialogviewcontroller won't work. dialogviewcontroller.source , nested type, has getcell method so public class basedialogviewcontrollersource : dialogviewcontroller.source { public override uitableviewcell getcell... } should work. of course need own subclass of dialogviewcontroller use new subclass of source . can done overriding createsizingsource method.

BigQuery service outage? -

is there bigquery service outage aware of? async queries in web application stopped retrieving data - no response (no error message etc.) i have back-end process imports data bigquery, seems working fine, however. we believe we've identified , fixed problem. apologies disruption! if see further problems, please let know.

php - prestashop create and update resources via url webservice api -

i (unfortunately) have write client application front end prestashop powered web site. i'd need perform crud operations on resources via url webservice , i'm stuck on create , update. surprise find out how few examples available on web since prestashop supposed used cms. however, till came to: get http://www.myshop.com/api/myresource/id to xml resource given id or get http://www.myshop.com/api/myresource/?display=full&filter[field]=[value] to filter results. i'm writing because had struggle google achieve information, filters stuff might in future. delete http://www.myshop.com/api/myresource/id to delete resource (i suppose filters work here too, didn't try far) now, know how create , update resources? tried post/put http://www.myshop.com/api/myresource/ giving couples of field - value in http request parameters no luck, i'm getting internal server error. no, have no direct access server don't know error thrown , hope can solved without

javascript - How do I implement Toastr JS? -

i new js , not sure how make work on page. below have. how must make alert show? i added source correctly not sure how render alert. <!doctype html> <html> <head> <title>toast</title> <link href="toastr.css" rel="stylesheet"/> <script src="toastr.js"></script> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script> $(document).ready(function() { //toastr.info('are 6 fingered man?') command: toastr[success](" ", "settings saved!") toastr.options: { "debug": false, "positionclass": "toast-top-right", "onclick": null, "fadein": 300, "fadeout": 1000, "timeout": 5000, "extendedtimeout

javascript - Ember.js routing alias -

in there way in ember.js routing create alias route goes same place route? have following defined: this.resource("accounts", { path: "/accounts/:account_id" }, function() { this.route("credit", { path: "/credits/:credit_id" }); this.route("debit", { path: "/debits/:debit_id" }); this.route("refund", { path: "/refunds/:refund_id" }); this.route("hold", { path: "/holds/:hold_id" }); }); an example working route looks like: /accounts/foo-bar-account-id/credits/foo-bar-credit-id i need alias routes though each, without account, should work in form of: /credits/:credit_id /debits/:debit_id /refunds/:refund_id /holds/:hold_id can simple as? this.route("accounts.credit", { path: "/credits/:credit_id" }); this.route("accounts.debit", { path: "/debits/:debit_id" }); this.route("accounts.refund", { path: "/refund

asp.net - how to set sqldatasource default value from database in c#? -

how set sqldatasource deafult value database field value. have coding like, <asp:dropdownlist id="ddvehicle" runat="server" appenddatabounditems="true" cssclass="drop" datasourceid="sqldatasource4" datatextfield="vehicletype" datavaluefield="vehicleid"> <asp:listitem value="">-select-</asp:listitem> </asp:dropdownlist> <asp:sqldatasource id="sqldatasource4" runat="server" connectionstring="<%$ connectionstrings:taxiconnectionstring %>" selectcommand="select [vehicleid], [vehicletype] [vehiclemaster] ([vehicleid] = @vehicle or [status] = @status1)"> <selectparameters> <asp:parameter defaultvalue="???" name="vehicle" type="string" /> <asp:parameter defaultvalue="available" name

php - How to write a bot that does not consume much RAM? -

i have web bot , consumes memory much, after time, memory usage hits 50%, , process gets killed; have no idea why memory usage increasing that, did not include "para.php" library parallel curl requests. want know more things web crawlers, searched lot, not find helpful document or methods can use. this library obtained para.php. my code: require_once "para.php"; class crawling{ public $montent; public function crawl_page($url){ $m = new mongo(); $muun = $m->howto->en->findone(array("_id" => $url)); if (isset($muun)) { return; } $m->howto->en->save(array("_id" => $url)); echo $url; echo "\n"; $para = new parallelcurl(10); $para->startrequest($url, array($this,'on_request_done')); $para->finishallrequests(); preg_match_all("(<a href=\"(.*)\")siu", $this->montent, $matk); foreach($matk[1] $longu)

mysql - Error when trying execute statement with where from joined table in subquery -

i'm trying rank of spent hours table in amount of time. works. want restrict 1 usergroup. made this: select s.shortname servername, s.displaycolor displaycolor, min( if(`yearweek`=yearweek(current_date(),3) , (s.admin_group=u.usergroupid or find_in_set(s.admin_group, u.membergroupids)>0), (select count(*) godziny_tygodnie x left join vbulletin.vb_user xu on xu.userid=x.dbid gw.sid=x.sid , x.`yearweek`=gw.`yearweek` , x.`time` > gw.`time`)+1 , ( xu.usergroupid=s.admin_group or find_in_set(s.admin_group, xu.membergroupids)>0) , null) ) rweek0, -- there more columns simillar previous, different time interval godziny_tygodnie gw inner join godziny_miesiace gm on gw.dbid=gm.dbid , gw.sid=gm.sid inner join godziny_lacznie gt on gw.dbid=gt.dbid , gw.sid=gt.sid left join serwery s on s.id=gw.sid left join vbulletin.vb_user u on u.userid=gw.dbid gw.dbid=

php - MySQL Syntax Error During UPDATE -

if($_post['submit']) { $day1 = $_post['day1']; $day2 = $_post['day2']; $day3 = $_post['day3']; $day4 = $_post['day4']; $day5 = $_post['day5']; $day6 = $_post['day6']; $day7 = $_post['day7']; $day8 = $_post['day8']; $day9 = $_post['day9']; $day10 = $_post['day10']; $day11 = $_post['day11']; $day12 = $_post['day12']; $day13 = $_post['day13']; $day14 = $_post['day14']; $query_update = ("update user_glucose set (day1='$day1',day2='$day2',day3='$day3',day4='$day4',day5='$day5',day6='$day6',day7='$day7',day8='$day8',day9='$day9',day10='$day10',day11='$day11',day12='$day12',day13='$day13',day14='$day14') username='$username'"); $result_update = mysql_query($query_update); ec

java - Spring Maven - context configuration in resources folder -

as found in other question @ stackoverflow, better keep configuration of spring in src/main/resources folder. when use mvn jetty:run tries load context configuration web-inf whatever i'm typing web.xml. following error: javax.servlet.servletexception: org.springframework.beans.factory.beandefinitionstoreexception: ioexception parsing xml document servletcontext resource [/web-inf/easyscrum-servlet.xml]; nested exception java.io.filenotfoundexception: not open servletcontext resource [/web-inf/easyscrum-servlet.xml] what should force servlet load config classpath instead of web-inf? to load spring config context files classpath have prefix path classpath: <context-param> <param-name>contextconfiglocation</param-name> <param-value> classpath:context.xml </param-value> </context-param>

How to create indicative arrows to help the user of the android application? -

i finished app android using eclipce, before start using it, develop explains how application works. thought of when enter website , arrows appear indicating process have do, or have click. thought of using flash or this. has ever worked similar or can give me idea? you might want 'showcase' show on first app run. neat little library : http://www.theultimateandroidlibrary.com/resources/4034/ to run fist time only, can write flag preferences , check in oncreate().

ruby - Nokogiri group flat structure -

i have html structure like: <div class='content'> <h2>title</h2> <p>some content title</p> <h2>another title</h2> <p>content title</p> <p>some more content title</p> <h2>third</h2> <p>third content</p> </div> i trying write code output: title - content title title - content title - more content title third - third content i've never used nokogiri until 5 minutes ago, can come far is: content = doc.at_css('.content') content.css('h2').each |node| puts node.text end content.css('p').each |node| puts " - " puts node.text end this doesn't group pieces together. how can achieve required grouping nokogiri? there many ways it, here's one: doc.at_css('.content').element_children.each |node| puts(node.name == "h2" ? node.text : " - #{node.text}") end

android - How manage orientation of other applications from my app? -

i see app: https://play.google.com/store/apps/details?id=nl.fameit.rotate&hl=en can set orientation of every app @ start. how set orientation of app? have not been able find nothing this. thanks! p.d sorry english :)

java - How do I iterate through an arraylist? -

i have getarray.jsp java code outputs array of form : [{"value":"hi","id":"77","label":"hi there"}, {"value":"hello","id":"21","label":"hello there"}] the array declared in java : arraylist<sometype> arr = new arraylist<sometype>(); i ajax load jsp : $(document).ready(function (e) { $('.container').load('getarray.jsp', function (responsetext, textstatus, xmlhttprequest) { $.each(responsetext, function (index, response) { $('.main').append(response.value); $('.main').append('<br /><br /><br /><br />'); }); }); }); but not getting jquery print anything, though jsp return array mentioned on top. i know json, how print it?

c# - Simple way to display an object (POCO) in an ASPX file -

first of all, let me start saying i'm not asp.net developer. have web experience other technologies have read webforms. know have no experience them. and problem. have inherited webforms application has run unmodified years (~ 6 years) , have enhance it. it's not complicated, managed 80% of i'am stuck on thing seems minor have not yet found simple way achieve it. i have simple object, instance of class this: public class eventdetails { public string eventname { get; set; } public string eventlocation { get; set; } public datetime startdate { get; set; } //... etc } i have created in eventdetails.aspx.cs , need display in eventdetails.aspx file , don't know how. have read tutorials , use <asp:gridview> or list view or repeater. these have datasource bind to. can't use object directly datasource, seems need create myself idatasource etc. it seems complicated. need display thing, nothing else , don't know how. must simple,

Calling C/C++ dll functions from C# -

i trying call functions compiled c/c++ dll in c# program. have called several of functions having trouble couple. compliled c/c++ function call: decldir int ads1292r_get_version(unsigned char ads129x_version[]) { unsigned char wbuf[10]; unsigned char rbuf[10], retval =1; wbuf[0] = start_data_header; // packet start header wbuf[1] = firmware_version_req; // firmware version info command wbuf[2] = 0x00; // not used wbuf[3] = 0x00; // not used wbuf[4] = 0x00; // not used wbuf[5] = end_data_header; // packet end header wbuf[6] = '\n'; pcomport->write(wbuf, 7); // send command firmware sleep(5); memset(rbuf,0,7); pcomport->read(rbuf, 7); // receive response frimwate if ((rbuf[0] == start_data_header) && (rbuf[1] == firmware_version_packet) && (rbuf[5] == end_data_header)) {

r - Purging observations from a dataset based on number of occurrences -

i have data frame in 1 variable categorical , has large number of possible values. i'm trying process data frame in way removes instance of categorical variable occurs fewer x number of times. for example, if i'm dealing car makes variable, may like: toyota ford lexus ford acura subaru dodge ford ford lexus ... ... ... i remove observations in car make classifier occurs fewer ten times. example, if ford, lexus, , toyota appear 30, 20, , 15 times, , others fewer ten, remove other entries associated makes. i know command like cars.processed <- which(table(cars$make) > 10) does produce integer count of how many classifiers meet required criteria, don't know how move on there. thanks help! lets assume df data.frame , x column in questions , thr threshold: thr <- 3 keep <- names(which(table(df$x) > thr)) df <- df[df$x %in% keep, ] # optionally, drop levels df$x <- droplevels(df$x) here data.table solution well: librar

c# - Show alternating images for changing ViewModel states -

for different user interfaces want show image depending on state of viewmodel object. for example: i have database connection, if connected, want show green database image, if not connected want display red database image. in viewmodel there bool represents state. possibilities are: having 2 images in view (with converter inversebooleantovisibilityconverter red image), @ same place, showing 1 of them. binding image source (but not want set in viewmodel) some sort of selector? this state depending image can more of use, e.g. in treeview itemimage . is there more clever way accomplish that? i use valueconverter so: public class booltoimageconverter: dependencyobject, ivalueconverter { public bitmapimage trueimage { { return (bitmapimage)getvalue(trueimageproperty); } set { setvalue(trueimageproperty, value); } } public static dependencyproperty trueimageproperty = dependencyproperty.register("trueimage", typeo

assembly - Reverse a string using the stack -

i'm using dosbox , assignment. have reverse string using stack. thinking push string 1 character @ time onto stack pop out revstring 1 one. can't figure out how though. here have far. .model small .stack 100h .data string db "najafi", 13, 10, "$" revstring db 6 dup(?), '.', 13, 10, "$" .code main proc ;; set ds register point data mov ax, @data mov ds, ax ;; printing string in dos mov dx, offset string mov ah, 9h int 21h ;; reverse string using stack mov ax, word ptr string push ax pop ax ;mov revstring, ax ;; print reverse string in dos mov dx, revstring mov ah, 9h int 21h ;; dos return mov al, 0 mov ah, 4ch int 21h main endp end main to push string onto stack: mov di, offset string mov cx, string_length xor ax, ax pushloop: mov al, [di] push ax inc di dec cx jnz pushloop you can same type o

c# - Using Contains method within linq's Where clause -

i've got problem query. have 2 simple classes. let's say public class a{ public list<b> mycollection{get; set;} } public class b{ public string id; } //i want var myb = new b{id="1"}; context.a.where( x=> x.mycollection.contains(myb)).tolist(); how can solve this? know like context.a.tolist().where... but that's not idea, have few thousands records. update! context entityframework context , context.a represents dbset i'm still getting error "linq entities not recognize method 'boolean contains" can't use context.a.tolist().where(.... because have thousands of records , inefficient this worked me: public class { public list<b> mycollection{get; set;} } public class b { public string id; } void main() { // you're searching var myb = new b{id="1"}; // here objects put in collection a1 = new a(); a1.mycollection = new list<b>(); a2 = new a();

javascript - How to use this selector in the jQuery -

Image
i'm making drag , drop resizable template engine. i'm having problem think isn't hard fix, i'm stuck. jquery code $(".getinfo").click(function(){ $("b").mousemove(function(){ var bodycolor = $("#bgcolor").css("backgroundcolor"); $(this).css("background-color",bodycolor); }); }); html code <div id="resizable1" class="drag resize getinfo"> <h3 class="ui-widget-header">slide show</h3> </div> demo image i need have this . when user clicks on div class name .getinfo , user clicks color in colorpicker want assign clicked div. try using above code had no luck. don't bind mousemove colour picker inside click . need separate. try this: var bodycolor = "#ffffff"; //declared globally, default color $("b").mousemove(function(){ bodycolor = $("#bgcolor").css("backgroundcolor"); }); $(&

Java game - layout -

Image
i'm making tetris in java , have few questions layout in reference picture below: should gameboard , scoreboard separated 2 jpanels within 1 jframe... set jframe size equal gameboard + scoreboard? jframe f = new jframe("tetris"); f.setsize(gameboard.getwidth()+scoreboard.getwidth(), gameboard.getheight()); or should 1 jpanel within 1 jframe contains everything...? (here set frame equal size of gameboard + 200 on right have space show buttons, score, next piece, etc...) if so, how align buttons , such? jframe f = new jframe("tetris"); f.setsize(gameboard.getwidth()+200, gameboard.getheight()); any thoughts on how should lay out game? don't use setsize . use layout, position components, , call f.pack . automatically size window correctly. you should have more 1 jpanel . two-panel layout looks good. for example: jpanel contentpane = new jpanel(new borderlayout()); contentpane.add(maingamepanel, borderlayout.center); contentpa

how to convert a variable to string in matlab? -

this question has answer here: print variable-name in matlab 5 answers i have structure array some_struct_var=struct( 'filed1', filed1, 'filed2', filed2 ,...) i want create string str=['the struct variable name :' , some_struct_var] with name of structure variable in it. some_struct_var may vary , not fixed. create function takes variable input , returns string equivalent of variable's name ouput so: vartostr = @(x) inputname(1); structvarstring = vartostr(some_struct_var) str = ['the struct variable name :', structvarstring]

javascript - jqm data-rel="back" issue -

imagine following scenario: i have jquery-mobile formular, it´s results linking resultpage. on resultpage have button: <a href="#" data-rel="back" data-role="button"></a> this works fine update content , keep submitted form data, but if user came search-engine or similiar extern link, button links searchengine/externlink . so how differentiate between came form or anywhere else in jqm-way ? i have "start-search-page" love link if user didn´t came search , don´t want miss ajax-link search resultpage, use same button , idealy don´t have set cookie. is there hint or smarter attempt check server url document.referrer ? in advance you can check current page url using below code: var prevurl = $.mobile.activepage.data('url'); in case u want perform different actions based on previous url. on save url in global javascript variable , on click of button check previous url , functionality. eg before n

Install4j - how to exit when "insufficient disk space" -

i use installation components screen, , have selected option insufficient disk space warning . works - warning when there's not enough disk space, , user presented prompt along lines of continue y/n ... the thing can't figure out how exit installer when select n . stands, when there's not enough disk space, , user selects n (to "not continue"), installer loops installation components selection again, , cycles through warning again - endless cycle. there's no "quit on failure" option screen, how cancel install when user elects not continue since there's not enough disk space? thanks.... there no way insert code there, loop goes can select installation directory more space. have created issue canceling added option in console mode. to check condition beforehand, compare systeminfo.getfreediskspace(context.getinstallationdirectory()) with com.install4j.runtime.installer.helper.content.contentinstaller. getinstance(