Posts

Showing posts from September, 2010

php - How to get the html Page from where I redirect to an other -

i'm using squidguard redirect order formular page of special producer local php script stores order in db. after storing script sends order via request producer. the html site product of producer looks like: http://producer.com/products/product123 this site contains link calls formular. after pressing link our users redirected our local script. it works fine ... for processing order need informations located on side of product --> http://producer.com/products/product123 is there way site (html code) whithout downloading second time php script? edit 1: ok try explain little bit better: site site describes product. on site link opens new site --> site b site b site contains order formular order product (or more) when press on link on site redirected local php script on our company server proceeds order , stores additional informations. redirection works squid proxy , squidguard filter. my problem is: script has download product page (site a) additional i...

java - How to know which framework is used? -

i have been made involve in new project , unaware of framework used.after long time came know spring used because saw imports like import org.springframework.beans.factory.annotation.configurable; and sure spring used.now unaware of whether hibernate used or jpa used.when asked colleague telling jpa used , telling hibernate means confused.can body please throw light regarding this.how know jpa or hibernate used. which packages should imported jpa or hibernate.any hint please what going on, project using hibernate implemention of jpa. to check , see jpa used, check code , see whether or not can find entitymanager or entitymanagerfactory one way see if hibernate being used, check spring configuration , see whether or not hibernatejpavendoradapter used anywhere in case have persistence.xml file, hibernatejpavendoradapter shouldn't present anywhere, , can check if hibernate mentioned anywhere in file

parallel processing - OpenMP tasking - way of preventing a specific thread from executing tasks? -

i creating several tasks in openmp, reason tasks executed same thread. code has following pattern: #pragma omp parallel num_threads(n_threads) #pragma omp single while(!found){ /.... operations k, e, y, dist, u, step #pragma omp task firstprivate(k, e, y, dist, u, step) process(k, e, y, dist, u, step, h, out); } is there way of forcing openmp runtime system assign tasks threads 1 creates task? thanks edit: void process(int a[]){ printf("thread %d processing\n", omp_get_thread_num()); /* heavy operations (used sleep simulate them)*/ sleep(10); } int main(){ int a[10]; int i, j; #pragma omp parallel num_threads(4) { #pragma omp single { (j = 0; j < 10; j++) { /* compute */ (i = 0; < 10; i++) { a[i] += 1; } #pragma omp task firstprivate(a) process(a); }...

rad - Creating a search portlet in Rational application developer using websphere -

i new portlet development. java, jsp developer. got assignment create search box , based on search should display best possible results after searching database. just google/ wikipedia when enter search query , results displays. i need on how create portlet in rational application developer using webshere. thanks in advance. kishan gourav developing portlets , developing search capabilities 2 topics , solution provide may vary depending on specific requirements. getting started on portlets in rad, samples (all taken this page can find more resources going): jsr 286 portlet project faces portlet using ajax web 2.0 portlets when comes search depends lot source search is. talking database in case harder me help, in case mean want search contents of portal these resources may help: faceted search - leverage search experience based on ibm search rest api customizing , extending functionality of ibm websphere portal 6.1 search center portlet - old version o...

gradle - How to place context.xml in war's META-INF? -

i building webapp through gradle's war plugin. in order disable tomcat's session persistence, need place file context.xml in meta-inf directory of war's root. i attempted following: create file src/main/webapp/meta-inf/context.xml of main project create file src/main/resources/meta-inf/context.xml of main project however, when build project using gradle clean war , produced war file contains meta-inf manifest.mf in it. if directory gets overridden. how place context.xml in war? src/main/webapp/meta-inf/context.xml correct , works fine me. chances went wrong somewhere, or there problem build script.

javascript - SyntaxError with .js and .css - ASP.NET MVC 5 -

when load page can't show errors when use inspector in google chrome have error: uncaught syntaxerror: unexpected end of input file : :65200/js/metro.min.js:1 and first line of metro.min.js all of this : var metro_auto_reinit, metro_locale, metro_week_start, metro_dialog = !1; (function (c) { c.metro = function (a) { c.extend({}, a) }; c.metro.getdevicesize = function () { return { width: 0 < window.innerwidth ? window.innerwidth : screen.width, height: 0 < window.innerheight ? window.innerheight : screen.height } } })(jquery); $(function () { $("html").on("click", function (c) { $(".dropdown-menu").each(function (a, b) { $(b).hasclass("keep-open") || "block" != $(b).css("display") || $(b).hide() }) }) }); the .cshtml file have this: <link href="~/css/metro-bootstrap.css" rel="styl...

