Posts

Showing posts from July, 2013

json - Working with dates function in php -

i newbie php programming , came across this: { "dates": [ "2015-07-23", "2015-07-22" ], "en": [ "1", "1" ], "ak": [ "0", "0" ], "ga": [ "0", "0" ] } what mean? its json data. { "dates":[ "2015-07-23", "2015-07-22"], "en":["1","1"], "ak":["0","0"], "ga":["0","0"] } the whole thing json object. dates, en, ak , ga json arrays within object. representation in key: value form. dates, en, ak , ga keys , data after ":" value. objects enclosed within { }. json array enclosed [ ]. note: can have embedded objects within objects. associating multiple values key, array used. here key "dates" has ...

html - CSS button with folded corner effect and animations -

i used code below create effect on folded corner button, can not avoid white background in upper left corner of button. class use make transparent part , show yellow color, background of main div? http://codepen.io/rsvaz83/pen/aorzby .back { background: #fc0; } .button { display: inline-block; padding: 1em; margin: 1em; background-color: #007e9f; text-decoration: none; color: white; } .curl-top-left { display: inline-block; position: relative; -webkit-transform: translatez(0); transform: translatez(0); box-shadow: 0 0 1px rgba(0, 0, 0, 0); } .curl-top-left:before { pointer-events: none; position: absolute; content: ''; height: 0; width: 0; top: 0; left: 0; /* ie9 */ background: linear-gradient(135deg, white 45%, #aaaaaa 50%, #cccccc 56%, white 80%); filter: progid: dximagetransform.microsoft.gradient(gradienttype=0, startcolorstr='#ffffff', endcolorstr='#000000'); /*for ie7-8-...

ruby on rails - coccoon: change where added form field is rendered -

i have form uses coccoon dynamically add form fields. problem styling. form fields being added in wrong spot. here code: <div class="col-md-5> <!--content here !--> </div> <div class="col-md-2"> <!-- more content here !--> </div> <%= form_for @owner |f| %> <div class="col-md-4"> <%= f.fields_for :cars |car| %> <%= render 'cars_fields', :f => car %> <% end %> <div class="row text-center center-block"> <%= f.submit "send", class: 'btn btn-default' %> </div> </div> <div class="col-md-1"> <%= link_to_add_association f, :cars, class: 'btn bgm-cyan btn-float waves-effect' %> <i class="md md-add"></i> <% end %> </div> <% end %> here code of partial car_...

sqlalchemy - Python Dataset module error: You might need to add explicit type casts -

having difficulties query data postgres db using python dataset module , data type varchar when query data receive following error. error: line 1: ...t * sources.product post = 31055183... hint: no operator matches given name , argument type(s). might need add explicit type casts. [sql: 'select * sources.product post = 310551835'] snip of code used: deltas = db.query('select * deltas.deltas_del') idx in deltas: print type(idx['post']) prod = db.query('select * sources.product post = 310551835') add quotes value in right hand side of clause since you're filtering varchar. prod = db.query("select * sources.product post = '310551835'"

r - Turning for loop to apply -

i have tried understand how apply works having hard time understaning how use it. have df frame called sso9 172*92. 1:s or 0:s elements in it. col1 col2 col3 ... 1 0 1 0 1 1 0 0 1 . . i want take each permutation there when choosing 3 columns , take rowsum. meaning first first, second , third column , take row sum , save in new df, first secound , 4 , on. meaning reslut in 92 choose 3 = 125580 column. ds=data.frame(rowsums(sso9[,c(1,2,3)])) for(i in 1:90){ for(j in (i+1):91){ for(k in (j+1):92){ temp<-data.frame(rowsums(sso9[,c(i,j,k)])) colnames(temp)<-(paste(colnames(sso9[i]),colnames(sso9[c(j)]),paste(colnames(sso9[k]),sep=","))) ds=cbind(ds,temp) rm(temp) } } } ds$rowsums.sso9...c.1..2..3...<-null this code work kind of slow, try use apply insted of 3 loops, have no idea how make use of apply, when want permutations. can see create df ds taking rowsum of first 3 columns deleting dimentions righ...

matlab - Construct a 3D matrix with linear index -

