Posts

Showing posts from September, 2015

php - regexp cyrillic filename not matches -

i take list of files php glob(."*.pdf") . files have cyrillic names. example: ООО «Рога и копыта» then load company names database , try find them in file names: preg_match("/$firm_name/ui", $file_name, $match); i have problem: firms if $firm_name visually similar $file_name , preg_match says there no match. mb_detect_encoding both variables return utf-8. there problem in file name, or maybe there encoding or something, can not understand, ask help. upd: $file_name='ООО «Рога и копыта»'; preg_match("/... .Рога и копыта./ui", $file_name, $match); as result, ОО «Рога и копыта» , 1 О missing

sql - Select Query has unexpected multiple records (MS Access) -

i may tired, can't seem figure out happening. have 2 queries. query 1 has 10 fields. query 2 has 5 fields. fields 1 through 3 same in both queries. trying write select query , simple add field 5 query2 query1 result should query1 additional field (query2.field5). i join first 3 fields both queries , choose select records in query1 , in query2 match. don't know sql, use query designer. expect same number of records have query 1 instead have 3 times or more. can tell me doing wrong. tried reversing joins still seem same records. thanks in advance. here query: the fields in common divisionname , supplierid = vendorid , commodityname . select [part revenue exposed query p1].divisionname, [part revenue exposed query p1].commodityname, [part revenue exposed query p1].suppliername, [part revenue exposed query p1].partnumber, [part revenue exposed query p1].partdescription, [part revenue exposed query p1].bucode, ...

php - Cannot create local copy of Magento -

i'm trying create copy of existing magento website on localhost developing purposes. i followed steps listed here: copy ec2 files local i created fake domain localhost there’s “.” in read somewhere required magento. localhost fake url like: www.mysite.local i have xampp installed on os x 10.9.1 , placed magento filesystem follows: /applications/xampp/xamppfiles/htdocs/magento/ in database added local url follows: update core_config_data set value = ‘http://www.mysite.local/’ config_id = 6; and on local.xml entered following parameters: <host><![cdata[localhost]]></host> <username><![cdata[myusername]]></username> <password><![cdata[mypassword]]></password> <dbname><![cdata[mydatabase]]></dbname> where localhost localhost, myusername username db restored on local xampp server, mypassword password same db, mydatabase name of same db. still, when browse www.mysite.local/magento/ or www....

c# - OpenXML hanging while writing elements -

Image
i have program pulls data database, caches file , exports data multiple formats (excel, excel 2003, csv). i'm using openxml sdk 2.0 excel work. these export processes run in parallel (using parallel.foreach ), , amount of data can pretty large - e.g. csvs 800mb. during these larger exports, i've noticed writing of xml documents hang. instance, if have 8 exporting in parallel, @ point "pause". hang around same point: //this.writer openxmlwriter created worksheetpart. this.writer.writeelement(new cell() { cellvalue = new cellvalue(value), datatype = cellvalues.string }); when happens, pause debugger (vs2013 in case) , notice threads blocking around same portion of code - bit deeper in openxml sdk - stem call openxmlwriter.writeelement . i dug through source using justdecompile didn't find answers. appears there intermediary stream in use writing isolated storage , is, reason, blocking. underlying stream each of these filestream . here screenshot ...

c# - Can I convert a My.Resources file into a Properties.Resources file -

i have existing my.resources file, convert properties.resources file. wouldn't want hand (that ugly). there tool out there capable of doing that? the my.resources type standard .resx file exists in project. same format c# uses , can copied directly 1 project other. the .resx file under my project folder of project. easiest way import on to right click on c# project add -> existing item navigate vb.net .resx file , select it

tomcat - java.lang.IllegalArgumentException: Document base [...]org.eclipse.wst.server.core\tmp0\wtpwebapps[...] does not exist or is not a readable directory -

i getting exception in eclipse-jee-kepler-sr1-win32 java.lang.illegalargumentexception: document base c:\users\praveen\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\advanced java not exist or not readable directory @ org.apache.naming.resources.filedircontext.setdocbase(filedircontext.java:138) @ org.apache.catalina.core.standardcontext.resourcesstart(standardcontext.java:5077) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5257) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1559) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1549) @ java.util.concurrent.futuretask.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown sourc...

c# - MaxLength="255" property does not seem to be working? -

this question has answer here: specifying maxlength multiline textbox 14 answers i have textbox field maxlength set 255. can enter more 255 characters in textbox. expecting there 255 character limit.is there way control this? need use code behind? can control requiredfieldvalidator? here code in .aspx <asp:textbox id="txtcommentaire" runat="server" width="600px" maxlength="255" textmode="multiline" height="90px" style="overflow:hidden" ></asp:textbox> maxlength doesn't apply when have textmode="multiline". when use <asp:textbox textmode="multiline"> , <textarea> rendered page. textarea tags didn't support maxlength attribute until (html5). therefore, when feature designed, microsoft ignored maxlength attribute in multiline mod...

