Posts

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*" | ...