Posts

Showing posts from August, 2012

eclipse - Phonegap android emulator crashing -

i installed phonegap following of steps: http://docs.phonegap.com/en/2.5.0/guide_getting-started_android_index.md.html i installed latest versions of: eclipse android sdk adt plugin phonegap cordova i using: osx 10.8.5 everything runs smoothly when run cordova emulate android . emulator shows , loads minute says: "unfortunately, workshop has stopped" and app never loads. also, when run cordova serve android browser shows alert says: gap:["pluginmanager","startup","pluginmanager1650094558"] then app loads , browser show default cordova screen says "connecting device" app never reaches "device ready". have have tried tons of different approaches downgrading versions creating several avds test. far after 4 hours of testing haven't found answer.

java - Making cross domain jquery ajax calls to Restful webservice? -

i using jquery ajax calls access restful webservices below. webservice hosted on different domain. $.ajax({ type: "get", url: "some url hosted on differnt domain", crossdomain: true, contenttype: "application/json; charset=utf-8", datatype: "jsonp", success: function(responsejson) { alert("json"+responsejson); }, error: function(xhr, status, error) { var err = eval("(" + xhr.responsetext + ")"); alert(err.message); } }); am not sure whether not hitting webservice.it going error block no alert displayed. doing wrong here? thanks! you got change header @ server side http://www.w3.org/tr/cors/#access-control-allow-origin-response-header since cause forgery. more of cors understanding http://enable-cors.org/server.html

php - I want get one array from database records -