JavaScript - Binary Search Tree - inOrderTraverse() function log "undefined" to console window? -

i'm implementing avl tree using javascript, , i'm working inordertraverse() function. problem that: when want log values of nodes console window, shows "undefined" instead. i've referenced https://gist.github.com/theirondeveloper/6604713 , think there's not difference between code , code i've referenced from. here js code implementing avl tree: http://jsfiddle.net/nru4t/ or https://dl.dropboxusercontent.com/u/178536659/avl%20tree%20javascript/avltree.js the result got here: (i run code on chrome) node 12 added. avltree.js:205 nodes count = 1 avltree.js:206 undefined avltree.js:64 avltree.js:68 node 18 added. avltree.js:264 nodes count = 2 avltree.js:265 undefined avltree.js:64 undefined avltree.js:64 avltree.js:68 avltree.js:68 node 20 added. avltree.js:264 nodes count = 3 avltree.js:265 undefined avltree.js:64 undefined ...

sql - How can a Non-Clustered index output a column that is not included in the index -

viewing execution plan, see "column a" in output list. operation index scan on non-clustered index : "ix_name" when see definition of index. not see "column a" in either index key columns or included columns. how non-clustered index being used output column not present in index. shouldn't use table scan on table or other index has "column a" present in it. if table clustered 1 , secondary indexes contain copy of clustering key 2 (a key determines physical order of rows in clustered table). the reason: rows in clustered table physically stored within b-tree (not table heap), , therefore can move when b-tree nodes split or coalesced, secondary index cannot contain row "pointer" (since in danger of "dangling" after row moves). often, has detrimental effect on performance 3 - querying through secondary index may require double-lookup : first, search secondary index , clustering key. second, based on...

windows - open program minimized via command prompt -

i have windows 8.1 machine , want open program minimized window. program notepad, use following command: start /min "" "c:\windows\notepad.exe" and new notepad window starts in minimized mode. the problem not programs this. when want start instance ms word in minimized mode use: start /min "" "c:\program files (x86)\microsoft office\office12\winword.exe" but new word windows starts in maximized mode. is there way start minimized? i tried commands in pc.it working fine.... to open notepad in minimized mode: start /min "" "c:\windows\notepad.exe" to open ms word in minimized mode: start /min "" "c:\program files\microsoft office\office14\winword.exe"

java - Replacing String parts -

