Posts

Showing posts from September, 2014

mysql - How to run the PHP and/or CodeIgniter function continuously -

i working on location-based social networking website integrating foursquare . have used login foursquare, whenever user login foursquare account access token using data foursquare account large , takes lot of time. that's why looking solution retrieve foursquare data continuously in cycle. is there way run codeigniter or php function continuously update users data instead of updating data scheduled basic using cronjob , should run once run function run infinite time without stop. note: i using curl data foursquare thanks in advance! you can write simple php script following , run script scheduling in cron job , once script runs, delete cron tab (the script keep runing): while (true) { // setup curl request foursquare // fire curl request , results // processing // can put sleep here before again loops // here magic break infinite loop - check // variable database table or ini file , break loop // if variable set } hope helps...

.net - WMI instancename retrieved from performancecounter (for a network card) is not then accepted when used to retrieve counter value -

my basic problem want find total network io list of ip addresses. many of servers have different nics , have teamed nics. since seems need have exact name network interface instance have created array of instance names: dim category new performancecountercategory("network interface") dim instancenames string() = category.getinstancenames() i step through names , add list of performancecounter objects: each instancename in instancenames network.add(new performancecounter()) network(i) .categoryname = "network interface" .countername = "bytes total/sec" .instancename = instancename .machinename = ip_address end try network_usage = network_usage + network(i).nextvalue() catch ex exception end try = + 1 next the problem names generated first part of code raise e...

c# - Copy file from internal server to remote server in IIS 7 -

i have application written in c# after creating pdf file, needs save pdf file virtual folder in remote server. server in dmz , created 2 users in both servers same permissions. 2 servers not in same network. i'm able access dummy pdf file using string stempsourcefilespec = "https://servername/virtualfolder/dummy.pdf"; b = file bytes; //here write bytes system.io.file.writeallbytes(stempsourcefilespec, b) , i'm having problems when copying pdf file same virtual directory. user i'm using has full permissions on folder. this works internally when using \servername\folder\, doesn't work when try save remote virtual directory. thoughts? try convert virtualpath phyicalpath in handler, such system.web.httpserverutil.mappath http://asp.net.bigresource.com/uploading-files-to-server-and-saving-outside-virtual-path-bmvjftyf4.html#l9lpkwyji http://forums.iis.net/t/1157234.aspx

php - Form post not working in while loop result -

i'm pulling customer bookings database dependent upon date, seems working fine. decided add button within form, in table, send record invoicing page. seems work except first result in table. form post post invoicing page below first result, first result nothing, refresh page. when looking @ source code looks correct, isn't working if there 1 result or doesn't work first result, if there more one. need use other while loop? <?php $i=0; while ($i < $num) { $id = mysql_result($update4, $i, "id"); $booking_date = mysql_result($update4, $i, "booking_date"); $date = date("m/d/y", strtotime($booking_date)); $customer_name = mysql_result($update4, $i, "customer_name"); $customer_address = mysql_result($update4, $i, "customer_address"); $customer_city = mysql_result($update4, $i, "customer_city"); $starter1 = mysql_result($update4, $i, "start_time"); $starter = date("g:i a...

PHP-Submit a form to different pages according to variable values -

i wondering in php web page, like <form method = "post" action = ?> age: <input type = "text" name="age"> submit: <input type="submit"> </form> for example, if input age larger 18, go page: a.php; else goto b.php how can fulfil that, in current page or in next forwarding page? more specifically, if want in current page, what think action="function()", , inside function, judgement go a.php or b.php. correct way write action , function()? , saw using onclick="..." well, difference? if want in next page, we can write action="c.php" , judgement in c.php page. if so, how in c.php page? btw, way common used way? thanks, eve best way submit same page. <form method = "post" action = 'c.php'> age: <input type = "text" name="age"> submit: <input type="submit"> </form> in c.php ...

spring - Use an ApplicationContextListener or @PostConstruct to -

in 1 of our beans reading file based data in memory. would better applicationcontextlistener e.g. calling beans init() method, or adding @postconstruct init() method container automatically? you can use: 1. @postconstruct 2. initializingbean interface 3. <bean class="your bean class" init-method="your init method"/> attribute : init-method : name of custom initialization method invoke after setting bean properties. method must have no arguments, may throw exception. alternative implementing spring's initializingbean interface or marking method postconstruct annotation. they alternative: if program totally annotated go annotation, if xml go xml (i don't mixing , don't need ask if implements feature annot or xml) edit: context listener: called every context refresh (usually once, @ startup) initializingbean or @postconstruct : apply bean's lifecycle called every time bean created (depends scope) in case us...

common lisp - How to insert multiple records at once using the clsql provided FDML -

