Posts

Showing posts from February, 2012

google app engine - How to update single files in GAE? -

the following command upload whole project google app engine: appcfg.py -r update c:/users/user/desktop/myproject/ however, made corrections locally single file of project called index.php , update server version without uploading whole project, large. i have tried: appcfg.py update c:/users/user/desktop/myproject/index.php (notice removed -r , added file name @ end) prints: usage: appcfg.py [options] update appcfg.py: error: directory not contain index.yaml configuration file. any idea? my inexperience google app engine made me post question, got answer on own after little while. hahahaha discovered did not know before. after making changes index.php file , decided redeploy whole thing. time took less minute redeploy server (the first time took on 10). it seems local appgine scans local changes , submits instead of whole project! therefore re-running: appcfg.py -r update c:/users/user/desktop/myproject/ will update files changed only.

Android gradle build: running assembleDebug makes release tasks of project dependencies being called -

when running assembledebug, release related tasks of projects depend on called. e.g. have project called 'x' depends on 'y'. when gradle assembledebug calls y:mergereleaseproguardfiles, packagereleaseaidl, etc... etc.. android library modules publishes "release" build type. don't have "debug" build type. application module build debug version, use release version of library. you can enable "debug" build type of library dependency using following in module's build.gradle file: android { publishnondefault true ... } then when using dependency in other module, should use this: dependencies { releasecompile project(path: ':moduley', configuration: 'release') debugcompile project(path: ':moduley', configuration: 'debug') } i using same trick in application. have shared module , use debug version of module. find details here: https://github.com/pomopomo/wearpomodoro/bl...

Eclipse plugin: java.lang.NoClassDefFoundError -

Image
as can see: i added jni4net.j-0.8.6.0.jar referenced libraries stell receive java.lang.noclassdeffounderror exception: java.lang.noclassdeffounderror: net/sf/jni4net/bridge @ sibeclipseplugin.debug.debuggerinterface.initialize(debuggerinterface.java:15) @ sibeclipseplugin.debug.sibdebugtarget.<init>(sibdebugtarget.java:65) @ sibeclipseplugin.ui.launch.launchconfigurationdelegate.launch(launchconfigurationdelegate.java:30) @ org.eclipse.debug.internal.core.launchconfiguration.launch(launchconfiguration.java:858) @ org.eclipse.debug.internal.core.launchconfiguration.launch(launchconfiguration.java:707) @ org.eclipse.debug.internal.ui.debuguiplugin.buildandlaunch(debuguiplugin.java:1018) @ org.eclipse.debug.internal.ui.debuguiplugin$8.run(debuguiplugin.java:1222) @ org.eclipse.core.internal.jobs.worker.run(worker.java:53) caused by: java.lang.classnotfoundexception: net.sf.jni4net.bridge cannot found sibeclipseplugin_0.0.0.1 @ org.ecli...

Smarty reading config values from .conf files in PHP -

