Posts

Showing posts from February, 2010

c# - long varchar to string -

i using long varchar column store log information. want retrieve string, in c#, using datareader. however, there error: request retrieve blob column had been accessed. blob column may accessed once. maybe url you: retrieving ntext, text, or image values best regards

How do I test PayPal mass payment in PayPal sandbox account? -

i want test mass payment in paypal sandbox account. per paypal documentation describes steps transfer money paypal account only. want transfer money customer’s bank account. how can this? fyi: paypal documentation content how recipients money? every recipient receives email notifying them of payment. there 3 scenarios recipients. recipients paypal account tied email address contains payment notification can click link in email message, log in account, , access payments. if recipients have paypal account, payment sent email address not tied account, offered opportunity log in account. then, when log in, money deposited account , new email address added account automatically. if recipients do not have paypal account , email message contains link directs them paypal sign-up page. sign-up process automatically confirms email address. when complete sign-up process, money available in new paypal account. thanks in advance k.lakshmi priya paypal masspay can transfer fu...

What is the unit of measurement used for fonts in Adobe Livecycle Workbench ES3? -

i have question appears trivial, not able find answer satisfy me. in units of measurement expressed font sizes can specified on form in adobe livecycle workbench es3? don't know whether they're px, pt, mm, inch, ... for example, if set font=arial , size=9, means size 9 px/pt/mm/inch? is there way set unit of measure should used fonts? thanks in advance. the introduction says you're dealing html5 , css. so can use %, in, cm, mm, em, ex, pt, pc , px . recommended use relative sizes: em , %. i guess dealing graphical user interface. if doesn't accept units of measurement, create test , open css file in text editor see units used.

html5 - Changing favicon using favicon.ico -

i had inserted favicon html page i'm trying change put different 1 first 1 seems stuck..it can't move, when remove whole link tag favicon. had generated favicon (favicon.ico) , i'm using it's not working. it may due caches, try clearing cache , replacing favicon.ico file in webroot. browsers search favicon.ico file in webroot.

android - How To Change Background Resource of Button after Several Seconds -