is there way of using given fdml interface insert multiple records @ once? the given insert-record statement can handle 1 value tuple @ once , idea of calling function uncountable times, instead of once bugging me quite bit, , guess (without having done profiling) not fastest approach either. how this? ; slime 2013-04-02 cl-user> (ql:quickload "clsql") load "clsql": load 1 asdf system: uffi install 1 quicklisp release: clsql ; fetching #<url "http://beta.quicklisp.org/archive/clsql/2013-04-20/clsql-20130420-git.tgz"> ; 900.99kb ================================================== 922,610 bytes in 1.92 seconds (468.78kb/sec) ; loading "clsql" [package uffi].................................... [package cmucl-compat]............................ [package clsql-sys]............................... [package clsql]................................... [package clsql-user].............................. .....................

git - How to push Drafts to Gerrit? -

i unable push drafts gerrit. when try push drafts gerrit throwing following error. [3:37pm] [myrepo] -> git push origin head:refs/drafts/remote counting objects: 167, done. delta compression using 8 threads. compressing objects: 100% (80/80), done. writing objects: 100% (124/124), 58.19 kib, done. total 124 (delta 75), reused 47 (delta 32) remote: resolving deltas: 34% (26/75) to ssh://myrepo ! [remote rejected] head -> refs/drafts/remote(prohibited gerrit) error: failed push refs 'ssh://myrepo' can 1 me out in issue? use command: git push --receive-pack="git receive-pack" origin {commit sha-1 or head}:refs/drafts/{branch} a general rule push gerrit, branch = master: git push origin <a_local_branch_name or specific_commit or head>:refs/for/master a general rule push gerrit draft, branch = master: git push origin <a_local_branch_name or specific_commit or head>:refs/drafts/...

outlook - mailitem.Save The operation cannot be completed because the objct has been deleted -

i'm trying make copy of mailitem, move copy different location , add custom item property it. after add custom property, item wont save , crash error mentionned above. here's code, me figure out please! dim objcopieditem, objcontrolitem set objcopieditem = item.copy call objcopieditem.move(objpstfolder) dim property1 : set property1 = getmigrationproperty(objcopieditem.itemproperties) if property1 nothing set property1 = objcopieditem.itemproperties.add("migration id", 1) property1.value = item.entryid objcopieditem.save else property1.value = item.entryid objcopieditem.save end if the error occurs @ objcopieditem.save, operation works without problems if add properties original item , copy/move , new item, delete property on original item. move function returns new item, not sub: set objcopieditem = item.move(objpstfolder)

Foundation and AngularJS -

i modifying application using zurb's foundation framework responsiveness , angularjs. there bug data displayed in table <tr ng-repeat="obj in entries">...</tr> has <td> 's hidden/shown based on foundation's responsive rules. unfortunately, when angular model updated, foundation doesn't re-flow newly rendered dom. i have tried using $(document).foundation('table') found in extensive google searching, didn't trigger reflow of responsive collapsed table. added directive trigger simple $(window).trigger('resize') works first call, subsequent calls not. anybody else run this? you mixing 2 technologies dont play nice together. the js assets provided zurb foundation inevitably have conflicts digest cycle in angularjs. reason --- angular-bootstrap projects emerged transform jquery plugins angularjs directives. http://angular-ui.github.io/bootstrap/ i don't believe same level of support, "if any...

vba - How to split Full Name field into First Name, Last Name and Middle Initial? -

i have table field called patrn name set first_name, last_name m.i. examples: smith, james m jones, chris j. anderson, wendy l how can break field 3 different fields called first_name, last_name, , mi ? tried running query last_name: [patrn name]" & ", " last name didn't results. didn't design table way realize wasn't smart make full field name without individual field names; i'm in charge of fixing it. consider whether can bend split function will. here example immediate window session. patrn_name = "smith, james m" ? patrn_name smith, james m ? split(patrn_name, ",")(0) smith ? trim(split(patrn_name, ",")(1)) james m ? split(trim(split(patrn_name, ",")(1)), " ")(0) james ? split(trim(split(patrn_name, ",")(1)), " ")(1) m you can't use split() in query directly. build 1 or more user-defined functions , call udf(s) query. that a...

jquery - Resizing browser stops width:100% background over css -

my website www.onlinemoviesbox.com having slight css issue. when resize(make browser width smaller) vertical scrollbar appears , if scroll right see header background corrupts , not continue(black background). went on lots of similar questions , wasn't able fix issue similar answers. tried removing header div width pixels percentage , didn't work. i'd happy if me fix header no matter how resize , scroll have background continued. thanks i see on page's html: <div class="topheader" style="width:100%;background:#000;"> it looks width:100% problem there. try setting min-width there too, width horizontal scrollbar first appears.

objective c - NSNotification sent once, but is received multiple times -

