Posts

Showing posts from June, 2012

android - How to set onclick listener for animated image view -

i developing application has animated image view moving right center.when click on image onclick() called. when click on screen in image moving path(near image view) onclick() fired. please tell me how set on click listener image view. code is: ll = new linearlayout(this); ll.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); ll.setorientation(linearlayout.vertical); ll.setgravity(gravity.center); imageview=new imageview(getapplicationcontext()); imageview.setimageresource(r.drawable.moveimage1); int width=getwindowmanager().getdefaultdisplay().getwidth()/2; system.out.println("width==="+width); movelefttoright = new translateanimation(width, 0, 0, 0); movelefttoright.setduration(3000); movelefttoright.setrepeatcount(translateanimation.infinite); // animation repeat count movelefttoright.setrepeatmode(2);

ruby - How to get domain from URL without using URI Parser. I want to done it using regex -

i'm trying write regular expression returns domain url. example:- "http://github.com" # => 'github' i'd go @arup rakshit's solution. if want regexp, why not using /^http:\/\/(.+)\.[a-z]{2,3}/

ruby on rails - Heroku open gives a 404 -

i'm deploying rails on heroku first time, accept i'm bit of newbie on turf. i installed tool heroku tool belt. created simple rails application. logged heroku. did.. heroku create and pushed master git push heroku master once deployment complete tried heroku open i end getting 404. app though runs fine on local environment. heroku not provide standard welcome page rails 4. if did not create 1 404 page. problem should not arise if root set. you can test creating home controller index action, create index. html.erb page , define root to: 'home#index'. heroku knows page and not receive 404 error. getting started heroku guide: https://devcenter.heroku.com/articles/getting-started-with-rails4

javascript - Retrieve text from page with jQuery -

i'm trying retrieve text remote url , put in div on current page. first i'm trying text local file first, doesn't seem pull text. suggestions? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>html5 jquery</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> </head> <body> <div id="replace"> placeholder </div> <script type="text/javascript"> $(document).ready(function(){ $.get("test.txt", function(data) { $("#replace").html(data); } ); }); </script> </body> </html> same origin policy prevents page reading in javascript page coming origin (roughly domain+port). a special case 1 of file:// protocol : files opened in protoco

Mavericks XAMPP install PHP GD2 extension -

i using xampp php development on mavericks. using phpexcel excel manipulations. problem phpexcel requires php gd2 extension. please guide me how install extension on mac osx. this link should out. https://community.apachefriends.org/f/viewtopic.php?p=136656

asp.net - How to use ASPX page into MVC -

as per requirement, need use existing/provided ascx user controls mvc application. understnad, use these controls, have create aspx traditional page mvc , use these user controls inside aspx page. i can add webform mvc application. how can incorporate url added webform ?? appear different url browser other pages of mvc please suggest me if have take other thing incorporate traditional aspx mvc application.? thanks actually asp.net project can host web forms, mvc , web api. it's adding right references whole project. thus, can create traditional .aspx pages in project. about "difference in urls" when using web forms or mvc, isn't longer true. since asp.net 4.0, web forms supports url routing (follow link) .

java - Error in getting data from excel: Invalid header signature -