this topic has been discussed here lot, none of solution worked me. want replace part of string, got html. getting , displaying html works fine, cann't remove parts of string. acts doesn't find it. please, have @ code bellow: public class main extends activity { public static string url = ""; public static string htmlstring; public textview maintext; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main_layout); maintext = (textview) findviewbyid(r.id.maintext); constructurl(); gethtml(); htmlstring.replaceall("<head>", "hulo"); maintext.settext(htmlstring); } public void gethtml() { try { httpclient httpclient = new defaulthttpclient(); httpcontext localcontext = new basichttpcontext(); httpget httpget = new httpget(url); httpresponse response = httpclient.execute(httpget, localcontext); buffe...

Firebase Security: read-only parent node, but writable child nodes -

can have read-only parent node, allow write leaf node? use-case: user parent testimonial children i'd let authenticated user read own user object, allow them write testimonials other user. or shoud down 2 parent level nodes user id linked? thanks. yes - can. setup more restrictive .write rule @ parent rule, setup less restrictive .write rule @ leaf node. for example: { "root": { "parent": { "$user": { ".write": false, ".read": true, "leaf": { ".write": true } } } }

php - subject length issue while sending email using codeigniter -

when subject of email long getting following error the following smtp error encountered: 451 see http://pobox.com/~djb/docs/smtplf.html. unable send email using php smtp. server might not configured send mail using method. and when shortened subject length, works fine.my smtp config setting $config['protocol'] = 'smtp'; $config['smtp_host'] = 'host'; $config['smtp_port'] = '**'; $config['smtp_user'] = $email_id; $config['smtp_pass'] = $password; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['crlf'] = "\n"; $config['wordwrap'] = true; $config['wrapchars'] = 10; $config['mailtype'] = "html"; thanks in advance. apparently known issue, caused email subject more 75 chars: http://codeigniter.com/forums/viewthread/154493/p15/#925385 it might change email config. there 2 ways go it: create ...

javascript - Toggle up and down arrows in a simple accordion widget -

Image
i have followed few tutorials , created simple accordion widget, works fine can see in fiddle however, trying add downward arrow when section closed , upper arrow when section open - @ right end of head of each tab in accordion, image below shows: here arrows font codes: .icon-arrowup:before { content: "\f077"; } .icon-arrowdown:before { content: "\f078"; } here have tried, added downward arrow default using css: .accordian .accordian-head:before { font-family: 'icons'; content: "\f078"; float: right; } this added arrow nicely, want replace arrow upward 1 when section open, have no clue do! tried add following css , toggle javascript, didn't work: .accordian .accordian-head .accordian-head-active:before { font-family: 'icons'; content: "\f077"; background-color: red; } //accordian $('.accordion').each(function () { var $accor...

css - HTML: adding <form> tags to in input textbox puts textbox under website logo -

i making social network , having troubles navbar , search box. have simple code textbox <div style="float:left"> <a href="index.php"><div class="website_icon"></div></a> <input type="text" name="q" class="search" placeholder="search..." /> </div>< when have code this, looks http://prntscr.com/39v9g0 now <div style="float:left"> <a href="index.php"><div class="website_icon"></div></a> <form action="" method="get"> <input type="text" name="q" class="search" placeholder="search..." /> </form> </div> when add <form></form> tags textbox, looks http://prntscr.com/39v9kl here css textbox, , website_icon /*search box*/ .search { height: 30px; width: 250px; margin-top: 10p...

javascript - Is CryptoJS vulnerable to the OpenSSL Heartbleed bug? -

we using cryptojs in our application. since cryptojs uses openssl, vulnerable heartbleed bug? if yes, can prevent it? since 'crypto.js' uses open ssl ,are vulnerable heartbleeding attack? the heartbleed attack connected " handling of transport layer security (tls) heartbeat extension ". so, heartbleed attack possible if crypto.js has tls / ssl server or client; , using tls / ssl server or client. if don't use tls it, (or if library has no tls/ssl client looks - can't find tls in sources ) - not vulnerable heartbleed . if yes,what can prevent it? update system's openssl library; check servers , clients connecting heartbleed vulnerability.

ruby on rails - Mapbox 1.6 - Javascript error with Marker layer (GeoJSON) -

i having 2 issues i'm hoping can me with. 1) marker layer renders (geojson), renders before map loads, need implement wait on ready, not sure how to. 2) getting error on heroku: typeerror: argument 1 of node.appendchild not implement interface node, , can't select actual marker, while works fine on development laptop. thanks! typeerror: argument 1 of node.appendchild not implement interface node <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script> <link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' /> <div id="map" style="width: 600px; height: 400px"></div> <style> #open-popup { position:absolute; top:5px; right:5px; } </style> <div id='map'></div> <button...

php - Save filename with unicode chars -

i have searched on internet , so, still no luck in following: i know, how save file using file_put_contents when filename has unicode characters. (windows 7 os) $string = "jérôme.jpg" ; //utf-8 string file_put_contents("images/" . $string, "stuff"); resuts in file: jГ©rГґme.jpg tried possible combinations of such functions iconv , mb_convert_encoding possible encodings, converting source file different encodings well. proper headers set, browser recognises utf-8 properly. however, can copy-paste , create file such name in explorer's gui, how make via php? the last hardcore solution urlencode string , save file. this might late found solution close hurting issue me well. forget iconv , multibyte solutions; problem is on windows ! (in link you'll find it's beauty this.) after numerous attempts , ways solve this, met urlify , decided best way cope unicode-in-filenames transliterate them before writing file. ...

ajax - BackboneJS .ajaxStart() and .ajaxStop() while fetching collection -

i have backbonejs app fetch bunch of collections. want apply sort of loader indicate collection loading , user gets know happening. want use .ajaxstart() , .ajaxstop() -method. thinking this: this.artistscollection.fetch( $(document).ajaxstart(function () { console.log('ajax start'); $('.somediv').addclass('test'); }), $(document).ajaxstop(function () { console.log('ajax stop'); // stop doing stuff }) ); issue first time trigger .fetch() console says ajax stop , class not applied!?!? second time trigger .fetch() works should , class gets applied. know whats issue? please anyone? you're passing returned result of adding 2 event handlers jquery parameters collection fetch method. backbone collection fetch method receives options object can include success callback (see documentation ). i think if move listeners out of method call should work expect: // global ajax listeners $(document).ajaxstart...

android - showing header content of application -

string.xml <string name="homeactivitytitle">placement cell</string> <string name="feedbackactivitytitle">feedback</string> <string name="eclairactivitytitle">placement record</string> <string name="froyoactivitytitle">cdc team</string> <string name="gingerbreadactivitytitle">news feed</string> <string name="honeycombactivitytitle">student forum</string> <string name="icsactivitytitle">assessment test</string> <string name="jellybeanactivitytitle">recruiters info</string> </resources> placement-regi.xml <textview android:id="@+id/textview1" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:text="placement registration form" /> i need regarding how display text on ...

php - I'm receiving a syntax error which I can't understand in form -

i've written code can create form, there error can't understand. my code <html> <head> <body> <?php include("menu_admin.php"); ?> <div style="clear:both"> <form action="edit.php" method="post" style="margin-left:502px"> <table > <tr> <td>name</td> <td><input type="text" name="name" /></td> </tr> <tr> <td>age</td> <td><input type="text" name="age" /></td> </tr> <tr> <td>phone no</td> <td><input type="text" name="phonenum" /></td> </tr> <!--value=" echo $phonenum; " size="30"--> <tr> <td>date</td> <td><input type="text" name="date" /></td> </tr> <tr> <td>e-mail</td> <td><i...

Selecting an option using jquery - select box -

i'm trying update selected option in select box using jquery. html follows: <select id="selectbox"> <option value="1">value 1</option> <option value="2">value 2</option> <option value="3">value 3</option> <option value="4">value 4</option> </select> using jquery, how can change selected option default (first option) option value 3 (third option)? thanks in advance use .val() $(document).ready(function() { $('#selectbox').val('3') });

jquery - How to get nearest text inside an element? -

$("#item_1").text() return text under #item_1, need "the first item". is possible text "the first item" using jquery? <ul> <li id="item_1"> first item <ul class="ltundertema _khkonteringundertemaer mt2"> <li>item 1.1</li> <li>item 1.2</li> </ul> <li>...</li> <li>...</li> </ul> i'd suggest: var text = $.trim($('#item_1').contents().filter(function(){ return this.nodetype === 3; }).text()); js fiddle demo . or: var text = $('#item_1').map(function(){ return $.trim(this.firstchild.nodevalue); }).get().tostring(); js fiddle demo . without jquery: var text = document.queryselector('#item_1').firstchild.nodevalue.trim(); js fiddle demo . references: $.trim() . contents() . filter() . get() . map() .

c++ - stereoCalibrate() changes focal lengths even when it was not supposed to -

i noticed opencv stereocalibrate() changes focal lengths in camera matrices though i've set appropriate flag (ie cv_calib_fix_focal_length). i'm using 2 identical cameras same focal length set mechanically on lens , furthermore know sensor size can compute intrinsic camera matrix manually do. here have output form stereo calibration program - camera matrices before , after stereocalibrate(). std::cout << "before calibration: " << std::endl; std::cout << "c1: " << _cameramatrixa << std::endl; std::cout << "c2: " << _cameramatrixb << std::endl; double error = cv::stereocalibrate(objectpoints, imagepointsa, imagepointsb, _cameramatrixa, _distcoeffsa, _cameramatrixb, _distcoeffsb, _imagesize, r, t, e, f, cv::termcriteria((cv::termcriteria::count + cv::termcriteria::eps), 30, 9.999999999999e-7), cv_calib_fix_focal_length | cv_calib_fix_principal_point); std::...

netlogo - Creating multiple plots on the same Graph? -

in code have variable called hops owned breed ants. ants-own [ hops distance-gone distance-to-go target-node current-node ] i want plot hops against time ( ie when takes 1st hop , plots 1 against time n likewise) each ant. in doing so, should have n number of graph lines on same plot n number of ants). i implemented using following code snippet, getting 1 line of graph. do-plot set-current-plot "hop count" let 0 ask ants [ set-current-plot-pen (word who) set-plot-pen-color + 15 plot hops ] end it better if different ants graph gets plotted in diffrent color. at setup, need create plot pen each ant using create-temporary-plot-pen (word who) . doing this? also, don't think color line going turn out how want it. in netlogo, main colors 5, 15, 25, 35, , forth. o...

execute sql in command line through sqlplus in java -

this question has answer here: how connect oracle “sys” sql*plus in java 3 answers i have execute sql statement through sqlplus in java without using file in command line in sqlplus. need make connection , execute sql statement in same single line in java echo "show user;" | sqlplus username/password sysdba i need find connection string that. how same thing in java?? every suggestion welcomed. there's article here describes better ways of calling runtime.getruntime().exec() the linked example may bit dated, still works. the following code based off this import java.io.*; public class doscmd { public static void main(string args[]) { try { string[] cmd = new string[3]; cmd[0] = "cmd.exe" ; cmd[1] = "/c" ; cmd[2] = args[0]; ...

Change the position of Google Play Game Services notification on Android -

i'm using google play game services android games. there 1 game doesn't go along achievements notification. it's endless game , user have concentrate , stay focus gain more score. achievements notification cover important portion of screen annoyed user. i see it's possible ios: https://developers.google.com/games/services/ios/achievements#changing_the_notification_location . is there similar in android? you can using setgravityforpopups method games class games.setgravityforpopups(googleapiclient apiclient, int gravity) for example, games.setgravityforpopups(getapiclient(), gravity.top | gravity.center_horizontal);

java - Cannot iterate over ExecutionResult -

i have written test, copying official cypher query example here , adding needed cast. fails with: java.lang.classcastexception: scala.collection.iterator$$anon$11 cannot cast java.util.iterator ... . code: @test public void testcreatewithcypher() { executionengine engine = new executionengine(db, stringlogger.system); try (transaction transaction = db.begintx()) { string cypher = "create (x:person {name: 'john'})" + "return x"; executionresult result = engine.execute(cypher); iterator<node> n_column = (iterator<node>) result.columnas("x"); (node node : iteratorutil.asiterable(n_column)) { string noderesult = node + ": " + node.getproperty("name"); } transaction.success(); } } without cast, not compile, since columnas returns iterator<object> . scala.collection.iterator$$anon$11 doing way? thought extended java.lang.iterator ? i want iterat...

functional programming - No operation in Scheme Language -

i having trouble in how define no operation in scheme language like ; in c i want this: (cond [(null? exp) nop ] ..... ) if leave empty wiil return #t thanks! scheme has no statements, expressions . each expression returns value -or may never return- so want expression not compute much. use nil (or #f , or other value) purpose: (cond ((null? exp) ()) .... ) if wrote condition test - , no "then" body sub-expressions (cond ((null? exp)) ) then result of cond when exp nil result of (null? exp) test #t actually, when exp null, return exp itself.

html - inherit the height of block from another in css -

Image
i have 2 areas, left menu pane , right content pane. css code both left , right below /*-----------------navi_left area-----------------------*/ layoutform { clear: both; //background-color: #e2e2e2; font-size: 1em; height: 100%; } .div_navi { border:1px solid #cccccc; width:216px; height: inherit; float: left; } /*------------------contents area--------------------*/ .div_text{ border:1px solid #cccccc; vertical-align:top; width:761px; height: 100%; //padding:0px 0px 0px 34px; font-size:11px; line-height:22px; float: right; } the problem that, on pages right pane has more height due more content. want make such if right page gets more height, left should inherit height it. below picture shows both unequal. developing application in asp.net mvc4 , _layout.cshtml is <!doctype html> <html lang="de"> <head> <meta charset="utf-8" /> <title>@viewbag.title - fleets go green dataserver</title> <link href=...

javascript - Angular unable to instantiate module when loaded using RequireJS -

there weird going on when i'm using requirejs angularjs. managed load angular dependencies through requirejs. can see scripts downloaded when open sources pane in chrome's developer tool. angular keeps throwing error in console failed instantiate module: uncaught error: [$injector:modulerr] failed instantiate module mytestapp due to: error: [$injector:nomod] module 'mytestapp' not available! either misspelled module name or forgot load it. if registering module ensure...<omitted>...0) it seems angular, when loaded requirejs, cannot bind ng-app tag in html page. i'm not sure if case seems me because when import angular.min.js manually html page, works fine. did wrong when using requirejs angular? how should use 2 together? here's how code look: index.html <!doctype html> <html lang="en" ng-app="mytestapp"> <head> <meta charset="utf-8"> <title>angularjs</title> <link re...

windows 7 ftp upload stops working for file >2K -

i have strangest problem ftp. after reboot windows command line ftp program works fine. then, try use friendlier ftp client (totalcommander, have used years) , can log in, folder contents, works until try upload file. seems connection gets closed -- , ftp ability thereafter damaged. here strange part: ftp upload seems permanently broken. , way broken quite strange. go command line ftp client, , can connect, list folders, change folders, download files of size, upload small files <2kbytes, upload of file bigger 2k causes connection dropped, , command times out. reboot os (64 bit win 7) , fine again. i have disabled windows firewall since many discussions centered on this. behavior same whether windows firewall on or off. i have tried toggling pasv mode, , again, behavior same whether sending passive or not. i have tried in both binary , ascii mode, , behavior same. this problem began when reinstalled windows 7 enterprise, service pack 1 on new disk. installed...

c++ - Does std::move invalidate pointers? -

assume following: template<typename item> class pipeline { [...] void connect(outputside<item> first, inputside<item> second) { queue<item> queue; first.setoutputqueue(&queue); second.setinputqueue(&queue); queues.push_back(std::move(queue)); } [...] std::vector<queue<item> > queues; }; will pointers queue still work in "first" , "second" after move? the pointers not work, because queue local object deleted @ end of connect . using std::move still create new object @ new memory location. try use as possible "old" object. additionally whole thing not work @ independent of using std::move push_back possibly has reallocate. call connect may invalidate old pointers. a possible solution creating queue objects on heap. following suggestion uses c++11: #include <memory> template<typename item> class pipeline { [...] ...

regex - Allow space in .htaccess url redirect -

i have redirected url special characters 400 error page using .htaccess working fine. i redirecting way. rewritecond %{query_string} [^\w+=&/.()-] [or] rewritecond %{request_uri} [^\w+=&/.()-] rewriterule .? /site/error/400/? [l,b,r] i want allow spaces in query too, trying way not working. rewritecond %{query_string} [^\w\s+=&/.()-] [or] rewritecond %{query_string} [^\w+=&/.()-\s] [or] rewritecond %{query_string} [^\w+=&/.()\s-] [or] rewritecond %{query_string} [^\w\d\s+=&/.()-] [or] please see , suggest possible way this. thanks. you can use %20 space: rewritecond %{query_string} [^\w=+&/.%20()-] [or] rewritecond %{request_uri} [^\w+=&/.()-] rewriterule ^ /site/error/400/? [l,b,r]

c# 4.0 - What CurrentSessionContext to use with Tasks -

when using currentsessioncontext tasks, context should used? i have been using threadstatic context, , warnings nhprof same session being used in multiple threads. if using threadstatic should fine. should use different session per thread if used properly. typically use following use session context: // open session if there not 1 opened yet. if (!currentsessioncontext.hasbind(sessionfactory)) { currentsessioncontext.bind(sessionfactory.opensession()); } var currentsession = sessionfactory.getcurrentsession();

php - basic date comparsion for expiration checking -

i want create traffic lights system tell me how many days left go until document reaches expiration date. want marked colors in html. green: if document has 31 days or more go until expires. amber: 30 days or less until expires. red: 7 days or less. i want display text, telling me how many days until expiration. expiration date comes database in field called insurance_date heres code new php struggling put code together, if show me how restructure code in order achieve im trying id greatful, thanks. my code: <?php include 'config.php'; $data = mysql_query("select * supplier_stats") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { echo "<p>insurance expires ! - <font color=\"red\">".$info['insurance_date'] . "</font></p>"; } $date_diff = 60*60*24*7; // 7 days // time()+$date_diff timestamp 7 days in future if ($info['insu...

java - two different cameras on one 3D-Object in Scene (JavaFX) -

i'm experimenting new javafx-3d objects. molecule example starting point, tried build scene embedded subscene . in main scene, there should molecule in example oracle , in subscene 1 should see e.g. projection left of molecule. is possible add second camera scene, , set subscene, or every subscene need same 3d object in it? i'm new topic, , happy read tips/tricks/infos. in advance! only 1 camera can set scene or subscene. simultaneous viewing requires several subscenes individual camera , redundant scene graphs. instances of shareable classes phongmaterial , trianglemesh can re-used in every scene graph. alternatively, node.snapshot() feature can used. lighting doesn't seem work yet. see proof of concept here http://www.interactivemesh.org/models/jfx3dtuxcube.html .

emacs python pdb restart debugging sesson -

i using emacs edit , debug python code , know how restart debugging session within emacs pdb single letter command. in perldb , there single command r equates restart script, can't find equivalent one-letter instruction restart in python. is there way hook r restart in pdb? here code use that. first tries send nice 'restart' comint-send-input, if doesn't work, falls killing buffer (along underlying pdb process), , restarts pdb session, using same directory , arguments last started pdb session. (defun pdb-restart () (interactive) (comint-insert-send "restart") (sleep-for .5) (when (or (last-lines-match "raise restart.* restart") (last-lines-match "restart") (not (get-buffer-process (current-buffer))) ) (let ( (kill-buffer-query-functions nil );disable confirming process kill (pdbcmd (car-safe (symbol-value (gud-symbol 'history nil 'pdb)))) (default...

python - Is it possible to install supervisord inside virtualenv? -

currenty install supervisord system-wide on ubuntu apt-get install supervisor . projects inside virtualenvs, system-wide python not used anything. is possible install supervisor inside virtualenvs? can run multiple instances? yes. can first setup virtualenv , install supervisor use pip . virtualenv env cd env ./bin/pip install supervisor create configuration file: echo_supervisord_conf > /path_to_configuration_file/supervisord.conf you can run multiple instances, use different port supervisord listen on in configuration file: port=127.0.0.1:9001

python - Scapy Raw Sockets -

i try implement 3-way-hadnshake raw socket in python , using scapy. the code is: s=socket.socket(socket.af_packet, socket.sock_raw, socket.ipproto_tcp) ss=streamsocket(s) iph=ipheader() syn = tcp(sport=tcp_source_port,dport=tcp_destination_port, flags="s") synack = ss.sr1(iph/syn) myack = iph/tcp(dport=synack[tcp].sport, sport=synack[tcp].dport, seq=synack[tcp].ack, ack=synack[tcp].seq+1, flags="a") ss.send(myack) ipheader() method return scapy ip header. when running script error: error: --- error in child 3057 traceback (most recent call last): file "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 89, in sndrcv pks.send(p) file "/usr/lib/python2.7/dist-packages/scapy/supersocket.py", line 34, in send return self.outs.send(sx) error: [errno 6] no such device or address i see couple of possible problems code: before invoking streamsocket() need establish connection regular socket. need make connection, s.conne...

asp.net mvc 3 - Removing comma from IntegerTextBoxFor -

i have question integertextboxfor telerik extensions mvc. i'm trying remove use of commas it. here have. editor template called int32.cshtml @model system.int32 @using telerik.web.mvc.ui @html.telerik().integertextboxfor(model => model) model [nopresourcedisplayname("admin.returnrequest.list.searchorderid")] public int searchorderid { get; set; } i have tried adding [displayformat(dataformatstring="{0:g}")] model has done nothing. tried using 0:#####, 0:00000, , 0:n. you can configure group separator calling numbergroupseparator method on integertextboxfor(model => model) . so if don't need separator can set empty string: @html.telerik().integertextboxfor(model => model).numbergroupseparator("")

c# - AppDomain.ResourceResolve event -

Image
ms visual studio, c#. i need locate localized resource files .\resource subdirectory. can't use probing xml element of config-file, i.e. project dll (it loaded in external application , located not in hosted application directory). try use appdomain.resourceresolve event problem... now wrote "hello world" showing it: using system; using system.collections.generic; using system.globalization; using system.io; using system.linq; using system.reflection; using system.resources; using system.text; using system.threading; namespace helloworld { class program { static void main(string[] args) { appdomain domain = appdomain.currentdomain; thread thread = thread.currentthread; thread.currentuiculture = new cultureinfo("en"); domain.resourceresolve += domain_resourceresolve; resourcemanager res = new resourcemanager(typeof(program)); console.writeline(res.getstring("message")); console.writeline("p...

excel - l form to save data in Access -

good day !! i manage contact center , require staff capture data calculate productivity this could've been done through access forms, team not allowed have access due policies i wanted know if create few predefined fields in excel data entry (dropdowns , free text), agents enter information each time, click "submit" button. once "submit" button clicked, data passed access table, , excel fields reset blank. note: each agent has excel file name stored on our shared drive. access stored on shared drive. paths predefined , fixed. can please i'm sure has been posted somewhere before, cant seem find exact requirements. thanks that should work. copy, paste , adjust workbook name. option explicit sub updatelogworksheet() dim historywks worksheet dim inputwks worksheet dim wb1 worksheet dim nextrow long dim ocol long dim myrng range dim mycopy string dim mycell range 'cells copy input sheet ...

objective c - How to add +1 to the label every time sprite is touched? -

i developing game using cocos2d 3.0. have sprite. i'd add +1 label every time sprite touched( score). -(void) touchbegan:(uitouch *)touch withevent:(uievent *)event { cgpoint location = [touch locationinview: [touch view]]; cgpoint convertedlocation = [[ccdirector shareddirector] converttogl: location]; cgpoint convertednodespacepoint = [self converttonodespace:convertedlocation]; if (cgrectcontainspoint([_sprite boundingbox],convertednodespacepoint)) { label = [cclabelttf labelwithstring:@"1" fontname:@"verdana-bold" fontsize:23.0f]; label.position = ccp(_contentsize.width - _contentsize.width/20,_contentsize.height - _contentsize.height/20); [self addchild:label ]; }} edited according answers : in @implementation : long score; cclabelttf *label; in - (id)init : label= [cclabelttf labelwithstring:@"" fontname:@"verdana-bold" fontsize:23.0f]; label.position = ccp(_contentsize.width - _contentsize.width/20,_co...

r - distribution comparison for large number of data sets -

i have data named "data" this: centre_blinded val_list 1 1104 c(-13, -1, 0, 28, -88, 28, -1, -6, -5, -58, 28, 28, 28, 28, 2, 0, 28, -26, 28, 28, 2, 28, 28, -2, -29, 0, 28, -34, -6, 0, 28, 1, 0, 0, -1, 28, 28, 0, 28, 6, 28, 0, 28, 28, 28, 0, -2, -6, -1, 4, 6, 1, -16, -7, 2, 3, 7, 0, 1, 11, 0, 1, -6, -5, 0, 3, 8, 7, 0, 0, 6, -6, 2, 36, -8, 0, -7, -7, -1, -1, -1, 7, -3, 7, 2) 2 1204 c(2, -9, 28, 28, -2, 1, -3, -1, 0, 28, 28, 28, 28, 28, 28, 3, 10, -5, -8, 9, -8, 0, 13, 0, -1, 2, -1, 0, 6, 1, 0, -7, 6, -6, 1) 3 1403 c(0, 2, 0, 2, 28, 0, -1, -35, -36, 2, 1, 1, 28, 28, 28, 0, 0, 28, -7, -35, 28, -3, -18, 28, 28, 28, -5, 0, 28, -2, 4, 5, 0, 56, 1, 0, 1, -7, -20, 0, 0, -3, 0, 1, 3, 0, 4, -2, 42, -13, 7, 10, 7, 56, 0, -5, 10, 56, 8, 56, 84, -4, 1, 0, -14, -7, -1, -48, -6, -3, 0, 7) 4 1110 c(0, 1, 0, -3, 28, 28, 0, -5, 0, 9, 15, 56, -11, -1, -7) the first column containts id of centre, , second contains list of values. wanto build empirical distributions...

Why close pipe in c? -

what go wrong if reader of pipe forgets close fd[1] or if writer of pipe forgets close fd[0]? you'll have file handle leak (as long process has file descriptor open running). worst thing can happen run out of file descriptor handles if have lot of pipes. there's soft , hard limit (see ulimit ) per user, , system wide limit (although you're unlikely hit if system has useful per-user limit). once run out of file descriptor handles, strange things happen won't able start new processes or other running processes might stop working correctly. most of time isn't worry of time there's 2 processes , 1 pipe, leak won't big deal. still, want close filehandle don't need more free resources.

windows - Rainmeter - How to launch a period task -

i've used geektool mac , can setup process (like script) run every x number of seconds , display output (say image). i'm trying similar rainmeter (windows) can't seem make sense of it. there simple way in skin have run system command every x seconds? thanks! something should job: [rainmeter] update=1000 ;updates rainmeter every second [measureperiodcommand] updatedivider=15 ;runs every 15 seconds measure=calc onupdateaction=["ping"] ;replace 'ping' command ;you can omit meter [meterdumb] meter=string text="this working!" fontsize=50 for more information, see onupdateaction

Importing flat XML data into SQLite database in c#.net -

i have generated xml file exporting sqlite database in c#.net.my generated xml like- <root> <name1> <names> <id>5</id> <from>germany</from> <to>france</to> <through> <via> <id>7</id> <routeno>5<routeno> <route>vienna<route> </via> </through> </names> <names> <id>10</id> <from>us</from> <to>canada</to> <through> <via> <id>8</id> <routeno>10<routeno> <route>mexico<route> </via> </through> </names> </name1> </root> then transformed file f...

Gradle task take over configuration of war -

for web project need build 2 war files. 1 static content, 1 without. war { archivename = "feeder##${version}.full.war" exclude 'test.html', 'test.js', 'todos.js' } task smallwar(type: war, dependson:[war]) { // exclude 'css', 'img', 'js', 'template', 'index.html' archivename = "feeder##${version}.war" } it's clear, i'm able configure both same way, how can take on configuration , enhance it? current configuration calls war before running smallwar . don't want call it. instead smallwar task should exclude same files war plus additional files. the dependson affects execution, not configuration. easy way configure commonalities between 2 war tasks is: tasks.withtype(war) { exclude 'test.html', 'test.js', 'todos.js' } smallwar can add further excludes: task smallwar(type: war) { exclude 'css', 'img', ...

php - Query works if I don't bind, but fails when I do. Where is my error? -

i have tried variations of this: $prep_get_company=$connection->prepare("select * sl_customer company_name = ':company_name'"); $prep_get_company->bindparam(':company_name',$company_name); and no results if this: $prep_get_company=$connection->prepare("select * sl_customer company_name = '$company_name'"); it returns desired results. contents of $company_name string spaces. remove single quotes on query: select * sl_customer company_name = ':company_name' should have been: select * sl_customer company_name = :company_name the single quote treat literal value make prepared statement fail bind think there nothing bind when using single quotes. the prepared statement arrange data you're binding needed.