i communicating between 2 classes nsnotificationcenter. problem although tap button once (and button fires off once) unintentionally producing increasing numbers of notifications 1 call nsnotificationcenter. here better explanation of problem, code: my 2 classes mainview class , menu class. when view in mainview class tapped, launches view created , governed menu class. code called when mainview initialized: menu=[[mymenu alloc] init]; uitapgesturerecognizer * tap=[[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(ontapped:)]; [tap setnumberoftapsrequired:1]; [container addgesturerecognizer:tap]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(onchangeitem:) name:@"itemchange" object:nil]; this gesture recognizer fires off method, in mainview class: - (void) ontapped: (uigesturerecognizer*) recognizer { nslog(@"tap"); [menu displaymenu]; } this how menu class initializes: - (mymenu*) in...

What type of copy does the default java.lang.Object.clone() method perform -

i new java can 1 tell me please. shallow copy : primitive types , references copied deep copy : objects copied recursively there no default implementation clone() you can @ documentation clone() : the method clone class object performs specific cloning operation. first, if class of object not implement interface cloneable , clonenotsupportedexception thrown. note arrays considered implement interface cloneable , return type of clone method of array type t[] t[] t reference or primitive type. otherwise, method creates new instance of class of object , initializes fields contents of corresponding fields of object, if assignment; contents of fields not cloned. thus, method performs "shallow copy" of object, not "deep copy" operation.

php - JOIN Query for Specific Table -

i have following tables: login iduser (int) username (var) pass (var) photos idphoto (int) title (var) iduser (int) following iduser (int) followingid (int) i trying create query fetches 'photos' people following. so far, have created query grabs 'photos' across service: $query = "select idphoto, title, l.iduser, username photos p join following login l on (l.iduser = p.iduser) following.followingid = following.userid order idphoto desc limit 50; any appreciated. select p.*, l.iduser, l.username following f left join login l on f.followingid = l.iduser left join photos p on p.iduser = l.iduser f.iduser = 1 limit 50 this should fetch photos of people followed user id = 1 in example.

android - How to display fragment *over* tabulation setup as Play Store Settings does? -

my application has 3 main screens (1 fragment each) presented in action bar compat navigation_mode_tabs . from action bar , menu, user able reach settings, profile, credit card etc. which less used functionality. feel (from android guidelines) should not regrouped inside 4th tabulation (as currently). how display less-used fragments similar feeling way google play creates , displays screen settings (leaving tabs mode)? need secondary activity? can stay in same activity (best case me) , how? create second activity, can show other fragments. can put flag in intent, need startactivity() method, can check fragment should shown in otheractivity. navigation need edit manifest this, set activity hirarchy: <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/mytheme" > <activity android:name="com.test.activitymain" ...

ssis - Changed MaximumErrorCount to 9999 but still getting an error that says it is set to 1 -

i running sql task, though whenever runs stops , gives me error: "...the number of errors raised (50) reached maximum allowed (1); resulting in failure" despite fact set maximumerrorcount in properties , other tasks in package 9999. gives? the package fail if tasks have maximumerrorcount set 9999 package needs maximumerrorcount set higher number other 1. if package has maximumerrorcount property set higher number, can return success result if tasks inside fail. be sure if task expected fail, dependent task use precendence constraint completion value rather success value, if want them run after 1st task attempted.

How to add two matrices in c++ -

i write class , have problem adding matrices. know have overload operator +, don't know how exactly. ideas ? class cmatrix { private: int rows; int columns; float* pdata; public: cmatrix(void); cmatrix(int rows, int columns); void setelement(int row, int column, float element); float getelement(int row, int column); ...}; istream& operator>>(istream& in, cmatrix& matrix) { in >> matrix.rows; in >> matrix.columns; for(int = 0; < matrix.rows; i++) for(int j = 0; j < matrix.columns; j++) in >> *(matrix.pdata + * matrix.columns + j); return in; } cmatrix::cmatrix(int rows, int columns) { rows = rows; columns = columns; pdata = new float[rows * columns]; float* pend = &pdata[rows * columns]; for(float* p = pdata; p < pend; p++) *p = 0.0; } ...

java - apache httpclient doesn't set basic authentication credentials -

have @ following code: defaulthttpclient http = new defaulthttpclient(); http.getcredentialsprovider().setcredentials( new authscope(authscope.any_host, authscope.any_port), new usernamepasswordcredentials( configuration.username, configuration.developerkey ) ); httppost post = new httppost(strurl); stringentity entity = new stringentity( ac.toxmlstring() ); entity.setcontenttype("text/xml"); post.setentity( entity ); org.apache.http.httpresponse response = http.execute( post ); it produces no errors. response server "no authorization header". checking request wireshark unveils there indeed no basic authentication set. how possible? okay, default basic authentication turned off. however, enabling far complicated ( link ) . therefor...