i want construct 3d matrix of size = 80 * 80 * 2 based on set of data: 1 4532 1257.0 1 4556 1257.0 1 4622 257.0 1 4633 257.0 2 7723 31.0 2 8024 31.0 2 8099 31.0 2 9800 31.0 2 8524 34.0 2 8525 34.0 2 8700 734.0 2 8701 734.0 the first column denotes slice of matrix. the second column denotes linear index of matrix. the third column denotes values of elements. what i'm doing is: first obtain 2 80 * 80 2d matrices a , b , concatenate them using cat(3, a, b) : denote above data m . for = 1 : size(m,1) if (m(:,1)==1) [r c]=ind2sub(m(:,2)); = accumarray([r c], m(:,3)); elseif (m(:,1)==2) [r c]=ind2sub(m(:,2)); b = accumarray([r c], m(:,3)); end end cat(3, a, b) i curious if there solutions can build 80*80*2 matrix merely linear index (the second column of data) or other simpler solution works purpose...

database design - Deleting child objects in HasMany() NHibernate relationship -

i have product object references ordered list of specification objects. when product gets updated, associated list of specifications .clear()'d , rebuilt (not new'd.) the problem cascade.all() when product updated, creates 20 new specification rows in database, abandoning 20 old ones. cascase.alldeleteorphans() throws error: additional information: collection cascade="all-delete-orphan" no longer referenced owning entity instance: invax.core.models.product.specifications although want happen.. it's true, collection of specifications no longer referenced product -- delete these, right? well, have tried inverse() allow specification objects handle relationship didn't work either. here current mappings throw aforementioned error. product mapping: public class productmap : classmap<product> { public productmap () { id(x => x.id); map(x => x.catalogid).not.nullable(); map(x => x.name).not.nullable(); m...

responsive design - Text overlapping slide -unresponsive -

using wordpress responsive theme ,but 1 slide isnt responsive ,text overlapping slide.i tried code .wpi_slide_image { width: 100% max-width: 675px; not working my website slide on home page here screenshot of slide - http://postimg.org/image/p7oafp57d/ thank ! you have override following css .wpi_slide .wpi_slide_image { background-position:50% 50%; background-size:cover; height:100%; left:0; position:absolute; top:0; width:100%; } set width 49%!important; , height auto!important; remember put in !important after attributes. important - lol. also override .wpi_slide_607 .wpi_slide_image { -webkit-filter:blur(0px); background-image:url(cardmart.tk/wp-content/uploads/2015/07/…); left:0; opacity:1; top:0; } add in z-index:1!important; also in .wpi_slide_607 , 608 have set width 49% , height auto. last. step step.

javascript - In different browsers input time field shows in different formats -

i have created input time html element, line: <input type="time" id="starttime" value="@datetime.now.tostring("hh:mm")" /> i using c# razor syntax, not matter. i checked in both google chrome , mozilla firefox , in both time represented in 24 hour format. later, when shared code colleagues, in versions of chrome time represented in 12-hour format , pm. there way specify in html code time should represented in 1 way in browsers. there similar question here , asked 3 years ago , accepted answer starts with: this feature still in draft. each browser shows differently. so wondering if issue has been resolved in meantime. if not, suggestions of time components welcome. simplest way comes mind use separate select tags, prefer use single component wraps both hours , minutes. edit: realized problem local settings of machine browser runs on, , after changing settings on colleagues' laptops works fine. wondering if there...

python - Handling duplicates in SQLAlchemy -

i using sqlalchemy write data python database in sql. use code below write contents of 1 of tables sql, give me primary keys first table, table 1 , use when writing in data next table, table 2 foreign keys of table 2 mapped table 1 . however, writing function prevent duplicated data being written these tables if run script again. base.metadata.create_all(engine, checkfirst=true) session = sessionmaker(bind=engine) session = session(bind=engine, expire_on_commit=false) # writing data table 1 session.add_all([ table1(name = 'euro'), table1(name = 'fed'), table1(name = 'aus'), table1(name = 'boe'), table1(name = 'canada')]) session.flush() session.commit() session = session(bind=engine, expire_on_commit=false) #obtaining primary keys table 1 listofindices = [] row in session.query(table 1): listofindices.append(row.id) so, far code handling duplicates follows. however, not sure how obtain primary keys table 1 , @ same time prev...

xslt, javascript and unescaped html entities -

i have tiny little problem xslt, js , html entities, eg. within template: <script type="text/javascript"> <xsl:value-of select="/some/node"/> (var = 0; &lt; 5; i++) { // ^^^ js error } </script> <script type="text/javascript"> <xsl:value-of select="/some/node"/> (var = 0; < 5; i++) { // ^ xslt error } </script> <script type="text/javascript"> <xsl:value-of select="/some/node"/> // <![cdata[ (var = 0; < 5; i++) { // ^ becomes &lt; } // ]]> </script> <script type="text/javascript"> <xsl:value-of select="/some/node"/> (var = 0; <xsl:value-of disable-output-escaping="yes" select="string('&lt;')"/> 5; i++) { // works of course } </script> does have idea ...

windows 8 - Xampp Apache server not responding to request -

i have installed xampp server (xampp-win32-5.6.8-0-vc11-installer) on windows 8 64 bit os. have deployed helloworld application folder in htdocs directory , added virtual host in httpd-vhosts.conf file below <virtualhost localhost:80> documentroot c:/xampp/htdocs/ rewriteengine on proxyrequests off servername localhost <directory c:/xampp/htdocs/aasifeweb/app/> require granted allow </directory> <location /> proxypass http://localhost/aasifeweb/app/#/home proxypassreverse http://localhost/aasifeweb/app/#/home proxypassreversecookiepath / http://localhost/aasifeweb/app/#/home </location> </virtualhost> apache error log file [fri aug 07 19:23:26.149126 2015] [ssl:warn] [pid 2684:tid 448] ah01909: www.example.com:443:0 server certificate not include id matches server name [fri aug 07 19:23:26.200160 2015] [core:warn] [pid 2684:tid 448] ah00098: pid file c:/xampp/apache/logs/httpd.pid overwritten -- unclean shut...

python - How to find out programmatically if a domain name is registered or not -

i use pywhois determine if domain name registered or not. here source code. (all permutations a.net zzz.net ) #!/usr/bin/env python import whois #pip install python-whois import string import itertools def main(): characters = list(string.ascii_lowercase) ##domain names generator r in range(1, 4) : name in itertools.permutations(characters, r) : #from 'a.net' 'zzz.net' url = ''.join(name) + '.net' #check if domain name registered or not try : w = whois.whois(url) except (whois.parser.pywhoiserror): #not found print(url) #unregistered domain names? if __name__ == '__main__': main() i got following results: jv.net uli.net vno.net xni.net however, above domain names have been registered. not accurate. can explain it? there lot of errors: fgets: connection reset peer connect: no route host connect: network unreachable conn...

Use computed value in element using less.js -

have following bit of code: generate-margins(4); .generate-margins(@n, @i: 1) when (@i =< @n) { .marginleft@{i} { margin-left: (5px * @i); } .marginright(5*@{i}) { margin-right: (5px * @i); } .generate-margins(@n, (@i + 1)); } which gives me: .marginleft1 { margin-left: 5px; } .marginright(5*1) { margin-right: 5px; } .marginleft2 { margin-left: 10px; } .marginright(5*2) { margin-right: 10px; } .marginleft3 { margin-left: 15px; } .marginright(5*3) { margin-right: 15px; } .marginleft4 { margin-left: 20px; } .marginright(5*4) { margin-right: 20px; } what wanted was: .marginright5 {... } .marginright10 {... } ... how can use computed value in element name? tried using string functions no luck. appreciate help. did more testing , came this: .generate-margins(@n, @i: 1) when (@i =< @n) { @l : @i*5; .marginleft@{l} { margin-left: (5px * @i); } .marginright@{l} { margin-right: (5px * @i); } .generat...

gruntjs - how to call the reporter task in grunt -

this grunt file task, mochaprotractor: { options: { configfile: 'conf.js', port: 9999, singlerun: true, browsers: ['chrome'], loglevel: 'off' }, files: ['test/automative/*.js'], reporter:{ reporter:'html_table_reporter' , outputfile: 'report/report.html', timeout: 60000 } } not able generate report tests.

angularjs - RESOLVED: Angular IF ELSE show element -

i setting display type of dashboard , came across problem, how make if else in angular. is there better way this? <div ng-if="'config.dashboard.rows == 1'" layout="column" flex> <div ng-if="'config.dashboard.rows > 1'" layout="row" flex> resolved: <div ng-switch on="config.dashboard.rows" flex> <div ng-switch-when="1" layout="column" flex layout-wrap> <div ng-repeat="wdg in config.widgets" flex='100' ng-include="wdg.template"></div> </div> <div ng-switch-default layout="row" flex layout-wrap> <div ng-repeat="wdg in config.widgets" flex='50' ng-include="wdg.template"></div> </div> </div> you use ngswitch directive accomplish this.

Create Virtual Column in mysql -

i have mysql query this: $statement=$pdo->prepare("select id activity_id,type,status,description, (select sum(price*worked_hours) tbl_working_hours id_act = activity_id) total_hours tbl_activity"); there 2 tables: 1- tbl_activity 2- tbl_working_hours i trying create virtual column each row based on summary table. thanks you might want use subqueries select [...], (select count(*) mytable) count myothertable thats solution comming mind. problem way pretty costly when comes performance.

excel - Sort alphanumeric values -

Image
i need sort list of part numbers alphanumerically. excel not sort them correctly though when open auto filter drop down shows them in order need. they aren't uniform in length, contain letters, have leading zeros, maximum length of 15 characters. here list along correct sorting: part correct sort 00863 00863 1123 02257 02257 07706 6549 10338 6834 11212 07706 1123 8001 65412sscy 8001 6549 10338 6834 11212 8001 65412sscy 8001 en93 en93 scsm11be scsm11be hoping macro or method. if have values formatted text , not numbers custom number formats (for leading zeroes) need choose correct sort warning option.          if opt *sort numbers , numbers stored text separately, come teh correct (as per sample) sort order. note text default left-aligned in cell while numbers (regardless of number formatting) right-aligned default.

android - RealmList inside RealmObject not being populated from json -

so started playing around realm , been pretty self-explanatory simple use cases far i've found creating realm object realmlist inside json doesn't populate realm list. here's i've got: public class user extends realmobject{ @primarykey private int user_id; private realmlist<place> places; private string fname; private string lname; private string birth_date; public realmlist<place> getplaces(){ return this.places; } public void setplaces(realmlist<place>places) { this.places = places; } } public class place extends realmobject{ private string place_name; //several other types ints , strings getters , setters } both of these classes have appropriate getters , setters in actual code included sample of information , of important info shorten this. i using retrofit , of data coming in jsonelements. userservice.requestprofile(new callback<jsonelement>() { @o...

java - JSON response Issue for Jira Rest Client -

when use following method : public string getprojectlist() { projnames = new arraylist<>(); projnames.add("project1"); projnames.add("project2"); projnames.add("project3"); return new gson().tojson(projnames); in following code : $(document).ready(function() { $.getjson('dbdropdown', function(resp) { // on sucess var $select = $('#someselect'); $select.find('option').remove(); $select.prepend("<option value='select project'></option>").val(''); $.each(resp, function(key, value) { // iterate on json object. $('<option>').val(key).text(value).appendto($select); // create html <option> element, set value iterated key , text content iterated item , append <select>. }); }).fail(function() { // on failure alert("request failed....

How to modify XML tag in Java? -

i have xml file tag following : <sometag/> i want modify tag following : <sometag>somevalue</sometag> initially tried delete element , create new element, doesnt work. know there method rename tag, tried following code, dont know how add value (somevalue) renamed element(sometag). nodelist scpnodes=doc.getelementsbytagname("sometag"); (int = 0; < scpnodes.getlength(); i++) { element tobereplaced=(element) scpnodes.item(i); doc.renamenode(tobereplaced, tobereplaced.getnamespaceuri(),"sometag"); // how append value ? } you have call tobereplaced.settextcontext("somevalue"); and rid of doc.renamenode(tobereplaced, tobereplaced.getnamespaceuri(),"sometag");

php - XML to MySQL when xml file has multiple matching fields -

i've been doing work on xml mysql using load xml . have been successful itin past. difference latest effort have multiple occurrences of field-name in mysql. sample of below: <row> <pictures> <picture name="photo 1"> <filename>image1.jpg</filename> </picture> <picture name="photo 2"> <filename>image2.jpg</filename> </picture> <picture name="photo 4"> <filename>image3.jpg</filename> </picture> <picture name="photo 3"> <filename>image4.jpg</filename> </picture> <picture name="photo 7"> <filename>image5.jpg</filename> </picture> <picture name="photo 6"> <filename>image6.jpg</filename> </picture> <pictur...

CRM 2011 FetchXML returning invalid XML -

i trying retrieve account fetchxml returning invalid xml: function selectloadouttransactioncurrency(id) { debugger; var _oservice = new fetchutil(_sorgname, _sserverurl); var sfetch = "<fetch mapping='logical'>" + "<entity name='salesorder'>"+ "<attribute name='transactioncurrencyid' />" + "<filter type='and'>" + "<condition attribute = 'salesorderid' operator='eq' value='" + id + "'/>" + "</filter>" + "</entity>" + "</fetch>"; var fetchresult =_oservice.fetch(sfetch, null); return fetchresult.results[0].attributes["transactioncurrencyid"].guid; } function getsuppliers(){ debugger; _oservice = new fetchutil(_sorgname, _sserverurl); var sfetch = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'...

spark worker insufficient memory -

i have spark/cassandra setup using spark cassandra java connector query on table. far, have 1 spark master node (2 cores) , 1 worker node (4 cores). both of them have following spark-env.sh under conf/: #!/usr/bin/env bash export spark_local_ip=127.0.0.1 export spark_master_ip="192.168.4.134" export spark_worker_memory=1g export spark_executor_memory=2g here spark execution code: sparkconf conf = new sparkconf(); conf.setappname("testing"); conf.setmaster("spark://192.168.4.134:7077"); conf.set("spark.cassandra.connection.host", "192.168.4.129"); conf.set("spark.logconf", "true"); conf.set("spark.driver.maxresultsize", "50m"); conf.set("spark.executor.memory", "200m"); conf.set("spark.eventlog.enabled", "true"); conf.set("spark.eventlog.dir", "/tmp/"); conf.set("spark.executor.extracl...

android - Animating Toolbar with LayoutTransition -

what i'd achieve my app has toolbar contains 2 autocompletetextview . i'd show second 1 when user selected someting in first one, , hide again if first 1 cleared (i have 'x' in autocompletetextview clear it). i'd toolbar animate between 2 states, expanding , fading in second autocompletetextview when selected in first one, , fading out second autocompletetextview , collapsing toolbar when first 1 cleared. what tried, didn't work i tried using layouttransition , both in xml setting android:animatelayoutchanges true, , in code declaring layouttransition , setting linearlayout containing both autocompletetextview s. the first time tried way: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" style="@style/categorystyle.vertical" tools:context=".mainactivity"> <!-- toolbar --> <android.support.v...

mailchimp - Mandrill - Merge Vals Null Value -

i have merge vals working correctly in mandrill when dynamic text sent in. i trying if dynamic content null, don't show anything. *|if:buy!=null|* *|buy|* *|end:if|* when |buy| appears when buy null. is there anyway in mandrill conditional merge tags empty dynamic content? you should let mandrill evaluate variable: *|if:buy|* *|buy|* *|end:if|* this show variable's contents when it's not empty (so not null , not empty string). not match asked may intended do.

html - Block that stay in line no matter the size of the screen -

Image
i have row not stay in line when window narrow. green block goes under other block, normal behavior? i mean though because in "row" class , because use xs column add 12 should stay in line whatever size of screen. here code (or can go bootply ) <div class="row" style="height:150px"> <div class="col-xs-1 bggrey" style="height:100%"></div> <div class="col-xs-6 bgblue" style="height:100%"></div> <div class="col-xs-2 bgred" style="height:100%"></div> <div class="col-xs-3 bggreen" style="height:100%"></div> </div> what expect code (working fine if window not narrow) what if window narrowed i think problem of default paddings in divs. when resolution smallest sum of paddings broken. in code there 4 divs, 30 pixels of padding, , when fit, broken. put paddings 0 value...

How can I hide my specific Java source code (a single class) by making it non-readable? -

how can hide specific java source code (a single class out of several classes) of software application. mean, there way make class can not viewable or accessible others? can create class library or reference file? , can't viewed hackers? there way partially want. you can use proguard obfuscate it. as hiding class not know way that.

Excel VBA to copy -

my task create searchable database within excel entry form. need macro take data entry form move database sheet offset active cell down 1 row , copy values only(not formatting) every time try run macro run-time error in code. have no experience vb or vba; please tell me wrong this. sheets("database").select 'navigates database worksheet if activesheet.filtermode activesheet.showalldata end if 'clears filters sheets("entry form").select 'navigates entry form worksheet range("e10:l10").select ' select date, period, , data selection.copy sheets("datatable").select ' navigate datatable tab range("a1").select selection.end(xldown).select ' ctrl-down last occupied row, activecell.offset(1, 0).select ' 1 more first blank row selection.pastespecial paste:=xlpastevalues 'pastes data values database worksheet sheets("entry form").select ...

sql delete - How to remove duplicate rows from a mysql table -

i have table large number of columns. say, table has 1000 columns 'col1' 'col1000'. for duplicate criteria don't want use 'col1' , 'col1000'. so, if in row values 'col2' 'col999' have occurred, duplicates. i tried solution given here http://www.besttechtools.com/articles/article/sql-query-to-delete-duplicate-rows requires me explicitly write columns considering duplicates. can't write 998 columns. can please me query in deleting such duplicates? i want delete such duplicates in multiple tables. one thing sure - have name columns query. 1 simple approach use excel task easily. 1) describe table, column names. 2) put column names excel , cleanup data (using text-to-column feature along find/replace). 3) once have columns, build query. can use excel sort of specific manipulation around column in one-go (using select-drag). 4) once queries ready, dump text file select excel data (of cells). 5) make sure r...

fft - Octave (Matlab): Spectrum calculation -

another question spectrum calculation in octave using fft: with audacity created .wav file containing white noise, filtered lowpass fcut = 1khz, -20db/decade. spectrum analysed audacity looks expected (unfortunately can't post image since don't have enough reputation) then analysed spectrum octave using following code: pkg load signal %load signal package graphics_toolkit ("gnuplot") % use gnuplots close clear [stereosig, fs,bit] =wavread('noise_stereo.wav'); % load wav ch1 = stereosig(:,1); % left ch2 = stereosig(:,2); % right nfft = 1024; nfft_half = nfft/2; x = fft(ch1, nfft); freqvect = (1:nfft_half+1)./nfft*fs; figure(1) x_mag_scaled = abs(x(1:nfft_half+1)./nfft_half); semilogx(freqvect, 20*log10(x_mag_scaled)); grid on xlabel('frequency (hz)') ylabel('mag [db]') the plot produced octave extremly "unsmooth", -20db/decade can not recognised since difference between 2 adjacent po...

Replacing a javascript function inside an object using GreaseMonkey -

i having troubles finding way replace javascript function defined property of object. had googled 2 days , looked @ questions in stack overflow related overriding function javascript, none of solution worked. have webpage ( http://gefs-online.com if helps), , there object called "multiplayer" declared somewhere that: var multiplayer = window.multiplayer || {}; after that, there properties under multiplayer declared that: multiplayer.nbusers = 0; multiplayer.users = {}; multiplayer.visibleusers = {}; multiplayer.minupdatedelay = 500; multiplayer.updatetimeout = null ; multiplayer.hearbeattimeout; multiplayer.hearbeatlife = 9000; multiplayer.userlife = 10000; multiplayer.userhalflife = 4000; multiplayer.mapupdateperiod = 10000; multiplayer.myid = ''; multiplayer.lastrequest = null ; multiplayer.lastrequesttime = 0; multiplayer.localtime = new date().gettime(); multiplayer.farvisibilityrange = 10000; multiplayer.lowvisibilityrange = 1000; multiplayer.nearvisib...

python - Why doesn't my array space correctly when I use np.savetxt -

why doesn't text file space output correctly? import numpy np my_list =['str1', 'str2', 'str3'] my_list2=[1,2,3] print(my_list) ['str1', 'str2', 'str3'] printed. my_array=np.array(my_list) my_array2=np.array(my_list2) combined=np.column_stack([my_array,my_array2]) np.savetxt('test_file_name.txt', combined, fmt="%s") print(combined) the print gives: [['str1' '1'] ['str2' '2'] ['str3' '3']] the file says str1 1str2 2str3 3 . want say: str1 1 str2 2 str3 3 running windows 8.1, using notepad view file. short answer: notepad worst. use notepad++. appending question: there way have columns line nicer? of data has few characters, while others have fifteen or so. if print array not see commas normal behaviour numpy, if use repr when printing i.e print repr(np.array([1, 2, 3])) or run python shell or ipython without printing show repr see...

css - Border-radius on mapbox in safari -

i using angular directive mapbox ( http://tombatossals.github.io/angular-leaflet-directive/#!/examples/simple-map ) , trying border-radius 10px works in chrome , firefox on safari isn't working. this css using (for reason works opacity: .99 on chrome/firefox) .angular-mapbox-map{ opacity: .99; border-radius: 10px; } does know going on or how resolve this. can play mapbox element in link above using chrome dev tools or equivalent. i found solution here how make css3 rounded corners hide overflow in chrome/opera using: -webkit-mask-image: url(data:image/png;base64,ivborw0kggoaaaansuheugaaaaeaaaabcaiaaacqd1peaaaagxrfwhrtb2z0d2fyzqbbzg9izsbjbwfnzvjlywr5ccllpaaaaa5jrefuenpiygbgaagwaaaeaagba+ojaaaaaelftksuqmcc);

ios - How to achieve pushViewController animation when using presentViewController -

i need use presentviewcontroller in app - [self presentviewcontroller:thingcontainer animated:yes completion:nil]; but need animation similar of pushviewcontroller navigation controller. idea how achieve that?

javascript - Change value of same field on multiple objects - JS -

i have object on scope, the_data , has multiple objects inside it. one object, important_entries has list of objects inside it. the objects inside important_entries have specific field want change - field_i_want_to_change . name of each of these objects it's id. what want iterate on important_entries object , each object in it, change value of each field_i_want_to_change field. could possibly give me pointers how best accomplish this? have access underscore library, if can of use. here rough blueprint of the_data object, apologise syntax errors. the_data : { some_data : {}, some_data : {}, important_entries: { xxxccc : { field_i_want_to_change: 'some data' }, cccfff : { field_i_want_to_change: 'some data' }, tttyyy : { field_i_want_to_change: 'some data' }, }, some_data : {}, some_data : {} } why don't loop through ja...

python - Multiindex assigning while avoiding SettingWithCopyWarning -

this code works, generates settingwithcopywarning. since warning can useful, i'd rather not turn off globally. in other cases i've found ways achieve same result, without triggering warning, can't think of alternative here: # df not yet have colz # df indexed date , name (which not use here) df["colz"] = 0.0 z = df.xs(mydate, level="date", drop_level=false)["colz"] z[:36] = 99.0 df.loc[(mydate,), ("colz",)] = z i can't take cross section ( xs ) , assign new column, because cross section give me copy. , can't take cross section cells want set 99, because need slice index , row, need blend of iloc , loc. 1 possibility reset index drop name level , put again afterward, seems yucky. any suggestions, or live warning? you can disable warning following code: with pd.option_context('mode.chained_assignment',none): code here

java - PhantomJS - Element is not currently interactable -

i'm using phantomjs + selenium populate form fields having weird results. 50% of time, test runs fine. other 50% errors out , gives me following {"errormessage":"element not interactable , may not manipulated" i'm doing following make sure page loaded. private static boolean waitforjqueryprocessing(webdriver driver, int timeoutinseconds) { boolean jqcondition = false; try { new webdriverwait(driver, timeoutinseconds) { }.until(new expectedcondition<boolean>() { @override public boolean apply(webdriver driverobject) { return (boolean) ((javascriptexecutor) driverobject) .executescript("return jquery.active == 0"); } }); jqcondition = (boolean) ((javascriptexecutor) driver) .executescript("return window.jquery != undefined && jquery.active === 0"); return jqcond...

reference - Web2py: Incorrect row when representing a referenced field -

it's rare find issue hasn't answered i've been searching 3 days , haven't found yet. i'm aiming create page inputing records in 'spreadsheet' format. i've used inline editing in sqlform.grid this slice . the problem i'm having when 1 of fields reference table, row being use in lambda function taking row of reference table rather row in grid. here example: model db.define_table('people', field('name', 'string'), format = '%(name)s', ) db.define_table('animals', field('name', 'string'), field('pet_owner', 'reference people'), format = '%(name)s', ) controller def index(): #process submitted form if len(request.post_vars) > 0: print request.post_vars key, value in request.post_vars.iteritems(): (field_name,sep,row_id) = key.partition(...

array values to nested array with PHP -

i'm trying figure out how can use values indexed array path array. i'm exploding string array, , based on values in array i'm looking value in array. example: $haystack['my']['string']['is']['nested'] = 'hello'; $var = 'my@string@is@nested'; $items = explode('@', $var); // .. echo $haystack[... items..?] the number of values may differ, it's not option $haystack[$items[0][$items[1][$items[2][$items[3]] . any suggestions? you can use loop - $haystack['my']['string']['is']['nested'] = 'hello'; $var = 'my@string@is@nested'; $items = explode('@', $var); $temp = $haystack; foreach($items $v) { $temp = $temp[$v]; // store current array value } echo $temp; demo

AMD OpenCL driver: 1) detects Intel CPU 2) lists same type of GPU with different OpenCL version -

my workstation configuration: intel(r) xeon(r) cpu e5-2609 v2 @ 2.50ghz (x2) amd firepro w9100 (x2) operating system: windows server 2012 r2 standard i use lwjgl's opencl demo ( link ) list platforms , devices. problem 1) after installing amd drivers on workstation amd accelerated parallel processing platform list intel(r) xeon(r) cpu e5-2609 v2 @ 2.50ghz device. (3rd device listed amd platform) i tested same code both amd , intel opencl driver , intel's own implementation faster it's own hardware. ( no surprise there ) anyway don't want intel device listen under amd platform. problem 2) my 2 identical amd firepro w9100 (device 1 , 2 under amd platform) listed different level of opencl support . what cause problem, , more importantly how can make 2nd card use 2.0 opencl driver? opencl demo results: new platform: [0x7ffe51b57b60] cl_platform_profile = full_profile cl_platform_version = opencl 2.0 amd-app (1642.5) cl_platf...

xcode - Reading NSUserDefault key data into UITableView -

how can read/load data key uitableview? when run println(keydata1) output [data1, data2, data3] . how can add data uitableview? uiviewtable read data " var minespillere ". this how read data: if let testarray : anyobject? = nsuserdefaults.standarduserdefaults().objectforkey("yourkey") { var readarray : [nsstring] = testarray! as! [nsstring] println(readarray) // here want add "readarray" uitableview. } maybe this: var minespillere = readarray // make minespiller same readarray? in table view's data source (which uitableviewcontroller contains table, can class implements uitableviewdatasource ), override numberofsectionsintableview() (in case, should return 1 ); tableview(_, numberofrowsinsection:) return size of nsuserdefaults array; , tableview(_, cellforrowatindexpath:) return uitableviewcell you've configured display user defaults value.

Lightbox2 does not work -

i running lightbox v2.03.3 in standard html document. actually, file has .php extension, because using php includes. anyway, of images on page setup use lightbox display them. i verified lightbox files uploaded, called correct folder, , working. every image being called there. i have following code in head section of web page. <link rel="stylesheet" href="/scripts/lightbox/css/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="/scripts/lightbox/js/prototype.js"></script> <script type="text/javascript" src="/scripts/lightbox/js/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="/scripts/lightbox/js/lightbox.js"></script> <script> lightbox.option({ 'resizeduration': 200, 'wraparound': true }) </script> and code attached each of im...

android - How to show my Spinner to right of Toolbar -

Image
my layout looks below you can see spinner added toolbar, want make right align, show right of toolbar. below xml code used <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical" > <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" android:elevation="4dp" android:gravity="right" //gravity set right android:background = "@color/color_toolbar" > <spinner android:id="@+id/spinner_category" android:layout_width="wrap_content" android:layout_heigh...

asp.net mvc - MVC calling external API in View and adding authentication header -

i developing mvc application hosted on web role in azure cloud service. trying send api post request after user push button. have multipart form in view and, instead of calling controller, want post data external api specific in action attribute. code shown below. @using (html.beginform(null, null, formmethod.post, new { enctype = "multipart/form-data", @action = "http://localhost:55637/api/dataingestion/upload" })) { <div> <input type="file" name="fileupload" /> <input type="text" name="filepath" /> </div> <div> <button>upload</button> </div> } and external api because api protected azure active directory, need put authentication token in header of request. token acquired in 1 controller method , stored in tempdata dictionary shown below. my question how can pass token view , when view try post multipart form data, how can add...