Posts

Showing posts from May, 2012

Run Selenium Java Code on Jenkins master using shell -

i'm trying run java selenium code on jenkins using shell command. java file needs 3 .jar files in order run. tired, among other commands, javac "*.jar" myfile.java not working. i'm pulling code form repository , master node running redhat 6. when run javac myfile.java follwoing error messgae: java version "1.8.0_92" java(tm) se runtime environment (build 1.8.0_92-b14) java hotspot(tm) 64-bit server vm (build 25.92-b14, mixed mode) clusterreloadaut.java:3: error: package org.openqa.selenium not exist import org.openqa.selenium.by; ^ clusterreloadaut.java:5: error: package org.openqa.selenium not exist import org.openqa.selenium.webdriver; ^ clusterreloadaut.java:6: error: package org.openqa.selenium.firefox not exist import org.openqa.selenium.firefox.firefoxdriver; ^ clusterreloadaut.java:11: error: cannot access webdriver static webdriver driver = new firef

javascript - nodejs adding double quotes to command arguments? -

example: ffmpeg -i test.mkv -metadata title="test 123" -c copy temp.mkv ffmpeg sees ""test 123"" . happens spawn() , execfile() if run same command in windows shell ffmpeg sees correctly "test 123" so what's nodejs? here's nodejs code: var process = spawn('ffmpeg', [ '-i', infile, '-metadata', 'title="test 123"', '-c', 'copy', outfile ]); you need switch "title='test 123'" since double quotes have precedence on single quotes. stdin should parse right title="test 123" .

php - How to get two forms on one submit -

this question has answer here: how submit 2 forms in 1 page single submit button 3 answers i have 2 forms this: <h2>first form</h2> <form id="first-form"> <table> <tr> <td> <input type="text" name="left[]" value=""> </td> <td> <input type="text" name="right[]" value=""> </td> </tr> <tr> <td> <input type="text" name="left[]" value=""> </td> <td> <input type="text" name="right[]" value=""> </td> </tr> <tr> <td> <input type="text" name="left[]" value

Match function of Excel with different sheets -

i want use match function lookup array in different sheet. here trying: = match( "lead-poi-bba concours", sheet_13_15!f5 : sheet_13_15!o5) but giving error #n/a i tried changing = match( "lead-poi-bba concours", 'sheet_13_15'!f5 : 'sheet_13_15'!o5) but again reverts = match( "lead-poi-bba concours", sheet_13_15!f5 : sheet_13_15!o5) giving same error #n/a where making mistake no need refer sheet twice. sheet!range = match( "lead-poi-bba concours", sheet_13_15!f5:o5)

Using Spring MVC Upload image to /webapp/resources/images directory -