php - WordPress Gravity forms with pretty url (url rewrite) on IIS7 -

we have issue wordpress instance running on iis 7 server. gravity forms used ask user there information. when fill gravity form information entered user works charm. though, when information prefilled in gravity form using parameters ?param1=1&param2=2 result no entry in database. if disable wordpress pretty urls , add paramaters again url form works again. so, concluded has something rewrite rules. far our current analysis goes (and knowledge on iis's behavior on rewrite rules). i added current web.config bellow. hope can give hand. <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <httperrors errormode="detailed"> </httperrors> <rewrite> <rules> <rule name="wordpress" patternsyntax="wildcard"> <match url="*"/> <conditions> <a...

c++ - controlling paintGL method - How to decide what to paint? -

i want control paintgl method keypress-event. aim show additional point pushing return. in other words: have painted nice background scene , want push return (in lineedit) , there appears red point in front of shown background. //mainwindow.cpp mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); glwidget = new glwidget; connect(ui->lineedit, signal(returnpressed()), glwidget, slot (set_draw())); } //glwidget.h #ifndef glwidget_h #define glwidget_h #include <qglwidget> #include <qmessagebox> #include "mainwindow.h" #include "cstdio" class mainwindow; class glwidget : public qglwidget { q_object mainwindow *mymainwindow; public: glwidget(qwidget *parent = 0); //~glwidget; int draw; void initializegl(); void paintgl(); void resizegl(int w, int h); public slots: void set_draw(); }; #endif // glwidget_h //glwidget.cpp gl...

popup - Overlay two Silverlight apps -

i wondering if possible have 2 silverlight apps overlway each other. have silverlightapp1 take whole browser window, silverlightapp2 show popup in center of window modal transparent background. silverlightapp2 take window space (to act modal , block access silverlightapp1), since background transparent act modal , have main container element accessible. is possible? i kind able achieve not transparency part of it... i know there easier solutions this, working inside existing silverlight application (which silverlightapp1 above) don't have ability modify much, html containing app. thank you! you try make modal javascript window overlays div of silverlightapp1 , place silverlightapp2 on it. maybe should make silverlightapp2 not take window space , make transparent/modal part div. i think work.

apache - Nutch 2.x No errors, No results neither -

i've been playing nutch 2.x awhile, have set according nutch 2.x tutorial advised in this post , still can't figure out - appreciated. when using inject command per tutorial, injects 2 urls have in seeds.txt: nutch inject ../local/urls/seed.txt but when running script doesn't visit of urls: bin/crawl ../local/urls/seed.txt testcrawl *ttp://l*calhost:8983/solr 2 i've started again complete new install of nutch 2.2.1 - hbase-0.94.10 , solr 4.4.0 advised vy on mailinglist, due versions mentioned in tutorial years old, , error i'm getting is: [root@localhost local]# bin/nutch inject /urls/seed.txt injectorjob: starting @ 2013-08-11 17:59:32 injectorjob: injecting urldir: /urls/seed.txt injectorjob: org.apache.gora.util.goraexception: java.lang.runtimeexception: java.lang.illegalargumentexception: not host:port pair: �2249@localhost.localdomainlocalhost,45431,1376235201648

.htaccess - Correct RegEx to avoid infinte loop using RewriteRule to redirect 301 -

i trying tell server redirect following requests: http://example.es http://example.es/ http://example.es/es http://example.es/es/ http://www.example.es http://www.example.es/ http://www.example.es/es to page: http://www.example.es/es/ in order have following in .htaccess #rewriteengine on # turn on rewriting engine rewritebase / rewritecond %{http_host} ^(\.?example\.es(/|/es|/es/)?|www\.?example\.es(/|/es)?)$ [nc] rewriterule ^(.*)$ http://www.example.es/es/ [r=301,l] the problem causes infinite redirects since wanted url http://www.example.com/es/ has http_host string within. thing cannot find accurate regular expression avoid problem. the rest of .htaccess goes follows: php_flag register_long_arrays on php_flag register_globals on addoutputfilterbytype deflate text/html text/plain text/xml text/css javascript application/javascript expiresactive on expiresbytype text/css "access plus 1 years" expiresbytype image/png "access plus 1 years" e...

angularjs - Angular form validation won't trigger -

i'm trying form validation on -url removed- trigger when submit , it's not. believe have things setup correctly missing something. looks angularjs requires model bound on input use validation. see http://jsfiddle.net/adamdbradley/qdk5m/ try removing ng-model="email", run, , you'll notice validation no longer works. <input type="email" id="inputemail" placeholder="email" ng-model="email" required> vs <input type="email" id="inputemail" placeholder="email" required>

powershell - How to add a column of incrementing values to cmdlet output? -

suppose call get-service , want assign new column id cmdlet output prints incrementing integers that: id status name displayname -- ------ ---- ----------- 0 running adobearmservice adobe acrobat update service 1 stopped aelookupsvc application experience 2 stopped alg application layer gateway service i'm trying use select-object right add column, don't quite understand how iterate variable in sort of expression. here's i've got: get-service | select-object @{ name = "id" ; expression= { } }, status, name, displayname | format-table -autosize is there way iterate integers within expression= { } , or going problem wrong way? you can way, though need maintain counter variable outside of main expression. $counter = 0 get-service | select-object @{ name = "id" ; expression= {$global:counter; $global:coun...

insert NaNs where needed in matlab -

i have following 3 vectors , want insert nans b a misses data points in an . bn should [0.1;0.2;0.3;nan;nan;0.6;0.7] . how can bn? thanks.--jackie a=[1;2;3;6;7]; an=[1;2;3;4;5;6;7]; b=[0.1;0.2;0.3;0.6;0.7]; okay first off, cant store string 'nan' 1 cell of matrix, must stored cell array. code snip below gives solution, if cell array okay output. please let me know questions or concerns might have. forget italic parts, david k. % nan solution jackie a=[1;2;3;6;7]; an=[1;2;3;4;5;6;7]; b=[0.1;0.2;0.3;0.6;0.7]; len = max(length(a),length(an)) bn = zeros(len,1); k = 0; % adjust index don't call b outside of size =1 :len ind= a(an(i)==a); if isempty(ind) ==1 bn(i) = nan(1,1) k = k+1; else bn(i) = b(i-k) end end

javascript - Window.Open() is Modifying the page Layout on Internet Explorer -

i have page in asp.net called home.aspx . uses masterpage , have button calling: response.write("<script> window.open('page2.aspx','_blank'); </script>") result: new tab open page2.aspx , if return home.aspx , page layout modified, central <div> moved left of page. what can solve problem? remember occurring on internet explorer, firefox works normally! thanks lot. not going merit on why doing that, response.write killing html/css/js output in home.aspx page , preventing loading properly. try using: scriptmanager.registerstartupscript(typeof(page), "openpage2", "window.open('page2.aspx','_blank');", true); instead of response.write, page loads open window.

devkit - Mule EE jars command populate_m2_repo needs %MULE_HOME% env variable set in windows -

when running populate_m2_repo c:\users\me.m2\repository asked %mule_home% set. typically on computer have more 1 standalone version available testing inconvenient keep changing variable every time new standalone comes out. can explain why populate_m2_repo needs %mule_home% set? thanks ever since mule 3.1.0 recommended not set system wide %mule_home%, since mule.bat script set when not available. that said populate_m2_repo needs know find artifact need installed. hth

css - Animate single element on background -

what efficient way change walk signals on header image on http://www.daniellmusic.com red green. think there'd more efficient way change backgrounds since i'm changing small percentage of it. newbie self appreciated.also, it's wordpress site if makes difference. thank in advance! recreated background image signals transparent, you'll need use png or gif. use background-color css property change color, leaving background-image untouched. .bg { background-color: red; background-image: url('...'); } .bg:hover { background-color: green; }

decimal - Get daily average for specific date range SQL Server -

thanks in advance!! here have far: i selecting total amount of tasks person specific owner given date range. trying exact daily average number of tasks each person. the problem having keeps returning .00 on end of average, rather exact average. example, person may have 2 tasks in week; getting 0.00 average rather 0.28 or 0.29 select convert(nvarchar, count(p.personid)) count, convert(decimal(4, 2), count(p.personid) / datediff(day, @startdate, @enddate)) average, p.personid, p.firstname, p.lastname, c.companyname tasks t join person p on p.personid = t.personid join client c on c.id = p.employer join commission m on m.clientid = c.id t.created between @startdate , @enddate , m.owner in ('john doe') group p.personid, p.firstname, p.lastname, c.companyname order c.companyname, count desc be aware if enddate , startdate identical division 0 error. your problem count(p.personid) , datediff(day,@startdate,@en...

Current Time in DateTime PHP -

is correct way current time in php using datetime? $currenttime = new datetime(); $currenttime2 = $currenttime->format('h:i:s'); i believe can this $date = date('y-m-d h:i:s');

c++ - What is the proper order of initialization of OpenGL inside a QT GraphicsScene? -

the following qt sample straightforward : i'm trying find out why texture shows if application gets timed messagebox. i'm using qt4.8.1 , tried both under linux , vs2008. #include "ui_qtgltest.h" #include <qtgui/qapplication> #include <qtgui/qmainwindow> #include <qgraphicspixmapitem> #include <qgraphicsscene> #include <qglwidget> #include <qmessagebox> #include <qdebug> #include <qtimer> class glitem : public qgraphicspixmapitem // item issue opengl commands { gluint texture[1] ; glsizei w, h; public: glitem(qgraphicsitem *parent = null) : qgraphicspixmapitem(parent){ // when following line commented out, texture doesn't show up. qmessagebox::warning(null,qstring("???"),qstring("hold on second") ); qimage img( "im0.png" ) ; qimage gl_formatted_image; gl_formatted_image = qglwidget::converttoglformat(img); w = gl_f...

c# - ASP.NET for Windows Mobile Screen Size -

i'm developing site needs display nicely on windows mobile device. reason, standard <div> on page scrolls out view entire page, despite contents being in top left corner. there way have screen zoom particular portion of page automatically? have tried set width , height atributes of div element? like: <div style="width:250px; height: 250px;">content</div> p.s.: imo responsive design best option.

javascript - How to do a document.write to load a script without overwriting the whole page -

this question has answer here: what alternatives document.write? 10 answers load scripts after page has loaded? 8 answers i executing code in browser (chrome) through url bar. document.write('<script src=http://example.com/example.js></script>') when executed on page, overwrites , places: <script src=http://example.com/example.js></script> source code of page , launches .js script. question is, possible launch .js script without overwriting entire page small amount of code? if how? try creating script element in javascript during body's onload handler, , append script element created document.

c++ - boost interprocess mutex in managed_shared_memory -

i have thread in process 1 create boost::interprocess::managed_shared_memory segment. in segment allocate boost::interprocess::deque using custom allocator , create boost::interprocess::interprocess_mutex , 2 boost::interprocess::interprocess_condition variables using default allocator. use find_or_construct method create these. i have process (process 2) opens these using find method on boost::interprocess::managed_shared_memory segment have opened in process 2. i understand managed_shared_memory segments have kernel or filesystem persistency , interprocess_mutex/interprocess_condition variables have process level persistency. the scenario getting stuck. 1) process 1 starts thread creates everything. 2) process 2 starts , opens everything, @ stage shared memory , synchronization working well. 3) process 1 restarts thread tries create again (i believe shouldnt though using find_or_construct) 4) process 2 stuck on wait call condition variable though thread in process 1...

