Posts

Showing posts from May, 2012

sql setting xml property through a loop -

trying desperately combine 2 simple answers need. sql loop , set properties sql set xml value set @i := 0; select *, @i := @i + 1 set xml = updatexml(xml,'comic/pagenumber', '<pagenumber>'.@i.'</pagenumber>') `comics` order extractvalue(xml,'comic/pagenumber')+100000 asc this close have come, know select / order works separate trying set xml property. side note: +100000 work around treat value numeric sorting. otherwise 11 < 2 100011 > 100002 i have tried this set @i := 0; update comics, @i := @i + 1 newpagenumber set xml = updatexml(xml,'comic/pagenumber', '<pagenumber>'.@i.'</pagenumber>') 1 order extractvalue(xml,'comic/pagenumber')+100000 asc i think don't know how combine select , update update comics inner join ( select c.id, @row:=@row+1 rownum (select @row:=0) x cross join comics c order extractvalue(xml,'comic/pagenumber')*1.

pipe - Python subprocesses experience mysterious delay in receiving stdin EOF -

i reduced problem seeing in application down following test case. in code, parent process concurrently spawns 2 (you can spawn more) subprocesses read big message parent on stdin, sleep 5 seconds, , write back. however, there's unexpected waiting happening somewhere, causing code complete in 10 seconds instead of expected 5. if set verbose=true , can see straggling subprocess receiving of messages, waiting last chunk of 3 chars---it's not detecting pipe has been closed. furthermore, if don't second process ( doreturn=true ), first process never see eof. any ideas what's happening? further down example output. in advance. from subprocess import * threading import * time import * traceback import * import sys verbose = false doreturn = false msg = (20*4096+3)*'a' def elapsed(): return '%7.3f' % (time() - start) if sys.argv[1:]: start = float(sys.argv[2]) if verbose: chunk in iter(lambda: sys.stdin.read(4096), ''): print >

php - smtp relay - gmail - swiftmailer: Expected response code 220 but got code "" -

i using gmail smtp server swiftmailer class. however getting expected response code 220 got code "", message "" in "\classes\swift\transport\abstractsmtptransport.php" what mean? i think means sent blank line smtp server. make sure none of commands have line feeds in them. can log transaction , paste copy of log? see here details logging http://swiftmailer.org/docs/logger-plugin

drupal - What could cause $user to change while logged in? -

i seeing weird bug after logging in user "foo" username in logged in block shows "bar" i.e. $user object has somehow switched foo bar. i've checked custom modules , theme make sure there no voodoo going on when use global $user; no leads. also placed additional watchdog messages inside user_authenticate , user_authenticate_finalize user object seems behaving. how else can track error down? a user switch can happen simple code : global $user; $some_user = user_load('uid' => some_uid); $user = $some_user; perhaps can try looking @ assignments last 1 or uses of global $user

Extending an object with a tree-traversing method in javascript -

