Posts

Showing posts from January, 2011

wordpress - What Contact Form 7 action should I hook into for seed submitted data AFTER validation and spam filters? -

i'm building api integration wordpress plugin forwards from's data crm's api. i've got working on contact form 7 adding action after 'wpcf7_submit'. // wpcf7_submit available since contacform7 4.1.2, testes 4.4 add_action("wpcf7_submit", "crm_forward_cf7_to_crm", 10, 2); function crm_forward_cf7_to_crm($form,$result) { // todo has spam been filtered already? // todo has form been validated already? $submission = wpcf7_submission::get_instance(); if ( $submission ) { $posted_data = $submission->get_posted_data(); $posted_data = crm_filter_cf7_data($posted_data); crm_post_form($posted_data); } }; my questions are: has submission been filtered out spam validation (e.g.: akismet) @ point? has cf7 validated form @ point? i'm not sure akimeset (but judging form possible statuses did kind of spam validation time), @ point cf7 has validated it. can check if it's valid , not spam, $result[...

email - PhP e-mail auto e-mail response -

on website have promotion going on users input name , e-mail , send them e-mail same title, same text , voucher image @ end embedded/inserted onto e-mail (not attached). we thought able copy paste on past 6 weeks have sent out on 1000 e-mails , undo able more. we have php code sends info. know add @ end of php when inputs e-mail , name can automatically send e-mail them "template" title, text , image? i have tried many different things programmes newsletter senders not auto-responders. can't use gmail auto response either because receive other e-mails different things well. don't want send promo e-mails us. any help? cheers. check github sendemail repository. allows send emails through php. can can set sendemail repository in project whenever enter email id run php script.for configuring sendemail provided on github . link: https://github.com/mogaal/sendemail script this: $message = "thank interest. possible.<br />sincerely...

git - Get current version of repository -

i'm new git, can't find out how : get version of repository (folder offline) get last version of repository (online) i can compare two, doesn't give me information version. : git status , tell me it's date. how can have : your version : 1.9.0 latest version : 1.10.1 with conky example : https://github.com/brndnmtthws/conky there's no clean way this, since "current" version of repository means different things different people. depends on whether or not tags used. in scenario, if want rely exclusively on tags, can use git tag -l listing of tags, recent 1 created being last entry. if want committed work, you'd have @ branches of own volition , inspect when committed. in case, it's master, you'd need perform log on it. git checkout master && git log

regex - emacs greedy search-backward-regexp -

how make backward regexp search greedy in emacs? for example, have abc 163439 abc in buffer, , run m-x search-backward-regexp following regexp: 163439\|3 . regexp allways find '3' in buffer, newer whole long number. because, when starts search, meet '3' firstly. in second try, start position of '3', inside number, , omit it. how can find longest , closest match? so mean, when meet '3', want check if matched part isn't part of bigger match. i don't think can want. emacs search-backward-regexp searches closest instance matches regular exprssion. not greediness (greediness in regular expressions matching many characters possible when there kleene star operator -- or syntactic variants ? or +). in example, emacs finds first instance matches regular expression. --dmg

jsp - Collect and save submitted values of multiple dynamic HTML inputs back in servlet -