csv - spring batch: Dump a set of queries over a database in parallel to flat files -

so scenario drilled down essence follows: essentially, have config file containing set of sql queries result sets need exported csv files. since queries may return billions of rows, , because may interrupt process (bug, crash, ...), want use framework such spring batch, gives me restartabilty , job monitoring. using file based h2 database persisting spring batch jobs. so, here questions: upon creating job, need provide rowmapper initial configuration. happens when job needs restarted after e.g. crash? concretly: is state of rowmapper automatically persisted, , upon restart spring batch try restore object database, or will rowmapper object used part of original spring batch xml config file, or i have maintain rowmapper's state using step's/job's executioncontext? above question related whether there magic going on when using spring batch xml configuration, or whether create these beans in programmatic way: since need parse own config format spring batch job c...

javascript - Check each item of one array for matches in another array -

i trying program word game player types words he/she finds text box , hits submit. after hitting submit, word stored in array can in javascript, , textbox cleared can enter word. think can figure parts out (i new html , javascript), have no idea how want next. need check each of words player found against array of verified words. have found codes on here search whether single word matches strings array, how write code checks of words player finds against dictionary/verified array? you can iterate on every element in user array , use indexof see if exists in verified array. indexof return -1 if not found. for (var = 0; < userarray.length ; i++) if(verifiedwordarray.indexof(userarray[i]) == -1) return false; return true; if have match specific position, trick assuming both of same length. for (var = 0; < userarray.length ; i++) if(userarray[i] != verifiedwordarray[i]) return false; return true;

