Posts

Showing posts from May, 2015

Current ruby and rails resources (2010) -

Current ruby and rails resources (2010) - can great , knowledgable programmers please point me current , updated ruby/rails blogs/sites? looking active forum lively discussions on ruby/rails. i tried google them already mentioned on so, many of links on google seem to sites no longer updated. new website started rails developers: http://railsdeveloper.com/ great blogs are: http://railstips.org/, http://railstutorial.org/ mislav created cool tool @ gogaruco called explain ruby: http://explainruby.net/ screencasts: http://teachmetocode.com/screencasts/ ruby-on-rails ruby ruby-on-rails-3

Problem with IE in a menu with CSS -

Problem with IE in a menu with CSS - i have unusual problem ie in css menu. have <li> text , <ul> (with position absolute) , <li> inside. in mozilla firefox sub <ul> assumes desired position (see image below). in ie text forces sub <ul> go forward. ideas? thanks in advance! li { float:left; width:auto; } li ul { left:-999em; margin-left:0; margin-top:5px; padding:0; position:absolute; width:150px; } li:hover { left:auto } there 3 suggestions coming in mind. 1 - can utilize eric meyer's reset css. 2 - may go ie7.js , create ie behave standard compliant browser. 3 - unrecommended way utilize ie6 hack this: * html ul li{ /* styles */ } css

javascript events - jQuery click action does not trigger onclick attribute -

javascript events - jQuery click action does not trigger onclick attribute - i having problems getting function clicks search matched checkboxes. click event seems fire, no checkbox gets checked nor myfunc() called. it works when clicking each checkbox manually, wants 40+ checkboxes - not users. may wonder why utilize div-onclick instead of straight on input checkbox. because want give users larger area click on little checkbox. i want provide users single hyperlink select multiple checkboxes match attribute value(s). i need fast solution out of time. html <div id="container"> <a href="#" onclick="clickandcheckallmatch('search text');return false;">some text</a> <div id="*actual_id*" onclick="myfunc(a, b, c, d);"> <input type="checkbox" id="book-*actual_id*" onclick="this.parentnode.click;return false;"> </div> </div> js function m...

shell - Bash print informations on the same point -

shell - Bash print informations on the same point - in bash how can print informations on same point ??? for illustration how can if want loop on files in subdirectories of hypothetical root , want print on terminal informations on same location without printing new lines ?? dir example --> root --> dir 1 --> file 1 --> file 2 --> dir 2 --> file 3 --> file 4 the shell output must thing : infos before don't want clear ------------------------------- directory : dirname file count : x file : filename ------------------------------- "count" remain same in accord current dir other informations must changed in accord current subdir (element) of loop thanks in advance consider next example: for file in * printf "\r%${columns}s\r%s" "" "$file" sleep 1 done echo this prints files in current directory on same line, sleeping 1 sec after each filename...

php - Create directory and upload image in Laravel 5 -

php - Create directory and upload image in Laravel 5 - $extension = $file->getclientoriginalextension(); $directory = storage::makedirectory($this->objproperty->id); //create directory using property id. storage::disk('local')->put($file->getfilename().'.'.$extension, file::get($file)); currently code upload image storage/upload/ directory want upload image newly created directory( $directory ). example: storage/upload/1/test.jpg specify folder in put() method: class="lang-php prettyprint-override"> storage::disk('local')->put( $this->objproperty->id.'/'.$file->getfilename().'.'.$extension, file::get($file) ); php laravel laravel-5

javascript - Padding-right has no effect, help please? -

javascript - Padding-right has no effect, help please? - here html , js. have tried putting padding on both bottomwrapper , toplist , reason neither seems work padding-right . other styles seem fine. nil floated or know of. ideas? webview android, shouldn't matter in case same behavior when render code in browser. <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawvisualization); function drawvisualization() { // raw info (not accurate) var info = google.visualization.arraytodatatable([ ['month', 'bolivia', 'ecuador', 'madagascar', 'papua new guinea', 'rwanda', 'average'], ['2004/05', 165, 938, 522, 998, ...

grails - Joda timeField taglib formatting -

grails - Joda timeField taglib formatting - using: joda-time grails plugin. using: datetime in domain object. how time component without milliseconds in gsp input field? using this: <joda:timefield type="date" name="time" value="${mydate}" /> i example: 17:00:00.000 where have: 17:00 <joda:time value="${mydate}"> <joda:format value="${it}" pattern="hh:mm"/> </joda:time> <joda:time> , <joda:format> can used above. grails jodatime

floating point - How do I math on floats? -

floating point - How do I math on floats? - this question has reply here: is floating point math broken? 26 answers i need alternative simple math. float freqa = 28.333334; freqa = freqa+0.000001; println(freqa); however results in 28.333336. how perform math right reply of 28.333335? i have tried converting float integer performing math, converting float, same mathematical errors. chances high programming environment has double datatype. type uses more memory float , offers higher precision. https://en.wikipedia.org/wiki/double-precision_floating-point_format floating-point

hadoop - FIles comparing field by field in PIG -