i trying read .xlsx excel file getting exception: error in getting data excel invalid header signature; read 1688935826934608, expected -2226271756974174256 what thing missing? my code fileinputstream fileinputstream; try { fileinputstream = new fileinputstream(filepath + "\\" + "uploadareaexcel.xlsx"); hssfworkbook workbook; workbook = new hssfworkbook(fileinputstream); hssfsheet worksheet = workbook.getsheet("sheet1"); system.out.println("total count :" + integer.tostring(worksheet.getlastrownum())); for(int i=1;i<worksheet.getlastrownum();i++){ hssfrow row1 = worksheet.getrow(i); hssfcell cella1 = row1.getcell((short) 0); system.out.println(cella1.getstringcellvalue()); hssfcell cellb1 = row1.getcell((short) 1);

php - Laravel's Response::json() returns nothing to the client under HHVM -

i have hhvm running on virtualbox vm, webroot mapping local laravel install, being served out @ internal ip. locally, i'm serving site out under http://[localhost]:8000. the codebase identical. code of memberscontroller.php (resourceful controller): public function show($id) { $member = member::findorfail($id); $data = array(); $data['id'] = $member->id; $data['first_name'] = $member->first_name; $data['last_name'] = $member->last_name; return response::json($data); } assuming working normally: when run request localhost: http://[localhost]:8000/api/v1/member/1, client returns json normal - good. when run request hhvm (same client, identical codebase): http://[vm_ip_address]/api/v1/member/1, client receives no data. the data is being passed through calls within hhvm though, if change 'return' 'echo', payload returned in both cases (heade

Convert One field in an Object Array data with angularjs and Javascript to another value -

in angularjs controller have code: var ysshcontrollers = angular.module('thecontrollers', []); ysshcontrollers.controller('commoncontroller', function($scope, $http, $route) { $scope.dbkey = $route.current.custominput; $scope.urltodb = 'https://' + $scope.dbkey + '/.json'; $http.get($scope.urltodb).success(function(data) { var values = []; (var name in data) { values.push(data[name]); } $scope.items = values; }); // order date , time $scope.orderprop = 'ac'; } ); it creates object array name items . key values labed aa , ab , ac etc. when user inputs data drop down menu, want save values like: 1,2,3,4,5 , when data imported website, convert values back. 0 = bad ; 5 = very good . so, every record key name ae want convert values 1,2,3,4,5 bad, okay, fair, good, good. i can figure out program flow, n

php - How to setup virtual host using Wamp Server properly? -

i need here in creating virtual host in wampserver. in office can create virtual hosts when try create in laptop doesn't work. still can't figure out what's wrong. here's did. i copy wordpress file in folder. path of project e:\subversion\chelle.wpblog.local i edit host file c:\windows\system32\drivers\etc\hosts i added end of file 127.0.0.1 chelle.wpblog.local next enable virtual host in apache c:\wamp\bin\apache\apache2.4.4\conf\httpd.conf i uncomment this include conf/extra/httpd-vhosts.conf next setup virtual host in wamp c:\wamp\bin\apache\apache2.4.4\conf\extra\httpd-vhosts.conf i add @ bottom <virtualhost *:80> servername chelle.wpblog.local serveralias chelle.wpblog.local documentroot "e:/subversion/chelle.wpblog.local/" <directory "e:/subversion/chelle.wpblog.local/"> options indexes followsymlinks multiviews allowoverride order allow,deny allow

how to Hide notification after tap in android application -

this code gives notification on start of service notificationcompat.builder mbuild = new notificationcompat.builder(getapplicationcontext()); intent in = new intent(getapplicationcontext(), mainactivity.class); pendingintent resultin = pendingintent.getactivity(getapplicationcontext(),code,in,notification_count); mbuild.setsmallicon(r.drawable.images1); mbuild.setcontenttext(notification_count +" new message"); mbuild.setcontentintent(resultin); //mbuild.addaction(r.drawable.notifications,notification_count +"new messages",resultin); notificationmanager nmagr = (notificationmanager) getsystemservice(notification_service); nmagr.notify(1, mbuild.build()); everyting working correct ..the code opens target activity notification still stays there in notification bar. have tried useing mbuil.setautocancel(true); doing nothing try this notificationmanager nmagr = (notificationmanager) getsystemservice(notification_service);

sql - Unmatched column Data -

i have situation explained below select * version vno name sal deptno - - - - - - - - -------------------------------------------------------------------- 1 xxx 1000 10 - - - - - - - - 2 yyy 1000 10 - - - - - - - - here need simple plsql code returns unmacthed column_name data too. i need following output: vno 1 2 name xxx yyy here columns , data both generic. select vno,name version column_name != 'your variable'; //hope works

c++ - leveldb DeleteObsoleteFiles is private -

does knows why deleteobsoletefiles member function private in leveldb ? there situations when need free diskspace , 1 of ways try delete leveldb obsolete files. can make public , call safely ? files become 'obsolute' after compaction: deleteobsoletefiles() called @ end of every compaction , @ end of recovery. finds names of files in database. deletes log files not current log file. deletes table files not referenced level , not output of active compaction. if want reduce disc space occupied can run compaction // compact underlying storage key range [*begin,*end]. // in particular, deleted , overwritten versions discarded, // , data rearranged reduce cost of operations // needed access data. operation should typically // invoked users understand underlying implementation. // // begin==null treated key before keys in database. // end==null treated key after keys in database. // therefore following call compact entire database:

mysql_num_rows() expects parameter 1 to be resource, php error -

i getting error accessing site. have used same files 3 different servers, including local server , it's running fine. can shed lights? $stringip = $_server['remote_addr']; $intip = ip2long($stringip); $indb = @mysql_query("select 1 av_whoisonline ip=".$intip); if(!mysql_num_rows($indb)) //code in question <--------- { if($_cookie['geodata']) { list($city,$countryname,$countryabbrev) = explode('|',mysql_real_escape_string(strip_tags($_cookie['geodata']))); } else { $xml = file_get_contents('http://api.hostip.info/?ip='.$stringip); $city = get_tag('gml:name',$xml); $city = $city[1]; $countryname = get_tag('countryname',$xml); $countryname = $countryname[0]; $countryabbrev = get_tag('countryabbrev',$xml); $countryabbrev = $countryabbrev[0]; setcookie('geodata',$city.'|'.$countryname.'|'.$countryabbrev, time()+60*60*24*30,'/'); } $countryname = str_re

mysql - how to load two tables data into single table side by side -

i have 2 table , want 2 columns each table. , want keep these total 4 columns 1 table. example:- s1, s2, s3 columns of table1 s4, s5, s6 columns of table2 and want columns s1, s2, s4, s5 in table-3. can 1 solve in hive. if there column in table1 , table2 can used join use: select t1.s1, t1.s2, t2.s4, t2.s5 table1 t1, table2 t2 t1.column_for_join = t2.column_for_join and result table3 (s1,s2,s4,s5) if there no column join, can use union this: select s1,s2, null, null table1 union select null, null, s4,s5 table2 hope helps... pawel

javascript - Popover for long text without spaces -

Image
i have in grid in 1 column long text should truncated in grid (ends ...) should show whole in popover. the popover displaying correctly when there spaces in text. text no spaces popover displaying incorrectly. see examples below incorrect popover: correct popover: i'm displaying popover in way: <div data-toggle="popover" rel="popover" data-container="body" data-content="my_test_in_popover"> my_text_with_... </div> how should modified code display popover correctly long text no spaces? that's because twitter bootstrap applies max-width property .popover box default (which max-width: 276px; ). there 2 options: 1) override max-width reseting none as: .popover { max-width: none; } 2) or use word-wrap: break-word; css declaration popover content box as: .popover-content { word-wrap: break-word; }

php - how to convert 500,000 rows of data with 39 columns from MySQL into Excel -

i have php web app can convert data excel file using phpexcel. web app running inside linux machine. these steps involved. i need run several join queries data want. i take data , write them excel file using phpexcel. repeat step 1-2 in batches of ~5000 rows. i noticed time taken generate ~50000 rows alone (which 10%) 15 minutes long. i need generate excel file once day. off top of head, have following options. a) instead of doing step 1 , 2 repeatedly 10 times, retrieve data need in step 1 , store data separate mysql table. then try phpexcel , read table once , write excel file once. at end, wipe table clean again. b) same a) instead of using phpexcel, find way run mysql excel in cloud windows instance generate excel file. if need further formatting, use phpexcel format excel file. the way send data between linux machine , windows cloud instance through email attachments because linux machine within firewall. i posting question see if has better idea.