javascript - Synchronize 2 Select Boxes -

i have 2 select boxes: <select name="county" id="countyselect"> <option value="dixie">dixie</option> <option value="hernando">hernando</option> <option value="holmes">holmes</option> <option value="jackson">jackson</option> <option value="liberty">liberty</option> <option value="putnam">putnam</option> </select> <select name="site" id="siteselect"> <option value="florahome">florahome</option> <option value="green swamp">green swamp</option> <option value="ne jackson county">ne jackson county</option> <option value="n holmes county">n holmes county</option> <option value="s liberty county">s liberty county</option> <option value="suwannee">suwannee</option...

html - JQuery - Autocomplete and dynamic inputs -

my page creates multiple rows 3 text inputs in each. functions add , remove fields works correctly. i need after user typing in code, search database , change value of field name. the problem works on first line, , not work each field created. customer can add many lines want, after sending php file create csv file information. html <div id="campos"> <table border="0" cellpadding="2" cellspacing="4"> <tr> <td> excluir </td> <td align="center"> codigo no bag: </td> <td> nome comum: </td> <td> quantidade de registros: </td> </tr> <tr class="linhas"> <td> <a href="#" class="removercampo" title="r...

seekbar - android - cant put thumb on center of a seek bar -

Image
i want know how set thumb @ center of seekbar. don't know how express, i'll add link of pic. first img seekbar design guides, , belows seekbars. (ignore corners. fixed after capturing imgs.) @ first, designer, got 2 separate img of text, , bad. combined those. thought work thumb. got these result... please me.. thank you! drawable : progressbar_goodbad xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <gradient android:startcolor="#f5c0bd" android:centercolor="#f5c0bd" android:centery="0.75" android:endcolor="#f5c0bd" android:angle="270"/> <padding android:left="10dp" android:top="1dp" android:right="10...