i follow approach uploaded "/var/www/java/football/src/main/webapp/resources/images" folder here need specify complete path , question root path directly "webapp/resources/images" no need specify complete path, how root path ? @requestmapping(value="/savedeal",method=requestmethod.post) public string savedeal(@modelattribute("savedeal") deal deal,bindingresult result,@requestparam("couponcode") multipartfile file,httpservletrequest request){ if(!file.isempty()){ try{ byte[] bytes=file.getbytes(); system.out.println("byte data :"+bytes); string filename=file.getoriginalfilename(); file newfile = new file("/var/www/java/football/src/main/webapp/resources/images"); if (!newfile.exists()){ newfile.mkdirs(); } file serverfile = new file(newfile.getabsolutepath()+file.separator+filename); buff

php - WordPress translate functionality -

i know __() function double underscore function, people call translate string.what's actual name of __(),_e functions in wordpress ? all of series of functions translating strings said -- don't have specific "name" per-say, operation perform. there quite few different ones: __() - retrieve translation of $text . _e() - display translated text. _x() - retrieve translated string gettext context. _ex() - display translated string gettext context. _n() - translates , retrieves singular or plural form based on supplied number. _nx() - translates , retrieves singular or plural form based on supplied number, gettext context.

c++ - How does std::invoke(C++1z) work? -

namespace detail { template <class f, class... args> inline auto invoke(f&& f, args&&... args) -> decltype(std::forward<f>(f)(std::forward<args>(args)...)) { return std::forward<f>(f)(std::forward<args>(args)...); } template <class base, class t, class derived> inline auto invoke(t base::*pmd, derived&& ref) -> decltype(std::forward<derived>(ref).*pmd) { return std::forward<derived>(ref).*pmd; } template <class pmd, class pointer> inline auto invoke(pmd pmd, pointer&& ptr) -> decltype((*std::forward<pointer>(ptr)).*pmd) { return (*std::forward<pointer>(ptr)).*pmd; } template <class base, class t, class derived, class... args> inline auto invoke(t base::*pmf, derived&& ref, args&&... args) -> decltype((std::forward<derived>(ref).*pmf)(std::forward<args>(args)...)) { return (std::forward<derived&g

python - displaying values from entry boxes in tkinter -

i doing gcse computer science , current piece of work have make population model. have made several entry boxes , want able store , information print on window , later use in calculations. please me values print? have tried multiple ways without luck. apologise, of other code have done may not right! when try run program, error saying 'question 1 not defined' in code have @ minute try , information print appears. # import tkinter module import tkinter def quitfile (): window.destroy() def setvalues(): # create new window window = tkinter.tk() # add title window.title("population model") # make size of window window.geometry("600x600") # set background of window window.configure(background = "#ffffff") # title lbquestion = tkinter.label(window, text = "set generation 0 values", fg = "#5855fa", bg = "#ffffff" , font = "verdana 12 bold") # place widget

c - Segmentation fault with char pointer -

i tried run piece of code on windows, , same 1 on linux. while ran fine on windows, gave me segmentation fault in linux. know in code allocated memory getting wasted, can please clarify why linux giving fault while windows not. char *ptr=(char*)malloc(sizeof(2*10)); ptr="harsh"; printf("%s\n",ptr); this code doesn't segfault itself. there bug somewhere else overwriting memory used string "harsh" (so printf crash) or overwriting data structures maintain heap (so malloc crash) these kinds of problems common beginning programmers, , cause different problems in different environments. since 2 out of 3 lines in program seem have memory-related bugs, seems likely. one of important things c++ programmer has learn afraid of these kinds of bugs. that's why, in modern c++, use raii , collection classes make sure these kinds of problems don't happen.

angularjs - Angular Ui-router: editing a child item with save and cancel where parent has resource resolve -

i have parent child relationship of let's customer , invoices. have customer object navigate state $resource ui-router resolve $resource gets data web service. have child array of invoices off customer customerview has links invoices. trying is: if click invoice link nav invoiceedit state. invoiceedit state, if cancel return customerview , invoice not updated, if save return customerview invoice updated in memory not saved web service until save or cancel pressed on customerview . also, on customerview can press add add invoice. thought push new invoice customer.invoices collection , nav invoiceedit state. so issue is, if invoiceedit , upon save or cancel if nav customerview ui-router, $resource reload web service. it kind of want state.resolve when loading controller/state not when returning it. does know of design pattern deal this?

coldfusion cffile upload how to describe the file to be uploaded -

i've never used cffile upload. in looking @ documentation see file uploaded described name of form field used select file. not use number signs (#) specify field name. i cannot decipher this. if file uploaded john.jpg, residing on user's disk, how indicate in cffile command? i have other questions well, start basic one. what documentation using? there should example there here: <cffile action="upload"> in example (which i've edited), shows not reference name of file user selected, anything, reference name of form field , filecontents , used upload file. <!--- windows example ---> <!--- check see if form variable exists. ---> <cfif structkeyexists(form, "filecontents") > <!--- if true, upload file. ---> <cffile action = "upload" filefield = "filecontents" destination = "c:\files\upload\" accept = "text/html" nameconf

java - Best way to manage my own paths in Google Maps Android API -

i have mobile application have own paths have put in map, best way manage paths? kml files paths , upload them map or specific database purpose? well, i'm using simple sqlite database , works fine, first save locations real types in database , can save locations on list of latlgn objects or on hashmap string key , marker object, example: private void getlatlgns() { dbconnection dbc = new dbconnection(this, "mapsdb", null, 1); sqlitedatabase db = dbc.getwritabledatabase(); cursor c = db.rawquery("select latitude,longitude records", null); if(c.movetofirst()){ { alllatlng.add(new latlng(double.parsedouble(c.getstring(0)), double.parsedouble(c.getstring(1)))); }while (c.movetonext()); } db.close(); } private void addingmarkers { for (int x= 0; x < alllatlng.size() ; x++) { hashmarkers.put(string.valueof(x), mmap.addmarker(new markeroptions() .position(allla

c# - How to add a primary (Surrogate) key from one table into a foreign key of another table? -

i trying add custid(primary key) customers table custid(foreign key) customeraddress table. unable add foreign key automatically. should do. below schema (i copied sql server instance) create table [dbo].[customers] ( [custid] int identity (1, 1) not null, [firstname] nvarchar (50) not null, [middlename] nvarchar (50) null, [lastname] nvarchar (50) not null, [salutation] nvarchar (10) null, [position] nvarchar (50) null, [organizationtype] nvarchar (50) null, [phonenumber] nvarchar (50) not null, [ext] nchar (10) null, [faxnumber] nvarchar (50) null, [cellnumber] nvarchar (50) null, [emailaddress] nvarchar (50) not null, [emailpermission] nchar (10) not null, [password] nvarchar (50) not null, primary

laravel - Unable to load the requested file: home.php -

Image
in codeigniter message : unable load requested file: home.php controller : cp/ login views : cp/ home.blade.php address : http://www.vitrinsaz1.ir/mobile/vitrinsaz/pannel/cp/login routes : $route['default_controller'] = 'index'; $route['pages/(:any)'] = "page/get/$1"; $controllers = array('bank','basecontroller','contact','cron','faq','inbox','index','livescore', 'msg','news','odds','page','profile','poll','rss','setting','traction','user' ,'shop' , 'product' , 'ad' , 'comment','home','login'); foreach($controllers $controller) { $route[$controller] = $controller."/index"; $route[$controller."/(:any)"] = $controller."/$1"; } as folder structure, home.php inside view

c - I am getting a run time error for the following code -

#include<stdio.h> #include<stdlib.h> int main() { int i, j, a[10], result = 0,p; int *m = malloc(sizeof(int)*8); for(i = 0; < 10; i++){ scanf("%d", &a[i]); result += a[i]; } //printf("%d\n", result); //printf("\n"); //for(i = 0; < 8; i++) { for(j = 0; j < 9; j++) { scanf("%d", &m[j]); result = result - m[j]; p = result / 2; } return p; } in code getting runtime error. appreciated. thanks! insufficient memory allocated. int *m=malloc(sizeof(int)*8); // 8 `int` ... for(j=0;j<9;j++){ scanf("%d",&m[j]); // attempt set the 9th `int`, m[8] allocate sufficient memory. #define jsize 9 int *m=malloc(sizeof *m * jsize); if (m == null) handle_outofmemory(); ... for(j=0;j<jsize;j++){ if (scanf("%d",&m[j]) != 1) handle_badinput();

android - Trouble with google drive -

i want create application browsing files in google drive located in root folder. problem can set permissions creating , browsing files. have browse files upload in google drive via browser. @override protected void onresume() { super.onresume(); if (mgoogleapiclient == null) { mgoogleapiclient = new googleapiclient.builder(this) .addapi(drive.api) .addscope(drive.scope_file) .addscope(drive.scope_appfolder) // required app folder sample .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .build(); } mgoogleapiclient.connect(); } to retrieve files root folder use drive.getrootfolder method. the getrootfolder returns drivefolder , can used interact root folder. method return synchronously, , safe invoke ui thread. drivefolder folder = drive.driveapi.getfolder(getgoogleapiclient(), result.getdriveid()); folder.listchildren(getgoogle

repository - Maven nexus could not resolve juniper-contrail-api -

am trying install code on workstation using own remote repository using nexus. of projects can deployed , installed correctly. however, there project dependencies cannot resolved. this log: [info] building apache cloudstack plugin - network juniper contrail 4.5.3-snapshot [info] ------------------------------------------------------------------------ downloading: http://192.168.1.109:8081/nexus/content/groups/public/net/juniper/contrail/juniper-contrail-api/1.0-snapshot/maven-metadata.xml downloading: http://192.168.1.109:8081/nexus/content/groups/public/net/juniper/contrail/juniper-contrail-api/1.0-snapshot/juniper-contrail-api-1.0-snapshot.pom [warning] pom net.juniper.contrail:juniper-contrail-api:jar:1.0-snapshot missing, no dependency information available downloading: http://192.168.1.109:8081/nexus/content/groups/public/org/apache/commons/commons-exec/1.1/commons-exec-1.1.pom downloaded: http://192.168.1.109:8081/nexus/content/groups/public/org/apache/commons/commons-exe

Prints a 2D list of the possible rolls of two dice in python -

i trying print 2d list of possible rolls of 2 dice in python 3.0+, using eclipse have 2 questions. first, why prof gave function take no arguments, should write main program? second, when runs r.append(result) , said attributeerror: 'int' object has no attribute 'append' can helps me please, thank functions: def roll_two_dice(): """ ------------------------------------------------------- prints 2d list of possible rolls of 2 dice. ------------------------------------------------------- postconditions: prints table of possible dice rolls ------------------------------------------------------- """ r = [] rolls = [] r in range(dice1): c in range(dice2): result = r + c + 1 r.append(result) rolls.append(r) r = [] print("{}".format(rolls)) main program functions import roll_two_dice roll_two_dice() the result should table of 2 dice rolls [[2 3 4 5 6 7] .............

windows services - Create setup for web application (PHP) -

i developed php web application in windows. know there 2 service needed this; apache , mysql. application hosted in custom computers, possibl no apache , no mysql in it. need windows setup install these services , check if exist , running. its first time face this, please clear possible on advices , examples. thank you under windows environment, simplest way install easyphp . in automated way, you'll need install script (for quiet install example). check website details. hope helps.

Running Apache Drill Cluster in Windows? -

i'm playing around apache drill first time using nice documentation apache site. able play in embedded mode using sqlline.bat file start it. when comes distributed mode, instructions specific unix system - running drillbit using shell command. is there anyway me play around apache drill cluster using 2 windows boxes? if so, how start drillbits on each client without being able run drillbit.sh file? the shell command can run through cygwin . install , add path it's bin directory path environment variable. assuming have zookeeper installed , set on both windows boxes, open command prompt on each box, navigate apache drill's bin directory , run following command: sh ./drillbit.sh start running drillbits without drillbit.sh hell of task script resolves complete classpath , declares environment variables hadoop_home execution proceed.

Can I raise and handle exceptions in the same function -

i raising exception , trying handle exception in snippet. raising exception part , handling exception part done in function. wrong so? import sys def water_level(lev): if(lev<10): raise exception("invalid level!") print"new level=" # if exception not raised print new level lev=lev+10 print lev try: if(level<10): print"alarming situation has occurred." except exception: sys.stdout.write('\a') sys.stdout.flush() else: os.system('say "liquid level ok"') print"enter level of tank" level=input() water_level(level) #function call the output not handling exception. can explain me why? it better raise exception in function , catch it when call function function not , error handling independent. , makes code simpler. your code never reached except clause because if water level low raises exception , jumps out of fun

metaprogramming - Ruby: Dynamically create new classes -

i'm trying dynamically create set of classes follows. class foo attr_reader :description end ['alpha', 'beta', 'gamma'].each |i| klass = class.new(foo) |i| def initialize @description = end end object.const_set(i, klass) end rather creating each class manually, e. g.: class alpha < foo def initialize @description = 'alpha' end end what right way such thing , how pass iterator nested block? how pass iterator nested block? by using nested block . def not block. def cuts off visibility of variables outside def. block on other hand can see variables outside block: class foo attr_reader :description end ['alpha', 'beta', 'gamma'].each |class_name| klass = class.new(foo) define_method(:initialize) @description = class_name end end object.const_set(class_name, klass) end = alpha.new p a.description --output:-- "alpha" you ca

data structures - element address in 3 dimensional array -

i looking formulas find memory location of element in 3-d array row major , column major. after using logic end following formulas. array a[l][m][n] . row-major: loc(a[i][j][k])=base+w(m*n(i-x)+n*(j-y)+(k-z)) column-major: loc(a[i][j][k])=base+w(m*n(i-x)+m*(k-z)+(j-y)) where x, y, z lower bounds of 1st(l) 2nd(m) , 3rd(n) index. tried formula , got correct result when applied formula on question in book answer did not match. please can me out this.

javascript - How to prevent .load() from browser console? -

i want content of website dynamically loaded after login. $.post(...) interacts servlet validates user's credentials, , $.load(url) loads content separate page <div> . noticed that, long know fetch content from, can force behavior chrome javascript console, bypassing validation. how can prevent user doing this? you can't. once document has been delivered user's browser under control of user. can run js like. the urls present on webserver public interface it. can request them. can use authentication/authorization limit gets response, can't make response conditional on user running specific javascript supply. the server needs authorize user each time delivers restricted data. can't once , trust browser enforce it.

swift - NSOutlineView, using item: AnyObject -

i'm creating nsoutlineview . when implementing data source, although i'm able create top hierarchy can not implement childhierarchy. reason can't read item: anyobject? prevents me returning right array dictionary. //mark: nsoutlineview var outlinetophierarchy = ["collect", "review", "projects", "areas"] var outlinecontents = ["collect":["a","b"], "review":["c","d"],"projects":["e","f"],"areas":["g","h"]] //get children item func childrenforitem (itempassed : anyobject?) -> array<string>{ var childrenresult = array<string>() if(itempassed == nil){ //if no item passed return highest level of hirarchy childrenresult = outlinetophierarchy }else{ //issue here: //need find title call correct child childrenresult = outlinecontents["collect"]!

php - Abbreviate Number Function Won't Output Negative Value -

so have class, appreciates numbers. example, abbreviatenum::convert(1178); round , turn 1.18k . this works should, nicely. however, can't seem figure out how output negative numbers. if run abbreviatenum::convert(-1178); , output same response 1.18k . without negative indicator. any tips on how fix this? <?php namespace app\helpers; class abbreviatenum { /** * abbreviate long numbers * * @return response */ public static function convert($num) { $num = preg_replace('/[^0-9]/', '', $num); $sizes = array("", "k", "m"); if ($num == 0) return(0); else return (round($num/pow(1000, ($i = floor(log($num, 1000)))), 2) . $sizes[$i]); } } here modified function provides little bit more robustness strings accept. public static function convert($num) { $num = intval(preg_replace('/[^\-\.0-9]/', '', $num)); $sizes = array("

matplotlib - Unable to catch RuntimeError in python -

i writing python 2.7 plotting script using matplotlib , want display plotted, unless run non-x session on institute server batch-plotting. such cases tell not display anything. however don't want stop if forget doing that, why i'm trying catch runtimeerror exception so: try: pyplot.show() except runtimeerror: print 'could not display figure. no x-session?' except: print 'unexpected error:' raise doing this, however, still i'd without trying catch anything, namely traceback and: runtimeerror: invalid display variable it doesn't print 'unexpected error', doesn't run second except. what missing? might simple because i'm rather new this. edit: the exception seems thrown before try display plot, maybe different problem altogether. the problem somewhere else altogether. hava use different backend matplotlib if i'm running non-x session. checking display-variable cel suggested , calling matplotl

ios - Reload data in table view without harming animation -

i have uitableview-based in-game shop. every cell has "buy" button enabled , can switched "bought" if item one-time purchase or can disabled if there not enough money. right calling reloaddata every time buy button being pressed in order update visible cells , current cell itself. (i have update cells, because after purchase possible there wont enough money visible item cells). but causes weird animation glitches, when click on 1 cell's buy button , animation finishes on one. i think happens due reusability of cells. want know how reload data in whole table view without harming native animation. the thing can think of not use reusable cells , cache them all, dont think programming practice. first, make sure view layer , model layer separate. there should non-view object knows each item; we'll call item . now, create itemcell (you have 1 already). that's reusable cell. hand item . should configure based on data in there. use k

javascript - Duplicate entries in webix datatable when changing state of ui-router in angularJs -

i having problems webix datatable. i boulding application angularjs , ui-router webix integration. when refresh site, o.k. when redirect view datatable load duplicate entries. i using webix , firebase extensions. i think somehow related angular please answer. thanks! most have problem data ids. webix widgets may render data twice if .load called twice , each time data different ( or missed ids ) loaded. if have .load somewhere in code, try prepend .clearall call grid.clearall();//delete existing data grid.load("some");//load new data

http - Safari render HTML as received -

when load html page have 5 strings written second apart. <br>1</br> ...... 1 second ...... <br>2</br> ...... 1 second ...... <br>3</br> ...... 1 second ...... <br>4</br> ...... 1 second ...... <br>5</br> ...... 1 second ...... --- end request --- chromium , firefox both load , display first br next received. (firefox requires content encoding however). safari refuses display of tags until request ended. chromium seems it. firefox first needs determine content encoding https://bugzilla.mozilla.org/show_bug.cgi?id=647203 but safari seems refuse. different response code or header needed? try setting explicitly content type text/html. didn't work. i have confirmed in wireshark strings being sent second apart, i.e not being cached , sent @ once. i have confirmed occurs if go through localhost or use public ip address. i have tried content-length , keep alive, former closes request automatically, latter seem

dataframe - Aggregate R data frame over count of a field: Pivot table-like result set -

i have data frame in following structure channelid,authorid 1,32 28,2393293 2,32 2,32 1,2393293 31,3 3,32 5,4 2,5 what want is authorid,1,2,3,5,28,31 4,0,0,0,1,0,0 3,0,0,0,0,0,1 5,0,1,0,0,0,0 32,1,2,0,1,0,0 2393293,1,0,0,0,1,0 is there way this? the xtabs function can called formula specifies margins: xtabs( ~ authorid+channelid, data=dat) channelid authorid 1 2 28 3 31 5 2393293 1 0 1 0 0 0 3 0 0 0 0 1 0 32 1 2 0 1 0 0 4 0 0 0 0 0 1 5 0 1 0 0 0 0

java - Why does my binary search produce an ArrayIndexOutOfBoundsException? -

i using eclipse. code: private int binarysearch(int[] arraysorted, int value, int min, int max) { if (max < min) { return -1; } else { int mid = min + max / 2; if (value > arraysorted[mid]) // line 22 return binarysearch(arraysorted, value, mid + 1, max); else if (value < arraysorted[mid]) return binarysearch(arraysorted, value, min, mid - 1); else return mid; } } and error: exception in thread "main" java.lang.arrayindexoutofboundsexception: 7 @ launcher.binarysearch(launcher.java:22) @ launcher.binarysearch(launcher.java:23) @ launcher.main(launcher.java:14) i call method so: int[] arraysorted = { 0, 1, 2, 2, 4, 7, 99 }; binarysearch(arraysorted, searchnum, 0, arraysorted.length - 1); can figure out why getting this? how can identify issue using debugger? the middle index element calculated incorrectly because of missing parentheses. it should be: in

python - Sublime text plugin is not working -

i'm using sublime text 3 , i'm writing simple plugin, problem have whenever put myplugin.py in packages/user folder result perfectly. but when move myplugin.py file folder example myplugin/myplugin.py plugin not working anymore. tried see if there information logged console found nothing related problem. can 1 tell me problem , i'm doing wrong? actually missing fact sublime text plugin should living in packages folder , not packages/user folder

Using Python Subprocess to send command lines to command prompt [Error 2: The system cannot find the file specified] -

i'm trying send command line command prompt (terminal) , read output keep receiving error: self get_version(self) file <folder path of script>, line 39, in get_version stdout = subprocess.pipe file "c:\python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) file "c:\python27\lib\subprocess.py", line 958, in _execute_child startupinfo) windowserror: [error 2] system cannot find file specified here's code: import subprocess def get_version(self) command = "wmic datafile name='c:\\drivers\\current_version\\genericdriversetup.exe' version" proc = subprocess.popen([command], stdout=subprocess.pipe) stdout_value = proc.communicate()[0] print '\tstdout:', repr(stdout_value) can tell me what's wrong this? much

html - Hide and show <p> element with javascript -

i creating text based rpg javascript. want hide , show <p> element when specific input made. when "1" pressed, want create <p> element in top right hand corner says "get key handcuffs" -- reminder. below code talk prisoner. after done talking him should reminder. else if (input == "1") { if (currentroom == "interrogation" && guarddead3 == true) { $('<p>no, dont want kill you. why here? <br>prisoner: dont know, got captored. need me. need find key handcuffs. not sure are. </p>').insertbefore("#placeholder").fadein(1000); } else { $('<p>what mean?.</p>').insertbefore("#placeholder").fadein(1000); $("#container").fadeout(3000, function() { $("#killed_guard").fadein(3000); }); } } edit: html:  <div id="placeholder"></div> </div> <!-- input -->

html - How to animate a span becoming visible? -

using following css have cards, when hover on them show additional information using inside div. when div becomes bigger because div within existing div shown, color change animated, resizing of card beacause of info in not animate. solution? /* geschiedeniskaart */ .geschiedeniskaart { width:350px; background-color: #e0f0ff; box-shadow: 3px 3px 1px #888888; margin-top:20px; margin-left:5px; transition: 1s ease; } .geschiedeniskaartdatum { width:350px; background-color: #001433; box-shadow: 3px 3px 1px #888888; margin-top:20px; margin-left:5px; } .geschiedeniskaartdatum .tekst { font-size:1.1 em; margin-left:20px; color: white; line-height: 20px; } .geschiedeniskaart .tekst{ font-size:.9 em; margin-left:20px; color: #00004c; line-height: 20px; } .geschiedeniskaart .visibletekst { display:none; transition: 1s ease; } .geschiedeniskaart:hover { background

python - Connection refused when using abstract namespace unix sockets -

i have strange problem unix socket (us) using so-called abstract namespaces when using python , "pure" c (python 3.x looks 2.x have same problem). "normal" socket works charm. "abstract" 1 code works when i'm using same "code platform" (c or python). first thought has memset / str(n)cpy (see can not connect abstract unix socket in python ) imho it's not case. test matrix (srv - server, cli - client): srv + cli @ "abstract" unix sock: python + python = ok c + c = ok srv + cli @ "normal" unix sock: python + python = ok c + c = ok srv + cli @ "normal" unix sock: python + c = ok c + python = ok srv + cli @ "abstract" unix sock: python + c = fail [cli / strace output: econnrefused (connection refused)] c + python = fail [cli / raised exception: socket.error: [errno 111] connection refused] /proc/net/unix / lsof or strace show nothing unusual: working "normal&

python - Python2 grep command with pipes -

i need identify environment variable in following script. env | grep -i timezone | cut -c14-18 what doing wrong? tried: command = ['env'] command2 = ['grep'] command2.append('-i') command2.append('timezone') command3 = ['cut'] command3.append('-c14-18') process=subprocess.popen(command,stdout=subprocess.pipe,shell=true) process2=subprocess.popen(command2,stdin=process.stdout,stdout=subprocess.pipe) process3=subprocess.popen(command3,stdin=process2.stdout,stdout=subprocess.pipe) (out,err) = process3.communicate() print 'output :', out

javascript - Using Jquery to write html of Div based off of variable -

i'm in process of making simple web based calculator. i'm having trouble assigning value of buttons "screen" area want show value of number pressed. can value javascript variable, when attempt write screen area coming undefined. here code: $(".numbers").click(function(){ currentvalue = ($(this).val()); $("#screen").html(function(){ return "<p> " + currentvalue.tostring() + "</p>"; }) }); the problem seems code getting run twice, when have set return (if use return "test" works perfectly). based on code have provided, believe need: $(".numbers").click(function() { currentvalue = $(this).val(); $("#screen").html("<p> " + currentvalue + "</p>") }); i believe instead of using .html() , should using append() or use input box screen , use .val() . how have it, using .html , overwriting screen every time num

How to import a GitHub hosted project as a Java Project in Eclipse? -

Image
i have forked project on github: https://github.com/iluwatar/java-design-patterns and i'm trying import (clone) own origin repo locally. managed via bash command line, i'm not being able import project in eclipse , make "java project". it's imported "generic project" packages seen plain directories: the import wizard gives these 3 options: if go first 1 says "no projects found" , if go second have no idea how proceed. is wrong way go? i'm using eclipse mars (4.5.1) egit plugin. what trying import maven project. first of all, make sure have m2eclipse installed, projects can imported , built automatically. what in cases following (pictures taken eclipse mars 4.5.1, need adjust eclipse installation shouldn't change much): clone git repository url: https://github.com/iluwatar/java-design-patterns.git . select master branch only once eclipse has downloaded everything, do not use import facility in

java - .equals() or == when comparing the class of an object -

in java, when testing object's class equal use .equals() or == for example in code below be: if(object.getclass() == myclass.class) or if(object.getclass().equals(myclass.class)) you can use instanceof kind of comparision too, anyway, class implementation don´t override equals comparing using == correct, check runtime class, f.e: code shows true: public static void main(string[] args) { object object = ""; if (object.getclass() == string.class) { system.out.println("true"); } } the general rule comparing objects use 'equals', comparing classes if don´t want use instanceof, think correct way use ==.

xml - Java web service client cdata tag -

is possible in simple way send string inside cdata tag witout escaping chacters? used @xmlcdata tag string , changes value when use marshaller. when want send request soapui it'doesn't add this. when add tag manually (for example in setter) escapes characters. for example: if use marshaller get: <?xml version="1.0" encoding="utf-8"?> <getrequest xmlns="pl/nosd/get"> <clientnumber> <![cdata[<client_number>]]> </clientnumber> </getrequest> and that's correct. but when want send soapui using service: sync_customer_service = new sync_customer_service(); customer_porttype customer_porttype = sync_customer_service.getcustomer_httpsport(); getrequest getrequest = new getrequest(); getrequest.setclientnumber("<client_number>"); customer_porttype.get(getrequest); i get: <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:bo