PHP parse string as condition operator -

i have form user can create own condition. e.g <select name="operator"> <option value="==">(==) equal</option> <option value="!=">(!=) - not equal</option> <option value="&gt;">(&gt;) - greater than</option> <option value="&lt;">(&lt;) - less than</option> <option value="&gt;=">(&gt;=) - greater or equal </option> <option value="&lt;=">(&lt;=) - less or equal </option> </select> how parse operator string php interprets condition operator? if($column $operator $value){ } the long winded way of doing this: switch($operator){ case '!=': if($column != $value){ } break; case '<=': case '&lt;=': if($column <= $value){ } break; } the way use eval evaluates string php code.

To increase or to mute volume programmatically for windows phone -

i wanted know there classes or api accessing same ? have seen lots of applications on windows phone store. click here sample. for windows phone, can use microsoft media foundation apis . if want use volume apis in c# need make reference c++ project it. imfmediaengine::setvolume method : hresult setvolume( [in] double volume ); volume [in] : volume level. volume expressed attenuation level, 0.0 indicates silence , 1.0 indicates full volume (no attenuation). i think can use background audio agent too.

c++ - what happens if Interrupts occur after mutex lock has been acquired -

i have multi-threaded c/c++ program services read , write requests frequently. synchronization purposes, have used mutex locks , unlocks. read , write threads acquire lock before performing operations. happens if 1 thread acquires lock , before release locks, interrupt occurs ? thread resume execution or have handle manually ? user-side locks, including mutexes not block interrupts. important, since mutex may used protect read file on disk, or protect reception of packets network, , such, result reliant on interrupt. in essence, "nothing" happens if there interrupt. interrupts handled os, other time. there nothing program needs in case, takes few microseconds or milliseconds longer whatever programmed task if happens. some kernel-side locks, such spinlocks indeed block interrupts (on processor core) ensure other processes/threads not scheduled during process. there restrictions on functions kernel can use under these circumstances - example, wouldn't poss

