Posts

Showing posts from June, 2011

apache pig - Distributed cache with Pig and Python -

i know there lot of resources using distributed cache in pig scripts java-udfs. haven't found explain same python udfs. also, have not found detailed explanation of distributed cache usage while writing pig scripts. i not asking question. want have place people me can first pig + python + distributed cache example working. sorry if unknowingly asking wrong question. thankful help. thanks, r0ger22

<sizeof(T)> as inherited class template parameter in c++ -

i've been trying make transition simple self-made game engine written in c c++ , came across nice book mike mcshaffry (game coding complete). , love of bios almighty cannot wrap head around 'optional template class', namely piece of code: class optional_empty { }; template <unsigned long size> class optional_base { public: // code here }; template <class t> class optional : public optional_base<sizeof(t)> { public: // code here }; why 'sizeof(t)' used template parameter when inheriting, , not plain 't'? make possible have t's of dynamic size? there no 'sizeof...' operator, it's not related variadic templates. or it? thanks. because optional_base not expecting template type parameter template value parameter (of type unsigned long ).

swift - `{ ... }` in output from `po` in Xcode debugger indicates what? -

i gather strings (as received block's first parameter in call enumeratetagsinrange:scheme:options:usingblock: ) array , inspect array in xcode debugger po strings . strings bear annotation { ... } so: (lldb) po strings ▿ 3 elements - [0] : "determiner" - [1] : "adjective" - [2] : "adjective" { ... } (lldb) expr strings ([string]) $r5 = 3 values { - [0] : "determiner" - [1] : "adjective" - [2] : "adjective" what { ... } indicate? if additional information, of kind , can "expand" somehow?

Wix - Installing an app off the c:\ root instead of program files and creating shortcuts -

this markup used create directory structure , create sub directories. work fine. creates software directory of c:\ root , creates sub directories under that. add new component group called "shortcuts". want create short cut on start menu , desktop icon.i not sure of call id ?????? in start menu directory. following error when build project. error 1 component/@directory attribute not found; required. occurs twice. 1 @ line component id="cmpstartmenushortcut" , 1 @ line component id="cmpdesktopshortcut" <fragment> <directory id="targetdir" name="sourcedir"> <directory id="windowsvolume"> <directory id="softwaredirectory" name="unionadministrator"> <directory id="runtimefolder" name="runtime" /> <directory id="reportsfolder" name="reports" /> <directory id="tasksfol...

How to use REST using Post Method to get XML information in android? -

for example, uri: http://99.99.99.99:8080/services/api/products/getproduct method: post content-type: application/xml then, use advanced rest client can these data <products> <product> <category>apple</category> <productcode>a1</productcode> </product> <product> <category>orange</category> <productcode>a2</productcode> </product> <product> <category>banana</category> <productcode>a3</productcode> </product> .... </products> how if want store of category , productcode. what kinds of method should use? httppost? xml parser? this sample code try , nothing logcat. public void getxml(){ string result = ""; httpclient client = new defaulthttpclient(); try { httppost post = new httppost("http://99.99.99.99:8080/services/api/products/getproduct...

mobile - Google Maps block touch events on Windows Phone -

i've got basic google maps implemented on site. i've put custom controls (basic divs touch events) on map area , work great on devices. the problem have windows phones google maps somehow blocks events on top of it. controls not responding @ all. if swipe on controls div have on top of maps doesn't scroll map. i'm using basic touch events touchstart, touchmove , touchend controls. i'm using stoppropagation inside events. controls divs have z-index bigger map , said works on android , ios. thanks i've figured 1 out. problem in how implemented touch events. i've added click events windows phone , works should.

JSON Unicode doen't work or phpMyAdmin? -

i searched in web stackoverflow problem didn't resolved. im trying json database shows question sign (?) [{"task_id":"13","task_title":"???","task_desc":"??? ???","task_done":"0"}] i set db collation utf8_persian_ci; didnt work me. used php codes didnt worked me: mysql_set_charset('utf8'); (didn't worked) set db collation utf8_persian_ci (didn't worked) header('content-type: application/json; charset=utf-8');(didn't worked) function escapejsonstring($value) { $escapers = array("\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c"); $replacements = array("\\", "\/", "\\"", "\n", "\r", "\t", "\f", "\b"); $result = str_replace($escapers, $replacements, $value); return $result; } echo my_json_encode($...

vbscript - unable to save changes in our web application when running VB test script using testcomplete 11.0 -

i have recorded vb test script in testcomplete 11.0 , did changes in our web application. when running recorded test script, didnt errors in log file generated testcomplete changes not reflecting in our application. here vb test script: sub test1 dim browser dim page dim form dim textbox dim table testedapps.xxxcm.run call browsers.item(btiexplorer).navigate("http://localhost/xxxcm/connect.asp") set browser = aliases.browser set page = browser.pagexxxconfigurationmanager set form = page.formconnectform set textbox = form.textboxusername call textbox.drag(89, 12, -244, 6) call textbox.settext("admin") call textbox.keys("[tab]") set table = form.tableyyyytable call table.passwordboxpwd.settext("xxxx") table.submitbuttonlogin.clickbutton page.wait set page = browser.pagexxxconfigurationmanagerfield set textbox = page.ta...

How to get min value in elasticsearch curl command -

i newbie elasticsearch. want min value particular day of log line's field. kibana shows indexed data follows: @timestamp 2015-07-30t22:22:07.071-07:00 @version 1 type mtalogs integerdata 052256894-0400 msgtype received internet msgid qamail-4.02.0220150730080248.ijruj.email-qa-sun26@172.20.1.10 msgsize 5635 path /opt/user1/log/mta.log processid 23441 protocol smtp rcpts pd10@myoxdomain.com sender pd9@myoxdomain.com servername mta sid 4f9f325e-8decdb12-00003556.1 time 0 tracename msgtrace i want min value of msgsize curl coomand. my curl command follows: curl -xget 'http://localhost:9200/_all/_search?pretty=true' -d '{ "query" : { "bool" : { "must" : [ { "match" : { "type" : "mtalogs" ...

sagepay - Trying to upgrade to v3. Unable to find 'admin' username for logging into mysagepay -

i web developer company need upgrade v3 of mysagepay continue trading. however, username have been given, not appear give me admin rights in control panel. need add ip address of our shopping cart provider allow continue work after end of july. my guess there username , full admin rights one.. the 1 have payments, allows view orders etc, not access of settings. is there standard username admin account on given vendor name? i've tried 'retrieve username' using various emails of company, return payments username, isn't apparently admin user. i've filled out couple of forms online support yet have had no useful responses, , time running out. can 1 advise whether there standard username gives full access rights (admin?) or whether there way of telling admin user is. many - pulling hair out here. gavin call sage pay. can add ip you, and/or sort out admin user account. you'll need merchant number in order prove have vendor account - can au...

Getresponse API 2 (Adding Custom fields and contacts using PHP) -

im new coding , web development , diving deep end api's thing wish never had done! being said have progressed further expected. having problems when trying add custom fields add contact feature. im trying code add hidden form input fields when user hits thankyou page. dont want use getresponses own form builder main page better use api. have code running when comes adding contact when add set_contact_customs code not execute , fails following error: (request have return error: array) understand set_contact_customs array im clueless have done wrong.. advice , appreciated still learning basics picking on experts great learning curve. thanks. --- below working version without set_contact_customs ---- <?php // add contact selected campaign id try{ $result_contact = $client->add_contact( $api_key, array ( 'campaign' => 'my-camp-id', 'name' => $fullname, 'email' => $emailaddress ) ); echo "<p style='color: blue; fon...

c# - How to use table instead of gridview? -

Image
i dont know if question or bad or duplicate want ask favor. designer gave me grid design using html tables looks quite handsome when use same css classes in asp gridview totally looks different. additional info: in project have used telerik grids. have tried applying css @ of no use. cant change designer css because our company. now @ last want use same table designer gave me , use grid dont know how fill datatable? 1. gridview generates/renders code in difficult impossible modify. 2. stay away telerik well. 3. use bootstrap css, should happy bootstrap css framework above easily. with bootstrap use classes class=table table-striped , have nice grid alternating row colors see in image posted. with asp.net , use nuget , install bootstrap. reference in masterpage or layout. i assume have styles overwrite designer gave you. perhaps if using stylesheets, make sure overwrite default styles. either omit style reference in master page etc... or place stylesheet r...

compiler errors - What is a Framework build of Python? -

so i'm testing out spy library in anaconda's spyder, , have run strange error: systemexit: program needs access screen. please run framework build of python, , when logged in on main display of mac. this happens when try call view_cube command spectral python (spy), requires wxpython. i have feeling related spyder's displaying of images generated program in onboard console, instead of in independent windows. how can fix error, , there way tell spyder display images in own windows? can run "framework build" within spyder? edit: able display resulting images in separate windows going preferences > ipython console > graphics, , setting backend mac osx. however, error when trying run view_cube command still persists... i expect you're using system version of python comes installed on mac default, isn't framework build . you'll want install version of python python.org framework builds. expect you'll want la...

java - Cannot see server.xml -

i have created liberty project in eclipse mars , pushed bluemix server. upon opening application files , logs , going app -> .liberty -> usr -> server , cannot see defaultserver folder or server.xml file. have tried bind services without success. please help. the location of liberty server , server.xml located in application 'files , logs' section under app -> wlp -> usr -> servers . folder should contain defaultserver (or own server name if pushed liberty server).

ios - How to remove observer defined without object and using block? -

within extension uiviewcontroller have method: func setupuserandcartbuttons() { let cartbarbuttonitem = uibarbuttonitem(image: dbcart.sharedcart().icon, style: .plain, target: self, action: selector("cartbuttontapped:")) nsnotificationcenter.defaultcenter().addobserverforname(dborderschangednotficationname, object: nil, queue: nil, usingblock: { [weak self] notification in print("---->\(self!.classforcoder)") cartbarbuttonitem.image = dbcart.sharedcart().icon }) } i use change image uibarbuttonitem . this how push notification: nsnotificationcenter.defaultcenter().postnotificationname(dborderschangednotficationname, object: nil) for every controller, within deinit, need remove observer: nsnotificationcenter.defaultcenter().removeobserver(self, name: dborderschangednotficationname, object: nil) but doesn't work: when push notification , deinit never called (what means never pop controller stack) looks ok, no ...

Keep text block in view while scrolling in window phone 8.1 Runtime -

my problem similar article but need implement in wp8.1 runtime. want textblock (name=txt_latest_update) in view while scrolling here xaml code <grid name="root_content" background="#fff7fdf7"> <grid.rowdefinitions> <rowdefinition height="70"/> <rowdefinition height="*"/> </grid.rowdefinitions> <border grid.row="0" background="red"> <image source="/assets/nepaltoday.png" horizontalalignment="left" margin="10,0,0,0"/> </border> <scrollviewer grid.row="1" name="frontpage_scrollview" verticalscrollbarvisibility="visible" > <stackpanel> <grid> <grid.rowdefinitions> <rowdefinition height="300"/> <rowdefiniti...

javascript - window.onload after every navigation - bfcache in chrome -

in firefox can flush bfcache setting en empty function window.onunload. window.onunload = function(){}; like window.onload fire after every navigation page. i need behaviour in chrome(ium) well, doesn't work onunload event. how can achieve this?

ios - If I have a dispatch_sync call followed by a second dispatch call within a dispatch_async block, does it matter if that second call is sync or async? -

this code pretty standard situation i'm having data model potentially slow data retrieval , want update view data once data retrieval finishes. dispatch_queue_t queue = dispatch_get_global_queue(dispatch_queue_priority_default, 0); dispatch_async(queue, ^{ dispatch_sync(queue, ^{ //get bunch of data } dispatch_sync(dispatch_get_main_queue(), ^{ [viewcontroller tellviewtoreloaddata]; } } my question here is, make of difference if second dispatch_sync instead dispatch_async? this understanding of what's happening code above (i'm using opportunity gauge understanding of overall topic): the outer dispatch_async returns, , block 2 dispatch calls gets put concurrent queue. at point outer async block execute on random thread, @ point first dispatch_sync gets called , block gets put concurrent queue. at point inner first sync block execute of data gathering operations on random thread, , when finished first dispatch_sync return , seco...

css - Taming the automatic telephone number thing in the windows 10 edge browser -

windows 10's edge browser seems detect phone numbers if there's no phone app installed on system. it formats phone number in blue underline if it's in plain text somewhere (ugly on backgrounds), detects e.g. vat numbers if phone numbers. so how control webmasters to: how renders detected stuff (i suppose msft invented own css selector stuff?) how turn detection off preferably targeting browser , not risk messing things others or adding non-standard things otherwise valid code. edit: the suggested way turn detection off based on way done in ie11 windows phones not work in of tests. meta tag fails , non-standard html attribute seem work. i've looked @ inspect thing in edge , seems me computed css detected items 1 expect see there if not detected (i.e. computed css normal color , no underline), suggesting little chance of controlling how it's rendered. edit: test case 1: meta tag (fails) <!doctype html> <html xmlns="http:...

data binding - Generate Java Classes From API XSDs -

i'm working on flight api integration on company platform , i'm facing issues. need use data binding plugin in order generate java classes based on provided xsd files. nevertheless, have tried many plugins such adb, cxf or jibx , got binding errors of them. have been able fix these errors modifying xsds in order "eliminate" errors think i'll issues later due these changes. so question quite simple, has of been able find plugin able handle xsds ? thanks ! you need use jaxb generate java classes xml schema ,please check so question . if want specific plugin ide please check intellij idea , eclipse .

c# - Type or namespace name 'OwinStartupAttribute' could not be found -

error the type or namespace name 'owinstartupattribute' not found type or namespace name 'owinstartup' not found code using microsoft.owin; using owin; [assembly: owinstartup(typeof(employee.web.models.startup))] namespace employee.web.models.startup { public class startup { public void configuration(iappbuilder app) { app.mapsignalr(); } } } any appreciated. using: .net 4.0 mvc 4 microsoft.aspnet.signalr.systemweb (1.1.0.0) microsoft.owin (2.1.0.0) microsoft.owin.host.systemweb (2.1.0.0) owin (1.0.0.0) visual studio 2013 installed singlar after referencing microsoft.owin using command install-package microsoft.aspnet.signalr -version 1.1.3 update: removed [assembly:.. , added in web.config: <add key="owin:appstartup" value="employee.web.models.startup" /> the error says 'owin.iappbuilder' not contain definition 'mapsignalr' , no extens...

ios - Two table views in view controller: Swift -

i have uitableview prototype cells takes whole page. have uibutton on bottom should display pop-up static uitableview when tapped. i'm struggling account pop-up table view in cellforrowatindexpath . func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let result: uitableviewcell if tableview == self.tableview { var cell = self.tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) as! uitableviewcell cell.textlabel!.text = array[indexpath.row] result = cell } else if tableview == self.popuptableview { var popupcell = self.popuptableview.dequeuereusablecellwithidentifier("popupcell", forindexpath: indexpath) as! uitableviewcell popupcell.textlabel!.text = popuparray[indexpath.row] result = popupcell } return result } i'm getting error @ return res...

Deploying TypeScript to Azure - Your project file uses a different version of the TypeScript compiler -

i've been working typescript 1.4 , vs2013 update 4 on project deploys via cd windows azure. this working happily til yesterday, today i'm getting following error seem relate version of typescript tools on azure build server: 4>c:\program files (x86)\msbuild\microsoft\visualstudio\v14.0\typescript\microsoft.typescript.targets(103,5): error : project file uses different version of typescript compiler , tools installed on machine. no compiler found @ c:\program files (x86)\microsoft sdks\typescript\1.4\1.4\tsc.exe. may able fix problem changing <typescripttoolsversion> element in project file. [d:\a\src\myproject\myproject.web\myproject.web.csproj] 4>c:\program files (x86)\msbuild\microsoft\visualstudio\v14.0\typescript\microsoft.typescript.targets(103,5): error msb6004: specified task executable location "c:\program files (x86)\microsoft sdks\typescript\1.4\1.4\tsc.exe" invalid. [d:\a\src\myproject\myproject.web\myproject.web.csproj] 4>done b...

php - Adding custom field from Easy Property Listing Wordpress plugin -

i'm using easy property listings wordpress plugin ( http://easypropertylistings.com.au/ ) , i'm setting custom fields. have managed working in cms field shows , can input data using following: function listings_callback($meta_fields) { $custom_field = array( 'id' => 'epl-property-listing-custom-data-id', 'label' => __('listing details', 'epl'), 'post_type' => array('property'), 'context' => 'normal', 'priority' => 'default', 'groups' => array( array( 'id' => 'property_listing_lot_width', 'columns' => '1', 'label' => 'lot width', 'fields' => array( array( 'name' =...

javascript - Testing a React component - determining where the functionality should be tested -

i extremely new testing in general, not react testing, i'm still trying figure out not how test, what test. here login callback gets called on submit of form: login() { let typedusername = react.finddomnode(this.refs.username).value; if (!typedusername) { return this.setstate({ errored: true }); } // don't send request here, set username on authmodel , call `login` method below authmodel.set('username', typedusername); authmodel.login(); }, authmodel backbone.js model. question, lets it's external module i'm importing login.jsx component. i'm writing test see if username typed, authmodel.login() gets called. want test in test.login.js test file, test in test.authmodel.js test file? it('calls login when there\'s username present', () => { react.finddomnode(loginelement.refs.username).value = 'foo'; testutils.simulate.submit(form); // not sure direction...

C++ fstream writing to file very slow -

i have 2d world in game consisting of tiles. whenever make new world initialize array of 48 million tiles short worldgrid[48000000]; i set value 48 million, write values file this: std::fstream save("game_save", std::fstream::out); (int x = 0; x < 48000000; x++) { save << world.worldgrid[x]; save << " "; } save.close(); it's 48 million values, each 1 2 bytes. 96 million bytes, or 96 megabtyes. problem process inside loop alone takes 2 minutes complete on ssd. don't feel should take 2 minutes , 5 seconds write 96mb worth of data onto file. if has advice i'd appreciate it. try writing array @ once, instead of 2 bytes-at-a-time.. like: save.write(world.worldgrid, sizeof(worldgrid)); see the docs

c++ - Getting a time difference in milliseconds -

i´m trying thought simple have looked everywhere , can´t figure out. i´m new c++ , have no understanding of templates , such. i need function measures time program´s launch point in milliseconds, like: class timecounter { private: long starttime; long currenttime; long timedifference; public: long gettime(); } timecounter::timecounter () { starttime = time.now(); } long timecounter::gettimepassed () { currenttime = time.now(); timedifference = timenow - timestart; return timedifference; } i´ve tried clock() / clocks_per_seconds result slower second. can me out? thank much! i writing similar system delta time game engine. using std::chrono library, here's example: #include <iostream> #include <chrono> #include <thread> class timer { // alias our types simplicity using clock = std::chrono::system_clock; using time_point_type = std::chrono::time_point ...

c# - Using azure stream analytics with power BI -

i have created stream analytic's job in azure. want use power bi output of stream job. seems azure accounts organizational id can used there. there workaround use azure stream analytic power bi using azure account without organizational ids? i believe there no workaround. power bi allows organizational ids login. are admin of default directory of azure active directory? create new user@mydirectory.onmicrosoft.com , sign free @ powerbi.com user. edit: today resolved limitation in azure stream analytics: http://blogs.msdn.com/b/streamanalytics/archive/2015/07/31/new-asa-features-service-bus-queues-and-topics-outputs-amp-power-bi-org-id-decoupled-from-azure-id.aspx

How to undo `git annex initremote` -

i used git annex initremote myrsync type=rsync rsyncurl=ssh://... encryption=none to initialise remote. however, when attempting git annex copy , errors like: rsync failed -- run git annex again resume file transfer failed copy ... (checking myrsync...) (to myrsync...) ssh: not resolve hostname ssh: name or service not known rsync: connection unexpectedly closed (0 bytes received far) [sender] rsync error: unexplained error (code 255) @ io.c(226) [sender=3.1.0] i'd undo initremote try again. found comment out [remote "myrsync"] entry in .git/config not sure if safe/correct way of doing things.

entity framework - EF two one to many relations, something get wrong -

what trying do: i have entity named 'department', , each department might have several translations different languages (e.g. "sales" on english, "sales" on german, etc). also, each 'department' have synonyms in either language. i want make number of available translations , synonyms flexible possible, since don't know ahead how translations or synonyms have each department. therefore, idea this: public class departmententity { public departments id { get; set; } public list<departmentnaming> names { get; set; } public list<departmentnaming> synonyms { get; set; } } public class departmentnaming { public int id { get; set; } public virtual departmententity department { get; set; } public string name { get; set; } public language language { get; set; } } this results ...

laravel - Specify controller & method to use in anonymous function of a route parameter? -

i'm checking out laravel. trying make use of wildcard route. 2nd parameter anonymous function. ideally i'd little bit of validation determine if it's valid wildcard option & specify controller & method use. route::get('lodging/{entrance}', function($entrance){ // validate if entrance 'north','south','east','west' // send controller & specific method return "entrance $entrance"; }); is appropriate place this? or should validation taken care of in controller , use format route: route::get('lodging/{entrance}', 'lodging@chooseentrance'); you can add simple validation route route::get('lodging/{entrance}', function(){ ... })->where('entrance', 'north|south|east|west'); see routing#parameters-regular-expression-constraints

objective c - iOS: How can i get location names of multiple longitudes and latitudes when data is coming from web service as a response? -

Image
i need code. getting longitudes , latitudes response web service. need convert them location name , show in respective table view cell label. following response, code , screen shot of view show converted city, country name, , correct code doing mistake. #import <uikit/uikit.h> #import "jobtableviewcell.h" #import "slidenavigationcontroller.h" #import <corelocation/corelocation.h> @interface jobpostedviewcontroller : uiviewcontroller <slidenavigationcontrollerdelegate, uitableviewdatasource, cllocationmanagerdelegate> @property (strong, nonatomic) nsarray* job_id; @property (strong, nonatomic) nsarray* assigned_user_id; @property (strong, nonatomic) nsarray* job_title; @property (strong, nonatomic) nsarray* job_description; @property (strong, nonatomic) nsarray* job_priority; @property (strong, nonatomic) nsstring* job_longitude; @property (strong, nonatomic) nsarray* date; @property (strong, nonatomic) nsstring* job_latitude; @proper...

javascript - Set a reset button to clear a specific single input of type text -

i have following: <div id="section1"> <label> label 1 </label> <br> <input type="text" id="input_section1"> <button type="reset" class="clear"></button> </div> this how html must remain structured. have other divs on page same above (called #section2, #section3 etc), , none of inputs within form. so want button reset specific input associated with; in case above, input '#input_section1'. at moment when click reset button clearing every input on page. you can use following jquery code using .siblings() : $(document).on('click','.clear',function(){ $(this).siblings( "input" ).val(''); }); this find input type sibling of current clicked element , reset it. see fiddle

Vehicle Object Array - C# -

i'm having trouble writing code. i'm not sure , how write constructors , accessors. the activity have this: write 3 derived classes allow user enter details of 3 types of vehicles attributes. • car (make, model, year, bodytype) • airplane (make, model, year, noengines, enginetype) • boat (make, model, year, length, hulltype) the 4th class base class vehicle contains shared attributes , methods make attributes either private (in derived classes) or protected (in base class) , write accessor methods each attribute. write 2 constructors each derived class. 1 no arguments , other accepts values of attributes in derived class arguments. write console application called fleet.cs creates , displays 2 of each vehicle type my code far follows: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace consoleapplication5 { class vehicle { static void main(string[] args) ...

php - mysql query for this -

hello mysql query output example... 'table 1 | id |date | | 1 |01/01/2015 | | 2 |01/02/2015 | | 3 |01/01/2015 | | 4 |01/02/2015 | 'table 2 |id |table1_id| value1| value2| value3|value4| | 1 | 1 | 5 | 2 | 4 | 4 | | 2 | 2 | 40 | 3 | 2 | 3 | | 3 | 3 | 5 | 2 | 4 | 5 | | 4 | 4 | | 4 | 2 | 3 | sample $result = ($value1 * $value2) + ($value3 + $value4); if($value1 == ""){ }else{ $result = ($value1 * $value2) + ($value3 + $value4); } sum same date... here's final output.... date finalvalue 01/01/2015 37 01/02/2015 125 thanks in advance.. i think want : select table1.date, sum(table2.value1)...

c# - System.Runtime.InteropServices.COMException: The device is not ready -

i using third party library(digitalofficepro) in c# app under hood use microsoft interop. app converts powerpoint presentation html files. in local environment works fine. on remote server receiving following error: 2015-07-30 11:46:00,584 [10] error mintra.publisher.documentconverter.core.presentation.conversion.htmlconversion.convert(:0) (null) - system.exception: error durign conversion of file '\virt-pub-stagin\converter_shared\ppt\beerenberg_manual0_cellglasscutting.ppt' output location 'd:\converter_shared\converted\ppt\beerenberg_manual0_cellglasscutting' retrowing! ---> system.runtime.interopservices.comexception: device not ready. ---> system.io.ioexception: device not ready. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.directory.internalcreatedirectory(string fullpath, string path, object dirsecurityobj, boolean checkhost) @ system.io.directory.internalcreatedirectoryhelper(string path, boo...

java - JavaFX Canvas - how to repaint a canvas after painting? -

i wrote code possible paint on javafx canvas. works fine don't know how repaint (like in swing) canvas start again painting on new canvas. here code , lot help! mario public class main extends application { private static final int width = 600; private static final int heigth = 400; @override public void start(stage primarystage) { //handling canvas final canvas canvas = new canvas(width, heigth); final graphicscontext gc = canvas.getgraphicscontext2d(); gc.setfill(color.aqua); gc.fill(); //painting mousedragged event canvas.setonmousedragged(event -> gc.filloval(event.getx(), event.gety(), 25, 25)); //user colorpicke color of painting colorpicker cp = new colorpicker(); cp.setonaction(e -> gc.setfill(cp.getvalue())); //layout borderpane root = new borderpane(); hbox hb = new hbox(30); button button = new button("clear all"); button.setonaction(e -> /*how repaint canvas*/ syst...

python - Getting the maximum accuracy for a binary probabilistic classifier in scikit-learn -

is there built-in function maximum accuracy binary probabilistic classifier in scikit-learn? e.g. maximum f1-score do: # aucpr precision, recall, thresholds = sklearn.metrics.precision_recall_curve(y_true, y_score) auprc = sklearn.metrics.auc(recall, precision) max_f1 = 0 r, p, t in zip(recall, precision, thresholds): if p + r == 0: continue if (2*p*r)/(p + r) > max_f1: max_f1 = (2*p*r)/(p + r) max_f1_threshold = t i compute maximum accuracy in similar fashion: accuracies = [] thresholds = np.arange(0,1,0.1) threshold in thresholds: y_pred = np.greater(y_score, threshold).astype(int) accuracy = sklearn.metrics.accuracy_score(y_true, y_pred) accuracies.append(accuracy) accuracies = np.array(accuracies) max_accuracy = accuracies.max() max_accuracy_threshold = thresholds[accuracies.argmax()] but wonder whether there built-in function. i started improve solution transforming thresholds = np.arange(0,1,0.1) smarter, dic...

javascript - PhoneGap catch 'Enter' pressed event for iPhone and android on anchor tag -

i want know how catch 'enter' pressed event using phonegap. i have form anchor tag. how catch when user has pressed "enter" in keyboard. have write javascrpt <head> <script language="javascript"> $("a.submit").click(function () { if(window.event.keycode == 13) { alert(window.event.keycode); } } </script></head> <body> <a id="submit" href="abc.html" class="abc"> </body>