hadoop - FIles comparing field by field in PIG - i have 2 files like file 1 id,sal,location,code 1000,1000,jupiter,f 1001,2000,jupiter,f 1002,3000,jupiter,f 1003,4000,jupiter,f 1004,5000,jupiter,f file 2 id,sal,location,code 1000,2000,jupiter,f 1001,2000,jupiter,z 1002,3000,jupiter,f 1003,4000,jupiter,f 1004,5000,jupiter,f when compare file1 file 2, need output like 1000, sal 1001,code basically, should tell me field changed previous file along id. can done in pig. you can solve problem challenging part output format mentioned. requires little bit complex logic output format. i have fixed of border cases can check input create sure works combinations. file1: 1000,1000,jupiter,f 1001,2000,jupiter,f 1002,3000,jupiter,f 1003,4000,jupiter,f 1004,5000,jupiter,f file2: 1000,2000,jupiter,f 1001,2000,jupiter,z 1002,3000,jupiter,f 1003,4000,jupiter,f 1004,5000,jupiter,f pigscript: = load 'file1' using pigstorage(',') (id,s...

c - Why the following code prints 1 as output? -

c - Why the following code prints 1 as output? - difference of pointer gives 1 output.. #include<string.h> #include<stdio.h> int main() { int a=5,b=10; int *p=&a,*q=&b; int c=p-q; printf("%d",c); homecoming 0; } subtracting 2 pointers not pointing same array create no sense. c11: 6.5.6 additive operators (p8) [...] if both pointer operand , result point elements of same array object, or 1 past lastly element of array object, evaluation shall not produce overflow; otherwise, behavior undefined. c pointers

java - How to execute else if(xpathcondition) , If first xpathcondition fails? -

java - How to execute else if(xpathcondition) , If first xpathcondition fails? - if(driver.findelement(by.xpath("//div/h3[contains(text(),'movenpick hotel deira')]")).isdisplayed()) { } else if(driver.findelement(by.xpath("//div/h3[contains(text(),'hotel inn')]")).isdisplayed()) { } in above code, if status fails means how execute else if(xpathcondition), failed status showing exception "element not found". if handled exception, how execute else if?? advance help !! ideally isdisplayed() should homecoming false instead of throwing exception. you can go saifur answer. approach (as per this) try { if(driver.findelement(by.xpath("//div/h3[contains(text(),'movenpick hotel deira')]")).isdisplayed()) { } }catch(){ //catch executes else part when exception thrown. if(driver.findelement(by.xpath("//div/h3[contains(text(),'hotel inn')]")).isdisplayed()) { } } c...

c# - Azure Document DB UpdateDoc -

c# - Azure Document DB UpdateDoc - i starting off azure document db. trying update existing document. when utilize next query works: dynamic team2doc = client.createdocumentquery<document>(documentcollection.documentslink).where(d => d.id == "t002").asenumerable().firstordefault(); team2doc.teamname = "updated_team_2"; await client.replacedocumentasync(team2doc); but if utilize below code: dynamic team2doc = client.createdocumentquery<document>(documentcollection.documentslink).where(d => d.teamname== "team1").asenumerable().firstordefault(); team2doc.teamname = "updated_team_2"; await client.replacedocumentasync(team2doc); i error: "the best overloaded method match 'microsoft.azure.documents.client.documentclient.replacedocumentasync(microsoft.azure.documents.document, microsoft.azure.documents.client.requestoptions)' has invalid arguments" is there anyway retrieve document 1...

iOS 8.3 - UITableView cell not aligned, indentation to the left -

iOS 8.3 - UITableView cell not aligned, indentation to the left - i've stumbled upon unusual behaviour, cells added uitableview indented left. happens on ios 8.3, , can't find clear pattern when happens. anyone experiencing same thing? my tableviewcells seeing increased left , right margins when run on ios 8.3 did not see on previous versions. setting: self.contentview.preservessuperviewlayoutmargins = no; fixed problem , kept margins consistent on versions aware in available on ios 8+. so here, example, might this: - (void)awakefromnib { if ([self.contentview respondstoselector:@selector(setpreservessuperviewlayoutmargins:)]) { self.contentview.preservessuperviewlayoutmargins = no; } } ios uitableview uiview ios8.3

java - Android: Difference between ft.remove() and popBackStack() -

java - Android: Difference between ft.remove() and popBackStack() - this question has reply here: how popbackstack() , replace() operations differ? 2 answers i trying remove fragment stack. using code: fragmentmanager fm = getsupportfragmentmanager(); if (fm != null) { fragmenttransaction ft = fm.begintransaction(); fragment currentfragment = fm.findfragmentbyid(r.id.my_id); if (currentfragment != null) { ft.remove(currentfragment); ft.commit(); } } do need phone call popbackstack() above code? fm.popbackstack(); remove() remove fragment. popbackstack() remove current fragment , replace lastly 1 stack. work need addtobackstack() on lastly fragment transaction. not want don't it. java android android-fragments fragmentmanager

html - PHP SQL : How to allow access to my website page for only a certain time in a day? -

html - PHP SQL : How to allow access to my website page for only a certain time in a day? - i have html/php page, illustration mypage.php illustration contains <?php echo "hello everyone"; echo "please fill below form"; ?> <form action="form.php" method="post"> first name:<br> <input type="text" id="fname" name="fname"> <br> lastly name:<br> <input type="text" id="lname" name="lname"> <br><br> <input type="submit" value="submit"> </form> <?php echo "sorry it's time on today. time is" . date("h:i:sa"). echo "please come 1 time again tomorrow @ 11:00 am"; ?> what should code within php page, can accessible 11:00 2:00 pm ist. if time between 11am 2pm should show html form, if time has passed should print sec message, sorry it's time on tod...

php - Replacing special characters from URL with iconv doesn't work -

php - Replacing special characters from URL with iconv doesn't work - i have little problem of urls. let's that $result['title'] = citroën in url, want word become "citroen". next function right, except removes "ë", url becomes "citron". <?php echo strtolower(preg_replace('/[^a-za-z0-9\-]/', '', str_replace(' ', '-', $result['title'])));?> i thought solve using iconv ... doesn't work. "citroën" still replaced "citron". <?php echo strtolower(preg_replace('/[^a-za-z0-9\-]/', '', str_replace(' ', '-', iconv('utf-8', 'ascii//translit', $result['title']))));?> so, missing here? okay, figured out. need set target locale. next code works (so "citroën" becomes "citroen"): <?php setlocale(lc_all, 'en_gb.utf8'); echo strtolower(preg_replace('/[^a-za-z0-9...

Why is my Polygon on Google Maps Android API not Appearing? -

Why is my Polygon on Google Maps Android API not Appearing? - i in java class: //this in on create gamemapfragment map = new gamemapfragment(); onmapready(map.googlemap); ... public void onmapready(googlemap map) { map.movecamera(cameraupdatefactory.newlatlngzoom( new latlng(-18.142, 178.431), 2)); // polylines useful marking paths , routes on map. map.addpolyline(new polylineoptions().geodesic(true) .add(new latlng(-33.866, 151.195)) // sydney .add(new latlng(-18.142, 178.431)) // republic of the fiji islands .add(new latlng(21.291, -157.821)) // hawaii .add(new latlng(37.423, -122.091)) // mount view ); } yet shows map without points - not polyline. how create polygon visible? it looks should calling map.getmapasync(this); instead of onmapready(map.googlemap); in oncreate (assuming activity implements onmapreadycallback ). ...

unix - Is it possible to set MySQL session variables using mysqlimport? -

unix - Is it possible to set MySQL session variables using mysqlimport? - i have import job uses unix's mysqlimport, , source info undependable, need set sql_mode="no_engine_substitution" job doesn't fail if there error. i'd prefer individual job, don't know if it's possible. know? current command: mysqlimport --compress --fields-terminated-by="," --fields-optionally-enclosed-by='"' --lines-terminated-by="\n" --replace --local --user=username --password=password -h localhost dbname company_data.txt i'm not familiar mysqlimport, manual doesn't list alternative that. since mysqlimport command-line interface load info infile sql statement, workaround this: mysql -uuser -ppassword dbname -e "set session sql_mode='no_engine_substitution'; load info infile 'company_data.txt' ..." /*you can figure out rest*/ here's manual entry load info infile . mysql un...

java - Offsets for per vertex data interleaved in OpenGL ES on Android -

java - Offsets for per vertex data interleaved in OpenGL ES on Android - is possible utilize per vertex info interleaved in opengl es on android? i'm unable right offset pointers normal , color members. in c++ this: struct coloredvertexdata3d{ vertex3d vertex; vector3d normal; colorrgba color; }; const coloredvertexdata3d vertexdata[] = { { {0.0f, 0.5f, 0.8f}, // vertex | {0.0f, 0.4f, 0.6f}, // normal | vertex 0 {1.0f, 0.0f, 0.0f, 1.0f} // color | }, { {0.8f, 0.0f, 0.5f}, // vertex | {0.6f, 0.0f, 0.4f}, // normal | vertex 1 {1.0f, 0.5f, 0.0f, 1.0f} // color | }, // ... more vertexes. }; const int stride = sizeof(coloredvertexdata3d); glvertexpointer(3, gl_float, stride, &vertexdata[0].vertex); glcolorpointer(4, gl_float, stride, &vertexdata[0].color); glnormalpointer(gl_float, stride, &vertexdata[0].normal); is same thing possible on...

php - Can a enum value in phpmyadmin be like this? 'Readme'=>1 -

php - Can a enum value in phpmyadmin be like this? 'Readme'=>1 - in this, see readme, value set 1 is possible? edit; sorry. have site. it's navigation in database. need display nav items depening on users state, like, logged in , admin, blogger, not loggin, , indepenant. these work, move numerical values human readable. maintain script same. so, basicly, can create enum test equal 1, php array? the interface you're using has no way of assigning symbolic names values describe. however, can utilize lookup table can associate string name each numeric value. is, can go on store values -1, 0, 1, 2, 3 in database table, create another table map values strings. when want show human-readable names, bring together lookup table. php mysql enums phpmyadmin

How to access AJAX hash values in ASP.NET MVC? -

How to access AJAX hash values in ASP.NET MVC? - i'm considering using hash method create static urls content managed ajax calls in asp.net mvc. proof of concept i'm working on profile page /user/profile 1 can browse , edit different sections. inquire next url /user/profile#password access straight profile page, in alter password section however, i'm wondering if i'm not starting bad way, since apparently can't access part after hash in way, except declaring route value hash in global.asax . i'm wondering if right way access part of url? am supposed declare route value, or there way work hash values (a framework, javascript or mvc)? edited add: in pure javascript, have no problem using window.location.hash property, i'm not sure though how standard in today's browsers, hence question javascript framework/plugin utilize it. the thing part follows hash (#) never sent server http request server has absolutely no way of reading it....

eclipse - How to insert a date in a Date Type Column in HSQLDB Table using Hibernate? -

eclipse - How to insert a date in a Date Type Column in HSQLDB Table using Hibernate? - i'm trying insert date type entry in column of table in hsqldb. issue i'm using hibernate so, can please help me how that? the table follows: create table test( workingdate date not null ) the bean file follows: import java.util.date; public class test { private date workingdate; public date getworkingdate() { homecoming workingdate; } public void setworkingdate(date workingdate) { this.workingdate = workingdate; } @override public string tostring() { homecoming "test [workingdate=" + workingdate + "]"; } } the xml mapping follows: <?xml version="1.0"?> <!doctype hibernate-mapping public "-//hibernate/hibernate mapping dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <cla...

Is it possible to send to Event Hub from Windows Phone 8.1 directly? -

Is it possible to send to Event Hub from Windows Phone 8.1 directly? - i'm trying send strings service bus event hub can't see related event hubs in microsoft.windowsazure.messaging reference. tried utilize windows phone 8 project , 8.1 silverlight project service bus nuget packet failed install due configurationmanager dependency error. basically want able send thousands of request service bus , save them sql or documentdb. is there other way or workaround accomplish this? windows events azure service azureservicebus

javascript - Want to use datepicker to be able to calculate weekdays and subtract weekends -

javascript - Want to use datepicker to be able to calculate weekdays and subtract weekends - i have simple holiday time app building in rails. have javascript calculates business days , subtracts weekends datepicker. seems it's not working subtract days , input amount in range_days text box. help appreciated! this app.js function calcbusinessdays(ddate1, ddate2) { // input given date objects var iweeks, idatediff, iadjust = 0; if (ddate2 < ddate1) homecoming -1; // error code if dates transposed var iweekday1 = ddate1.getday(); // day of week var iweekday2 = ddate2.getday(); iweekday1 = (iweekday1 == 0) ? 7 : iweekday1; // alter sunday 0 7 iweekday2 = (iweekday2 == 0) ? 7 : iweekday2; if ((iweekday1 > 5) && (iweekday2 > 5)) iadjust = 1; // adjustment if both days on weekend iweekday1 = (iweekday1 > 5) ? 5 : iweekday1; // count weekdays iweekday2 = (iweekday2 > 5) ? 5 : iweekday2; // calculate differ...

ruby - two-way search with Hashes? -

ruby - two-way search with Hashes? - i'm trying create database search programme using hash db storage. i can search list using fellow member numbers how search using fragments of numbers (so entering 1 give 001 , 010 , 011 , 021 , etc...) or fragmented/full usernames (entering ni give nightc||ed , oni ) my current code follows: #rdb nightc||ed, ©2015 db = hash.new() db["001"] = "oni" db["002"] = "eclipse" db["003"] = "saikou" db["004"] = "nightc||ed" db["005"] = "anime" db["006"] = "master" x = 0 num = db.count puts "in: member:" num.times |pair| puts "#{db.keys[x]} | #{db.values[x]}" x += 1 end puts "------------------- come in index number:" = gets.to_i -= 1 scheme "cls" puts "in: member: #{db.keys[i]} | #{db.values[i]}" sleep first, iterate on hash. within each itera...

sql - How to insert multiple JSON files into postgresql table at a time? -

sql - How to insert multiple JSON files into postgresql table at a time? - i have multiple json files, have same format values different based on each transaction. want migrate info postgresql table. best way proceed this? right now, using next query: create table test (multiprocess varchar(20), http_referer varchar(50)); insert test select multiprocess, http_referer json_populate_record(null::test, '{"multiprocess": true,"http_referer": "http://localhost:9000/"}'); but, 1 time number of files become large, becomes hard utilize technique. there other way effectively? you utilize lateral join insert more 1 row @ time: json as( values('{"multiprocess": true,"http_referer":"http://localhost:9000"}') ,('{"multiprocess": false,"http_referer": "http://localhost:9001/"}') ,('{"multiprocess": true,"http_referer"...

Create JSON in swift -

Create JSON in swift - i need create json this: order = { type_id:'1',model_id:'1', transfer:{ startdate:'10/04/2015 12:45', enddate:'10/04/2015 16:00', startpoint:'Ул. Момышулы, 45', endpoint:'Аэропорт Астаны' }, hourly:{ startdate:'10/04/2015', enddate:'11/04/2015', startpoint:'ЖД Вокзал', endpoint:'', undefined_time:'1' }, custom:{ startdate:'12/04/2015', enddate:'12/04/2015', startpoint:'Астана', endpoint:'Павлодар', customprice:'50 000' }, commenttext:'', device_type:'ios' }; the problem can not create valid json. here how create object: let jsonobject: [anyobject] = [ ["type_id": singlestructdataofcar.typeid, "model_id": singlestructdataofcar.modelid, "transfer": saveddatatransfer, "...

How Stack exchange OAuth work for android app? -

How Stack exchange OAuth work for android app? - i trying understand how stackexchange's oauth work posting question using android app.but couldn't find illustration understand process. although https://api.stackexchange.com/docs/authentication on link mentioned send user https://stackexchange.com/oauth, these query string parameters client_id scope (details) redirect_uri - must under apps registered domain state - optional i don't understand how utilize information. android oauth-2.0 stackexchange-api

android - DataChannnel - can't send a message, send always returns false -

android - DataChannnel - can't send a message, send always returns false - i followed advice http://stackoverflow.com/a/29466254/2813589 add together back upwards of datachannels in android apprtc applcation. here's part of code bit changed: public class peerconnectionclient { //...... public void senddata(string sendstring) { bytebuffer sendbuffer=bytebuffer.wrap(sendstring.getbytes()); datachannel.buffer buf = new datachannel.buffer(sendbuffer, false); boolean res = dc.send(buf); // res false log.d(tag, "onsenddatachannelmessage(), sent: " + sendstring); log.d(tag, "onsenddatachannelmessage(), result: " + res); } //... } public class callactivity extends activity implements apprtcclient.signalingevents, peerconnectionclient.peerconnectionevents, callfragment.oncallevents { // never never executed @override public void ondatachannelmessage(string msg) { toast....

Jquery not showing up -

Jquery not showing up - class="snippet-code-html lang-html prettyprint-override"> <body> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="http://dl.dropbox.com/u/40036711/scripts/ddslick.js"></script> <script type="text/javascript"> & (document).ready(function() { $('#mydropdown').ddslick({ onselected: function(selecteddata) }); </script> <select id="mydropdown"> <option value=""></option> <option>american black bear</option> <option>asiatic black bear</option> <option>brown bear</option> <option>giant panda</option> <option>sloth bear</option> <option>sun bear</option...

excel vba - Passing Dates to VBA UDF, returns NUM error -

excel vba - Passing Dates to VBA UDF, returns NUM error - the next vba code works if run sub(), when run udf, #num! error. i suspecting there problem while passing values it. public function servicetaxinterest(paymentdate date, duedate date, taxamount integer) integer dim involvement double involvement = 1e-32 if duedate > paymentdate involvement = 0 elseif taxamount <= 0 involvement = 0 else to_day = duedate paymentdate if to_day < dateserial(2014, 10, 1) involvement = involvement + (taxamount * 0.18 / daysinyear(to_day)) elseif monthsdelay(duedate, to_day) < 6 involvement = involvement + (taxamount * 0.18 / daysinyear(to_day)) elseif monthsdelay(duedate, to_day) < 12 involvement = involvement + (taxamount * 0.24 / daysinyear(to_day)) else involvement = involvement + (taxamount * 0.3 / daysinyear(to_day)) end if next end if ...

Multiple PHP array split -

Multiple PHP array split - array (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); array (b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12); array (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12); from upper array want this: array (a1, a2, a3, a4); array (b1, b2, b3, b4); array (c1, c2, c3, c4); array (a5, a6, a7, a8); array (b5, b6, b7, b8); array (c5, c6, c7, c8); array (a9, a10, a11, a12); array (b9, b10, b11, b12); array (c9, c10, c11, c12); //etc. i have opportunities columns check. 4-columns above or 3. the list long. $input_array = array ("a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12"); var_dump(array_chunk($input_array, 4, true)); out set : array (size=3) 0 => array (size=4) 0 => string 'a1' (length=2) 1 => string 'a2' (length=2) 2 => stri...

javascript - Jquery ajax() call fails in IE8 -

javascript - Jquery ajax() call fails in IE8 - i have next code submitting info using ajax forms of class ajax . works in firefox, safari , chrome fails in ie. ajax: function() { $('form.ajax').live('submit', function() { var form_ajax = $(this); $.ajax({ url: form_ajax.attr('action'), data: form_ajax.serialize(), type: form_ajax.attr('method'), datatype: 'script', beforesend: function(xhr) { $('#ajax-bid-new .ajax-form-error, #ajax-bid-new .ajax-form-success').remove(); form_ajax.slideup(); } }); homecoming false; }); please help - stuck here past 2 days. returning javascript file server evaluated within browser. works expected in firefox, chrome , safari, ie receives file , opens file download dialog. what can in ie create work? tried dropping next code in application.js file (i'm d...

memory management - Share large data structure between C++/Win7 processes? -

memory management - Share large data structure between C++/Win7 processes? - i attempting allow 1 process d read memory in process a's address space, using c++/visual studio 2013, under 64-bit windows 7. normally, job createfilemapping / mapviewoffile, there problems approach: (1) allocating memory via new , malloc, , should not changed; (2) amount of memory shared big (gb); copying not option, , using file way slow; (3) memory beingness shared can alter allocates , de-allocates. process d can thought of debugger, able read parts of particular big info construction in process a. process run using visual studio 2013 debugger, , @ breakpoint when process d looks @ a's data. if programming @ o/s level, allow process d create copies of a's page mapping entries memory shared. there way me accomplish same result application pgm? c++ memory-management shared-memory

neo4j - Talend : Set up talend 5.6.1 to use java 1.7 jdk on macosx -

neo4j - Talend : Set up talend 5.6.1 to use java 1.7 jdk on macosx - using talend big info studio. trying utilize neo4jconnection version 2.x.x, shows error "component required java 1.7" i have setup java_home path variable in .bash_profile selected preferences in talend point java 1.7 jre. can please allow me know if has worked anyone? if need run talend specific java version, can run using param "-vm". i.e ./tos_bd-linux-gtk-x86_64 -vm /usr/java/jdk1.7.0_75/bin just need specify [path jre or jdk] after -vm. java neo4j talend .bash-profile java-home

java - Use cookie with Httpclient on Android -

java - Use cookie with Httpclient on Android - i'm trying session cookies when authenticate user don't understand witch way best httpclient. public void postdata() { // create new httpclient , post header httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://www.yoursite.com/script.php"); seek { // add together info list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(2); namevaluepairs.add(new basicnamevaluepair("id", "12345")); namevaluepairs.add(new basicnamevaluepair("stringdata", "anddev cool!")); httppost.setentity(new urlencodedformentity(namevaluepairs)); // execute http post request httpresponse response = httpclient.execute(httppost); } grab (clientprotocolexception e) { // todo auto-generated grab block } grab (ioexception e) { // todo auto-generated grab block }} java android cookies httpclient

java - Android how to let users interact with each other -

java - Android how to let users interact with each other - been doing basic android development awhile now. ready implement ideas unsure touch on. if question has been asked please sense free direct me there can not find thread. lets based on user interaction info collected , entered either text or xml file. how can enable user send info thats been collected android user using same app? there apis out there capable of transferring info between users? in simple example, facebook messaging. 1 message created user , sent user. how can on right path this? thank you! java android facebook

ios - Using Swift in a master-detail app, how can i programmatically switch detail views? -

ios - Using Swift in a master-detail app, how can i programmatically switch detail views? - i thought i'd have go @ building ipad app using swift. app i'm mucking around master-detail app. in master table have 2 rows: "window1" , "window2" , 2 detail views. have created storyboard segue 2 detail views (1 beingness default one). 2 segues called "showdetail" , "showwindow2". a video watching on youtube used next code direct user master tab appropriate detail page: override func numberofsectionsintableview(tableview: uitableview) -> int { homecoming 1 } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { homecoming 2 } override func tableview(tableview: uitableview, diddeselectrowatindexpath indexpath: nsindexpath) { var row = indexpath.row switch row { case 1: self.performseguewithidentifier("showd...

sql server - Azure VM Image with SSRS & SSIS -

sql server - Azure VM Image with SSRS & SSIS - i looking appropriate , cost effective azure vm image allow secure access web application communicates ssrs instance reporting side of equation. need able deploy vm using web deploy. note info requirements @ low end of scale - i'm running thing locally on dev box - 1 time published needs accessible people 2 different domains. in short, on vm i'll need: sql server ssrs ssis (for uploading info in bulk) iis web deploy the ability send email 1, 2, , 3 available in sql server image in azure. rest can installed , configured after creating vm. cost effective provision sql server 2014 web edition vm. sql-server azure ssis virtual-machine ssrs-2008-r2

c++ - Assigning the address of nonconst to a const pointer -

c++ - Assigning the address of nonconst to a const pointer - i'm studying pointers, constness. confused @ point. learned assigning address of const nonconst pointer prohibited in c++ can solved using const_cast. it's ok. however, assigning address of nonconst variable const pointer allowed. didn't understand why allowed. please @ below example. in example, ptr pointer const int. however, value ptr points changes. there contradiction here, because const int value ptr points changes. can explain contradiction, or if wrong, can explain why? #include <iostream> using namespace std; int main() { int year = 2012; const int* ptr = &year; year=100; year=101; cout << *ptr; // 101 printed, value ptr points alter whenever year changes homecoming 0; } if familiar file access, having pointer-to-const kind of opening file read only. given file handle can utilize reading, doesn't mean file can't changed in other w...

java - KeyboardFocusManager issue, Maven vs IDE build -

java - KeyboardFocusManager issue, Maven vs IDE build - i trying add together keyboard shortcuts existing java app. relevant part follows: public final class main{ ... private mykeyeventdispatcher keydispatcher; /*implements keyeventdispatcher*/ ... keyboardfocusmanager manager =keyboardfocusmanager.getcurrentkeyboardfocusmanager(); keydispatcher = new mykeyeventdispatcher(this); manager.addkeyeventdispatcher(keydispatcher); viewer = makejviewer(); /*an extension of jpanel, shows video stream.*/ ... } now, keyboard focus scheme works 1 expect software rendering. however, since add-on of gl rendering support, behaviour different. upon starting program, keyboard manager works fine. kid objest of main have focus , focus manager behaves defined in main . when click on stream-video button however, ie. when internal jpanels within jviewer rendererred first time, although same buttons , panels maintain focus, keyboard manager ...

python - Asyncio Making HTTP Requests Slower? -

python - Asyncio Making HTTP Requests Slower? - i'm using asyncio , requests benchmark series of http requests. for reason, it's slower utilize asyncio straight requests. thought why? using asyncio incorrectly? import asyncio import functools import requests import time ts = time.time() in range(10): @asyncio.coroutine def do_checks(): loop = asyncio.get_event_loop() req = loop.run_in_executor(none, functools.partial(requests.get, "http://google.com", timeout=3)) resp = yield req print(resp.status_code) loop = asyncio.get_event_loop() loop.run_until_complete(do_checks()) te = time.time() print("version a: " + str(te - ts)) ts = time.time() in range(10): r = requests.get("http://google.com", timeout=3) print(r.status_code) te = time.time() print("version b: " + str(te - ts)) output: version = asyncio; version b = requests 200 200 200 200 200 200 200 200 200 200 version a: 5.72158...

objective c - change storyboard entry point -

objective c - change storyboard entry point - i have app tabbarcontroller entry point 2 tabs in it. requirements have changed , need add together login screen before showing tabbarcontroller . how can alter storyboard entry point ? possible programmatically ? objective-c ios7

version control - Git add and commit all files in one _native git_ command? -

version control - Git add and commit all files in one _native git_ command? - the mutual git command sequence is: git add together . git commit -m "message" i have searched native git command 1 line surprisingly not find it. there @ to the lowest degree 2 big threads concerned question here , here, surprisingly have high voted answers not doing job or doing using additional hacks. the top voted solution in first thread linked above suggest define macro git config --global alias.add-commit '!git add together -a && git commit' which has downside of having 1 time again , 1 time again every new software environment. sec voted solution git commit -a -m "message" does not work - not add together new files! other "solutions" involve writing same 2 commands in single line - offers no advantage in terms of typing! further, pro git - 1 of well-known books states on page 22: 2.2.7 skipping staging area a...

php - Wordpress newbie seeking a name and guidance -

php - Wordpress newbie seeking a name and guidance - i've began larn css , php, in effort create wordpress site. i've pretty much been 24/7 2 weeks trying figure out. today while browsing ideas stumbled on own thought... , after googling felt eternity thought i'd give site try... (it's confusing google when have no clue called.) there "easy" way hide of site's content until button pressed? for instance, http://gyazo.com/6645edf04777af0f375b662db452d33f ... let's image entire site, until press arrow facing down. "reveals" rest of site, in fancy way. thanks in advance. yes, there is. can jquery javascript library. note: if you're not familiar jquery, you'll have set within <head> tag: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> phone call jquery library googgle. learn more jquery here this <script> should go header or can ...

Google Apps Script. Make script work in active row -

Google Apps Script. Make script work in active row - i utilize simple table register tasks should clients. every time when reached task, send in history cell info adding date. need automate process , have script: function goal (){ var ss = spreadsheetapp.getactivesheet(); var formatteddate = utilities.formatdate(new date(),"gmt+5", "dd.mm.yy..hh:mm"); var num1 = ss.getrange("b7").getvalue(); var num2 = ss.getrange("c7").getvalue(); var num3 = ss.getrange("d7").getvalue(); ss.getrange("d7").setvalue(num3+" / "+num1+" "+num2); ss.getrange("b7").clear(); ss.getrange("c7").setvalue(formatteddate); var range = ss.getrange("b7"); ss.setactiverange(range); } a7 - name of client b7 - active task c7 - date of creating task d7 - history of tasks and here question: now script work in 1 row range, how can create work in active row range? function goal (){ ...

Empty Stack Exception in Java -

Empty Stack Exception in Java - i'm not sure i'm going wrong code, hoping more experienced eyes review me. this stack trace: input look string:(+ 1 2) evaluate look #1 :(+ 1 2) exception in thread "main" java.util.emptystackexception @ java.util.stack.peek(stack.java:102) @ pj2.simplelispexpressionevaluator.evaluatecurrentoperation(simplelispexpressionevaluator.java:126) @ pj2.simplelispexpressionevaluator.evaluate(simplelispexpressionevaluator.java:235) @ pj2_test.main(pj2_test.java:42) java result: 1 this line 126: while(tokenstack.peek() instanceof double){ this line 235: evaluatecurrentoperation(); this current code: import java.util.*; public class stackcalculator{ private string currentexpression; // main look stack, see algorithm in evaluate() private stack<object> tokenstack; public simplelispexpressionevaluator() { tokenstack = new stack(); currentexpression = ""; } // constructor input look public...

c++ - Stuff a class with user-defined constructors into a union -

c++ - Stuff a class with user-defined constructors into a union - class foo { foo(int val) { /* initialization */ } foo() { /* nil */ } }; union bar { foo foo; }; that code generates error: error c2620: fellow member 'bar::foo' of union 'bar' has user-defined constructor or non-trivial default constructor i understand why you'd throw error if constructor did something, constructor here takes no parameters , nothing. there way can stuff class union? i've had resort way doing char foo[sizeof(foo)] , cleaner solution. originally question: http://stackoverflow.com/questions/321351/initializing-a-union-with-a-non-trivial-constructor: from c++03, 9.5 unions, pg 162 a union can have fellow member functions (including constructors , destructors), not virtual (10.3) functions. union shall not have base of operations classes. union shall not used base of operations class.an object of class non-trivial constructor (12.1), non-tr...

java - build gradle variables to be used in code depending on flavor AND build type -

java - build gradle variables to be used in code depending on flavor AND build type - is there way utilize variables build.gradle in code, dependent on flavor , buildtype? in illustration here: is possible declare variable in gradle usable in java? new resource value depends on if debug or release build type. what have 1 variable each possible buildvariant. so like: flavor1debug => resvalue "string", "app_name", "app 1 debug" flavor1release => resvalue "string", "app_name", "app 1" flavor2debug => resvalue "string", "app_name", "app 2 debug" flavor2release => resvalue "string", "app_name", "app 2" is there nice way either through build.gradle or way doesn't included switches or if else statements? in build.gradle app, 1 way accomplish be: buildtypes { debug { productflavors.flavor1.buildconfigfield "st...

save multiple images from url into internal storage in android -

save multiple images from url into internal storage in android - i using method images url , downloading more 1 image varable below called "name" array of names of images .i want able store images whos name in array thats why kept url that.it seems work have having problem selecting 1 image out or them. this code save images string filename="code"; seek { url url = new url("http://10.0.2.2/picure/"+name+".jpg"); httpurlconnection conn = (httpurlconnection) url.openconnection(); conn.setdoinput(true); conn.connect(); inputstream = conn.getinputstream(); bitmap bm = bitmapfactory.decodestream(is); fileoutputstream fos = getactivity().openfileoutput(filename, context.mode_private); ...

windows - Win8.1 Net Use Succeeds, Mapped Drive Fails -

windows - Win8.1 Net Use Succeeds, Mapped Drive Fails - a client has nas box (nas01) , batch script connect 3 drives @ startup. net utilize h: \\nas01\home\foo /user:foo bar net utilize m: \\nas01\music /user:foo bar net utilize p: \\nas01\media /user:foo bar from windows explorer clicking on m , h drive gets him folders. p drive fails cross through it. i opened command prompt ( cmd ) administrator (right click run administrator) , ran batch. it succeeded under cmd. it failed allow user in under windows explorer. i used net utilize * /delete cmd prompt ran next line manually. net utilize p: \\nas01\media /user:foo bar in cmd can dir p: , see files, can alter p: drive, alter folders , see sub folders , files. windows explorer nada. a manual disconnect each drive re map of drives under windows explorer fixed issue - 4 drives accessible, leaves me batch file client cant utilize when windows drops mapped drives 1 time again in future. why...

How could comma separated initialization such as in Eigen be possibly implemented in C++? -

How could comma separated initialization such as in Eigen be possibly implemented in C++? - here's part of eigen documentation: matrix3f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::cout << m; output: 1 2 3 4 5 6 7 8 9 i couldn't understand how comma separated values captured operator<< above. did tiny experiment: cout << "just commas: "; cout << 1, 2, 3, 4, 5; cout << endl; cout << "commas in parentheses: "; cout << ( 1, 2, 3, 4, 5 ); cout << endl; predictably (according understanding of c++ syntax) 1 of values captured operator<< : just commas: 1 commas in parentheses: 5 thus title question. the basic thought overload both << , , operators. m << 1 overloaded set 1 m , returns special proxy object - phone call p - holding reference m . then p, 2 overloaded set 2 m , homecoming p , p, 2, 3 first set 2 m , 3 . a similar tech...

hyperlink - Check whether a cell contains a link in Excel -

hyperlink - Check whether a cell contains a link in Excel - i trying check whether values in column, a, contain link, , if true, in column b, want type text, example: link. have many records (10 000), doing hand take lot of time. thx. here: sub links() dim lnk hyperlink, lnks hyperlinks set lnks = range("a:a").hyperlinks = 1 lnks.count set lnk = lnks(i) lnk.range.value = "link" next end sub you need read more on vba if want utilize procedure above. please share research first , @ to the lowest degree code stub. simple hence exception. excel hyperlink

java - SSO using spring-security-oauth2 : Authentication Code never read -

java - SSO using spring-security-oauth2 : Authentication Code never read - using : spring-security 3.2.5 spring-security-oauth 2.0.7 i have working oauth2 provider built spring-security-oauth (oauth2). i have client configured in utilize authorization_code grant type. the provider works : testing curl, can authorization code , exchange access token. on service provider part, fine. now i'm trying implements client application, spring-security-oauth. i'm using xml configuration, based on illustration here, using own provider (mentionned above) instead of google. when create phone call protected resource on client, oauth2clientauthenticationprocessingfilter tries obtain access token, redirect service provider. 1 forcefulness user log in, expected, , redirect him configured redirect_uri (the redirect uri 1 configured oauth2clientauthenticationprocessingfilter : http://myclient/context/external/login). problem : the client never read authorization code i...

java - Is there a way to define the value of the index in an arraylist? -

java - Is there a way to define the value of the index in an arraylist? - i had assignment due today ( late wont getting credit problem eating @ me) not figure out life of me. assignment goes followed: withoutten: homecoming version of given array 10's have been removed. remaining elements should shift left towards start of array needed, , empty spaces @ end of array should 0. {1, 10, 10, 2} yields {1, 2, 0, 0}. may modify , homecoming given array or create new array. withoutten({1, 10, 10, 2}) --> {1, 2, 0, 0} withoutten({10, 2, 10}) --> {2, 0, 0} withoutten({1, 99, 10}) --> {1, 99, 0} i have tried various things create programme work failed. ` // arraylist defined integer class name of list int i= 0; //loop for(i = 0; < list.size(); i++) { if( list.get(i) == 10) { list.remove(i); list.add(0...

java - What types to use for my numbers when calculating -

java - What types to use for my numbers when calculating - so need calculate value. the input this: a seed/m2. value might illustration 56 might 56.7 also. b in g's. instance 600g c % value, might 90.6 d % value, might 90.6 the result should kg/ha regular int not cutting it. value of (56 * 600 / 100 / 100) / 100 0.0336 . multiply 10000 lose precision. i tried bigdecimal gave me arithmeticexception: “non-terminating decimal expansion; no exact representable decimal result” when changed values of % variables else 100. what best alternative go this? calculation easy in exel knew how convert each value automatically, doing in java code thing. my solutions: int version: int = integer.decode(germinativeseed.gettext().tostring()); int b = integer.decode(seedmass.gettext().tostring()); int c = integer.decode(clean.gettext().tostring()); int d = integer.decode(germinative.gettext().tostring()); int result2 = ( *...

c++ - How to initialize 2D array of chars -

c++ - How to initialize 2D array of chars - i trying write simple name generator, got stuck array initialization. why can't initialize 2d array this? const char* alphab[2][26] ={{"abcdefghijklmnopqrstuvwxyz"}, {"abcdefghijklmnopqrstuvwxyz"}}; it compiles without errors , warnings, cout << alphab[0][5] prints nothing. why this class sample{ private: char alphnum[] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; } throw "initializer-string array of chars long" error, , this char alphnum[] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; class sample{ //code }; doesn't? here code class namegen { private: string str; char arr[5]; const char* alphab[2][26] = {{"abcdefghijklmnopqrstuvwxyz"}, {"abcdefghijklmnopqrstuvwxyz"} }; public: string genname() { srand(time(0)); (unsigned int = 0; < sizeo...

how to convert german charater in to utf string in pdf parsing in iphone? -

how to convert german charater in to utf string in pdf parsing in iphone? - i have implementing pdf parsing in have parsed pdf , fetch text disply junks characters want convert in utf string.how possible please help me question. first, need find out encoding used text. guess it's iso-8859-1, aka latin-1 or it's variant iso-8859-15, aka latin-15. as know it's piece of cake. haven't said in container got text, e.g. whether it's stored in c string or nsdata. let's assume got c string. in case do: mystring = [[nsstring alloc] initwithbytes:mycstring length:strlen(mycstring) encoding:nsisolatin1stringencoding]; if got nsdata, utilize initwithdata:encoding: initializer instead. that's need do, according apple's documentation, "a string object presents array of unicode characters". if need utf8-encoded c string, can query via: myutf8cstring = [mystring utf...

delphi - Converting a string to TDateTime based on an arbitrary format -

delphi - Converting a string to TDateTime based on an arbitrary format - is there way in delphi 5 convert string tdatetime can specify actual format use? i'm working on jobprocessor, accepts tasks various workstations. tasks have range of parameters, of dates, (unfortunately, , out of control) they're passed strings. since jobs can come different workstations, actual datetime format used format dates string might (and, of course, actual do) differ. googling around, quick solutions found sneakily alter shortdateformat variable, , restore original value afterwards. since shortdateformat global variable, , i'm working in threaded environment way work synchronizing every access it, unacceptable (and undoable). i re-create library code sysutils unit own methods, , tweak them work specified format instead of global variables, i'm wondering if there's more adequate out there missed. kind regards, , in advance, willem update to set more succinctly: ...

RegEx JavaScript problem -

RegEx JavaScript problem - i have text: <body> <span class="forum"><div align="center"></div></span><br /> <span class="topic">text</span><br /> <hr /> <b>text</b> text<br /> <hr width=95% class="sep"/> text<a href="text" target="_blank">text</a> <hr /> <b>text</b> -text<br /> <hr width=95% class="sep"/> **text need.** <hr /> and regex "text need" - /"sep"(.*)hr/m . it's wrong: why? don’t utilize regular expression, utilize dom methods instead: var elems = document.getelementbytagname("hr"); (var i=0; i<elems.length; ++i) { var elem = elems[i]; if (/(?:^|\s+)sep(?:\s|$)/.test(elem.classname) && elem.nextsibling && elem.nextsibling.nodetype === node.text_node) { ...