Posts

Showing posts from July, 2010

c# - Restricting access to the other open browser -

i have requirement need open popup on click of button. works fine, pop window goes behind opened browser. want restrict access other opened browser window until complete transaction in newly opened window done. in order open new window using following code. response.write("detailedresults=window.open('newwindow.aspx','send data','left=(screen.width) ? (screen.width - 800) / 2 : 0,top=(screen.height) ? (screen.height - 700) / 2 : 0, width=1000, height=500, toolbar=no, menubar=no, titlebar=no, location=no, addressbar=no');"); i use modal dialog instead of popup. one, modal dialogs less intrusive other tabs might open, , two, typically include semi-transparent overlay layer covering main window restrict access requested. here example jquery ui: http://jqueryui.com/dialog/#modal-confirmation

knockout.js - Where to trigger application of bindings -

in durandal app have dialog containing view bound viewmodel. the label elements each of input elements includes warning glyph done icon-warning-sign. visibility of each glyph controlled data-binding this: <div class="form-group"> <label for="email"> email <i class="icon-warning-sign orange" data-bind="visible:email.haserror, attr: { title:email.validationmessage }"></i> </label> <input id="email" class="form-control" type="text" data-bind="value: email, valueupdate: 'afterkeydown'" /> </div> email observable property of view model. haserror property sub-observable created extender. there several of these, here's sample. validate implementation varies. function prepforextender(target) { if (target.haserror) return; target.haserror = ko.observable(); target.validationmessage = ko.observable(); } ko.extenders.require...

c++ - Combine Multiple Data Types To Formulate A packet -

i'm attempting create class combine variables of multiple types single variable can used send remote machine , reconstruct class data. you construct new packet, packet have 'data variable', not sure type of variable should be, networking library allows data sent 'const void *' datapacket *packet = new datapacket(); add data packet, passes value of type specify , 'appends' onto end of 'data variable' packet.adddata<int>(45); packet.adddata<bool>(true); packet.adddata<const char*>("test"); send packet off, send 'data variable' remote machine through networking library packet.send(); construct packet on receiving machine passing 'data variable' sent, construct copy of packet sent sending machine datapacket *packet = new datapacket(data); read out data in same order wrote moving through 'data variable' start end little more every time getdata called int var1 = packet.getdata<i...

How to set each and every row of a ListView to transparent in Android? -

