Posts

Showing posts from April, 2015

javascript - How does one use Flot's selection graph with time on the xaxis? -

update: here fiddle demonstrate: http://jsfiddle.net/msybn/1/ i using flot's selection graph: http://www.flotcharts.org/flot/examples/selection/index.html i use time xaxis, when drag zoom in smaller time interval graph goes blank. in working examples xaxis time based in years, numerically easy plot (i.e 1994.5 half way through 1994). i have month year on xaxis such as: 'jul 2012', 'jan 2013', 'jul 2013' , on in 6 month intervals. using in conjuntion crosshair plugin , time plugin. the zooming wont work. get's milli sec values correctly cant set graph them. code below, can help? imported scripts: jquery.flot.js jquery.flot.time.js jquery.flot.crosshair.js jquery.flot.selection.js $(function() { //define datasets var datasets = { "blah": { label: "blah", key: "blah", data: [] }, //etc }; $.each(datasets, function(

Is it possible to know in what language an exe file is written? -

i have exe file , decompiled ida. told program coded in delphi, tried decompile dede failed, no output , no error. , i'm wondering possible find language used in creating exe trying different decompilers written programming language? or can fail other reason? in many cases is possible identify compiler used compile code, , that, original language. most language implementations include kind of runtime library implement various high-level operations of language. example, c has crt implements file i/o operations ( fopen , fread etc.), delphi has compiler helpers string type (concatenation, assignment , others), ada has various low-level functions ensure language safety , on. comparing code of program , runtime libraries of candidate compilers may able find match. ida implements approach in flirt technology . using signatures, ida able determine of major compilers dos , windows. it's more difficult on linux because there's no single provider of compiler bina

asp.net mvc - Modified Webforms project ro run MVC 4 but no mvc items in the project -

