Posts

Showing posts from June, 2012

tee - stdout to multiple processes - Windows -

very similar to: how can send stdout of 1 process multiple processes using (preferably unnamed) pipes in unix (or windows)? particularly... proc2 -> stdout / proc1 \ proc3 -> stdout i have 'proc1' output pass in 'proc2' , 'proc3'. not save output 'proc1' , pass in [as input] 2 other processes, 'proc2' , 'proc3'. there lot of discussion 'tee' , found ' wtee '. alas, following did not work: proc1 | wtee (proc2 -i - <other arguments>) (proc3 -i - <other arguments>) note: '-i -' passed in 'proc2' , 'proc3' each process knows input coming (stdout). is there way can trying in windows? perhaps arguments passed in each process why 2 not working? better off [or stuck] writing program this? i have not tested this, should able named pipes. write vbscript called splitter.vbs reads stdin , writes 2 named pipes, start 2 other proc

mysql - PHP loop x number of times, using while and if -

so has been driving me nuts several days. i've tried this , that nothing working. here's basic rundown: i have mysql database 200 or locations. user enters zip code, , want give them 6 random locations within 100 miles of home. works great, except can't limit results 6. give me results <100. when try code below (adding for ($x=0...) bit), same result, each 1 repeats 6 times before listing next one. here's pertinent code returns locations. save me throwing computer out window. $sql = "select * locations order rand()"; $result = mysql_query($sql, $dbase2); while ($row = mysql_fetch_array($result)) { $city = $row['city']; $id= $row['id']; $miles = calculatedistance($lat, $lon, $point2_lat,$point2_lon); if ($miles < "100") { ($x=0; $x<6; $x++){ echo $city . " " . round($miles) . " miles away.<br />"; }; }; }; like said, sake of pos

laravel - Adding Model directories to the ClassLoader -

i using october , cms built on top of laravel framework . in october, pretty plugin based, , models seem defined exclusively within plugin/model directories. unfortunately, need define , use number of site-wide models . end, have created classic laravel app/models directory , placed them in there. the framework, however, not detect these models , auto-load them. have had success including them in standard php files, extent. however, when attempt define relationships between models run problems. think (this wrong) need use whatever autoload system laravel / october . i found illuminate\support\classloader , tried using adddirectories() method, passing in ['app/models'] in hopes models undergo "standard" autoload process. unfortunately, while didn't break anything, didn't fix either. the question: how can specify custom directory laravel application load upon startup? additional steps need register models have in aforementioned directory?

php - Checking sha1 against stored sha1 password -

