Posts

Showing posts from March, 2011

django - How to pass arguments to an already running python program? -

i'm using django framwork, , have pass new query python script. however, python program have read large data file, , takes 2 minutes load data. want load data once, , pass new query running python program, fast enough web users. unfortunately, have searched lot, still don't know how implement it. one method read communication file: oldid = -1 while true: f = open("communication","r") t = f.read() f.close() t = t.split("==") id = int(t[0]) query = t[1] if id > oldid: # query not handled yet stuff handle query ... oldid = id you write file looks so: id==query replace id , query wishes. count id +1 if push new query. use script that.

Looping through a List<Map<Integer, Map<Long, Integer>>> in Java -

as title suggests, i'm struggling looping through data structure given. i have list of maps contain integer key , map value contains long , integer. how can loop through list, map, map able access of required fields? thanks. edit: in response comments, looping through list i'm fine with. step 1 loop through list, i'm left with: for (map<integer, map<long, integer>> periodscores : request.getperiodscoremap()) { ... } it's goes in there confuses me. currently have: for (map<integer, map<long, integer>> periodscores : request.getperiodscoremap()) { while (periodscores.entryset().iterator().hasnext()) { map<integer, map<long, integer>> opponentscores = (map<integer, map<long, integer>>) periodscores.entryset().iterator().next(); } } and i'm struggling final map of its matter of being careful , being able differentiate between map , list it

http - use Java client like curl with param -

i use influxdb 0.9. in version, can write database like curl -xpost 'http://localhost:8086/write?db=mydb' -d 'cpu,host=server01,region=uswest value=1.0' now convert java url url = new url("http", "localhost", 8086, "/write?db=mydb"); httpurlconnection con = (httpurlconnection) url.openconnection(); con.setrequestmethod("post"); con.setdooutput(true); outputstream wr = con.getoutputstream(); stirng s = "cpu,host=server01,region=uswest value=51.0"; wr.write(s.getbytes(utf_8)); wr.flush(); wr.close(); but doesn't work. "-d" meant represent post parameters? how can express in java? in example curl flag should --data-binary , not -d , can have different encoding. long string unaltered java code should fine. url encoding prevent line protocol insert working.

java - How to rapidly play a sound when button is clicked(android) -

i'm trying play sound each time, button clicked. sound played need play every single time(like sound played when type something), problem is, mine isn't playing always. think because button clicked little delay. new mediaplayer sound = new mediaplayer().create(getapplicationcontext(), r.raw.sound); button.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { if (x >= ps.getx() && x < (ps.getx() + squares.getwidth()) && y >= ps.gety() && y < (ps.gety() + squares.getheight())) { ps.setres(psquareoffres); ps.setx(ps.getx() - squares.getwidth()); ps.sety(ps.gety() - squares.getheight()); ps.settouched(true); ps.lock(true); touchlimita = system.currenttimemillis(); timer = 3; sound.start(); break; } return false; } i glad o

android graph view not shown when the data is the same -

i'm using android graph view here works fine , when y value of data same doesn't show thing more whole view visibility gone. can handle appending fake value data point doesn't fine.does have idea. lot! part of code /... datapoint[] datapoints = new datapoint[length]; // populate datapoints linegraphseries<datapoint> series = new linegraphseries<datapoint>( datapoints); graph.removeallseries(); graph.addseries(series); // make other stuff /... you don't need append fake value. in case have mentioned (same value y) works correctly, line created coincides on x-axis y-axis starting y value have set, not zero. changing line colour adding following lines code, able see drawn line. graph.setbackgroundcolor(getresources().getcolor(android.r.color.holo_blue_bright)); series.setcolor(color.green); graph.getviewport().setscalable(true); graph.getviewport().setscrollable(true);

axapta - Dynamics AX : Restrict Security policy (xDS) -

we have defined projectmanager role. want restrict list of accessible project. idea allow access project of user's department. department information available in field of employee , in financial dimension on project. i've created xds , works fine. but project manager can work on projects other departments. want "disable" xds when user fills in timesheets. because xds restrict project list when user add line in timesheets. do have idea? first of all, can try deactivate xds operation: xdsservices xds = new xdsservices(); xds.setxdsstate(false); //do have xds.setxdsstate(true); then, regarding business case, may go command , restrict list of projects join query. or go xds myproject tempdb table containing projects worker works on. then, have no more filtering issue this. you'll have implement additioal filter/restriction on other departements projects.

