Posts

Showing posts from July, 2013

java - Why do original variables change when new variables are changed? -

i have following block of code: arraylist<integer> list1 = new arraylist<integer>(); arraylist<integer> list2 = list1; // both list1 , list2 empty arraylists system.out.println(list1.size()); // prints: 0 list2.add(7); system.out.println(list1.size()); // prints: 1 how come when modify list2, list1 modified? causing concurrentmodificationexception s in program. how can edit list2 without changing list1? list1 , list2 2 different references set refer same object. if want 2 different lists same contents, can make copy: arraylist<integer> list1 = new arraylist<integer>(); arraylist<integer> list2 = new arraylist<integer>(list1);

Python syntax error in version 2.6 -

this question has answer here: invalid syntax using dict comprehension 1 answer i'm not familiar python need fix script throws syntax error in version 2.6. can explain problem? import pandas pd .... d = pd.read_csv(csv_filename, skiprows=skip).to_dict() d = {k: d[k].values() k in d} this error message: d = {k: d[k].values() k in d} ^ syntaxerror: invalid syntax dictionary comprehensions new feature in 2.7, , aren't valid syntax in earlier versions. instead, pass dict generator expression of two-tuples: d = dict((k, d[k].values()) k in d)

javascript - Does a JSON file on disk, occupy the same amount of space when loaded into a var in memory? -

i store json files on disk (each small 4kb), , load them var when required. may have thousands of such files, , if space occupy in memory same occupy on disk, rather load them memory @ application start. how can calculate how memory (ram) file occupies when create object ? edit: know how save json files disk. not question. trying understand how memory (ram), json file occupy when load var. if know size of json file on disk, how can calculate how memory (ram) occupy when create javascript object file in node.js or in web browser ? the files saved "plain text files". eg: {"foo": { "bar": 1, "foo": { "bar": [ "foo", "bar" ], "foo":[ "bar", "foo" ] } } } the amount of ram occupied object not same size of file. size of file number of bytes in it, amount of ram occupied obje...

php - storing multiple static data into database -

i have table these columns (database) like http://netelity.com/table.jpg . and have static form through user define installments. static 24 input boxes there this <form name="installment" method="post" action="" enctype="multipart/form-data" onsubmit="return validate()"> <table id="dt_hscroll" class="table table-striped"> <thead> <tr> <th>sl no.</th> <th>amount</th> <th>due date</th> </tr> <tr> <td> 1. </td> <td> <input type="text" name="installment1" id="installment" class="span4" value="0" /> </td> <td> <input type="text" name="due_dat...

xamarin.ios - Custom controls not visible in the View -

below code used create custom uitextfield in code behind. uitextfield usernamefield; usernamefield = new uitextfield { placeholder = "enter username", borderstyle = uitextborderstyle.roundedrect, frame = new rectanglef(10, 32, 50, 30) }; view.addsubview(usernamefield); but when run app, dont see anywhere. not control controls create in code behind. if drag controls toolbox onto view it's working fine. might cause? make sure container view not transparent alpha = 1 , set background colors appropriate controlls. because default set clear you can use method easly set background , rounded corners in older versions of ios public static void makeviewrounded(uiview view,float cornerradius, monotouch.coregraphics.cgcolor backgroundcolor) { view.layer.cornerradius = cornerradius; view.layer.backgroundcolor = backgroundcolor; } also make sure adding custom controll viewcontroller/view

oop - Refer to object method property from another method property in JavaScript -

