Posts

Showing posts from January, 2015

Extracting IIS Configuration in C++ -

Extracting IIS Configuration in C++ - i need extract iis configuration text files compare files (using windiff) create sure have same configuration on every server have ( there many of them - offer on demand services ). in purpose, i'm looking way extract / dump iis configuration through c++ program. i've tried read "applicationhost" xml file, can't so. if have done kind of things helping. i've seen there api given msdn documentation not clear me. thanks. c++ iis

Arguments to C program question -

Arguments to C program question - possible duplicate: should utilize char** argv or char* argv[] in c? what difference between using char **argv , char *argv[] sec parameter c program. impact way strings passed? :-) there absolutely no difference. @ all. in c void f(int*); and void f(int[]); and void f(int[42]); are 3 identical declarations. c command-line-arguments

Javascript prototypical inheritance creates extra properties in the derived classes -

Javascript prototypical inheritance creates extra properties in the derived classes - when inheritance in js, find properties in derived classes duplicates of base of operations class properties; can't guess how forcefulness derived class utilize properties of base of operations class. need little shove in right direction can prepare inheritance model or can alter way using prototypical inheritance. let's start typical inherit function: function.prototype.inheritsfrom = function( parentclassorobject ){ if ( parentclassorobject.constructor == function ) { this.prototype = new parentclassorobject; //normal inheritance this.prototype.constructor = this; this.prototype.parent = parentclassorobject.prototype; } else { this.prototype = parentclassorobject; //pure virtual inheritance this.prototype.constructor = this; this.prototype.parent = parentclassorobject; } homecoming this; }; you've seen before. create next inherita...

java - Why doesn't this GestureDetector work? -

java - Why doesn't this GestureDetector work? - i want observe fling-gestures on relativelayout called belowcontainer, code looks this: // create new gesturelistener gesturedetector.simpleongesturelistener gesturelistener = new gesturedetector.simpleongesturelistener() { @override public boolean onfling(motionevent e1, motionevent e2, float velocityx, float velocityy) { log.d("test", "velocityx=" + velocityx); homecoming true; } }; // setup new gesturedetector, attach custom gesturelistener final gesturedetector gesturedetector = new gesturedetector(this, gesturelistener); // attach gesturedetector belowcontainer ontouchlistener belowcontainer.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view view, motionevent event) { log.d("test", "clicked!"); if(gesturedetecto...

c++ - How to iterate through such a map? How to fix 8 scary C2784 errors? -

c++ - How to iterate through such a map? How to fix 8 scary C2784 errors? - so seek compile such code: bool server_utils::find_service_by_name_iterator_function(std::pair<boost::shared_ptr<service>, server_utils::service_description> const & element, std::string name) const { homecoming element.second.name == name; } server_utils::service_description server_utils::stop_service_by_name(std::string name) { typedef std::map<boost::shared_ptr<service>, server_utils::service_description> map_t; map_t::iterator map_it = std::find_if(description.service_map.begin(), description.service_map.end(), std::bind1st(std::ptr_fun(&server_utils::find_service_by_name_iterator_function), name)); if (map_it != description.service_map.end()) { description.service_map.erase (map_it); } else { throw std::runtime_error("service such name not found map not found!"); } } where struct service_d...

c# - Upload files from client to server programmatically -

c# - Upload files from client to server programmatically - i'm working on fileupload command simple application transfer file server automatically. i used references samples setting file upload within webbrowser component , uploadfileex when tested doesn't create file on server! form code: // simulate form //<form action ="http://localhost/test.php" method = post> //<input type = text name = uname> //<input type = password name =passwd> //<input type = file name = uploadfile> //<input type=submit> i found class post file server using httpwebrequest: public static string uploadfileex( string uploadfile, string url, string fileformname, string contenttype,namevaluecollection querystring, cookiecontainer cookies) { if( (fileformname== null) || (fileformname.length ==0)) { fileformname = "file"; } ...

Php, wait 5 seconds before executing an action -

Php, wait 5 seconds before executing an action - i have .php script utilize creating list of products. on shared hosting, can't lot of queries otherwise blank page. this how utilize script now: script.php?start=0&end=500&indexoffile=0 ->> create product0.txt file first 500 products script.php?start=501&end=1000&indexoffile=1 ->> product1.txt file 500 products script.php?start=1001&end=1500&indexoffile=2 ->> product2.txt file lastly 500 products how can modify script create these files automatically, don't have alter each time link manually? i click button this: create product0.txt file first 500 products wait 5 seconds create product1.txt file with 500 products wait 5 seconds create product2.txt file lastly 500 products use: sleep(number_of_seconds); php

Authenticate a mobile handset using PHP -

Authenticate a mobile handset using PHP - i looking way authenticate mobile device web-app, ideally using php. i authenticate pc users ip address username/password provide level of security. want launch our application on mobile devices sec layer of security beyond username/password. obviously ip lookup not applicable mobile devices may alter ip frequently. i don't believe possible lookup device id number remotely check id. there few mobile users , have physical access devices. any ideas on best way this? install client ssl cert on each, , utilize authentication. php mobile

java - unable to execute a .sh script with Jsch -

java - unable to execute a .sh script with Jsch - i'm trying execute script shell in unix server java application (on windows 7 station) using ssh api jsch. the script shell i'm using "start_lm" c binary. this code i'm using (it's jsch website exemples) try{ jsch jsch=new jsch(); session session=jsch.getsession(user, host, 22); userinfo ui=new myuserinfo(); session.setuserinfo(ui); session.connect(); string command="user/psi/start_lm"; channel channel=session.openchannel("exec"); ((channelexec)channel).setcommand(command); channel.setinputstream(null); ((channelexec)channel).seterrstream(system.err); inputstream in=channel.getinputstream(); channel.connect(); while(true){ if(channel.isclosed()){ system.out.println("exit-status: "+channel.getexitstatus()); break; } try{thread.sleep(...

Double less than Ruby access -

Double less than Ruby access - i still new ruby , wondering how access info element stored in "double less than" structure: @email << {:envelope => envelope, :body => body} if do <% @results.email.each |result| %> <%= result %> <% end %> i get bodytest test envelope#<struct net::imap::envelope date="tue, 28 jun 2011 09:20:35 -0700", subject="test test", from=[#<struct net::imap::address name="some name", route=nil, mailbox="someinbox", host="somehost.com">], sender=[#<struct net::imap::address name="somename", route=nil, mailbox="somebox", host="somedomaincom">], reply_to=[#<struct net::imap::address name="someperson", route=nil, mailbox="somemailbox", host="somehost.com">], to=[#<struct net::imap::address name=nil, route=nil, mailbox="thisinbox", host="somehost.com"...

PhpStorm File open issue -

PhpStorm File open issue - i new using phpstorm, trying figure out 2 things giving me issues: when have phpstorm open , utilize windows explorer open php file cannot find file error. if close phpstorm , seek open, works fine. reason why happens need alter settings? how view projects created using phpstorm feature similar eclipse can switch , between multiple projects. thanks in advance. it's bug. phpstorm doesn't have workspaces concept, file | reopen recent project can utilize now. phpstorm

php - Zend_Layout + helperClass -

php - Zend_Layout + helperClass - i seek utilize helperclass in zend_layout options. create class: class helper_testi extends zend_controller_action_helper_abstract{ public function init(){ echo "111111111"; $this->fff = 'hello helper'; } public function getmessage(){ echo "=============="; homecoming "message"; } } and in bootstrap.php seek add together zend_layout: $options = array('layout' => 'layout','helperclass'=>'../application/controllers/helper/testi'); $layout = new zend_layout(); $layout->startmvc($options); but when reload browser see exception: fatal error: uncaught exception 'zend_exception' message 'file "../application/controllers/helper/testi.php" not exist or class "../application/controllers/helper/testi" not found in file' what wrong? help me please. try utilize app...

Create new git repo from already existing repo's subdirectory -

Create new git repo from already existing repo's subdirectory - i want create separate repo existing repo's subfolder. detach subdirectory separate git repository shows that. but, can't clean repo it. end 2 problems new repo: the history seems duplicated; i can't maintain branches history. here did: $ git clone ssh://.../repo.git $ cd repo $ git filter-branch --subdirectory-filter subdirectory head -- --all $ git reset --hard $ git gc --aggressive $ git prune after this, seems have original history of repo , new history. type "git log --all --graph" (or gitk --all) see, first commit, initial commit of first repo. graph shows original repo's total history until lastly commit. then, have sec history on top of first 1 showing history of subfolder want. in part of history have "master" , no branches/merges. "git log", gitk or gitg show "flatten" history only: don't show initial repo's history before...

How do I use Selenium IDE on Firefox to test JavaScript generated codes? -

How do I use Selenium IDE on Firefox to test JavaScript generated codes? - i trying test website contains alot of javascript. javascript alot of opening new dialog allow user take "yes" or "no". has function upon right clicking, opens right click menu contains many functions such zip, delete etc. in selenium, can utilize selenium ide login, click, , others, don't know how test functions. i've read there codes can write such in java run test, i'm hoping create work using simple selenium ide if possible. if not, can post simple testing code works run java scripts? such click button -> javascript menu pops -> click ok on pop up. thank much. right context menus can little tricky. i'd suggest making custom commands right click context menu. add together code article custom user-extensions.js file. http://old.nabble.com/how-to-recognise-right-click-of-the-mouse-in-ide-td14913052.html the parameters these functions in the...

mysql - How do I parameterize how users input their Connection Strings in C#? -

mysql - How do I parameterize how users input their Connection Strings in C#? - i've learned how parameterize text boxes when we're talking inserting info within database, i'd implement same technique while manually putting connection string sql database. code goes this: connectionstring = "server=localhost;uid=" + usr.text + ";pwd=" + pwd.text; and think quite vulnerable sql injections. suggestions? it's not vulnerable sql injections since sql isn't beingness used in case. can't access tables , records specifying in connection string, nor can receive info specifying connection string. it is vulnerable connection string property injection, nikola mentions in answer. see question, " ms access - prevent sql injection in connection string ". c# mysql

Maven 3.0.3 - how to check dependency conflict reason -

Maven 3.0.3 - how to check dependency conflict reason - is there easy way check reason of dependency conflict in maven 3.0.3? easy maven 2.x using debug mode (-x switch). since maven 3.0.3, -x doesn't show dependencies resolution problems. maven produce conflict info without giving underlying source reason. with maven (>= 3.0.0) utilize sonatype m2eclipse plugin eclipse or alternative latest spring tool suite graphically visualize dependency tree , hence solve conflict problem. 1 time maven project imported ide open pom 'maven pom editor' , see 'dependency hierarchy' , 'dependency graph' tabs. import maven project, go file / import project / maven / existing maven projects. in order utilize downloaded maven 3.x.y version instead of default eclipse-embedded maven installation, go windows / preferences / maven / installations , add together external maven home location. additionally shall enable 'show advanced tabs in pom editor' in...

css3 - CSS equivalent to Photoshop's Justify-All -

css3 - CSS equivalent to Photoshop's Justify-All - i'd take h2 element , span it's text across width of it's div. text-align:justify; only spreads text if it's width greater width of it's container... kind of photoshop's justify-left css: h2 {text-align: justify;} h2 span {width: 100%; display: inline-block;} html: <h2>this h2 heading<span></span></h2> note adds unvisible line, resulting in much height. might want compensate that: h2 {text-align: justify; height: 1.15em;} and neat markup, working browsers other ie7 or below, utilize ::after selector: h2::after { width: 100%; display: inline-block; content: "."; visibility: hidden; } see demo fiddle of 3 solutions. css css3 photoshop justify text-align

java - TreeSet contains method doesn't work for me -

java - TreeSet contains method doesn't work for me - i want set custom's info treeset . when custom number same, add together volume of trade. here tradenode class implements comparable interator. import java.util.comparator; public class tradenode implements comparable<tradenode> { private string cstm; // custom number private integer mon = 0; // trade public tradenode() {} public tradenode(string cstm, int mon) { this.mon = mon; this.cstm = cstm; } public int compareto(tradenode o) { if (o.cstm.equals(this.cstm)) { o.mon += this.mon; homecoming 0; } else if (this.mon == o.mon) { homecoming this.cstm.compareto(o.cstm); } else { //return (o.mon - this.mon); homecoming o.mon.compareto(this.mon); } } @override public boolean equals(object obj) { if (this =...

android - Display a view containing magnified image along with some text -

android - Display a view containing magnified image along with some text - i have listview having 2 textviews , image. when touch image, want display view containing magnified iamge along text below alternative close view. don't want create whole new activity this. kindly assist how can accomplish this? stone try utilize custom dialog box. custom dialog android

iphone - How to subclass UINavigationBar for a UINavigationController programatically? -

iphone - How to subclass UINavigationBar for a UINavigationController programatically? - i'm using custom drawrect function draw on uinavigationbar across application in ios4, doesn't utilize images, coregraphics. since can't implement drawrect in uinavigationbar category in ios5, apple suggesting subclass uinavigationbar . how possible replace uinavigationbar subclass in uinavigationcontroller (so it'll compatible ios4 , ios5) when navigationbar property read only? @property(nonatomic, readonly) uinavigationbar *navigationbar i'm not using xibs in application @ all, adding uinavigationbar nib , changing class via interfacebuilder not option. as of ios6, quite simple accomplish without swizzling or messing other classes using uinavigationcontrollers method initwithnavigationbarclass:toolbarclass: - (id)initwithnavigationbarclass:(class)navigationbarclass toolbarclass:(class)toolbarclass; from docs: initia...

javascript - Why embedding jQuery code into $(function())? -

javascript - Why embedding jQuery code into $(function())? - i used different jquery plugins , in cases not working (or not working @ all) until embedded them $(function({ ... })) . as illustration plugin: $('#datetextbox').datetimepicker(); does not work, if in plugin web site used in same form. placing within $(function()) turns working perfectly: $(function () { $('#datetextbox').datepicker(); }); what statement "$(function ())" brings exactly? tried search in same jquery web site did not find answer. what statement "$(function ())" brings exactly? it makes sure code not executed before page has finished loading. shorthand for $(document).ready(function () { // ... }); read: http://api.jquery.com/ready/ javascript jquery jquery-plugins

Using array in php query? -

Using array in php query? - i want obtain number of rows in query using mysql_num_rows.the query contains 2 arrays. want store number in array. here's code $antecedent=array(); for($i=0;$i<=$index;$i++){ if(isset($period[$i])|| isset($gpa[$i]) || isset($antecedent[$i])){ $queryantecedent=mysql_query("select * mytable study_period='$period[$i]' , ipk='$gpa[$i]'") or die (mysql_error()); $antecedent[$i]=mysql_num_rows($queryantecedent); }//endif }//endfor print_r ($antecedent); when used 1 array within query, code works. on other hand, when set 2 arrays in it..the code doesn't work(all element in array antecedent contain 0). how slve this? no way using 2 arrays in query? give thanks you if you're not getting mysql error when query runs, query returning no rows. seek building query separately , store in variable, can view you've built: $sql = "select * mytable study_period='$pe...

javascript - Overwriting key events -

javascript - Overwriting key events - how overwrite or remove key events, on website? i'm writing script greasemonkey , want create event on come in button, when press come in button, triggers function on website. edit 1: here website, need http://lockerz.com/auth/express_signup one of these 2 should you. used first one, although on told me sec 1 work also. went hammer. sorry, first 1 wasn't cutting , paste answer. utilize using homecoming up/down arrow command on website. changed identifies keycode 13 instead. (function() { function keykiller(event) { if (event.keycode == 13 ) { event.cancelbubble = true; event.stoppropagation(); homecoming false; } } window.addeventlistener('keypress', keykiller, true); window.addeventlistener('keydown', keykiller, true); })(); javascript

html - JQuery floating div stop after scrolling down certain div -

html - JQuery floating div stop after scrolling down certain div - please check link http://jsfiddle.net/sasindu555/xaytt/ i want stop floating special_features div after scrolling downwards stop div. how that. please help me. thanks. try below code - wroks expected http://jsfiddle.net/sasindu555/xaytt/ var name = "#special_features"; var menuyloc = null; $(document).ready(function(){ $(name).css("top", $("#start").offset().top - 10); menuyloc = parseint($(name).css("top").substring(0,$(name).css("top").indexof("px"))) $(window).scroll(function () { var offset = menuyloc+$(document).scrolltop(); if(offset > $("#stop").offset().top){ offset = $("#stop").offset().top - 10; } else if(offset < $("#start").offset().top){ offset = $("#start"...

TextMate: Shortcut to go to the first non-whitespace character in the line -

TextMate: Shortcut to go to the first non-whitespace character in the line - i textmate. however, after using long time , searching several times, haven't been able find shortcut takes me origin of line way want. commonly want cursor @ origin of line, after whitespace. for example, in next code if cursor @ end of line puts 'hi' , , type ⌘ ← , set cursor @ origin of line, , rather set cursor next 'p' @ origin of line. there such shortcut? class test def greet puts 'hi' end end although it's not one-keypress solution, when want press... cmd + ← opt + → textmate

android - Eclipse not showing the 'USB Driver package' -

android - Eclipse not showing the 'USB Driver package' - i downloaded , installed latest version of eclipse , android sdk , adt yesterday, july 15, 2011. but when open eclipse, , go menu item window->android sdk , avd manager , select 'available packages,' there no "usb driver package" installed , i'm on windows vista , led expect usb bundle there install it. i apparently got eclipse 'indigo' release; , version: 12.0.0.v201106281929-138431 of adt the 'android development' book says need usb driver bundle able debug on actual android device, opposed debugging using emulator. why isn't usb driver bundle showing up? i installed eclipse galileo , version 3.2 of android sdk , avd manager. had same problem (usb driver bundle not in available packages)- went "installed packages" , pressed 'update all' button @ bottom of window. take packages install window appeared google usb driver bundle abl...

iis - Problem with multiple ISAPI Extensions processing the same request (Exchange 2003) -

iis - Problem with multiple ISAPI Extensions processing the same request (Exchange 2003) - i trying add together isapi extension read request content before goes on original extension processes request. to more specific, added isapi extension in exchange 2003 activesync folder (more details later) above microsoft's original "massync.dll" processes activesync requests. deployment: 1. under iis manager-->web service extensions, added extension , set "allowed" 2. under iis manager-->web sites-->default web site-->microsoft-server-activesync-->properties-->virtual directory-->application settings-->configuration, inserted extension above original "massync.dll" on httpextensionproc(), extension returns hse_status_success. the problem extension catches request , able read content. however, extension, request not proceed next extension , activesync process fails. how create request proceed next extension extension inst...

jQuery: Multiple selector issue -

jQuery: Multiple selector issue - i having problems showing divs div has 3 selectors need match on. these typical: <div class="pinfo draft sept-2010">...</div> <div class="pinfo published feb-2011">...</div> etc... there pinfo followed review state (published or draft) , time frame (month + year) this have: // hide rows $(".pinfo").hide(); // now, show rows selectors in filters built (idx in $cls) { console.log('filter: '+$cls[idx]); $('.pinfo').filter($cls[idx]).show(); } where $cls array of strings. strings class selectors built given choices made user input form. example: $cls = [".draft .sept-2011", ".published .sept-2011"] i having problems showing divs div has 3 selectors need match on. any help appreciated. thanks! eric don't utilize for..in loop on an array. utilize them on objects, , hasownproperty . can utilize jquery's ...

javascript - Adding space to the bottom of textarea -

javascript - Adding space to the bottom of textarea - can't seem find decent way of doing this. editor total screen editor, not normal textarea. total screen editing , issue is, currently, 1 time reach end of page always typing @ bottom of browser window unless press come in bunch of times. i thinking adding bunch of \n\n\n\n\n bottom of textarea there (if erase them , start typing 1 time again pops them in), wasn't sure how that'd work or best way implement that. ideas? my best thought was, check if lastly n characters of textarea value equal deemed buffer, i.e. 6 \n s doing little regex. if not equal, it'd add together bottom , scroll bottom (making padding). using javascript , jquery (1.6, .prop() examples, not .attr() !) here's screenshot scrolled downwards (no padding): ==update== problem padding editor seen not total screen , looks strange: the solution think needs go modifying actual text on fly... maybe try applying pa...

javascript - How do I stop getting this ReferenceError in node.js? -

javascript - How do I stop getting this ReferenceError in node.js? - 183| }); 184| >> 185| <% if(just_registered) { %> 186| alert("welcome!"); 187| <% } %> 188| just_registered not defined basically, want say: if just_registered defined , true, alert. however, want want set false...i want leave undefined (i have 100 variables) <% if(typeof just_registered !== "undefined") { %> basically checking whether local variable exists. have utilize typeof operator since accessing just_registered undeclared local variable creates reference error. this best compared var foo; if (foo) { } vs //var foo; if (foo) { } // referenceerror where as //var foo if (typeof foo !== "undefined") { } will work because accessing undeclared variable typeof operator returns "undefined" rather throwing referenceerror javascript te...

Bash and variables -

Bash and variables - scenario $ var1=test $ var2=testing $ var3=$var1_$var2 $ echo $var3 testing i expected "test_testing" output. why not working? how output in "test_testing" format? (make $var1_$var2 work) does interprets var3=$var1_$var2 var3=$(var1_$var2) ? try: var3="$var1"_"$var2" it interprets var3=$var1_$var2 $var1_ + $var2 --- there no variable named $var1_ bash

ios - Xcode 4 keeps crashing -

ios - Xcode 4 keeps crashing - everytime seek provision app onto iphone 4, iphone screen goes black status bar start app, in xcode spinning rainbow globe , have forcefulness quit every time. i cleaned target, cleaned caches onyx, , repaired permissions, still happening. please help!! i inserted breakpoint in main.m file, , of sudden works. either after not trying while, or jutting working. ios xcode

java - "Could not find the main class" -

java - "Could not find the main class" - i'm trying run sample java application command promopt i'm getting next error: exception in thread "main" java.lang.noclassdeffounderror: com/badlogic/gdx/helloworld/helloworlddesktop caused by: java.lang.classnotfoundexception: com.badlogic.gdx.helloworld.helloworlddesktop @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:190) @ java.lang.classloader.loadclass(classloader.java:306) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) @ java.lang.classloader.loadclass(classloader.java:247) not find main class: com.badlogic.gdx.helloworld.helloworlddesktop. programme exit. the command i'm using seek , run app is: java -cp .;gdx.jar;gdx-backend-jogl.jar com.badlogic.gdx.helloworld.helloworlddesktop where relevant fi...

android - How to go back after playing video -

android - How to go back after playing video - i have application makes list of videos play button. when click on play button, separate activity started using intent. want when video playback finished, activity should automatically finish , go main activity. here code creating videoview. public void oncreate(bundle icicle) { super.oncreate(icicle); setcontentview(r.layout.videoview); intent = getintent(); bundle extras = i.getextras(); filename = extras.getstring("videofilename"); mvideoview = (videoview)findviewbyid(r.id.videoview); path=filename; if (path == "") { toast.maketext( viewvideo.this, "no video selected, toast.length_long).show(); } else { mvideoview.setvideopath(path); mc = new mediacontroller(this); mvideoview.setmediacontroller(mc); mvideoview.requestfocus(); mvideoview.start(); } } ...

javascript - Closure trouble: passing "event" to named function -

javascript - Closure trouble: passing "event" to named function - i'm debugging bit of javascript suffering little closure problem - don't seem able pass "event" argument function. here's problem (in shorthand): // let's links.length == 3 for(var = 0; < links.length; i++){ links[i].onclick = function(e){ alert(i); //closure! links alert "3" // "e" } } here's solution //workaround // define function outside of loop function outer(e,i){ homecoming function(){ alert(i); //closure! links alert "3" // "e" } } for(var = 0; < links.length; i++){ links[i].onclick = outer(e,i); //uh oh! e = undefined??? } in workaround, i've defined function outside loop prevent closure - unable pass "e" argument it. can point me in right direction? define in returned function. function outer(i){ // ------------...

How come Python's dict doesn't have .iter()? -

How come Python's dict doesn't have .iter()? - def complicated_dot(v, w): dot = 0 (v_i, w_i) in zip(v, w): x in v_i.iter(): if x in w_i: dot += v_i[x] + w_i[x] homecoming float(dot) i'm getting error says: attributeerror: 'dict' object has no attribute 'iter' it has iter . can write for x in v_i: python

Question on "Converting Maven project of Mahout into Eclipse project" -

Question on "Converting Maven project of Mahout into Eclipse project" - while installing open-source software mahout, read notes like convert maven project of mahout eclipse project what mean? what's difference between maven project , eclipse project? install maven if haven't done it. enter command prompt or shell , navigate directory mahout located (there's pom.xml file). type command: mvn eclipse:eclipse which create project files eclipse , open project in eclipse. no conversion needed. eclipse supports maven projects, , vice-versa. difference between these 2 projects yield difference of tools. eclipse ide , maven build tool. in fact, ide superset of build tool. that's why eclipse may utilize maven building. mutual properties between projects relate how build beingness done , eclipse has set of properties aimed persist state between programming sessions. eclipse maven mahout

Why is custom variable data in the Google Analytics Data Export API data different from my Google Analytics dashboard? -

Why is custom variable data in the Google Analytics Data Export API data different from my Google Analytics dashboard? - i have custom variable defined on site , info beingness recorded in google analytics account. when go access info via google info feed query explorer, info isn't same. really, case 'visits' , metrics calculated using it. this see in dashboard: http://www.screencast.com/t/qjl21zompw this see in query explorer: http://www.screencast.com/t/wngliuuwum i made sure time frame matches , have pulled same metrics. 'hits' (aka pageviews) match every time. visits off , seems messing other metrics depend on it, such 'pages/visit' (aka pageviews per visit). i have reviewed code , custom variable beingness set prior recording pageview. missing something? understanding google uses exact same api run analytics dashboard, why getting different data? try removing visitors metric feed in query explorer. "visitor...

java - JSTL & Spring: Accessing methods with arguments -

java - JSTL & Spring: Accessing methods with arguments - i have object method public boolean haspermission(string role) { homecoming permissions.contains(role); } i want equivalent of: <c:if test="${row.haspermission(role)}"> <td></td> </c:if> but cannot access haspermission method within jsp file. how can it? the latest version of el (in tomcat 7 ex.) supports ( ${obj.method(arg)} ) if have older version have 2 options: make custom jstl function use jboss el extension java spring jsp jstl el

List of running programs in Linux using java -

List of running programs in Linux using java - i'm trying code task manager linux using java. i need list of running programs. , other info like: memory usage, cpu usage ... is possible java? thanks. try { // execute command string command = "ps aux"; process kid = runtime.getruntime().exec(command); // input stream , read inputstream in = child.getinputstream(); int c; while ((c = in.read()) != -1) { process((char)c); } in.close(); } grab (ioexception e) { } source (modified): http://www.exampledepot.com/egs/java.lang/readfromcommand.html java linux process operating-system

iphone - String to NSDate -

iphone - String to NSDate - i trying convert string date. have used next code. getting wrong date. thanks, nsstring *datestring = [nsstring stringwithformat:@"12-07-2011"]; //nsstring *datestring = [nsstring stringwithformat:@"%d-%d-%d", selecteddate.day, selecteddate.month, selecteddate.year]; nslog(@"%@",datestring); nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setlocale:[nslocale currentlocale]]; [dateformatter settimezone:[nstimezone localtimezone]]; [dateformatter setdateformat:@"dd-mm-yyyy"]; nsdate* d = [dateformatter datefromstring:datestring]; nslog(@"%@",d);     uialertview *alert = [[uialertview alloc] initwithtitle:@"selected date" message: [nsstring stringwithformat:@"%@",d] delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alert show]; [alert release]; the problem using min , not month. m ...

c# - Is there a performance difference between int i =0 and int i = default(int)? -

c# - Is there a performance difference between int i =0 and int i = default(int)? - i creating integer , wanted instantiate 0 before working with. i wrote firstly int = default(int); then removed replace other 1 is int = 0; i know if selection best in mini mini performance. default() function increment instructions @ compile time? no, resolved @ compile time , produce same il. value types 0 (or false if have bool, that's still 0) , reference types null . c# .net c#-4.0

facebook discussion on my web page - how to make comments visible for everyone? -

facebook discussion on my web page - how to make comments visible for everyone? - i have facebook give-and-take on web page , works, i'm unable see comments of users not in friend list. administrative purposes, described here http://developers.facebook.com/docs/reference/plugins/comments/ i've added between <meta property="fb:admins" content="{your_facebook_user_id}"/> with facebook user id, unable find administration settings or that. give thanks you! facebook comments

class - C# - Complex variable-assignment -

class - C# - Complex variable-assignment - i have class row . class should have content-property. content of type: list<irowcontent> ( irowcontent interface) other classes column , textcontent , imagecontent implements interface irowcontent . i can add together columns list or real "content" (text or image). but can add together columns , text/image. if row contains text/image should not contain item. how can design class-structure back upwards this? edit: additionals infos: want build layout "fluent interfaces" http://en.wikipedia.org/wiki/fluent_interface and idee prevent wrong utilize intellisense of visualstudio. here classes: layout have column-list. class layout { //attributes public color background { get; set; } public list<column> columns { get; set; } public uint margin { get; set; } public layout addcolumn(column c) { homecoming null; } public layout...

asp.net mvc 3 - Entity Framework 4 Navigation property null value throws an exception -

asp.net mvc 3 - Entity Framework 4 Navigation property null value throws an exception - i trying setup editing functionality using mvc3 , entity framework 4. have navigation property adding client entity allow me access 1 many related entity. have related entity defined virtual - client property in below customersite entity namespace customerorders.domain.entities { public class customersite { [hiddeninput(displayvalue = false)] [key] public int customersiteid { get; set; } [hiddeninput(displayvalue = false)] [displayname("customer id")] public int customerid { get; set; } [required(errormessage = "please come in unit no/street name")] [displayname("address line 1")] public string addressline1 { get; set; } public virtual client customer { get; set; } } } when seek save edit customersite entity next exception object reference not set instance of object. now when inspect model values, null value ...

clojure - Using `line-seq` with `reader`, when is the file closed? -

clojure - Using `line-seq` with `reader`, when is the file closed? - i'm reading lines text file using (line-seq (reader "input.txt")) . collection passed around , used program. i'm concerned may bad style however, i'm not deterministically closing file. imagine can't utilize (with-open (line-seq (reader "input.txt"))) , file stream potentially closed before i've traversed entire sequence. should lazy-seq avoided in conjunction reader files? there different pattern should using here? since doesn't have clear reply (it's mixed comments on first answer), here's essence of it: (with-open [r (reader "input.txt")] (doall (line-seq r))) that forcefulness whole sequence of lines read , close file. can pass result of whole look around. when dealing big files, may have memory problems (holding whole sequence of lines in memory) , that's when it's thought invert program: (with-open [r (r...

mysql - Perl DBI without accessing the database -

mysql - Perl DBI without accessing the database - i'm creating set of sql insert statements database doesn't exist yet, , i'm saving them file. how can utilize perl's powerful dbi module create insert statements without accessing specific database. in particular, looks using $dbh->quote() function requires instantiate $dbh connection database. unfortunately, actual quote() behaviour isn't portable characteristic, each driver them differently. unless connect driver, don't know quoting format utilize in practice. (there 1 module might without connection, dbix::abstract , not current.). the quote() method implemented corresponding driver class, in dbd::* namespace. might effort load driver need , phone call function straight (see http://search.cpan.org/~timb/dbi-1.616/lib/dbi/dbd.pm#writing_dbd::driver::db::quote) feels grubby. i'd still create dbi connection, if right format of quoting. don't need send statements, know qu...

c++ - What happens when pthreads wait in mutex_lock/cond_wait? -

c++ - What happens when pthreads wait in mutex_lock/cond_wait? - i have programme should maximum out of cpu. it multithreaded via pthreads job apart fact "only" cores 60% load not plenty in opinion. i searching reason , asking myself (and hereby you) if blocking functions mutex_lock/cond_wait candidates? what happens when thread cannot run on in such function? does pthread switch thread handles or does thread yield time scheme , if latter case, can alter behavior? regards, nobody more information setting 1 mainthread fills taskpool , countless workers fetch jobs there , wait on conditional signaled via broadcast when serialized calculation done. go on values calculation until done, deliver mail service , fetch next job... on typical modern pthreads implementation, each thread managed kernel not unlike separate process. blocking phone call pthread_mutex_lock or pthread_cond_wait (but also, say, read ) yield time system. scheme find eligibl...

android - ListView setOnItemClickListener not working by adding button -

android - ListView setOnItemClickListener not working by adding button - i have list view text , button in each row, list view setonitemclicklistener() not working. possible handle item click , button click events differently(item click should phone call activitya , button click should phone call activityb). have solution private arraylist<string> useridarr = null; private arraylist<string> usernamearr = null; private databasehelper dbhelper = null; private listview userlistview=null; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.list_view); dbhelper = new databasehelper(this.getapplicationcontext()); map<string,arraylist<string>> displaymap = dbhelper.getuserlisttodisplay(); useridarr = displaymap.get("userid"); usernamearr = displaymap.get("firstname1"...

XCode converting project from C++ to Objective-C++ -

XCode converting project from C++ to Objective-C++ - how convert xcode c++ project xcode objective-c++ project, because doesnt threat ".mm" files objective-c++ files, c++ files generating lots of errors:) cannot utilize objc++ goodies thank you i think should do: c++ objective-c xcode

PHP Configuration for GMP and Large Number Arithmetic -

PHP Configuration for GMP and Large Number Arithmetic - i'm using php of problems on projecteuler.net, have found current installation of php, cannot compute numbers long or big plenty of problems. some initial research on stackoverflow , through google has told me must install extension php in order math big numbers. 1 such extension suggested gmp, not exclusively sure how configure php installation utilize gmp. i running windows 7 64-bit installation of xampp (i think version 2.5). there way configure current php build work gmp? how?! first seek bc extension. believe comes pre-installed on xampp. if doesn't work, requirements gmp here , instructions here. php configuration xampp gmp

nsstring - Leaks with NSStirng -

nsstring - Leaks with NSStirng - iam getting memory leaks in below code. is proper way handle memory? please right me. -(void)getholidays { if (idarray!=nil) { [idarray release]; idarray=nil; } idarray=[[nsmutablearray alloc]init]; if (countryarray!=nil) { [countryarray release]; countryarray=nil; } countryarray =[[nsmutablearray alloc] init]; if (holidaynamearray!=nil) { [holidaynamearray release]; holidaynamearray=nil; } holidaynamearray =[[nsmutablearray alloc] init]; if (datearray!=nil) { [datearray release]; datearray=nil; }datearray =[[nsmutablearray alloc] init]; if (dayarray!=nil) { [dayarray release]; dayarray=nil; }dayarray =[[nsmutablearray alloc] init]; if (favoritearray!=nil) { [favoritearray release]; favoritearray=nil; } favoritearray =[[nsmutablearray alloc] init]; nsstring *destinationpath = [self getdestinationpath]; const char *dbpath = [dest...

phone - Configuring softphone for asterisk - PBX -

phone - Configuring softphone for asterisk - PBX - i've been trying configure softphone (twinkle) work asterisk many days , no avail. i'm running both asterisk , softphone in linux on virtual machine. my sip.conf file looks this: [general] context=default allowoverlap=no bindport=5060 bindaddr=0.0.0.0 srvlookup=yes [1000] type=friend context=phones host=dynamic username=1000 in twinkle business relationship settings, have username:1000, domain: localhost this gives me error 403 forbidden. can please please help me figure out how prepare this? i'm running softphone on different sip port asterisk. thanks, dhruv my reply super weak seek before help advice. first of all: anytime create vm asterisk create tests or new ivrs have issues firewall. check if firewall on or off on linux box since can issue. have turn off or create proper setup it. secondly: @ sip configurations , yours specify secret=some_password , host=dynamic. might want seek ...

html - jquery slider problem -

html - jquery slider problem - i have slider scrolls on drag using jquery ui handle seems drag far off end of slide bar can anyoune see why might be? html <div id="content"> <div id="slidercontent"> <div class="viewer"> <div class="content-conveyor ui-helper-clearfix"> <div class="item"> <img src="images/slide_image_one.png"/> </div> <div class="item"> <img src="images/slide_image_one.png"/> </div> <div class="item"> <img src="images/slide_image_one.png"/> </div> <div class="item"> <img src="images/slide_image_one.png"/> </div> <div class="item"> <img src="images/sli...

Symbol lookup error: undefined symbol atexit (linux/C) -

Symbol lookup error: undefined symbol atexit (linux/C) - i error symbol lookup error: undefined symbol atexit (linux/c) when seek run program. atexit() should defined in <stdlib.h>. is there add together -l alternative when compile gcc? or else do? this in c. i trying write shared object phone call atexit once. define corresponding function explained here http://linux.die.net/man/3/atexit program call: ld_preload=mymal.so /bin/ls error message: /bin/ls: symbol lookup error: ./mymal.so: undefined symbol: atexit i don't error after compilation, when seek execute it. i build shared library commands (found in http://www.ibm.com/developerworks/library/l-shobj/): gcc -fpic -c -ldl mymal.c ld -shared -soname mymal.so.1 -o mymal.so -lc mymal.o solved: worked g++ instead of gcc the function called atexit , not atexit . c linux

image scanner - Twain detect landscape for scanning -

image scanner - Twain detect landscape for scanning - i writing programme images twain device. problem when set mode landscape scanner gui not program, cannot observe , image rotated wrong. if understand spec right icap_orientation should homecoming if landscape or portrait or different rotation. 1 scanner seek on returns twor_rot180 whether set landscape or portrait. different scanner twor_rot90 think sending right code it. understand wrong or doing else wrong? there different way observe landscape? thanks. i figured out getting capability icap_orientation wrong way, sending me wrong info before making changes. image-scanner twain

asp.net mvc 3 - MVC3 Minimise HTML output -

asp.net mvc 3 - MVC3 Minimise HTML output - i have been looking possibility of minimising html output in asp.net mvc. it seems there must simple httpmodule or manipulate rendering engine strip out spaces , other letters. anyone got ideas? html asp.net-mvc-3

logging - Apache logs, name them by IP? -

logging - Apache logs, name them by IP? - i have apache 2 installed , running away, logging stuff /logs folder called "access/error.txt" , wondering, lot, how create apache generate new access log file every unique ip connects, , log of user's requests in respective file. example, guy @ 173.49.91.61 visits server, apache automatically makes /logs/173.49.94.61.txt , logs accesses it. it? thanks, don't know if possible. know. grumbles self inaudibly let me first state bad idea, you'll have 1 file per ip address. may think that's cool , easy manage , all, until have 2 million+ unique visitors @ site , start run major issues. these issues include: low disk performance, not beingness able ls , rm in logging directory, , possibility of running out of inodes before run out of disk space. have been warned. that said, if really still want this, apache has customlog directive: http://httpd.apache.org/docs/current/logs.html#piped with this: cu...

Java reflection question -

Java reflection question - i working on project uses reflection fields of running java application. i managed fields, can not read or write them. illustration found on web: class aclass = myobject.class field field = aclass.getfield("somefield"); myobject objectinstance = new myobject(); object value = field.get(objectinstance); field.set(objetinstance, value); the problem utilize classes running jar file, , classes seek manipulate obtained classloader. instead of 'myobject.class' have '.class'. 'myobject' tried utilize classloader did not work. if utilize '.class': object value = field.get(theloadedclass); i error: java.lang.illegalargumentexception: can not set int field myclass.field java.lang.class thanks. this should help: class aclass = myclassloader.loadclass("myobject"); // utilize class loader , qualified class name field field = aclass.getfield("somefield"); // can not ut...

Android: AutoCompleteTextView with default suggestions -

Android: AutoCompleteTextView with default suggestions - how show default suggestions autocompletetextview before user type anything? cannot find way creating custom class extends autocompletetextview. i want show suggestions mutual input values save user typing. any suggestions? you should subclass autocompletetextview , override enoughtofilter() homecoming true time. after can phone call performfiltering("",0) (it's protected function, can export phone call via public function in class). something that: public class contactsautocompletetextview extends autocompletetextview { public contactsautocompletetextview(context context) { super(context); } public contactsautocompletetextview(context context, attributeset attrs) { super(context, attrs); } public contactsautocompletetextview(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } @override pub...

Adding Date in a file - C -

Adding Date in a file - C - i'm coding network game in c. 've written scores in file. wanted add together date of day. here file's construction : date name score , code : scorefile = fopen("scores.txt", "a"); fprintf(scorefile, "%s %d\n", name, score); i've tried system("date") it's printed on stdout. think can't add together date fprintf. do know solution permits add together date in file ? (maybe time.h ?) thanks lot !! consider using strftime convert time construction string. example (from link above): #include <time.h> // ... char s[30]; size_t i; struct tm tim; time_t now; = time(null); tim = *(localtime(&now)); = strftime(s,30,"%b %d, %y; %h:%m:%s\n",&tim); puts jul 9, 2011; 17:55:55\n in s c file date file-io time.h

java - Postgres with Glassfish connection pool -

java - Postgres with Glassfish connection pool - i new java ee world , want utilize postgresql database in web application. utilize glassfish application server , added connection pool via administration interface (i used site help). don't know "right" way utilize connection pool in application (in fact don't know how connection pool , write simple query). we need write pretty complex queries, don't know if should create mapping every table , utilize mappings, or utilize sql , kind of row mapper pars results (we used spring rowmapper before). so question are: what different ways there utilize connections pool? what (dis)advantages of these patterns? how create clever mapping can handle complicated , performance intensive query's. does work hibernate? , if so, how? 1 - if connection pool configured using glassfish, may develop simple ejb , inject connection using annotation, think best way handle connexion pool. (all examples compat...

How to take a screen shot in android -

How to take a screen shot in android - i want take screen shot in android irrespective of application , without rooting phone. have seen previous thread link followed instructions specific 1 application. , need alter layout file of every application. i came across link library. 1 thing not clear me in whether manifest.xml file should changed every application. can please allow me know if other ways possible? know security issue if application doesnt mind need take screen shots. thanks. if don't need status bar (or keyboard) can in activity: view root = findviewbyid(android.r.id.content); root.setdrawingcacheenabled(true); bitmap bm = bitmap.createbitmap(root.getdrawingcache()); root.setdrawingcacheenabled(false); completely untested should work. after seeing comment taking screenshots of other applications not believe want possible without rooting phone. android android-layout screenshot

C#. Does shortening identifier names increase overall run-time performance of an application? -

C#. Does shortening identifier names increase overall run-time performance of an application? - shortening identifier names makes resulting executable smaller in size since msil code includes these names except local variable ones. impact executing code in .net runtime in way in terms of performance, @ to the lowest degree in theory? native machine code doesn't include names interoperates .net runtime. wonder if makes sense obfuscate (namely shorten identifier names) msil code in order increment run-time performance of application @ to the lowest degree little. i surprised statement: "dotfuscator improves run-time performance. removing unneeded programme elements , renaming identifiers little names, dotfuscator can speed programs." http://msdn.microsoft.com/en-us/library/ms227226.aspx the identifier names discarded compiler/jitter, not create difference. c# performance runtime obfuscation

jquery - How can I find the fc-event div by having the event Object ID? -

jquery - How can I find the fc-event div by having the event Object ID? - i want append additional html event divs depending on info ajax function. i have grabbed eventobjects with var array = $('#calendar').fullcalendar( 'clientevents' ); for(var a=0; a<array.length; a++) { $.post(site_url+"/calendar/get_workers_on_job", { 'id' : array[a].id }, function(data) { for(var b=0;b<data.length;b++) { //here want append json info event div. } },'json'); } but can't figure out how find out event div associated it. i'd appreciate help can get. put class on div utilize jquery. jquery fullcalendar

python - How to share db connection like session across different users? -

python - How to share db connection like session across different users? - we're using soaplib - soap server apache/mod_wsgi , sqlalchemy orm mysql connection. we tried utilize global dict store db session handled sqlalchemy - makesession connection. but when move our code production environment using mod_wsgi won't work, creates different processes each request so we've set wsgidaemonprocess illustration processes=1 threads=1 isn't solution. what ideal solution utilize global db connection pool share db session across requests? a new process not created each request. doing running in embedded mode apache prefork mpm. apache create many processes handle requests , requests beingness handled different processes in turn. requests come , handled process has been used before , nail cached connection. in general using embedded mode , prefork mpm bad idea. utilize daemon mode , create code thread safe , utilize multithreaded process. if don...