i have listview in rows generated using simpleadapter . have 3 textviews , 2 imageviews in it. have set background of listview android:background="@drawable/backgnd" .the textview's background set following android:background="#20535252" . getting nice glass/transparent kind of background textviews placed, don't glass background @ whole row of listview. can suggest me solution this. hi depends on color choosing in layouts , can modify color transparent adjusting the values below android:background="#80xxxxxx" (or) bg.setcolor(color.argb(128, xxx, xxx, xxx)); (or) android:background="@android:color/transparent" use , in xxxxx fields add ground color give smooth glass color backgrounds... best... this custom adapter use have used layouts in adapter put custom layout in adapter customadapter madapter = new customadapter(this, r.layout.listitem, mlistitems); mpullrefreshlistview.setadapter(m...

angularjs - Is there an image carousel that is compatible with the Angular Jquery Mobile adapter? -

i've been working on photo app , chose build around tigbro angular-jqmobile adapter. i've come along point need image carousel, , none of options finding out , working me. have tried swipeview , angular-carousel ... no luck whatsoever. locked in pretty old versions of angular (1.0.6) , jquerymobile (1.3.1). does know image carousel solution work in environment? (added bonus, happening within cordova project...) thanks.

php - How to clear $this to insert more records in CodeIgniter? -

with ci, want insert 1 record in user table , 1 in post table. below brief of code (two tables have multiple columns, , use 1 example). $this->username=$user; $this->db->insert('user',$this); $this->title='my first post'; $this->db->insert('post', $this); however, second insert "insert post (user, title) values ('$user', 'my first post'). , error reported unknown column user in post. how can clear members in $this before inserting next records (in table)? this happening becouse of $this->username=$user; you need use $this->db->insert('post', $this->title); and before insert, set in title want, not $this->db->insert('post', $this); however if still want work object, more information how can find here, http://ellislab.com/codeigniter/user-guide/database/active_record.html#insert

asp.net - Radio Button in C#.net -

i doing project on “ online railway reservation system ” using c# .net front end , sql server backend. in project have make 1 page train inquiery in have provided souce , destination city. in page had used 2 gridview, gridview1 , gridview2 : in gridview1 trains table binding. in gridview2 had seat table binding. in gridview1 have used radio button in template field , autopostback property set true . if set autopostback property value of radio button false have not class value… have set autopostback property true . when clicking radio button gridview data changed should not happen please me… first need ask questions why don't want post back(autopostback=true)? if answer "it loading whole page again" use "update panel"...

Issue while converting JSON to XML in Java -

i have json data accessed third party server. contains large content , starts [ { "id":1845, "title":"llm in transnational oil, gas , energy law online learning", "category_id":4, "sub_category_id":null, "timestamp":"2013-05-15t11:56:19.168508z", "start_time":"2013-09-29t15:00:00+01:00", "end_time":"2014-12-19t19:30:00+00:00", "summary":"develop deep, practical understanding of how resolve challenges posed\r\nby national authorities oil, gas , energy production.\r\n" ... i cannot convert json xml, using jsonserializer , xmlserializer . got following error: ncname 0*20 illegal character i tried org.json libraries jsontokenizer , jsonarray retrieve text not generate xml output.

hadoop - How to send multiple line text to key/value in MapReduce, not single line -

i'm studying mapreduce. face problem. my data ...(in example.) <doc> <id> no-001 </id> <value> 001 value. </value> </doc> <doc> <id> no-002 </id> <value> 002 value. </value> </doc> ... i need change above text ... this 001 value. no-001 002 value. no-002 ... i want send multiple line between , value of mapper in mapreduce. key anything. have searched example, can't problem. to solve problem, think must handle inputformat. please answer problem. you should use mahout xmlinputformat class xml-files' parsing. allows configure driver code this: conf.set("xmlinput.start", "<doc>"); conf.set("xmlinput.end", "</doc>"); job.setinputformatclass(xmlinputformat.class); and inside mapper may process xml-content parser like. there is tutorial xmlinputformat class.

c++ - How is the keys searched in a STL map? -

how keys stored , searched in stl std::map ? data structure used store keys (or values also) in map , algorithm used search keys in std::map ? from cppreference : maps typically implemented binary search trees. by default less<t> used compare keys, can specify custom compare function template parameter.

c# - BackgroundTransfer cannot move files -

i having problem downloading files using background transfer. after completion of download when moving file, gives exception operation not permitted void addtransferrequest(string filename) { if (string.isnullorempty(filename)) return; string filepathtodownload = string.empty; filepathtodownload = activereciter.downloadurl; filepathtodownload += filename; uri transferuri = new uri(uri.escapeuristring(filepathtodownload), urikind.relativeorabsolute); backgroundtransferrequest transferrequest = new backgroundtransferrequest(transferuri); transferrequest.method = "get"; transferrequest.transferpreferences = transferpreferences.allowbattery; uri downloaduri = new uri(datasource.tempdownloadlocation + filename, urikind.relativeorabsolute); transferrequest.downloadlocation = downloaduri; transferrequest.tag = filename; transferrequest...

eclipse - Build WAR file using Ant for WebApplication -

i have created sample/default test web project in eclipse. then using ant build , deploy. export default build.xml. ant doesn't have task create war file. so, have write task creating war. i used below code. <property name="app" value="testantwar"/> <property name="tomcatwebapps" value="c:/apps/apache/jakarta/tomcat/tomcat-6/webapps" /> ...... <target name="buildwar" description="create war file"> <war basedir="${basedir}/build" destfile="${app}.war" webxml="${basedir}/webcontent/web-inf/web.xml"> <fileset dir="webcontent"/> <exclude name="web-inf/**" /> <lib dir="webcontent/web-inf/lib"/> <lib dir="lib"/> <classes dir="build/classes"/> <classes dir="config"/> ...

php - Delete html Row and Delete Column dynamically using Javascript -

i'm trying add , remove row , column table dynamically.while i'm trying static contents code working fine. same thing i'm trying fetching data database , adding deleting row/column it's not working..added rows getting deleted value contains mysql row , column not getting deleted. javascript: //*********************************start add row ********************************************************** function addrowtotable() { var tbl = document.getelementbyid('tbl_sales'); var columncount = tbl.rows[0].cells.length; var rowcount = tbl.rows.length; var row = tbl.insertrow(rowcount); // every row added checkbox on first cell-------------------------------------- var cell_1 = row.insertcell(0); var element_1 = document.createelement("input"); element_1.type = "checkbox"; element_1.setattribute('id', 'newcheckbox'); cell_1.appendchild(element_1); // every row added add se...

android - Autocomplete with Google Places API -

i developing application related train. how can autocomplete textview railway station name in india using google places api. the railway station names static , not huge in number, can put them in javascript array well. faster autocomplete.

c# - System.Web.UI.WebControls.DataGrid' does not contain a definition for 'Rows' -

i got excel value in gridview , need insert values in rows sql server 2008. when try iterate throught gridview rows throws error in loop near dg_agentsfr.rows "datagrid' not contain definition 'rows' " here code: protected void savedatafromgv() { foreach (gridviewrow g1 in ***dg_agentsfr.rows)*** { sqlconnection con = new sqlconnection(strconnstring); sqlcommand cmd = con.createcommand(); cmd = new sqlcommand("insert tb_transagenseafreightrate(pol,pod,forwarder,forwarder reference,shipping line,container type,container size,validity from,validity to,basic rate,paf,caf,pss,total amount,ree days,credit days,nit deposit,companyid,isactive) values ('" + g1.cells[0].text + "','" + g1.cells[1].text + "','" + g1.cells[2].text + "','" + g1.cells[3].text + "','" + g1.cells[4].text + "','" + g1.cells[5].text + "','...

c# - Protected method access from derived class -

i have protected method in base class : public class baseclass { protected virtual void foo(){} } the method overrided 1 of derived classes: public class derived1 : baseclass { protected override void foo() { //some code... } } another derived class has instance of first derived class. when try access foo method (existing in base class, mentiond) error : public class derivedclass2 : baseclass { baseclass instance = new derivedclass1(); instance.foo(); // here error } the error get: error cs1540: cannot access protected member 'baseclass.foo' via qualifier of type 'baseclass'; qualifier must of type 'derivedclass2' (or derived it) i understand protected members should not give value other instance, instance derived same type, there way not modify method public? you can make foo method declaration protected internal.... public class baseclass { protected internal virtual void f...

c++ - Qt ogre3d application - error loading scripts and materials -

i using qt5 , ogre3d 1.9 , aim have @ end ogrewidget working on machine. first, trying create simple ogre app. (i working windows7) therefore, followed tutorial: setting application qtcreator i runned several problems: first can load opengl render system, see plugin file , dlls below. i can compile, cannot load resources scripts , materials basic example. example app showing ogre head. thus, without these resources, head has no texture... thus, here questions: - how can example work textures, , texture problem dependent on 2 resources cannot load? - should use older version of either qt or ogre3d? - @ end, goal have qtwidget working, have clue too? thanks time. the dlls: cg, ogremain_d, ogreoverlay_d, ogrepaging_d, ogreproperty_d, ogrertsshadersystem_d, ogreterrain_d,ogrevolume_d, ois_d, plugin_cgprogrammanager_d, pluginbspscenemanager_d, pluginoctreescenemanager_d,octreezone_d, plugin_particlefx_d,pluginpczscenemanager_d,rendersystem_direct3d9_d,rendersystem_direct...

Titanium + AJAX and array -

the question in title. make request titanium.network.httpclient assuming result of call (ty var_dump) : array(2) { [0]=> string(3) "foo" [1]=> string(3) "bar" } edit : here complete function. var paramsrecepteur = "demande=recepteur"; var client = ti.network.createhttpclient({ // si la réponse est ok onload : function(e) { ti.api.info("**************************************"); var results = json.parse(this.responsetext); ti.api.info(results[0]); ti.api.info("**************************************"); }, // si erreur . ou timeout ! onerror : function(e) { alert("erreur recepteur"); }, timeout : 5000 // implique un probleme reseau }); ti.api.info("¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤"); ti.api.info(url); // url defined upper & correct. ti.api.info("¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤"); client.setrequestheader("conten...

multithreading - How can I test if Python http.server.HTTPServer is serving forever? -

i writing little demo code start http server, test running , exit. import http.server import urllib.request import threading # start http server httpd = http.server.httpserver(('', 8080), http.server.simplehttprequesthandler) thread = threading.thread(target=httpd.serve_forever) thread.start() # test http server , shutdown print(urllib.request.urlopen('http://127.0.0.1:8080/').read()) httpd.shutdown() this seems working fine might working fine due luck. see, invoking httpd.serve_forever in separate thread, script doesn't block @ call , can continue urllib.request.urlopen call test http server. but must ensure making urllib.request.urlopen call after httpd.serve_forever has been invoked , server serving requests. is there flag or method in http.server.httpserver or socketserver.tcpserver me ensure begin testing urllib.request.urlopen after ready serve requests? if goal not empty / invalid answer in urlopen, answer won't. open socket ...

c++ - Strange ld error -

i have following situation. i've written library (liba) helper classes , application (app) depends on library. in 1 of cpp files of app call function liba has following form: int computesomething(int param) { int val; // call internal liba function. val = computeinternal(param); return val; } during building of app linking error "undefined reference computeinternal" leads following error message "collect2: error: ld returned 1 exit status". has idea why linker requires reference internal liba function? what more interesting application built using microsoft tools.

shell - Read any .txt file in the folder through bash -

the idea want read .txt file in specific folder , something. tried code: #!/bin/bash #read file line line while read line if [ $i -ne 0 ]; #do something... fi done < "*.txt" echo "finished!" i think got idea now. advice. after doing stuff, want move file folder. to avoid using cat unnecessarily, use for loop: for file in *.txt while read line # whatever mv -i "$file" /some/other/place done < "$file" done this treats each file separately can perform actions on each 1 individually. if wanted move files same place, outside loop: for file in *.txt while read line # whatever done < "$file" done mv -i *.txt /some/other/place as suggested in comments, have added -i switch mv , prompts before overwriting files. idea, when expanding * wildcard. if rather not prompted, instead use -n switch not overwrite files.

gcc - Why cant seabios compile with -fno-inline -

i'm trying compile seabios in more debug-able state, , want cancel function inlining. to so, have added -fon-inline compilation flag, compilation error: error: can't find register in class 'general_regs' while reloading 'asm' which complaning on following code: asm volatile( "calll __call16big_from32" : "+a" (callregs), "+m" (*callregs) : : "ebx", "ecx", "edx", "esi", "edi", "cc", "memory"); i've looked error , found means compiler has ran out of registers can't compile asm statement. the thing is, exact same code compile fine without -fon-inline, why that? the first argument asm may not share register address of second because first modified. if function inlined callregs may constant or offset stack pointer, , therefore separate register not required. given presence of volatile , "memory", , no re...

python - How to hide a field in django modelform? -

for example: class testmodel(models.model): ref1 = models.foreignkey(refmodel) text1 = models.textfield() class testmodelform(modelform): class meta: model = testmodel fields = ('text1') i allow user input text1 field, when redefine post method of view, want set ref1 value, how should that? i wish can let testmodelform has ref1 field don't let user modify it, can modify value of request.post in post method, , pass testmodelform, possible? you can use hiddeninput ref1 widget: class testmodelform(modelform): class meta: model = testmodel widgets = { 'ref1': forms.hiddeninput(), } another option saving form commit argument equal false . way can include visible fields in form , update model instance needed data: def some_view(request): # ... if request.method == 'post': form = testmodelform(request.post) if form.is_valid(): inst...

ios - Multisample framebuffer failed to make in GLKView error 8cdd -

i'm creating glkview above view draw lines on. have got strange problem. task need use multi-sampling done line self.drawablemultisample = glkviewdrawablemultisample4x; in constructor. on simulator on ios 7.1/7/6.1 got expected result. on ipad mini 1 same result. edit: ipad 2 works. but if use ipad 1 (5.1) or ipad 4 (7.1) following error. failed make complete multisample framebuffer object 8cdd if check error gluint returned = glcheckframebufferstatusoes(gl_framebuffer_oes); nslog(@"error code: %x -->", returned); i error code: 8219 on ipad 4 , error code: 8cdd on ipad 1 and no drawing done of course. if disable multi-sampling there no error. class used in big project , subclassed. using super class not solve problem. glk done in code superview simple uiview .xib file. if use class in new project making glkview in storyboard class, multi-sampling works fine. if further informations needed don't hesitate ask. in advance. update: there...

jQuery Syntax error, unrecognized expression -

i have script updates fixed menu user's position scroll down page. working on front-end error free, have started working on wordpress integration getting bizarre error message having trouble understanding. one loading page fine, scroll down error appears. here jsfiddle. http://jsfiddle.net/2k4eq/ seems related full url, works #whatwedo. syntax error, unrecognized expression: http://localhost:8888/sitename/#whatwedo from jquery sizzle.error = function( msg ) { throw new error( "syntax error, unrecognized expression: " + msg ); }; thank you! // update menu position on scroll $(function() { function updatemenu() { var lastid, mainmenu = $("#main-menu ul"), mainmenuinnerheight = mainmenu.outerheight(), mainmenuitems = $("#main-menu.navigation ul").find(".section-item a"), sliderbuttons = $("#call-to-actions "), ...

c++ - Why do my threads sometimes "stutter"? -

Image
i trying write multithreaded code read daq device , render captured signal @ same time: std::atomic <bool> rendering (false); auto render = [&rendering, &display, &signal] (void) { while (not rendering) {std::this_thread::yield ();}; {display.draw (signal);} while (display.rendering ()); // returns false when user quits rendering = false; }; auto capture = [&rendering, &daq] (void) { (int = daq.read_frequency (); --> 0;) daq.record (); // fill buffer before displaying signal rendering = true; {daq.record ();} while (rendering); daq.stop (); }; std::thread rendering_thread (render); std::thread capturing_thread (capture); rendering_thread.join (); capturing_thread.join (); sometimes work fine, bad stuttering. had render () , capture () print line upon each loop iteration, , colored lines such red render () , blue capture () : ...

Metro Style in WPF applications _ Packages differences -

i want create metro style application, did researches , found lots of articles , tutorials that. but still need clear comparison between modern ui wpf , elysium , mahapps . testing of them takes time ! need learn bout each one's features decide 1 start. thanks, first : download wpf shell integration library here then use xml code : <window x:class="mylibrary.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell" title="mainwindow" windowstyle="singleborderwindow" resizemode="canresizewithgrip" mc:ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/200...

How to ORDER BY FIELD VALUE in MongoDB -

in mysql use field() function in order by clause: order field(id, '1', '6', '3', ...); how 1 same results in mongodb? tried following: .find(...).sort({id: [1, 6, 3]}) this did not work so record: given array [1,6,3] want in query this: db.collection.aggregate([ { "$project": { "weight": { "$cond": [ { "$eq": ["_id": 1] }, 3, { "$cond": [ { "$eq": ["_id": 6] }, 2, { "$cond": [ { "$eq": ["_id": 3] }, 1, 0 ]}, ]}, ]} }}, { "$sort": { "weight": -1 } } ]) and gives specific "weights" order of "array" of inputs "project" weights upon results.

c# - Invalid Index. Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX) when Workbooks.Open -

i trying make app open xlsx file reading, , read , stuff it. when run app, , click button load file, getting error: invalid index. exception hresult: 0x8002000b (disp_e_badindex) on line of code: excel.workbook = excelapp.workbooks.open("c:\\test.xlsx", 0, true, 5, "", "", true, microsoft.office.interop.excel.xlplatform.xlwindows, "\t", false, false, 0, true, 1, 0); can suggest wrong here? edit: here full code hope easier tell causes error using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using excel = microsoft.office.interop.excel; using system.reflection; namespace windowsformsapplication2 { public partial class form1 : form, idisposable { public form1() { initializecomponent()...

php - Why does MySql format datetime microseconds as .000000? -

i not sure why, when new record added database table, format of time followed period , 6 zeros. example 2014-03-24 11:00:03.000000 i using following php code date , time date("y-m-d h:i:s") the record added database via array, passed through following function: $record = array( 'date' => date("y-m-d h:i:s") ); function: $data = '`' . implode('`, `', array_keys($record)) . '`'; $values = '\'' . implode('\', \'', $record) . '\''; mysql_query(" insert `". $table ."` ($data) values (". $values .") "); i don't think mysql supports microseconds, ideally remove makes table messy. suggestion on how can remove microseconds? if care format of datetime value when returned, use date_format() : select date_format(col, '%y-%m-%d %h:%i;%s') yyyymmss_hhmmss don't depend on database returning value in particular format, ...

database - java resultSet not updatable -

i have problem in resultset when made update on value inside database , have primarykey inside db exception have com.mysql.jdbc.notupdatable: result set not updatable protected void processpairwords() { int count1=0; try { statement st1; statement st2; st1 = conn.createstatement(resultset.type_scroll_sensitive, resultset.concur_updatable); st2 = conn.createstatement(resultset.type_scroll_sensitive, resultset.concur_updatable); resultset res1 = st1 .executequery("select txt,freq,prob searchtb txttype=1"); resultset res2= st2 .executequery("select txt,freq,prob searchtb txttype=2"); res1.beforefirst(); res2.beforefirst(); while (res1.next()){ while(res2.next()) { if(res2.getstring("txt").startswith(res1.getstring("txt...

c++ - C++11 variable size POD struct -

i writing low-lewel data manipulation code in c++ 11 , want use old-known c feature of flexible arrays @ end of struct ( see info here ). struct variablecell { /** * @brief size in bytes of following data. */ std::uint32_t cellsize; /** * @brief data stored in overlay. */ std::uint8_t celldata[]; }; once use gcc paramaters -wall -pedantic -std=c++11 i waring xxx.h:xx: warning: iso c++ forbids zero-size array 'variablecell' [-wpedantic] this used correct feature. please, not tell me approach wrong - , has been correct way low-level data manipulation. why standard changed , how disable 1 particular warning? thanks edit: apologies, mistaken c feature turned 1 of exceptions not c++ include. consider using different approach. curiosity, compilers allows non-standard extension , how make them accept without warning? thanks as reference incompatibilities between iso c , iso c++ states in flexible array members s...

r - get extension of file without knowing the extension, no patterns -

how can extension of file? there function or tool package in r this? for example, if have file "file.txt", how extension?. want extension without having know, can not use functions use patterns. thank much use file_ext > file_ext("test.exe") [1] "exe" as side note, don't need separate package file i/o tasks, have in package base set of functions dealing files. are: file file.access file.exists file.info and many many others. cool 1 basename extract file name path

LESS to CSS conversion -

i'm eager start working less. i've been trying figure out how should convert less css. googled , found lot of things confused me more rather making things simple. i not want install ruby. , not want install .net on pc (found 1 method google.) i read 'simpless' outdated. (their last blog post in july 2012) the easiest read use less.js file , done. not production. can please me way out problem. if familiar grunt suggest try this: https://www.npmjs.org/package/grunt-contrib-less here nice tutorial started grunt: http://www.justinmccandless.com/blog/a+tutorial+for+getting+started+with+grunt

javascript - Node.js: test assert that a pointer points to myType, not only to object -

i've "userservice" object contains functions like: exports.userslist exports.insertuser exports.registeruser etc... in test file have: var usercontroller = servicefactory.getuserservice(); now, i've assert usercontroller points userservice if do: typeof usercontroller it returns object type , not "userservice" want. how can check trough node.js assertions? if defined class (that function in js), try instanceof // in user_controller.js file function usercontroller() { ... } usercontroller.prototype.userlist = function() { ... } module.exports = usercontroller // in file var usercontroller = new usercontroller(); usercontroller instanceof usercontroller // prints true

php - Error with strings in JavaScript -

i have rare problem variables between php , javascript. this example: <?php $test = "123"; ?> $(document).ready(function(){ alert('.$test.'); }); works fine, if put $test = "hello"; doesn't works fine. works in js when put numbers. the php variable server side variable. javascript accessing variable on client. in order javascript need like: <?php $test = "123"; ?> $(document).ready(function(){ alert('<?php echo($test); ?>'); }); that should it! alternate approach the alternative set variable in javascript have value on client. looks like: <?php $test = "123"; ?> var $test = <?php echo($test); ?>; $(document).ready(function(){ alert('.$test.'); }); the nice part can use "$test" anywhere need without worrying client versus server.

ruby - Calabash -Android: Can we simulate Home button on Android devices for Calabash-Android? -

can simulate home button on android devices calabash-android? need tap on home button in our scripts execute scripts using calabash. i have not tried yet myself. looking around solution did find this. link http://krazyrobot.com/2014/02/calabash-android-enter-text-from-keyboard-using-adb/ balazs balazs aka krazyrobot his solution use send keycodes, home button keycode_home. wrapping calabash give you: system("adb shell input keyevent keycode_home") again have not tried this, sounds solution.

ios - file is encrypted or is not a database message when application Become Active -

i have random case of not able access sqlite database ipad app. have used fmdatabase access sqlite database , have not enable dataprotection in provisioning profile.also sqlite version 3. happens passcode enabled devices. when device goes sleep while app in foreground error comes randomly when user enter passcode. once user enter passcode app comes foreground , database inaccessible sqlite code 26: file encrypted or not database can 1 me solve issue. i have added 1 place occurred -(nsstring*)getvalueforsetting:(nsstring*)settingname{ __block nsstring *settingvalue ; nsstring *sql = [nsstring stringwithformat:@"select settingvalue settings settingname = '%@' ",settingname]; fmdatabasequeue *queue = [fmdatabasequeue databasequeuewithpath:[databaseutility getdbpath]]; @try{ [queue indatabase:^(fmdatabase *database) { fmresultset *results = [database executequery:sql]; if (![database haderror]) { if...

asp.net mvc 4 - HTML Helper in MVC -

how use overload of html.textbox in mvc. @html.textbox(string name, object value, string format, object htmlattributes) the name represents name of texbox the value represents value of textbox i.e text inside textbox the htmlattributes represents html attributes what format (the third parameter) represents? how use it? please provide example. thanking you. simple basic question. have searched google , did not answer. the name represents name of texbox the value represents value of textbox i.e text inside textbox the htmlattributes can specify your id control , css classes string format can specify formats "{0:d mmm yyyy}" for example: @html.textboxfor("txtdate","somedate","{0:d mmm yyyy}", new { @class="input-large" })

I need help in a iframe -

i not have knowledgement of html, css, etc. , work on wordpress website. my question how make iframe in website http://www.stadtrundfahrten-muenchen.de/de/startseite/#top when click in order button!? i have similar website boxes , button saying "order now", in fact iframe should equal website because same ticketing provider. sent me iframe link cannot make website! can me or tips? regards the website mentioned not use iframe anywhere. if trying set dynamic size of iframe please reefer here: how-to-set-iframe-size-dynamically if can post iframe trying implement

keyboard - How to get a combination of keys in c# -

how can capture ctrl + alt + k + p keys on c# form? thanks it chord, cannot detect without memorizing having seen first keystroke of chord. works: public partial class form1 : form { public form1() { initializecomponent(); } private bool prefixseen; protected override bool processcmdkey(ref message msg, keys keydata) { if (prefixseen) { if (keydata == (keys.alt | keys.control | keys.p)) { messagebox.show("got it!"); } prefixseen = false; return true; } if (keydata == (keys.alt | keys.control | keys.k)) { prefixseen = true; return true; } return base.processcmdkey(ref msg, keydata); } }