i modfied existing webforms projects run mvc 4 , did , when try add new item such mvc view or controller , cant find them in new items list , should modify allow mvc items show? i fix issue add bolded guid projecttypeguids tag {e3e379df-f4c6-4180-9b81-6769533abe47} ;{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

numpy - How to populate an empty array selectively? -

i new python , have tried accomplish following little success: in folder there *.columns files contain 5 (0-4) columns , 500 rows. need sum columns 1-4 on *.columns files , plot result against first column of of (all equal). i created empty array in want paste first (0) column of array "x_array3" , columns 1-4 "y_array0". of them have same size (500l, 5l). could please give me advice how proceed? lost right now. christian import glob import numpy np listoffiles = glob.glob("*.columns") y_array0 = 0 filename in listoffiles: y_array1 = np.genfromtxt(filename, skip_header = 1, usecols = (0, 1, 2, 3, 4)) y_array0 = y_array0 + y_array1 x_array3 = np.genfromtxt(listoffiles[0], skip_header = 1, usecols = (0, 1, 2, 3, 4)) empty_array = np.empty(shape=(500, 5)) ausgabe_array = ??? here i'm stuck ??? np.savetxt('sx_dos.out', ausgabe_array) i have found working solution. read in columns single arrays , merge them @ en

mysql - PHPMYADMIN returns result, PHP Query doesnt -

so, created query in phpmyadmin pick 1 random online member part of group. works fine in phpmyadmin , want. however, when run query using php not return anything. 'null' when use var_dump($result) . $sql= "select ow_base_user_online.userid, ow_base_authorization_user_role.roleid ow_base_user_online inner join ow_base_authorization_user_role on ow_base_authorization_user_role.userid = ow_base_user_online.userid ow_base_authorization_user_role.roleid = 14 order rand() limit 1"; $result = ow::getdbo()->queryforlist($sql); please, have ideas? please have ideas? yes, use error reporting mysql query , see returns. check php errors (can auth warnings show daft bad user/password etc). also, testing, try removing class use , stick db connection code above query , query direct test script. if works fine, query ok, connection , credentials. there can work backwards checking class have.

java - Android Proximity alert with multiple POI -

i have database of lat , long id's , have retrieved using json , want apply proximity alert geo locations in array. unsure if array being passed or if proximity alert.java being invoked properly this db retrieval public class retrievedb extends asynctask<void, integer, void> { @override protected void doinbackground(void... params) { string result = ""; inputstream = null; //http post try{ httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://cs1.ucc.ie/~am32/getdb.php"); httpresponse response = httpclient.execute(httppost); httpentity entity = response.getentity(); = entity.getcontent(); } catch(exception e){ log.e("log_tag", "error in http connection "+e.tostring()); } //convert response string try{ bufferedreader reader = new bufferedreader(new inputstreamreader(is, &q

javascript - Are jQuery selectors snapshots or are they updated in real time -

i have variable y derived jquery selector: function g() { jquery('.myproperty').each(function(){ var x = jquery(this); f(x); }); } function f(x) { var y = x.siblings('someproperty').children('someclass'); var myvalue = random(); y.myvalue = myvalue; jquery.ajax( /* ... */ success: function { if (myvalue != y.myvalue) { /// something! } else { /// else! } } ); } now, let's suppose g() event handler runs whenever user clicks button. means can fire in succession. since f() fires asynchronous ajax call, browser not block until succeeds , may arrive in random sequence after f() calls done (remember, don't block on ajax calls , complete), instance: the issue facing y in each ajax call appears snapshots of actual dom object because state of y.myvalue not appear change despite perturbations calls g() (and f() extensio

fluent interface - Creating multiple contexts in Entity Framework Code First -

Image
i struggling implement multiple database contexts in entity framework code first. have implemented 3 contexts (all entities, entities related conference , entities related user profile) shown on pictures. fluent api used entity mappings. example code used conferencecontext: public class conferencecontext : basecontext<conferencecontext> { public dbset<conference> conferences { get; set; } public dbset<importantdate> importantdates { get; set; } public dbset<topic> topics { get; set; } public dbset<venue> venues { get; set; } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { base.onmodelcreating(modelbuilder); insertentitymappings(modelbuilder); // inserts entity mappings } private void insertentitymappings(dbmodelbuilder modelbuilder) { modelbuilder.configurations.add(new conferencemappings()); modelbuilder.configurations.add(new importantdatemappings()

Dynamic style - manipulating CSS with JavaScript -

i have image slider in worpress theme using inline styles change display block none depending on slide is. there way separate change dynamically in js rather using inline style? changing display block when becomes current slide. html: <div class="single_fading_slide staged_slide" style="display: none;"> <div class="positioning load_slide_image"> <span id="355_img_1"> <img src="http://imagehere" title="" alt="" width="960" height="340" class="slide_image"> </span> </div><!-- .positioning .slide_image --> <div class="slide_overlay"></div> </div> script:i new js appreciated. sure not of applies wanted include see it. <script type="text/javascript"> /* <![cdata[ */ jquery(document).ready(function(){ // add class nopreload images in 'slid

regex - For a set of sequences store sequence in hash and its open reading frames as values -

as follow ( find multiple matches of , nucleotide sequence ) i want add each orf (as atg...tag or atg...taa) hash each sequence sequence have orfs attached values. have far - #!/usr/bin/perl use warnings; use strict; @file = qw(atgccccccccccccctagatgaaaaaaaaaataaatgaaaaatagatgccccccccccccccc atgcgcgctatatatgcgcgggctaatatat atatgaggtcgtagctagcaaacacaaataaa ); %hash; foreach (@file){ @match = ($_ =~ /(atg\w+?ta[ag])/g); # make %hash sequence key , orfs values)... } can me? building on code: (i've changed nucleotide sequence make easier see stop , start codons, but work same way sequences...) i've stored matched sequences in array within hash of arrays follows: #!/usr/bin/perl use warnings; use strict; use data::dumper; @file = qw(atgcgcgcgcgcgcgtaaatgatatatatatatag atgccccccccctaagggggggggatgttttttttttttag atatgaggggatagaaaatttttttctttct); (@match, %hash, @sequence, $line); $line_number = 0; foreach (@file){ push @match, /(atg\w+?ta[ag])/g;

php - Efficiently use mysqli in object oriented setting -

i have come conclusion using mysqli in oo approach better procedural approach. (source: why object oriented php mysqli better procedural approach? ). i'm not quite sure if doing more efficient doing before. i have function runs sql queries. block of code looked like: database connection: function connectdb(){ $con = mysqli_connect(server, username, password, database); return $con; } query function: function executequery($payload){ $con = connectdb; $result = mysqli_query($con, $payload); return $result; } as can see, that's not efficient because i'm creating new database connection every time executequery called. figured i'd try using oop. database connection (oop): function connectdb(){ $con = new mysqli(server, username, password, database); return $con; } database query (oop): function executequery($payload){ $con = connectdb(); $result = $con->query($payload); return $result; } now m

objective c - How to edit elements in plist file -

i have settings.plist , want edit values in file. my function edit/writing is: - (void) setparamwithname: (nsstring*) name withvalue: (nsstring*) value { // paths root direcory nsarray *paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes); // documents path nsstring *documentspath = [paths objectatindex:0]; // path plist file nsstring *plistpath = [documentspath stringbyappendingpathcomponent:@"settings.plist"]; // check see if data.plist exists in documents if (![[nsfilemanager defaultmanager] fileexistsatpath:plistpath]) { // if not in documents, property list main bundle plistpath = [[nsbundle mainbundle] pathforresource:@"settings" oftype:@"plist"]; } // read property list memory nsdata object nsdata *plistxml = [[nsfilemanager defaultmanager] contentsatpath:plistpath]; nsstring *errordesc = nil; nspropertylistformat format; // convert static property list dictionary object nsdictionary *temp = (ns

java - Integer.parseInt(string) is giving me number format exception -

why code throw numberformatexception ? int = integer.parseint("1111111111111111111111111111111111111111"); how value of int string ? the value you're attempting parse bigger biggest allowable int value ( integer.max_value , or 2147483647 ), numberformatexception thrown. bigger biggest allowable long ( long.max_value , or 9223372036854775807l ), you'll need biginteger store value. biginteger verybig = new biginteger("1111111111111111111111111111111111111111"); from biginteger javadocs : immutable arbitrary-precision integers.

python - Error in cx_freeze Build -

i using cx_freeze bundle app. have 2 questions. 1) using osx mountain lion - /build/exe.macosx-10.8-x86_64-2.7 have - contain executables windows, linux - , if so, in list can find it? original script cpu.py. dir contains lot of ".so" files , 1 "cpu" file. 2) when try "cpu" list above, output. 'psutil' python module required script - cpu.py. desktop/build/exe.macosx-10.8-x86_64-2.7/cpu ; exit; traceback (most recent call last): file "/usr/local/lib/python2.7/site-packages/cx_freeze/initscripts/console.py", line 27, in <module> exec code in m.__dict__ file "cpu.py", line 6, in <module> file "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 102, in <module> import psutil._psosx _psplatform file "/usr/local/lib/python2.7/site-packages/psutil/_psosx.py", line 14, in <module> import _psutil_osx file "build/bdist.macosx-10.8-x86_64/egg/_psutil_osx.py",

linux - The meaning of the /sys/class/net/<interface>/type value -

for each network interface linux contains directory in /sys/class/net there file name "type". value is: 1 - wlan0/eth0. 772 - lo. 512 - rmnet0/rmnet1/... so meaning of these values? can find descriptions? this header show way world of work interfaces: http://lxr.linux.no/linux+v3.0/include/linux/if_arp.h#l30

vbscript - CreateObject("Redemption.RDOSession") returns error code 800401FA -

i'm trying use redemption library in script , can't load it. set m_objrdosession = createobject("redemption.rdosession") i have tried load directly following set m_objrdosession = getobject("redemption.dll", "redemption.rdosession") both same error code, null message , source. i'm using windows 64 bit outlook 32 bit. have loaded library c# , redemption loader on same machine. ps: should mention saw terms , agreement prompt before error got thrown. what can do? error code 0x800401fa co_e_wrongosforapp . if machine 64 bit, end using 64 bit version of cscript.exe, bitness of code must match bitness of outlook - use cscript.exe syswow64 folder. extended mapi set of dlls loaded in-proc, , 64 bit process cannot load 32 bit dll , vice versa. see http://www.dimastr.com/redemption/faq.htm#errorcreatingredemptionobject more details.

c# - Turn Off ServiceStack Logging -

servicestack's internal logging isn't want have in logs. how disable internal logging, or @ least suppress doesn't clog log? when configuring logmanager set instance of nulllogfactory logmanager.logfactory = new nulllogfactory();

Differences betweeen Hector Cassandra and JDBC -

i'm starting project use cassandra apache. i'm interesting in accessing database cassandra java. that, i'm using hector cassandra. however, i've doubts what's differences between access via hector or jdbc cassandra (specifically this: https://code.google.com/a/apache-extras.org/p/cassandra-jdbc/ ). i believe following (although not sure if i'm right): one difference between both api of different level (i consider hector cassandra api of higher-level jdbc cassandra)? in jdbc cassandra used cql accessing/modifying database, while hector cassandra don't use cql (only use methods provided that). i'll thankful if can me , tell me if i'm right/wrong in previous lines , more differences between both (hector , jdbc cassandra). thank in advance! official cassandra java driver ( https://github.com/datastax/java-driver ) best (imho, only) choice new project several reasons: new features all other cassandra clients (hector, astyanax,

Fastest transfer of data from MSSQL to MySQL via PHP -

i need store data remote ms sql db local mysql db; need using php. the fetching of data mssql simple enough: select orderref , ordervalue remotetbl this results in 100k rows. want store in local mysql database using php. enough, can (with addition of field want) : while(list($orderref, $ordervalue) = mssql_fetch_array($result)){ mysql_query("insert localtbl (orderref, ordervalue, updated) values ('$orderref', '$ordervalue', now())"); } // done rows this seems wasteful 100k rows of data though. is there way can more efficiently? updated further comments: by using php resource mssql query perhaps? need things data, , mssql dbms read only. thanks you should use mysqli since mysql functions aren't going around more speed 1 big insert statement so. $sql = "insert localtbl (orderref, ordervalue, updated) values "; while(list($orderref, $ordervalue) = mssql_fetch_array($result)){

asp.net mvc - jqgrid url not invoking controller action method mvc3 -

i want call controller action jqgrid , used url property of jqgrid, still controller action method not being called....the jqgrid being loaded without data, posting view, can point out going wrong <link href="../../content/ui.jqgrid.css" rel="stylesheet" type="text/css" /> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="../../content/site.css" rel="stylesheet" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script> <script src="../../scripts/jquery.validate.min.js" type="text/javascript"></script> <s

edit - Please help me to get the dynamic id of the record in the listing of the records in Cakephp 2.3.9 -

i used bake make cms of settings table. it contains 3 fields. column type null default id int(11) no key varchar(10) no value varchar(200) no and have 3 records. all create functionality working fine. delete , edit edit/delete first record. for getting link... i used following code in view file. foreach ($languages $language){ echo $this->html->link(__('edit'), array('action' => 'edit', $language['language']['id'])); ?> echo $this->form->postlink(__('delete'), array('action' => 'delete', $language['language']['id']), null, __('are sure want delete # %s?', $language['language']['id'])); } i assigned following value languages variable controller. $this->language->recursive = 0; $this->set('languages', $this->paginate()); schema: create table if not exists languages ( id int(11) no

php - mySQL insert syntax error with quote -

i'm receive following error below, believe in part quote have in insert string 5'10 - (178cm) in passed $en['height'] variable. what's best way handle error? error: have error in sql syntax; check manual corresponds mysql server version right syntax use near '10 - (178cm)', m_btype = 'rather not say' @ line 12 this mysql insert: m_height = '".$en['height']."', table set as: varchar(30) latin1_swedish_ci your issue must "escape" strings before inputting them sql queries. not doing allow people alter query inputting quotes. example if input following string: '; select * users; -- its possible execute sql did not intend. solution escape: m_height = '".mysql_real_escape_string($en['height'])."', or better yet use more date method of querying mysql such pdo or mysqli functions. edit think have more general syntax error. try this: m_height = "'&

VBA, Excel Error 'object required' when passing an array as a variable -

i have 2 vba procedures 1 building array pass another. however, when first procedure run excel error window pops saying 'object required'. here code have. cannot seem find causing error. sub determineload() worksheets("gear").activate dim row_src string dim strt_row string dim col_storage string dim arr() string dim alength integer row_src = "c" strt_row = "9" col_storage = "b" range(row_src + strt_row).activate while not isempty(range(col_storage + active.row)) if not isempty(activecell) if activecell.value alength = ubound(arr) + 1 redim arr(0 alength) arr(alength) = string(activecell.column, activecell.row) end if end if activecell.offset(0, 1).activate wend determineweight arr end sub sub determineweight(paramarray arr() variant) worksheets("gear").activate dim weight_lb_trgtcell string dim weight_oz_trgtcell string dim volume_cuin_trgtcell string

Using javascript closures for context in loops -

is bad practice make jquery closure purpose of retaining context? example: { testfunction: function() { //instantiate variables etc... (var = 0; < columns.length; i++) { (var j = 0; j < columns[i].length; j++) { // create closure .then callback has correct value x var func = function() { var x = new testobject(columns[i][j].id); // find method returns jquery promise x.find().then(function() { // use x logic here }); }; func(); } } } } in case closure needed function jquery promise has context x is. otherwise x variable changed after next iteration of loop. jquery promise object gets value of whatever x in last iteration of loop. i'm looking best practices here, wondering keep code simple, readable , efficient. please note performance issues c

scala - Why does not Set implement PartialFunction? -

programming in scala: comprehensive step-by-step guide, 2nd edition, page 546: in inheritance hierarchy below iterable find 3 traits: seq, set, , map. common aspect of these 3 traits implement partialfunction trait apply , isdefinedat methods. however, code not compile (tried both 2.8.2 , 2.10.2): set(1, 2, 3).isdefinedat(1) with error: value isdefinedat not member of scala.collection.immutable.set[int] is mistake in book? sure looks it. going far scala 2.5.0: seq , map extend partialfunction : set not. it seems sensible: set maps objects boolean values, it's always defined ( true members, false nonmbers).

c# - Copy value from in a GridView into a TextBox -

i have gridview want text value cell in column 26 in selected row textbox (named txtresult ). cell not visible (its visible property false ). i tried this: txtresult.text = grdmygrid.selectedrow.cells[26].text; thanks in advance! don't set invisibility on regular column properties on code behind (.aspx), throught rowdatabound event. believe way value.

Jquery AngularJS router working in Firefox but not in other browsers -

i have developed app uses both angularjs , jquery versions of mobile , web. im facing peculiar problem in app developed works in firefox not in browsers, please open below link in firefox cold see router linking 2 files working, if same opened in chrome ie or safari doesnt work http://plnkr.co/edit/wbqi3x32fvl0rmw3embd?p=preview any appreciated i see few things might want change first, in index.html, can fill ng-app value then, in path1.html , path2.html, remove html, head , body tags, , remove ng-controller declaration, declaring in routers. it shouldn't work in mozilla have project now, browser quite reluctant being beaten mediocre html definitions (learned personal experience, lol!) hope helps!

Can I proxy a ServiceStack Service? -

i'm wondering if it's possible have servicestack use aop-proxied service, instead of main implementation. avoid having class inherits servicestack.serviceinterface.service wrapper, if possible. looks me need be, thought wouldn't hurt ask, sure. i looking way achieve this, proxy services of servicestack app. till have learned that: way can generate proxy service [route("/reqstars")] public class allreqstars : ireturn<list<reqstar>> { } public class reqstarsservice : service { public virtual list<reqstar> any(allreqstars request) { return db.select<reqstar>(); } } is using custom service generation strategy. , generating proxies of iservice interface class target , marking method of service virtual. i have not tested yet , not know (and researching now) if servicestack can handle service generator delegate can use castle's dynamicproxy. good luck!

asp.net mvc 4 - Storing HttpClient BaseAddress on web.config -

i want store httpclient baseaddress uri on asp.net mvc4 project web.config. in section correct place add configuration? add in web.config <configuration> <appsettings> <add key="baseaddress" value="http://xxx/"/> </appsettings> </configuration> get value this: configurationmanager.appsettings["baseaddress"]

Android AsyncTask: what is difference between execute() and get()? -

should write smth that return task.exec(session, state).get(json_timeout, timeunit.milliseconds); or can this task.exec(session, state, result); return result; a have read documentation found, failed find answer. bad... do not use get() . block ui thread until asynctask finishes execution no longer makes asynchronous. use execute , invoke asynctask new task().exec(session, state, result); also can pass params constructor of asynctask or doinbackground() http://developer.android.com/reference/android/os/asynctask.html public final result () added in api level 3 waits if necessary computation complete, , retrieves result. you can make asynctask inner class of activity class , update ui in onpostexecute . if asynctask in different file can use interface. how return boolean asynctask?

Connect to SQL Server CE in stimulsoft -

i want stimulsoft software wizard connect sql server ce how can stimulsoft software connect sql server ce database ? you download sql server ce adapter stimulsoft site , compile assemblies use. find instruction in archive.

servlets - Can't get the session for Junit testing -

my struts2 action classes use below code access session actioncontext.getcontext().getsession().clear(); however, when try use junit test action classes nullpointer exception. have been reviewing of comments posted others on stackoverflow , have been using below code: httpservletrequest request; httpsession session; @before public void setup() throws exception { request = mockito.mock(httpservletrequest.class); request.setattribute("beanlist", beanlist); request = mockito.mock(httpservletrequest.class); mockito.when(request.getsession()).thenreturn(session); map<string, object> contextmap = new hashmap<string, object>(); contextmap.put(strutsstatics.http_request, request); actioncontext.setcontext(new actioncontext(contextmap)); } however, still throws null pointer error. system able find context, when tries session dies on me. have tries few different ways accomplish same goal no avail. idea doing wrong

Eclipse Android - where should i create .java files -

i'm new development android apps in eclipse. i have connect simple app oracle database. got .java class work, don't know put in android project. ( src folder? gen folder?) thank answer. sources in in src folder, stand sources. recommend intall the eclipse adt plugin then create new android project, set base files you, can continue developing.

java - Basic programming class...first time using a string. -

i supposed make program incorporates methods , string format. situation user inputs new tree example: tree t = new tree(27, 43.25, "pine") , type t.describe() , receive output "tree number 27 has circumference of 43.25 , of species pine." here code: public class tree{ int serial; double circumference; string species; tree(int serial, double circumference, string species) { this.serial = serial; this.circumference = circumference; this.species = species; } public string describe() { string.format("tree number %d has circumference of %.2f , of species %s.", serial, circumference, species); return describe(); } } the program blows though. help! the problem calling describe() within describe() , nothing stopping calling ad infinitum. must getting stackoverflowerror . the solution here simple - string.format returns string want. return it. return string.format("tree number %d has circumf

What happens when you end a Sql Server Service Broker message "with error"? -

i trying figure out how deal errors using sql server service broker. i have read there no real "poison message" control in service bus other stop processing. for system, bad (we quite behind on messages). i have seen example says deals using end conversation error <error code> but can't seem find out in queues or error recorded. if knows calling "with error" on end conversation does, love hear it. it places error message on queue rather enddialog message. books online states 'service broker drops other messages conversation in transmission queue.' take mean message replaces messages haven't yet been sent. the error number , message placed in message body.

Good CSS grammar in Antlr v4 -

are there css grammars out there antlr4? know there grammars antlr3, turns out css not trivial parse without "lexer modes", added in v4. why? consider following css selectors: .hello.world { /* ... */ } .hello .world { /* ... */ } in grammars, whitespace ignored. if ignore whitespace, becomes impossible distinguish between 2 selectors above @ parser level. then again, if don't ignore whitespace, grammar becomes pretty noisy ws? or ws* patterns everywhere, since whitespace mostly meaningless unless occurs within selector. which modes antlr4 come in, because support lexer modes can define new rules lexer whenever enter different contexts (i.e. don't ignore whitespace within "selector" context). that said, i'll accept grammar antlr3 long handles whitespaces properly, that's version we're using anyway ;-) i imagine you've found answer question posted long ago. still: a antlr v4 grammar css3 can found on antlr github h

android - Issues with large APK file -

i'm creating version of game app stores such amazon, don't have apk expansion mechanism - put files in "assets" folder. however, 300+ mb apk seems create lot of problems: when try install adb on either emulator or samsung galaxy s2, 75% of times fails. samsung, install_failed_media_unavailable (although it's not mounted, , there's plenty of free space), , emulator, 'null'. again, happens 75% of time, random. my game locks @ point in native code. there's absolutely nothing there can lock or has os - plain c++ logic. verified issue happens when push large assets apk. if remove assets (completely unused, pushing large files there), issue doesn't happen. clarify - in order test that, manually pushed game files device, has nothing asset extraction. this weird, , i'm starting consider getting own expansion file server. any ideas? update: found solution #2. code base using doing hackish in background apk assets, that's why

optimization - Algorithm for optimizing computation of an arithmetic expression -

suppose have expression formed integer variables , arithmetic operations: addition, subtraction , multiplication. know each multiplication takes m seconds, , each addition/substraction takes seconds. there algorithm compute expression in efficient way arbitrary assignment variables? (assume can store in memory 1 number). example: m=10 a=1 expression: a*a+a*b+b*b. initially, has 3 multiplications , 2 additions, total time 3*m+2*a=32 however, can build equivalent expression (a+b)*(a+b)-a*b has 2 multiplications , 3 additions, total computation time 2*m+3*a=23. you want apply sum product algorithm. see: http://www.isiweb.ee.ethz.ch/papers/docu/aloe-2001-1.pdf

java - Hide an entity variable from xml message - @XmlTransient not working -

i have entity class: public class customer implements serializable { private static final long serialversionuid = 1l; @xmltransient @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "customer_id") private integer customerid; @basic(optional = false) @notnull @size(min = 1, max = 30) @column(name = "name") private string name; @basic(optional = false) @notnull @size(min = 1, max = 30) @column(name = "addressline1") private string addressline1; @basic(optional = false) . . . . i sent object of class via xml in jax-ws web service so: <addressline1>bunkilla</addressline1><addressline2>donoughmore</addressline2><city>cork</city><country>ireland</country><creditlimit>10</creditlimit><customerid>1</customerid><email>davidmurray06@gmail.com</email><fax>0217337330</fax><name>david</name><owner>dav

Android SDK false syntax error "Syntax error on token "}", delete this token." -

so i'm trying complete google's "my first app", , have gotten work point. however, receiving false error on 2 of brackets. i not allowed post images reason, here link screencap (which thought appropriate highlighted errors): http://imgur.com/0byjz2x i have cleaned build, rebuilt project, restarted computer, wiped code, , repeated in manner of orders no avail. here experienced similar problem on older build of adt plugin: syntax error on token "}", delete token any appreciated, 3 hours of time , lot of caffeine haven't made dent in problem. android sdk false syntax error “syntax error on token ”}“ i think not false syntax error. need put sendmessage function inside } quote @ line 29 , showing error. function outside activity . why giving error since last 3 hours :).

About C++ Payroll -

i taking online c++ class , having hard time learning. not sure doing wrong code below problem. formula right if hours = 40, going wrong if hrs above 40 or below 40. appreciate help! cheers, r. problem: if hrs <= 40 regular pay = hrs times pay rate if hrs > 40 overtime pay = 1.5 times (hrs - 40) times pay rate gross pay = regular pay plus overtime pay // code #include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { //variable declarations int employeeidentificationnumber = 0; double hours = 0; double payrate = 0; double grosspay = 0; double regularpay = 0; double overtimepay = 0; std::cout << "welcome employee payroll.\n"; // display message std:: cout << "enter employee identification number: "; //promp user data std::cin >> employeeidentificationnumber; //read integer user employeeidentificationnumber std::cout <

sql - Syntax error for MySQL function -

delimiter $$ create function ecmsbackoffice.getsequence($delimeter varchar(20)) returns varchar(20) begin declare result varchar(20); set result = 0; if (delimeter='b') update id_generator set seq_currval=(seq_currval+1) seq_name='b'; else if (delimeter='d') update id_generator set seq_currval=(seq_currval+1) seq_name='d'; else if (delimeter='c') update id_generator set seq_currval=(seq_currval+1) seq_name='c'; end if select seq_currval result id_generator seq_name = delimeter; return result; end $$ delimiter ; i'm trying create mysql function, following error: error code: 1064 have error in sql syntax; check manual corresponds mysql >server version right syntax use near 'select seq_currval result id_generator seq_name = delimeter; r' @ line 9 what problem? change else if elseif everywhere,

sql - How to select all products satisfying n numbers of attributeid/attributevalue conditions -

i have products table , productattributevalues table product ------- id 1 name id 2 name b productattributevalues ------- id 1 productid 1 attributeid 1 values z id 2 productid 1 attributeid 2 1 values y id 3 productid 1 attributeid 3 1 values p i need select products where, ((productattributevalues.attrbuteid = x , productattributevalues.value = x) , (productattributevalues.attrbuteid = x , productattributevalues.value = x) , ............................................................................ , ............................................................................) these conditions dynamic. might 1 or 2 or 3 or on. so how select products satisfying n numbers of aattributeid/attribute value conditions? this "set-within-sets" query. think general approach aggregation having caluse: select productid productattributevalues pav group productid having sum(case when productattri

assembly - Moving a quadword number to xmm registers -

i trying move number in 64-bit register xmm register arithmetic. thinking was: movq xmm1, r14 in program r14 holding counter , need moved xmm1 can divide sum of numbers have stored in xmm0. , display it. when execute code, stores 0 xmm1. someone please help. i created test.asm as: section .code global _start _start: mov r14,0x123456789abcdef0 movq xmm1, r14 int 3 compiled , linked with: nasm.exe -f win64 -o test.obj test.asm link.exe test.obj /entry:_start /subsystem:console and ran under 64-bit windbg. when hit int 3 windbg showed registers as: r14 123456789abcdef0 xmm1 0.000000e+000: 0.000000e+000: 5.690457e-028:-7.811515e-023 xmm1/0 9abcdef0 xmm1/1 12345678 xmm1/2 0 xmm1/3 0 xmm1l 1234:5678:9abc:def0 xmm1h 0:0:0:0 ...and having typed of that, possible looking @ xmm1 floating point instead of integer values?

java - Display ProgressBar while saving an image from Activity -

in app letting user save drawing. while drawing saved, want display progress bar on top of drawing let user know saving. my xml layout: <framelayout android:id="@+id/viewd" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="3" android:orientation="vertical" android:layout_gravity="center" > <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" android:background="@drawable/bd" android:id="@+id/llfreedraw" > </linearlayout> <progressbar android:layout_height="fill_parent" android:layout_width="fill_parent" style="@android:style/widget.progressbar.large" android:id="@+id/p

Python- adding two functions together -

working on problem set- here q: two function definitions saved in same file: function count_vowels has 1 parameter, word, , returns number of vowels in word. function count_consonants has 1 parameter, word, , returns number of consonants in word. determine number of letters in word, write one-line body following function calls both count_vowels , count_consonants: def count_letters(word): """ (str) -> int return number of letters in word. >>> count_letters('hello') 5 >>> count_letters('bonjour') 7 """ # write one-line function body belongs here. my answer: return count_letters(count_vowels() + count_consonants()) wrong. why? you don't need call count_letters , other 2 functions. need pass word argument each function. return count_vowels(word) + count_consonants(word)

opengl - glXChooseFBConfig() setting for anti-aliasing? -

according post , stated to request visual multisampling xlib , use these 2 attributes in list glxchoosefbconfig(): glx_sample_buffers - value should true. on/off toggle. glx_samples - number of samples. these of which, according wiki on multisampling section in opengl.org, glxchoosefbconfig() accept these attributes. however, glx_sample_buffers/glx_samples don't appeared specified in sdk here . might know why? i suggest download glx-1.4 specification pdf, better reference manual: http://www.opengl.org/registry/doc/glx1.4.pdf

python - Django Form not rendering in template -

i must overlooking here, after stripping - can't seem django render either form or modelform template. code below: #forms.py class contactform(forms.form): subject = forms.charfield(max_length=100) message = forms.charfield() sender = forms.emailfield() cc_myself = forms.booleanfield(required=false) #views.py def index(request): if request.method == 'post': form = contactform(request.post) if form.is_valid(): # validation rules pass return httpresponseredirect('/thanks/') else: form = contactform() # unbound form return render_to_response('home/new_website.html',{ 'form': form, }) #new_website_html <html> <body> <form method = "post" action = ""> {{ form.as_p }} </form> </body> </html> i had same issue , after many tries solution: change view this #views.py else: form = contactfor

javascript - How to change a Fusion Table layer query based on user input and button? -

google provides great example of updating fusion table layer on map here: https://developers.google.com/fusiontables/docs/samples/change_query user input captured in html: <select id="delivery"> <option value="">--select--</option> <option value="yes">yes</option> <option value="no">no</option> </select> the query updated in javascript: function updatemap(layer, tableid, locationcolumn) { var delivery = document.getelementbyid('delivery').value; if (delivery) { layer.setoptions({ query: { select: locationcolumn, from: tableid, where: "delivery = '" + delivery + "'" } }); } else { layer.setoptions({ query: { select: locationcolumn, from: tableid } }); } as can see on link above, query , map layer updates o

mysql - subquery in IN clause? -

i have 2 tables named as product_category create table `product_category` ( `pid` int(11) not null, `cid` int(11) not null ) engine=innodb default charset=latin1; -- -- dumping data table `product_category` -- /*!40000 alter table `product_category` disable keys */; insert `product_category` (`pid`,`cid`) values (1,1), (2,3), (3,2), (4,2), (5,3), (1,2), (2,4), (3,1); and category table create table `category` ( `id` int(11) not null auto_increment, `cat_name` varchar(50) not null, `mapped_cat_id` varchar(250) not null, primary key (`id`) ) engine=innodb auto_increment=5 default charset=latin1; -- -- dumping data table `category` -- /*!40000 alter table `category` disable keys */; insert `category` (`id`,`cat_name`,`mapped_cat_id`) values (1,'c1','1,2,4'), (2,'c2','2,3'), (3,'c3','3,4'), (4,'c4','4,1,3'); /*!40000 alter table `category` enable keys */; when run query select dis

jQuery append not inserting detached elements -

i can't seem append working elements detaching detach() basically want remove images dom based on screen size (larger 900px) , add them (smaller 900px). using enquire.js handle breakpoints unable implement insertion of removed elements. here's html: <div class="mobile-slides"> <a><img src="image.jpg" /></a> <a><img src="image2.jpg" /></a> <a><img src="image2.jpg" /></a> </div> here's js i'm using: enquire.register("screen , (min-width: 900px)", { match : function() { var slides = $('.mobile-slides a').detach(); }, unmatch : function() { $('.mobile-slides').append(slides); } }); detach seems working when second condition met nothing happening. doing wrong? edit stupid mistake on behalf declaring variable "slides" inside enquire match function therefore wasn't avail