this question has answer here: how access correct `this` inside callback? 6 answers i've got strange behavior , if can workaround i'd know why happens. function game () { this.viewport = { ... }; this.player = player; this.renderer = { ... }; this.stage = { ... }; this.init = function () { //this gets executed this.setkeybindings(); } this.run = function () { //this works requestanimframe(this.update); } this.update = function () { //bad! throws undefined not function //here need use reference here this.processinput(); this.renderer.render(this.stage); this.handlelogic(); //even 1 won't work, worked in init()! reques...

ios - scrollView in Swift provides error in content size -

in storyboard ctrl-dragged uiscrollview in vc , connected property in code. now i'm creating list of buttons inside scrollview list button 1 button 2 ... so exceed size of view. while creating via code buttons i'm storing them inside nsmutablearray , use code manage content size of scrollview self.scrollview.contentsize = cgsize(width:self.view.bounds.size.width, height: self.arrayofcreatedbuttons!.lastobject!.frame.origin.y + self.arrayofcreatedbuttons!.lastobject!.frame.height) the problem scrollview does not scroll till last button created stops before. what's error in code? in advance edit this code i'm using create buttons let btn = uibutton.buttonwithtype(uibuttontype.custom) uibutton btn.frame = frame! // frame! cgrect variable create list of buttons --> y cgfloat decreased every cycle btn.layer.cornerradius = 0.5 * btn.bounds.size.width btn.layer.maskstobounds = true ...

python - UnicodeDecodeError: 'ascii' codec can't decode byte ... in position ... ordinal not in range(128) -

i've read topics similar question, none of fits problems. i'm working in ipython notebook , have following chunk of code: import scipy sp %pylab inline when try run it, fails on second line error in title. why that? because of % before pylab guess have define encoding utf8. like: import sys reload(sys) sys.setdefaultencoding('utf8')

android - Refreshing fragments in ViewPager -

i have fragment activity viewpager in it, , fragment activity should send data fragments inside of pager(so fragments can display search results). so issue when swipe fragment doesnt refresh - need swipe few more times between fragments show new data. can tell me propper approach this? here code: //first init widgets private void initwidgets() { bundle = new bundle(); progressbar = (progressbar) findviewbyid(r.id.search_progressbar); viewpager = (viewpager) findviewbyid(r.id.search_viewpager); titlestrip = (pagertabstrip) findviewbyid(r.id.search_titlestrip); myfragmentpageradapter = new screenslidepageradapter(getsupportfragmentmanager()); viewpager.setadapter(myfragmentpageradapter); viewpager.setcurrentitem(1001); titlestrip.setdrawfullunderline(true); } //then after writing text in search call function// private void search(string keyword) { try { bundle.putstring(intentconstants.keywo...

bash - MIME type check via SFTP connection -

i want list images sftp , save list, script may further process it. unfortunately, there many other files there, need identify images. filtering out wrong file extension, go step further , check content of file. downloading check file --mime-type on local machine slow. there way how check mime type of file on remote sftp before download? we found way, downloading first 64 bytes. lot faster downloading whole file, still enough see if looks image: curl "sftp://sftp.example.com/path/to/file.png" -u login:pass -o img.tmp -r 0-64 file --mime-type img.tmp

javascript - Masking a web page -

Image
example: the area red border can see through mask. else grayscaled , partially hidden opacity or transparent white background. one thing tried make class each selectable area grayscale filter , lower opacity. apply class on areas selected one. doesn't work nested zones because of areas become less opaque others. any advice on how implement this? codepen works expected on #footer , because doesn't have parent or children areas selectable you apply highlighted class chosen element so .highlighted { border: 1px red solid; outline: 999em solid rgba(255,255,255, .75); } a wide outline cover other elements. example : http://codepen.io/anon/pen/emoxrj

Two's complement in C++ - invalid types 'int[int]' for array subscript -

i'm trying implement sort of two's complement algorithm in c++ , far think logic correct. however, following error when run invalid types 'int[int]' array subscript #include <iostream> #include <stdio.h> using namespace std; int main(){ int a[4] = {0, 2, 3, 5}; int b[4] = {9, 7, 8 ,4}; int sum = 0; int transmit = 0; int c{0}; (int k=3;k>0;k--){ sum = a[k]+b[k]+transmit; c[k+1]=sum%10; transmit=sum/10; } c[0] = transmit; return 0; } i guess purpose plus operation of 2 int arrays? little explanation: have declare 5 units 'c' there may 1 additional carrier (you called transmit) #include <iostream> #include <stdio.h> using namespace std; int main(){ int a[4] = {0, 2, 3, 5}; int b[4] = {9, 7, 8 ,4}; int sum = 0; int transmit = 0; int c[5] = {0}; (int k=3;k>0;k--){ sum = a[k]+b[k]+transmit; c[k+1]=sum%10; t...

ios - Is my iPhone app required to be compatible with 3.5" screens now that the iPhone 6 was released? -

i'm developing app iphone. target device when started iphone 5/5s. iphone 6 , 6+ released, app compatible them. however, wondering if supporting old 3.5" displays required. i'd skip step if @ possible, don't want rejected apple it. since ios 8 supports iphone 4s , has 3.5´´ display, guess is: yes, required now. presumably, once ios version drops iphone 4s support released (possibly ios 9 ), require version minimum deployment target of app, , drop support 3.5´´ screens.

How to use javap to see what lines of bytecode correspond to lines in the Java code? -

i tasked make method calculates magnitude of given vector , used javap -c break down. now must show each local variable in magnitude frame corresponds in java, , lines of bytecode correspond what. here method made: public class vector { /** magnitude of vector * calculates magnitude of vector corresponding * array a. * * @return magnitude */ public double magnitude(double[] a){ int n = a.length; double sum = 1; (int i=0; i<n; i++){ sum = sum*a[i]; } double magnitude = math.sqrt(sum); return magnitude; } } here result of using javap -c : public class vector { public vector(); code: 0: aload_0 1: invokespecial #1 // method java/lang/object."<init>":()v 4: return public double magnitude(double[]); code: 0: aload_1 1: arraylength 2: istore_2 3: dconst_1 4: dstore...

c# - How do I retrieve data from cell of selected row in datagridview? -

i have datagridview 7 columns, column 0 , 1 not visible. column 0 id column. when select row value in column 0 . once have value, can delete row data table . deleting row datagridview not problem. this line returns row index no problem; int rowindex = customer_ship_contactsdatagridview.selectedrows[0].index; then research appear line data column 0 of selected row . not. error states "when converting string datetime, parse string take date before......" int contact_id = int.parse(customer_ship_contactsdatagridview[0, rowindex].value.tostring()); any teaching me how value of column tostring selected row of datagridview appreciated. i have found answer in post get value in specific column in datagridview . not sure why didn't find last night except today simplified search , came across post. sorry trouble may have caused, using site help. datagridviewrow row = customer_ship_contactsdatagridview.currentcell.owningrow; string contact_i...

java lambda returning a lambda -

i trying seems relatively basic thing in new jdk8 land of functional programming can't work. have working code: import java.util.*; import java.util.concurrent.*; import java.util.stream.*; public class so1 { public static void main() { list<number> l = new arraylist<>(arrays.aslist(1, 2, 3)); list<callable<object>> checks = l.stream(). map(n -> (callable<object>) () -> { system.out.println(n); return null; }). collect(collectors.tolist()); } } it takes list of numbers , produces list of functions can print them out. explicit cast callable seems redundant. seems to me , intellij. , both agree should work: list<callable<object>> checks = l.stream(). map(n -> () -> { system.out.println(n); return null; }). collect(collectors.tolist()); however error: so1.java:10: error: in...

Need to use name of current button in the associated Acrobat javascript code -

i need insert several (50+) buttons on acrobat document, each of "save as" on specific non-pdf attachment. single button, following script works perfectly: this.exportdataobject({cname:"attachment01", nlaunch:0}) it simpler if use name of current/calling button in javascript this: var currbuttonname = ??? this.exportdataobject({cname:currbuttonname, nlaunch:0}) with second approach, use name of button determine attachment saved, don't have change javascript code @ all. is possible name of current button , if how? thanks. using var currbuttonname = event.target.name ; or based on event.target.name should want accomplish.

c++ - Qt add function call to event loop from other thread -

i've stumbled across problem can't solve on elegant way right now. situation: have callback function called outside application. callback function has update gui object.. since can't call (for example) repaint() within thread, have finde way add function call main event loop task gets executed @ time. one possible way use this: qmetaobject::invokemethod(object, "functionname", qt::queuedconnection, q_arg(float, value)); however, gives me response no such method "object::functionname" . (which lie!) i've read connecting signal slot called event loop setting connection type qt::queuedconnection . however, using qojbect.:connect() won't work since don't knwo object signal needs get. nice like qobject::emit(object, signal(function(flaot)), arg); qmetaobject::invokemethod should use in kind of situation. make sure that: object qobject subclass q_object macro @ top functionname either declared in slots section or ha...

ruby on rails - How do I work around a "RuntimeError: can't modify frozen Hash" when trying to delete records on Heroku? -

at rails console on heroku, trying simple array iteration , delete record if condition exists, , running error. this doing: irb(main):044:0> a.first => #<activity id: 1, trackable_id: 3, trackable_type: "node", owner_id: 5, owner_type: "user", key: "node.create", parameters: {}, recipient_id: nil, recipient_type: nil, created_at: "2014-07-30 11:22:15", updated_at: "2014-07-30 11:22:15", read_status: 0> irb(main):045:0> a.first.trackable.nil? => false irb(main):046:0> a.second.trackable.nil? => true irb(main):061:0> a.each |x| irb(main):062:1* if x.trackable.nil? irb(main):063:2> x.destroy irb(main):064:2> x.save irb(main):065:2> end irb(main):066:1> end runtimeerror: can't modify frozen hash thoughts on how can achieve this? if leave off x.save doesn't rid of record seems. you can't call .save on destroyed record. once you've called .destroy on record, it...

php - How to dump database backup file in computer's another disk and to network pc? -

Image
i using code dump database backup file folder in htdocs named db_backup , , and option download backup file. <?php function export_tables($host,$user,$pass,$name, $tables=false, $backup_name=false ) { $link = mysqli_connect($host,$user,$pass,$name); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } mysqli_select_db($link,$name); mysqli_query($link,"set names 'utf8'"); //get of tables if($tables === false) { $tables = array(); $result = mysqli_query($link,'show tables'); while($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } } else { $tables = is_array($tables) ? $tables : explode(',',$tables); } $return=''; //cycle through foreach($tables $table) { $result = mysqli_query($link,'select * `'.$table.'`'); ...

fortran - Polynomial Interpolation with derivatives -

i made post issue few weeks ago , edited i'm not sure if it's still active. since still bothering me i'm making new 1 in better form, hope. for assignment supposed interpolate function values , derivative values in newton form. can on paper i'm lost when comes turning fortran code. have looked @ different source codes either opened file or asked input, given 5 sets of values , have use those. able write small program interpolation without derivatives. tried add derivatives it. in code below "yp" derivatives program main implicit none double precision , allocatable , dimension (:,:) :: nt double precision , allocatable , dimension (:) :: xnodes, yval, yp double precision :: x, evalnewton integer :: i,n,k n = 7 allocate ( xnodes (0:n), yval (0:n), yp (0:n), nt (0:n, 0:n) ) xnodes = (/ 1.32d0, 2.47d0, 5.81d0, 6.83d0, 7.0d0 /) yval = (/ 5.63d0, 6.11d0, 8.12d0, 4.33d0, 6.15d0 /) yp = (/ 1.29d0, 2.21d0, 1.48d0, -3.61d0, 3.11d0 /) call computent (n, xnode...

java - "Cannot run program error=2" on Linux -

i'm having app running in tomcat 7.0.32 on linux server. app runs program in file. problem of sudden got "cannot run program "./blogin.sh" error=2, no such file or directory" of course, didn't erase file. after while, issue stopped (again, without intervention) , app runs fine. can cause it? thing can think of out of space issue occuered during period. try run command unset catalina_home this command unset environmental variable catalina_home.

vb.net - I want a table in Reportviewer with added information after every line -

i using vb.net , report-viewer. able data dataset table in reportviewer. want after every line can print information related row. how can go it? e.g. datatable fields :: [s.no, name, amount, notes]. want print this, customer1 100.00 note line1----- customer2 200.00 note line2---- and on. suggestions? i assuming have matrix of kind in report, , data table fields in detail section of matrix. i think you'll have add detail row matrix. you can right-clicking on "row header" of detail row. click matrix until grey frame around top , left side appears, , right-click on left-side box triple horizontal lines. that's detail row header. click on insert row menu option, , choose inside group - below detail menu option. have second detail row. if have multiple fields in matrix already, new row have multiple text boxes in it. if want merge them have 1 big text box (suitable long strings of information) can select textboxes in row, right click,...

How to include image to header (as well as content) in CSS? -

on my website have included background (on contact page). when put in background not cover header. has done on main page not on contact page? have tried use #sitewrapper{ background-image: url("http://static.squarespace.com/static/545d45afe4b08eea0ac65e7a/t/54612b8ae4b0ca233d43bdee/1415654282657/website%20background%20trees.png"); background-repeat: no-repeat; background-size: 100%; } so here, puts background in , fits screen background-size: 100%; has put on content. have tried put background on body has put behind content. main goal try , include background header content (like home page). - thanks try setting background image on #site element instead.

python 2.7 - FIltering Pandas Dataframe using vectorization -

i have data frame x rows , y colums, called df. have datafame df2 less x rows , y-1 colums. want filter df rows identical rows of df2 column 1 y-1. there way in vectorized fashion without iterating through rows of df2? here code sample df: import pandas import numpy.random rd dates = pandas.date_range('1/1/2000', periods=8) df = pandas.dataframe(rd.randn(8, 5), index=dates, columns=['call/put', 'expiration', 'strike', 'ask', 'bid']) df.iloc[2,4]=0 df.iloc[2,3]=0 df.iloc[3,4]=0 df.iloc[3,3]=0 df.iloc[2,2]=0.5 df=df.append(df.iloc[2:3]) df.iloc[8:9,3:5]=1 df.iloc[8:9,2:3]=0.6 df=df.append(df.iloc[8:9]) df.iloc[9,2]=0.4 df2 calculated follows: df4=df[(df["ask"]==0) & (df["bid"]==0)] now want filter df rows in df2 except column strike, should have value of 0.4. filter process should without iteration, because real world df large. you try merge on both dataframes, should return (set) intersection ...

html - CSS last-child if more than 4 elements -

jsfiddle - i'm trying last element highlight if there more 4 containers within wrapper. possible using css instead of js <div class="wrapper"> <div class="container">container #1</div> <div class="container">container #2</div> <div class="container">container #3</div> <div class="container">container #4</div> <div class="container">container #5</div> </div> .wrapper div:nth-child(n+4):last-child() { background-color: gold; } yes. can achieve this. there small correction. fiddle: http://jsfiddle.net/kiranvarthi/q5parpxy/4/ .wrapper div:nth-child(n+5):last-child { background-color: gold; }

vbscript - VBS How to call cmd.exe using a string variable with spaces -

i need call following: set wshshell = wscript.createobject("wscript.shell") wshshell.run "cmd /c copy /y c:\input\" & wscript.arguments(0) & " c:\output", 0 where input argument may "file name.txt". have seen countless examples of people doing same thing using double quotes hard coded file location, nothing using input argument or variable. syntax required command line receives: copy /y "c:\input\file name.txt" c:\output and not copy /y c:\input\file name.txt c:\output for arbitrary file name? embed needed quotes (escaped via doubling) in surrounding literals: wshshell.run "cmd /c copy /y ""c:\input\" & wscript.arguments(0) & """ c:\output", 0 background , further reading

excel - VBA - Copy from Closed File paste to next available row on Summary Sheet -

this first post. forgive me if doing wrong here. glad correct mistakes. have found web site valuable baby in field of vba. please have patience me. i super rookie in vba. learning go have spent lot of time on this. find bits , pieces of information on web have trouble in putting them together. have learned how make vba macro can select file , run other macros. using excel 2013. complete time sheet every week(sometimes more @ end of month) of hours work , projects work on. include on sheet when out , code reason. copy 3 sections summary sheet. cell d1. cell has date beside it. copy cell in first row. cells f3-l3 cells code put. copy second cell in first row. the next range of cells aret last cells data in columns f-l. these vary have different numbers of rows work orders each time in columns f-l. copy second row below corresponding cells in first. next file copy next available row in summary. i copy data can figure vacation days, sick days, etc. know i'm asking alot ex...

ios - App rejected - iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution -

just got app rejected. issue : iphone apps must run on ipad without modification, @ iphone resolution, , @ 2x iphone 3gs resolution but have set devices option in xcode on iphone, apple require me run them on ipad well? plus- dont know if it's connected - added section : pla 3.3.12 found app uses ios advertising identifier not include ad functionality. not comply terms of ios developer program license agreement, required app store review guidelines. specifically, section 3.3.12 of ios developer program license agreement states: "you , applications (and third party whom have contracted serve advertising) may use advertising identifier, , information obtained through use of advertising identifier, purpose of serving advertising. if user resets advertising identifier, agree not combine, correlate, link or otherwise associate, either directly or indirectly, prior advertising identifier , derived information reset advertising identifier." note: iad not use ads...

activeadmin - How would I split a form into multiple pages? -

i have resource rather large amount of attributes , relations need able modify respective resource page. the page has become large , unwieldy. wondering if there simple way divide multiple pages. for example, 1 page modify resource attributes, 1 page modify relations table, modify relations table. if use aa master can give try tabs https://github.com/activeadmin/activeadmin/blob/master/docs/5-forms.md#tabs it can separate form visually.

web - What exactly does Node.js do? -

could give me quick description of node.js is? understand server, server? have basic knowledge of web, not understand it. send requests node.js , database? thanks can help! node platform. it's platform written in javascript , c++ interacts , calls underlying operating system don't have directly. makes platform, basically(not framework or environment). it's platform leverages javascript v8 engine can write in javascript abstraction lower details of programming; e.g. writing in c , assembly a server serves requests requester service. if serving request, server. node more server. it's platform act client too, other program. can lower-level language or platform can do, can think of possibilities. higher-level languages , platforms viewed being faster code writing in c. you can send requests node server program can access database on behalf of request , forward database data fulfill request. instance, if request website generates dynamic data database;...

ruby on rails - Use AWS s3 image_url for production and development -

upload images through admin feature on production. use pg_restore pull down production database local db. problem image links broken in development. dev environment use aws s3 image urls both production , development. looking inside consoles, see this: local rails console $ image.last.photo.url $ "/assets/products/3/product/__35.jpg?1415467267" heroku console $ image.last.photo.url $ "https://s3.amazonaws.com/app_name/app/public/assets/products/3/product/__35.jpg?1415467267" i'm using following relevant gems: paperclip, asset_sync, , rmagick my image class using paperclip storage: has_attached_file :photo, paperclip_storage_opts the storage options same in development.rb , production.rb paperclip_storage_opts = { :styles => {:mini => '48x48>', :small => '100x100>', :medium => '200x200>', :product => '320x320>', :large => '600x600>' }, ...

ruby - "-" == "-" returns false.. Why? -

Image
anybody know whats going on here? why "-" not found? try in irb. if string = "(( :h – :2b – :3b – :hr )+( 2 * :2b )+( 3 * :3b )+( 4 * :hr ))/ :ab " string.split(" ")[2] == "-" it returns false well. the character string.split(" ")[2] – . may normal hyphen, in fact different character normal hyphen: - . you can see getting ordinal value of each: string.split(" ")[2].ord # => 8211 "-".ord # => 45 therefore, should checking equality unicode character \u2013 : string.split(" ")[2] == "\u2013" # => true or can replace occurrences of \u2013 - : string.gsub!("\u2013", "-") string.split(" ")[2] == "-" # => true

javascript - Firefox box-sizing + expanding div = missing padding? -

i've been trying solve issue have expanding div (as content added on time) box-sizing , padding . mentioned case works fine on ie , chrome, behaves weird on firefox (33.0.2). here link http://codepen.io/anon/pen/mydpdv keep pressing button. button send end of page via: $("#button").click(function(){ $("#container").scrolltop(99999999999999999); }); after page filled, , scroll appears, see osme reason padding-bottom stay out of page - on firefox! on chrome , ie works should. it looks firefox making wrong calculation somhere? or int not calculate padding @ all, expanding/dynamic content? missing point? i'm looking quickfix. $("#button").click( function(event){ event.preventdefault(); var newdiv = $("<div>"); newdiv.text("here dummy content"); $('#content').append(newdiv); //$('#container').prop('scrollheight'); var sh = parseint($(...

visual studio 2010 security tab missing -

Image
i want ti change security settings in visual studio 2010 . in project-> properties -> security tab missing. i answered here: why not seeing security tab in office solution properties? and here answer re-posted: i had same issue , solution super annoying figure out. on website mentioned security tab relevant types of clickonce applications started playing around various options , figured out. in application tab, application type , select windows forms application drop-down menu (other drop-down options might work haven't tried them) save everything: in main menu bar of visual studio, click file > save all . close project properties window (i.e. 1 application tab modifying) open project properties window again: in solution explorer , select project, go main menu bar, click project , click properties . voila! should there. :)

php - Contact form 7 default option print as selected value in mail -

[select my_select class:input class:styled "select options" "option 1" "option 2" "option 3" "option 4"] question: how prevent printing 'select options' if user not selected options in receiving email? if user select first option ('select options') ,it should not print 'select options' in mail. [select my_select first_as_label class:input class:styled "select options" "option 1" "option 2" "option 3" "option 4"]

ruby - How to enable the command 'CorePlot' in Cocoa Pods? -

when tried install coreplot ios project on xcode via cocoa pods, following massage showed up. of guys give me advice solve issue? thanks. xxxxx-macbook-pro:test1 xxxxx$ pod 'coreplot', '~> 1.5' # coreplot [!] unknown command: `coreplot,` did mean: repo it looks you're trying install pod running pod command line. need put pod definitions in podfile in root of repo. after doing need run pod install . check out using cocoapods guide more info: http://guides.cocoapods.org/using/using-cocoapods.html

Java: Can I create Generic-typed static classes? -

i'm working on quicksort algorithm in java, , i'm required use arrays. right now, want make algorithm support sorting array of comparables. i've looked around, of discussion , tutorials around generics pretty confusing. put, i'm not sure how make work. i've confirmed quicksort works integers, strings, etc, need make work comparables. ide telling me "cannot make reference non-static type t". i'm not sure means. public class quicksort<t extends comparable<t>> { public static void sort(t[] a) { quicksortrecursive(a, 0, a.length-1); } public static void quicksortrecursive(t[] a, int p, int r) { if( p < r ) { int q = partition(a, p, r); quicksortrecursive(a, p, q-1); quicksortrecursive(a, q+1, r); } } public static int partition(t[] a, int p, int r) { string x = a[r]; int = p - 1; for(int j = p; j < r; j++) { if(a[j].compareto(x) <= 0) { = + 1; ...

c# - What is the correct Resource.Load path? -

Image
i'm trying load texture2d (.png) resource using resource.load . i've tried following path patterns: assets/casesensitivepath/texturename casesensitivepath/texturename assets/casesensitivepath/texturename.png casesensitivepath/texturename.png every time, resource.load(path, typeof(texture2d)) returns null. code , error handling: public class lazyresource<t> t : unityengine.object { //path read-only public string path { { return _path; } } private string _path = ""; //whether not found warning thrown //in case, further load attemts ommited , resource returns null... public bool failed = false; //constructor uses path first parameter public lazyresource(string path) { _path = path; } //cached resource private t cache = null; public t res { { //does not re-try if failed before if (cache == null && !failed) { //load pro...

javascript - Enable scrolling with drag-n-drop on touch devices -

Image
re-arranging columns , click working on touch devices. facing issue scrolling. tried resolve iscroll plugin didn't work. screenshot took device mode of chrome browser. table columns can added on-the-fly , number of columns may vary. is there css way work scrolling ??? if not how implement javascript or jquery ??? update: -webkit-overflow-scrolling: touch; not working. update 2: tried below code: if (modernizr.touch) { $('.container-fluid').css('overflow', 'auto'); } and 1 well: if (modernizr.touch) { //iscroll plugin var myscroll = new iscroll('#tblgrid', { scrollbars: true }); } none of them worked. update 3: below code enable dragging of table columns , click event: var clickms = 200; var lasttouchdown = -1; function touchhandler(event) { var touch...

python - Using Subprocess and Communicate to execute commands on Telnet connection -

this first query on stackexchange. kindly excuse, if question been raised , answered. if so, kindly point me same. query: trying establish telnet connection board , run app after that. capture both stdout , stderr during whole process. below snippet of code code snippet: import subprocess import time #1. establish subprocess commandlist = ["telnet"] + ["10.11.12.13"] p = subprocess.popen(commandlist, stdin = subprocess.pipe, stdout = subprocess.pipe, stderr = subprocess.pipe) #2. give login name. there no password p.stdin.write("root\r") #3. adding sync avoid overlap time.sleep(1) #4. invoke communicate execute application specied path on 10.11.12.13 system stdout, stderr = p.communicate('sh /mnt/path/app\r') at step (4), tried printing values of stdout , stderr see whether application 'app' has run or not. unfortunately, has not executed 'p.communicate()...

java - Producer and Consumer in Spring Jms use same connection factory? -

i have component reads messages queue , meanwhile sends processed messages queue. therefore, component both message consumer , producer. configuring them, need connection factory consuming , connection factory producing. here part of spring configuration. <!-- configuration listener --> <bean id="mdc.targetconnectionfactory4listener" class="com.tibco.tibjms.tibjmsconnectionfactory"> <property name="serverurl" value="tcp://localhost:7222"/> </bean> <bean id="mdc.connectionfactory4listener" class="org.springframework.jms.connection.usercredentialsconnectionfactoryadapter"> <property name="targetconnectionfactory" ref="mdc.targetconnectionfactory"/> <property name="username" value="admin" /> <property name="password" value="test" /> </bean> <bean id="mdc.inputqueue" class=...