set - Python - Iterating through two files to create a new file that has fields from second file appended to fields of first file -

new python attempted use logic answers in @mgilson , @endolith , , @zackbloom zack's example i getting bunch of blank columns placed in front of first field of primary record. my out_file empty (more because of columns 2 files cannot match up. how can fix this? end result should following: ('pudo_id','load_id','carrier_id','pudo_from_company','pudoitem_id';'pudo_id';'pudoitem_make') ('1','1','14','fmh material handling solutions','1','1','crown','tr3520 / twr3520','tuggers') ('2','2','7','wiese usa','2','2','cat','ndc100','3','2','cat','ndc100','4','2',' 2 batteries') note: in output of 3rd row, appended 3 rows sub file array, while first 2 rows appended 1 row sub file. determined value in pri[0] , sub[1] co...

c++ - Defining Global Variables Between Two .cpp Files -

how can share/globalize bool variable between a.cpp , b.cpp neither of them include other ones .h file?? have other joint header files not each other's. can define global variables inside shared headers? thanks can define global variables inside shared headers? no. in a.cpp (or) b.cpp write, int gvariable = 10; remember write above definition in 1 source file or else linker complain of multiple symbols if write in both source files. and in common header of a.cpp, b.cpp write, extern int gvariable;

php - Google stacked column chart giving an error -

hi trying google stacked column charts. getting following error not able solve it. error "uncaught typeerror: cannot read property 'type' of null " here code <html> <head> <title></title> </head> <?php $con=mysql_connect("localhost","root", "innernet") or die("failed connect database!!!!"); mysql_select_db("mobiledb", $con); $user= $_get['user']; //echo $user; $response["cols"] = array(); // $news = array(); //$news["id"] = ""; //$news["label"] = "id"; //$news["type"] = "string"; //array_push($response["cols"], $news); array_push($response["cols"], $news); $news = array(); ...

Using R, how to find the line number of a specific phrase in a file without opening the file? -

i new r. have large (3.2 gb) txt file containing 2 columns. first column has human genome sequence position , second column has value corresponding each position. want find line numbers specific positions first column , read lines table in r. cannot import file because of memory issue. here example of r code tried line number of 1 specific position first column of data file. data file called my.data. con <- file("my.data",open="r"); grep("13108", con) grep not work. i appreciate if can tell me correct code. try along lines of: read.csv(pipe("grep 13108 my.data"), ...) (fill parameters appropriately data)

parsing - Accept and parse information from email -

what accomplish user able send email designated email address. once email has been obtained, run script parses body section of email , carries out various tasks information provided in email (the data coming in email structured in xml type format). in mind seems simple task accomplish i'm not familiar inner workings of email. questions are: how know once email has been obtained sender can processed? how can use php obtain text found in email? i agree other responses, piping php application should first option (if mail server , php same) otherwise if have external mail server need poll email address @ regular intervals , check new emails. extracting plain text body email message not hard, getting attachments can pain sometimes. you need use cronjob trigger script @ regular intervals to fetch email server , parse it, have used php imap functions http://php.net/manual/en/book.imap.php you can use 3rd party services mandrillapp receive message, break parts...

runtime - My 4 python loops take too long -