clojure - How do I store and retrieve friend roles in a SQL database? -

i'm not sure how store friend roles in database. can either store string "#{::user}" or store "user" , transform on retrieval. former bad juju , i'm unsure how latter without making angels cry. (ns foo.handler (:require [cemerick.friend :as friend] (cemerick.friend [workflows :as workflows] [credentials :as creds]))) ;; dummy in-memory user "database" (def users {"root" {:username "root" :password (creds/hash-bcrypt "admin") :roles #{::admin}} "jane" {:username "jane" :password (creds/hash-bcrypt "pw") :roles #{::user}}}) (derive ::admin ::user) this how i'm doing it; i'm sure it's sorts of bad. please stop me. starting "user" extracted database: foo.handler> #{(keyword (str *ns* "/" "user"))} =>

c# - See WCF http data from Visual Studio -

i implementing client-side of ms webservice , see exact http call made. i.e. parameters , how encoded. i tried sniffing wireshark, since seems done via https can see data. i running client straight out of visual studio. there way see data there? teletic fiddler great tool debug http communication. http://www.telerik.com/fiddler . can show request , response information in raw views, xml, json etc it can inspect https traffic. follow this guide . there similar question here .

Selecting first part of a text file in Python -

in process of making program, came across need read first value of text file . have tried put each value onto it's own line , read first line such in code, never load part of text file wanted shown in code: l = open('output.txt').read() words = l.split() word in words: print(word) open("output.txt", 'wt').write(l) open('output.txt','r') f: line in f: word in line.split(): print(word) open("output.txt", 'wt').write(word) q = open("output.txt") x, line in enumerate(q): if x == 0: print (line) how able this? store contents 1 element line , this with open("input.txt") in_file: data = next(in_file) now data have first line. this works because open function returns object of file type, iterable. so, iterate next function first line.

angularjs - Tutorial to create a protractor project in Netbeans IDE. (Installed Netbeans 7.4) -

Image
i'm going write hell lot of test cases using protractor framework. i've installed netbeans ide i'm not able configure correctly tests. helpful if can give tutorial create protractor project in netbeans ide. the future release of netbeans 8.1 have support protractor wiki.netbeans.org/newandnoteworthynb81#protractor for now, can download netbeans nightly has configuration protractor going project properties , , clicking on category, selenium testing

javascript - Unable to create shortcut on Desktop for a remote IP file -

i using below code create help.lnk (which refers mainhelp.html) remote ip local system. facing below problems: the same code running on friends pc not mine.its saying = "automation server can't create object" on friend's pc "help.lnk" targeting "c:\172.xx.xx.xx\abc\html\mainhelp.html" ,which wrong "c:" must not come because mainhelp.html present @ remote ip.so, giving target not found error function fngo() { var wshshell = new activexobject("wscript.shell"); strdesktop = wshshell.specialfolders("\\172.xx.xx.xx\\abc\\html"); var oshelllink = wshshell.createshortcut(strdesktop + "help.lnk"); oshelllink.targetpath = "\\172.xx.xx.xx\\abc\\html\\mainhelp.html"; oshelllink.windowstyle = 1; oshelllink.hotkey = "ctrl+shift+g"; oshelllink.description = "shortcut script"; oshelllink.workingdirectory = strdesktop; oshelllink.save(); } please help try

removing a char at the end line of a page in python -

the following code seems work fine adds period(.) @ end of page. how can remove dot , coming from? thank help! code with open("strings.txt") inf: line in inf: line = line.rstrip() if line.isalnum(): print("{} ok".format(line)) else: print("{} invalid".format(line)) the following output should have been generated: 5345m34534l invalid. no2no123non4 ok. noq234n5ioqw#% invalid. %#""sgmsgser invalid. doghdp5234 ok. sg,dermoepm invalid. 43453-frgsd invalid. hsth())) invalid. bmepm35wae ok. vmopaem2234+0+ invalid. gsdm12313 ok. gswrgsrdgrsgsig45 ok. )/(/)(#=%#)%/ invalid. ++-+-+--+--+-+>-<+-<<_<-+>>++ invalid. your program generated following output: 5345m34534l invalid. no2no123non4 ok. noq234n5ioqw#% invalid. %#""sgmsgser invalid. doghdp5234 ok. sg,dermoepm invalid. 43453-frgsd invalid. hsth())) invalid. bmepm35wae ok. vmopaem2234+0+ invalid. gsdm12313 ok.

How can we bind the GridView control in asp.net using AngularJS? -

i newbie angularjs.i want bind data gridview control using angularjs.i have done task using html table working fine. can apply angularjs databind asp.net controls? angular client-side tool. gridview , other asp.net controls rendered server-side. so, there no way angular know asp.net. , if does, bad thing. so, in case, html table correct approach. typically, angular single page application (spa) , speaks server through ajax calls data (usually json). development style makes server-side ui rendering obsolete. because returning data, not rendered html. hope helps.

shell - Can't find self written script -

i have strange problem here on mac os x 10.9.2 time ago have written script (called "whilerub") , placed somewhere execute every directory in system. no matter can run script , works change can't find it. tried far: sudo whilerub sudo find / -name "*whilerub*" sudo locate "whilerub" and checked every directory in path variable example /opt/local/bin/whi , tab complete it not on externel device or in network since runs without network connection too. any idea? could have defined alias instead of script? defining alias # alias r='cd ..' and trying find which # r won't find it: # no r in (/usr/local/bin:/ .....)

gtk - Adding custom widget to GLADE -

hi using gtk3 , glade 3.14...i want add custom widget glade can add user interface easily. i found knob widget missing in glade , found knob widget in http://sourceforge.net/projects/giw/ i downloaded , installed instrumentation widgets wont added glade. is knob widget available in glade. i tried using knob.c , knob.h file , tried example , got examples working couldn't integrate them gade. what need glade catalog file describes widgets properties, catalog name , few other things. may have add additional catalog path under edit > preferences in dialog section says extra catalog paths if catalog resides outside of default lookup paths. for details on how create catalog, read catalogintro.

cocoa - AVAssetReader audio capture, samples missing -

i've weird question. i'm capturing audio samples of .mov/.wav/.aiff files playback them. i'm using following codes captures unchanged pcm samples if available , otherwise convert them 32 bit float. nserror *error = nil; avassetreader *assetreader= [[[avassetreader alloc] initwithasset:self.movieasset error:&error] autorelease]; nsarray *audiotracks=[movieasset trackswithmediatype:avmediatypeaudio]; avassetreadertrackoutput* audioreaderoutput=nil; avassettrack *mainaudiotrack = nil; cmtimerange audiorange; if ([audiotracks count]) { mainaudiotrack=[audiotracks objectatindex:0]; audiorange = mainaudiotrack.timerange; cmtimerange readingrange = cmtimerangemake(kcmtimezero,audiorange.duration); assetreader.timerange = readingrange; nsarray* formatdesc = mainaudiotrack.formatdescriptions; if ([formatdesc count]) { cmaudioformatdescriptionref item = (cmaudioformatdescriptionref)[formatdesc objectatindex:0]; const audiostreambasicd

c# - asp:Button not displaying correctly -

this scenario: i want display button(btngenerate) based on amount of rows displayed in gridview. i've gotten display second goes away again. i'm using onclientclick of 1 of other buttons(btnimport). think causing problem on same button(btnimport)'s onclick event 2 gridview's performs each databind. problem? have written script using javascript perform task client side. there better way it? can fix problem? here code have far: <asp:button runat="server" id="btnimport" text="load data file" backcolor="#990000" forecolor="white" nowrap onclick="btnimport_click" style="display:none" onclientclick="displaybuttongenerate()"/> <asp:button id="btngenerate" runat="server" text="generate new stock codes" backcolor="#990000" forecolor="white" onclick="btngenerate_click" style="display:none" /

javascript - How to target image inside a div with an id with getelementbyid/tag/name? -

basically want change smiley.gif landscape.jpg without changing divs , tags, code not working. suggestions? <div id="foo"> <div id="bar"><img src="smiley.gif"> hello world! </div> </div> <script> getelementbyid("bar").getelementsbytagname("img").src="landscape.jpg"; </script> it better if assign id img tag , use this <div id="foo"> <div id="bar"><img src="smiley.gif" id="myimg"> hello world! </div> </div> <script> document.getelementbyid("myimg").src="landscape.jpg"; </script> jsfiddle 1 or use this <div id="foo"> <div id="bar"><img src="smiley.gif"> hello world! </div> </div> <script> var obj = document.getelementbyid("foo"); if(obj != null) { var images = ob

objective c - NSMutableArray being overwritten in for-loop -

i searched around , thought found answer doesn't appear working. trying make array of dictionaries later sorting, etc. can correct data dictionary object , key pairs, when try add dictionaries array previous array entries "overwritten". realize i'm doing wrong pointer nsarray, cannot straight. 1 post suggested moving instantiation of array out of loop, following 2 snippets produce identical results. nsmutabledictionary *tempmatricesnw = [nsmutabledictionary dictionary]; nsuinteger middle = 0; if (([factorsnw count] % 2) != 0) { middle = (([factorsnw count]+1)/2)-1; } nsmutablearray *tempmatricearraynw = [nsmutablearray array]; (nsuinteger = 1; < [factorsnw count]-1; i++) { if (i == middle) { [tempmatricesnw setobject:[nsnumber numberwithint:[[factorsnw objectatindex:i] intvalue]] forkey:@"x"]; [tempmatricesnw setobject:[nsnumber numberwithint:[[factorsnw objectatindex:i] intvalue]] forkey:@"y"]; [tempma

How to "watch" all contents of a dynamically created multi-dimension array in Visual Studio debug -

i have 2 dimension array created malloc . simplified code like: double **p = dmatrix(0, 50, 0, 50); when debugging, want see content 51*51 members in 1 go. tried use below in "watch": p,51; //to show address 1st dimension, can't expand 2nd dimension. (only show 1st one) p[0][0]; //to show [0][0] p[0],51; //to show 51 members p[0] i hope like: p,51 51 //to show address 1st dimension, while can expand 2nd dimension. any suggestions? i've tried "memory" window it's not intuitive.. just found 1 solution myself. let's assume have below pointer: double ** p; // assume 51*51 then can write below in visual studio debug watch: (double(*)[51]) p[0],51 which cast array below, , can view contents in 1 go. double[51][51] p; similarly, can apply 3 dimension pointers, write like: (double(*)[51][51]) p[0][0],51 //for 51*51*51

javascript - Disable few signature attributes/types in DocusignAPI -

http://i.stack.imgur.com/zu1om.png see image here, can see have 13 types of signature (e.g. signature,initial,my name,my first name,etc...) i dont want these field in app. want disable/remove while i'm using in iframe. there way that, manually check/unchecked box or api. yes, showing not result of signature adoption. there couple issues see image (thank you!) that fax document e-signing rest lossy api when missing tags signer, puts signer in free form signing pallet on right e-signature secure fields/tabs can place on document sign it, not attributes, if had placed secure fields/tabs via api on envelope not see those here link our online docusign https://www.docusign.com/p/restapiguide/restapiguide.htm

user - Individual/restricted "dashboard" for Icinga Classic -

im student, , having bachelor thesis, , 1 of tasks set solution system administrators @ local schools should able monitor relevant services , hosts. lets there firm hosts many local schools in city. system administrators @ firm, drifts every server/host loaclly, has acces on monitoring icinga hosts , services, system admins , service @ schools icinga monitoring well. should not able config hosts, have overall monitoring hosts thay using. is there solution this, restricted/individual monitoring plugin many individual users? thanks in advance. you need enter in cgi.cfg, user_viewer user need create before htpasswd , first defined contact too. authorized_for_read_only=user_viewer but need have permissions modify this. check before rest of properties around cgi.cfg, place can , more custom things. another solution maybe more focus in visualization , custom monitoring install , config nagvis, design simple dashboards. has template system can reuse design differents

java - mvn --version not working? -

i have problem maven path have set path not working please see below path path ....;c:\program files\java\jdk1.6.0_20\bin;d:\apache-maven-3.2.1\bin java_home c:\program files\java\jdk1.6.0_20 maven_home d:\apache-maven-3.2.1 when try run mvn --version give error of java_home please see error error: java_home set invalid directory. java_home = "c:\program files\java\jdk1.6.0_20\bin" please set java_home variable in environment match location of java installation. but javac working fine java_home needs point folder contains bin/ , lib/ , etc. your variable points inside of java's home folder.

c# - Delete input if date is invalid : XAML datepicker -

i working datepicker control in silverlight. want delete input if date invalid. i have tried following code : xaml: <sdk:datepicker height="23" x:name="datepicker1" width="179" datevalidationerror="datepicker1_datevalidationerror" /> c#: private void datepicker1_datevalidationerror(object sender, datepickerdatevalidationerroreventargs e) { try { if (datepicker1.selecteddate != null && (regex.ismatch(datepicker1.selecteddate.tostring(), @"^([1-9]|0[1-9]|1[0-2])[- / .]([1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1])[- / .](1[9][0-9][0-9]|2[0][0-9][0-9])$"))) { //working fine } else { messagebox.show("please enter valid date"); datepicker myelement = ((frameworkelement)system.windows.application.current.rootvisual).findname("datepicker1") datepicker; // se

opencv - 3D Triangulation similar to Hawkeye -

forgive me if question has been asked before, i'd know start achieve stereo vision convert 2d coordinates 3d coordinates. i'm trying track balls hawkeye in 3d. have 2 high speed cameras , i'm able detect ball in each camera. understand need calibrate cameras, synchronize them , run algorithm remove lens distortion etc. however, don't know next step convert 2d coordinates world 3d coordinates. does know how perform triangulation can assist me this? cameras not parallel each other, @ different angles, somehow, need know location of each camera in terms of 3d coordinates. any gratefully received. many thanks to convert 2d 3d 2 calibrated cameras use these formulas: z = focal*baseline/disparity x = z*u/focal y = z*v/focal where focal - focal length of camera in pixels u = column-cx, cx~image_width/2 calibration give more precise value v = -row+cy, cy~image_height/2 baseline - horizontal distance between cameras disparity - difference in horizontal

javascript - Avoid function to return before Promise ends -

inside function have this function() { var user = new models.commerceuser(); var userpromise = user.fetch(); userpromise .done(function() { console.log('user fetched') var commercecollection = new models.commercecollection(); var commercepromise = commercecollection.fetch({ data: { nocursor: true } }); commercepromise .done(function() { console.log('commerces fetched') var activeofferscollection = new models.activeofferscollection(); var activeofferspromise = activeofferscollection.fetch(); activeofferspromise .done(function() { console.log('activeoffers fetched') initvariables(); }) .error(function() { console.error('error while getting commerces')

android - getLastKnownLocation always returns null -

after reviewed articles on stackoverflow, not solutions question posting similar type of issue here. usual, getting null in return of getlastknownlocation . have implemented locationlistener well. below code. for information, have checked both providers (network , gps) in below code , returning false if check value of sbestprovider getting "network". how coming not know. hope, out me. quick response appreciated. friends. permissions. <uses-permission android:name="android.permission.access_coarse_location"/> <uses-permission android:name="android.permission.access_fine_location"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> java code public class activitymarkinglocation extends activity implemen

actionscript 3 - Which is best, make a multiple file or single file? -

i start new project flash professional cs6 , as3. project huge 1 lot alot of mcs, coding, pictures ... etc. in previous project flash 8, tried use several files working each others faced lot of problems in loading , interacting them. hard control specially when came loading stuff. i don't know if has been changed in cs6, want advice. should use old strategy using many files? or should dump thing in 1 huge fla file? in either case, best way arrange assets, codes, ... etc organised , easy work in coding , yet give high performance. thank in advance. you should go several source files, if project huge. first of all, create dedicated .fla file ui components , small/handmade elements, — assets.fla , compile assets.swc. if compile project of flash professional cs6 (but recommend ide...), have 1 more .fla file, main.fla , it's entry point document class, , connected libraries(mostly .swc files) images, huge animated scenes, these stuff external: bitmaps, swf fi

Draw circle with different border colors Android -

public static bitmap drawcircle(int width,int height, int borderwidth) { bitmap canvasbitmap = bitmap.createbitmap( width, height, bitmap.config.argb_8888); bitmapshader shader = new bitmapshader(canvasbitmap, tilemode.clamp, tilemode.clamp); paint paint = new paint(); paint.setantialias(true); paint.setshader(shader); paint.setshader(null); paint.setstyle(paint.style.stroke); paint.setcolor(color.white); paint.setstrokewidth(borderwidth); canvas canvas = new canvas(canvasbitmap); float radius = width > height ? ((float) height) / 2f : ((float) width) / 2f; canvas.drawcircle(width / 2, height / 2, radius - borderwidth / 2, paint); return canvasbitmap; } simple code draws circle white border, want part of border black , other part white. 40 % of black, 60 % of white how can done? try code class myview extends view { private paint paint; public myview(context context, int x, int y)

c# - What is the performance overhead of Entity Framework compared to raw SQL execution time? -

in application (ef6 + sql server) dynamically creating ef queries enable rich search functionality. these queries created chaining bunch of where() predicates, , projecting results using few aggregations known clr types. in cases ef generates single sql query returns small amount of results (about 10). using sql profiler can see execution time of these generated queries when executed database withing few milliseconds. however, unless query trivially simple, total execution time (calling tolist() or count() code) within few hundred milliseconds! code built in release mode , tested without debugger attached. can give me hints might wrong approach? can possible ef's overhead 2 orders of magnitude in time compared raw sql execution time? edit: these code samples using filter result set: if (p.pricemin != null) query = query.where(a => a.terms.any(t => t.price >= p.pricemin.value)); if (p.startdate != null && p.enddate != null) query = query.whe

Combination of group's math php function -

looking function in php possible element combinations of unknown number of groups {x, y...z}...{x,y...z} example: a:{1,2,3,4},b:{5,6},c:{a,b,c} result: abc 15a 15b 15c 16a 16b 16c 25a 25b 25c 26a 26b 26c 35a 35b . . . 46c thanks i need not working $array = array( 'a' => array(1, 2, 3, 4), 'b' => array(5, 6). 'c' => array('a', 'b', 'c')) function makecombinations($array){ foreach($array $value){makecombinations($array) } } try this. assuming ,b , c arrays $a = array(1,2,3,4); $b = array(5,6); $c = array("a","b","c"); foreach($a $values) foreach($b $values2) foreach($c $values3) echo $values."".$values2."".$values3."\n"; demo

c# - Copy multi dimension array fast -

i have following code , want know fastest way copy _zobrist , _hashenpassant arrays? internal void inithash() { int32 i; ( = 0; < 2; i++ ) ( int32 j = 0; j < 6; j++ ) ( int32 k = 0; k < 64; k++ ) _zobrist[ i, j, k ] = hashrand(); ( = 0; < 64; ++i ) _hashenpassant[ ] = hashrand(); } the reason chess engine creates multiple analysis boards , rather recreating new boards scratch clone existing board. issue having calling inithash() method or doing simple copy slow. i have looked @ this , not sure how modify work uint64 types. from here: http://msdn.microsoft.com/en-us/library/z50k9bft%28v=vs.110%29.aspx if looks need copy total number of elements in array using array.com array.copy( myobjarray, 0, myintarray, 0, numelements ); numelements 2*6*64? just show api declaration website , values use: public static void copy( array sourcearray, int sourceindex, array destinationarra

java - Android google maps v2 crashing on startup -

in android app supporting 2.2 , higher, trying use google maps api v2. i have far: does know issue is? thanks. xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".activity_map" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment"/> </relativelayout> java import com

Move to Universal Analytics - how to send City, State, Country -

for reason city, state, country not used in universal analytics https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs new version: ga('ecommerce:addtransaction', { 'id': '1234', // transaction id. required 'affiliation': 'acme clothing', // affiliation or store name 'revenue': '11.99', // grand total 'shipping': '5', // shipping 'tax': '1.29' // tax }); old version: _gaq.push(['_addtrans', '1234', // transaction id. required 'acme clothing', // affiliation or store name '11.99', // total. required '1.29', // tax '5', // shipping 'san jose', // city 'california', // state or province 'usa' // country ]); but how

php - Nginx redirect all requests from subdirectory to another subdirectory root -

i'm quite new nginx please bear me. i'm trying redirect requests 1 subdirectory (store) root of subdirectory (trade). see progress below. site in target subdirectory (trade) magento site of current rules for. server { server_name example.com *.example.com; root /usr/share/nginx/html/example.com/public_html; index index.php index.html index.htm; access_log /var/log/nginx/example.access.log; error_log /var/log/nginx/example.error.log; location / { try_files $uri $uri/ /index.html; } location /trade/ { index index.html index.php; try_files $uri $uri/ @handler; expires 30d; } location ~ /store { rewrite /trade permanent; } location ~ ^/trade/(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ { internal; } location /trade/var/export/ { internal; } location /. { return 404; } location @handler { rewrite / /trade/index.php; } error

Why isn't Python throwing an overflow error? -

i'm learning python , have question range of data types. this program: print("8 bits:", pow(2, 8)-1) print("16 bits:", pow(2, 16)-1) print("32 bits:", pow(2, 32)-1) print("64 bits:", pow(2, 64)-1) print( pow(18446744073709551615+18446744073709551615+2, 9) ) produces following output: 8 bits: 255 16 bits: 65535 32 bits: 4294967295 64 bits: 18446744073709551615 12663316555422952143897729076205936129798725073982046203600028471956337925454431 59912019973433564390346740077701202633417478988975650566195033836314121693019733 02667340133957632 my question is: how can python calculate result of last call pow() ? cpu cannot handle integers more 64 bits, expect operation produce overflow. the python long integer type limited available memory. until run out of memory, digits keep on coming. quoting numeric types documentation : long integers have unlimited precision. python transparently use long integers when need unlim