Posts

Apache - Find the number of requests for a file -

so here's problem: want find out how many times file(or files) has been viewed(or downloaded). can kind of info apache logs, , if yes how? with apache access logs able identify whether particular resource accessed or not along response code. have count number of such accesses resulted in success response. this, may have grep previous logs. don't think there straight forward way this. if logs huge, consider map , reduce framework achieve this. another option have app server delivers resource using controller, , persist count in database, inefficient.

javascript - Data binding inside <option> element in angular.js and jQuery mobile -

i have added multi-language support jquery-mobile/phonegap app using this great repo on github . it uses firebase , angular.js bind language dependant labels , texts in app selected language, in example: <h2>{{getword("selection_criteria")}}</h2> however, there language-dependant texts in app cannot bound language data, have found far: <select id="sel" data-role="slider"> <option value="off">{{getword("select_off")}}</option> <option value="on">{{getword("select_on")}}</option> </select> the <option> element doesn't allow bind it's text data (the rendered text empty). don't know why. tried test whether work: <option value="off">{{1+2}}</option> and yes, displayed number 3 in slider. the angular.js part looks this: function languagectrl($scope) { $scope.words = json.parse('{}'); $...

sorting - Sort a table with multiple <tbody> in jquery table sorter 2.0 -

i have table lets say <table id="mytable"> <thead> <th>id</th> <th>name</th> </thead> <tbody> <tr> <td>1</td> <td>sam</td> </tbody> <tbody> <tr> <td>2</td> <td>alex</td> </tbody> </table> how can sort using tablesorter 2.0 if use $("#mytbale").tablesorter(); sort single tbody. i have fork of tablesorter sort each tbody separately. if have tbody don't want sort, add class name contained within cssinfoblock option - default tablesorter-infoonly . <tbody class="tablesorter-infoonly"> <tr> <th>the contents of tbody</th> </tr> <tr> <td>will not sorted</td> </tr> </tbody>

java - Preferences-like Framework for multiple VM's -

i coding settings project. today have found out project running on multiple vm's , why have scrap preferences wrapper , code new one. what java.util.prefs.preferences-like frameworks there except properties? want ability save more string types. thank you take apache commons preferences . supports several formats.

php - Unable to insert any record and returns error:MySQL returned an empty result set (i.e. zero rows) -

if(isset($_post['submitted'])) { //mysql_connect('localhost','root','')or die(mysql_error()); //mysql_select_db('ecommerce'); include_once ('mysql_connect.php'); if(is_uploaded_file($_files['image']['tmp_name'])) { // $image=$_files['image']['tmp_name']; if(move_uploaded_file($_files['image']['tmp_name'], "uploads/".$_files['image']['name'])) { if(!empty($_post['description'])) { $d=$_post['description']; } else { $d=null; } $query="insert uploads(file_name,file_size,file_type,description)values('{$_files['image']['name']}',{$_files['image']['size']},'{$_files['image']['type']}',$d)" or die(mysql_error()); mysql_query(...

java - Algorithm to calculate values based on width and height (coordinates and size) -

what want might separated several or 1 methods, whatever best. i have 4 values set (as fields): width of image whole image (canvas speak) height of whole image (height of canvas) padding (how many pixels want have padding) how many images in want in width , height separately (can separate values) what want have whole image, i'm putting small images inside (these bitmap sizes want method). i want have size of images inside, both width , height. , coordinates in of small images in whole image view. a small example might be: the width of image 200 , want padding of 4, , want have 3 images on 1 row of image. the calculation might this: (200 - (4*(3+1))) / 3 = 61,33; the 3+1 because want have padding on either side of small images. but width, have universal solution applies height well. and calculate height , width of every image inside canvas-image. and put sugar on top. have x , y coordinates of every image inside. how can done? , how every value? bi...

sh - Argument variables in a shell script -

i tips problem : i'd run script bash, 1 call suivitest2 launch ./suivitest2 : #!/bin/sh echo $1 echo"-----------------------------------" set classpath="" echo"-----------------------------------" echo $1 jar in lib/*.jar; classpath="$jar;${classpath}"; done echo using classpath $classpath /cygdrive/c/program\ files/java/jdk1.7.0_25/bin/java -classpath ${classpath} suivi.test.testsuivi conf/suivi.properties $1 echo $1 but gave me : $ ./suivitest2 chrp chrp ./suivitest2: line 4: echo----------------------------------- : command not found ./suivitest2: line 6: echo----------------------------------- : command not found classpath= using classpath lib/xmlsec-1.4.3.jar;lib/wss4j-1.5.9.jar;lib/velosurf-2.3-r526.jar;lib/velocity-> > 1.6-dev.jar;lib/suivi.jar;lib/stillness-0.1-dev.jar;lib/mysql-connector-java-5.1.13-bin.jar;lib/mail-1.4.jar;lib/jdom-1.1.jar;lib/dom4j-1.1.jar;lib/commons-net-3.1.jar;lib/...