i'm hashing password using sha1 , storing in database, cannot seem check see if sha1 matches 1 in database. i've tried numerous different iterations of below code, nothing seems work - missing? registration <?php $username = $_post['username']; $password = $_post['password']; $passwordencrypted = sha1($password); try { $result = $db->prepare("insert user_info set username = :user, pass = :pass "); $result->bindparam(':user', $username); $result->bindparam(':pass', $passwordencrypted); $result->execute(); } catch (exception $e) { echo "could not create username"; } if (isset($_post['submit'])) { foreach ($_post $field) { if (empty($field)) { $fail = true; } else { $continue =

html - How to maintain client session for shopping cart even when user has not logged in -

i have question, looked on google , other threads on stackoverflow well. did not accurate answer. please me redirect .. i use amazon.com (just example, other e-commerse site) , keep on adding items in wishlist. (while have not yet logged in) i close browser , system , came next day or may after 10 days or longer time. i can see wish list there was. is amazon maintaining client side cookie on client side save data? data big , not reliable accuracy. are using guid on client side (for 1 year) , send server have data base sessionid mapping in db? when once login amazon, wishlist , cart there. means might have beed updated client cookie. i asked in interview design/architect question , got confused. wanted clear friends. ideally need html5 , make use of local storage ( http://dev.w3.org/html5/webstorage/ ) a key value pair can saved below: localstorage.setitem("basket", {"item":"product 1","price":100.50,"qty":2,&

javascript - jsfiddle error {"error": "Please use POST request"} when submitting a form -

i'm new using js fiddle , keep getting error: {"error": "please use post request"} when submitting form. understand cannot submit post request in jsfiddle, how can append form? <form> <label>add</label> <input type="text"/> </form> $('form').on("submit", function(){ $('form').after("apple") }); if not explicitly set form method browsers default using get. <form method="post">

WordPress - How do I isolate my changes to the top Menu, instead of all clickable links on my page? -

i making website on wordpress using moldularity - lite theme. wanted change appearance of navigation menu on top of page. thought looked small , unnoticeable computer-illiterate person (which main audience). novice html , css code teaching myself, please keep simple. :) what problem want isolate changes top navigation menu , not every clickable link on page.

r - Changing font in PDF produced by rmarkdown -

Image
i producing reports using rmarkdown. when knitting pdf --- title: "untitled" output: pdf_document --- i specify font used in creating pdf. official documentation (see section "latex options) says can this. however, i've never used latex , fail understand how such selection can made in yaml options @ top of .rmd document used rmarkdown package. question: how change font in pdf produced rmarkdown? sessioninfo() r version 3.1.0 (2014-04-10) platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] lc_collate=english_united states.1252 lc_ctype=english_united states.1252 [3] lc_monetary=english_united states.1252 lc_numeric=c [5] lc_time=english_united states.1252 attached base packages: [1] grid stats graphics grdevices utils datasets methods base other attached packages: [1] ggplot2_1.0.0 rodbc_1.3-10 knitr_1.6 dplyr_0.2 i've never used latex , don't want @ mom

ruby on rails - PostgreSQL - must appear in the GROUP BY clause or be used in an aggregate function -

this query works locally, doesn't work on heroku reason. 2014-06-26t00:45:11.334388+00:00 app[web.1]: pg::groupingerror: error: column "conversations.updated_at" must appear in group clause or used in aggregate function this sql. conversation.joins("inner join notifications on notifications.conversation_id = conversations.id , notifications.type in ('message') inner join receipts on receipts.notification_id = notifications.id notifications.type = 'message' , (receipts.receiver_id = #{a.id} , receipts.receiver_type = 'profile') , conversations.id in #{active_conversations_ids} order conversations.updated_at desc") i tried doing distinct , did not work, , tried group_by('conversation_id') the to_sql select "conversations".* "conversations" inner join notifications on notifications.conversation_id = conversations.id , notifications.type in ('message') inner join receipts on re

swing - Java paintComponent as a JComponent -

don't know if specific title, have asked question has gone dead. trying execute paintcomponent() can draw rectangles, triangles , more class being jcomponent. here code far: public class design extends jcomponent { private static final long serialversionuid = 1l; private list<shapewrapper> shapesdraw = new arraylist<shapewrapper>(); private list<shapewrapper> shapesfill = new arraylist<shapewrapper>(); graphicsdevice gd = graphicsenvironment.getlocalgraphicsenvironment().getdefaultscreendevice(); int screenwidth = gd.getdisplaymode().getwidth(); int screenheight = gd.getdisplaymode().getheight(); public void paintcomponent(graphics g) { super.paintcomponent(g); graphics2d g2d = (graphics2d) g; for(shapewrapper s : shapesdraw){ g2d.setcolor(s.color); g2d.draw(s.shape); } for(shapewrapper s : shapesfill){ g2d.setcolor(s.color); g2d.fill(s.shape); } } public void drawrect(int xpos, int ypos

javascript - Uncaught TypeError: Cannot set property 'onfocus' of null -

i trying learn javascript , i'm building basic tutorial. in trying demonstrate onfocus , onblur, error message in javascript console: uncaught typeerror: cannot set property 'onfocus' of null. here code. new learning javascript , use help. //alert("hello, world!"); // javascript alert button // var year = 2014; var useremail = ""; var todaysdate = ""; /*var donation = 20; if (donation < 20) { alert("for $20 cookie. change donation?"); } else { alert("thank you!"); } */ var mainfile = document.getelementbyid("maintitle"); console.log("this element of type: ", maintitle.nodetype); console.log("the inner html ", maintitle.innerhtml); console.log("child nodes: ", maintitle.childnodes.length); var mylinks = document.getelementsbytagname("a"); console.log("links: ", mylinks.length); var mylistelements = document.getelementsbytagname("li"

javascript - On blur triggered multiple times -

i trying create editable table using jquery. as part of showing text-area onclick of td , on blur of text-area hiding that. the issue text-area blur triggered exponentially go on clicking other td. text-area showing correctly issue abnormal trigger count onblur . it must flow in design. please guide me on right path. code var $td = $('td') $td.on('click', function () { $(this).addclass('selected'); var $self = $(this); var offset = $(this).offset(); var height = $(this).outerheight(); var width = $(this).outerwidth(); var value = $(this).text(); $('.input').show().css({ top: offset.top, left: offset.left, height: height, width: width }).val(value).focus().on('blur', function () { console.log('triggerd') $self.removeclass('selected'); $(this).hide(); }); }); jsfiddle the problem because you're adding .on('bl

javascript - jQuery .slideDown() for each paragraph -

i'm trying make slidedown set kind of delay everytime start new paragraph. me? think i've seen step function, didn't work me. i'm beginner html/css/javascript html: <p><font color = "white"> >>></font> opening new terminal . . . </p> <p> <font color = "white"> >>></font> successful . . . </p> <p> <font color = "white"> >>></font> executing ./xxx </p> slidedown $( document.body ).click(function () { if ( $( "p:first" ).is( ":hidden" ) ) { $( "p" ).slidedown(900); } else { $( "p" ).hide(); } }); do this $(document).click(function () { if ($("p:first").is(":hidden")) { $("p").slidedown(900); } else { $("p").hide(); } }); demo actually in context hide p element when body clicked .then again click there no

java - Unix: Delete File code giving some process -

i have coded java code delete file particular path. able see process running using below command , find 1 entry. root@ad4d # ps -ef | grep del root 27896 27895 0 jun 24 pts/5 0:49 java -jar /oracle/php/online/jars/dist/delfile.jar but when administrator checks process running command below can see many child threads , parent thread process below root@almt4d # ps -aadeflcjlpyz | grep del s global root 27896 27895 26891 26891 1 - 96 ts 59 37144 116392 ? jun 24 pts/5 0:00 java -jar /oracle/php/online/jars/d s global root 27896 27895 26891 26891 2 - 96 ts 59 37144 116392 ? jun 24 pts/5 0:00 java -jar /oracle/php/online/jars/d s global root 27896 27895 26891 26891 3 - 96 ts 59 37144 116392 ? jun 24 pts/5 0:00 java -jar /oracle/php/online/jars/d s global root 27896 27895 26891 26891 4 - 96 ts 59 37144 116392 ? jun 24 pts/5 0:00 java -jar /

html - Text Wrap Laravel pulling article From DB -

Image
i'm using laravel, pulling article db , displaying image, it's lorem ipsum generated. question : how article wrap around image , beneath it. img ur pic can see! @extends('layouts.main') @section('headcontent') <div class="container" class=""> <div class="row"> <div class="col-md-6"> <a href="{{ url::route('equipment-item') }} " alt="{{$fd->name }}"><h2 class="page-header">{{$fd->name }}</h2></a> <small>created: {{ $fd->created_at }}</small> <img src="{{ $fd->image }}" alt="{{$fd->name }}"> </div> <div class="col-md-12"> //if go <div class="col-md-6" (the other 50% of first div) acts side bar. <article class="dbarticle"> {{ m

gmail api - getting a list of authorized sender addresses -

using gmail webui can send emails masquerading sales or support organization. is there way enumerate list of authorized sender addresses? if you're google apps domain existing gmail settings api can give access that: https://developers.google.com/admin-sdk/email-settings/#retrieving_send-as_alias_settings the new gmail api announced today doesn't support (so gmail.com users don't have access doesn't sound use case).

javascript - Why do only some of my js work when I switch cases with php? -

i cannot figure out life of me why of js works. i using switch-case in php files. both "content_allinboxes.php" , "content_emails.php" can recognize "app.v2.js". however, "content_allinboxes.php" uses "jquery.ui.touch-punch.min.js" & "jquery-ui-1.10.3.custom.min.js" aren't recognized. what doing wrong? have been @ hours , can't figure out. (note: 2 javascript files works if not put "content_allinboxes.php" in switch-case.) here how switch contents called: <div id="displayloading"><img src="images/account/loading_indicator.gif"/></div> <div id="displaycontent" style="height: 100%; width: 100%"></div> here switch-case codes. file called "content_load.php": <?php switch($_get['id']) { case 'feeds_allinboxes': $content = 'content_allinboxes.php'; break; cas

jboss7.x - myeclipse 6.6 not supporting jboss 7 -

can kindly explain me how can use jboss 7.1.0 server in myeclipse 6.6 projects since in jboss server list, recent jboss 5. know if there other way around without having update ide. try jboss 5 connector. if doesn't work, there may setting deploying custom location - not sure don't have me 6.6 installed. right click on project, select myeclipse->add/remove deployments (or similar) choose custom location or "custom location - suffix" deploy particular folder. suffixed choice adds ".war" folder name. once deployed custom location should appear in servers view though can't start or stop server way. me 6.6 old , you'd better off upgrading latest ga release (12.0 or "2014") or latest access release (13.0 or "2015"), full support.

python - memory issues with big numpy/scipy arrays -

i've below code snippet: data / imat data matrices of 100000 x 500 , while matrix s i'm constructing of order 50000 x 100000 . matrix s super sparse 1 entry in each column def getsparsecoverr(imat, sketch): ata = np.dot(imat.transpose(), imat) btb = sketch.transpose().dot(sketch) fn = np.linalg.norm(imat, 'fro') ** 2 val = np.linalg.norm(ata - btb , 2)/fn del ata del btb return val nrows, ncols = data.shape samples = noofsamples(ncols, eps, delta) cols = np.arange(nrows) rows = np.random.random_integers(samples - 1, size = nrows) diag = [] in range(len(cols)): if np.random.random() < 0.5: diag.append(1) else: diag.append(-1) s = sparse.csc_matrix((diag, (rows, cols)), shape = (samples, nrows))/np.sqrt(samples) q = s.dot(data) q = sparse.bsr_matrix(q) print getsparsecoverr(data, q) when run above code first time gives me print statement output. after that, if run below error: python: malloc.c:2369: sysmal

c# - Use for every Reyling Party seperate client Certificate? -

i'm reading on sso , used tutorial http://chris.59north.com/post/2013/04/09/building-a-simple-custom-sts-using-vs2012-aspnet-mvc.aspx creating custom sts. if understood correct on sts machine installed certificate. reyling party sends thumbprint of x509 signature. relying party accept claims of sts proper certificate. correct? if so, implement every relying party sending certificate sts sts got installed too. on request sts in trusted relying party list if sent certificate known sts. is implemention idea , practice? there ressource implement this? thanks implementing custom sts hard work. advise have @ windows azure acs or thinktecture free sts starting point. being said, having separate certificate relying party common practice. however, private key of certificate stored inside database in sts (acs , thinktecture both support this). relying party knows public key. security token (saml2 or jwt) signed acs security token , relying party can use public key (

eclipse - Load RDF model into Jena SDB -

i trying load rdf model jena sdb. have done connection (and think should fine). not know why not work right. think because of arq library have imported project not know. here code : string rdf_file = "./prova_rules_m_rdf.owl"; string classname = "com.mysql.jdbc.driver"; string db_url = "jdbc:mysql://localhost:3306/prova_rules"; string db_user = "root"; string db_passwd = ""; // create store description storedesc storedesc = new storedesc(layouttype.layouttriplenodeshash,databasetype.mysql); // load database driver try { class.forname(classname); system.out.println("jdbc driver load successfully!"); } catch (exception e) { e.printstacktrace(); } // create sdbconnection sdbconnection sdbconnection = new sdbconnection(db_url,db_user,db_passwd);

sql - select multiple column from multiple table join query -

this question has answer here: select query multiple column multiple table 5 answers i have table a,table b,table c,table d,table e table columns a1,a2,a3 table b column a1,b1 table c column b1,c1 table d column a1,d1 table e column d1,e1,e2,e3,e4,e5,e6,e7 note: i enter a1 want a1 related data database. a1 relate table b , table d ,b1 relate table c,d1 relate table e , want table e data. means want d1,e1,e2,e3,e4,e5,e6,e7,b1,c1 @ same time when enter a1 if understand question, can cross-join on tables. want this, select d1,e1,e2,e3,e4,e5,e6,e7,b1,c1 a, b, c, d, e a.a1 = b.a1 , b.a1 = d.a1 , b.b1 = c.b1 , d.d1 = e.d1

Java SE vector array help please -

i need here java school work. yesterday posted 1 question quite similar 1 regarding arrays @ java se array needed please , managed solved of guys. this time round, required prompt user enter series of words regarding of number , there application determine longest word of , print console stating longest word length of it. although, weren't given hint on how go thought using vector solution please advise me if i'm wrong. now, manage print console no matter how many words user input have no idea how able add each individual vector , compare them regarding length. thank once again , hope guys can try understand i'm total newbie in programming try keep simple. :d import java.util.*; class longestword2 { public static void main(string [] args) { system.out.println("please enter words"); scanner userinput = new scanner(system.in); vector <string> v = new vector <string>(); while (userinput.ha

google analytics - Should I set the Tracker Name, Cookie Name, and Cookie Domain for my Tags? -

Image
my pages setup multiple ga trackers: ga('create', 'ua-xxxxx-1', {'name': 'tracker1','cookiename': 'tracker1', 'cookiedomain':'example.org'}); ga('tracker1.send', 'pageview'); ga('create', 'ua-xxxxx-2', {'name': 'tracker2','cookiename': 'tracker2', 'cookiedomain':'example.org'}); ga('tracker2.send', 'pageview'); ga('create', 'ua-xxxxx-3', {'name': 'tracker3','cookiename': 'tracker3', 'cookiedomain':'example.org'}); ga('tracker3.send', 'pageview'); in gtm, when create universal analytics tags, have option define tracker name , cookie name , , cookie domain : q1: have set values, or gtm figure out automatically based on tracking id provide in tag? for tracker name , gtm ui reads: use of named trackers highly discouraged in gtm a

cocos2d iphone - Convert PVR.CCZ image to PNG for edit the image. -

i need convert pvr.ccz image file png image edit image file. m original image got deleted. used texture packer create pvr file. i refer link:- how can recover png images .pvr.ccz file? not useful. in googling u get. got link:- https://gamedev.stackexchange.com/questions/69519/how-can-i-batch-convert-texturepacker-pvr-ccz-files-to-png worked fine also.. simple command in terminal help:- texturepacker filename.pvr.ccz --sheet filename.png --data dummy.plist --algorithm basic --allow-free-size --no-trim

sql server - SQL: SELECT TOP with ORDER BY clause does not return correct result -

i have select top query order clause not return correct result. below sample query , output. any suggestion / workaround / solution ? query: create table #testtop ( topid int, topstr varchar(max) ) insert #testtop values(1749, ''); insert #testtop values(1750, ''); insert #testtop values(1752, 'z'); insert #testtop values(1739, 'a'); select * #testtop order topstr asc select top 1 * #testtop order topstr asc select top 4 * #testtop order topstr asc drop table #testtop; result: [select *] topid topstr ----------- ----------- 1749 1750 1739 1752 z [select top 1] topid topstr ----------- -------------- 1750 [select top 4] topid topstr ----------- -------------- 1750 1749 1739 1752 z try this, works in sql server select top 4 * #testtop order row_number() over(order (case when topstr = '' null else topstr

javascript - ThreeJS loadTexture collects images into memory and memory raises fast -

if open kemooolep.com/three chrome/windows, browser crash soon, beware! :) maybe have ideas how change materials dynamically without having memoryleak it's not clear trying achieve here. first, onloaded function called infinitely, if not seem necessary. part, especially: if (loadedcount == 6){ onloaded(); } then, don't understand why want call three.imageutils.loadtexture when scene ready ? easier load them directly, , assign them mesh.material.materials[index] in respective callbacks.

vb.net - Brute force MD5 hash in Visual Basic -

i have made program converts string hash using md5 algorithm. public shared function getmd5hash(byval strtohash string) string dim md5obj new system.security.cryptography.md5cryptoserviceprovider() dim bytestohash() byte = system.text.encoding.ascii.getbytes(strtohash) bytestohash = md5obj.computehash(bytestohash) dim strresult string = "" dim b byte each b in bytestohash strresult += b.tostring("x2") next return strresult end function private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click textbox2.text = getmd5hash(textbox1.text) end sub but have added button use brute force find original text when md5 hash given. what code can write in button systematically try every word/number , check against original hash? what code can write in button systematically try every word/number , check against original hash? looking @ current code , enormous e

java - Put a JPanel on top of JLabel -

i have put background image on jframe using seticon label. have put button s on jframe , want jscrollpane ,which can show image. without showing background image, able see jscrollpane cannot see jscrollpane .

TAR size difference after uploading to Linux server via FTP command or a shell script with FTP command -

i have tar file "backup_20140626" size 444477440. uploaded via ftp onto nas running linux so: >put backup_20140626 local: backup_20140626 remote: backup_20140626 229 entering extended passive mode (|||22735|) 150 opening binary mode data connection backup_20140626 100% |*************************************| 423 mb 26.59 mb/s 00:00 eta 226 transfer complete 444477440 bytes sent in 00:15 (26.57 mb/s) i downloaded file , opened. then wrote script backup.sh auotmate uploading: ftp -n 192.168.0.2 <<eof quote user backup quote pass backup cd /mnt/array1/_backup put backup_20140626 quit eof ok, ran script: #./backup.sh connected 192.168.0.2. 220 192.168.0.2 ftp server ready 331 password required backup 230 user backup logged in 250 cwd command successful local directory /backup/dat local: backup_20140626 remote: backup_20140626 229 entering extended passive mode (|||63859|) 150 opening binary mode data connection backup_20140626 100% |**************

html - Why does the required field validator not work if I click twice? -

i have form on aspx page asks email address. want email address required field using requiredfieldvalidator force user enter email address. the validator works on first click, i.e. code associated submit click won't execute, submit form if click second time though there still no email in email field. am using incorrectly? should use javascript instead of class? <tr> <th class="style1"><strong>email: </strong></th> <th class="style2"><asp:textbox id="email" runat="server" class="textboxes"/> <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server" controltovalidate="email" errormessage="email required field." forecolor="red"/> </th> </tr> as

css - pagination in javascript with dynamic page numbers -

i having 4 blocks , in 1 page 3 blocks should displayed , in next 1 block should displayed , page numbers should generated dynamically according the pages.i have given html , javascript coding.how pagination ? <div id=1></div> <ul class="pagination pagination-lg"> <li><a href="#">&laquo;</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">&raquo;</a></li> </ul> <div id="2"></div> (var = 0; < 5; i++) { var a1 = $("<label></label>") .prop("class", i) .text("nand" + i) .css({ 

php - Two different actions in a form cakephp -

i using cakephp 2.4 , want form 2 buttons each button should have own action don't know how can redirect submit-a action1 , submit-b action2. <div class="form information"> <?php echo $this->form->create('soya', array('action' => 'reportecompravsprod')); ?> <?php // here goes forms ?> <div class="submit"> <?php echo $this->form->submit('vista', array('class' => 'form-submit', 'name' => 'submit-a')); echo $this->form->submit('reporte', array('class' => 'form-submit', 'name' => 'submit-b')); ?> </div> </div> using javascript, there many ways accomplish you're trying do. the easiest make onclick() on button, , change "action" of form before submitting.

implement combinatoric algorithm in c++("put apples in different plates") -

i generated group of n-element arrays consist of alternating 1 , -1 followed zeros, starting 1. for example, n=5, arrays are: 10000, 1-1000, 1-1100, 1-11-10, 1-11-11, i need “insert” zeros between non-zero numbers each array: 1-1100 in above example, enumeration is: 1 -1 1 0 0,(allow 1 , -1 have no 0 between them.) 1 -1 0 1 0, 1 0 -1 1 0, 1 0 -1 0 1, 1 0 0 -1 1, 1 -1 0 0 1 (the first element still needs 1) is there algorithm generate such enumeration given array above format? i think problem putting identical apples different plates(because putting zeros different gaps gives different enumeration) , allowing plates remain empty. i need print out possibilities, not count them. can't figure out way it. this simpler appears. the first element 1. thus, can ignore that, , prepend 1 our answers. the nonzero elements, after initial 1, -1, 1, -1, etc. since pattern fixed, can replace nonzeros 1, translate back. so have list of 0's , 1's , ne

mysql - Delete from table A where no children exist in table A and no children exist in table B -

i have traditional parent/child table simple tree categorisation , 'page' table pages linked categories: **table: cat** c_id c_name parent_id **table: page** p_id page_name c_id i perform deletion only if there no child categories in cat table , no child pages in page table . know how counting , checking first. but, want know if can achieved elegantly in single query , affected rows. i've tried , doesn't work i think disallowed select target table in delete query? delete cat c_id=x , not exists ( select count( distinct p_id ) pages page c_id =x ) , not exists ( select count( distinct c_id ) children cat parent_id =x ); a delete join work, when deleting joined table. here left join check if there connections (c2 possible parent, , p possible referring page) finally delete rows there no connections (ie connections retu

netbeans - Problems adding native DLLS to Java runtime (JIntellitype) -

i'm trying jintellitype function java application, stuck @ following exception: exception in thread "awt-eventqueue-0" com.melloware.jintellitype.jintellitypeexception: not load jintellitype.dll local file system or inside jar @ com.melloware.jintellitype.jintellitype.<init>(jintellitype.java:114) @ com.melloware.jintellitype.jintellitype.getinstance(jintellitype.java:177) @ marketbot.settingswindow.<init>(settingswindow.java:27) @ marketbot.marketbot$2.run(marketbot.java:129) @ java.awt.event.invocationevent.dispatch(invocationevent.java:251) @ java.awt.eventqueue.dispatcheventimpl(eventqueue.java:733) @ java.awt.eventqueue.access$200(eventqueue.java:103) @ java.awt.eventqueue$3.run(eventqueue.java:694) @ java.awt.eventqueue$3.run(eventqueue.java:692) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$1.dointersectionprivilege(protectiondomain.java:76) @ java.awt.

c# - CPU is 100% at multithreading -

first i've read posts here regarding issue , manged progress bit. seems need :) i have program several threads, (not always) cpu usage of program increasing 100% , never reduced until shut down program. as read in other similar posts, ran app using visual studio (2012 - ultimate). paused app, , open threads window. there pauses threads until i've found 4 threads stuck app. refer same line of code (a call constructor). checked constructor inside , outside , couldn't find loop cause it. more careful i've added break point every line of code , resume app. none of them have been triggered. this line of code: public static void generatedefacementsensors(icrawlermanager cm) { m_sensorsmap = new dictionary<defacementsensortype, defacementsensor>(); // create instance of sensors // new defacement sensor, don't forget add appropriate line here // m_sensorsmap.add(defacementsensortype.[type], new [type]sensor())

html - Link Bootstrap Button -

i have piece of code in flask application want implement button takes me specific page. <button type="button" class="btn btn-primary btn-block">evaluate</button> how link button? did putting tag wrapping it, can use tag directly? (using tag changing styling) *i did code below, not me <a href="{{url_for('evaluate')}}"><button type="button" class="btn btn-primary btn-block">evaluate</button></a> use <a> tag instead <a href="someurl" class="btn btn-primary btn-block">evaluate</a> use href attribute navigate new location. bootstrap take care of presenting <a> tag button css classes.

c# - You do not have permission to view this directory or page. (ASP.NET website to Azure) -

i have uploaded asp.net site azure when try browse message: "you not have permission view directory or page." i have nothing in web.config file right , have tried google on , tried code (just copied/pasted it) without progress: <system.webserver> <handlers> <add name="iisnode" path="server.js" verb="*" modules="iisnode" /> </handlers> <rewrite> <rules> <rule name="sommarstugan"> <match url="/*" /> <action type="rewrite" url="server.js" /> </rule> </rules> </rewrite> then says instead: "the resource looking has been removed, had name changed, or temporarily unavailable." my startpage called "default.aspx" , located in folder called "html" , have tried ti change index.aspx nothing changed. what should do? tnx call hostname/html/default.a

solaris - Memory efficient calling of external command in Python -

i have python script needs load lot's of data calling lot's of external commands. after couple hours crashes this: .... process = subprocess.popen(cmd, stdout=subprocess.pipe, stderr=subprocess.pipe, close_fds=true) file "/usr/lib/python2.6/subprocess.py", line 621, in __init__ errread, errwrite) file "/usr/lib/python2.6/subprocess.py", line 1037, in _execute_child self.pid = os.fork() oserror: [errno 12] not enough space abort: not enough space ... though machine have more memory available script using. the root cause seems every fork() requires twice memory parent process released calling of exec() (see: http://www.oracle.com/technetwork/server-storage/solaris10/subprocess-136439.html ) ... in case above worse because i'm loading data in multiple threads. so see creative way how workaround issue? do need launch external command or fork 1 you're running? if need run script try: subprocess.call() i.e. subprocess.call([&

c# - Recommended way to host a WebApi in Azure -

i wanted host webapi project on azure. not getting sure way should use run on azure. there websites , cloud services contain web role , worker role. 1 should choose. if cloud service option 1 out of web role , worker role good? any appreciated. for hosting simple web api (that can scale according usage, etc.) you'll want use websites. assuming you're not looking more complex / heavy-weight features (network configuration, more complex architectures e.g. offloading background processing different instances via queueing mechanisms, rdp host machine, etc.), websites becoming de-facto way host websites on azure. the following page azure documentation give full feature comparison between two: http://azure.microsoft.com/en-us/documentation/articles/choose-web-site-cloud-service-vm/ , in short, if have web api project in vs want host in azure without worrying underlying infrastructure, use websites.

python - Pixel Tracking for a django based email -

i wanted know, of emails, have sent have opened email. here how approach solve problem - create image file in html template should rendered. < img src="{{ tracking_url }}" height="1" width="1"> once email opened request made url, have base64 encoded url pattern: base64_pattern = r'([a-za-z0-9+/]{4})*([a-za-z0-9+/]{2}==|[a-za-z0-9+/]{3}=)' url(r'^tracking/(?p{})/$'.format(base64_pattern), 'tracking_image_url', name='tracking_image_url'), that url serve image, , update counter, follows - transparent_1_pixel_gif = "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b" view - def tracking_image_url(request, mail_64=none): eml = base64.b64decode(mail_64) // update counters in db table email address. return httpresponse(transparent_1_pixel_gif, content_type=

excel - How to use data entered into userform in main module -

i new coding vba. have userform 5 textboxes. user enter integer in first textbox , cell locations (e.g. a1) in last 4 textboxes. want these data used in main module. need use integer in loop, i.e. loop until counter reaches integer. need use cell locations begin accessing different datasets, anywhere within sheet. i having trouble accessing these data in main module. hide form when user clicks ok button. test code writing data textboxes cells. the code main module: sub sort2stack() userinput.show cells(5, 22).value = testperiod.value 'integer entered in textbox 1 cells(6, 22).value = ymloc.value 'cell location entered in textbox 2 cells(7, 22).value = yfloc.value ' . cells(8, 22).value = nmloc.value ' . cells(9, 22).value = nfloc.value 'cell location entered in textbox 5 end sub i runtime error 424, object required. pretty , have searched while--new this. please advise. thank in advance! cells(5, 22).value = use

Append list in Python -

i need first create empty list, insert 1 element , save disk. again read list disk , append element list , again save list disk , again read list , save element further operations , on. current code: import pickle emptylist = [] # create empty list x = 'john' #this data coming client, change on each server call emptylist.append(x) # append element open('createlist.txt', 'wb') f: # write file pickle.dump(emptylist, f) open('createlist.txt', 'rb') f: # read file my_list = pickle.load(f) print my_list # print updated list now updated list this: #if x = 'john' ['john'] #if x = 'george' ['george'] #if x = 'mary' ['mary'] # ..... , on what want append elements, this: ['john','george','mary',....] just change emptylist = [] # create empty list to emptylist = [] if not os.path.exists("createlist.txt") else pickle.load(open("cre

java - Openssl is not recognized as an internal or external command -

i wish generate application signature app later integrated facebook. in 1 of facebook's tutorials, found command: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 in tutorial, says running cmd, process of generating signature start. however, command gives error: openssl not recognized internal or external command how can rid of this? well @ place of openssl ... have put path openssl folder have downloaded. actual command should like: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | "c:\users\abc\openssl\bin\openssl.exe" sha1 -binary | "c:\users\abc\openssl\bin\openssl.exe" base64 remember, path enter path have installed openssl...hope helps..:-) edit: you can download openssl windows 32 , 64 bit respective links below: openssl 64 bits openssl 32 bits

php - getting Select tag value by ajax -

<?php include('connection.php'); $query="select * category"; $result=mysql_query($query,$conn); echo' <select name="category" id="uni" >'; //the select tag start here,it gets options database while($catrow=mysql_fetch_array($result)) { echo'<option value="">'; echo'<option value="'.$catrow['id'].'">'.$catrow['name']. '</option></form>'; } echo'</select>'; ?><br /> now have ajax codes this,i know how input value ajax dont know how select tags value ajax. i use line of code input types: function checkuser() { var str=document.form.category.value; xmlhttp=getxmlhttpobject(); if (xmlhttp==null) { alert ("browser not support http request"); return; } //this line inputs value,how can select tag's?????

Trigger PHP with javascript -

i have php process get's user's ip address, page on, screen resolution , date/time on website. i want put line of code on other website such as: <script type="text/javascript" src="http://www.mywebsite.com/tracker.js"></script> in javascript file, post information file called tracker.php processes information put in database. i assume you're asking how send asynchronous request tracker.php, aka ajax. w3 schools has guide on here: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp the ip address , date/time can gotten without passing information down website. if want pass information such page on , resolution of viewing area, 1 easy way pass url variables. xmlhttp=new xmlhttprequest(); xmlhttp.open("get","tracker.php?windowwidth=" + window.innerwidth +"&windowheight=" + window.innerheight + "&page=" + encodeuricomponent(document.url) ,true); xmlhttp.send(); these

How to see DOM changes real time Chrome Dev Tool? -

i not sure, appears js changes not reflect in 'element' tab section executed. don't see changes document.write( '<script src="' + scriptsrc + '" type="text/javascript"><\/script>' ); if , how able see js changes real time in dom chrome dev tool? if chrome dev tool doesn't provide capability, tool there this? thank helping

unit testing - clojure.test (is (thrown? ...) not seeing exception -

i have function param-values throws illegalargumentexception when cannot find key in liberator context. have clojure.test unit test this: (testing "non-existing key" (is (thrown? illegalargumentexception (param-values ctx [:baz])))) for reason, test failing, though can see function behaving correctly in repl: user> (param-values ctx [:baz]) illegalargumentexception missing required param baz resources/param-value (resources.clj:57) user> (is (thrown? illegalargumentexception (param-values ctx [:baz]))) fail in clojure.lang.persistentlist$emptylist@1 (form-init2687593671136401208.clj:1) expected: (thrown? illegalargumentexception (param-values ctx [:baz])) actual: nil param-values quite simple; maps on specified args param-value : (defn param-values [ctx args & [{:keys [optional-args] :as opts}]] (let [params (or (get-in ctx [:request :params]) {}) args (concat args optional-args)] (map #(param-value params % opts) args))) of