this question has answer here: how mix multiple array in 1 array in php 1 answer i fetching records database return records in multiple array. want 1 array database. my php code - $resultdata = array(); $re=mysql_query("select pro_ref_id,pro_qty,pro_item proforma_details pro_ref_id in($piid_str)"); while($re1=mysql_fetch_array($re)) { $rq=mysql_fetch_array(mysql_query("select sale_ref_id,proforma_invoice_no proforma_invoice pro_invoice_id='".$re1['pro_ref_id']."'")); $rq1=mysql_fetch_array(mysql_query("select sale_order_no sale_order sale_id='".$rq['sale_ref_id']."'")); array_push($resultdata,$re1); array_push($resultdata,$rq); array_push($resultdata,$rq1); } i getting array - array( [0] => array( [0] => 1 [pro_ref_id] => 1 ) [1] => array( ...

remove directory name from linux find result -

when using find command below find /asdf/asset -mtime -3 -printf "%f " > log.txt result below asset text.txt movie.ts asset not exist, it's directory. how hide directory name result.

php - JavaScript: How to set for setInterval function a custom behaviour -

i need set custom behaviour setinterval js function; this part of online game, , script used keep data updated; worlds[world_id].building traffic light, true grren , false red values, know; i used following function obtain array; this js function: function init() { $.ajax({ type: "post", url: '<?php echo yii::app()->baseurl; ?>/robots/default/loadworlds', data: {}, success: function(data) { if (data) { if (data.status === true) { if (data.worlds) { worlds = data.worlds; $.each(data.worlds, function(key, value) { addelement(key, value); count_world_ids++; }); } } } }, datatype: 'json', ...

java - Get currency applied to an Excel Cell using POI -

i have written java program read excel file cell-by-cell using poi api. setting of currency done explicitly using ms excel - "format cell" option. however, there way in can recognize currency has been applied cell using poi? so far, have tried using getcellstyle().getdataformat() , returns unique number. however, problem is based on cell style, , can change change in cell formatting(font, size, etc.). i tried this: if(cell.cell_type_numeric) { system.out.println("value in excel cell:: " + cell.getnumericcellvalue()); short styletype = cell.getcellstyle().getdataformat(); system.out.println("style (currency):: " + styletype); if(styletype == <some unique number>) //want unique number { system.out.println("currency applied cell:: " + <currency name>); } } so, either unique number identifies currency name or if currency name directly, best. you can identify built in format id looking @ org.apache...

c++ - How to deal with reference data-members in the assignment operator, and copy constructor? -

i have following class class tvdata { private: int id; monitor& monitor; string pname; } i need implement assignment operator , , copy-constructor usable class. how handle reference members, in case tvdata::monitor , in such scenario? you can't reassign reference, if need change in assignment operator should make pointer - assignment can done usual = , although it's still encouraged use initialiser list in copy constructor... tvdata(const tvdata& rhs) : id(rhs.id), p_monitor(rhs.p_monitor), pnmae(rhs.pname) { }

javascript - Getting an error when trying to load json data from remote location -

Image
i have students.json file on remote server data { "studentid":101, "firstname":"carissa", "lastname":"page", "emailid":"laoreet.libero.et@mauris.net" } now trying read students.json different server (cross-domain) using jquery.ajax(). this html page <!doctype html> <html> <head> <meta charset="utf-8"> <title>metadata test page</title> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> </head> <body> <div id="studentdisplay"> <p>getting student details</p> </div> </body> </html> i have code in javascript file $(document).ready(function() { $.ajax({ type: 'get', url: 'http://rupeshreddy.com/students.json', contenttype: "appl...

How to declare type for a class method in Delphi? -

how declare type class procedure, example type ttest = class procedure proc1; class procedure proc2; class procedure proc3; static; end; tproc1 = procedure of object; tproc2 = ???; tproc3 = ???; tproc2 = procedure of object; a class method still has self pointer. it's class rather instance. an interesting consequence of provides way implement event handlers without having instantiate object. instance, use class method of class that never instantiated way provide event handlers global application object. tproc3 = procedure; a static class method has no self pointer. assignment compatible plain procedural type. static class methods can used alternative globally scoped procedures. allow put such methods in namespace, of class, , avoid polluting global namespace. take care when implementing static class methods not call virtual class methods. such calls bound statically @ compile time because lack of self pointer means dynamic polym...

OpenShift system and package updates/patches -

how 1 keep openshift gears up-to-date? example, updates to: the linux kernel important components/libraries libc apache apache modules mod_wsgi python python packages does openshift automatically update these , restart gear (or reboot node)? or openshift send email notifications , end-user can restart gear during maintenance windows? model? what got me thinking in january there remote-code-execution bug in ruby on rails had patch immediately. this faq seems suggest level of upgrades happen automatically, isn’t clear whether applies openshift-specific code, or other components kernel, apache, etc. i can tell experience changes openshift system not automatic. had change 10 days ago , i'm still tracking down did make app run correctly. far know there no email sent. did find blog post of of major changes, not all. of course, introduced @ least 1 bug know of. ymmv

asp.net mvc - Unable to retrieve metadata for ApplicationUser. - VS13 -

i receiving following error when choose generate mvc5 controller views using entity framework: unable retrieve metadata applicationuser. multiple object sets per type not supported. object sets applicationusers , users can both contain instances of type applicationuser" searching , found : same problem has hack not solution .. is bug in vs13? and how can fix it

c# - Handling limitations in multithreaded server -

in client-server architecture have few api functions usage need limited. server written in .net c# , running on iis . until didn't need perform synchronization. code written in way if client send same request multiple times (e.g. create sth request) 1 call end success , others error (because of server code + db structure). what best way perform such limitations? example want no more 1 call of api method: foo() per user per minute. i thought synchronizationtable have 1 column unique_text , before computing foo() call i'll write foo{userid}{date}{hh:mm} table. if call end success know there wasn't foo call user in current minute. i think there better way, in server code, without using db that. of course, there thousands of users calling foo . to clarify need: think light dictionarymutex . for example: private static dictionarymutex foolock = new dictionarymutex(); foolock.lock(user.guid); try { ... } { foolock.unlock(user.guid); } edit: so...

How to merge Bazaar patches into a Git repository? -

how can merge patches bzr repository hosted on launchpad self hosted git repository? bzr merge lp:ubuntu/trusty-proposed/chewmail i tryed wont work because git repo not bzr repository. thanks. check man page git-remote-bzr . oh, i'm sorry, it's not main git package. here's homepage link: https://launchpad.net/bzr-git may check if exists in distribution repository.

python - error in inserting image in Webpy -

i new @ python, want insert image in html. first have tried static page concept web.reloder doesn't works. shows error after have tried following code still not desired output import web urls = ('/', 'hello') app = web.application(urls, globals()) class hello: def get(self): return """<html><body><img src="images.jpg"></body></html>""" if __name__ == "__main__": app.run() i'm not sure web.reloader talking about, here's how use static files. create directory static script runs. then, put images.jpg static . in html, change image tag <img src="/static/images.jpg . web.py knows retrieve image. so better visualization of whole directory this: project | |-- main.py | |-- static | |-- images.jpg okay, since rather new, let off question asked searched online easily. go google-fu , search static file...

java - converting full date to short date -

i'm getting date server like: mon mar 24 13:44:44 asia/calcutta 2014 want display in shorter format may : mar 24 13:44 there way this? may can covert string desired format ? parsequery<parseobject> query = new parsequery<parseobject>( "case"); query.orderbydescending("updatedat"); query.setcachepolicy(parsequery.cachepolicy.network_else_cache); ob = query.find(); (parseobject country : ob) { parseobject image = (parseobject) country.get("objectid"); objectid = country.getobjectid(); string ctitle = country.getstring("casetitle"); string cdescription = country.getstring("casecomment"); string nameofcreator = country.getstring("name"); createtime = string.valueof(country.getcreatedat()); system.out.println("the created time...

c# - App stops at foreach number 3286090 -

basically have problem application stops after loop 3286090 or batch 1735. i have list of 1894 of validated addresses @ point in application , makes possible combinations , calculates distance , travel time per batch. sub function calls local web service takes 60 180 seconds complete each batch , writes result .csv file. (writing excel file existing excel libraries convulates memory excessively wasn't option.) there no exception. there no system log. , every single "break on exception" option ctrl+alt+e enabled. if (startnumber <= batchnumber) { calculaterouteinfo(waypointdescarraylist, batchnumber, address); } code seems fail here. moment batchnumber reaches 1735 , compares startnumber (which in case have tried entering 1734 redo last batch / 1735 current batch , try skip @ 1736 or higher.) no matter number above 1736 application reaches end @ specific number of comparing x batchnumber 1735 when tell application compare higher number 1800. ends there...

sql - is below mysql Query cause huge load on server -

hi have executed below query select a.* table1 a, table2 b a.x!=b.x; as server hang not able provide exact structure of both tables. server having huge load. table1 has no indexes , table 2 has index on x. i have explain output similar query. select a.* table1 a, table2 b a.x!=b.x; +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | | +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ | 1 | simple | b | | null | null | null | null | 70503 | | | 1 | simple | | eq_ref | email | email | 386 | asp_db.b.email | 1 | | +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ 2 rows in set (0.00 sec) please can 1 in regrading this... table1 has 69264 rows ...

java - Using OnException within a route containing aggregator -

i trying use onexception clause within route has aggregator in it. expecting whenever exception thrown within aggregate() method of aggregator, onexception clause should catch it, handle , redeliver it. however, doesnt seem happening. can please suggest going wrong. from("jms:queue:start?concurrentconsumers=10").routeid("testroute") .onexception(exception.class).log("exception caught").process(new processor() { @override public void process(exchange exchange) throws exception { logger.debug("****exception caught***"); } }) .handled(true).maximumredeliveries(-1).end() .transacted() .aggregate(header("correlationheader"), new customaggregator()) .completionsize(50). to("jms:queue:end"); where customaggregator aggregator , within aggregate method throwing exception test exception handling. any or suggestion apprecia...

javascript - jQuery .data() function works when selector targets 1 element, but not when targetting multiple and iterating over them -

so i'm trying read data value of each checkbox checked, have following code: var jobjchk = $("input:checkbox[name=resourceselect]:checked"); jobjchk.each(function () { receivers[receivers.length] = this.data("data-email"); }); now when 1 checkbox checked, , use this.data, code works expected. when use code above , have multiple checkboxes selected, "i object doesn't support property or method 'data'". both should jquery objects (and supporting .data())? your assumptions incorrect. statement: but both should jquery objects (and supporting .data())? is incorrect. this inside of .each() callback actual dom element, it's not jquery object. if want use jquery functions need create new jquery object containing single element: jobjchk.each(function () { receivers[receivers.length] = $(this).data("data-email"); });

html - How do I write JavaScript that validates input across multiple forms? -

i attempting write javascript traverses multiple html forms, checks input given value on edit, enables/disables submit button form based on input value. i have simple example script, overrides onclick function of checkboxes, test flow of code. <form> <input type="checkbox" /> <input type="submit" disabled="disabled" /> </form> <form> <input type="checkbox" /> <input type="submit" disabled="disabled" /> </form> <form> <input type="checkbox" /> <input type="submit" disabled="disabled" /> </form> <form> <input type="checkbox" /> <input type="submit" disabled="disabled" /> </form> <form> <input type="checkbox" /> <input type="submit" disabled="disabled" /> </form> <script ty...

jquery - How to disable(inactive) a div using javascript? -

i new javascript, can 1 please me. actually have div in html, disable div on page loading. code <div class="col-1" id="plug_play_box" > <div class="box first"> <div class="pad"> <div class="wrapper indent-bot"> <strong class="numb img-indent2">01</strong> <div class="extra-wrap"> <h3 class="color-1"> <strong>plug </strong><label id="and">&</label> play </h3> </div> </div> <div class="wrapper"> <a class="button img-indent-r" href="#" id="plug_play_button"></a> <div class="extra-wrap"> point.co 1 of free website templ...

css - Create space between float image and text -

Image
Ι want have 5px space between image , description. i tried margin-left or padding-left doesn't want achieve, creates space begging of container. idea how can that? #portofolio-element-image{ width: 128px; height: 128px; margin-bottom: 5px; float:left; } #portofolio-element-description{ color: white; text-align:justify; margin-left: 5px; } why not use: #portofolio-element-image{ margin-right:5px; } adding margin text have no effect on distance between , floated image, because image falls within text element.

How to change the connection in Sql Server Data Tools Editor in Visual Studio -

Image
my goal keep sql server stored procedures under source control. want stop using sql server management studio , use visual studio sql related development. i've added new sql server database project solution. have imported database schema new project, , sql objects (tables, stored procedures) there in own files. i know if run (with f5) .sql files changes applied (localdb) . if fine, if want run on machine (like dedicated sql server shared entire team)? how can change connection string of current .sql file in sql server data tools editor ? i have latest version of sql server data tools extension visual studio 2012 (sql server data tools 11.1.31203.1). don't know if related current version, cannot find anymore transact-sql editor toolbar. i have tried right-click on sql editor, choose connection -> disconnect. if reverse (connection -> connect...) editor directly connects automatically (probably localdb), without asking me dialog choose connection. another str...

numpy - Start, End and Duration of Maximum Drawdown in Python -

Image
given time series, want calculate maximum drawdown, , want locate beginning , end points of maximum drawdown can calculate duration. want mark beginning , end of drawdown on plot of timeseries this: a busy cat http://oi61.tinypic.com/r9h4er.jpg so far i've got code generate random time series, , i've got code calculate max drawdown. if knows how identify places drawdown begins , ends, i'd appreciate it! import pandas pd import matplotlib.pyplot plt import numpy np # create random walk want calculate maximum drawdown for: t = 50 mu = 0.05 sigma = 0.2 s0 = 20 dt = 0.01 n = round(t/dt) t = np.linspace(0, t, n) w = np.random.standard_normal(size = n) w = np.cumsum(w)*np.sqrt(dt) ### standard brownian motion ### x = (mu-0.5*sigma**2)*t + sigma*w s = s0*np.exp(x) ### geometric brownian motion ### plt.plot(s) # max drawdown function def max_drawdown(x): mdd = 0 peak = x[0] x in x: if x > peak: peak = x dd = (peak -...

isinteger - PHP check if is integer -

i have following calculation: $this->count = float(44.28) $multiple = float(0.36) $calc = $this->count / $multiple; $calc = 44.28 / 0.36 = 123 now want check if variable $calc integer (has decimals) or not. i tried doing if(is_int()) {} doesn't work because $calc = (float)123 . also tried this- if($calc == round($calc)) { die('is integer'); } else { die('is float); } but doesn't work because returns in every case 'is float' . in case above should'n true because 123 same 123 after rounding. try- if ((string)(int) $calc === (string)$calc) { //it integer }else{ //it float } demo

c - Can anyone tell me what this section of pseudocode is doing? -

can tell me section of pseudocode doing? produced use ida pro thanks in advance! int __cdecl sub_401000(int a1, int a2) { int result; // eax@4 int v3; // [sp+0h] [bp-ch]@4 char v4; // [sp+7h] [bp-5h]@4 int i; // [sp+8h] [bp-4h]@1 signed int v6; // [sp+8h] [bp-4h]@4 ( = 0; *(_byte *)(i + a1); ++i ) ; result = - 1; v6 = - 1; v3 = 0; v4 = -1; while ( v4 ) { v4 = *(_byte *)(v6 + a1); result = a2; *(_word *)(a2 + 2 * v3) = ((unsigned __int8)byte_40a300[v6 % 4] ^ *(_byte *)(v6 + a1)) & 0x7f; --v6; ++v3; } return result; } the first for loop finds length of string a1 . following while loop transforms bytes of a1 xoring them 4 byte constant key, , widening utf16 (presumably). ...

php - PHPMailer SMTP issue -

i want use phpmailer send out emails, have html form collects necessary data such username, password, recipient, subject , html template. so have downloaded phpmailer library , trying config can send out emails, getting error: smtp connect() failed. message not sent.mailer error: smtp connect() failed. debuting purposes have used $mail->smtpdebug =1; , error says 2014-03-24 11:13:13 smtp error: failed connect server: (0) smtp connect() failed. message not sent.mailer error: smtp connect() failed. i working on localhost (mamp) error says there problem smtp server using (smtp.gmail.com) have tried change local host error same. i belief there configuration issues my code: <?php session_start(); if(isset($_request['submit'])){ $email = array(); $email['email_to'] = $_post['recipient']; $email['subject'] = $_post['subject']; $email['html'] = $_post['template']; require 'phpmailer/phpmai...

python - Return Match with respect to Occurrence ,Regex -

i have many strings (in series format) , list of words in csv format. need match expression , return word @ top in csv . example : have them hsr layout aecs layout garden layout k aecs layout and suppose string contains : str1 = "room no 135 chancery hotel,block k aecs layout" since aecs layout occurs above k aecs layout , want expression match aecs layout . code returns latter. how prioritize it? my code: str1 = "room no 135 chancery hotel,block k aecs layout" layouts_string1 =r'({})'.format('|'.join(['hsr layout','aecs layout','garden layout','k aecs layout'])) layout1_re = re.compile(layouts_string1) ms = layout1_re.search(str1) print ms.group() but returns "k aecs layout" . how 1 i.e aecs layout comes first in '|' expression? the reason k aecs layout matches, rather aecs layout , because k letter comes before a letter, , regex finds match on k r...

php - Insert a mysql table into another table with sub query -

i'm importing csv 2 columns existing table using php (i'm using joomla/virtuemart) the columns in existing table id (user id) , product_id. the columns csv file product_sku , username need first join appropriate tables match id (user id) username, , proudct_sku product_id. need trim leading zeros off username, , whitespace productsku i've done using sql. i created temporary table containing data in csv, joined onto both tables. i've got data need need insert data existing table. ideally i'd mysql, possible sub query? would there massive difference in speed? function do_query($file) { // $sql = "load data infile ".$file['tmp_name']." table favouritestmp fields terminated ',' lines terminated '\n' (data1, data2)"; $sql = "create temporary table favouritestmp ( productsku varchar(50) not null, user varchar(50) not null )"; $this->_db->setquer...

How to change only line shape color in vba powerpoint -

i have task make colour fill in powerpoint vba. when select lines , boxes want change lines , leave boxes colour. there way change private shapes? the below code change line colours in slide 2 red in powerpoint 2007: public sub changelinecolours() dim shp shape each shp in activepresentation.slides(2).shapes '<~~ change '2' whichever slide want loop through if shp.type = msoline shp.line.forecolor.rgb = rgb(255, 0, 0) end if next shp end sub

sitecore6 - Add font size in sitecore richtext editor -

Image
i change font size selection of rich text editor of sitecore following the instruction . what need add font size 60px in selection. how , can change that? to add font size in richtext control of sitecore, modify toolsfile.xml <root> <tools name="maintoolbar" enabled="true"> <tool name="realfontsize" /> </tools> <realfontsizes> <item value="8px"></item> <item value="9px"></item> <item value="10px"></item> <item value="11px"></item> <item value="12px"></item> <item value="13px"></item> <item value="14px"></item> <item value="16px"></item> <item value="18px"></item> <item value="20px"></item> ...

c# - WebDriver take screenshot out of screenbounds -

i trying use webdriver save away image of in dom, of items may 1500px+ in height. , taking screenshot of doesn't @ best can 1080. when in testing may lower. i have tried researching , finding ways of doing of day, , thought had found trick var element = findelement(by.classname("contentbody")); int width = element.size.width; int height = element.size.height; point point = element.location; int x = point.x; int y = point.y; rectanglef part = new rectanglef(x, y, width, height); bitmap bmpobj = new bitmap((int)part.width, (int)part.height); bitmap bn = bmpobj.clone(part, bmpobj.pixelformat); bn.save(path, imageformat.png); however getting outofmemory exception when cloning rectangle across. in particular example element div bounds 1220 x 3045 (it list of items) , save away comparisons later. if has idea how solve appreciated.

Is chained assignment in C/C++ undefined behavior? -

ignoring types of variables, expression a=b=c has defined behavior in both c , c++? if so, can 1 give me official evidence, quotes standard, please? p.s. searched chained assignment got associativity, didn't find text in c99 standard. maybe did wrong? hoping can me. from c++ standard 5.17 assignment , compound assignment operators [expr.ass] 1 assignment operator (=) , compound assignment operators group right-to-left. require modifiable lvalue left operand , return lvalue referring left operand . result in cases bit-field if left operand bit-field. in cases, assignment sequenced after value computation of right , left operands, , before value computation of assignment expression. and example there int a, b; = b = { 1 }; // meaning a=b=1; from c standard 6.5.16 assignment operators semantics 3 assignment operator stores value in object designated left operand. assignment expression has value of left operand after assignment,111) bu...

c++ templates argument based compilation -

i want write template function calls different method based on type of template argument. ex- template<typename t> void getdata(t& data) { if(t int) call_int_method(data); else if(t double) call_double_method(data); // call not compile if data int ... } basically, getdata should calling 1 method based on type of t. other calls should not exist. possible somehow? provide overloads, either of getdata if need whole function have specific behaviour int or double : void getdata(int& data) { call_int_method(data); } void getdata(double& data) { call_double_method(data); } or call_x_methods if portion of function's logic specialized: template<typename t> void dotypespecificstuff(t& data) { /* stuff */ } void dotypespecificstuff(int& data) { .... } void dotypespecificstuff(double& data) { .... } template<typename t> void getdata(t& data) { dotypespecificstuff(data); // other stuff ...

database - What is the meaning of round circle in er digram -

Image
it has round circle in middle not getting meaning of circle.. it seems symbol inheritance. financial, physical, , information assets kinds of assets.

java - Connection between server and android -

i'm trying develop app instant messaging (like whatsapp). i'm confused type of connection should use: socket, http or other? have use non-standard java api? server use java , client use andoid (java). have tried socket connection without success. don't error nothing happens because device , server not connected(i don't know why). this client class (android) sends messages: public class sendmsg implements runnable { private socket socket; string msg; public sendmsg(string msg){ this.msg=msg; } @override public void run() { try { socket = new socket("ip_globale_server",5000); socket.setsotimeout(5000); bufferedwriter writer= new bufferedwriter(new outputstreamwriter(socket.getoutputstream())); writer.write(msg); writer.flush(); } catch (ioexception e){ system.err.println("connection error"); } finally{ if (socket!=null) { try{socket.close();} ...

C# - Dynamic code, reference issues and placement -

in code, i'm reading text file, compiling , trying run it, have issue references (i think) code: using system; using system.collections.generic; using system.windows; using system.runtime.interopservices; using system.text; using system.codedom.compiler; using system.io; using microsoft.csharp; using system.reflection; namespace ifcviewer { static class program { static public void main() { string code_file = system.io.file.readalltext(@"c:\tmp\my_code.txt"); /* element db */ list<db.ifcarray> element_list = new list<db.ifcarray>(); /* relationships db */ list<db.relobj> rel_list = new list<db.relobj>(); bool flag = false; compileandrun(code_file); } static void compileandrun(string code) { compilerparameters compilerparams = new compilerparameters(); string outputdirectory = directory.getcurrentdirectory(); compilerparams.generatei...

jython - Pass in ant properties to WLST task -

i invoking wlst task through ant , want pass in properties defined in ant's context either through importing property files inside ant, inaddition ant startup arguments. (ie properties available in ant via property expansion) the way can see use foreach/inheritall functionality of antcontrib. not require iterations. is there solution without having use antcontrib , iteration loop of 1? i want reference properties in wlst script example print "ant property is",antproperty solved i trying initialise variables incorrectly. the way ie set jython variable ant variable in wlst task use sys.argv array. this can either done in jython file or in embedded script element in wlst task.

javascript - Generating tooltip text from .js/external file -

i have created simple jquery toolip: http://jsfiddle.net/oampz/k9thh/ my issue dont want place text within img tag have on 20 tooltips on page lot of text in each.. there way can have tooltip access .js file (or other file) , capture necessary text that? html: <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 1" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 2" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 3" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question...

ios - Passing data forward with delegate protocol -

i'm trying pass data forward viewa viewb using delegate. reason trying use delegate viewb slide out menu - using swrevealviewcontroller library function. side effect - prepareforsegue not called viewa not own viewb . so seemed delegates way forward. the problem delegate method not called. in viewb - added method gets called when pan gesture happens - opens side menu. so did: in viewa declared protocol: @protocol firstviewcontrollerdelegate <nsobject> (void)senddata:(nsstring *)string; @end declared in viewa @property (nonatomic, assign) id <firstviewcontrollerdelegate> delegate; then in pan gesture in viewa -void)pangesturestarted:(uipangesturerecognizer *)gesture{ if (gesture.state == uigesturerecognizerstatebegan){ nsstring *datatopass = @"test sending data second view"; [self.delegate senddata:datatopass]; } then in viewb : #import "viewacontroller.h" conformed protocol @interface bbfilterviewcont...

sed - Appending text at EOL not working -

i'm trying append string @ end of each line in file, it's not working. file has format 1992988282,78.93,sometext and tried sed -e 's/$/,2012-09-03/' sample.csv but text getting appended , replacing characters @ beginning of line. have tried awk '{ print $0 ",2012-09-03" }' < sample.csv and i'm getting exact same problem. sed -r 's/[[:cntrl:]]*$/,2012-09-03&/' sample.csv so keep ended control char in place (unless want use without, last & removed)

php - Is str_replace with an array the right way to format a person's last name? -

out of mysql database have list of names like smith frank dent md smith sr. jones, jr. smith-jones o'toole i need list be smith frank dent smith jones smith-jones otoole by format mean want "main" part of last name eliminating non-alphanumeric characters spaces titles (jr, sr, md, etc...) i realize in cases "changing" person's name it's not being used in way see. right doing like: $toreplace = array('.', ',', '-', ' jr', ' sr', ' md', ' do', "'", ' '); //for each result query $lname = str_replace($toreplace, '', $row_rsgetusers['lname']); $lname = strtolower($lname); then, after awhile name shows wright cisa have update $toreplace array account that. (i have no control on input of names) is best way go doing or there better way/library out there should using eliminates need me manually update $toreplace ar...

javascript - Is there a more accurate mousemove? -

i asking myself there "more accurate mousemove" in javascript. normal event fired when mouse moves, it's possible "jumps" on pixels, question if there's way detect every pixels crossed. an application use paint want draw (e.g. stroke) the mouse not cross every pixel, though. touchscreens. you can see in microsoft paint. if drag mouse , forth while drawing, you'll see guessing , drawing lines in between points os sending it. if need handle every pixel, take last pixel saw, , current pixel, , have code find of pixels fall on line between 2 points.

javascript - Angular transclude and scopes -

i trying generate directive click-to-edit input fields. since have variety of different types of input fields needs work with, wanted make attribute type directive transcludes input field itself. however, problem when using scope parameter directive description (for ipdisable), things stop working should (try commenting in line 44 in jsfiddle js part). presumably, therefore scope error, have no idea begin debugging it, , appreciated. jsfiddle: http://jsfiddle.net/hbywx/3/ html: <input inplace type="string" ip-disable=false name="username" ng-model="uname"> js: myapp.directive('inplace', function($compile) { var compile = function(telem,tattrib,transclude) { var whole = $('<div ng-scope></div>'); var editable = $('<div class="editable-transclude" ng-hide="static">'+ '<a ng-click="changestatic()" ng-show="!static && !dis...

c# - The type '' cannot be used as type parameter 'T' in the generic type or method ''. There is no implicit reference conversion from '' to '' -

i generated linq -to -entity model database , modified - i've made interface : public interface ivalid { byte valid{ get; set; } } and make generated classes inherit interface. i've wrote generic class access tables database: public list<t> getvalidrecords<t>() t: class, ivalid { try { return _context.set<t>().where(x => x.valid == 1).tolist(); } catch (exception ex) { throw new exception(ex.message); } } when call method in unit test var records = repositary.getvalidrecords<tablename>(); i error - the type 'tablename' cannot used type parameter 't' in generic type or method 'getvalidrecords()'. there no implicit reference conversion 'tablename' 'ivalid'. how fix it? edit: table class: public partial class tablename: ivalid { public byte isvalid { get; set; } } edit2: calling method: public void getvalidrecordsgenerictest(...

linker - Link error when referencing managed dll to native c++ -

i trying create rather simple project in native c++ calls a managed dll. how native c++ code looks: // mycppstud.cpp : defines entry point console application. // #include "stdafx.h" #include "mystudwrapper\mystudentwrapperwrapper.h" int _tmain(int argc, _tchar* argv[]) { char * path = "c:/users/rami.schreiber/documents/visual studio 2013/projects/testproj/test.xml"; mystudentwrapperwrapper* student = new mystudentwrapperwrapper(); // student->getstudent(path); return 0; } and here .h , .cpp files managed dll (compiled /clr) //mystudentwrapperwrapper.h #pragma once //#ifdef thisdll_exports #define thisdll_api __declspec(dllexport) /*#else #define thisdll_api __declspec(dllimport) #endif*/ class mystudentwrapper; class thisdll_api mystudentwrapperwrapper { private: mystudentwrapper* _impl; public: mystudentwrapperwrapper(); mystudentwrapperwrapper(mystudentwrapper* student); ~mystu...

Why is this PHP warning (division by zero) being thrown? -

i receiving php warning 'division zero' due 1 of equations on site: $vidlistapprate = (($vla['likes'] / $vla['views']) * 100; after realized did not account fact variable $vla['views'] zero, changed code following, thinking eradicate warning: $vidlistapprate = ($vla['views'] === 0) ? 0 : ($vla['likes'] / $vla['views']) * 100; however, warning still appeared (note: $vla['views'] int) . tried replacing 0 string: $vidlistapprate = ($vla['views'] === 0) ? 'n/a' : ($vla['likes'] / $vla['views']) * 100; but still receive warning. know notices, warnings, , error messages in php error_log friends, how rewrite code appease warning? an exact match expected here: $vidlistapprate = ($vla['views'] === 0)... maybe need: $vidlistapprate = ($vla['views'] == 0)... or: $vidlistapprate = ($vla['views'] === '0')... or: $vidlistapprate = (...

java - Android Service unexpectedly stoppping -

for android application i'm making, want there service checking database attack when app isnt running (kinda how facebook notify if it's closed) , made class below, yet minute after stop app running message "app has unexpetedly stopped" , again few minutes later...i know possible keep checking somehow cause many apps doing wrong? have far: package com.ducknoise.toonfight; import java.sql.sqlexception; import android.app.notificationmanager; import android.app.service; import android.content.intent; import android.os.asynctask; import android.os.build; import android.os.ibinder; import android.support.v4.app.notificationcompat; import android.support.v4.app.notificationcompat.builder; import android.widget.toast; public class toonservice extends service{ public static toonservice toonservice; public toonservice(){ toonservice = this; } @override public ibinder onbind(intent intent) { string toonname = intent.getstringext...