for meeting schedule, want have dynamic pages given room. user can edit file named "schedules.conf" in config folder. @ moment looks this: [rooms] room = 5022 room = 5082 and can load , shows 2 links in web page: {config_load file="schedules.conf" section="rooms"} ...... ...... ...... {foreach from=#room# item=r} <li><span><span><a href="{$smarty.const.site_url}/admin/schedules.list.php?room={$r}">schedules {$r}</a></span></span></li> {/foreach} so links handler php file, in php file want check weather room exist in config file, if manually change value room in address bar have chance handle that: if(!isset($_get["room"])) { header('location: '.site_url.'/admin/index.php'); } else { $validrooms = $smarty->getconfigdir(); //how check id $_get["room"] value exist in config file } g...

sql server - CTE Recursion to get tree hierarchy -

i need ordered hierarchy of tree, in specific way. table in question looks bit (all id fields uniqueidentifiers, i've simplified data sake of example): estimateitemid estimateid parentestimateitemid itemtype -------------- ---------- -------------------- -------- 1 null product 2 1 product 3 2 service 4 null product 5 4 product 6 5 service 7 1 service 8 4 product graphical view of tree structure (* denotes 'service'): ___/ \___ / \ 1 4 / \ / \ 2 7* 5 8 / / 3* ...

javascript - JS - Set variables value in function but use variable outside of it? -

i need set variables value within function, use outside of function. can done? $(document).ready(function() { $(window).scroll(function () { var myvar = something; }); console.log(myvar); }); yes, need first declare outside of function. $(document).ready(function() { var myvar; $(window).scroll(function () { myvar = something; }); console.log(myvar); }); just know myvar updated after scroll event triggered. so, console.log log undefined because runs before event runs , sets variable.

excel - Vlookup translation error in multiple sheets -

suppose have sheet question numbers , different respondents. example, in sheet 1 have q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 person 1 3 1 5 2 4 1 2 1 5 person b 5 1 5 1 3 3 2 5 4 3 person c 5 1 5 1 3 3 2 5 4 3 on sheet 2 have same setup q5 q4 q2 q3 q4 q6 q7 q8 q9 q10 person person b person c when type following in on respective sheet 2 calls: =vlookup(a1,sheet1,b$1+1,0) # return value of person a, q1 sheet 1 i value of person q6 instead. why? am right assume using excel? if so, equation use is: =vlookup($a2,table1,match(b$1,sheet1!b1:k1)+1,false) you can't pass whole sheet parameter. going need pass range. here named table1. in third parameter, adding 1 string, causes problems. use match function column number.

python - What is the pythonic way of generating this type of list? (Faces of an n-cube) -

if n == 1: return [(-1,), (1,)] if n == 2: return [(-1,0), (1,0), (0,-1), (0,1)] if n == 3: return [(-1,0,0), (1,0,0), (0,-1,0), (0,1,0), (0,0,-1), (0,0,1)] basically, return list of 2n tuples conforming above specification. above code works fine purposes i'd see function works n ∈ â„• (just edification). including tuple([0]*n) in answer acceptable me. i'm using generate direction of faces measure polytope. directions, can use list(itertools.product(*[(0, -1, 1)]*n)) , can't come quite concise face directions. def faces(n): def iter_faces(): f = [0] * n in range(n): x in (-1, 1): f[i] = x yield tuple(f) f[i] = 0 return list(iter_faces()) >>> faces(1) [(-1,), (1,)] >>> faces(2) [(-1, 0), (1, 0), (0, -1), (0, 1)] >>> faces(3) [(-1, 0, 0), (1, 0, 0), (0, -1, 0), (0, 1, 0), (0, 0, -1), (0, 0, 1)]

javascript - wierd way to get chrome, IE 8 and firefox to submit the same form -

this way found 3 browsers submit form without problems. there obvious reason why so? more elegant solution this? i'm using jquery 1.9. chrome odd man out here, code in else sufficient submit via ie , firefox. function submitformbypost(actionname){ $("#eventaction").val(actionname); var is_chrome = navigator.useragent.tolowercase().indexof('chrome') > -1; if(is_chrome){ document.getelementbyid('myform').method='post'; document.getelementbyid('myform').submit(); } else{ document.forms[0].method='post'; document.forms[0].submit(); } } the way works in chrome work in others also, use that: function submitformbypost(actionname){ $("#eventaction").val(actionname); var frm = document.getelementbyid('myform'); frm.method = 'post'; frm.submit(); } or using jquery way: function submitformbypost(actionname){ $...

android - Nested fragments and back button cause duplicate id -

i have activity hosts 3 fragments in viewflipper. each of 3 fragments hosts fragments of own. using viewflipper tab control, allows me switch between various "views" in app. works fine, far. when user inside view, there navigation flow. use: final fragmenttransaction txn = getchildfragmentmanager() .begintransaction(); txn.replace(r.id.view1_silo_container, new view1fragment()); txn.addtobackstack(null); txn.commit(); to move around inside view. user navigates, call variation of code above replace current fragment new one. again, works fine far. the problem that, when bottom fragment (a>b>c) , hit button go (c>b) duplicate id error. problem "b" fragment has fragment nested in it. long avoid giving fragment id, there no problem. however, if give fragment id "duplicate id, tag null, or parent id 0x0 fragment". i don't understand why problem, , haven't found way work ar...

Add New Row to SlickGrid -

hi have tried these 2 codes inserting new row in slickgrid. code-1: data1.push({id: "12345", name: "seckey", field: "seckey", complete:true}); //grid1.setdata(data1); //grid1.render(); it inserting undefined in slick grid cell.. code-2: try{ var rowdata = grid1.getdata(); //alert(rowdata+"rowdata"); newid = dataview1.getlength(); //alert(newid); newrow.id = newid + 1; //alert(newrow.id); var newrow = {title: "new title"}; //alert(newrow); dataview1.insertitem(newrow.id, newrow); alert("end"); }catch(e){ alert("error:"+e.description); } the code-2 catches , gives error..let me know wat have code change.! you can follows if using dataview, function addnewrow() { dataview.additem({id: "12345", name: ...

java - What exactly is meant by Spring transactions being atomic? -

my understanding of atomic operation should not possible steps of operation interleaved of other operation - should executed single unit. i have method creating database record first of check if record same value, satisfies other parameters, exists, , if not create record. in fakecode: public class foodao implements ifoodao { @transactional public void createfoo(string foovalue) { if (!fooexists(foovalue)) { // db call create foo } } @transactional public boolean fooexists(string foovalue) { // db call check if foo exists } } however have seen possible 2 records same value created, suggesting these operations have interleaved in way. aware spring's transactional proxies, self-invocation of method within object not use transactional logic, if createfoo() called outside object expect fooexists() still included in same transaction. are expectations transactional atomicity should enforce wrong? need using synch...

ocr - ABBYY Flexicapture Layout/Setup stations recognizing different things -

Image
when build abbyy flexicapture layout in layout studio captures perfectly. after saving , exporting layout setup station of information missing, particularly info in repeating group. for example, in repeating group in layout studio can find 2 'taxes' listed on page. recognized @ quality no errors. however, in setup station, 1 of 2 taxes captured. fl studio location_taxes repeating block fl studio captured taxes (2/2) close of tax repeating group fc studio captured tax (1/2) is there missing cause recognition work in layout studio not in setup/capture? thanks it see abbyy flexilayout project there couple of causes, , test , confirm solution. think see issue enough. when capture elements using repeatable group element, make sure expose capture results in flexilayout studio under blocks block has "has repeating instances" enabled (checkmark). show instances in flexicapture, not first captured instance. think issue, because stated see 1 ins...

node.js - Compare two date fields in MongoDB -

in collection each document has 2 dates, modified , sync. find modified > sync, or sync not exist. i tried {'modified': { $gt : 'sync' }} but it's not showing expected. ideas? thanks you can not compare field value of field normal query matching. however, can aggregation framework: db.so.aggregate( [ { $match: …your normal other query… }, { $match: { $eq: [ '$modified', '$sync' ] } } ] ); i put …your normal other query… in there can make bit use index. if want documents name field charles can do: db.so.ensureindex( { name: 1 } ); db.so.aggregate( [ { $match: { name: 'charles' } }, { $project: { modified: 1, sync: 1, name: 1, eq: { $cond: [ { $gt: [ '$modified', '$sync' ] }, 1, 0 ] } } }, { $match: { eq: 1 } } ] ); with input: { "_id" : objectid("520276459bf0f0f3a6e4589c"), "modified" : 73845345, "sy...

php - Recaptcha check page returns nothing -

i have feedback webpage on php-based project. feedback page has form fields need , put recaptcha display there , works fine: displayed , functions according google manuals. form "action" set page should check recaptcha, prevent sql injections , insert user message db. seems simple. the problem in second page. returns blank though shouldnt: <?php require_once('recaptchalib.php'); $privatekey = "my private key"; $resp = recaptcha_check_answer ($privatekey, $_server["remote_addr"], $_post["recaptcha_challenge_field"], $_post["recaptcha_response_field"]); if (!$resp->is_valid) { // happens when captcha entered incorrectly //in case returned page totally blank echo <<<eot <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-tra...

How should I deal with linebreaks in strings I want to marshal in Java to XML? -

how should deal linebreaks in strings want marshal xml? i having difficulty using java , jaxb handle putting strings in xml files have linefeeds in them. data being pulled database actual line feed characters in them. foo <lf> bar or additional example: foo\r\n\r\nbar yields: foo&#xd; &#xd; bar if marshal data xml, literal line feed characters in output. apparently against xml standards characters should encoded &#xd; . ie in xml file output should see: foo &#xd;bar but if try , manually, end ampersand getting encoded! foo &amp;#xd;bar this pretty ironic because process apparently supposed encode linebreaks in first place , not, foiling attempts encode manually. below example of jaxb's default behaviour regarding \n , \r : java model (root) import javax.xml.bind.annotation.xmlrootelement; @xmlrootelement public class root { private string foo; private string bar; public string getfoo() { return...

Synapse/WSO2: Modifying a message in proxy service with iterate mediator -

here's problem i'm trying solve: receive message enrich message calling service obtain information (the other service happens wso2 data service, using mock proxy works same); see here info on enrich pattern send message on way the input message looks this: <purchaseorder xmlns="http://example.com/samples"> <header> <vendordata> <vendornumber>123456</vendornumber> </vendordata> </header> <body> <lineitem> <itemnumber>111222333</itemnumber> </lineitem> <lineitem> <itemnumber>333224444</itemnumber> </lineitem> <lineitem> <itemnumber>123456789</itemnumber> </lineitem> </body> </purchaseorder> ... , output message should this: <purchaseorder xmlns="http://example.com/samples"> <header> <vendordata> <vendornumber>1234...

jquery - Adding and removing input fields -

i have requirement add 4 input fields when user clicking addagent button. allow user remove 1 of those. if user adds 4 input fields, want disable add button. if user removes 1 of 4 input fields, enable add button 1 more add or 2 more add, depending on how many inputs user removed or added. max four. jquery, or sample can get? thanks! here working jsfiddle [demo] <div id="add">add</div> <div id="container"></div> $('#add').bind('click', function() { if($('#container').find('input').length < 4) { $('#container').append('<div><input type="text"><span class="remove">remove</span></div>'); } }) $('body').on('click', '.remove', function() { if($('#container').find('input').length > 0) { $(this).parent().remove(); } })

html - Responsive CSS triangles jQuery not working -

so, funny is, found concept of css triangles using element borders. i'm trying implement in 1 of custom wordpress themes, , i'm running issue. i'm trying add triangle bottom of div (kind of banner), div contains text can set user, can't hard code width of box , triangle. led me jquery try box width, , resize triangle appropriately. when first tried simple script set both borders half total parent width, seems ran issue box resizing elements load (seems slow font loading). wrapped script fire on element resize, doesn't seem triggering. causing triangle stay larger box it's under. can see effect here: http://dev3.thoughtspacedesigns.com here's code: html <div id="logo-box"> <h1><?php bloginfo('name'); ?></h1> <div id="logo-box-point"></div> </div> css #logo-box{ background:#374140; display:inline-block; padding:20px; position:relative; } #logo-...

c++ - Is there a convenience function in win32 (windows.h) that would convert lParam to POINT? -

i keep doing following: lresult onmousemove(uint umsg, wparam wparam, lparam lparam, bool& bhandled) { mouse.x = loword(lparam); mouse.y = hiword(lparam); // ... return 0; } i wonder if there convenience method convert loword(lparam) , hiword(lparam) point me? mouse = topoint(lparam) ? no, trivial roll own: point topoint(lparam lparam) { point p={get_x_lparam(lparam),get_y_lparam(lparam)}; return p; }

httpclient - Android HTTP GET doesn't work -

i know java unfortunately chosen basic4android android development. after working on year realized should move in native solution. question might silly need advice solve it. my goal retrieve data request. i've tried tons of android http client tutorials on internet failed each tutorial. i'm going share 1 here can me fix. when i'm clicking on button, nothing happening without tons of error message in logcat window. main class here quick review: public class mainactivity extends activity implements onclicklistener { private button test; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); test = (button) findviewbyid(r.id.test); test.setonclicklistener(this); } @override public void onclick(view v) { if (v.getid() == r.id.test){ try { httpclient client = new defaulthttpclient(); ...

javascript - Calling super method in sails.js controller -

when create controller in sails.js standard method redefined, how call default parent method of controller? module.exports = { create: function(req, res) { //test parameters if (condition) { //call regular super method, proceed usual //_super(); <- how this? } else { //do other things } } }; update: sails >= v0.10.x, see the comment below @naor-biton if want access default implementation (the blueprint), of v0.9.3, can call next() (the third argument controller). because sails based on express/connect concept of middleware, allowing chain things together. please note behavior may change in subsequent version, since next() how call default 404 handler ( config/404.js ) actions don't have blueprint underneath them. a better approach, if you're interested in using blueprints running bit of logic beforehand, leave controller action undefined , use 1 or more policies, ...

python - Arrange strings for maximum overlap -

let's have set of strings: strings = {'qqq', 'eqq', 'qqw', 'www', 'qww', 'wwe', 'eee', 'eeq', 'wee', 'qwe'} how write algorithm arranges strings such overlap maximally? know 1 way of arranging them follows: qww www wwe wee eee eeq eqq qqq qqw qwe however, found above result brute-force solution. there cleverer way of doing this? this called shortest superstring problem , np complete. you might interested in approaches in paper approximation algorithms shortest common superstring problem jonathan turner .

javascript - Responsive Bootstrap -

i added responsive bootstrap application , things working great. i've been able make modifications layout based on screen resolutions following in application.css file: * // other stuff here...// * *= require_self *= require bootstrap_and_overrides *= require_tree . */ @media (min-width: 1200px) { #winner_table { max-width: 30%; } } now, i'm wondering if it's possible make modifications these javascript based on screen resolution? specifically, want popover on element float right default, float when using phone. options this? may incorrect assuming responsive bootstrap can solve problem, feel solvable problem somehow. you can use matchmedia.js call jquery elements - https://github.com/paulirish/matchmedia.js/

c# - Ajax postback partialview not getting loaded with updated image -

i trying create sample mvc4 webpage partialviews on parent page ,eg., index.cshtml page displaying partialview page allow user view/update profile photo when index page loads ,i need partial page show photo if photo available once page loaded ,when user uploads new photo,i need partialview page ajax postback , show new photo . i able load page photo fetched db, able save new photo db clicking "#btnphotoupload" button. but after saving photo ,the partialview not getting refreshed automatically.please me how partialview page refesh , display updated photo. here index page ie., "index.cshtml" @model mvcsamples.models.viewmodels.userinfoviewmodel @{ viewbag.title = "ajax partial postback demo"; viewbag.userid = 1; } <h2>personalinfo example</h2> <div id="photoform"> @html.partial("_userphoto") </div> <div id="otherdetails"> @html.partial("_userdetails") ...

Gmail not rendering email with html breaks properly when sent from Django -

i'm using django send email user has forgotten password. other email clients render email breaks. gmail doesn't seem care html , squishes text together. here's email looks when rendered in hotmail: hello bob, you receiving email because have (or pretending has) requested new password sent account. if did not request email can let know @ support@mailapp.com. to reset password, enter temporary password below login. temporary password: sebdtzk4cc once logged in, can change password in "edit profile" option under "account" in settings. -the mail app team however in gmail, looks this!: hello bob,you receiving email because have (or pretending has) requested new password sent account. if did not request email can let know @ support@mailapp.com.to reset password, enter temporary password below login.temporary password: sebdtzk4cconce logged in, can change password in "edit profile" option under "account" in settings.-th...

How to call public method jquery plugin from outside? -

i read lot undertand not working. i'm using jquery plugin boilerplate . i have plugin called "defaultpluginname" , have public method inside plugin: sayhey: function(){ alert('hey!'); } i want call method outsise, that: $('#test').defaultpluginname('sayhey'); but not working, follow here fidle link give better view issue: http://jsfiddle.net/tcxwj/ the method trying call not public need alter plugin in order trigger outside plugin. see here how can that: https://github.com/jquery-boilerplate/jquery-boilerplate/wiki/another-extending-jquery-boilerplate . basically need change $.fn[ pluginname ] = function ( options ) { return this.each(function() { if ( !$.data( this, "plugin_" + pluginname ) ) { $.data( this, "plugin_" + pluginname, new plugin( this, options ) ); } }); }; to $.fn[pluginname] = function ( arg ) { var args, instance; // allow ...

coffeescript - jQuery circular reference -

i made jquery plugin/widget oop object , in object saving html/jquery element ( $elem ) property. storing object's reference (created using new ) in data attribute of html element. cause circular reference/memory leakage? the code in coffeescript be: class wid constructor @$elem = $('<div>hello</div>') @$elem.appendto('body') @$elem.data('obj',@) // adding instance element's data attribute updatetext: (p)-> @$ele.text(p) widget = new wid() on real browser, no. internet explorer, microsoft's browser-shaped object, has separate garbage collectors dom , javascript, it's easy create circular references. since ie tightly integrated operating system, merely shutting down browser not free memory: os has rebooted. however, thing: ie becomes slower , slower, weighed down unfreed object references, user learns vital lesson microsoft quality.

sql - Ruby on Rails: Duplicates with Join -

i working on part of app sort list of children based on parent's other children's attributes. here classes i'm working with: class specialchild belongs_to: parent class child_a belongs_to: parent class child_b belongs_to: parent class parent has_many: specialchild has_many: child_a has_one: child_b these 2 order functions applied it: scope :order_child_a, joins("inner join child_a on specialchild.parent_id = child_a.parent_id"). where("booleanvalue = true") scope :order_parent_and_child_b, joins("left outer join parent on specialchild.parent_id = parent.id"). joins("left outer join child_b name on parent.child_b_id = child_b.id"). order("name asc, parent.lastname asc") my problem though there 1 specialchild in list yet parent has multiple child_a's have booleanvalue = true, copies of same specialchild showing if doesn't exist. edit: problem arises in first scope though includ...

javascript - Array[0] but still data in it -

Image
i'm debuging code chrome devtools , have strange ocasion. have array which contains data console shows array[0] when try access it, gives me arror syntaxerror: unexpected token illegal let me show details: there object call console "quick_chat", when expand object there object called data, shows data: array[0], i'm still able expand there object id of chat. as see here data array[0] data in it. how can access console? suggestions? that data stored in property of array, , accessed using: quick_chat.data["3swa8h0clcai"]

How to decipher matlab function syntax ambiguity -

this question has answer here: what @ operator in matlab? 3 answers i cannot find syntax anywhere y = @(beta, x)x*beta; where x vector or matrix lets say. @ used reference function can have more 1 externally visiuble function in same .m file? sorry i'm new matlab can't find in documentation that way define anonymous function in matlab. same function result = y(beta, x) result = x * beta; but without needing m-file or subfunction define it. can constructed within other m-files or within expression. typical use throw-away function inside call of complex function needs function 1 of inputs, i.e.: >> arrayfun(@(x) x^2, 1:10) ans = 1 4 9 16 25 36 49 64 81 100 i use them lot refactor list of repetitive statements a = complex_expression(x, y, z, 1) b = complex_expression(x, y, z, 3) c = complex_ex...

html - How to get an element centered while a floated element is next to it? -

i have element want centered relative page, while having floated element inline it. html: <div class="container"> <span class="centerme">i should centered</span> <span class="ontheright">i'm on right!</span> </div> css: .container{ text-align:center } .centerme{ margin-left:auto; margin-right:auto; } .ontheright{float:right;} the problem centered element centered relative space left over, after floated element uses up. want center relative full width of container. have tried using position:absolute instead of float, collides when screen small. http://jsfiddle.net/j5mff/ you set relative positioning center-me div define left property: .centerme { margin-left:auto; margin-right:auto; position: relative; left: 70px; } for problem colliding on small screen widths, use media query: @media screen , (max-width: 320px) { .ontheright { float: none; top: 20px; } } be sure inclu...

Anyone else having Provisioning Profile Problems in iOS? -

since apple developer site outage, unable add new devices new or existing provisioning profile , have app install without error new devices. devices added before recent outage work fine new , existing profiles, device added since saturday august 3 2013 fails, same file! we have built new profiles , modified existing ones without luck. have submitted bug apple, no response. we distribute through testflight testers, , install works great on old devices prior date. however, devices added since, download file , seem fail @ point "install" takes place (ie, signature check , decryption.) testflight correctly recognizes new (and old) devices being added profile, , installs show in testflight on devices available. my guess keys being corrupted when new devices being added portal. i looking see if else has had problem, , if have kind of workaround issue? have tried new profiles, new builds, new devices! nothing works thanks in advance so problem "went awa...

jquery - Submit with javascript -

how can specify submit button submit with? the current example submits first submit button, $("form").submit(); how can make chooses submit button id or name? <html> <script> $("form").submit(); </script> <form action="<?=$_server['php_self']?>" method="post" /> //other inputs <input type="submit" value="enter" name="enter" id="enter"> <input type="submit" value="void" name="void" id="void"> <input type="submit" value="refund" name="refund" id="refund"> </form> </html> by id you can select element id $('#my_btn') , can click on using jquery method click() . by name (or other attribute other attributes bit harded (but not complex) select element $('input[name=some_name]') examlpe using code here example shows how...

How to SELECT only few rows from a column in sql (SQLite Database Browser)? -

i using sqlite database browser. table : test test has single column "words" values shown below : words -------- apple pen xerox notebook toys zoo stars apes write sql query (which should execute in sqlite database browser) select words between 'xerox' , 'stars' & words 'pen' apes. this may 1 option: select * test rowid between (select rowid test words = 'xerox') + 1 , (select rowid test words = 'stars') - 1 union select '---' union select * test rowid between (select rowid test words = 'pen') , (select rowid test words = 'apes');

github - Gitignore CodeIgniter -

before put first (codeigniter) application on github, have question codeigniter .gitignore file (see below). not have development directory in config directory. can .gitignore */config/* instead? importance of development directory in config directory? */config/development */logs/log-*.php */logs/!index.html */cache/* */cache/!index.html many people set development , production folders in config folders. codeigniter load correct file correct folder depending on environment set in main index.php if you're creating public repository on github copy files passwords , keys (your config.php , database.php 2 come standard framework believe) new folder called development inside config, remove passwords , paths , things ones in root folder. leave gitignore is. this way when push git aren't pushing personal private information project.

python - multiple download folders using Selenium Webdriver? -

i'm using selenium webdriver (in python) automate donwloading of thousands of files. want files saved in different folders. following code works, requires quitting , re-starting webdriver multiple times, slows down process: some_list = ["item1", "item2", "item3"] # on 300 items on actual code item in some_list: download_folder = "/users/myusername/desktop/" + item os.makedirs(download_folder) fp = webdriver.firefoxprofile() fp.set_preference("browser.download.folderlist", 2) fp.set_preference("browser.download.manager.showwhenstarting", false) fp.set_preference("browser.download.dir", download_folder) fp.set_preference("browser.helperapps.neverask.savetodisk", "text/plain") browser = webdriver.firefox(firefox_profile = fp) # bunch of code accesses site , downloads files browser.close() browser.quit() so, @ every iteration have quit webdrive...

javascript - Why is this returning undefined? jquery -

i have line <table id='<?= $value['name']?>'> in php sets id can target. this table inside <div> id="god" . but when click table has script: $("#god table").click(function(){ var link = $(this).id; alert(link); }); it alerts undefined - tell me why is? my best guess targets <td> click on $(this) not sure - , not know how test that. use following: var link = this.id; the jquery object $(this) not have propery id . note: do not use $(this).attr('id') when can use this.id way more efficient. also, note id case sensitive consistent "god" , "god".

java - intent flag over intent startActivity(i); -

@override public void onclick(view view) { // launching news feed screen intent = new intent(getapplicationcontext(), profile.class); startactivity(i); } }); what difference of using code , difference on program compared doe intent = new intent(currentactivityname.this, nextactivityname.class); i.setflags(intent.flag_activity_reorder_to_front); startactivity(i); first 1 uses getapplicationcontext() launch intent. application context attached application's life-cycle , same throughout life of application. if using toast, can use application context or activity context (both) because toast can raised anywhere in application , not attached window. second 1 uses activity context. activity context attached activity's life-cycle , can destroyed if activity's ondestroy raised. if want launch new activity, must need use activity's context in intent n...

textbox - Dismiss Numeric Keyboard WP8 in Code Behind (VB) -

so have numeric keyboard entering few numbers , according other apps , questions best way put done/cancel button application bar have setup without issues. problem when click on done or cancel button want dismiss keyboard can't seem figure part out. i've seen few other posts use this.focus(); that's c# , i'm using vb instead , far haven't been able find similar function. the page still has method called 'focus()' in vb. problem that: (c#) this (vb) me so, it's: me.focus() or, simply: focus()

How to implement editable text in Meteor and DRY? -

i have come methodology making editable text in meteor app. however, not follow dry paradigm , i'd change not javascript yet... suppose have table cell text , i'd double click edit it. created template variable handle this: <td class="itemname"> {{#unless edititemname}} {{name}} {{else}} <input class="edititemname" type="text" value="{{name}}" style="width:100px;"> {{/unless}} </td> i create event execute transition on double-click: template.inventoryitemdetail.events = { 'dblclick td.itemname': function (evt) { session.set("edititemname",true); }, 'blur input.edititemname': function () { session.set("edititemname",null); },}; i reused ok_cancel code todo's example app (but that's sort of irrelevant): // returns event_map key attaching "ok/cancel" events // text input (given selector) var okcancel_event...

backbone.js - How to attach Backbone.Marionette view to existing element without creating extra element -

say have these 2 backbone.marionette views: var fooview = backbone.marionette.itemview.extend({ tagname: p, id: 'foo', template: this.templates.summary }); var barview = backbone.marionette.itemview.extend({ template: this.templates.summary }); and want show them inside app region, so: app.contentregion.show(new fooview/barview()); the first view create new element , append region. thought second way more standard backbone view , attach region without creating new element, wraps in tag. there way avoid without using setelement()? for this, should use attachview method: https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.region.md#call-attachview-on-region

tfs2012 - TFS255231 - VMM server name can't be changed -

Image
we need change configured scvmm server scvmm server on tfs console. throws following exception: also cannot delete groups , library shares each team project collection tfs console. could give clue? after investigation, fixed issue follow post . in order retain lab settings, use following commands: tfsconfig.exe lab /settings /scvmmservername:newscvmmnameorip /force tfsconfig.exe in c:\program files\microsoft team foundation server 11.0\tools log: logging sent file c:\programdata\microsoft\team foundation\server configurati on\logs\cfg_set_url_0807_105542.log microsoft (r) tfsconfig - team foundation server configuration tool copyright (c) microsoft corporation. rights reserved. command: lab microsoft (r) tfsconfig - team foundation server configuration tool copyright (c) microsoft corporation. rights reserved. do want overwrite existing settings these new values ? (yes/no) yes may have lab resources associated curren...

javascript - Add milestones (markers) every x Km on direction -

i want add marker every 5 or 10 kilometer on polylines of direction given google maps api. : http://www.geocodezip.com/v3_polyline_example_kmmarkers_0.html but google direction's given start point, initial bearing, , distance, calculate destination point , final bearing travelling along (shortest distance) great circle arc. var lat2 = math.asin( math.sin(lat1)*math.cos(d/r) + math.cos(lat1)*math.sin(d/r)*math.cos(brng) ); var lon2 = lon1 + math.atan2(math.sin(brng)*math.sin(d/r)*math.cos(lat1), math.cos(d/r)-math.sin(lat1)*math.sin(lat2)); source: http://www.movable-type.co.uk/scripts/latlong.html the radius of earth ( r ) 6371000 meters. brng direction travelling in degrees (0 = north). then use function add markers map function setmarkers(map, locations) { // add markers map // marker sizes expressed size of x,y // origin of image (0,0) located // in top left of image. // origins, anchor posit...

datetime - Convert seconds since epoch to days since 0001-01-01 UTC in Python -

i have time in python that's represented seconds since unix epoch. matplotlib wants days since 0001-01-01 utc ( http://matplotlib.org/api/dates_api.html ). how can convert seconds since unix epoch days since 0001-01-01 utc? a little more thorough reading of documentation shows matplotlib.dates.epoch2num

GWT-bootstrap Deferred binding failed -

where download gwt-bootstrap.jar latest stable version? i downloaded here copy of gwt-bootstrap 2.3.2.jar. , create sample project each time following error. compiling module com.test.bootstrap scanning additional dependencies: file:/f:/desk/bootstrap/src/com/test/client/testing.java computing possible rebind results 'com.test.client.testing.testinguibinder' rebinding com.test.client.testing.testinguibinder invoking generator com.google.gwt.uibinder.rebind.uibindergenerator [error] <b:heading> missing required attribute(s): size element <b:heading> (:4) [error] errors in 'file:/f:/desk/bootstrap/src/com/test/client/testing.java' [error] line 11: failed resolve 'com.test.client.testing.testinguibinder' via deferred binding scanning additional dependencies: jar:file:/f:/technology/lib/gwt-2.4.0/gwt-2.4.0/gwt-user.jar!/com/google/gwt/user/client/ui/composite.java [warn] following type(s), generated sou...

How to schedule a sqoop action using oozie -

i new oozie, wondering - how schedule sqoop job using oozie. know sqoop action can added part of oozie workflow. how can schedule sqoop action , running every 2 mins or 8pm every day automatically (just lie cron job)? you need create coordinator.xml file start, end , frequency. here example <coordinator-app name="example-coord" xmlns="uri:oozie:coordinator:0.2" frequency="${coord:days(7)}" start="${start}" end= "${end}" timezone="america/new_york"> <controls> <timeout>5</timeout> </controls> <action> <workflow> <app-path>${wf_application_path}</app-path> </workflow> </action> </coordinator-app> then create coordinator.properties file one: host=namenode01 namenode=hdfs://${host}:8020 wf_application_path=${namenode}/oozie/deployments/example oozie.coord.a...

java - how to display different screen -

i'm writing simple program using cardlayout. main screen should display button when pressed go next screen contains button screen. problem when run program screen black. tried following tutorials online write own program don't seem find problem code. don't errors when run. here code //using cardlayout change screen when action performed import javax.swing.jframe; import javax.swing.jtextfield; import javax.swing.jlabel; import javax.swing.jbutton; import javax.swing.jpanel; import javax.swing.popup; import javax.swing.joptionpane; import java.awt.borderlayout; import java.awt.cardlayout; import java.awt.event.actionlistener; import java.awt.event.actionevent; import java.awt.flowlayout; public class cl extends jframe { jpanel cardpanel; jpanel cardpanela; jpanel cardpanelb;//to set different screens cardlayout cl; private jbutton button1; private jbutton button2; private jbutton change; private jlabel label; private jtextfield te...

Access the value from list in java -

this 1 of class class number11 { string ab; int i; public number11(string ab,int i) { this.ab=ab; this.i=i; } } and in main method, used list<number11> n1= new arraylist<number11>(); how can access value of integers , string contained in list? wish print them use further. just loop on list: for (number11 n : list) { string ab = n.ab; int = n.i; //print ab , } note number11 should in camelcase follow java's conventions: number11 .

php - Issue with JPG file transfer with ssh2_scp_send -

we sending image files 1 server another. use ssh2 library of php. when send png images, work fine when send jpeg or txt file create file on server file size 0 kb. anyone have idea issue? could lack of permissions? ssh server may sending error messages without knowing it'd hard figure out issue is. my recommendation: use phpseclib, pure php ssh implementation , , post logs. ie. <?php include('net/sftp.php'); define('net_sftp_logging', net_sftp_log_complex); $sftp = new net_sftp('www.domain.tld'); if (!$sftp->login('username', 'password')) { exit('login failed'); } // puts three-byte file named filename.remote on sftp server $sftp->put('filename.remote', 'xxx'); echo $sftp->getsftplog(); ?>

iphone - NSDictionary Error Handling -

i creating application don't know how handle error when there no value given entry in nsdictionary. here code have currently: nsdictionary *entry = [self entries][indexpath.row]; nsdictionary *text = [self entries][indexpath.row]; nsstring *user = entry[@"user"][@"full_name"]; nsstring *caption = text[@"caption"][@"text"]; if (caption != nil && entry != [nsnull null] && text != nil && caption != [nsnull null]) { rnblurmodalview *modal = [[rnblurmodalview alloc] initwithviewcontroller:self title:user message:caption]; [modal show]; } here error response receive when tap on cell without caption: 2013-08-08 02:36:57.871 floadt[5566:c07] -[nsnull objectforkeyedsubscript:]: unrecognized selector sent instance 0x310b678 2013-08-08 02:36:57.872 floadt[5566:c07] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull objectforkeyed...

c# - SelectedValue for ComboBox not getting set -

i have combobox name cmbcontacttype . binded combo datasource displaymember valuename (string type) , valuemember valueid (number type). when user change value in cmbcontacttype cmbcontacttype.selectvalue set , able save document selectedvalue. facing problem while setting cmbcontacttype value database of type number. every time trying set value, null value set cmbcontacttype.selectvalue . following code binding datasource cmbcontacttype , setting selectedvalue of cmbcontacttype . using vs2010 , ms-access. please help. //method bind datasource. public static void binddatasourcewithcombo(ref combobox cmb, string query, string valuemember, string displaymember) { datatable _tablesource = (new accessconnectionmanager()).getdatatablebysqlquery(query); var _datasource = (from datarow _row in _tablesource.rows select new { valuemember = _row[valuemember], ...