directory structure - Python Create a Folder -

i have folder named d:\myfolder\subdir1\subdir2 contains file named garbage. how create folder under same directory named garbage? script not working, receiving error oserror: [errno 17] file exists: 'd:\myfolder\subdir1\subdir2\garbage'. here code snippet: if os.path.exists(newloc): print('exists ', newloc) if not os.path.isdir(newloc): print('create ', newloc) os.makedirs(newloc) else: print('creating ', newloc) os.makedirs(newloc)

hadoop - Removal Double Quote(") from CSV file using PIG -

i trying remove double quotes(") file.some of field has data "newyork,ny". please advice me do?i have tried delete (") csv.but not happening.stepwise codes given below: i opening pig using pig -x local 1st step: test4 = load '/home/hduser/desktop/flight_data.csv' using pigstorage(',') ( year: chararray, quarter: chararray, month: chararray, day_of_month: chararray, day_of_week: chararray, fl_date: chararray, unique_carrier: chararray, airline_id: chararray, carrier: chararray, tail_num: chararray, fl_num: chararray, origin: chararray, origin_city_name: chararray, origin_state_abr: chararray, origin_state_fips: chararray, origin_state_nm: chararray, origin_wac: chararray, dest: chararray, dest_city_name: chararray, dest_state_abr: chararray, dest_state_fips: chararray, dest_state_nm: chararray, dest_wac: chararray, crs_dep_time: chararray, dep_time: chararray, dep_delay: chararray, dep_delay_new: chararray, dep_del15: chararray, dep_

Can't override class method with monkey patching in Ruby on Rails -

so trying override class method reflect_on_association in activerecord::reflection . here's link original file: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/reflection.rb the method defined on line 106. these attempts far: 1. activerecord::reflection::classmethods.module_eval # test method def say_hello puts 'hello' end # want override original method 1 def reflect_on_association(association) puts 'overridden!' # < implementation goes here > end end 2. module activerecord::reflection::classmethods # test method def say_hello puts 'hello' end # want override original method 1 def reflect_on_association(association) puts 'overridden!' # < implementation goes here > end end the say_hello methods works both cases (for example when call person.say_hello ), still no luck reflect_on_association . anyone has idea on how can this? thank much!

android - stop panning to my location after camera update -

i have set map points marked on works fine. open map , move , zoom location. problem when pan location, after moment takes me location. how move , zoom , release move @ location. here code move , zoom: private void setupmapifneeded() { // null check confirm have not instantiated map. if (mmap == null) { // try obtain map supportmapfragment. mmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)) .getmap(); mmap.setmylocationenabled(true); // check if successful in obtaining map. if (mmap != null) { setupmap(); mmap.setonmylocationchangelistener(new googlemap.onmylocationchangelistener() { @override public void onmylocationchange(location arg0) { // todo auto-generated method stub latlng mylocation = new latlng(arg0.getlatitude(), arg0.getlongitude());

javascript - Show/Hide element when clicking buttons -

i have 2 buttons show , hide , have image want know when click hide button img disappear , when click show button appear again. , don't want css or jquery javascript. if can lot. window.onload = function(){ var myimg = document.getelementbyid('myimg'); document.getelementbyid('hidebtn').onclick = function(){ myimg.style.display = 'none'; }; document.getelementbyid('showbtn').onclick = function(){ myimg.style.display = ''; }; document.getelementbyid('togglebtn').onclick = function(){ var display = getcomputedstyle(myimg).display=='none'?'':'none'; myimg.style.display = display; }; } <button id="hidebtn">hide</button> <button id="showbtn">show</button> <button id="togglebtn">toggle</button> <br/> <img id="myimg" src="http://www.eastcottvets

mysql - Php isset not working after button click -

for reason when click cancel button should run through cancel isset mysql query doesn't. passes through mysql query when make $_get instead of $_post. not entirely sure whats happening. if(isset($_post["cancel"])) { $scancel = $dbh->prepare(" update materialorders set `cancelledbyuid` = :uid, `cancelled` = 'true' `idmaterialorders` = :idmaterialorders "); $scancel->bindvalue(":uid", $_session["uid"]); $scancel->bindvalue(":idmaterialorders", $_get["oid"]); if ($scancel->execute()) { $scancel->closecursor(); } } <a href="i

javascript - jQuery - Bind two events to an AND operator -

is posible bind 2 events , logic operator both has active function called? have this: foobar.bind("foo , bar", barfunc); function barfunc(e) { alert("foobar!"); } so in order barfunc called both foo , bar needs active. useful cause making slider/seeker out of divs (cannot use jquery ui slider) , need call function when both pressing down mouse button , hovering on div. it's not possible using syntax that—the events never fire @ exact same time, 1 after other. said, following (pseudo code based off example): var ishovering = false, isclicking = false; function barfunc(e) { if(ishovering && isclicking){ alert("foobar!"); } } foobar.on('mousedown', function(event){ isclicking = true; barfunc(event); }).on('mouseup', function(event){ isclicking = false; }).on('mouseenter', function(event){ ishovering = true; barfunc(event); }).on('mouseleave',

c# - iis basic auth doesn't work with my asp.net app -

my need simple, have asp.net mvc 5 web app , want show app customer. want put website on iis , protect basic auth access. the problem : empty folder works when deploy app got : the page isn't redirecting properly with link : http://xx.xxx.xxx.xxx:xxxx/account/login?returnurl=%2faccount%2flogin%3freturnurl%3d%252faccount%252flogin%253freturnurl%253d%25 .... here web.config : <?xml version="1.0" encoding="utf-8"?> <configuration> <appsettings> <add key="webpages:version" value="3.0.0.0" /> <add key="webpages:enabled" value="false" /> <add key="clientvalidationenabled" value="true" /> <add key="unobtrusivejavascriptenabled" value="true" /> </appsettings> <system.web> <authentication mode="none" /> <compilation debug="true" targetframework="4.5" />

javafx 8 - Copy entite fxml data to different container -

i having 2 vbox(es). first vbox fx:id vbox1 second vbox fx:id vbox2 in vbox1 having textbox, combobox, buttons , else. i having 1 button want copy (onclick) entire source/fxml vbox1 vbox2. is there anyway that? define content of vbox es in separate fxml file. can include content in first vbox directly in "main" fxml <fx:include> : <vbox fx:id="vbox1"> <fx:include source="content.fxml"/> </vbox> and can load copy in button's handler with @fxml public void handlebuttonaction(actionevent e) throws exception { fxmlloader loader = new fxmlloader(getclass().getresource("content.fxml")); vbox2.getchildren().add(loader.load()); } complete example (everything in package called application ): main.fxml: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.layout.borderpane?> <?import javafx.scene.layout.hbox?> <?import javafx.scene.

html - Unicode symbol is not displaying in tooltip in chrome (43) or IE -

i have anchor tag title contains glyph symbol "☀", when place cursor on anchor display tooltip displays square instead of symbol. i'm having problem in ie , chrome 43. seems work fine in firefox , chrome 45. here's code: <a href="javascript:void(0)" class="active elipsisforleftnav" id="csl_1" title="☀">☀</a> browsers typically handle tooltips passing them desktop environment's own tooltip interface, consistency rest of desktop. desktop render tooltip in own style own fonts, won't match fonts browser using. browser can render text using wider range of fonts desktop will. font support u+2600 black sun rays isn't brilliant, makes dicey use in tooltip. renders ok me (on ubuntu/chrome) desktop windows desktop font segoe ui doesn't support it. a workaround use 1 of many javascript tooltip replacement scripts. these take on title attributes , convert them hovering, positioned page ele

c# - Firing WebBrowser.DocumentCompleted event whilst in a loop -

i have simple app developing needs iterate through list of urls passed webbrowsers navigate function in each loop. hoping see documentcompleted event firing after each call of navigate function seems fired after whole form has completed loading - , loop has completed. i guess missing fundamental here , advice great! thanks! here sample of code trying... this foreach loop runs n form load event of winforms page using... int id = 0; foreach (datarow row in quals.rows) { urn = row["laim_ref"].tostring(); string urn_formated = urn.replace("/", "_"); string url = "http://url_i_am_going_too/"; string fullurl = url + urn_formated; wbrbrowser.scripterrorssuppressed = true; wbrbrowser.refresh(); wbrbrowser.navigate(fullurl); id += 1; label1.text = id.tostring(); } at point loop gets line: wb

html - How to remove spaces between two tds in a single table -

i working in html table have multiple tds there problem want reduce space between tds ,using css how that? here code <table id="employementinfo"> <tr> <th colspan="3" id="currentemploymentheading"> current employment </th> </tr> <tr> <th class="empleftdiv">current employment status<span style='color: #ff0000; display: inline;'>*</span></th> <% if(employmentstatus.equals("employeed")) {%> <td class="emprightdiv"> <input type="radio" name="employementstatus" value="<%=employmentstatus %>" checked>employeed <input type="radio" name="employementstatus" value="not employeed">not employeed<br>

jQuery stopped working with PHP -

i have written code jquery session, etc. happens when click text link should come "success" but when there's no data works, when put in data , fix it, code stops working completely. $(function() { $(".open").click(function() { var status = "open"; var ticketid = "<?php echo $_get['id']; ?>"; var username = "<?php echo $_session['mm_username']; ?>"; var datastring = 'status=' + status + 'id=' + ticketid + 'username=' + username; if(status==='' || ticketid==='' || username==='' || datastring==='') { $('.success').fadeout(200).hide(); $('.error').fadeout(200).show(); } else { $.ajax({ type: "post", url: "core/ticketdata.php", data: datastring, success: functi

ios - Saving and fetching Multiple Image Selection From Library in Core Data -

i building project using elcimagepickercontroller multiple selection , saving selected image core data. fetching images in vc , showing them uicollectionview. but problem facing here images not showing in collectionview. having 2 confusions. the images saving core data or not. if images saved, fetching or not. here entering selected images core data - (void)imagepicker:(snimagepickernc *)imagepicker didfinishpickingwithmediainfo:(nsmutablearray *)info { _arrimages = [[nsmutablearray alloc]init]; _imgdata = [[nsmutabledata alloc]init]; appdelegate* app=(appdelegate*)[[uiapplication sharedapplication]delegate]; nsmanagedobjectcontext *context = app.managedobjectcontext; albums *objphotos = (albums *)[nsentitydescription insertnewobjectforentityforname:@"albums" inmanagedobjectcontext:context]; //get images (int = 0; < info.count; i++) { alassetslibrary *assetlibrary=[[alassetslibrary alloc] init]; [assetlibrary assetf

angularjs - Jasmine Testing angular directive with [^form] dependency -

i trying test directive, explained e.g. here http://angular-tips.com/blog/2014/06/introduction-to-unit-test-directives/ . however, in directive use form, have in directive declaration object: return { link: link, restrict: 'e', require: ['^form'], // <- have !! scope: { //... }, controller: function ($scope) { //... } }; as such, when execute usual prerequisite jasmine test element = '<mydirective/>'; element = $compile(element)(scope); i getting following dependency problem when trying run karma / jasmine test: error: [$compile:ctreq] controller 'form', required directive 'mydirective', can't found! http://errors.angularjs.org/1.4.2/ $compile/ctreq?p0=form&p1=mydirective how can fixed? use '<form><mydirective></mydirective></form>' , , use element.find(&#

java - Don't find my file.properties -

Image
i try lot of thinks find fail don't know how can it. code is: //dominiollamadaredsys.java properties d = new properties(); inputstream entrada = null; try { entrada = new fileinputstream("prop/datosapp.properties"); d.load(entrada); system.out.println(d.getproperty("txd.endpointurl")); } catch (ioexception ex) { system.out.println("error: "+ ex.getmessage()); } { if (entrada != null) { try { entrada.close(); } catch (ioexception e) { } } } i call file inside class in "com.rsi.secpay.dominio" , catch same exception (don't find file), had try quit "prop/" (just "datosapp.properties" ) properties files this: if prop package in classpath, can stream using classloader: inputstream = dominiollamadaredsys.class.getresourceasstream("/prop/datosapp.properties");

networking - Is Backpropagation okay for this or should i try another approach? -

i'm making kind of "the life game" creatures , food on world. creatures eat food in order gain energy , when have enough energy reproduce. energy food provides based on time food has been on world, longer better. i'm using genetic algorithm creatures want them learn what's best through generations because thing have 4 ways search food: 1.- nearest one 2.- 1 provides more energy 3.- 1 provides best % mutate genes , gain cool new things 4.- 1 represents lower danger reach i have neural network input of 100 genes, 4 hidden layers , 1 output layer it's vector 4 components, each of them indicating search option should go based on genes. network doing great initial input, thing want keep feeding network on generations can things example creatures lazy genes evolved searching nearest food 1 provides more energy can "do nothing" longer periods of time (because yea, they're lazy). seems have pass in inputs everytime train it, impossible

javascript - To set focus on Anchor Tag on enter Key press -

i have used anchor tags in code mentioned below: <div title="main" > <a href="/home.aspx"> <div class="link-title"> home </div> </a> </div> <div title="contact" > <a href="/contact.aspx"> <div class="link-title"> contact </div> </a> </div> on enter key press opens specific page/link default tab navigation starts url. want during tab navigation when selects particular link on enter key press specfic page/link open , focused should remain on link/anchor tag. moves , start default navigation url. i have used css code: /* set keyboard focus on tab press*/ a:focus { outline: 1px dotted black; } can please assist me fix this? <div title="main" >

sql - Error while using OVER clause and variables -

i trying use variables preform calculation , display aggregate function. formula calculates total cost of product. @purchasecost how item cost per pound. ex. $5.50 @prod_costlbs how labor cost per pound. ex. $1.00 @inputweight how many pounds there are. ex. 4,000 of these variables input user. calculate total cost using formula: cast ((@purchasecost + @prod_costlbs) * @inputweight over() decimal (18,2)) [cost] however, error: the same query view cannot show column group designation of 'expression' without aggregate function when column contains group designation of 'group by' i using microsoft sql server 2005. full code: set nocount on; declare @purchasecost decimal(19,8); declare @inputweight decimal(19,8); declare @prod_costlbs decimal(19,8); set @purchasecost = 2.58; set @inputweight = 18100; set @prod_costlbs = .15; select cast([arc].[customercode] nvarchar(40)) + ' - ' + cast([arc].[name] nvarchar(40)) [supplier] , [

ios - Not getting email id when login via FacebookSDK.framework -

in application doing login facebook via facebooksdk.framework - (ibaction)facebookloginbtn1:(id)sender { [fbsession openactivesessionwithreadpermissions:@[@"email"] allowloginui:yes completionhandler: ^(fbsession *session, fbsessionstate state, nserror *error) { appdelegate* appdelegate = [uiapplication sharedapplication].delegate; [appdelegate sessionstatechanged:session state:state error:error]; [[fbrequest requestforme] startwithcompletionhandler: ^(fbrequestconnection *connection, nsdictionary<fbgraphuser> *user, nserror *error) { if (!error) { nsstring *firstname = user.first_name; nsstring *lastname = user.last_name; nsstring *facebookid = user.id; nsstring *email = [user objectforkey:@"email"]; nsstring *imageurl = [[nsstring alloc] initwithformat: @"http://graph.facebook.com/%@/picture?type=large", facebookid];

c# - TableView Cells Have Their Data Reset On Scrolling -

-----edit----- i've found workaround problem, utilising draggingstarted method inside tableviewsource. not optimal solution, , continue looking proper way deal problem, now, can continue on process. public override void draggingstarted(uiscrollview scrollview) { (int = 0; < 12; i++) { try { globalsupport.newclientdata[i] = ((scrollview uitableview).cellat(nsindexpath.fromitemsection(i, 0)).contentview.subviews[1] uitextfield).text; } catch { } } console.writeline("hoi"); } in getcell method, search new data structure, find right value: if (globalsupport.newclientdata[indexpath.row] != "") { cell.cellvalue = globalsupport.newclientdata[indexpath.row]; } -----endedit----- i working on implementing tableview-focused app. means of screens tableviews, have re-usable cells in them. these cells defined using xcode designer (this means have .cs, .xib , .designer in resour

okgrow:analytics - Meteor package GA installation - Not Working -

i trying install google analytics on test site on c9 s not working. not sure wrong. setting.json { "public": { "analyticssettings": { "google analytics" : {"trackingid": "my tracking id"} } } } i run with: meteor --port $ip:$port --settings settings.json

postgresql - C#: pg_restore to different schema -

i have .net application trying data dump using pg_dump , restore using pg_restore . here data dump code: public string getstringargument() { return string.format("-i -h {0} -p {1} -u {2} -f c -b -v -f {3} -n {4} {5}", _dbcredential.server, _dbcredential.port.tostring(), _dbcredential.user, getfilename(), "public", _dbcredential.database); } i'm getting datatables on public schema. now need restore data dump on postgres server using pg_restore. public string getstringargument() { return string.format("-i -h {0} -p {1} -u {2} -d {3} {4}", _dbcredential.server, _dbcredential.port.tostring(), _dbcredential.user, _dbcredential.database, _dbcredential.backuppath); } but need restore data bump different data schema called stack . this windows service application , cann't manual script changes. how can restore data dump different schema ? appreciate feedback!! there no way restore different schema using pg_restore all

Performance problems in SQL Server -

i´m trying sql sentence works fine (i think) have performance problem, takes 32 minutes execute, , think can poor code, can 1 me how improve it? this code: select distinct s.nombre, l.nomcli cli, (select max(lineas.fecalb) lineas lineas.codart = s.codart , lineas.codcli = l.codcli) fecha, (select max(proveedores.nombre) proveedores proveedores.codpro = s.codpro) proveedor, (select max(lineas.codrep) lineas lineas.codart=s.codart) representante stock s inner join lineas l on s.codart=l.codart s.codart in(select lineas.codart lineas inner join stock on lineas.codart=stock.codart datediff("d",lineas.fecalb,getdate())<365 , stock.stoexi>0 group lineas.codart having count(lineas.codart)<=2 )and (s.codart in( select st.codart stock st st.codart not in (select lineas.codart lineas datediff("d",lineas.fecalb,getdate())<=60) , st.stoexi>0) or s.codart in (select lineas.codart lineas datediff("d&quo

smartcard - how to Read Binary Data from EF in Scosta smart Card? -

i working scosta smart card, have created mf,df,ef file structure,i have created ef file formate in smart card , following code. sendbuff[0] = 0x00; //cla sendbuff[1] = 0xe0; //ins sendbuff[2] = 0x00; //p1 sendbuff[3] = 0x00; //p2 sendbuff[4] = 0x1a; //len sendbuff[5] = 0x62; //t sendbuff[6] = 0x18; //l sendbuff[7] = 0x80; //t sendbuff[8] = 0x02; //len sendbuff[9] = 0x02; //value,file size sendbuff[10] = 0x08; //value,file size sendbuff[11] = 0x82; //t sendbuff[12] = 0x01; //len sendbuff[13] = 0x01; //fdb (transparent working ef) sendbuff[14] = 0x83; //t sendbuff[15] = 0x02; //len sendbuff[16] = 0xe0; //ef indentifier sendbuff[17] = 0x07; sendbuff[18] = 0x88; //t sendbuff[19] = 0x01; //len sendbuff[20] = 0x09; //value sendbuff[21] = 0x8a; //t sendbuff[22] = 0x01; sendbuff[23] = 0x01; //lcsi. when file created first, in 01 sendbuff[24] = 0x8c; //t sendbuff[25] = 0x05; //len sen

javascript - Insert child elements in d3.js -

i trying create table using d3.js, td elements not nesting inside tr. this trying create: <table> <tr> <td>name</td> <td>value</td> </tr> </table> this i've tried: var mytable = d3.select("#mytable") var mytablerow = mytable.selectall("tr") .data(mydata); mytablerow.enter() .append("tr") .insert("td", ":first-child") .html(function(d) { return d.name; }) .insert("td", ":first-child") .html(function(d) { return d.value; }); however, each td not nest inside tr. var mytable = d3.select("#mytable") var mytablerow = mytable.selectall("tr") .data(mydata) .enter() .append("tr") mytablerow.append("td", ":first-child")

asp.net mvc - MVC TimeSpan Value Not Returning To Controller -

when attempt post data database, time values not in model. display fine when retrieving data though. here model: public class schedule { [displayname("build time")] [displayformat(applyformatineditmode = true, dataformatstring = @"{0:hh\:mm}")] public timespan build_time { get; set; } [displayname("start time")] [displayformat(applyformatineditmode = true, dataformatstring = @"{0:hh\:mm}")] public timespan call_start_time { get; set; } [displayname("end time")] [displayformat(applyformatineditmode = true, dataformatstring = @"{0:hh\:mm}")] public timespan call_end_time { get; set; } post controller: // post: recurringtemplate/create [httppost] public actionresult create(recurringtemplate recurringtemplate) { try { _repo.addrecurringtemplate(recurringtemplate); return redirecttoaction("index"); }

vsto - How to disable "New From Existing" functionality of Powerpoint programatically? -

i have written vsto addin powerpoint 2010. want disable "new exisiting" functionality powerpoint achive requirements. option comes under : file -> new -> new existing so there way block or disable functionality through code or registry settings ? you can hide built-in tab or button on backstage in powerpoint 2010 , add own control instead if required. read more backstage ui in following series of articles in msdn: introduction office 2010 backstage view developers customizing office 2010 backstage view developers

python - error when writing numpy into csv file -

i want save numpy array csv file. code gives me error: import os import pandas pd import numpy np path ='/users/mas/documents/workspace/avito/input/' # path testing file sample = pd.read_csv(path + 'samplesubmission.csv') index = sample.id.values - 1 test = np.array(pd.read_csv(path + 'dataset5test.csv')) #print new[0:10,:] new = test[index,:] np.savetxt(path + 'testsearchstream9.csv', new, delimiter=",") os.system('say "done"') this error get: np.savetxt(path + 'testsearchstream9.csv', new, delimiter=",") file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/numpy/lib/npyio.py", line 1061, in savetxt fh.write(asbytes(format % tuple(row) + newline)) typeerror: float argument required, not str you have specify form of data going save .by default takes float format np.savetxt(path + 'testsearchstream9.csv&#

angularjs - Upload multiple files in angular -

i've situation i've form in i've row i've 2 text fields entries , i've upload file row , kind of rows can 'n' , there master files can entered whole form while these part of form , i've submit these files @ once on clicking save button. i'm kind of stuck ng-upload needs api call, , can't have more 1 api call form. sample html code below : <!doctype html> <html> <head> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <form editable-form name="xyz

javafx 8 - How can I install maven repository into your pom.xml file in netbeans 8.0.2? -

should manually install maven in netbeans 8.0.2?i have try find pom.xml can not find it!in netbeans services show maven repository.how can add dependency in maven? you not need javafx fxml application while creating maven based javafx application using netbeans . since javafx (i.e. jfxrt.jar) present in default classpath jdk 8, not need external modification run javafx application. few things may come in handy : just make sure project running on jdk 8, add maven-compiler-plugin , set source/target 1.8 . maven not pick fxml files if add them in src/main/java . add java files in said directory , fmxl files must go inside src/main/resources . if need further packaging , deploying application can use javafx-maven-plugin . short tutorial can found in answer .

unix - Searching for a pattern inside a specific filetype from a zip file -

there zip file contains around 50k files of various types. i interested in below pattern match (looking output 1150000) amountdue 1150000 i know file contains details of type .abc , there single occurance of .abc file currently , using : zipgrep "amountdue" /path/to/sample.zip it taking considerable time (~ 5mins) perform search.not sure why. possible specify file type search - .abc in case. this: zipgrep "amountdue" /path/to/sample.zip -file_to_search=.abc any suggestions on how can implemented/bettered upon great help. you can add "glob" pattern *.abc end of command. quote avoid expansion zipgrep "amountdue" /path/to/sample.zip '*.abc'

c# - ASP.net web page update issue ( Postback?) -

Image
greeting of day everyone. hoping well. need solve simple issue ( new c# + asp.net). i have created asp.net portal. when user open portal (web page). webpage give him list of groups member of , list of group can add himself.. it contain 2 drop downs. 1 contains list of groups, use can add themselves. second 1 contains list of groups , user member of, , can remove groups. adding , removing code working fine. have refresh page manually show updated information. after clicking add or remove button page not refreshing updated information. i tried use redirected main page using response.redirect("success.aspx") but nothing working, protected void page_load(object sender, eventargs e) { string un = "domain\\michael.jackson"; //systemresources sr = new systemresources(); //activeuser usr = sr.getuserdetails(un).firstordefault(); labelusername.text = "michael.jackson"; // getting list of groups using of praticular ou classorg