i creating app memory game. button has image resource drawable , want background resource of button go default background, after 5 seconds. here code. collections.shuffle(shapesarray); this.myimg1=shapesarray.get(0); img1.setbackgroundresource(myimg1); task = new timertask(){ @override public void run() { // todo auto-generated method stub img1.setbackgroundresource(android.r.drawable.btn_default); } }; timer appear = new timer(); appear.schedule(task, 5000); img1.setonclicklistener(new onclicklistener(){ public void onclick(view v) { img1.setbackgroundresource(myimg1); string txt = pname.gettext().tostring(); if(txt.equals("heart")){ if(myimg1 == r.drawable.heart){ correct++; img1.setbackgroundresource(android.r.drawable.btn_default); } } however, after 5 seco...

git - Changing to remote branch before pushing local commits -

i have committed changes in master branch not yet pushed remote. if switch remote branch (and run git pull) not have issue right? you not. how distributed version control systems work. read more here: http://git-scm.com/book/en/getting-started-about-version-control

java - Interfaces, annotations inheritance -

this question has answer here: why java classes not inherit annotations implemented interfaces? 2 answers i've java question interfaces, annotations , 'inheritance' (let me use word if we're talking interfaces). here's example, question: public interface { @somekindofannotation(..) boolean modifyelement(string id) } public class b implements a{ @override public boolean modifyelement(string id){ //implementation } } can method modifyelement(string id) (in class b) inherit annotation @somekindofannotation ? if yes how can access annotation value? import java.lang.annotation.retention; import java.lang.annotation.retentionpolicy; @retention(retentionpolicy.runtime) public @interface somekindofannotation{ public string typeofsecurityneeded(); } public interface { @somekindofannotation(typeo...

node.js - Meteor on Visual Studio 2012 -

i trying use visual studio 2012 ide meteor. i want change behaviour of vs2012 building , publishing. there nothing vs build, when click build button, want vs2012 run meteor command inside ruby command window. and when click publish button, want vs2012 deploy application (appname).meteor.com for both cases need set paths. trying modify project file far no luck... any appriciated.

Changing the user agent using selenium webdriver in Java -

can pls tell me how switch user agent using webdriver in java? tried below, getting errors. firefoxprofile ffp = new firefoxprofile(); ffp.setpreference("general.useragent.override", "mozilla/5.0 (windows nt 6.1; rv:15.0) gecko/20100101 firefox/15.0"); webdriver fd = new firefoxdriver(ffp); desiredcapabilities change user agent. you can achieve calling these methods: setbrowsername(java.lang.string browsername) setplatform(platform platform) setversion(java.lang.string version) or static desiredcapabilities chrome() static desiredcapabilities firefox() static desiredcapabilities iphone() ... more here .

ruby on rails - Error during assets:precompile because of Javascript function default argument -

i use rails 4.0.0, rake assets:precompile on env - production, , have error message: rake aborted! unexpected token operator «=», expected punc «,» (line: 15816, col: 39, pos: 465171) error @ new js_parse_error (/tmp/execjs20130828-23982-1kgxmyu.js:2357:10736) @ js_error (/tmp/execjs20130828-23982-1kgxmyu.js:2357:10955) @ croak (/tmp/execjs20130828-23982-1kgxmyu.js:2357:18665) @ token_error (/tmp/execjs20130828-23982-1kgxmyu.js:2357:18802) @ expect_token (/tmp/execjs20130828-23982-1kgxmyu.js:2357:19025) @ expect (/tmp/execjs20130828-23982-1kgxmyu.js:2357:19163) @ /tmp/execjs20130828-23982-1kgxmyu.js:2357:23402 @ /tmp/execjs20130828-23982-1kgxmyu.js:2357:23466 @ /tmp/execjs20130828-23982-1kgxmyu.js:2357:20786 @ /tmp/execjs20130828-23982-1kgxmyu.js:2357:19536 (in ~/rubymineprojects/hermes/app/assets/javascripts/application.js.erb) ~/.rvm/gems/ruby-1.9.3-p448/gems/execjs-1.4.0/lib /execjs/external_runtime.rb:68:in `extract_result' this construction raises error:...

jQuery Form Calculation - Works, but strange results -

i have form inputs laid out correctly using id's etc. have deployed little jquery function calculate form variables. in essence want calculate total vat , grand total. the code example taken http://forum.jquery.com/topic/calculation-on-form-fields , works ok. multiplication/division works vat addition gives strange results. example data input: sitefee = 3000 qty = 1 vat = 20 the vat function (a * b * c) /100 calculates ok , gives 600 correct grandtotal comes out @ 3000611.6659999999999 doesn't make lot of sense. looks it's trying concatenate values rather adding them together, again that's not occurring either!. jquery code: <script> $(document).ready(function() { function compute() { var = $('#sitefee').val(); var b = $('#qty').val(); var c = $('#vat').val(); var d = $('#incvat').val(); var totalvat = (a...

php - Post value through load Jquery function that not visible in source? -

what want want load page in div $('div[id=main]').load('logo.php?id=<?php echo($id); ?>'); but user can open page typing in url /logo.php?id=123 $('div[id=main]').load('logo.php',{ '12secret2': "hack"}); finding code hide passing value post,that not visible in user source code , able redirect if it's not passed $('div[id=main]').load('logo.php',{ '12secret2': "hack"}); is visible not able hide passing value if conducting client server communication traffic visible client side, no matter do. if want security encode client communication portion in form of binary code , encrypt how. still possible reversed. having said that you should use session maintain data don't want client see

sqlite - Using prepared statements with SQLite3 and PHP -

i'm trying add data database using sqlite3 in php. got working without prepared statements i'm trying make safer. i'm not using pdo. so far following code doesn't work. inserts words ":name" , ":email" database, instead of bound values should be: $smt = $db->prepare("insert names (name, email) values (':name', ':email')"); $smt->bindvalue(':name', $var_name); $smt->bindvalue(':email', $var_email); $var_name = ($_post[post_name]); $var_email = ($_post[post_email]); $smt->execute(); so thought @ first because have single quotes around :name , :email in prepared statement. took out. when post form, puts blank entries database, doesn't insert values of $var_name , $var_email the statement is executing, it's not binding variables don't think. have done wrong? you managed confuse binding functions completely . it bindparam have used if don't have variable as...

Publish web projects with msbuild -

i error message: (setgeneratemanifests target) -> c:\windows\microsoft.net\framework64\v4.0.30319\microsoft.common.targets(4351,5): error : publish valid 'windows application' or 'console application' project types. [e:\myproj\myproj.csproj] running command line: c:\windows\microsoft.net\framework\v4.0.30319\msbuild e:\myproj\myproj.csproj /p:visualstudioversion=11.0 /t:resolvereferences;publish /p:deployonbuild=true /p:configuration=release-dev /p:publishprofile=myapp-dev-web /p:deployonbuild=true /p:password=mypass /p:visualstudioversion=11.0 /l:filelogger,microsoft.build.engine;logfile=e:\temp\web-build.txt;verbosity=diagnostic before run command line succeeds: c:\windows\microsoft.net\framework\v4.0.30319\msbuild e:\mysln.sln /p:buildprojectreferences=true /p:configuration=release-dev msbuild cannot used deploy web projects. the publish feature in msbuild seems used database projects. the solution use msdeploy deploy web projects. ...

Referring to a range of cells inside a formula in VBA Excel -

i'm trying use vba in order calculate fields. when record macro this: activecell.formular1c1 = "=averageif(r4c[-27]:r4c[-6],2012,rc[-27]:rc[-6])" the problem range formula can change. i have integer variable numofmon counts required columns formula first column on sheet. formula above however, uses offsets determine required range because range can change need use numofmon in order use required cells. how can change formula can use properly? i tried using variables this: a = 28 numofmon = 21 activecell.formular1c1 = "=averageif(r4c[-(a-1)]:r4c[-(a-numofmon-1)],2012,rc[-(a-1)]:rc[-(a-numofmon-1)])" but error: "application defined or object defined error" basically activecell.formular1c1 = "=averageif(r4c[-" & (a-1) & "]:r4c[-" & (a-numofmon-1) & "],2012,rc[-" & (a-1) & "]:rc[-" & (a-numofmon-1) & "])"

objective c - Supported AVCaptureSessionPreset on iOS device -

is there way check whether concrete avcapturesessionpreset supported on ios device? want set resolution of avcapturesession, not know how check whether divice capable capture camera frames using selected resolution. avcapturesession * _session; nsstring * _sessionpreset; _sessionpreset = avcapturesessionpreset1920x1080; // here perform check. [_session setsessionpreset:_sessionpreset]; use this: if ([self.capturesession cansetsessionpreset:avcapturesessionpreset1920x1080]) { self.capturesession.sessionpreset = avcapturesessionpreset1920x1080; } else if ([self.capturesession cansetsessionpreset:avcapturesessionpreset640x480]) { nslog(@"set preview port 640x480"); self.capturesession.sessionpreset = avcapturesessionpreset640x480; }

iphone - image optimization reduce the loading time? -

today messed uiimageview. tried add (15.5mb)sized image uiimageview. using uigraphicsbeginimagecontext added image(process bit slow because of large sized image). after tried change brightness , contrast of image using thiscode because of large image size, filters working bit :-<. i worried loading time taken. now have question , image optimisation reduces time taken process?? know reduce size of image. reduce time taken loading image uiimageview? try one.... uiimage *originalimage = ...; cgsize destinationsize = ...; uigraphicsbeginimagecontext(destinationsize); [originalimage drawinrect:cgrectmake(0,0,destinationsize.width,destinationsize.height)]; uiimage *newimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext();

asp.net - call jquery dialog in gridview label mouseover -

how can fire jquery dialog asp.net gridview label mouse hover? tried doesn't work: asp markup <asp:gridview id="gvmain2" runat="server"> <columns> <asp:templatefield> <itemtemplate> <table class="tg-table-plain" style="width:100%"> <tr> <td><asp:label id="grid_lbl" class="grid_lbl" runat="server" text='<%# eval("some_text") %>'></asp:label> </td> </tr> </table> </itemtemplate> </asp:templatefield> </columns> </asp:gridview> javascript $(function () { $("#dialog").dialog({ autoopen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode...

python - Reading UTF8 encoded CSV and converting to UTF-16 -

i'm reading in csv file has utf8 encoding: ifile = open(fname, "r") row in csv.reader(ifile): name = row[0] print repr(row[0]) this works fine, , prints out expect print out; utf8 encoded str : > '\xc3\x81lvaro salazar' > '\xc3\x89lodie yung' ... furthermore when print str (as opposed repr() ) output displays ok (which don't understand eitherway - shouldn't cause error?): > Álvaro salazar > Élodie yung but when try convert utf8 encoded strs unicode : ifile = open(fname, "r") row in csv.reader(ifile): name = row[0] print unicode(name, 'utf-8') # or name.decode('utf-8') i infamous: traceback (most recent call last): file "scripts/script.py", line 33, in <module> print unicode(fullname, 'utf-8') unicodeencodeerror: 'ascii' codec can't encode character u'\xc1' in position 0: ordinal not in...

How to disable drawer indicator movement in Android? -

the navigation drawer icon on top left sliding in bit when navigation drawer open. can disable little animation icon stands still on place time? yes, can it. in oncreate function, when create actionbardrawertoggle override ondrawerslide function that: @override public void ondrawerslide(view drawerview, float slideoffset) {} deleting super call, delete slide movement.

vb.net - Appending a crystal sub report to a normal crystal report. (Suppress empty sections not working) -

Image
i have main crystal report. new section display sub report in it. (report footer b). sub report suppose show values @ end of actual report's data, , does. adds content section 'report footer a' though there no data in section since end of report has been reached @ point sub report starts. have tried changing section 'report footer a's suppress empty section no luck. see attached images. the green in image want shown red report footer section displaying unwanted. the following image of actual design , setting tried change unwanted section. i doubt vb code of concern since al set datasource there , part works fine.

c - Call EVP_Digest() or directly call MD4? Openssl - different timing -

i measured how many times can call md4 in 3 seconds. used md4 openssl. noticed interesting issue. when called md4(array, size, digest); directly, app said 5438501 md4's within 3 seconds. when used evp_digest(array, size, digest, null, evp_md4(), null); said did 4787370 md4's in 3 seconds. so direct call faster using evp api? why that? i don't see why evp_digest should faster method uses :-) using evp_digest delegating "him" (it) use hash algorithm. there overhead in this. or perhaps think evp_digest use "magically faster" md4 algorithm "default" md4 algorithm? from md4/md5 (emphasis added) applications should use higher level functions evp_digestinit(3) etc. instead of calling hash functions directly. and evp_digestinit the evp digest routines high level interface message digests. where high level == slower :-) so why should use evp_digest ? it's explained in same page before: the evp inter...

mysql - How to join and get data with multiple table but the same structure? -

join multiple table , data in 1 line. tbl_2012-08 (structure) id | data_log | data_name 1 | 0001 | first 2 | 0002 | second tbl_2012-09 (structure) id | data_log | data_name 1 | 0003 | third output: data_log 0001 0002 0003 how join 2 table can extract data @ once. case help like: create table or something i don't know why have separate tables each month should able use union query return data both tables: select id, data_log, data_name `tbl_2012-08` union select id, data_log, data_name `tbl_2012-09` i used union all return rows both tables include duplicates (if any). cannot join tables unless have common value in both tables , if have separate tables each month guess don't have common value in both tables. as side note, might include include column can identify table data coming from: select id, data_log, data_name, '2012-08' mth `tbl_2012-08` union select id, data_log, data_name, '2012-09' mth `t...

c# - Display DataGrid Column as Hyperlink Column depending on column value -

i have below datagrid works no problem <asp:datagrid id="filebrowsergrid" runat="server" width="100%" pagesize="14" allowpaging="true" cellpadding="1" gridlines="none" bordercolor="#636e92" borderwidth="0px" autogeneratecolumns="false" onpageindexchanged="filebrowsergrid_pageindexchanged"> <alternatingitemstyle cssclass="mainbodytextalt"></alternatingitemstyle> <itemstyle cssclass="metadatabodytext"></itemstyle> <headerstyle cssclass="metadatabodytitle"></headerstyle> <footerstyle cssclass="blue"></footerstyle> <columns> <asp:boundcolumn datafield="loadedfileid" headertext="loaded file id" visible="false"></asp:boundcolumn> <asp:boundcolumn datafield=...

join - MySQL - Correct approach event counting -

i want list users have particular event count i'm confused on approach take. this database table: create table `event` ( `event_id` int(11) unsigned not null auto_increment, `visitor_id` int(11) default null, `key` varchar(200) default null, `value` text, `label` varchar(200) default '', `datetime` datetime default null, primary key (`event_id`) ) engine=innodb auto_increment=6 default charset=utf8; insert `event` (`event_id`, `visitor_id`, `key`, `value`, `label`, `datetime`) values (1, 1, 'login', null, '', null), (2, 2, 'login', null, '', null), (3, 1, 'view_page', 'hotel', '', null), (4, 2, 'view_page', 'hotel', '', null), (5, 1, 'purchase_hotel', null, '', null); create table `visitor` ( `visitor_id` int(11) unsigned not null auto_increment, `datetime` datetime default null, primary key (`visitor_id`) ) engine=innodb auto_...

tablet - GPS sensor Broadcom GNSS Geolocation -

i have problem sensor gps of broadcom. device tablet latitude 10 dell i use software sensor diagnostic tool test operation of gps, receive message pipe closed (exception hresult: 0x800700e8) see image. have problem?![enter image description here][1] http://imageshack.us/f/5/24mv.png/ hmmm... sign gps can't fix on location. not in location getting gps satellite signal? possible work-around turn on option of determining location via wireless tower triangulation. have tried that?

javascript - Angular expression in attribute -

i have page using angular im implementing popover bootstrap: <img class="state-msg" data-toggle="popover" ng-popover data-content="{{item.status.message}}" data-trigger="hover" data-placement="top" ng-src="{{item.status.stateicon}}"/> the data-content doesnt rendered correctly. returns literaly {{item.status.message}} instead of value of message. does angular have issue w expressions in 'data-' attributes? tnx remove interpolation notation this. {{, }} , angularjs string interpolation rather model binding. data-content="item.status.message"

html - Detecting Touch in a Div Box ? Javascript -

say have setup basic div : <div id='signaturebox'></div> i want register whenever box clicked on / touched in area. trying without success : //register signature callback var signature = document.getelementbyid("signaturebox"); signature.onclick() = function () { alert('signature javascript triggered'); } can ? thanks ! you've put in parentheses unneeded onclick in javascript. correct working code here var signature = document.getelementbyid("signaturebox"); signature.onclick = function () { alert('signature javascript triggered'); } working fiddle here http://jsfiddle.net/7m9ek/1/ difference between html , javascript onclick found here: http://www.w3schools.com/jsref/event_onclick.asp

c# - System.Timers Timer not firing event -

i have start timer on event when eyes closed duration.if timer elapsed screen turns off.if eye open before timer elapsed timer stopped , screen turns on. computationoftimer(); monitors whether eyes open/closed. working fine getting right feedback in console. private void computationoftimer() { if (blink[0] == 100) //if eye closed detected { ctrltimerstop = 3; ctrltimerstart = ctrltimerstart - 1; system.console.write("\n\t eyes closed"); timerstarting(); } else //if eyes open before timer elapsed //we have stop timer { ctrltimerstart = 5; ctrltimerstop -= 1; //system.console.write("\n\t\t\t\t\t opened"); timerstopping(); } } timerstarting() starts timer publi...

python - Vectorization of index for flat nested datastructure -

is there function in linear algebra takes vector [a, b, c] , returns vector [bc, c, 1] ? or perhaps [abc, bc, c] or [abc, bc, c, 1] ? for homework vectorizing indexing function, take in-product of vector [abc, bc, c, 1] (where letters represent maximum value dimension) vector [0, a, b, c] (where letters represent wanted index each dimension) results in index flat data structure. i want vectorize getting indexing vector [abc, bc, c] well, can't come matrix or vector creates first vector [a, b, c] . i use python.

c++ - Linphone Compiling - Mingw 64bit - GNU gettext tools not found; required for intltool -

i attempting compile linphone windows, receive configure: error: gnu gettext tools not found; required intltool when run ./configure --prefix=/opt/linphone --enable-shared --disable-static. how can solve problem? linphone uses gtk+, right? far know, precompiled development version of gtk+ windows should allready include gettext. run ./configure --help see how tell configure find gtk+ , gettext

linux - What is the best way to pass a command alias/function without reducing the functionality of said command? -

i have function ll expands this: function ll () { ls -lh --color "$@" | grep "^d"; ls -lh --color "$@" | grep "^-" | grep -v "~"; ls -lh --color "$@" | grep "^l" } what sort listed folder showing directories first, files, links. however, find such approach reduces functionality of ls command, instance if try call ll /bin /tmp , mix of files both folders. is there general rule of thumb pass command aliases/functions such full functionality of commands not reduced? if there isn't, how can fix ll command retain sorting, full functionality of ls not lost? please note have bash version 3.2.25(1)-release on system (ls version 5.97), --show-directories-first flag not available me. edit: this function ended using, modified ll work without args: function ll () { if [ $# -eq 0 ]; set -- .; fi d; ls -lh --color "$d"|awk '$1~/^d/{i=0} $1~/^l/{i=1} $1~/^-/{i=2} nf...

get number of columns of a particular row in given excel using Java -

i want number of columns of particular row in excel. how possible? used poi api but columns count 7 . try { fileinputstream = new fileinputstream(file); workbook = new hssfworkbook(fileinputstream); sheet sheet = workbook.getsheet("0"); int numberofcells = 0; iterator rowiterator = sheet.rowiterator(); /** * escape header row * */ if (rowiterator.hasnext()) { row headerrow = (row) rowiterator.next(); //get number of cells in header row numberofcells = headerrow.getphysicalnumberofcells(); } system.out.println("number of cells "+numberofcells); } i want number of columns @ particular row number 10 . excel columns not same there 2 things can do use int noofcolumns = sh.getrow(0...

xslt - Transforming XML mixed nodes with disable-output-escaping -

variations on question have been posted, couldn't find address base case. thought have canonical answer simplest version of problem. question assumes xslt 1.0. i have xml document contains mixed nodes, e.g.: <paragraph> text <bold>bold</bold> , <italic>italicized.</italic> </paragraph> i typically use transformation looks this: <xsl:template match="bold"> <b><xsl:apply-templates/></b> </xsl:template> <xsl:template match="italic"> <i><xsl:apply-templates/></i> </xsl:template> <xsl:template match="paragraph"> <p><xsl:apply-templates/></p> </xsl:template> which works great until want use disable-output-escaping="yes", attribute of xsl:value-of. there way select text-portion of mixed node can apply value-of independent of embedded nodes? this, of course, doesn't work because los...

javascript - Refresh/reload the content in Div using jquery/ajax -

i want reload div on click of button. not want reload full page. here code: html: <div role="button" class="margintop50 marginbottom"> <input type="button" id="getcameraserialnumbers" value="capture again" class="disabled" /> <input type="button" id="confirmnext" value="confirm & proceed" class="disabled marginleft50" /> </div> on click of <input type="button" id="getcameraserialnumbers" value="capture again"> button <div id="list">....</div> should reload without loading or refreshing full page. below jquery tried, not working:- $("#getcameraserialnumbers").click(function () { $("#step1content").load(); }); please suggest. here div on page, contains pictures , serial numbers of products... coming database 1st time on page load. user faces issue he...

gwt - Double Click event for DataGrid -

i added double click event datagrid, doesn't work correctly. code handles single click, not handle double click. please help. private datagrid<contract> table = new datagrid<contract>(); table.addcellpreviewhandler(new handler<contract>() { @override public void oncellpreview(final cellpreviewevent<contract> event) { if (browserevents.dblclick.equals(event.getnativeevent().gettype())) { //it doesn't handle window.alert("tro-lo-lo"); } if (browserevents.click.equals(event.getnativeevent().gettype())) { //it handles window.alert("tru-la-la"); } } }); datagrid has many things in common celltable. solutions this question must work too: using cellpreviewhandler count time between 2 clicks or can add doubleclickhandler using adddomhandler method

c# - Debug worker project run as a process from another project in VS -

i have 2 projects. 1 of them worker application stuff. other 1 gui worker (gui runs async processes instances of worker). worker project output .exe file used gui. how debug worker? there possibility of doing it? annoying thing can create command line interface worker , generate kind of reference params run separatelly, problem when want more 1 instance (i have program generates data async have find error in code works fine in 1 process, buggy in more one). you don't give info interaction between gui , worker, if attaching process hard (typically beacuse worker runs briefly), more usable scenario add configuration option gui add argument worker command line, on worker responds debugbreak. example worker's main be var args = parsearguments(); //check if string 'waitfordeugger' on command line if( args.requestsdebug ) system.diagnostics.debugger.break(); .... and gui invokes worker this: var args = getargumentsforworker(); if( somespecialdebugopti...

sql server - Any cleaner or alternate way to write sql join script -

i have following tables: table2 studentnumbers examtype ------------------------ 1234 1 2343 2 3345 5 3454 1 5465 2 ... table1 studentnumbers examtype examdate school area info ------------------------------------------------------------------ 1234 1 0825 warren ny 0x504b03042d0 1234 1 0829 north nj 0x63d86e1ffff 1233 2 0921 north nj 0xa001400646f 2343 1 0922 warren ny 0x01400646174 2343 1 0925 north ny 0x100100070se ... i trying write query following results: studentnumbers examtype examdate school area info ----------------------------------------------------------------- 1234 1 0829 north nj 0x63d86e1ffff ...

python - Identifying variables in equation -

i'm trying create calculator receive input formula , data respective variables. i trying made user friendly possible, in mind user insert formula , code identify variables in formula. after program ask values correspond each variable. and question is: "how can parse string in search of variables?" have able identify things "pi" , trigonometric functions, since variable angle. is there simple way this? edit: code have far, first aproach on user execute code. trying evade using eval , exec from scipy import stats import matplotlib.pyplot plt import numpy np math import* import math recept = "." print("bem vindo calculadora de incertezas com base no metodo monte carlo") formula = input("insira formula desejada:") while (recept != ""): recept = input("defina variaveis de acordo com o exemplo:\n ex: p = (media, desviopadrão)") print (recept) #aproach one: execute code inserted user: ...

Spring + Thymeleaf - how to implement pagination for a list -

i developing simple application using spring + thymeleaf. on 1 of pages have list of items needs paginated. ideally send currpageno (the number of current page) , numofpages (the total number of pages) variables view , rest of work done in there (this presentation issue , has nothing business logic). if, however, cleanest solution require me computation in controller first, accept small evil. i list of pages in following form. <prev | 1 | ... | 3 | 4 | 5 | 6 | 7 | ... | 15 | next> i able come following solution. works believe agree messy , hard read. moreover, in addition currpageno , numofpages had send 2 more variables view. ideal solution not require me that. firstpageno = math.max(2, currpageno - 2) lastpageno = math.min(numofpages - 1, currpageno + 2) the current version of code follows. <ul> <li th:if="${currpageno &gt; 1}"> <a th:href="@{/items.html(pageno = ${currpageno - 1})}" href=""...

io - difference between scanf("%c" , ..) and getchar() -

i think scanf("%c" , &addr); equal getchar() before test this: #include<stdio.h> int main() { int i; scanf("%c",&i); printf("%d\n", i); if(i == eof) printf("eof int type , char input\n"); =getchar(); printf("%d\n", i); if(i == eof) printf("eof int type , char input\n"); } i got output when use "ctrl+d" twice: -1217114112 -1 eof int type , char input since eof -1 in int type ,i try use scanf("%d",&i); replace scanf("%c",&i) , same output. i got confused. can explain me? ----------------------------------edit----------------------------------------------- i want know behavior of scanf("%c",i) of ctrl+d , test: #include<stdio.h> int main() { int i; int j; j = scanf("%c",&i); printf("%c\n", i); printf("%d\n", j); if(i ...

how to jump from one page to another page in bottle? -

in bottle, how jump form 1 url url in 1 page? import webbrowser webbrowser.open('http://localhost:8080/login.html') i tried above, it's not been opened in 1 page! want redirect, not raise 303 or 302 error! it sounds maybe (?) you're looking way redirect incoming http requests. mention not wanting return 302 or 303 (why not, exactly?), here's how you'd 301 ("permanently moved"): @route('/hello') def hello(): bottle.redirect('/the/destination/page', 301)

rest - Convert a string to another Python class -

is there anyway create class model? for example, have model.py, 1 of class inside contains: class customers(ndb.model): lastname = ndb.stringproperty() firstname = ndb.stringproperty() license = ndb.stringproperty() birthdate = ndb.dateproperty() remarks = ndb.textproperty() i know can models using dir(model) , , outputs like: ['customers', 'customeraddresses','whatever','__builtins__', '__doc__', '__file__', '__name__', '__package__', 'ndb'] however, there way can use these string inside dir(model) automatically generate class, like: class restcustomers(webapp2.requesthandler): #some code gets model class attributes , displays json string customers = # customer attributes model self.response.headers['content-type'] = "application/json" self.response.write(json.dumps(customers)) i'm not sure if possible, kind of way javascript works, wherein like var mod...

My Java Tortoise and Hare Applet will not run -

i trying create/simulate tortoise vs. hare race. random number generator used make competitors move....the possible moves being :a distance of 3 squares right, 1 square right, 6 squares left, 9 squares right, 1 square right, 12 squares left, 2 squares left, fall asleep. course plotted 50 squares of positions each player having own respective lanes , starting @ position 1. problems applet compiles, not run when try open html file in browser. on right track? how run....and when runs, properly? import java.awt.*; import java.applet.*; public class project2 extends applet { image tortoise, hare; int tortx = 250, harex = 250; final int torty = 100, harey = 300, width = 15, height = 50; int turn; string turnnum; int move; string tmove, hmove; public void init() { tortoise = getimage( getdocumentbase(), "images/tortoise.gif" ); hare = getimage( getdocumentbase(), "images/hare.gif" ); move = 0; turn = 0; } public void control() { whil...

css - Why doesn't margin hold for td? -

Image
this question has answer here: why margin padding doesn't work in table td , tr? 3 answers i have spent last several hours trying understand why margin css property (at least) td elements ignored. for example, fiddle shows "simulation" of table row using div elements, followed "real" table element single tr . (i give full code @ end of post.) div simulates tr has been given class tr , and, similarly, div s simulate td s have been given class td . css div.tr has been kept close possible tr (the exceptions css directives not apply tr in case). similarly, css div.td , td should identical. in particular: div.td,td{border:1px solid black;} div.td,td{margin:15px;padding:5px} furthermore, each div.td , each td contains empty div element, following dimensions: div.td > div,td > div{width:90px;height:60px;} as can se...

python - Combining all combinations of two lists into a dict of special form -

i have 2 lists: var_a = [1,2,3,4] var_b = [6,7] i want have list of dicts follows: result = [{'a':1,'b':6},{'a':1,'b':7},{'a':2,'b':6},{'a':2,'b':7},....] i think result should clear. from itertools import product = [1,2,3,4] b = [6,7] [dict(zip(('a','b'), (i,j))) i,j in product(a,b)] yields [{'a': 1, 'b': 6}, {'a': 1, 'b': 7}, {'a': 2, 'b': 6}, {'a': 2, 'b': 7}, {'a': 3, 'b': 6}, {'a': 3, 'b': 7}, {'a': 4, 'b': 6}, {'a': 4, 'b': 7}]

Run a Docker Image as a Container -

i built docker image dockerfile. see image built successfully, do it? shouldn't able run container? new docker misunderstanding on end, great. the specific way run depends on whether gave image tag/name or not. $ docker images root@dockertest:~# docker images repository tag id created size ubuntu 12.04 8dbd9e392a96 4 months ago 131.5 mb (virtual 131.5 mb) with name (let's use ubuntu ): $ docker run -i -t ubuntu:12.04 /bin/bash without name, using id: $ docker run -i -t 8dbd9e392a96 /bin/bash please see https://docs.docker.com/engine/reference/run/ more information.

PHP/Python Replace first string in a line with another string -

i'm trying replace first ":" "space" , don't have clue on how it! maybe guys can me. in text: ab:cd:ef:gh:ij:kl:mn 12:ab:c2:f3 303:mx: dk:ad:y4:d3 12:31:44:ac:210 sda: the output : ab cd:ef:gh:ij:kl:mn 12 ab:c2:f3 303:mx: dk ad:y4:d3 12 31:44:ac:210 sda: maybe me out. thanks in advance in python, a = 'ab:cd:ef:gh:ij:kl:mn' = a.replace(':', ' ', 1) yields ab cd:ef:gh:ij:kl:mn

oracle10g - Connect Oracle Forms builder to Oracle XE database, both 10G -

i have created default database in oracle xe (the hr user , schema) i have oracle developer suite - dev10g, installed on computer. when load forms builder , use "connect" screen, asks me username, password , database. i know username , password hr , hr, cant seem connect. i believe need edit tnsnames.ora file in oracle xe install, i'm not sure if i'm correct. is need , if can tell me need paste in here. you need configure devsuitehome environment @ oraclexe tnsnames.ora, or copy tns entry oraclexe environment devsuitehome one... in environments, set tns_admin registry key in devsuitehome point oraclexe tns_admin directory...

c# - How do I write a custom marshaler which allows data to flow from native to managed? -

in attempting write custom marshaler related question ( p/invoke c c# without knowing size of array ), have come across cannot understand. first ever custom marshaler have written no doubt i'm missing obvious due ignorance. here's c# code: using system; using system.runtime.interopservices; using system.text; namespace custommarshaler { public class mycustommarshaler : icustommarshaler { static mycustommarshaler static_instance; public intptr marshalmanagedtonative(object managedobj) { if (managedobj == null) return intptr.zero; if (!(managedobj int[])) throw new marshaldirectiveexception("variablelengtharraymarshaler must used on int array."); int[] arr = (int[])managedobj; int size = sizeof(int) + arr.length * sizeof(int); intptr pnativedata = marshal.allochglobal(size); marshal.writeint32(pnativedata, arr.length); ...

jquery - Ajax with WordPress Functions.php always returns 0 -

i know question has been asked lot, apologize redundancy. however, can not seem make return value other 0. below code have included @ bottom of functions.php within twenty-twelve theme: add_filter( 'views_edit-destination', 'so_13813805_add_button_to_views' ); function so_13813805_add_button_to_views( $views ) { $views['my-button'] = '<button id="update-dest-cache" type="button" class="button" title="update destinations cache" style="margin:5px" onclick="updatedestcache()">update destinations cache</button>'; $views['my-button'] .= ' <script type="text/javascript" > function updatedestcache() { jquery.ajax({ type: "post", url: ajaxurl, datatype: "json", action: "testajaxfunction", success: funct...

MySQL syntax error inserting php strings into table -

i'm parsing website's table querypath , trying put results mysql database. table looks this: mysql_query("create table airplanes ( flightid varchar( 50 ) primary key not null, flightlink text( 20000 ) not null, orig text( 20 ) not null, dest varchar( 20 ) not null , time varchar( 5 ) not null ); "); i trying save airplanes using flight numbers ids. this how extract table , echos shoving variables' contents. $flightdata = $row->find('td'); // $flightid = str_replace(" ", "", $flightdata->eq(1)->text()); $flightid = mysql_real_escape_string( trim( $flightdata->eq(1)->text() ) ); $flightlink = mysql_real_escape_string( $flightdata->eq(1)->html() ); $orig = mysql_real_escape_string( "rome (fco)" ); $dest = mysql_real_escape_string( trim( $flightdata->eq(2)->text() ) ); $time = mysql_real_escape_string( trim( $f...

ios - What is the best way to have multiple variations of a product in Xcode? -

Image
i have project maintain client; let's call mydataassistant. when project goes beta, client likes have "separate app" built them, create using different provisioning profile , modified bundle identifier (mydataassistant-beta). it's pain going , forth , changing bundle identifier, code signature settings, , icon. understand can have multiple targets , multiple build settings (within each target?) in project, i'm not clear on difference is, or how use them appropriately. additionally, client third version read-only capabilities. can accomplish making flag return part of code, if flag toggled in build (target?) settings. please advise on how manage kind of project multiple "variations" of build. add new configuration project duplicating release 1 example. give name "beta" add user-defined build setting call my_data_assistant_bundle_id_suffix example , set value -beta beta configuration. edit mydataassistant-info.p...

html - Form onsubmit issue with javascript -

ok confused on whole javascript in html stuff. trying validate form either "onblur" or on submit external file. here html code works first field: <script> function notempty(rep, errmsg) { var errmsg = "please enter in rep"; var rep = document.getelementbyid('submitted_by_hrrep'); if(rep.value == '') { alert(errmsg); hrrep.focus(); return false; } return true; } </script> this in body of form near field. <script type="text/javascript">document.getelementbyid("submitted_by_rep").onblur=notempty;</script> so work , pop alert tells em go can't work doing rest (15 fields) of form. "onsubmit" confusing me , think it's right not sure. <form onsubmit="return formvalidation()" method="post" action="process.asp" > anything help edit function validate() { if(document.newempreq...