i have custom object contains array (called "children") objects of same type stored, in result creating tree. let's looks that: function customobject(){ if (this instanceof topic) { this.text = "test"; this.children = []; } else return new customobject(); } now, add "forall" method object execute function provided argument, on elements of tree in depth-first fashion. what's best way it? something this? customobject.prototype.forall = function(func) { // process object first func(this); // process children (var = 0; < this.children.length; i++) this.children[i].forall(func); }

javascript - jQuery ajax doesn't work with last version of chrome -

hey guys, have little problem simple ajax request. can't figure out why jquery ajax method doesn't work last version of chrome ... on ff work great on opera on chrome don't response , no errors. js code: function load(idno){ var url = 'index.php'; $.get( url, { pagina:"ajax", show:"cars", brand:idno }, function(data) { document.getelementbyid("model").innerhtml=data }, "html" ); } any reason you're not using jquery.load() ? eg $('#model').load('index.php', { pagina: 'ajax', show: 'cars', brand: idno }); at guess, i'd problem innerhtml call. more robust method use jquery.html() , eg function(data) { $('#model').html(data); } edit just whipped test , works fine <?php // test.php echo '<pre>', print_r($_request, true), '</pre>'

select - swt table change selection item color -

i'm using standard swt table which, may know, default when item selected colored blue (windows standard). when selection inactive, turns light gray. override both colors... i've searched on web find old code no longer seems work table widget. below sample code trying overwrite default color doesn't seem working (please excuse dirty code, trying work): table.addselectionlistener(new selectionlistener() { @override public void widgetselected(selectionevent event) { color rowselectioncolor = new color(display.getcurrent(),new rgb(235, 200, 211)); tableitem item =(tableitem)event.item; item.setbackground(0,rowselectioncolor); item.setbackground(1,rowselectioncolor); item.setbackground(2,rowselectioncolor); } @override public void widgetdefaultselected(selectionevent event) { co

Building Android openssl using NDK doesn't make arm4 assembly files properly -

openssl included in android operating system , , google includes arm4/thumb assembler code in builds (aes/asm/aes-armv4.s, bn/asm/armv4-mont.s, sha/asm/sha1-armv4-large.s, sha/asm/sha256-armv4.s, sha/asm/sha512-armv4.s). have the android openssl building ndk-build builds plain c aes_core.c, not arm4 files. creates .o files, can't find *.o.d.org files, have no idea come from. any ideas on this? /usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc -mmd -mp -mf /users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -d__arm_arch_5__ -d__arm_arch_5t__ -d__arm_arch_5e__ -d__arm_arch_5te__ -wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -i/users/hans/code/eighthave/openssl-android -i/users/hans/code/eighthave/openssl-android/crypto/asn1 -i/

java - Add a click handler to a HorizontalPanel in GWT -

how add click handlers horizontalpanel ? it worked use of adddomhandler() in newer gwt versions, had downgrade gwt 2.0.4 isn't supported. used this: horizontalpanel.getwidget(1).adddomhandler(someclickhandler,clickevent.gettype()); //or horizontalpanel.adddomhandler(someclickhandler, clickevent.gettype()); use focuspanels instead of hooking native events. catch clicks whole panel: focuspanel wrapper = new focuspanel(); horizontalpanel panel = new horizontalpanel(); wrapper.add(panel); wrapper.addclickhandler(new clickhandler() { @override public void onclick(clickevent event) { // handle click } }); // add wrapper parent widget held panel. or catch clicks inside cell in horizontalpanel: iswidget child; // widget horizontalpanel panel = new horizontalpanel(); focuspanel clickbox = new focuspanel(); clickbox.add(child); panel.add(clickbox); clickbox.addclickhandler(...);

visual studio - Develop with VS and VS Express? -

i develop c++ , c# applications vs2008. i have need have ide on our target demonstrator platform debug , fix etc. use express editions task or there major drawbacks? any experience welcome, vs2010. you have tweak things in order compile 64 bit (true 2008, that's easy in 2010), no major functional drawback, except binary worrier says can frustrating however commonly accepted have full ide on target demo platform without buying license, why not deploying full ide on it? from licensing developer tools – per user license you must acquire license each user permit access or use software. may install number of copies on number of devices access , use 1 user design, develop, test , demonstrate programs. licensed users may access software.

What is XOauth and its relationship with OAuth? -

some opensocial containers use xoauth_security_token signing requests, instead of oauth_token , oauth_token_secret . is xoauth alternative oauth?(*) behind xoauth , official spec? casual googling lead me xoauth.py google-mail-xoauth-tools project states it's "utilities xoauth authentication". (*)aside: mustn't be, because container uses other oauth_xxx parameters alongside xoauth_xxx ones. where did see use of xoauth_security_token ? googled , did not single hit. xoauth sasl authentication mechanism based on oauth signatures. can used smtp or imap authentication instance. there's proposal make ietf standard, official sasl mechanism. supported google , works gmail smtp , imap access. for more information how implement , use it: http://code.google.com/apis/gmail/oauth/protocol.html hth.

Page navigation with JSF -

hy, simple question, don't know answer. i have project, myproject. in webcontent have file home.xhtml, leave.html , have 2 other folders cats , dogs. in cats directoy have page cat.xhtml, , in director dogs have page dogs.xhtml. i want go each page (home,cats, dogs) page leave.html have in each file commandlink `<h:form> <h:outputlink value="leave.html" action="#{mybean.leave}"> <f:verbatim>leave</f:verbatim> </h:outputlink> </h:form>` mybean in method leave returns string "leave" `<navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>leave</from-outcome> <to-view-id>/leave.html</to-view-id> </navigation-case> </navigation-rule>` but doesn't work. tried using <to-view-id>../leave.html</to-view-id> or add new folder leave , put in there leave.html page used <to-

php - option tags created from Zend_Form_Element_Select wrong -

i'm using zend_form_element_select create select list, when view source, options tags this: <select name="things" id="things"> <option value="thing1" label="thing 1">thing 1</option> <option value="thing2" label="thing 2">thing 2</option> <option value="thing3" label="thing 3">thing 3</option> </select> the label attribute doesn't need in there. has no use being in there. value should match what's in label. here's code used: $things = new zend_form_element_select('things'); $things->setlabel('things:'); $things->setrequired(true); $things->addmultioptions(array( 'thing1'=>'thing 1', 'thing2'=>'thing 2', 'thing3'=>'thing 3' )); $this->addelement($things); am going wrong or way zend works , have deal it? the array pass

security - Is the client allowed to choose challenge (nonce) in Digest HTTP authentication? -

digest authentication looks flavor of challenge-response mechanism: theres's random string mixed password (md5 or something) both client , server , result of such mixing sent on network. usually challenge ("nonce") chosen server , sent client. wikipedia article on digest authentication lists sample "session" - challenge ("nonce") chosen server there. tested same iis on machine - again, challenge generated iis. but in posts like one challenge generated client - client generates random string , sends request challenge , product of password , challenge. is latter allowed , accepted? client allowed choose challenge ("nonce")? in http digest authentication, server generates nonce. however, http authentication extensible, , applications may implement other methods of authentication (beyond basic , digest). in example link to, client authenticating using wsse , form of authentication (mainly soap-based) web services. in wsse,

fullcalendar - The calendar is black on pageload but works of i click the next day -

i have fullcalendar loaded in div in webpage. when page loads, has buttons there no grid display days, no space. however, if click next/prev or of buttons calendar show properly. ive tried spesificly load today: $('#userboxcalendar').fullcalendar('today'); but not work :( idea? your javascript loading before css script.... try moving script bottom of page , css load top... or make inline on page.... if using ajax load div use callback done loading re-render stated here , above. http://arshaw.com/fullcalendar/docs/display/render/ i loaded 1 in colorbox... , used colorbox done loading , works great... works when loading google maps... map.render or that...

php - input hidden value limit in html -

i trying put entire 20kb jpg file content in input hidden value, when receive data 4kb file. problem ? i using following code read jpg server , upload server. <?php $filename = "filetocopy.jpg"; $filedata = file_get_contents($filename); file_put_contents("filetocopy1.jpg", $filedata); echo "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\"><html><head><title></title>"; echo "<script language = "."javascript"." type"."test/javascript".">"; echo "function dosubmit() {"; //alert('function called.'); echo "document.forms[\"postjsform\"].submit();"; echo "}"; echo "</script>"; echo "</head>"; echo "<body onload='dosubmit();'>"; echo "<!-- start of form -->"; echo "<form id=\"postjsform\" actio

working with excel files in php -

what best php library use php read/write , display components of excel files on web based pages? i use phpexcel writing files (in fact, use it) http://phpexcel.codeplex.com/ and try http://sourceforge.net/projects/phpexcelreader/ for reading have no experience reading excel files in php, writing them.

How to fetch pretty advanced relation in Drupal 6 - Views 2? -

i have 3 content types: artist , artwork , exhibition . exhibition has field 'artworks' (unlimited values). artwork has field 'artist' (1 value, required). and there relation can't seem find views: want exhibitions artist ever participated in. means: on artist page, show exhibitions artworks of artist ever in. the problem (i think) 1 field (exhibition.artworks) has many values. yet artwork.artist has 1 value. i don't know problem =) it's not working , i've tried million things. @ point, i'll accept writing sql queries, drupal content database incredibly untransparent have no idea query , how. obviously i'd happiest unhacked views solution, i'm not getting hopes up. experience relations this? you can build dependent relationships should accomplish this. use relationship (artwork) on exhibition.artworks , relationship (artist) on (artwork).artist it easier understand you're doing exports of views & content types

will disabling javascript in browser affect ajax calls and js functions -

i have doubt i guess there options disabling javascript in browser. if ajax , javascript functions wont work isnt it? if there solution? . yes disabling js disable js... no ajax it's done js... only solutions server-sided fallbacks.

c++ - Get std::list by reference -

i have poly3d class in c++, has sole member: list<point_3> using namespace std; struct poly3d { public: poly3d(const list<point_3> &ptlist); private: list<point_3> ptlist; }; my question is, how ( in sense of c#) reference, same copy returned every time access poly3d.ptlist ? #include <list> using namespace std; struct point_3{ }; struct poly3d { public: poly3d(const list<point_3> &ptlist); list<point_3>& getpointlist(); private: list<point_3> ptlist; }; list<point_3>& poly3d::getpointlist(){ return ptlist; } int main(void){ list<point_3> mylist; poly3d mypoly(mylist); list<point_3>& mylistref = mypoly.getpointlist(); }

logging - Tools for reducing large logs files -

i work huge log files - 1gb or have many user sessions in while care 1 session. i can narrow-down general area of file covers session interested in searching session id (takes 2+ minutes). after want remove data before , after events occurred in user session make subsequent searches faster (because have narrowed down area of interest now). i load huge log files in google chrome , use search highlight feature displays area of interest markers on scrollbar, doesn't work on files bigger 200mb , doesn't allow me remove irrelevant parts of logs make subsequent searches faster. i imagine common problem. huge time-saver if can find such tool. thanks. many unix command line tools kind of stuff. grep allows find lines containing string or pattern (session id). default returns row, can return n rows before or after.

website - TFS Team Build - Build fails if app_code references another project in the solution -

i've using team build 2010 time, , stopped working after changes in code. more specifically, when file in app_code used reference project in solution. error message: c:\builds\venus\sources\branches\xxx\xxx\xxx\app_code\xxx.cs (9): type or namespace name 'xxx' not exist in namespace 'xxx.xxx' (are missing assembly reference?) is known problem? there workaround ? i tried deleting , redownloading whole workspace got no luck. thanks in advance this happened me after doing move web application project web site project . if project web application project, move files out of app_code folder , delete it.

email - SPF record clarification - Is this set correctly? -

i not familiar spf records need bit of setting spf record correctly. below record created using microsoft spf record wizard v=spf1 mx ptr ip4:xxx.xxx.xxx.a ip4:xxx.xxx.xxx.b include:aspmx.googlemail.com include:mydomain.com -all as can see use google apps, have 2 web servers sending mail on behalf of mydomain.com. listed 2 ips both web servers relating mydomain.com , mail mydomain.com sent both server (web app). i set ptr xxx.xxx.xxx.a @ isp. considering , fact above mentioned places mail generated mydomain.com above record correct? most of results of spf specification depend on mx entries of domain. here is: a : allow host, record of domain pointing (but not subdmains, or hosts inside domain) mx : allow hosts mx record pointing them ptr : allow hosts ptr record matches record. use when control both reverse , forward domains, , not results in dns overhead. ipv4:... : allow named ip. include:... : include servers allowed spf rules in named domain. google uses

plsql - pl sql: trigger for insert data from another table -

there table old , similar one, new. want insert in existing process fills table old trigger event each new inserted row, event insert newly inserted row table new, well. inside body of trigger, need include query below aggregates values of old before inserted in new: insert new select (select a.id,a.name,a.address,b.jitter,a.packet,a.compo,b.rtd,a.dur old a, select address,packet,compo, avg(jitter) jitter, avg(rtd) rtd old group address,packet,compo ) b a.address=b.address , a.packet=b.packet , a.compo=b.compo; can correct possible mistakes or suggest other trigger syntax on statement below? create or replace trigger insertion after update on old each row begin select query above end; in each row trigger cannot query table itself. mutating table error message if do. recommend use triggers basic functionality such handing out id numbers , basic checks. if use triggers more complex tasks may end system that's hard debug , maintain be

Can we get Preapproval key by sending request to PayPal server from iPhone? (For testing) -

i trying fetch preapproval key paypal server right iphone app instead of setting separate server that. (for testing purpose). can achieved? i have used following code that: nsstring *url = @"requestenvelope.errorlanguage=en_us&cancelurl=http://www.bytelyte.com/paypal_x_nvp_tester.php?cmd=test&currencycode=usd&endingdate=27.05.11 &maxamountperpayment=5&maxnumberofpayments=2&maxtotalamountofallpayments=5&pintype=not_required&returnurl=http://www.bytelyte.com/paypal_x_nvp_tester.php?cmd=test&startingdate=27.01.11&senderemail=krish_1297240918_per@gmail.com//www.bytelyte.com/paypal_x_nvp_tester.php?cmd=test&startingdate=27.01.11&senderemail=krish_1297240918_per@gmail.com"; nsdata *postdata = [url datausingencoding:nsasciistringencodinallowlossyconversion:yes]; [request setcachepolicy:nsurlrequestuseprotocolcachepolicy]; [request settimeoutinterval:1.0]; [request sethttpmethod:@"post"]; [request setvalue:@"xx

c# - Regex Problems, extracting data to groups -

how love regex! i have string mangled form of xml, like: <category>dir</category><location>dl123a</location><reason>because</reason><qty>42</qty><description>some desc</description><ipaddress>127.0.0.1</ipaddress> everything on 1 line, 'headers' different. so need extract information string above, putting dictionary/hashtable -- string mystring = @"<category>dir</category><location>dl123a</location><reason>because</reason><qty>42</qty><description>some desc</description><ipaddress>127.0.0.1</ipaddress>"; //this extract name of label in header regex r = new regex(@"(?<header><[a-za-z]+>?)"); //create collection of matches matchcollection mc = r.matches(mystring); foreach (match m in mc) { headers.add(m.groups["header"].value); } //this try , values. r = new regex(@"(

SQL Server 2005 mixed mode authentication -

Image
just wondering possible use mixed mode on sql server 2005 user sa? know how in management studio isn't enough user "sa". think needs done else where. i trying connect database via console app keep getting error "the account disabled" cheers louis yes http://msdn.microsoft.com/en-us/library/ms144284(v=sql.90).aspx how to: http://msdn.microsoft.com/en-us/library/ms188670(v=sql.90).aspx if didn't enable mixed mode authentication during setup need in server properties > security (you can use management studio - see above link). need enable sa login , set appropriate password. be sure restart sql service after changing authentication mode changes take effect.

asp.net mvc - How to redirect HTTP to HTTPS in MVC application (IIS7.5) -

i need redirect http site https, have added below rule getting 403 error when tried using http://www.example.com , works fine when type https://www.example.com in browser. <system.webserver> <rewrite> <rules> <rule name="http https redirect" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{https}" pattern="off" ignorecase="true" /> </conditions> <action type="redirect" redirecttype="found" url="https://{http_host}/{r:1}" /> </rule> </rules> </rewrite> </system.webserver> you can in code: global.asax.cs protected void application_beginrequest(){ if (!context.request.issecureconnection) response.redirect(context.request.url.tostring().replac

ruby - when i type commands in the terminal i get an error - "command not found" -

gal-harths-imac:~ galharth$ ruby -v -bash: ruby: command not found gal-harths-imac:~ galharth$ open -e .bash_profile -bash: open: command not found what shoud do? my .bash_profile , .profile , .bashrc empty, need write in them?.. i suspect have overriding default path (like .bash_profile or .bashrc) open valid command on os x, me man open returns name open -- open files , directories synopsis open [-e] [-t] [-f] [-w] [-r] [-n] [-g] [-h] [-b bundle_identifier] [-a application] file ... [--args arg1 ...] description open command opens file (or directory or url), if had double-clicked file's icon. if no application name specified, default application determined via launchservices used open specified files..... likewise possible ruby installed not on path. best guess delete or rename .bashrc , .bash_profile files , log off user , log in, reset bash session. to test if user level issue, create new account under system pre

automation - Petri net drawing and code generation -

is there software drawing petri net , generating source code there? source code in known programming language... slightly less desirable option outputting file description of petri net graphs in text-based file in open format, xml or other data language. write code generator myself, @ least avoid gui/graph development part ;)) thanks check petrinetsim developed in java, can draw , simulate simple/colored/timed petrinets. comes few examples. can extend arc , nodes constraints in java. , can see java classes of generated petri net you can grab source code github https://github.com/zamzam/petrinetsim

bash - How to find the difference in days between two dates? -

a="2002-20-10" b="2003-22-11" how find difference in days between 2 dates? if have gnu date , allows print representation of arbitrary date ( -d option). in case convert dates seconds since epoch, subtract , divide 24*3600. or need portable way?

Url Routing for the page inside a folder in asp.net 4.0? -

i trying implement url routing in asp.net 4.0. created small test application. trying browse pages kept inside folder. works fine when running in visual studio..but when hosted application in iis7 showed error. http error 404.0 - not found resource looking has been removed, had name changed, or temporarily unavailable. the code used is. (i using master page too.) protected void application_start(object sender, eventargs e) { customroutetable(routetable.routes); } void customroutetable(routecollection routes) { routes.mappageroute("telugu", "movie/telugu", "~/telugu/telugu.aspx"); } in default.aspx page kept button , on click of button wrote. protected void btntelugu_click(object sender, imageclickeventargs e) { response.redirecttoroute("telugu"); } where going wrong??? thanks. have updated web.config support url routing on iis7. <system.webserver> &

SOAP wrapper around existing Jersey RESTful service -

i created simple web service jersey reads in xml file , creates objects based on xml. have single method consumes post xml. parse xml , use values create business objects. recently discovered our clients support soap. is there way write wrapper of soap on top of this? (i saw mule mentioned have never used it) or easier start scratch , rewrite in soap? i'm new soap , looks more complicated experience jersey. thanks! the simplest way expose single method takes xml string, parses , returns xml document (again string). public class receiver { public string postxml(string inputdocument) { // parse , process xml xml ... return outputdocument.tostring(); } ... } you should able use method in jersey service, if necessary delegation separate class. creating soap service around facade object should easy soap: http://axis.apache.org/axis/java/index.html the technically superior solution decompose xml object-oriented data transfer object or impl

maven - How to configure Jenkins (Hudson) with gpg signature -

i'm in process of transitioning maven (from ant) , want automatically sign artifacts gpg in jenkins job. from documents i've read, need manually run maven sign documents $ mvn clean deploy -dgpg.passphrase=yourpassphrase how do without revealing passphrase? is possible? i saw question, there's no indication of how configure jenkins job / maven pom: where keep gpg secret key maven project in ci environment? i have generated gpg key on same server runs jenkins. i think searching plugin https://wiki.jenkins-ci.org/display/jenkins/mask+passwords+plugin 1 might if need deploy keystore https://wiki.jenkins-ci.org/display/jenkins/build+secret+plugin

c++ - Improving camshift algorithm in open cv -

i using camshift algorithm of opencv object tracking. input being taken webcam , object tracked between successive frames. how can make tracking stronger? if move object @ rapid rate, tracking fails. when object not in frame there false detections. how improve ? object tracking active research area in computer vision. there numerous algorithms it, , none of them work 100% of time. if need track in real time, need simple , fast. assuming have way of segmenting moving object background. can compute representation of object, such color histogram, , compare the object find in next frame. should check object has not moved far between frames. if want try more advanced motion tracking, should kalman filter. determining object not in frame big problem. first, kinds of objects trying track? people? cars? dogs? can build object classifier, tell whether or not moving object in frame object of interest, opposed noise or other kind of object. classifier can simple, such co

flex - spark List with ItemRenderer click function not working -

i having issue itemrenderer, using spark list. code following: i have list: <s:list id="productsetlist" dataprovider="{ model.productsets }" change="model.selectset( productsetlist )" height="100%" width="100%" bordervisible="false" itemrenderer="sidebaritemrenderer" top="20" left="15"> </s:list> and itemrenderer is: <s:itemrenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" width="160" height="175" autodrawbackground="false" buttonmode="true" usehandcursor="true" click="click(event)" cacheasbitmap="true" > <fx:script> <![cdata[ import com.png.vm.model.vos.productset; protected func

Preserve link in php form -

i've created form sends 2 email: 1. me 2. confirmation email user link other information <?php $to ='email@email.com'; $subject ="this subject"; $header="from: $firstname $lastname <$email>"; $message = "name: $firstname $lastname \n\nphone: $phone \n\nemail: $email"; $send_contact=mail($to,$subject,$message,$header); if ( $send_contact ) { echo "super fun message"; } else { echo "error"; } $to1 = $email; $subject1 ="this email subject"; $header1="from: email@email.com <email@email.com>"; $message1 = "thanks check out <a href="http://link.com" title="">link</a>."; $send_contact1=mail($to1,$subject1,$message1,$header1); ?> problem, think, syntax link in $message1 isn't correct... can't right. thanks help! it's because quotation mark before link match 1 @ start on $message1, change them single quotation marks , sh

qt - QSqlQuery buffer size -

i have large table in postgresdb (55gb). want scan in c++ qt, summarize result, , send db. far understand, default qsqlquery transfers data main memory. possible state explicit buffer size object? possible tell qt/postgres answer incrementally, i.e., not after data comuted , sent c++ program? the code using following: qsqldatabase db = qsqldatabase::adddatabase("qpsql"); db.sethostname("server"); db.setdatabasename("db"); db.setusername("user"); db.setpassword("pass"); bool ok = db.open(); qsqlquery query; query.setforwardonly(true); query.prepare("select attributes verylargetable"); while (query.next()) { int = query.value(0).toint(); // , work data } i saw answer on net recently, spent hours looking answer again without success. i split select (of course in transaction). first determine imaxlines size of select like: select count(*) verylargetable if want read 1000 lines ad once, can somethin thi

datestamp - date stamp pdf on download -

i have pdf users can download. however, need have date downloaded in text on pdf. is there way insert "date now" stamp on pdf dynamically added on opening? perhaps can add javascript pdf? you can sign , timestamp pdf on server before giving user. signing can performed once day (unless need finer granularity if timestamp time). reliable way put timestamp pdf. also, signature can removed, , if want add watermark can't removed, different story.

Android dx generates bad checksum dex files -

i'm working on project generates java code on-the-fly, , compiles android. funny thing dx.bat generates broken dex file while finishing successfully. when try dexdump dex, get: error: bad checksum (deadbeef vs deadc0de) manually playing around --no-optimize or --no-locals solve issue specific compilation. can never know happen next 1 , process should reliable. btw, manually fixing checksum doesn't fix problem (dexdump crash after dumping data) figure isn't dx checksum calculation bug. is there known issue? how can further debug? thanks! was bug in windows' version of dexdump (and other tools). will fixed in r11. see full bug report @ http://code.google.com/p/android/issues/detail?id=14746

asp.net mvc - How to get the column titles from the Display(Name=) DataAnnotation for a strongly typed list scaffold view at runtime? -

how [display(name="some title")] dataannotations "some title" rendered in list scaffold view's output? i create typed list scaffold view class: public class companyholiday { [key] public int id { get; set; } [required] [display(name = "datum")] [datatype(system.componentmodel.dataannotations.datatype.date)] public datetime date { get; set; } [required] [stringlength(50)] [display(name = "feiertag name")] public string name { get; set; } } the view looks this: @model ienumerable<zeiterfassung.domain.companyholiday> @{ viewbag.title = "year"; } <h2>year</h2> <p> @html.actionlink("create new", "create") </p> <table> <tr> <th></th> <th> date </th> <th> name </th> </tr> @foreach (var item in model) { <tr> <td>

Qt QPixmap QPainter problem -

i have piece of code has lines of code: int dsize = 100; qpainter *painter; qpixmap *img; qlabel *l_img; painter = new qpainter; img = new qpixmap(dsize, dsize); l_img = new qlabel; l_img->setpixmap(*img); painter->begin(img); painter->fillrect(img->rect(), qt::white); qpen pen(qt::black, 12); painter->setpen(pen); painter->drawline(40, 40, 40, 100); painter->end(); l_img->show(); how ever when run code, don't see white image black rectangle on it. in fact see title of window written in big fonts. nothing seems work, image that. doing wrong? thank you! got it!! it has line: l_img->setpixmap(*img); it should after painter->end(); thank you, xd.

php - exception handling for undefined index error? -

the script below called when saving app's options page. options stored in array in $options. i'm getting debug error "undefined index, id" on line comment below. ideas how can fix script? foreach ($options $value) { if( isset( $value['id'] ) && isset( $_request[$value['id']] ) ) { update_option( $value['id'], stripslashes($_request[$value['id']]) ); } else { update_option( $value['id'], ""); //error here } } your if{} segment precludes code in else{} segment working. in other words: in if block, ask: "does $value['id'] exist?" if not, code executes else block, attempts reference non-existent variable. you'll need set array key before can update it. your update_option function should check see if variable exists, , set instead of up

c++ - Good practice for referencing objects -

i'm working on project several different object semantically linked , i'm looking way let objects refer each other. put pointers in each object , link them together. in special case there no heap objects (at least not create while writing code, vector internally might on page). came idea have class stores list of unique ids , share id objects need them known. is practice? there other, better ways this? background: project settled in academic background. not know students or other people contribute this. skill level not known, not high. not using pointers can @ least ensure objects not deleted accidentally or out of stupidity. edit: what led me idea of unique id our usage of vectors store data. 1 thing stl containers lot copying containees. why i'm not sure pointers work well. same simple indices of vector elements, content and/or it's order might change. is pratice? in experience, no. sort of unique id crap 1 more thing has managed, , managed cor

java - Printing a Jtable as Table into file -

i in process of creating application finance management.so trying final job getting summary printed. ths summary page consists of different tables , each followed 2 labels , text field. great if can me light this. all want print populated jtable onto file is. i not expert java , im using netbeans coding gui. also regarding fileformat think has .rtf supporting lines etc.hope there wont difficulty in creating rtf file this. ps: im not particular format .rtf want format can support columns , tables. one more thing wanted add want create receipts custom templates.i thinking of using .rtf files templates , adding neccessary values file. after editing file in java, doesnt seem looking fine. better if suggest me suitable format edit: ive managed readymade code printing jtable pdf , it's working , good. code follows document document = new document(pagesize.a4); try { pdfwriter writer = pdfwriter.getinstance(document, new fileoutputstream("c:\users\a

asp.net - Does anyone know a workaround for the Windows Azure WebResource.axd timezone bug? -

i'm having real hard time seems rather old bug (pre-2009) in windows azure platform. in short, after deploying azure http 404 responses javascript resources loaded via webresource.axd . big deal since breaks of ajax functionality on website. interesting part things normal 2 hours after deployment , 404-ing resources start loading normally. , event more interesting part 404 errors don't occur after each deployment. after lot of googling around found similar case on azure forums. yi-lun luo's last post makes me think problem in case related bug describes. maybe i'm wrong, there seems connection between 2 hours takes 404 errors cease , fact timezone utc +2. please, if has had similar problem or has idea workaround, let me know. grateful! we have run before on project. it's not azure problem @ all, rather bug in how webresource.axd loading assemblies (roughly speaking). problem related timezone. if binaries building , deploying in timezone "ahe

php - Stackover API gives different search results than web interface -

i'm playing api, , noticed api call search lesscss gives total: 13 items api param tagged=lesscss http://api.stackoverflow.com/1.0/search?tagged=lesscss but web interface gives little on 30 https://stackoverflow.com/search?q=lesscss i think reason web interface searches not word tag, searches word in body of questions/answers. there better way search api gives more complete results in webinterface perform search tagged question should search squarebraked [lesscss] , result page should be: tagged lesscss to reply answer using api can search intitle, tagged or nottagged... this error message api: one of 'tagged', 'nottagged', or 'intitle' must set on method. and this is documentation of api search as can see: this method intentionally quite limited. more general searching, should use proper internet search engine restricted domain of site in question. so no, can't retrive complete result webinterface :)

How to show a wait screen in VBA Excel 2010 -

i have macros running on workbooks , status screen shows progress user not have stare @ blank screen or loading screen of excel. or though. status page works, update macros run, excel not show of until after macros finish running. how show status screen? status = "sheetname" private sub workbook_open() 'make sure screen active sheets(status).activate sheets(status).select end sub if purpose of status screen give feedback while macros running, quick , easy alternative use status bar. here's sample: sub yourmacro() dim statusold boolean, calcold xlcalculation ' capture initial settings statusold = application.displaystatusbar ' doing these speed code calcold = application.calculation application.calculation = xlcalculationmanual application.screenupdating = false application.enableevents = false on error goto eh ' code... ' every while code running application.status

mysql - Update left join query help -

i have no idea how i'm trying do. data relationships demonstrated in example update sym_entries_data_55' set value = '46.00' (sym_entries_data_55.id = sym_entries_data_54.id) , (sym_entries_data_54.member_id = sym_entries_data_5.entry_id) , (sym_entries_data_5.username = 'namehere') answer update sym_entries_data_55, sym_entries_data_54, sym_entries_data_5 set sym_entries_data_55.value = '52.00' sym_entries_data_55.id = sym_entries_data_54.id , sym_entries_data_54.member_id = sym_entries_data_5.entry_id , sym_entries_data_5.username = 'namehere' update sym_entries_data_55, sym_entries_data_54, sym_entries_data_5 set sym_entries_data_55.value = '46.00' sym_entries_data_55.id = sym_entries_data_54.id , sym_entries_data_54.member_id = sym_entries_data_5.entry_id , sym_entries_data_5.username = 'namehere'

AJAX query using jQuery and PHP POST method is not working -

below html form part <form name="messagebox" action="" onsubmit="return false"> <input type="text" name="newmessage" size="80" value="" /> <input type="submit" class="sendmessage" value="send" /> </form> below portion of javascript file containing jquery's ajax api. have tested php file in question independently , php file works. , javascript call pasted below works until 'alert(datastring)' problem ajax query. don't understand why isn't working copying structure of script have used on working website before. testing in xampp i'm not sure if maybe xampp server problem, highly doubt it. $(function() { $(".sendmessage").click(function() { var guestid = $(".username a").html(); var messagecontent = document.messagebox.newmessage.value; var dateobj = new date(); var mes

jquery - Overlay youtube embedded video with image, hide image when clicked and autoplay -

i display image before viewing youtube video in page. there way jquery or javascript function. i want overlay own image , when clicked, display video , autoplay it, wihtout reloading page. thank help regards judi if using html5 iframe youtube, above won't work video play in background autoplay=1 set before image clicked. instead used .append() append iframe after click on image video autoplay after click event image. <body> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <div id="ytapiplayer2" style="display:none;"> </div> <img src="https://i.qmyimage.com/mgen/global/zgetimagenew.ms?args=%22shpimg4198.jpg%22,425,96,1" id="imageid" /> <script type="text/javascript"> $('#imageid').click(function() { $('#ytapiplayer2').show(); $('#ytapiplayer2').append('<iframe width="1130" height="636&q

python - File Parsing on the fly in Flask -

i received advice on question regarding easy use web-framework use simple project helping friend , suggested use flask . everything has been working out far - trying figure out how (or if possible) read file on fly, , pass contents of file function have. for instance, want use following: html side: <form action="process_file" method=post enctype=multipart/form-data> <input type='file' name='file'> <input type='submit' value="upload , process selected file"> </form> i figure need on actual page using html, allow me path of file need, able read said-file. i unsure go on flask/python side of things - i'm looking step in right direction, perhaps reading in 2 numbers or letters (in file) , outputting them on same page? flask/python side: @app.route('/process_file', methods=['get', 'post']) def process_file(): if request.method == 'post': file =

How can I restore selected ASP.NET Membership users from a backup DB? -

had recent issue cms , discovered today of users created in last week deleted. news have backup of db, , uses standard asp.net membership tables. is there way restore of data without restoring whole db? membership tables of maze... there existing stored proc or utility out there? i'm not sure tables required , ones not. i'm not aware of single sproc or utility this. if you're using membership, you'll need copy from: aspnet_membership aspnet_users if you're using roles you'll need copy from: aspnet_usersinroles if you're using profile you'll need copy from: aspnet_profile so it's not bad. need roll sleeves , write between 2 , 4 insert statements. (that's theory @ least)

mysql - table column marked as unique, means it's indexed too, right? -

i'm trying setup mysql table. following: id (integer, auto increment, primary) username (varchar 32, unique) email (varchar 32, unique) i don't want allow duplicate usernames or email addresses in table. example, @ startup, i'll test if supplied username or email exist in table - if do, i'll cancel signup. if mark username , email columns "unique", mean they're indexed? i'd them indexed can already-exists check efficiently possible, thanks yes indexed. how database already-exists check efficiently possible.

sql - Can I use a user defined database function in a query in Pentaho Report Designer? -

i'm reporting on data 2 tables don't have sane way join together. it's inventory in 1 table, sales in other, , i'm trying days of inventory on hand dividing two. since couldn't think of way join tables abstracted 1 query database function , called other. here function definition: create or replace function avgsales(date, text, text, integer) returns numeric ' select sum(quantity)/(65.0*$4/90.0) thirty_day_avg data_867 join drug_info on drug_info.dist_ndc = trim(leading ''0'' data_867.product_ndc) rpt_start_dt>= $1-$4 , rpt_end_dt<= $1 , drug_info.drug_name = $2 , wholesaler_name = $3 ' language sql; and here report query: select (sum("data_852"."za02")/5)/avgsales(date '2010-11-30', 'semprex d 100ct', 'mckesson', 30) doh "data_852" join "drug_info" on "drug_info"."dist_n

spring - JSF application crossing user session data -

i have difficult jsf issue trying solve. note, new jsf , java....i have simple application users login, select checkboxes, click submit, add more info on page, save db , logout. in production env, seeing instances user session data getting crossed or cached , pickup subsequent user session. example, user enters data, user b enters data , upon reviewing data, sees stuff user entered. of course, cannot recreate in test. i using jsf 1.2._12, richfaces 3.3.2, , spring 2.5.6. app server jboss 5. all of jsf managed-beans session scoped. particular managed bean calls spring bean business object session scoped, calls dao singleton. here relavant faces-config info <managed-bean> <description>contactbean</description> <managed-bean-name>contactbean</managed-bean-name> <managed-bean-class>com.package.contactbean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property&

module - Daily question in my drupal website -

i new drupal may question dumb. want show daily questions on website build using drupal. question of multiple choice , options should displayed default. visitor click on ans , press submit ans. seems poll dont want show summary on submission instead want show correct ans. thanks in advance :) the quiz module provides, well, quizzes , supports multi-choice questions. after quiz has been answered, provides various display option. may suits need if use single-question quizzes. for quiz daily, may have add code or use additional module handle automatic creation, publication , de-publication of daily quizzes.

iphone - Why doesn't the UIAlertView work? -

i testing piece of code when run it, not trigger uialertview. when code hits if (ongoinggame = yes) , nslog jumps directly 'otherbuttontitles:nil' without executing uialertview. can please explain me why not trigger it? -(ibaction)continuegame_button:(id)sender { //=====check if there on-going game, if continue=====// accesscurrentgamedata *isthereanongoinggamefunction = [accesscurrentgamedata new]; bool ongoinggame = [isthereanongoinggamefunction checkifgameongoing]; [isthereanongoinggamefunction release]; nslog(@"+ + +continuegame_button+ + +"); nslog(@"ongoinggame = %@\n", (ongoinggame ? @"yes" : @"no")); if (ongoinggame == yes) { nslog(@"++++++++++++++++++"); nslog(@"++++++++++++++++++"); nslog(@"++++++++++++++++++"); nslog(@"++++++++++++++++++"); nslog(@"++++++++++++++++++"); // uialer

ASP.NET MVC Shopping Cart & jQuery -

i have pricing page display list of products along prices. user can choose add multiple products shopping cart (active shopping cart being shown on right hand side of page). how have implemented using ajax/jquery... code snippet view (aspx): looping thro available products in viewmodel , displaying details: <% foreach (var _product in _supplier.hotelproducts) { %> <tr> <td colspan="2" align="left" valign="top"><% = _product.description %></td> <td align="left"> <% using (html.beginform("addtocart", "shoppingcart", formmethod.post, new { @class = "addproducttocartform" })) { %> <input type="hidden" name="hsupplierid" id="hsupplierid" value="<% = _supplier.id %>" /> <input type="hidden" name="hproductcode" id=&qu

c# - OpenFileDialog in ASP.NET -

how can run sth openfiledialog? in asp.net there's no control. yes, there's option use <input type="file" name="filediag" /> but there's default name disabled modifications. i found either solution <input type="file" name="filediag" style="display:none" /> <input type="button" value="browse..." onclick="document.form1.filediag.click()" /> but doesn't work...or i'm doing sth wrong. is there other possibility this? you must have missed fileupload control - equivalent html input type="file" used uploading files. it exposes uploaded file - name , contents.

opengl es - VBO's on Android: Pointing out the correct image in texture coordinate buffers -

does know how point out given section of texture buffer array stored in hw buffer? i'm drawing triangle strip , filling square image. in texture have 2 square images next each other, texture coordinate buffer points out them out total of 16 floats. with software buffers i'm doing access second image in texture: texturecoordinatebuffer.position(8); gl.gltexcoordpointer(2, gl10.gl_float, 0, texturecoordinatebuffer); with hardware buffers assumed this: // setup hw buffers // ... // select hw buffers gl11.glbindbuffer(gl11.gl_array_buffer,vertexcoordinatebufferindex); gl11.glvertexpointer(3, gl10.gl_float, 0, 0); gl11.glbindbuffer(gl11.gl_array_buffer, texturecoordinatebufferindex); // point out first image in texture coordinate buffer gl11.gltexcoordpointer(2, gl11.gl_float, 0, 0); // draw // ... which works nicely if want point out first image in texture. access second image - assumed in last line: // point out second image in texture coordinate buffer - doesn&

c++ - How to use MS code coverage tool in command line? -

Image
i have following c++ code. #include <iostream> using namespace std; int testfunction(int input) { if (input > 0) { return 1; } else { return 0; } } int main() { testfunction(-1); testfunction(1); } i compiled execution cl /zi hello.cpp -link /profile then, instrument execution , generated .coverage binary. vsinstr -coverage hello.exe start vsperfmon -coverage -output:mytestrun.coverage vsperfcmd -shutdown when open coverage file in vs2010, got nothing in results. what might wrong? followed instructions in this post . you need run program after monitor starts: > vsinstr /coverage hello.exe > start vsperfmon /coverage /output:mytestrun.coverage > hello.exe > vsperfcmd /shutdown when run step 3, should see notification in vsperfmon.exe hello.exe has started. if plan on doing multiple test runs, need run steps 2-4. in other words, need instrument binary (step 1) once after it's built