this code taking long finish. did know make work , left running hour. trying solve problem: let a, b, c, , n positive integers. if a+b+c = 19*97 , a+n = b-n = c/n compute value of a. here code: from itertools import * import gc gc.disable() a_list = [] ah = 0 b_num = 0 c_num = 0 number_of_solutions = 0 a, b, c, n in product(range(1, 19*97), repeat=4): if a+b+c == 19*97 , a+n == b-n , b-n == c/n , a+n == c/n: a_num = b_num = b c_num = c a_list.append(a) number_of_solutions = number_of_solutions + 1 else: pass print a_num+b_num+c_num print a_list print number_of_solutions please help! thanks! brute-forcing possible combinations inefficient. instead, algebra. eliminate variables. (a+n) + (b-n) == (c/n) + (c/n) a+b == 2*c/n a+b+c == 2*c/n + c == 19*97 c*(2+n) == 19*97*n since a+n == c/n , a , b , c , , n positive integers, c multiple of n , so (2+n) * (c/n) == 19*97 (2+...

python - Is it possible to get a Flowable's coordinate position once it's rendered using ReportLab.platypus? -

my main goal have image flowables on page act though clickable links. in order this, create canvas.linkrect() , place on rendered image. here's example of how use canvas.linkrect(): canvas.linkurl( url='url_goes_here', rect=(x1, y1, x2, y2), #(x1, y1) bottom left coordinate of rectangle, (x2, y2) top right thickness=0, relative=1 ) after looking in basedoctemplate class, found method called afterflowable(self, flowable). overrode method , called dir() on flowable passed in, resulting in this: ['__call__', '__doc__', '__init__', '__module__', '_doctemplateattr', '_drawon', '_fixedheight', '_fixedwidth', '_framename', '_halignadjust', '_showboundary', '_traceinfo', 'action', 'apply', 'draw', 'drawon', 'encoding', 'getkeepwithnext', 'getspaceafter', 'getspacebefore', 'halign', 'height...

zurb foundation - How to make this photoshop ribbon navigation work and be responsive? -

i found awesome ribbon navigation i'd use photoshop file, no code or anything. @ first thought, i'll able figure out think might way above skill level. i'm designing site responsive using foundation. if has idea on how make work or similar kind work, that'd awesome. going drop whole thing (after customized it) in image , take cheap way out , image map that's not going work. i'd love little tag drop down when hover on parent (luckily, have 1 drop down menu in nav need) , ribbon raise (simple hover image?). anyways, if short answer "you're crazy, try else" that's totally fine. i'd rather responsive , work gerry-rigged. http://www.designkindle.com/2010/10/28/elegant-ribbon-menu/ you should able not image map. wanted animation occur when hover on part of ribbon may need use flash or silverlight (that project in itself). gifs might work though. image map. have never attempted myself may have project -- use jquery heavily.

php - No POST data in jquery ajax call -

i've been trying post data controller lightbox using ajax of course doesn't work. i have 2 select lists, both populated default controller. when select value , click submit have error box briefly flash disappear again. using firebug network tab can see post request under post tab there's no data. must doing wrong in javascript me looks ok , googling didn't suggest alternative worked. here's code... <body style="background-color: #f0f0f0;"> <div style="margin: 5px;"> <div id="ajax-login-register"> <div id="login-box"> <div style="text-align: center; font-weight: bold; font-size: 20px; margin: 10px 0 20px 0; border-bottom: #ccc 2px dashed; padding-bottom: 12px;"><?=lang('login')?></div> <form id="login-form"> <select name="currency_sel" id="brand_country" class="form_select_200px...

objective c - How to silence 'Expected a type' Xcode compiler warnings? -

this question has answer here: forward-declare enum in objective-c 5 answers is there way silence xcode compiler warnings because of unknown types @class? defined type in single .h file can reused throughout app: #ifndef apsiape_interfacedefinitions_h #define apsiape_interfacedefinitions_h #define color_alert_red [uicolor colorwithred:1 green:0.3 blue:0.3 alpha:1] ... typedef enum { byedgetypenone = 0, byedgetypetop, byedgetypeleft, byedgetypebottom, byedgetyperight } byedgetype; #endif and 1 of classes uses byedgetype type custom protocol in .h file: #import <uikit/uikit.h> @protocol bypullscrollviewdelegate <nsobject> - (void)pullscrollview:(uiscrollview*)pullscrollview didscrolltopage:(nsinteger)page; - (void)pullscrollview:(uiscrollview*)pullscrollview diddetectpullingatedge:(byedgetype)edge; @end i want interfacede...

Return an array of Pairs which have the same length as the input array of Strings. (Java) -

i want create class return array of pairs have same length input array of strings. in addition, pair should have first letter of string , length of string. for example; create(new string[] {"clue", "yay", "neon", "halala"}) should return array of pairs {[’c’,4],[’y’,3],[’n’,4],['h',6]} so, input , output both arrays. output has in form of pair. here's tried: import java.util.arrays; public class couple { public static couple[] create(string[] source){ (int = 0; < source.length; i++) { system.out.print("["+","+source.length+"]") ; } return null; } public static void main(string[] args) { system.out.println(arrays.tostring(create(new string[] {"clue", "yay", "neon", "halala"}))); } } as it's obvious there few errors+ dont want return null. sake of testing code, had it. id...