i able display arraylist of beans in jsp form using jstl looping through list , outputting bean properties in html input tag. <c:foreach items="${listofbeans}" var="bean"> <tr> <td><input type="text" id="foo" value="${bean.foo}"/></td> <td><input type="text" id="bar" value="${bean.bar}"/></td> </tr> </c:foreach> how code jsp when page submits updated values in appropriate item of the arraylist ? given simplified model: public class item { private long id; private string foo; private string bar; // ... } here's how can provided ${items} list<item> : <c:foreach items="${items}" var="item"> <tr> <td> <input type="hidden" name="id" value="${item.id}" /> <in...

java - Counting number of lines in test classes -

i'm developing tool recognizes test classes , counts number of lines in classes. tool count lines of business code , compare both results, here code: (file f : list) { if (f.isdirectory()) { walk(f.getabsolutepath()); } if (f.getname().endswith(".java")) { system.out.println("file:" + f.getname()); countfiles++; scanner testscanner = new scanner(f); while (testscanner.hasnextline()) { string test = testscanner.nextline(); if (test.contains("org.junit") || test.contains("org.mockito")) { system.out.println("this test class"); testcounter++; break; } } scanner sc2 = new scanner(f); while (sc2.hasnextline()) { count++; counting business code using (count++) working perfectly, ...

sql server - Can I replace a very complex SQL Select with parameters with a view? -

i have multi table sql select on 150 lines long, 2 input parameters used inside 1 of inner areas of select. not used where's limit data retrieved @ end. parameters used on inner areas of select. right sql select part of stored procedure 2 input params. it's called other stored procedures @ end of them. would idea replace view , if can somehow provide input parameters view? as far know, can't create view parameters. instead, can create function takes input parameters. create function test.func (@parameter varchar(10)) returns table return ( select field1, field2,.... table1 field3 = @parameter ); basically view acts table, , way can add " parameters " table via filter statements when accessing view.

ruby - Chef - Prevent execution of multiple resources -

let's have 3 execute resources 'create users' , 'install client' , 'verify client' . how can prevent execution of resources if 1 condition satisfied ? something like: block 'manage client' execute 'create users' cwd scripts_path command './installclient.sh -create_users' end execute 'install client' cwd scripts_path command '/installclient.sh -installclient' end execute 'verify client' cwd scripts_path command './installclient.sh -verifyclient' end not_if { ::file.exists?('/tmp/client_configured_success') } end use normal if/unless conditional in other ruby code. unless file.exist?('/tmp/client_configured_success') execute 'create users' cwd scripts_path command './installclient.sh -create_users' end execute 'install client' ...

Registering facebook app without including sdk -

since ios has built in facebook sharing (via uiactivityviewcontroller), i'm able post without including fb sdk. however, when post timeline, want "via appname". have add sdk app or there simpler way of doing this? no, have create facebook app , use ios sdk .

android - InputStream.available() is always 0 -

i trying connect server android app , json response. using httpurlconnection to ping server. server running fine since getting response on browser. in code below, inputstream.available() returns 0 , hence cannot parse data. there way response ? note : below method called inside separate thread ( asynctask<void, void, void> ) private void pingserver(final string serverurl) throws ioexception { inputstream inputstream = null; try { final url url = new url(serverurl); httpurlconnection conn = (httpurlconnection) url.openconnection(); conn.setreadtimeout(10000);// milliseconds conn.setconnecttimeout(15000);// milliseconds conn.setrequestmethod("get"); conn.setdoinput(true); conn.connect(); inputstream = conn.getinputstream(); string resp = readit(inputstream, inputstream.available());//resp empty :( } catch (ioexception e) { ...

c++ - WIC increases the size of TIFF image -

Image
scenario: load tiff image , extract frames of tiff image , save locally. combine extracted frames output tiff image. when try combine frames, size of output tiff image increasing drastically. example if input size if 40 mb , output increased 300 mb. below code explains scenario, void readtiff() { hresult hr; iwicbitmapframedecode *framedecode = null; iwicformatconverter *formatconverter = null; iwicbitmapencoder *encoder = null; iwicstream *poutstream = null; iwicbitmapframeencode *frameencode = null; iwicimagingfactory* m_pwicfactory; hr = cocreateinstance( clsid_wicimagingfactory, null, clsctx_inproc_server, iid_ppv_args(&m_pwicfactory) ); iwicbitmapdecoder *pidecoder = null; hr = m_pwicfactory->createdecoderfromfilename( l"d:\\test28\\multitiff_files\\300dpitiff40mb_water.tif", /...

contiki - Error Cooja software Simulation -

after enabling tunslip6 package in contiki , got error when gave command. sudo ./tunslip6 -a 127.0.0.1 aaaa::1/64 error sudo:./tunslip6 command not found please give me solution rid of this. in advance the error because don't have executable in /contiki/tools . perform following steps: in terminal, change working directory /contiki/tools , compile: cc tunslip6.c -o tunslip6 if ./tunslip6 see follows: tunslip6: usage: ./tunslip6 [-b baudrate] [-h] [-l] [-s siodev] [-t tundev] [-t] [-v verbosity] [-d delay] [-a serveraddress] [-p serverport] ipaddress: success now command shall work expected.

Can we get PowerBuilder Pb Data window object using hooking -

i testing powerbuilder application using iaccessible object. not able newly added row pbdatawindow object. possible pbdatawindow object using hooking. can not modify application code , don't have there source code also. regards, rajendar you can access datawindow control accessibility properties using iaccessible need set in code (ide) or in run-time. suspect case windows application uses accessibility unless language sets default accessibility properties when aren't explicitly provided. if don't have access source code forced @ microsoft windows 'window class names' handle objects challenging not mention name of object might not consistent across various instances of application in memory. for looking use accessibility , have access source code, how set. can set these many different object types , columns within datawindow object. assumption : datawindow control named, "dw_invoice". setting accessible properties dynamically @ runti...

jquery - color variable in animation doesn't work -

i don't see it. want change color of button animation. first click works second not. checked var c , gets rgb color correctly evidently don't give correctly animation. var grey2 = "#555"; $(".mainmenu .fa-search").click(function() { var c = $( ).css("color"); if ( == 0) { $(".mainmenu .searchform").slidedown(); $( ).animate({color: grey2}); = 1; } else { $(".mainmenu .searchform").slideup(); $( ).animate({color: c}); = 0 }; when second time click change color grey2(#555) var c has #555 both equal. that's why second time not working try code var grey2 = "#555"; var c = $(".mainmenu .fa-search").css("color"); $(".mainmenu .fa-search").click(function() { if ( == 0) { $(".mainmenu .searchform").slidedown(); $( ).animate({color: grey2}); = 1; } else { $(".mainme...

php - storing string that has unicode character in it -

i have string has following content: \ud83c\udf80new stuff \u0026 second stuff\n\ud83d\udcf1sms\/ kik : 085738566676 \/ veinshop\n\u26d4 item exclude ongkir\n\u2708shipping mon-fri\n\ud83d\udcb0bca only\n\ud83d\ude90jne\n\ud83c\udfe1 denpasar-bali i wanted store in mysql database gives me empty. using doctrine2 orm interface database. here's entity string property: class shop { /** * * @var string * @orm\column(name="bio", type="string", nullable=true) */ private $bio; /** * set bio * * @param string $bio * @return instagramshop */ public function setbio($bio) { $this->bio = $bio; return $this; } /** * bio * * @return string */ public function getbio() { return $this->bio; } } when set shop entity bio , call persist on entity. stored value null. i've set table collation utf8mb4 , charset in dbo utf8mb4 ...

websphere 7 - JSF 1.2 to 2.0 migration exception with el-api.jar -

we migrating our application developed using jsf1.2 jsf2.0 on was7 .also have decided use view technology jsp. have made required changes(jars,web.xmland faces-config.xml) suggested in: migrating jsf 1.2 jsf 2.0 we using richfaces components , have upgraded library richfaces3.3.3. we getting following exception while using h:commandlink , h:commandbutton: exception created : javax.servlet.servletexception @ javax.faces.webapp.facesservlet.service(facesservlet.java:325) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1657) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1597) @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:131) @ org.ajax4jsf.webapp.basexmlfilter.doxmlfilter(basexmlfilter.java:206) @ org.ajax4jsf.webapp.basefilter.handlerequest(basefilter.java:290) @ org.aj...

How does TeamCity calculate remaining build time -

i using teamcity continuous integration, , 1 linux server taking hour longer builds after moving new virtual host. thought might cifs mount acting remounted seems have resolved long read write times, after kicking off build, says remaining time still hour longer should be. number based on last build or there metrics being taken , number calculated via algorithm? teamcity version 7.0, build server ubuntu 12.04 it computed statistically, auto-correct after builds.

javascript - How the symbol $ in jquery works? -

this question has answer here: reading javascript script, why many $ (dollar signs)? 11 answers how can jquery run function when ever sees $ in script file? $ not javascript key character how come when ever $ appear, jquery run function? need read script file in way eval it? possible remake symbol? the jquery javascript file has following line in it: window.jquery = window.$ = jquery; meaning window-scoped $ variable assigned jquery namespace, in jquery functions placed under. why can use jquery in code $ . you same method , character symbol, even: window.$$ = jquery; would mean jquery assigned $$ , etc.

image - photoshop to flash size trim -

i've imported many clips photoshop flash , animated them. still editable photoshop though. realized clips larger size require on runtime. leads first question :- original size effect performance, if scaling them half on rumtime? and, if there anyway can shorten size originally, given i've animated them? right clicking image edit photoshop, not work because cant change size there. it affect performance, how noticable depends on size , on how many of them being scaled @ same time. them during runtime affect this. you can change size in photoshop, means have enlarge image again in flash, since transformations scaling remain after resizing image in photoshop.

c# - GridvView FooterRow Total -

i have gridview dynamically generated columns based on user's query. means can have 1 column xxx column name, or can have 4 columns. so: () means optional aaa | (bbb) | (ccc) | (ddd) 1 7 45 2 22 9 6 33 ... ... ... ... i need sum totals of each of columns without knowing columns available until program runs. i'm trying use e.row.rowtype == datacontrolrowtype.footer portion of gridview_rowdatabound event, can't seem figure out how work. i saving running totals in variables via e.row.rowtype == datacontrolrowtype.datarow portion of event, can't seem figure out how "inject" saved items footer of grid based on available column(s). can give me bit of assistance? edit gridview done basic mark since columns built dynamically. <asp:gridview id="gv" runat="server" showfooter="true" nrowdatabound="gv_rowdatabound"> </asp:gridview> and code columns: ...

matplotlib - pyplot and semilogarithmic scale: how to draw a circle with transform -

i want have circle in plot made pyplot, need use log scale on x axis. i do: ax = plt.axes() point1 = plt.circle((x,y), x, color='r',clip_on=false, transform = ax.transaxes, alpha = .5) plt.xscale('log') current_fig = plt.gcf() current_fig.gca().add_artist(point1) as see, want radius of circle equal x coordinate. my problem if use, written here, transaxes , circle circle (otherwise stretched on x , looks ellipse cut in half), x coordinate 0. if, on other hand, use transdata instead of transaxes , correct value x coordinate, circle stretched again , cut in half. i don't mind stretching don't cutting, want @ least full ellipse. any idea how obtain want? probably easiest way use plot marker instead of circle . example: ax.plot(x,y,marker='o',ms=x*5,mfc=(1.,0.,0.,0.5),mec='none') this give circle 'circular' , centred on correct x,y coordinate, although size bear no relationship x , y scale...

sql server - ms SSRS 2008 R2: Display Computed Values #Error -

the report display 2 columns foo , bar some rows of foo empty have numerical value: foo: +----+ | | +----+ |10.0| +----+ then there bar column, column take values foo , add 10 them, report should yield results this: foo: bar: +----+----+ | | | +----+----+ |10.0|20.0| +----+----+ thats expression use determine whether foo numeric inside bar: =isnumeric(reportitems!foobox.value) and result expression yield: foo: bar: +----+-----+ | |false| +----+-----+ |10.0|true | +----+-----+ okay, thats way want far, write expression way: =iif(isnumeric(reportitems!foobox.value), reportitems!foobox.value +10, "") this yield following results: foo: bar: +----+------+ | |#error| +----+------+ |10.0|20.0 | +----+------+ and bizare, when remove little addition in truepart of iif, execute: =iif(isnumeric(reportitems!foobox.value), reportitems!foobox.value, "") foo: bar: +----+--...

android - Personalized Listview error on set background color -

i have problem in app: use listview personalized adapter, in adapter want change color of line depending on whether message read or not. in metod getview control variable, if equal 0 want change background color. all works , list displayed want, but when there lot of elements , list scrolled in direction (from top bottom , vice versa) raws displeyed same color if code set color. has ever had same problem? can advise me it? there code of adapter: public class lazyadaptercomunicazioni extends baseadapter { private activity activity; private string[] id; private string[] titolo; private string[] data; private string[] letto; private static layoutinflater inflater=null; //public imageloader imageloader; public lazyadaptercomunicazioni(activity a, string[] idcom, string[] titolocom, string[] datacom, string[]lettocom) { activity = a; id = idcom; titolo = titolocom; data = datacom; letto = lett...

erlang - What is Mnesia replication strategy? -

what strategy mnesia use define nodes store replicas of particular table? can force mnesia use specific number of replicas each table? can number changed dynamically? are there sources (besides source code) detailed (not overview) description of mnesia internal algorithms? manual. you're responsible specifying replicated where. yes, above, manually. can changed dynamically. i'm afraid (though may wrong) none besides source code. in terms of documenation whole erlang distribution hardly leader in software world. mnesia not automatically manage number of replicas of given table. responsible specifying each node store table replica (hence number). replica may then: stored in memory, stored on disk, stored both in memory , on disk, not stored on node - in case table accessible data fetched on demand other node(s). it's possible reconfigure replication strategy when system running, though dynamically (based on node-down event example) have come so...

sublimetext2 - Regex: how to simplify numbers? -

given numbers large number of decimals, such: 213.094783481320923547301 093.7914840234913405 ... how keep first 3 decimals, result : 213.094 093.791 try using: find: (\d+\.\d{3})\d+ replace with: $1

apache - SOLR query to check if a field is set -

so added new field called 'thefield' documents. of them managed have fields set correctly others don't how go making solr query select documents 'thefield' field set properly? you can use range query both ends open. like: thefield:[* *]

converting javascript array into html table in new window on click -

i creating data visualizations, , have button execute javascript function , extract first 5 rows specified columns of data based on user's selection: getselection.onclick = function() { visual.document.selection.getselection( "city", \\identifies selection "users", \\identifies table ["name", "phone", "zipcode"], \\identifies columns 5, function(args) { log(dump(args, "visual.document.selection.getselection", 2)); }); }; the resulting output looks this: [name] 0: xxxxx 1: xxxxx 2: xxxxx [phone] 0: xxxxx 1: xxxxx what display results of users selection in html table in new window opens upon click. have seen suggestions doing similar this, reason can't seem them work. here have far: function getselmarking() { visual.document.selection.getmarking( "city", "users", ["name", "phone...

Testing that Rails verify_authenticity_token is being skipped -

i have action in rails 3.2 application skips verification of authenticity token, follows: skip_before_filter :verify_authenticity_token, only: [:my_action_name] however, time time, gets removed accidentally developers, , app fails silently, losing user's session on particular (ajax) action. from within functional tests, simplest way test before filter being skipped action? i.e. simplest way test line has not been removed? i run: before_filter :verify_authenticity_token, only: [:add, :your, :actions, :here] and add actions want run verify_authenticity_token on

SQL Server: copy, replace and paste within same table -

i pretty new sql , hope can me following general question. i have large table several columns want 3 things via 1 stored procedure: select data country great britain (gb), e.g. using following: select * xyz_tabledata (countrycode 'gb') copy above temp table , replace 'gb' in column countrycode 'xx'. copy data temp table , insert above table (i.e. copied data showing xx instead of gb). can me start here? many this. do in 1 step, no temp table required: insert mytable(field1,field2,field3,country) select field1,field2,field3,'xx' country mytable country='gb' this assumes trying append new set of records table, not update pre-existing records. read question 1 way, theresa read another...guess need decide meant.

glassfish - Fail command start-domain glassfish3 -

i using ubuntu 12.4 , installed glassfish3 follow tutorial: http://www.marlonj.com/blog/2012/05/instalando-glassfish-3-1-2-en-ubuntu-server-12-04/ all fine..but when try start domain: sudo -u glassfish bin/asadmin start-domain domain1 show error: esperando que se inicie domain1 ............error al iniciar domain domain1. el servidor ha finalizado de forma prematura con el código de salida 0. antes de terminar, ha generado la siguiente salida: launching glassfish on felix platform [#|2013-09-24t13:31:50.742-0300|info|glassfish3.1.2|com.sun.enterprise.server.logging.gffilehandler|_threadid=1;_threadname=main;|running glassfish version: glassfish server open source edition 3.1.2 (build 23)|#] [#|2013-09-24t13:31:51.819-0300|info|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_threadid=28;_threadname=grizzly-kernel-thread(1);|grizzly framework 1.9.46 started in: 308ms - bound [0.0.0.0:3700]|#] [#|2013-09-24t13:31:...

mapkit - iOS Routing App Registration -

i working on routing app , i'm following instructions found in ios location , maps programming guide. i have registered app routing app performing following: 1) included mkdirectionsapplicationsupportedmodes key (supporting car, bus, pedestrian) 2) included directions.geojson file (contents below) 3) configured special document type (mkdirectionsrequest) handle incoming direction requests 4) added logic handle incoming directions in application openurl sourceapplication annotation specifically, apple gives instructions on how test in simulator have also: 1) set debug scheme use directions.geojson file provided 2) after installing app on device or simulator, leave app , launch maps app specify start , end points directions. at point apple's documentation indicates if things setup correctly should see option choose app (to send directions to). apple says... your app should appear if geographic coverage file valid , contains 2 specified points. if not, che...

jquery - Automatic refresh and show more records -

i have automatic refresh load records in page. page updating every 20 seconds jquery/ajax. index.cfm: <script> $(document).ready(function() { $("##comments#timeline_id#").load("comments.cfm?timeline_id=#timeline_id#"); var refreshid = setinterval(function() { $("##comments#timeline_id#").load('comments.cfm?timeline_id=#timeline_id#&randval='+ math.random()); }, 20000); }); </script> it shows 5 comments , want create button "show comments", of course when there more available. want load comments without page refresh. is need fix on index.cfm, or should on comment.cfm page? can point me in right direction, because i'm stuck on this. thanks! i try not use coldfusion built-in ajax functions have made exception cfdiv. cfdiv seems perfect solution problem. http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=tags_d-e_04.html

PHP Error: Base class function calls derived class -

i writing api in php. have got base class implemets magic function __call : class controller { public function __call($name, $arguments) { if(!method_exists($this,$name)) return false; else if(!$arguments) return call_user_func(array($this,$name)); else return call_user_func_array(array($this,$name),$array); } } and child class this: class child extends controller { private function test() { echo 'test called'; } } so when this: $child = new child(); $child->test(); and load page takes lot of time , after while web browser prints page can't requested. no output given php, web browser error. apache error log (last part only): ... [tue sep 24 12:33:14.276867 2013] [mpm_winnt:notice] [pid 1600:tid 452] ah00418: parent: created child process 3928 [tue sep 24 12:33:15.198920 2013] [ssl:warn] [pid 3928:tid 464] ah01873: init: session cache not configured [hint: sslse...

email - Where can I find the security code in the Envelope -

when docusign sends email user requesting signature, view documents button contains link url such this: https://demo.docusign.net/member/emailstart.aspx?a=564ffc65-28s7-402b-a499-cfec5526db3c&er=ac335504-8a6d-49a0-bfb6-3793887c0722 i know second parameter in url call recipient id, can see in envelope. however, cannot find first parameter. is there anyway can regenerate url? the reason ask have website message center. upon logging our website, if user has documents require signature, want display list of links them click , sign. if have website message center , login believe should shift paradigm of how use docusign. docusign has concept of embedded signer. means notify signer , when log site can make web service call present person signing in iframe or separate window. you can find breakdown of scenario in code walkthrough: http://iodocs.docusign.com/apiwalkthrough/embeddedsigning a broader overview here: http://www.docusign.com/developer-center/explor...

c# - Testing Data Annotations using Moq in Entity Framework -

does moq take account data annotations while testing mock<dbcontext> , mock<dbset<ientity>> ? instance, proper validation exceptions thrown if attempt expressly forbidden data annotations of code first entity model? if not, how can test expected results data annotations? edit: should note using entity framework 6, has been overhauled work better mock frameworks. the accepted wisdom in unit testing "don't test code don't own", in case if moq (and can't because mentioned ela, provides fake implementations of parts of interface) shouldn't - have accept dataannotations provided system.componentmodel (or whichever) have been tested author, , work advertised. of course if have written own custom attribute unit test annotation validation code in separate test class tests functionality independent of being stacked onto property. also, given have mock dbcontext , entityset , don't see dataannotations come - relevant in uni...

java - Cannot Unhide Android System Bar after Hiding -

i have rooted nexus 10 on 4.3, , hiding system bar following code works fine: process proc = runtime.getruntime().exec(new string[]{"su","-c","service call activity "+ procid +" s16 com.android.systemui"}); //was 79 proc.waitfor(); but when try unhide following code, never unhides: process proc = runtime.getruntime().exec(new string[]{"am","startservice","-n","com.android.systemui/.systemuiservice"}); proc.waitfor(); if issue "am" command adb shell, works advertised (system bar reappears). there try/catch around root calls , there no exception. completion code of "1" out of "am". the hide , show in 2 different activities within same app, though don't see why matter. for interested, kiosk app bar needs go away while running, reappear when app exited hidden menu. thanks! after lot of searching on internet, managed system bar hide , appear in 4.2 de...

opengl - how to set a boolean property in unity3d CGprogram shader? -

i writing shader unity3d , want specify properties of shader in i.e - shader "graphicsquality/mediumscan" { properties { _color ("main color", color) = (1,1,1,1) _speccolor ("specular color", color) = (0.5,0.5,0.5,1) _shininess ("shininess", range (0.01, 1)) = 0.078125 _maintex ("base (rgb) refstrgloss (a)", 2d) = "white" {} _bumpmap ("normalmap", 2d) = "bump" {} _rimcolor ("rim color", color) = (0.48,0.78,1.0,0.0) _rimpower ("rim power", range(0,8.0)) = 3.0 } but these properties color, range, float etc want input boolean value how can tried like- properties{ _maintex ("particle texture", 2d) = "white" { _isbending("is bending",bool) = true } subshader{ pass{ cgprogram #pragma vertex vert #pragma fragment frag sampler2d _maintex; ...

sql - Rally Excel Plugin Queries -

i working rally/excel plug-in , setting queries/filters our various delivery teams. 1 of teams named "agency / l&c". & causing me sorts of problems cannot seem past. current filter is: ((release.name = "2013 november") , (project.name = "agency / l&c")) when execute query error: query failed due errors: not parse: cannot parse expression "((release.name = "2013 november") , (project.name = "agency / l" query i have tried several things, ' before , after, '' before , after, %, " , \ , nothing seems making register & text. thanks help this educated guess think problem arises ampersand not being escaped before request made to api. might try changing "%26" (the html code "&") , see get.

wordpress - User authentication through wp_signon(); help needed -

i use form send post request page , login user wp_signon() in order authenticate user wordpress installation described in wp documentation: $creds = array(); $creds['user_login'] = $_post["user-login"]; $creds['user_password'] = $_post["user-password"]; $creds['remember'] = true; $user = wp_signon( $creds, false ); after little piece of code i'm checking if user logged in: if ( is_user_logged_in() ) { echo "success"; } else { echo "fail!"; } but got fail! time. after sniffing around found little trick: wp_set_current_user( $user ); if ( is_user_logged_in() ) { echo "success"; } else { echo "fail!"; } i've got success on 1 when leave page got fail again , again. can explain me how login user wp_signon() without logging out after page changed or reloaded or whatever. i've got desirable result when go /wp_admin , login wp's default login form. can navigate throu...

java - Copying object fields -

what best way of copying classes when need have 2 independent variables? have simple class: public class myclass { boolean = false; string b= "not empty"; } do need make method : assign(myclass data ) { a= data.a; b= data.b; } is there automatic method copy (duplicate) objects in java? do need make method : pretty close. instead of making method, should make constructor. such constructors called copy constructor , , create them this: myclass(myclass data) { = data.a; b = data.b; } and create copy of instance, use constructor this: myclass obj1 = new myclass(); myclass obj2 = new myclass(obj1); copy constructor can tedious : using copy constructor create deep-copy can tedious, when class has mutable fields. in case, assignment create copy of reference, , not object itself. have create copy of fields (if want deep copy). can go recursive. a better way create deep copy serialize , deserialize object. why not use clone()? ...

javascript - JQuery Datatable : 'nTableWrapper is null or not an object' error -

i newbie jquery data table , here below code. var otable = $('#table').datatable(); otable.fndestroy(); otable = $('#table').datatable( { "bprocessing": true, "bserverside": true, "fndrawcallback": function( osettings ) { }, "fnserverdata": function ( ssource, aodata, fncallback, osettings ) { osettings.jqxhr = $.ajax( { "datatype": 'json', "type": "post", "url": ssource, "data": aodata, "success": function(data){ } } } ); it throwing following error in ie-8: ntablewrapper...

python - SqlAlchemy UserDefinedType based on built-in type, with additional method -

i have class foo defined as: class foo(object): def bar(self): pass i want extend sqlalchemy type: class myunicode(foo, sqlalchemy.unicode): def bar(self): print "myunicode::bar" and define table this: base = declarative_base() class table(base): __tablename__ = "table" first = column(unicode(16)) second = column(myunicode(16)) finaly, want able use here: t = query(table).first() t.bar() the problem typeengine, because debugger show t type of unicode not myunicode or sqlalchemy.unicode i tried by: class myunicode(foo, unicode): def bar(self): print "myunicode::bar" class myunicode(sqlalchemy.unicode): @property def python_type(self): return myunicode but doesn't work. suggestions? i think you'll need overwrite def result_processor(self, dialect, coltype): because type database still unicode string , you'll have convert python type. somethin...

php - Cannot get values via POST -

i have written electronic payment module bank. using in server without problem. i'm trying use in server , problem after payment in bank website, in callback function can't value(referenceid,...). indeed print_r($_post) returns empty array. is there special reason not post values server? bank of course uses ssl. don't.

node.js - Node Modbus Stack ECONNREFUSED -

i in need of modbus module use in node , found light-weight solution works perfectly. modbus-stack node tootallnate. ( https://github.com/tootallnate/node-modbus-stack ) i implemented , seems work. using browser make call node server using wireshark see modbus packet go node server (modbus master) device (modbus slave) see modbus packet go device node server. but server never able return data browser. turns out node server listening , prepared handle 'response' event getting 'error' event. when handled 'error' event saw following (stringified): {"code":"econnrefused","errno":"econnrefused","syscall":"connect"} node code: var http = require("http"); var querystring = require("querystring"); var url = require("url"); var fs = require("fs"); var rir = require("modbus-stack").function_codes.read_holding_registers; http....

sql server - Creating test data for calculation using RAND() -

i attempted populate table 2 columns of random float s, of every row generated identical. ;with cte (x, y) ( select rand(), rand() union select x, y cte ) --insert calculationtestdata (x, y) select top 5000000 x, y cte option (maxrecursion 0) i can accomplish need fine not using cte , has peaked curiosity. is there way quickly? i know relative term, it, mean approximately how take execute above. what expect other cte repeat rows because you're recursion selecting them again select rand(), rand() -- select 9 , 10 union select x, y -- select 9 , 10 what want more this select rand(), rand() union select rand(), rand() -- problem 'row' duplicated so need seed , reseed each row giving like select rand(cast(newid() varbinary)), rand(cast(newid() varbinary)) union select rand(cast(newid() varbinary)), rand(cast(newid() varbinary)) using newid() seed 1 way there may others more eff...

php - HTML Table not recognising line breaks from mysql database -

i have mysql database 'address' field (varchar). have html table used display addresses of different staff members. my problem data stored in address field of database linebreaks between each line of address, when data displayed in table line breaks not there, entire address displayed on 1 line. how can fix this? i'm sure question asked time, can't find answer anywhere. i'm new php please forgive naivety. thanks, joe update: this code: if(isset($_post['submit'])) { $address = $_post['address']; $queryupdate = "update staff set address= :address id= :id"; $q = $db->prepare($queryupdate); $q->execute(array( ":id" => $id, ":address" => $address)); the data in $address variable taken simple textarea. actual line breaks never shown in html unless word-wrap set pre , or actual pre tag used. however, overcome can use nl2br() functionality in php. you'l...

cmd - Batch programming: randomly goto random parts of the code -

(i edit or delete post if wrote bad) have code can't seem pull off correctly. @ it. set /a num=%random% %%9 +1 set /p start="do want start? " if %start% ==yes goto %random% if %start% ==no exit :1 echo tu turi %score% tasku (-us)! set /p answer="6 x 5 = " if %answer% equ 30 ( echo teisingai! gavai 1 taska! set /a score+=1 echo %score% > %player%.sav ) else ( echo neteisingai :( atsakymas buvo %answer%! echo %score% > %player%.sav ) :2 echo tu turi %score% tasku (-us)! set /p answer="123 x 3 = " if %answer% equ 369 ( echo teisingai! gavai 1 taska! set /a score+=1 echo %score% > %player%.sav ) else ( echo neteisingai :( atsakymas buvo %answer%! echo %score% > %player%.sav ) :3 echo tu turi %score% tasku (-us)! set /p answer="-93128 + 993128 = " if %answer% equ 900000 ( echo teisingai! gavai 5 taskus! set /a score+=5 echo %score% > %player%.sav ) else ( ...

ruby on rails - ActiveAdmin: Filter on method rather than attribute? -

i have method on 1 of models following: def current? self.parent.start_date <= time.zone.now.to_date && self.parent.end_date >= time.zone.now.to_date && !self.archived end i'd create simple filter in activeadmin based on result of method (a simple select filter called current options yes , no , , any ) can't seem figure out how. what's best approach filtering on model method rather 1 of attributes? the following class method in activeadmin.rb return records according conditions e.g. activeadmin.current("yes") or activeadmin.current("no") . def self.current(inp = "yes") # default inp "yes" d = time.zone.now.to_date return case inp # when inp == "yes" return records archived == false (won't return archived == nil) # , parents start_date <= d , end_date >= d when "yes" where(archived: false ). joins(:parent). ...

shell - How to selectively grep? -

i have file that's structured follows: particle 1 0.1 0.988 0.2 0.975 0.2 0.945 0.3 0.900 ... ... particle 2 0.1 0.988 0.2 0.965 0.2 0.945 0.2 0.935 0.3 0.900 ... how grep first occurrence of 0.2 under each particle? e.g want grep like particle 1 0.2 0.975 particle 2 0.2 0.965 thanks in advance!! this awk one-liner help: awk '/particle/{print;p=1}p&&/^0\.2/{print;p=0}' file add test: kent$ cat f particle 1 0.1 0.988 0.2 0.975 0.2 0.945 0.3 0.900 ..... ..... particle 2 0.1 0.988 0.2 0.965 0.2 0.945 0.2 0.935 0.3 0.900 kent$ awk '/particle/{print;p=1}p&&/^0\.2/{print;p=0}' f particle 1 0.2 0.975 particle 2 0.2 0.965

jquery - Zoom in on an iFrame's CONTENT -

i trying zoom in (not change size) of iframe, source swf file. <iframe src="http://ray.eltania.net/test/swf-play/swf/testmotion.swf" width="600px" height="500px" frameborder="0"></iframe> http://jsfiddle.net/muxrx/ as can see, size of iframe 600x500px. zoom in on content of swf. imagine zooming in 90%, see slider once in while, keep same size of frame. i tried every link on stackoverflow, every result changed size of content, want zoom effect. not want stuff this: iframe { zoom: 0.5; } http://jsfiddle.net/muxrx/1/ if iframe comes different domain, can't. cross-site scripting attack, blocked browser.