C++ I want to write to a text file but on the next line to whatever text is already in the .txt file -

if possible great i have tried code, float deposit (float balance) { double amount; system("cls"); cout<<"enter amount wish deposit"<<endl; cin>>amount; ofstream newbalance; newbalance.open ("deposit.txt", fstream::app); newbalance<<amount; newbalance.close(); balance = balance + amount; writebalance(balance); return balance; } //this function allow user increase balance you may want put fstream::out | fstream::app instead of fstream::app you can at: http://www.cplusplus.com/reference/fstream/fstream/open/ to put in new line do: newbalance<<amount<<"\n";

javascript - How to parse data from HTML and export in Excel in PHP -

this question exact duplicate of: how parse data html , export in excel in php 1 answer i want read html table data html page (without using of data base) , export excel file . using javascript cede not working. please suggest me, new here. function write_to_excel() { str=""; var mytable = document.getelementsbytagname("table")[0]; var rowcount = mytable.rows.length; var colcount = mytable.getelementsbytagname("tr")[0].getelementsbytagname("td").length; var excelapp = new activexobject("excel.application"); var excelsheet = new activexobject("excel.sheet"); excelsheet.application.visible = true; for(var i=0; i<rowcount; i++) { for(var j=0; j<colcount; j++) { str= mytable.getelementsbytagname("tr")[i].getelementsbytagname("td")[j].innerhtml;...

excel vba - vba project reference and shared state (for logging) -

say have 2 add-ins a , b - both use vb functions shared add-in c (i.e. a , b have reference vb project c ). c log messages file (e.g. c.log ) when errors detected. want c logs a.log when functions called , b.log when functions called b . the naive approach set global variable in c log-file name not work, because variable singleton, last project set variable ( a , or b ) win. how can done in vba? okay - here's solution came (quite code, seems work fine): i have logging project logging interface ilog (instancing publicnotcreatable ) this: public sub error(slogmessage string) end sub public sub warning(slogmessage string) end sub ' etc. and of course implementing class clog writes messages log-file. , public function callers can new instance of logger: public function new_log(byval logfilepathandname) ilog set new_clog = new clog new_clog.initialise logfilepathandname end function then project c must have it's code in clas...

xpath with multiple contains statements do not function correctly -

i have html code follows below. trying access selenium. if a //*[contains(text(),'add officecontract (portal)')] it finds several (there more html has more occurrences). want find specific instance when try //*[contains(text(),'add officecontract (portal)') , contains(text(),'7121995')] there no matches found. simpy doing //*[contains(text(),'7121995')] finds sorts of stuff (html full of string) html code <tr class="pd" valign="top"><br> <td> </td><br> <td nowrap="">sqaauto</td><br> <td nowrap="">01/30/2014 9:47:48 am</td><br> <td><br> <b>add officecontract (portal)</b><br> <br><br> office id 7121995<br> <br><br> contract id added: "8976504"<br> <br><br> term date added: "12/31/9999"<br> <br><br> </td><b...

JSON - Javascript - How to search array item by searching list of values -

i have json array below [ { french: 'hello', spanish: 'hello1', english:'hello2' },{ french: 'hello3', spanish: 'hello4', english:'hello5' },{ french: 'hello6', spanish: 'hello7', english:'hello8' },{ french: 'hello9', spanish: 'hello10', english:'hello81' } ]; in javascript array if wanted search items based on values ex if give hello6 finding string should 3rd item in list. generic search rather searching each , every element. you can try this: function findindex(arr, str) { (var = 0; < arr.length; i++) { (var key in arr[i]) { if (arr[i][key] === str) { if (arr[i].hasownproperty(key) { return arr[i]; } } } } return null; } this method consists of a...

wordpress - Less css parse error on mixin -

i'm using wp-less wordpress , twitter bootstrap plugin icontrolwp. the mixin taken bootstrap grid docs add grid style elements http://getbootstrap.com/css/#grid-less : // generate small columns .make-xs-column(@columns; @gutter: @grid-gutter-width) { position: relative; // prevent columns collapsing when empty min-height: 1px; // inner gutter via padding padding-left: (@gutter / 2); padding-right: (@gutter / 2); // calculate width based on number of columns available @media (min-width: @grid-float-breakpoint) { float: left; width: percentage((@columns / @grid-columns)); } } when load wordpress receive error: parse error: failed @ .make-xs-column(@columns; @gutter: @grid-gutter-width) { if cancel code block error pass next similar mixin function .make-sm-column(@columns; @gutter: @grid-gutter-width) { strangely enough, if pass code http://lesstester.com/ shows no error. what's going on? .mak...

Cygwin Git: The merge tool kdiff3 is not available -

i'm trying cygwin git installation working kdiff3. i followed noam lewis' instructions here: http://noamlewis.wordpress.com/2011/03/22/how-to-use-kdiff3-as-a-difftool-mergetool-with-cygwin-git/ but it's not working :( running git mergetool -t kdiff3 gives result: normal merge conflict ... {local}: modified file {remote}: modified file hit return start merge resolution tool (kdiff3): merge tool kdiff3 not available '~/kdiff3.sh' however, running ~/kdiff3.sh opens kdiff3 expected. here's .gitconfig: [diff] tool = kdiff3 [merge] tool = kdiff3 [mergetool "kdiff3"] path = ~/kdiff3.sh keepbackup = false trustexitcode = false kdiff3.sh #!/bin/sh result="" arg if [[ "" != "$arg" ]] && [[ -e $arg ]]; out=`cygpath -wa $arg` else out=$arg if [[ $arg == -* ]]; out=$arg else out=...

matlab - Deep learning toolbox -

i getting following error when using deeplearntoolbox . specifically, when executing file test_example_dbn.m ??? error: file: nneval.m line: 18 column: 17 unbalanced or unexpected parenthesis or bracket. error in ==> nntrain @ 66 loss = nneval(nn, loss, train_x, train_y); error in ==> test_example_dbn @ 38 nn = nntrain(nn, train_x, train_y, opts); the number of left parenthesis not equal number of right parenthesis in nneval.m line: 18. . may code clicking error message, , count number of left parentheses , right parentheses on line of code. edit i checked out nneval.m file github . what's matlab version? try change line 18 : [er_train, tmp] = nntest(nn, train_x, train_y); if input has 6 argument, change line 22 well: [er_val, tmp2] = nntest(nn, val_x, val_y); the error message should eliminated.

ios - Prototype UITableViewCell initialization -

earlier creating custom cells without prototype, custom class, register class reuse identifier uitableview , use that. in case, used: - (id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier , worked great (except uitableviewheaderfooterview, never knew frame though method called, frame 0 0 0 0 - that's not question here). now creating custom uitableviewcells using interface builder. created custom class, connected outlets interface builder custom class , i'v noticed - (id)initwithcoder:(nscoder *)adecoder being called , that's need modifications. but, wasn't able. that's init method being called, if try change font of label there, wont changed. tried round rect button not working (my button having frame 0 0 0 0 - not yet existing) in method. my question is, should modify things font, background color of elements created using prototype cells? (id)initwithcoder:(nscoder *)adecoder correct initializer. try th...

paypal - Looking for an escrow-type service that enables me to give the contributor more money back than they originally put in -

does know of payment-processing service (2checkout.com, braintree.com or transpact.com) or indeed method allow refund customer's payment, , pay them extra, cc or paypal account? "refund" confusing word here, let me explain: they pay €10 cc, pay them €16.66. so escrow-type system. 10 users set goal (there few goals choose from), , put €10 each escrow (pay cc or paypal). now there €100 in escrow. 4 users not complete goal, forfeit contribution. leaves €100 divided among 6. the remaining 6 users receive €16.66 each. is there way of paying each individual user completed goal initial sum + remainder of escrow / no. of users left? is service let 'compensate' customers instance? many thanks. that non-referenced credit , allows push funds credit cards without refunding original transaction, , can set amount whatever need. if has paypal accounts use pay api send money each 1 accordingly. if you're working php class library make simple...

unity3d - Unity 3D importing -

i used code in c# using xna saw unity 3d engine , downloaded latest version installed correctly started development of game when importing animated character unity 3d blocked pc ! noticed keyboard goes off when happened , cant move arrow or call task menager can restart pc ! brother , sisters me on way . model files placed in assets folder in unity project automatically imported , stored unity assets. a model file may contain 3d model, such character, building, or piece of furniture. model imported multiple assets. in project view main imported object model prefab. there several mesh objects referenced model prefab. a model file may contain animation data can used animate model or other models. animation data imported 1 or more animation clips.

java - variable not available despite public method -

the float targetvolume in created in public void method, cannot resolved in public void method... scheduletaskexecutor.scheduleatfixedrate(new runnable() { public void run() { float x = (float) math.random(); if (x < 0.5){ float targetvolume = 0; } else { float targetvolume = 1; } scheduletaskexecutor.scheduleatfixedrate(new runnable() { public void run() { if (targetvolume.equals (1)){ mp.setvolume(startingvolume+volumeincrement, startingvolume+volumeincrement); } else { mp.setvolume(startingvolume-volumeincrement, startingvolume-volumeincrement); } } }, 0, 1, timeunit.seconds); } }, 0, 5, timeunit.seconds); how can fix this? edit: can solve problem adding final modifier float: scheduletaskexecu...

Search Google for certain CMS platforms -

i use google search platforms. platform want search today big commerce. want list of websites using big commerce. i have found common ground between bigcommerce sites. if not use bigcommerce nameservers. have script in head tags http://cdn2.bigcommerce.com i have searched " http://cdn2.bigcommerce.com " don't many bigcommerce sites. how can set search query within google find sites use bigcommerce nameservers or have http://cdn2.bigcommerce.com within head tags? experiment search queries such as: inurl: http://cdn2.bigcommerce.com inanchor: http://cdn2.bigcommerce.com fashion inurl: http://cdn2.bigcommerce.com can combine inurl: or inanchor:, e.g., inurl: http://cdn2.bigcommerce.com or inanchor: http://cdn2.bigcommerce.com inurl: http://cdn2.bigcommerce.com | inurl: http://cdn.bigcommerce.com where or , | synonymous search either or , can contained within parentheses if queries complicated, e.g., (this or that) ("dog house*" | ...

git Save and Auto Use Merge Strategy Configuration for Specific Files -

i use git manage remote 'dev' environment common hosted solutions such wordpress. it's great, because can have sandbox, different custom themes, , kinds of goodies managed dynamically crafty dns , apache settings. i git fetch/pull every often, , have 2 files ahead of remote branch, , cause merge conflicts. .gitignore , .gitmodules . reasons being obvious, i'm extending software own customizations never remitted remote source repository. is there way can store ours merge conflict resolution on specific files? i'm guessing have custom settings in git config --local having trouble getting want. i'm approaching creating custom merge driver of own, , attempting use local config file auto-apply driver affected paths given (either in $local/config or .gitattributes # custom merge strategy handling specific files [core] resolveconflict = merge path = .gitignore path = .gitsubmodules #define custom merge driver [merge "ours"] ...

memory management - Does mlock prevent the page from appearing in a core dump? -

i have process sensitive memory must never written disk. i have requirement need core dumps satisfy first-time data capture requirements of client. does locking page using mlock() prevent page appearing in core dump? note, embedded system , don't have swap space. taken man 2 madvise : the madvise() system call advises kernel how handle paging input/output in address range beginning @ address addr , size length bytes. allows application tell kernel how expects use mapped or shared memory areas, kernel can choose appropriate read-ahead , caching techniques. call not influence semantics of application (except in case of madv_dontneed), may influence performance. kernel free ignore advice. particularly check option madv_dontdump : exclude core dump pages in range specified addr , length. useful in applications have large areas of memory known not useful in core dump. effect of madv_dontdump takes precedence on bit mask set via...

jersey - How to map exception for gwt-resty -

i using gwt-resty , jersey server side. problem have run how map exception methodcallback implementation. have created exceptionmapper converts exception json , returns in json format onfailure method giving me generic error message exception, "failed bad request" the question how convert exception gwt-resty can process exception in order message server side exception. here service implementation service.getcurrentaddress("123456", new methodcallback<address>() { @override public void onsuccess(method method, address response) { window.alert("got address" + response); } @override public void onfailure(method method, throwable e) { gwt.log("failed", e); gwt.log("failed " + e.getmessage()); } }); } here exception mapper. @provider public class vendorexceptionmapper implements exceptionmapper<exception> { @override ...

vb.net - retrieve int value from async task -

i have async task in separate project need call project im not sure how accomplish that. the async method is public async task<int> insertnewpasswordresetrequest(userpasswordreset upr) { string commandtext = "insert passwordresetrequests (reset_username, resettoken, resetrequesttime, resetrequesttimeout) values(@username,@rt,@rrt,@rrtout);"; var parameters = new dictionary<string, object>() { { "@username", upr.resetusername }, { "@rt", upr.resettoken }, { "@rrt", upr.resetrequesttime }, { "@rrtout", upr.resetrequesttimeout } }; return await task.fromresult( _database.execute(commandtext, parameters, false)); } i trying call project so dim success integer = prr.insertnewpasswordresetrequest(upr).fromresult() i know returning task how extract int value it? you can await of task if want run async dim success integer = ...

nullPointerException while linking jsp file to mysql -

http status 500 - internal server error type exception report messageinternal server error descriptionthe server encountered internal error prevented fulfilling request. exception org.apache.jasper.jasperexception: java.lang.nullpointerexception root cause java.lang.nullpointerexception note full stack traces of exception , root causes available in glassfish server open source edition 4.0 logs. glassfish server open source edition 4.0 i'm not able open stack trace. log file under domain empty. pls help nullpointerexception means trying call non-static method (or attribute) of object not defined. example: string s = "foo"; system.out.println(s.length()); this code prints 3, because length of foo 3, , s has been initialized foo . example nullpointerexception : string s = null; system.out.println(s.length()); here s null , try call method length() , non-static method. nullpointerexception : there no sense length of "no...

node.js - How to achieve rollback in transactions in mongo? -

i using mongoose on mongodb. in request , response nodejs express server, requires no of queries mongodb through mongoose. in many cases may happen, if first few queries executes , rest failed under transaction. now need rollback db state initial state of db. so how can rollback efficiently in mongodb? please provide suitable references. i agree hector. if need multiple document transactions mongo might not fit you. can embed data structure in single document? can rollback looking for. another option @ mongo clone tokumx provides transactions across multiple documents.

multithreading - Invoking For Loops VB.Net -

how invoke loop in vb.net? example: each listviewitem listviewitem in me.tasklistview.items me.executetask(listviewitem, false) next so needs invoked, how go that? not sure how. inside background worker handler , causes invalidoperationexception when inside it. information error is: "cross-thread operation not valid: control 'tasklistview' accessed thread other thread created on." the error occurs on line: each listviewitem listviewitem in me.tasklistview.items i overcome problems threads in winforms using following subroutine public sub guiasync(byval frm form, byval action action) if action isnot nothing if frm.invokerequired frm.invoke(action) else action() end if end if end sub i'd use follows (in case code runs in form , me reference form): guiasync(me, sub() each listviewitem listviewitem in me.tasklistview.items me.executetask(list...

Windows phone 7 facebook app authentication issue -

i have tested many facebook samples nothing seems work if target windows phone 7 platform.one of samples this one . copied files in new project targeting windows phone 7 when tap connect button , enter facebook username,password there icon of facebook application , description , no buttons permit or not permit application have access @ account. i tested facebook c# sdk sample windows phone 7 https://github.com/facebook-csharp-sdk/facebook-windows-phone-sample result same.if target windows phone 8 platform working. thanks in advance have tried this: http://facebooksdk.net/docs/phone/tutorial/ this may because works me.

lua - Floyd-Warshall path reconstruction -

i'm trying reconstruct least cost path between 2 vertices floyd-warshall algorithm implemented in lua. here i've written far: function shallow_copy(g) local h = {} k, v in pairs(g) h[k] = v end return h end function fw(g) -- g adjacency matrix representing graph local d = shaloow_copy(g) k = 1, #d = 1, #d j = 1, #d d[i][j] = math.min(d[i][j], d[i][k] + d[k][j]) end end end return d end these functions give me matrix containing length (number of edges) separating each pair of vertices in graph g, great. i need know actual path between given vertices. wikipedia conveniently provides pseudo code, -being newbie- i'm confuse how implement it. here pseudocode provided in wikipedia article ( https://en.wikipedia.org/wiki/floyd –warshall_algorithm#path_reconstruction): let dist |v| × |v| array of minimum distances initialized ∞ (infinity) let next |v| × |v| array of vert...

Backreferencing regex in apache -

i setting symfony framework system , configuring .htaccess file reroute requests when came across these 2 lines: rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1] this supposed give rewrite base proceeding rewrites. want know how $1 processed here since there no rewriterules preceding it? , clarification on how code works appreciated. the $1 last rule capture group. it's little confusing because of way rules processed mod_rewrite. given rule: rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1] this mod_rewrite does: i have uri, let's apply rule i @ rewriterule line , checks pattern: uri matches ^(.*), ok good, let's continue now let's check conditions the %{request_uri}::$1 string gets mapped out uri , first capture group, happened in step 2 the pattern in condition matches, apply target of rule the target - , pass uri through , apply flags so rule gets "halfway" appli...

maven dependency scope for mojo exec:java -

i want run local activemq broker jmeter tests with: mvn exec:java -pjmeterprofile i have deps in provided scope, causing java.lang.noclassdeffounderror, like <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.6.4</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>1.6.4</version> <scope>provided</scope> </dependency> <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>1.2.17</version> ...

Android - Update custom view from asynctask -

i have custom view class public class drawingview extends view { //drawing path private path drawpath; //drawing , canvas paint private paint drawpaint, canvaspaint; //initial color private int paintcolor = 0x00660000; ... public void printpoint(point p, boolean b){ if(p != null){ paint testepaint = new paint(); testepaint.setcolor(0xff0000ff); testepaint.setantialias(true); testepaint.setstrokewidth(brushsize); testepaint.setstyle(paint.style.stroke); testepaint.setstrokejoin(paint.join.round); testepaint.setstrokecap(paint.cap.round); if(b){ testepaint.setcolor(0xffff0000); }else{ testepaint.setcolor(0xff0000ff); } drawcanvas.drawpoint(p.x, p.y, testepaint); } } public void printpath(){ if(paths.size() > 0){ path testepath = new path(); paint testepaint = new paint(); testepaint.setcolor(0xff00ff00); testepaint.setant...

loops - Run a jmeter thread group every 5 minutes -

my jmeter test plan has thread group has csv config , 2 http requests i want able run thread group every 5 minutes performs csv config , 2 http requests every 5 minutes google search hasn't gave me info thanks suggestion barry update: benefit of others to solve problem uses test action sampler, follows: send first http request send second http request test action sampler - wait 5 minutes in milliseconds i put in thread group loops forever , sends 2 requests every 5 minutes does thread group contain single http request? well, add timer the thread group.

java - Run USSD Code in Android without using " Intent.ACTION_CALL" -

i creating app in android, required run ussd code in background. without send application in background, whenever using intent.action_call run ussd string encodedhash = uri.encode("#"); string ussd = "*123" + encodedhash; intent intent = new intent(intent.action_call, uri.parse("tel:" + ussd)); startactivity(intent); it send application in background, , open dialer interface on application. so possible run ussd code without open dialer interface in front. thanks in advance . it's kind of complex... need override default dialer. way skype does. how include application dialing option when calling addressbook? dial number without prompt

database - How much range Oracle Number(18) can store? -

i looking @ documentation number type in oracle db can store range 10 raise -130 10 raise 126. was wondering how many positive numbers field number(18) can store? integer numbers 18 digits (integers between -10^18+1 , 10^18-1 ) according oracle documentation , number datatype stores fixed , floating-point numbers. optionally, can specify precision (total number of digits) , scale (number of digits right of decimal point): number (precision, scale) if no scale specified, scale zero. in case, number(18) , specified precision of 18 digits , did not specify scale 0 used (no numbers after decimal point).

cannot move android widget to top or bottom of screen -

i have custom widget have shrinked 100dp x 100dp have issue widget can set in middle of screen , cannot put on bottom or on top of screen <?xml version="1.0" encoding="utf-8"?> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minwidth="75dp" android:minheight="75dp" android:updateperiodmillis="18000000" android:initiallayout="@layout/widget" android:resizemode="none"> </appwidget-provider> <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linerlay" android:layout_width="100dp" android:layout_height="100dp" android:background="@drawable/wid_bg" android:orientation="vertical"> <textview android:id=...

jquery - Fadeout not working in IE7/IE8 (have tried previously suggested fixes) -

after reading previous answers tried removing position:fixed , setting opacity 100 before fadeout, , adding display: inline-block nothing has worked far. here site: http://www.theseamstressofbloomsbury.co.uk/lookbook/ the element faded out has following css: #loading-wrapper { background: url(images/background.jpg) center top #eee9d1; height: 100%; width: 100%; position: fixed; z-index: 1000; text-align:center; color:#866a4b; } and jquery: $('#loading-wrapper').fadeout('slow'); related questions looked into: fadeout not working in ie7/ie8 jquery ie fadein , fadeout opacity does jquery's fadein() , fadeout() not work ie 8? any other tips? cheers!

c# - Backgroundworker Stops Working -

i have wpf project uses background workers interfaces external hardware (test & measure equipment, etc), write local files, , insert data database runs. program flow sequential, background workers in use keep gui accessible user, , chosen because haven't had issues using them before. take measurements, stuff, log, repeat. there status log on gui displays messages go. all of works beautifully hours on end, however, eventually, without fail, appears background worker used write database never calls dowork. backgroundworker dblogworker = new backgroundworker(); ... dblogworker.dowork += new doworkeventhandler(dblogworker_dowork); dblogworker.runworkercompleted += new runworkercompletedeventhandler( dblogworker_runworkercompleted); processscandata called when data has been retrieved 1 of pieces of hardware, setting property , firing generic property changed event (disclaimer: code everywhere investigating see whats going on): private void data_datas...

ios - Developing for iPad 1 on Xcode 5/Mavericks -

from can find out, ios 5.1 simulator isn't available on xcode 5/mavericks. wrong that? the issue i'm developing ipad application, , want run on ipad 1. i'd love target ios 7 , done it, unfortunately ipad 1 doesn't support past ios 5.1. there way target ios 5.1 yet able debug/test on xcode 5/mavericks? surely apps still support ipad 1 - there still lot of ipad 1's out there. since simulator isn't available, it's apple isn't letting me upgrade latest xcode , osx. others do? i'm hoping there's way eluding me! you correct, ios 5.1 simulator isn't available on xcode 5/mavericks. however, can still connect xcode real ipad 1 , develop way. bought used ipad 1 $100 purpose , it's working fine.

java - Logging in to pastebin using Jsoup -

i'm trying connect pastebin , login. when run this, html doesn't show have logged in , profile id isn't anywhere in script. response loginresponse; document cur = null; map<string, string> logincookies; loginresponse = jsoup.connect("http://www.pastebin.com/login.php") .data("user_name", name) .data("user_password", pwrd) .data("submit", "login") .method(method.post) .execute(); if (loginresponse != null) { logincookies = loginresponse.cookies(); try { cur = jsoup.connect("http://www.pastebin.com") .cookies(logincookies).get(); } catch (exception e) { e.printstacktrace(); } (map.entry<string, string> entry : logincookies.entryset()) { system.out.println(entry.getkey() + "/" + entry.get...

c# - ASP.net default login.aspx page missing images -

i using default asp.net web application in visual studio 2010. when starting site , going login page, missing of graphics. after logging in graphics return. i have tried adding exceptions path in web.config no luck. maybe have wrong path? using default styles. <authentication mode="forms"> <forms loginurl="~/account/login.aspx" timeout="2880" /> </authentication> <authorization> <deny users="?" /> </authorization> ... <location path="~/account/login.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> the site default new asp.net web application in visual studio 2010 plus in web.config it formatting/syntax issue. when allow access in web.config should be: <location path="styles"> not <location path="~/styles">

sql - MS Access "Invalid Procedure Call" matching first half of email address with email addresses from another table -

i'm running "invalid procedure call" when running below code on tables in access 2010 db working in access 2000 db. i didn't write code, know compairing text before '@' symbol love hear explanation of specific syntax looking @ here does: "left(nz(t1.username,''),instr(nz(t1.username,''),'@')-1) = left(nz(t2.email,''),instr(nz(t2.email,''),'@')-1) ))<>false));" select t1.id, t1.username email users t1 (((exists (select * license t2 left(nz(t1.username,''),instr(nz(t1.username,''),'@')-1) = left(nz(t2.email,''),instr(nz(t2.email,''),'@')-1) ))<>false)); nz(t1.username,'') returns blank string ('') if t1.username null. now, suppose t1.username aa.gmail.com then instr(nz(t1.username,''),'@')-1 3 - 1 = 2 so, left(nz(t1.username,''),instr(nz(t1.use...

osx - Matlab call to CPLEX seems to use A LOT of memory -

i have matlab function creates linear program , calls cplex solve it. right before call cplex.solve, total size of variables in workspace no more 200mb. however, when run function problems of moderate size, can see in activity monitor (i have mac) available memory drops 9gb down 0; returns around 8gb while cplex solving problem. large problem sizes, available memory goes 0, , starts swapping memory, unacceptable performance use-case. so seems there memory usage spike right matlab calls cplex. wondering if else out there has had problem , if there can done it. for reference, have imac 3.2 ghz intel core i5 , 16 gb 1600 mhz ddr3 memory. running os x 10.8.3, matlab r2013a, , cplex 12.5. thanks in advance help. please feel free ask clarifications. timmy

c# - How to programatically add watch in debugger -

you can programatically add break (debugger.break()) , in places means has gone wrong (instead of, or in addition throwing exceptions). in cases, programatically add watch variables. can done somehow? @ present best can come is object foo = someobjectiwanttowatch; this way, @ least have reference object want watch in code, can mouseover object see contents. hack , i'm hoping find better way. question edited: i have big application, asynchronous threads driven various system events, when goes wrong, want browse data structures in whole application, looking clues went wrong. @ top level, application launched (main()) creates object contain else hierarchically, , main() goes infinite loop. while (true) { thread.sleep(100); } so if application begins misbehaving reason, can put breakpoint there, , voila. can browse data structures in whole application. if have reference top level container object. can mouseover object , browse way - it's more convenient...

Relative imports with unittest in Python -

i trying use python unittest , relative imports, , can't seem figure out. know there lot of related questions, none of them have helped far. sorry if repetitive, appreciate help. trying use syntax pep 328 http://www.python.org/dev/peps/pep-0328/ must have wrong. my directory structure is: project/ __init__.py main_program.py lib/ __init__.py lib_a lib_b tests/ __init__.py test_a test_b i run tests using: python -m unittest test_module1 test_module2 test_a needs import both lib/lib_a , main_program. code test_a trying use import: from ..lib import lib_a lib ...project import main_program both raise error: valueerror: attempted relative import in non-package all of init .py files empty. any specific advice appreciated!! edit: this may answer: python packages? i'm still verifying if work. edit ii: to clarify, @ point have attempted run test file in 3 different ways: project/...

Fuzzy matching of words with phrases with ruby -

i want match bunch of data short number of services my data this {"title" : "blorb", "category" : "zurb" "description" : "massage manipulation of superficial , deeper layers of muscle , connective tissue using various techniques, enhance function, aid in healing process, decrease muscle reflex activity..." } and have match ["swedish massage", "haircut"] clearly "swedish massage" winner, running benchmark shows "haircut" is: require 'amatch' arr = [:levenshtein_similar, :hamming_similar, :pair_distance_similar, :longest_subsequence_similar, :longest_substring_similar, :jaro_similar, :jarowinkler_similar] arr.each |method| ["swedish massage", "haircut"].each |sh| pp ">>> #{sh} matched #{method.to_s}" pp sh.send(method, description) end end , nil result: ">>> swedish massage matched jaro_sim...

infinite loop - jQuery looping section of an animation - update: sample animation -

i trying loop sections of animation not having luck. have tried few suggestions other forum not seem work. can please give me few pointers. help. update : here sample animation on jsfiddle $(window).load(function() { $("#div1").animate({ "top": "0px" }, 2000, 'easeoutexpo'); $("#div2").animate({ "top": "0px" }, 2000, 'easeoutexpo', function() { $("#div3").animate({ "top": "0px" }, 2000, 'easeoutexpo'); $("#div4").animate({ "top": "0px" }, 2000, 'easeoutexpo'); // repeat here // !function repeat() { $("#div1").delay(5000).animate({ "top": "-300px" }, 2000, 'easeoutexpo'); $("#div5").delay(5000).animate({ "top": "-300px" }, 2000, 'easeoutexpo'); $("#div2").delay(10000).animate({ "top": "-300px" }, 2000, 'easeoutex...

Preparing Python program to be run in UNIX enviroment -

just starting using unix semester move programs repositories , curious how prep file run in enviroment... heres code: def main(file): ctest = 0 words = 0 lines = 0 chars = 0 l in open(str(file)): linewords = l.split() w in l: chars += 1 lines += 1 words += len(linewords) print("lines: " + str(lines)) print("characters: " + str(chars)) print("words: " + str(words)) in terms of functionality standpoint works fine when pointed on own system, is on unix being told run this.... python3 wc.py < file.txt how prepare file when executed in environment take text properly? fortunately not platform dependent. have read here or somewhere else import sys , read stdin : data = sys.stdin.readlines() but work begins: you should have executable entrance you should make script executable ( chmod +x yourfile.py ) you should make script start bash magic (the first l...

excel vba - How to parse an XML file and write in data then save it -

i working on following: an excel sheet cells end user asked enter required values; done code read values entered in these cells end users; load xml file; done parse , write values retrieved excel cells xml file (following rule) save it; stuck here! start application (another script use xml file values later). i simplify as possible: the excel file following example... cella cellb 1 t1 v1 2 t2 v2 3 t3 v3 4 t4 v4 5 t5 v5 6 t6 v6 "t" refers title. end user enter values v1, v2, ... v6 the xml file structured this: <?xml version="1.0" encoding="utf-8" standalone="no"?> <environment> <variable> <name></name> <caption>t1</caption> <type>text</type> <value>v1</value> <description></description> </variable> <variable> <n...

ember.js - Styling the Ember rootElement -

i've been banging head against on day , no amount of experimenting, google'ing, or stack overflow searching has helped. i'm developing ember/vert.x app has 1 ember route accepts "real-time" push-data via socksjs. working beautifully, including successful implementation of dynamic (ember) templates. what need ability set styles on rootelement (rootelement body). i've tried umpteen different approaches, including resorting jquery calls. nothing place style on body tag. can style attribute set on 1st div inside body tag doing: app.applicationview = ember.view.extend({ attributebindings: ['style'], style: "background-color: blue; background-image: url('" + app.currentprogram.backgroundimage + "')" }); this renders: <div id="ember325" class="ember-view" style="background-image: url('img/bg/1.png')">...</div> however, want style body tag dynamically. an...

jquery - How to find in javascript with regular expression string from url? -

good evening, how can find in javascript regular expression string url address example have url: http://www.odsavacky.cz/blog/wpcproduct/mikronebulizer/ , need string between last slashes (/ /) http://something.cz/something/string/ in example word need mikronebulizer. thank help. you use regex match group. use this: /([\w\-]+)\/$/.exec("http://www.odsavacky.cz/blog/wpcproduct/mikronebulizer/")[1]; here's jsfiddle showing in action this part: ([\w\-]+) means @ least 1 or more of set of alphanumeric, underscore , hyphen , use first match group. followed / and the: $ which means line should end this the .exec() returns array first value full match (ie: "mikronebulizer/") , each match group after that. so .exec()[1] returns value: mikronebulizer

Unable to start Riak CS? -

i unable start riak cs? in app.config riak, riak cs. i've replaced localhost ip address 127.0.0.1 0.0.0.0. riak running fine. "pong" response. riak cs says "node 'riak-cs@0.0.0.0' not responding pings." while http , protocol buffer interfaces can bind ip addresses defining 0.0.0.0 ip address, nodes need have name can resolved used when connecting nodes. riak-cs@0.0.0.0 therefore not work.

ruby on rails - Can't find production.log file in my server -

i deploying rails app ec2 using capistrano , works fine. except cannot find production.log or staging.log file in shared folder. i ran $ cap deploy:setup $ cap deploy:check $ cap deploy and both work fine. when ssh in instance log folder in my_application/current/log empty any idea? thanks ok solved removing app on server , running cap deploy:setup application owned root user , not write in log file