Posts

Showing posts from June, 2015

groovy - How to add multiple jars to the classpath of groovyConole/groovysh? -

groovy - How to add multiple jars to the classpath of groovyConole/groovysh? - this feels ridiculous have inquire this, can't seem add together multiple jar files classpath groovyconsole , groovysh. how add together multiple jar files classpath? here i've tried: groovyconsole -cp ~/lib/compile/jar/mysql-connector-java-5.1.32.jar:~/lib/compile/jar/ojdbc6-11.2.0.3.jar however, when execute code in console following: file:/users/charlie/lib/compile/jar/mysql-connector-java-5.1.32.jar file:/users/charlie/projects/fuseanalytics/./ file:/users/charlie/.gvm/groovy/current/lib/ant-1.9.3.jar file:/users/charlie/.gvm/groovy/current/lib/ant-antlr-1.9.3.jar file:/users/charlie/.gvm/groovy/current/lib/ant-junit-1.9.3.jar file:/users/charlie/.gvm/groovy/current/lib/ant-launcher-1.9.3.jar file:/users/charlie/.gvm/groovy/current/lib/bsf-2.4.0.jar file:/users/charlie/.gvm/groovy/current/lib/commons-cli-1.2.jar file:/users/charlie/.gvm/groovy/current/lib/commons-logging

Docker stop exit code -1 if the default CMD is a shell script -

Docker stop exit code -1 if the default CMD is a shell script - i building tomcat container in docker supervisord. if default command in dockerfile cmd supervisord -c /etc/supervisord.conf and when dispatch docker stop command, container exits exit code 0. but instead if have cmd ["/run"] and in run.sh, supervisord -c /etc/supervisord.conf the docker stop command gives me exit code -1. on viewing logs, seems supervisord did not receive sigterm indicating exit request. 2014-10-06 19:48:54,420 crit supervisor running root (no user in config file) 2014-10-06 19:48:54,450 info rpc interface 'supervisor' initialized 2014-10-06 19:48:54,451 crit server 'unix_http_server' running without http authentication checking 2014-10-06 19:48:54,451 info supervisord started pid 6 2014-10-06 19:48:55,457 info spawned: 'tomcat' pid 9 2014-10-06 19:48:56,503 info success: tomcat entered running state, process has stayed > 1 seconds (starts

c++ - How to work around `using K = ...` in MSVC 2012? -

c++ - How to work around `using K = ...` in MSVC 2012? - it appears msvc 2012 doesn't back upwards using k = ...; -type declarations. example, code: template <class map> inline void foo(map &m) { using k = typename map::key_type; using v = typename map::mapped_type; // ... } the result syntax error: error c2143: syntax error : missing ';' before '=' error c2873: 'k' : symbol cannot used in using-declaration how can work around missing feature of msvc 2012, without upgrading compiler? microsoft's back upwards c++11 incomplete, , 1 of things that's missing in vs2012. in case, should able utilize old-fashioned typedef; e.g.: typedef typename map::key_type k; the place workaround falls apart when type templated: template<typename t> using bar = foo<t>; // ok if compiler supports template<typename t> typedef foo<t> bar; // doesn't compile but still @ to the lowest degree

cq5 - CQ Basic Authentication -

cq5 - CQ Basic Authentication - i have requirement implement basic authentication @ dispatcher side i have below basic auth configuration in virtual host(www.abc.com) configuration file. <location /content/abc/jp-jp > authtype basic authname "private area" authbasicprovider file authuserfile /opt/cq/www/htdocs/password(this name of file, contains uname , password) require valid-user </location> when seek access www.abc.com/jp-jp getting basic auth prompt , authenticated succefully password file(username , password file ) located under /opt/cq/www/htdocs . after first prompt validated username , password , sec prompt displaying requires username , password .the server says (sling development). if disable basic authentication in apache sling authentication service of publish instance ..then it's redirecting me right page expected ..but unable publish contents author(blocked within replication agent queue). enabled back..but basic au

temp tables - MySQL: Syntax error, unexpected '@', expecting ':' -

temp tables - MySQL: Syntax error, unexpected '@', expecting ':' - i want create temp table dynamically. passing column name parameter stored procedure. example: delimiter $$ create procedure sptemp(in nm varchar(50)) begin set @q = concat('create temporary table temptable  // error occuring here @q select distinct ', nm ,' col from table1'); prepare d from @q; execute d; deallocate prepare d; end$$ delimiter ; error: syntax error, unexpected '@', expecting ':' set @q = concat('create temporary table if not exists temptable (index(col)) engine=myisam (select distinct ', nm ,' col table1)'); as bonus - index of col column. mysql temp-tables dynamicquery

Need Help passing an instance variable to another method for insert in ruby on rails 4 -

Need Help passing an instance variable to another method for insert in ruby on rails 4 - i new ror , spent of day trying work. have tried using before_filter , cannot object insert in method. the view index, file selected in view , button validate file clicked calls method 'evaluate_media' in method, values based on file path , name selected , can insert record values in method. problem don't want automatic save. when 'evaluate_media' method done displays either save button or update button based on if file submitted exists in database. user can take save/update record or now. button calls 'save_file' action. problem info save in 'evaluate_media' action file not accessible save_file or update_file actions. believe session variables might reply not find examples setup correctly , working in application. can please tell me , show me proper code pass value 'evaluate_media' action save_file or update_file actions? here code as

fft - how to find the peak(r,theta) from DFT spectrum in matlab? -

fft - how to find the peak(r,theta) from DFT spectrum in matlab? - suppose have matrix m apply dft on , shift centre img_fft = fft2(double(m)); img_spec = abs(img_fft); img_shift = fftshift(img_spec); then according question, how find peak of spectrum ,i.e. (u,v) of peak? lot! use find determine in image maximum value occurs. however, question says ignore dc value, largest component in spectrum far. such, should find maximum value, should dc value currently, , set nan . 1 time this, next maximum value you're searching reply question. as such, first: idx = find(img_shift == max(img_shift(:))); img_shift(idx) = nan; if set maximum value here nan , next time phone call find , disregard location , skip location when searching maximum value. now, phone call find again: [u,v] = find(img_shift == max(img_shift(:))); here, u horizontal location of image while v vertical position. should homecoming maximum peak not dc value. however, isn'

application C++/Java dependency -

application C++/Java dependency - i have builder c++ application create vm process metadata file. application comunicate extractmetadata.jar jni. when test ide, works fine(the process metadata works fine). when create setup application , run process metadata not run fine. i logged , seems class not found. jclass cls; jmethodid midallfield, midconstructor, mid1; jobject newobj; jboolean iscopy; file *filemeta; string strfields, strvaluefields, strfld; javavm* jvm; jnienv* env; // attach thread jvm jint succgetjvm = gl_env->getjavavm(&jvm); int succ1 = succgetjvm; if(succgetjvm!=0) logging(sextractmetalogfile, "\n getjavavm(&jvm) : failure "); else { logging(sextractmetalogfile, "\n getjavavm(&jvm) : success :"); logging(sextractmetalogfile, inttostr(succ1)); } jint succattchd = jvm->attachcurrentthread((void**)&env, null); int succ2 = succattchd; if(succattchd!=0) logging(sextractmetalogfile, "\n attachcurrent

sublime GIT can't push or pull -

sublime GIT can't push or pull - i switched sublime , seek set git can't force or pull to/from remote repository , seems related path of ssh key. if utilize command line works fine. if utilize command-line path ssh looks enter passphrase key '/root/.ssh/id_rsa': how add together sublime git bundle right ssh keys path console log permission denied, please seek again. permission denied, please seek again. permission denied (publickey,password). fatal: not read remote repository. please create sure have right access rights , repository exists. when ssh key has passphrase , seek push/pull plugin, don't have interactive shell can request passphrase. known workaround utilize keychain autofill passphrase. sublime-text-git/issues/178 git push sublimetext3 pull

asp.net mvc - Need c# code to get domain name -

asp.net mvc - Need c# code to get domain name - this question has reply here: what's best method in asp.net obtain current domain? 9 answers need c# code domain name illustration ("url: http://stackoverflow.com/questions/ask"). need output ("http://stackoverflow.com/") next time please seek google question see if has been asked , answered. try var domain = httpcontext.current.request.url.host; per comments... var domain = httpcontextbase.current.url.host; this can mocked unit testing - meaning can set test code . c# asp.net-mvc

javascript - AngularJS Asynchronous calls with multiple databases and a save not in the correct order -

javascript - AngularJS Asynchronous calls with multiple databases and a save not in the correct order - i quite confused @ whole javascript , asynchronous calls. it simple function really, or thought. have function searches 2 different databases site id. if site id cannot found in db1, has search db2 , save site in db1. pass in siteid search siteid in db1 cannot find siteid in db1, search db2 get site db2 save site in db1 search db1 site again return site display ui my code below: var xsite=''; function getsite(siteid) { xsite = siteid; var predicate = predicate.create('siteid', '==', siteid); homecoming entityquery.from(entitynames.site) //db1 .where(predicate) .using(manager).execute() .then(querysucceeded, _queryfailed); function querysucceeded(data) { if (data.results.length == 0) { logerror('site not found!'); //staticdb s

java - Loading Chrome Profile Not Working (ChromeDriver) -

java - Loading Chrome Profile Not Working (ChromeDriver) - i'm trying load chrome profile utilize selenium webdriver doesn't work , defaults new one. tried codes provided here. is there workaround or fix? i'd run chromedriver customized extensions, options , whatnot since command line flags , chromeoptions have restricted functionality. also, i'm having issue loading preconfigured extensions. i had same problem.but did , worked. string userprofile= "c:/users/"your user"/appdata/local/google/chrome/user"; chromeoptions options = new chromeoptions(); options.addarguments("user-data-dir=" + userprofile); driver = new chromedriver(options); please allow me know if work you. java selenium-chromedriver

ios - Xcode 6 not displaying correct image size for iPhone 6 simulator -

ios - Xcode 6 not displaying correct image size for iPhone 6 simulator - ive been next tutorial https://www.youtube.com/watch?v=_36y6rdckp0 on using image.xcassets display total screen images on different devices. creating launch items easy placeholders displayed. but, problem when creating new image set follows. the images have placed in each placeholder follows: 1x bg.png (320 x 640) 2x bg@2x.png (640 x 960) retina 4 2x bg-568h@2x.png (640 x 1136) 3x bg@3x.png (2208 x 1242) my problem when run iphone 6 simulator loads bg@2x.png (640 x 960) image instead of the bg-568h@2x.png (640 x 1136) image iphone 6? (the image stretched). other images sizes right each device. on video tutorial the iphone 6 simulator load bg-568h@2x.png (640 x 1136). doing wrong ?? after lot of playing around believe bug. when running iphone 6, image.xcassets should load 568h@2x.png (640 x 1136). xcode should scale 750 x 1334. doesn't, loads iphone 4 (320 x 640) image. work round p

Filter Doesn't display data using AngularJS -- Javascript -

Filter Doesn't display data using AngularJS -- Javascript - so, trying apply filter info i'm displaying. however, include filter in code can't see info beingness displayed should be. i've looked filters angularjs , creating own. seems pretty straight-forward , easy plenty implement kinds of problems occur filters? i'm looking constructive criticism angularjs , javascript, not skills computer scientist. negative comments deleted , reputation people hurt! <thead> <tr ng-if="vm.detail == false"> <th><input type="text" ng-model="filter.divisionname" class="input-sm form-control" /></th> <th><input type="text" ng-model="filter.poolname" class="input-sm form-control" /></th> <th><input type="text" ng-model="filter.subpoolname" class="input-sm form-control" /></th>

r - Decode base64 and unzip vector in-memory -

r - Decode base64 and unzip vector in-memory - i'm using rcurl vector of zipped , base64 encoded text data. need decode , unzip original content. figured can utilize base64decode catools bundle decode vector. there way can unzip vector in memory? i've found unzip packages r work .zip files. i'm trying not write content file, unzip , read them back. there way can decode , unzip in memory? you can utilize memdecompress in base r, you're looking @ support gzip , bzip2 & xz . if – @ os layer – create ram disk, you're technically not writing permanent file , getting similar in-memory benefits (if can't utilize memdecompress ). r vector base64 unzip

weblogic - Java ClassLoader Issue or Concurrency Error? -

weblogic - Java ClassLoader Issue or Concurrency Error? - after weblogic app has been running fine few weeks exception: <oct 25, 2014 9:31:11 pm edt> <error> <http> <bea-101020> <[servletcontext@60724164[app:whatever3000 module:whatever3000.war path: spec-version:2.5]] servlet failed exception java.lang.exceptionininitializererror after application defunct noclassdeffounderror until app server restarted. the total stack trace shows origin of issue concurrentmodificationexception in static initializer. specifically equivalent / minimized code follows: package a; import b; public class whatever { void doit() { password p = new password(); } } bundle b; public final class password implements serializable { private static final int param1 = commonstuff.somestaticmethod(); ... } import java.util.properties; public class commonstuff { private static properties prp = new properties();

linux - Child hangs if parent crashes or exits in google_breakpad::ExceptionHandler::SignalHandler -

linux - Child hangs if parent crashes or exits in google_breakpad::ExceptionHandler::SignalHandler - this happens if parent crashes after cloning kid process, before sending unblocking byte sendcontinuesignaltochild() . in case pipe file handle remains opened , kid stays infinitely blocked on read(...) within waitforcontinuesignal() . after crash, kid adopted init process. steps reproduce: l. simulate parent crash in google_breakpad::exceptionhandler::generatedump(crashcontext *context) : ... const pid_t kid = sys_clone( threadentry, stack, clone_files | clone_fs | clone_untraced, &thread_arg, null, null, null); int r, status; // allow kid ptrace sys_prctl(pr_set_ptracer, child, 0, 0, 0); int *ptr = 0; *ptr = 42; // <------- crash here sendcontinuesignaltochild(); ... send 1 of handled signal parent (e.g. sigsegv), above generatedump(...) method envoked. observe parent exits kid still exists, blocked on waitforcontinuesignal() . output above

jsf 2 - How to throw 404 from bean in jsf -

jsf 2 - How to throw 404 from bean in jsf - i need throw 404 , take visitor specific page. trying next code: facescontext facescontext = facescontext.getcurrentinstance(); externalcontext externalcontext = facescontext.getexternalcontext(); externalcontext.setresponsestatus(httpservletresponse.sc_not_found); externalcontext.setresponseheader(common.location, "browse_by_category.xhtml?category=category_all"); facescontext.responsecomplete(); 404 happens redirection browse_by_category.xhtml page not happen. help appreciated. according comment please seek this: facescontext facescontext = facescontext.getcurrentinstance(); externalcontext externalcontext = facescontext.getexternalcontext(); externalcontext.setresponsestatus(httpservletresponse.sc_not_found); //externalcontext.setresponseheader(common.location, "browse_by_category.xhtml?c

deployment - Force program to use java instead of java 8 -

deployment - Force program to use java instead of java 8 - i have programme (xx.jnlp) run webstart. application must utilize java 1.7.0_71. (32bit) when java 8 (64bit) installed tries start it. i have found out can controlled java command panel (user) , through deployment.properties , deployment.config my question now. how define code within deployment.properties , deployment.config run specified program(xx.jnlp) specified java version (in case 1.7.0_71 32bit) i tried line in deployment.properties. "deployment.javaws.jre = 1.7.0_71 /jnpl=http://xx.jnlp / arch = x86 " maybe need within deployment.config best regards add next jnlp file: <resources> <j2se version="1.7.0_71" arch="x86" /> </resources> as described here. maybe need test several options, before work properly. java deployment version java-web-start

Different matching results for opencv's descriptor_extractor_matcher when loading data from file -

Different matching results for opencv's descriptor_extractor_matcher when loading data from file - i using next code in descriptor_extractor_matcher.cpp sample compute descriptors of img1 (mat descriptors01), write disk , load (mat descriptors1). (same steps keypoints, code rather much same ...) ptr<descriptorextractor> descriptorextractor = descriptorextractor::create( argv[2] ); ... mat descriptors01; descriptorextractor->compute( img1, keypoints1, descriptors01 ); // compute descriptors filestorage storage("test.yml", filestorage::write); //save disc storage << "blub" << descriptors01; storage.release(); mat descriptors1; filestorage storage1("test.yml", filestorage::read); // load 1 time again storage1["blub"] >> descriptors1; storage1.release(); the keypoints & descriptors image 2 computed , used without saving , loading. i using loaded info (keypoints &a

c++ map of vector in structure -

c++ map of vector in structure - the programme want anagram finder dictionary file , string input, function "anagrams" should homecoming me vector (one each size 1 max) of vector of words found in dictionary match combination of sub-words possible input anagram when create new dictionary function createdictionary, set every anagram in vector of string however, when want check these anagrams in anagrams function, don't know how access (line 74) in uniqueanagram, have every sub-anagram possible, ok, using if (dict.words.find(it->second)){ cout << dict.words.find(it->second)->second[0] << endl; } in loop (as test see if look write right words) leads me error , don't understand why: in function 'std::vector, std::allocator >, std::allocator, > std::allocator > > >, std::allocator std::char_traits, std::allocator >, std::allocator std::char_traits, std::allocator > > > > > anagrams(const

json - Firebase data structure: Attending school on date -

json - Firebase data structure: Attending school on date - i looking first application using firebase backend. i have 2 models, school , user. each user can sign date attend school, need date. a sql table this: schools: id, name users: id, name, email schools_users: id, school_id, user_id, date what proper way of designing info construction in firebase? since don't specify requirements, suggest starting naive mapping @ first: root schools 1: "name of school1" 2: "name of school2" users: 1: { "name": "maeh", "email": "2523229@stackoverflow.com" } 2: { "name": "frank", "email": "209103@stackoverflow.com" } schools_users: 1_1: "20141031" 1_2: "20130102" json nosql firebase

math - How to calculate the winner and loser when with dice in javascript -

math - How to calculate the winner and loser when with dice in javascript - i have set 2 separate "games" 2 dice go @ random , calculates score both. can't show "winner" , "loser". theres player 1 , player 2, , want write winner or loser below player highest or lowest score. tried calculating myself using javascript none of code find correct.i have searched everywhere online nil seems working don't know doing wrong sorry beingness long in dire need doing isn't working, code have here dices , score no "winner" or "looser" <!doctype html> <html> <head> </head> <body> <div> <script> var randomnumber1 = math.floor (math.random()*6)+1; var randomnumber2 = math.floor (math.random()*6)+1; var opentag = " <img src = 'die"; var closetag = ".gif'>"; var imagetagstring1 = opentag + randomnumber1 + closetag; var imagetags

How to print Log4j java sql logger -

How to print Log4j java sql logger - i want utilize log4j java , sql. want print java , sql logs without using "logger.debug("log4j logger")" in class. below class , log4j properties used package com.log4j; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import org.apache.log4j.logger; import org.apache.log4j.propertyconfigurator; public class logtest { public static void main(string[] args) throws exception{ final logger logger = logger.getlogger(logtest.class); propertyconfigurator.configure("log4j.properties"); seek { class.forname("oracle.jdbc.oracledriver"); connection conn = drivermanager.getconnection("xxx", "yyy", "zzz"); string inserquery = "insert table1 (name,id) values (?,?)"; preparedstatement prestat = conn.preparestatement(inserquery); prestat.setstring(1, "test&q

binary - Shifting fractions in c -

binary - Shifting fractions in c - i have code: int = 3, b = 2; (a/b) << 3 ; how a/b shifted? , how can represent fractions in binary? (a/b) not shifted. evaluate look (a/b) int/int int, shifted. (a/b) << 3 (3/2) << 3 //integer divided integer gives integer, 1 (1) << 3 // 1 left shifted 3 bits 8 c binary bit-shift

r - coloring a segments of a curve when using stat_function in ggplot -

r - coloring a segments of a curve when using stat_function in ggplot - i have plotted z-curve, , have used geom_segment to color areas underneath curve. i have plotted z distribution using p <- ggplot(data.frame(x = c(-3, 3)), aes(x)) + stat_function(fun = dnorm) i color segments of curve color of curve matches color on x-axis beneath it. since i'm using stat_function , sense there less of chance modify it's characteristics. has attempted similar feat , found way this? dnorm_segment <- function(x, min = 0, max = 1) dnorm(x)*ifelse(x>=min & x<=max, 1, na) zero_segment <- function(x, min = 0, max = 1) ifelse(x>=min & x<=max, 0, na) plot_both <- function(min, max, colour) { args <- list(min = min, max = max) list( stat_function(fun = dnorm_segment, col = colour, size = 3, args = args, n = 1001), stat_function(fun = zero_segment, col = colour, size = 3, args = args, n = 1001) ) } ggplot(data.frame(x =

server - biograph.be We're sorry, but something went wrong -

server - biograph.be We're sorry, but something went wrong - i pharmacist , need site working, don't know do. maybe server, maybe me. lame (html-things). i go site: biograph.be , ok point, if want search illustration : tpo gene this happen: we're sorry, went wrong. and that's it. here view-source: <!doctype html> <html> <head> <title>we're sorry, went wrong (500)</title> <style type="text/css"> body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; } div.dialog { width: 25em; padding: 0 4em; margin: 4em auto 0 auto; border: 1px solid #ccc; border-right-color: #999; border-bottom-color: #999; } h1 { font-size: 100%; color: #f00; line-height: 1.5em; } </style> </head> <body> <!-- file lives in public/500.html --> <div class="dialog"> <h1>we're sorry

Java: Subclass can't get value of field in superclass -

Java: Subclass can't get value of field in superclass - here's superclass: public class memorycalc { private double currentvalue; public double getcurrentvalue() { homecoming currentvalue; } public void setcurrentvalue(double currentvalue) { this.currentvalue = currentvalue; } public int displaymenu() { @suppresswarnings("resource") scanner input = new scanner(system.in); int selection = -1; while (choice < 1 || selection > 6) { system.out.println(); system.out.println("menu"); system.out.println("1. add"); system.out.println("2. subtract"); system.out.println("3. multiply"); system.out.println("4. divide"); system.out.println("5. clear"); system.out.println("6. quit"); system.out.println(); system.out.print("what do? "); selection = input.nextint();

javascript - Observing "ended" media event on Polymer -

javascript - Observing "ended" media event on Polymer - i'm trying observe "ended" media event video playback. plan trigger action when video.ended == true. here template code: <div id="container"> <video id="video" width="{{width}}" autoplay> <source src="shamman.mp4" type='video/mp4;codecs="avc1.42e01e, mp4a.40.2"' /> </video> </div> <content></content> and here javascript: polymer({ author: '', ready: function() { console.log(this.$.video.ended); var observer = new pathobserver(this.$, 'video.ended'); observer.open(function(newvalue, oldvalue) { console.log(newvalue); console.log(oldvalue); }); } }); the first console.log returns initial value of ended, "false". sec , 3rd console.log never executed. i think practical way of doing using html5 a

Why does Python's max() function place a low value on strings with a leading space? -

Why does Python's max() function place a low value on strings with a leading space? - the quesion i've noticed built-in max() function in python 2.7.6 seems place low "value" on strings leading space unless tell utilize len function key. why that? example consider snippet interactive interpreter: >>> max(['abc', 'defgh']) 'defgh' >>> max(['abc', ' defgh']) 'abc' >>> max([' defgh']) ' defgh' >>> max(['abc', ' defgh'], key=len) ' defgh' notes i tried looking @ the source max() , , calls min_max(). on line 1370, case no key specified handled. there comment says "no key function; value item". don't know value associated string besides length, comment mean? also, why leading space impact magical value c code keying off of? python doesn't "ignore" string @ - behavior exactly becau

angularjs - Angular TypeError: Cannot read property 'then' of undefined -

angularjs - Angular TypeError: Cannot read property 'then' of undefined - i have info service this: this.myfunction= function(callback) { var url = rooturl + "path1/path2/service.json"; var promise = $http.get(url); promise.then(function(payload){ homecoming callback(payload); }); homecoming promise; } it called in controller initialize stuff: dataservice.myfunction(function(data) { if(data.statustext !== "ok"){ $scope.$worked= false; }else{ $scope.$worked= true; } } and "typeerror: cannot read property 'then' of undefined". console.log(data) in callback shows 200 "ok" response , info expect. have searched error , due not returning promise in service. however, i'm returning promise. setting on controller scope in callback causes error. angular version: angularjs v1.3.0-rc.2 thanks! you don't need homecoming promi

java - jasper reports file not found exception need help please -

java - jasper reports file not found exception need help please - hi friends trying pass couple of parameter through hashmap jasper report, getting file not found exception file placed under netbeans project folder,the below java code try{ hashmap hmp = new hashmap(); hmp.put("mytin", m_t_n); hmp.put("cname", c_n_m); hmp.put("invno", c_in); hmp.put("ctin", c_t); hmp.put("date", c_d); hmp.put("time", c_m); hmp.put("gtot", gt); hmp.put("dis", dcn); hmp.put("adj", amtn); hmp.put("fin", fn_am); jasperreport jrpt = null; string srcd="report1.jrxml"; jasperprint jp; //jrpt = jaspercompilemanager.compilereport(getclass().getresource(srcd)); jrpt = (jasperreport)jrloader.loadobject(new file(srcd)); jp=jasperfillmanager.fillreport(jrpt,hmp, drive

python - Get numpy 2D array from user input -

python - Get numpy 2D array from user input - i trying numpy two-dimensional array user input except not work input() returns 'str' type while numpy array() method expects tuple: import numpy n def main(): = input() # user expected come in 2d array [[1,2],[3,4]] illustration = n.array(a) # since 'str' print(a.shape) # output '()' instead of '(2, 2)' showing previous instruction didn't work expected if __name__ == "__main__": main() so question be: how can turn input string tuple array() method turns input numpy 2d array? thanks in advance. the next interactive session worked fine in case: >>> = input() [[1, 2], [3, 4]] >>> >>> [[1, 2], [3, 4]] >>> type(a) <type 'list'> >>> import numpy >>> numpy.array(a) array([[1, 2], [3, 4]]) >>> are entering info wrapped in quotes, i.e.: >>> = input() &

mysql - Database cluster for storage -

mysql - Database cluster for storage - i’m working in big project need massive database storage , web access. about web server performances, quite easy deploy. utilize load balancing scheme proxy ha/varnish my question database storage. need store huge quantity of simple info in real time , generate statistics. thinking nosql want maintain “simple” , don’t have knowledge nosql… think best selection me deploy mysql cluster of maybe mariadb cluster. let me show info need store: receive 1 1,5 1000000 of records each day: ip address, username, site id, rating. based on data, i’ll produce statistics every 6 hours. first database i’ll have massive write access, , little read access (read access internal use) statistics, have 25 millions of read query per day. because database huge after months, want have plenty disk space without having move new server, don’t know kind of technology best. think i’ll utilize ovh dedicated server 2 nic first public access , sec interna

html - how to make the navigation go across the whole page -

html - how to make the navigation go across the whole page - my aim: create navigation bar go across whole screen, greyish colour (#839496). , have each link/button have border left , right of it. navigation bar on: http://www.theberrics.com/dailyops however, my problem is: link/button going across far goes. want each button go across width of 150px (which works fine). have gray bar go on through whole screen horizontally (which isnt working , displays nothing). here css: nav { background-color: #839496; padding: 0.02px 0; margin-bottom: 10px; } nav ul { width: 100%; /*right here: whole unordered list go across screen. doesnt work*/ position: relative; left:10%; margin: 0; padding-left: 100px; } nav li { float: left; } nav li a{ display: block; width: 150px; background-color: #839496; color: #fff; text-align: center; font-weight: bold; text-transform: uppercase; padding: 5px; border-right: 1p

data structures - Zipping unequal lists in python in to a list which does not drop any element from longer list being zipped -

data structures - Zipping unequal lists in python in to a list which does not drop any element from longer list being zipped - i have 2 lists a = [1,2,3] b = [9,10] i want combine (zip) these 2 lists 1 list c such c = [(1,9), (2,10), (3, )] is there function in standard library in python this? what seek itertools.izip_longest >>> = [1,2,3] >>> b = [9,10] >>> in itertools.izip_longest(a,b): print ... (1, 9) (2, 10) (3, none) edit 1: if want rid of none s, try: >>> in (filter(none, pair) pair in itertools.izip_longest(a,b)): print (1, 9) (2, 10) (3,) edit 2: in response steveha's comment: filter(lambda p: p not none, pair) pair in itertools.izip_longest(a,b) python data-structures

javascript - add slide function to multiply items -

javascript - add slide function to multiply items - i added jquery mobile v1.2.0 our manifest add together slide funtion mobile devices. show accommodation template: :javascript $(document).ready(function() { $("#mycarousel").swiperight(function() { $("#mycarousel").carousel('prev'); }); $("#mycarousel").swipeleft(function() { $("#mycarousel").carousel('next'); }); }); images: #mycarousel.carousel.slide .carousel-inner - @house.attachments.each_with_index |a, index| %div{ :class => "#{index == 0 ? 'active item' : 'item'}" } = link_to(image_tag(a.file.url), photo_country_region_house_path(@country, @region, @house) ) %a.carousel-control.left %i.fa.fa-arrow-circle-left.fa-2x{"data-slide" => "next", :href => "#mycarousel"}

Fullcalendar day 24+7hours -

Fullcalendar day 24+7hours - im looking way how alter start/end day of day. for example: day start @ 7am , end @ 7am next day. in short need forcefulness calendar thinking day start , end +7hours any idea? look @ nextdaythreshold "when event's end time spans day, minimum time must in order render if on day." $('#calendar').fullcalendar({ nextdaythreshold: '07:00:00', // 7am ... }); fullcalendar

javascript - How to align two texts on right in d3 -

javascript - How to align two texts on right in d3 - how align text left of text right-aligned? must 2 distinct elements texts (one numbers , 1 'r$') because each have different style (like image below) to facilitate example, made ​​a little code in jsbin http://jsbin.com/qukoto/4/edit so next each value mean? i.e. this text = summary.append "text" .attr "text-anchor": "end", x: 250 text.append "tspan" .text "r$ " .attr "class": "summary-currency" text.append "tspan" .text (d) -> d3.format(',.0f') d .attr "class": "summary-value" javascript svg d3.js

dictionary - Python Tkinter Menu Command Not Working -

dictionary - Python Tkinter Menu Command Not Working - i trying execute next code in python 2.6.5. want show main window 'applications' menu. want menu have series of commands should correspond keys of apps dictionary. when click command, default web browser open , navigate url in apps dictionary particular key. instead, when execute code browser opening first url in apps dictionary without clicking. help please! from tkinter import * import webbrowser #real links pages on intranet. apps={ 'google':'http://www.google.com/', 'yahoo':'http://www.yahoo.com/' } def openapp(appurl): webbrowser.open(appurl, new=1, autoraise=1) homecoming none root=tk() menubar=menu(root) root.config(menu=menubar) appsmenu=menu(menubar) app in apps: appsmenu.add_command(label=app, command=openapp(apps[app])) menubar.add_cascade(label='apps', menu=appsmenu) root.mainloop() appsmenu.add_command(label=app, comman

database - Add project references in Xamarin's Shared Project -

database - Add project references in Xamarin's Shared Project - i using xamarin develop ios , android application.i have creates 1 shared project mutual both platforms. using database mutual , set in shared project.i need encrypt database, need add together native sqlite library reference in shared project can modify code. my question : have not found way add together reference of other project/library in shared project. is bug or expected behavior? any explanations appreciated. thanks. there no 'references' usual sense of adding project reference shared project. there scope shared project opened farther is, not, , design, currently, although limiting in ways. in short, shared projects have no generated outputs. other projects reference shared project(s) compilable outputs generated - based on conditional compilation symbols may have specified. in order add together sqlite library references need utilize nuget in order add together packag

ios - tableView.reloadData() causes crash in Swift -

ios - tableView.reloadData() causes crash in Swift - i read question asked on stackoverflow making view controller transparent when shown parent view controller can still seen behind. able so: however when click add together subject table view not add together subject tableview (this view appears behind above view when "+" button tapped): but if exit main menu , come table view displays list (which want when tap "add subject). i think due tableview.reloaddata() beingness in viewwillappear function. with in mind added tableviewclass.tableview.reloaddata "add subject" button action in order reload info button pressed fatal error: found nil while unwrapping optional value , highlights tableviewclass.tableview.reloaddata i know parent view controller (one table view) not killed 1 time new subject view controller appears in order show behind. why "viewwillappear" never called. im still little confused why crashing though... he

html - Why wont my Navigation Bar Center? -

html - Why wont my Navigation Bar Center? - why won't navigation bar center? i've tried < center> < /center> on main .html text no avail. class="snippet-code-css lang-css prettyprint-override"> #nav ul { text-align: center; list-style-type: none; } #nav li { float: left; } #nav a:link, a:visited { margin-left: auto; margin-right: auto; display: block; width: 120px; font-weight: bold; color: #ffffff; background-color: #21aeb8; text-align: center; padding: 4px; text-decoration: none; text-transform: uppercase; } #nav a:hover, a:active { background-color: #2bc1cc; } class="snippet-code-html lang-html prettyprint-override"> <link rel="stylesheet" href="style.css"> <head> <link href='http://fonts.googleapis.com/css?family=open+sans