Posts

Showing posts from July, 2012

How to load and play an audio file simultaneously using Javascript -

just can start playing youtube video part of has been loaded, want able play audio files. i'm using howler.js. var song = new howl({ src: mysrc, volume: myvol }); the problem whole audio file has loaded before starts playing. can issue users slow networks. how can achieve situation audio starts playing part of loaded, or without howler.js? howler.js defaults web audio api, must download full audio file on xhr before beginning playback. however, if force html5 audio begin playing able, if full file has downloaded: var song = new howl({ src: mysrc, volume: myvol, html5: true });

php - Best Practice for Laravel Asynchronous Requests -

i have laravel application. application loading fine, when make 3-10 api per page in controller. now, start see latency when start making 200 api requests per page in controller. since laravel mvc. all code in controller need executed , finished, , send data/variables view. leading lot of latency. i’m thinking perform apis call asynchronously, not sure 1 best move, i did quick search, found : php curl async: http://php.net/manual/en/function.curl-multi-init.php laravel async: https://laravel.com/docs/5.1/queues php promise: https://github.com/reactphp/promise any directions/suggestions on mean lot me, , others faced issue. explore using queues this. offload calls queue, await response. i recommend against 200 requests per page, seems excessive. perhaps start trying down before rearchitecting.

ios - My app is not fullscreen on iPhoneX -

Image
this question has answer here: seeing black bars @ top , bottom of iphone x simulator 3 answers on iphonex simulator app not fullscreen (see screenshot). do have idea why? i guess use lauchimage, need assign new lauchimage iphonex.

How can I set CG_CONTEXT_SHOW_BACKTRACE environmental variable in R? -

when execute following code on r: plot(x,fx(x),type="l",main="probability density function of x~uniform(-1,1)",xlab="x",ylab="f(x) (pdf of x)") i following red-warning message on screen, although plot showing: text_show_backtrace environmental variable. ktrace, please set cg_context_show_backtrace environmental variable. how can set cg_context_show_backtrace environmental variable on r? have seen several questions here applies xcode, there seem no similar question r. thank you,

android - Google Web Designer aligning text for multiple mobile devices -

i built banner ad, , when open disclaimer galaxy phone copy off box, works fine on iphone, familiar similar issues? http://creative.kmphdigital.com/larrymiller/cherokee300x250/ does if specify webfont disclaimer text? if don't specify webfont, os/browser/device default fallback system font. for example, on linux desktop, disclaimer text displayed in times new roman on chrome in dejavu serif on firefox. on firefox, text flows out of text box. on mac laptop, text displayed in times on chrome , times roman on firefox , appears fine in both. i hope helps.

Allure2 report not using allure.properties for @Issue -

in current setup have can have static allure.properties file located in allure-results folder. properties file holds value @issue environment variable , value. allure.link.issue.pattern=https://tfs.mytfs.com/tfs/_workitems?id\={} when generate report "allure generate --clean -o " not appear using allure.properties file populate @issue links correct value. instead link value blank , link redirects itself. i using updated @issue environment variable. think might due how generating report documentation states "simply generate report. default command line tool looking config in directory run command. can use allure_config environment variable specify path configuration". i not sure missing though run generate command results folder. not correct? since version allure 2 no need pass allure.properties file allure-results folder. need add test resources instead. here can find example https://github.com/allure-examples/allure-testng-example/blo

Python+Pandas - Determining Months of Inactivity -

Image
i have dataframe has: columns = "chronological months" index = "customer id's" data = "dollars spent customer" i want create new column indicates how many consecutive months each client has been inactive (with spent $ in recent month having 0 value). i'm interested in last 6 months. i can think of few ways inefficient (for example, string of if statements applied vectors), i'm hoping avoid them. image of i'm envisioning below. any appreciated. thanks! use bfill axis=1 (along columns) , isnull sum(axis=1) count in [14]: df.bfill(axis=1).isnull().sum(axis=1) out[14]: cusomter 1 5 cusomter 2 6 cusomter 3 1 cusomter 4 5 cusomter 5 0 cusomter 6 3 cusomter 7 6 cusomter 8 2 cusomter 9 3 cusomter 10 0 dtype: int64 in [15]: df['months of inactivity'] = df.bfill(axis=1).isnull().sum(axis=1) in [16]: df out[16]: jan feb mar april mat june months

javascript - Error trying to map a JSON object to a pojo using jackson mapper -

i've got pojo i've created populated json input. i'm running issue json i've got isn't matching pojo have can't figure out why. easy i'm not understanding basic structure of json. here's pojo: public class bears{ private string name; private list<toys> toys; // getters/setters omitted } and here's json. {"name":"1765665","toys":"[toy1,toy2,toy3]"} i'm creating json doing following javascript call: var bearjson = '${bearrows}'; var requestdata = { name: getname(), bearrows: bearjson }; any idea i'm missing?

php - The "replace" filter expects an array or "Traversable" as replace values, got "string" -

i'm using php 5.6 develop app want upgrade php 7.0. fact is, when build form app give me error: "replace" filter expects array or "traversable" replace values, got "string". error this code i'm using build form: <?php namespace pozo\metrajebundle\form; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolver; class metrajediariotype extends abstracttype { /** * @param formbuilderinterface $builder * @param array $options */ public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('metrosperforados', null, array('label'=>'commons.drillmt')) ->add('sidetrack', null, array('label'=>'commons.sidetrack')) ->add('descripcion', null, array( 'label' => '

python - call a specific module using the module name as an argument to the main program -

what achieve this. have series of small modules in there own module directory. each module supplies same function. import modules in main program. have main program called module name , have return value module. import worker_modules parser = argparse.argumentparser(description='download file through curl') parser.add_argument( 'module', help='module work on') args = parser.parse.args() module = args.module result = module.command(extra args not shown) the result fails thinks module has no attr command. is there way tho achieve - dont want dynamically load module want have built static file. you can @ imported modules using sys.modules import sys # parser code... module = args.module result = sys.modules[module].command() this allows import modules needed @ beginning without dynamically importing them. when module imported added sys.modules dict.

java - Spring MVC Sending Apache POI file to client browser from controller -

i'm attempting pass excel file have created apache poi client browser, triggers download on browser. i'm aware common issue, cannot seem figure out quite doing wrong in scenario. must small or logically incorrect. @restcontroller @requestmapping("/admin/home") @api(tags = {"site_endpoint"}) @responsebody public class filedownloadcontroller { private httpservletresponse servletresponse; @autowired public filedownloadcontroller(final httpservletresponse servletresponse) { this.servletresponse = servletresponse; } @requestmapping(value = "download/downloadpage/{param1}/pagenum/{param2}", method = requestmethod.get) public map<string, string> getbyasmsandcountrycode( @pathvariable final string param1, @pathvariable final string param2, httpservletresponse response){ // initialize worksheet here.. final workbook workbook = new hssfworkbook(); /

ruby - Fetching links from google search results -

i have code gives me title of search results of google search entry. i want links in "href" tag tag. example code <h3 class="r"><a href="https://www.lonelyplanet.com/india" onmousedown="return rwt(this,'','','','1','afqjcng5z2tyca5rni1x_vky3gt9bevs4w','','0ahukewi-99jmpqxwahuko48khdfqbciqtwiijzaa','','',event)" target="_blank">lonely planet india - india - lonely planet</a></h3> require 'mechanize' agent = mechanize.new page = agent.get("https://www.google.com/videohp") search_form = page.form('f') search_form.q = 'india' page = agent.submit(search_form) puts page.search('h3.r').map(&:text) page.search('h3.r a').map{|a| a['href']}

git - May I list the files of the current commit? -

imagine everytime commit files, before push them, i'd list them check. how may ? i tried: git ls-tree -r --name-only master git ls-files -stage if edit single file, add commit it. if try above codes, shows me files. i want list files pushed on current commit. git diff rescue on one. you'll use --name-only flag. contents of current commit, use command: #before stage git diff --name-only #staged changes before committing git diff --name-only --cached #after committing git diff --name-only head^ head if want see files pushing if there more 1 commit, you'll need specify current branch head , head on remote git diff --name-only remote/branch branch

validating html form with javascript -

basically want validate form, i'm trying document.getelementbyid(); not working can me , why not going way i'm trying. <form name="simple" action="post"> <label for="name"> name: </label> <input type="text" id="demo" class="form-control" onsubmit="validate();"><br> <label for="email"> e-mail: </label> <input type="email" id="email" class="form-control"><br> <label for="pwd"> password: </label> <input type="password" id="pwd" class="form-control"><br> <label for="phone"> phone: </label> <input type="text"

excel - How to get, ("fields") to Work in VBA-JSON -

summary i trying access deep levels of nested json comes api working @ moment. using vba-json through process has been pretty easy, i've ran little road block. part, i've got library work properly, error anytime try grab item nested in json response ( further 2 json levels ). going submit post, , i'll go , gather of error codes getting. off top of head, know run-time error '13' when try use code below doesn't work. think ( could wrong ) smart enough understand type mismatch error, don't know how fix it. this works for = 1 20 activesheet.cells(i + 1, 5) = json("issues")(i)("key") activesheet.cells(i + 1, 6) = json("issues")(i)("id") next doesn't work for = 1 20 activesheet.cells(i + 1, 7) = json("fields")(i)("summary") next none of these worked either activesheet.cells(i + 1, 7) = json("fields")(i)("summary") activesheet.cells(i + 1, 7) = json(&

scikit learn - Spatial Regularization -

is there way include spatial regularization penalty cost functions in scikit-learn clustering? more specifically, working neuroscience brain data, every voxels has spatially inherited dependency based on proximity. using 2-classes gaussian mixture learning, obtain, each voxel, probability score of being labeled '1' vs '0' (based on 30-ish samples). task pointless if cannot include regularization based on neighborhood, voxels not independents.

'numpy.float64' object has no attribute 'translate' Inserting value to Mysql in Python -

import dataset db = dataset.connect(....) table = db[...] when try insert value mysql table, error occurred. sample value inserting table: print("buy", ticker, price, date, otype, osize) buy aapl 93.4357142857 2016-05-12 market 200 data = dict(order_side='buy',ticker=ticker, price=price, order_date= date, order_type = otype, volume = osize ) table.insert(data) error message: traceback (most recent call last): file "<ipython-input-3-b7ab0c98f72f>", line 1, in <module> runfile('c:/users/swigeluser/documents/github/trading/strategies/strat_ma_exectest.py', wdir='c:/users/swigeluser/documents/github/trading/strategies') file "c:\users\swigeluser\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile execfile(filename, namespace) file "c:\users\swigeluser\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 10

c# - Prevent svcutil.exe from adding data annotations -

i have wsdl , xsd represents service need implement. understanding should use svcutil /sc option generate interface. while understand there benefit data annotations automatically generated, have use case end needing remove them manually. can prevent these being generated in first place? ideally i'd plain ol' imyservice class.

java - How to render Paragraph in vertical cell in itext7? -

Image
i want build table headers in itext7. : here code : package utils; import datamodels.ishvaxtidata; import com.itextpdf.io.font.fontconstants; import com.itextpdf.kernel.color.color; import com.itextpdf.kernel.events.event; import com.itextpdf.kernel.events.ieventhandler; import com.itextpdf.kernel.events.pdfdocumentevent; import com.itextpdf.kernel.font.pdffont; import com.itextpdf.kernel.font.pdffontfactory; import com.itextpdf.kernel.geom.pagesize; import com.itextpdf.kernel.geom.rectangle; import com.itextpdf.kernel.pdf.pdfdocument; import com.itextpdf.kernel.pdf.pdfname; import com.itextpdf.kernel.pdf.pdfnumber; import com.itextpdf.kernel.pdf.pdfwriter; import com.itextpdf.kernel.pdf.canvas.pdfcanvas; import com.itextpdf.kernel.pdf.canvas.pdfcanvasconstants; import com.itextpdf.kernel.pdf.xobject.pdfformxobject; import com.itextpdf.layout.canvas; import com.itextpdf.layout.document; import com.itextpdf.layout.style; import com.itextpdf.layout.border.border; import com.

html - Input button in modal not submitting external form -

i have created inline formset django. once form filled out , user clicks submit have coded in bootstrap modal pops reminder. footer of modal contains html input external form can submitted modal. the problem having submit buttons not submit form can saved database , emailed. there way accomplish using modal? template: {% extends "reports/base.html" %} {% load static %} {% block body_block %} <font color="green"> <h4 >company</h4> </font> <h3>please enter nightly reports in form below.</h3> <br> <p>if add new line category, select <font color="blue">add new line item</font> under each category. when finished, click on <strong><font color="gray">save , email corporate</font></strong> button @ bottom of form.</h4> once form sent, form refresh information have entered. if notice error after sent form, edit error , click <strong><fon

C++ avoid casting in derived class code for twin container/contained object design -

i have twin base classes container class , contained object (in case, generic graph class made of linked nodes, guess question stand in cases want derive both container class , contained object class twin container/contained base classes). want use derived classes of both container , contained object. how avoid having downcast contained object derived contained object type when access container of derived container class? // class represents graph template <typename wrappedobject> class basegraph { ... // constructor, virtual destructor, ... public: std::map<wrappedobject*, basenode<wrappedobject> *> obj_to_node_map_; bool addedge(wrappedobject *scr, wrappedobject *trg) { basenode<wrappedobject > * srcnode = getorcreatenode(src); basenode<wrappedobject > * dstnode = getorcreatenode(trg); return addedge(srcnode, dstnode); } bool addedge(basenode<wrappedobject> * src, basenode<wrappedobject> * trg) { if (src == t

Sharepoint 2013 Workflow - need to add item to another list -

i've created new list. when books travel on first list , in group permission on new list need travel information added new list. the workflow have travel list doesn't appear have option of adding same information new list. there dropdown multiple list choices none new list i've created. is not possible? has seen tutorial? if second list in different site collection first list, need use web service call in order update second list.

detect problematic process which affects system load but not cpu -

i have system contains application server multiple processes (this cannot changed... product i'm testing). when check system load, can see on 32 hyperthreads load of above 32 when @ cpu utilization, see less 30% cpu user time usage , system time below 5%. this means processes affect load in task_uninterruptible sleep waiting io (since system load metric takes account task_runnable , task_untinterruptible processes, meaning, processes either running, waiting run , ready, or waiting on lock io in uninterruptible sleep) what fastest way detect processes cause system load soar high? tried ps -e v, got lost there... many processes (over 1000....) can't make whats output.

python - Incrementing contiguous positive groups in array/Series -

suppose have pandas series of boolean values so. vals = pd.series([0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1]).astype(bool) >>> vals 0 false 1 false 2 false 3 true 4 true 5 true 6 true 7 false 8 false 9 true 10 true 11 false 12 true 13 true 14 true dtype: bool i want turn boolean series series each group of 1's enumerated, 0 0 1 0 2 0 3 1 4 1 5 1 6 1 7 0 8 0 9 2 10 2 11 0 12 3 13 3 14 3 how can efficiently ? i have been able manually, looping on series on python level , incrementing, slow. i'm looking vectorized solution - saw this answer unutbu concerning splitting on increasing groups in numpy, , trying work cumsum of sort have been unsuccessful far. you can try this: vals.astype(int).diff().fillna(vals.iloc[0]).eq(1).cumsum().where(vals, 0) #0 0 #1 0 #2 0 #3 1 #4 1 #5 1 #6 1 #7 0 #8

object - javascript getProperty -

this question has answer here: dynamically access object property using variable 10 answers i'm complete beginner in regards javascript , coding in general. i'm planning attend coding boot camp soon, part of requirements entry need learn basics first. i've been getting through first few problems in regards if/else quite easily, ran 1 requires me return value that's assigned key . function called getproperty , i'm stuck. unfortunately, each of other questions build on know 1 concept such as: addproperty , removeproperty . appreciated allow me continue studies! below have currently. keeps returning "should return value of property located in object @ passed in key" every time try run test on code. i know question simple solve, there many online resources clear answer. var obj = {key: 'value'}; function getproperty(o

javascript - mouseover/mouseout events with ajax requests -

this question has answer here: jquery mouseover , mouseout bug 1 answer i ran issue , wish top ideas here. here how code looks like: $(document).on('mouseover', '#element', function(){ $.ajax({ // generate hover view }) }); $(document).on('mouseout', '#element', function(){ // remove hover view }); the correct execution order mouseover - generate view - mouseout - hide view. however since view part depends on ajax, there chance mouseout event gets fired before ajax call finishes if user hovers super fast. in case, after ajax call completed, view going sit in dom without going away, since mouseout event fired. did try using promises? need tweaked like: $.when( $.ajax( "someajaxfile.txt" ) ).then(function( data, textstatus, jqxhr ) { $(document).on('mouseout', '#element&#

How to update Google Shared Contacts (External contacts) -

i'm new working google apis, , i'm finding lot of documentation out-of-date, , no longer seems match current g-suite admin portal. specifically, need work shared contacts api, need able add , remove external contacts our global directory (global address list). of documentation i'm reading points "shared contacts api", cannot find in api directory (even when logged in domain administrator in g-suite). is handled newer api? can please point me in right direction getting started this? more detailed better, including setting api access (credentials), etc. the goal have program (python now, replaced node.js) can used internally our staff add/remove external contacts our g-suite contact directory. thanks much, bill here developer's guide started. the shared contacts api allows client applications retrieve , update external contacts shared users in google apps domain. shared contacts visible users of apps domain , google servic

html - How to use correctly the og meta tags for sharing GIFs on facebook -

Image
i trying share link page in facebook in order generate gif (with rounded gif symbol) using og meta tags: <meta content="width=device-width, initial-scale=1" name="viewport" /> <meta property="og:url" content="https://i.giphy.com/yuxbch37iz5ao.gif" /> <meta content="video.other" property="og:type" /> <meta property="og:image" content="https://i.giphy.com/yuxbch37iz5ao.gif" /> <meta content="image/gif" property="og:image:type" /> <meta property="og:image:width" content="384" /> <meta property="og:image:height" content="480" /> <meta content="991618354275198" property="fb:app_id" /> <meta content="crazygifs" property="og:site_name" /> and resu

edi - BizTalk message box full of BTXTimerMessage messages -

we using biztalk (2013 r2 cu 6) edi functionality batch edi files. uses microsoft.biztalk.edi.batchingorchestration.batchingservice orchestration running in waiting state (for lack of better term), dehydrated of time. while running orchestration builds instances of btxtimermessages in queued (awaiting processing) state. these messages never removed or processed, can tell. causes pass 50k message threshold , start throttling. as far can tell there no way setup reoccurring schedule batcher, must run or manually started. if leave batcher off there routing errors. currently way have eliminate these messages terminate edi batcher each party, restart it. is there better way purge these messages system, or stop them being generated together?

python - How to convert text file with two columns to fasta format -

i kind of confused bit of code. have testfile.txt sclsc1_3349_ss1g_09805t0 ttgcgatctatgccgacgttcca sclsc1_8695_ss1g_14118t0 atggtttcggc sclsc1_12154_ss1g_05183t0 atggtttcggc sclsc1_317_ss1g_00317t0 atggtttcggc sclsc1_10094_ss1g_03122t0 atggtttcggc i want convert file format ( fasta ) below: >sclsc1_3349_ss1g_09805t0 ttgcgatctatgccgacgttcca >sclsc1_8695_ss1g_14118t0 atggtttcggc >sclsc1_12154_ss1g_05183t0 atggtttcggc >sclsc1_317_ss1g_00317t0 atggtttcggc >sclsc1_10094_ss1g_03122t0 atggtttcggc here python code (run like: python mycode.py testfile.txt outputfile.txt , not output result wanted. can please me correct code? thanks! import sys #file input fileinput = open(sys.argv[1], "r") #file output fileoutput = open(sys.argv[2], "w") #seq count count = 1 ; #loop through each line in input file print "converting fasta..." strline in fileinput: #strip endline character each input line st

javascript - Detect ul list content change jQuery -

we have unordered list id #some-list. in our backbone implementation, when data returned, list entries rendered , appended list , list displayed. we want detect when such change completed using jquery. used $(#some-list).ready() , $(#some-list).load() , looks not working. what ways capture such change? shed lights here? well didn't post code it's hard see guess fail. in general trigger custom event on ajax callback (you use ajax content , appending list right?). for example: loaddata(){ // invoke ajax request var def = $.get(...); def.then(function(result){ // $(#ul) append(result) ... // trigger custom event $(document).trigger('listrendred'); }); } now on different place or script can listen it: $(document).on('listrendred', function(e){ // ever... })

sql server 2008 - is this possible in SQL to locate where actual data sits? -

hi don't know possible. maybe, i want locate column within table, if has data: 'ready' - issue facing application appointment table holds person scheduled appt. under date_created , operator_id. but not show in table confirmed appointment. however, in screen application there 1 entry states 'ready' considered confirmation. but cannot locate table might in. (and code somewhere see 'ready' data, ) trying accomplish, there way? not column name begin 'ready' actual data. there quite few ways can follow, here quick , easy 1 can suggest. run sql profile, ui operations , see sql queries or stored proc use, stop profiler , pick queries, , can make sense out of it. this better building giant query using sys.tables or sys.columns , running heavy operation on non index columns. and remember, in ui see datatransformation in database, "r" status, on ui transformed "ready" ; or value derived on fly based on oth

python - How to set conditions for valid dates? -

this question has answer here: how validate date string format in python? 5 answers in python, how check if date valid? 6 answers i'm reformatting date inputs , part of using try/except function kick out invalid inputs. part of requires me set conditions is/is not valid date. example, 2017 did not have leap year, input '29-02-2017' invalid. example '31/09/2010', since september not have 31st. furthermore, '131/09/2020' invalid because of digits in day. catch drift. a colleague mentioned created elaborate list conditions each month of year, i'm wondering if there way simplify process. if want validate format of date (i.e. ensure single format such 01/02/99) can use from datetime import datetime datetime_object = datetime.strptime(your

sql server - Pivot Tables in visual basic -

Image
i hope find because i'm lost on here. have code generates pivot table dataset, need pivot table have 4 calculated fields wich has; problem when fields displayed in excel document displayed in rows , need display in columns. once excel file generated , if drag fields in correct way displays in columns how need displayed catches attention area of fields in excel file have field named "values" in row areas putting columns , columns fixed here can take of have explained above by way don't have experience pivottables following example in same project else made, difference file example generates need 1 calculated field, i'll leave code generate pivot table bellow if _dsdatos.tables.count > 0 dim xlapp object = createobject("excel.application") dim xlwbook object = xlapp.workbooks.add() each dt datatable in _dsdatos.tables dim col, row integer dim rawdata(dt.rows.count, dt.columns.count - 1) object 'i u

excel - Excel2013/VBA 3dChart RotationX -

i have 3d chart on worksheet , trying make rotate along x-axis using vba. once have can rotate spinner or timer... the problem threed.rotationx property seems read-only. can set value has no affect on chart , if re-read value still shows zero. any idea how solve this? thanks dim prevvalue integer sub spnchart_change() activesheet.shapes("spnchart").controlformat if .value = 360 .value = 0 else if .value = 0 , prevvalue = 0 .value = 350 end if 'the following line had no effect! activesheet.shapes("chtmain").threed.rotationx = -.value 'this prints 0 debug.print activesheet.shapes("chtmain").threed.rotationx prevvalue = .value end end sub

Get some text with CURL and parse only the variables inside with PHP -

php getting external text variable curl domain like: https://somedomain.com/file.txt this file.txt contains text , variables inside like: welcome our $storename store, $customername our store located @ $storeaddress in somewhere. you see text contains variables inside. when text in php file in domain like: https://example.com/emailer.php this emailer.php file is: <?php # defining variables use in text acquire: $storename = "candy"; $customername = "william"; $storeaddress = "123 store street"; # text domain: $curl = curl_init(); curl_setopt($curl, curlopt_url, "https://somedomain.com/file.txt"); curl_setopt($curl, curlopt_returntransfer, true); $result = curl_exec($curl); echo "$result"; actual result: welcome our $storename store, $customername our store located @ $storeaddress in somewhere. expected result: welcome our candy store, william our store located @ 123 stor

javascript - Plupload resize to minimal dimensions -

i'm having same problem people in unresolved thread http://www.plupload.com/punbb/viewtopic.php?id=82 i need resize pohotos minimal possible dimensions , preserve aspect ratio. lets set resize width , height 400x400. when pass in image of 800x600, want new dimensions 533x400 , not current 400x300. does plupload has option such "minimal sizes" or kind of "fill" option? couldn't find in docs. since upload 1 photo @ time quite overcome absence of such option calculating dimensions manualy in filesadded event , updating resize options accordingly. thought there might cleaner way already.

java - Apfloat writeTo() method not outputting to file -

i trying use apfloat library project , having trouble getting apfloat's output text file. trying code such as try { apfloat.one.writeto(new filewriter(new file("test.txt")), true); } catch (apfloatruntimeexception | ioexception e) { // todo auto-generated catch block e.printstacktrace(); } it creates file empty every time. have tried use printwriter did not work either.

apache spark - set outputCommitterClass property in hadoop2 -

i have been researching problem past few weeks, , didn't find clear answer. here problem: for hadoop1x (in mapred lib), use customized output committer using: spark.conf.set( "spark.hadoop.mapred.output.committer.class", "some committer" ) or calling jobconf.setoutputcommitter . however, hadoop2x (in mapreduce lib), gets committer outputformat.getoutputcommitter , there no clear answer on how setoutputcommitter . i found databricks set output committer using property, spark.hadoop.spark.sql.sources.outputcommitterclass . i tried netflix's s3 committer( com.netflix.bdp.s3.s3directoryoutputcommitter ), in log, spark still uses default committer: 17/09/13 22:39:36 info fileoutputcommitter: file output committer algorithm version 2 17/09/13 22:39:36 info directfileoutputcommitter: nothing clean since no temporary files written. 17/09/13 22:39:36 info csemultipartuploadoutputstream: close closed:false s3://xxxx/testtable3/.hive-staging

Visual Studio 2017 - Compiling C++ with older MSVC SDK -

with visual studio 2017, have several ways launch compilation within ide window. there's build menu, built-in command prompt, , cmake integration visual studio 2017 launches cmake. the command prompt , cmake integration allow users launch compilation older versions of msvc. example, using cmakesettings.json , users can specify generator version 14 so: "generator": "visual studio 14 2015" unfortunately, there's fundamental problem in visual studio 2017 window , child processes automatically populated environment variables compiling version 15: equivalent of running vcvarsall.bat . this problem because in microsoft document, recommendation not run vcvarsall.bat version once version of script has been run once in process. avoid conflicts between variables different versions. if current version of visual c++ installed on computer has previous version of visual c++, should not run vcvars32.bat different versions in same command window. https

Best substitute for GOTO in Python -

i want make risc-16 simulator in python, , instruction set requires jump (as do). now, number of program lines there 16 bits, that's 256 unique lines of instructions, , if/elif statement extremely stupid. what best way able access code lines (i.e. jump)? the instruction 1 line, well-defined op() function, how access specific code lines? alternately write code in txt file , turn string statement?

unity3d - How Stop movement of thirdpersoncontroller in Untiy C# -

well need know how stop movement of thirdpersoncontroller in unity , person controller default character of unity . try different methods , codes doesn't work. well in summary character talk other character , appears dialogue of text in screen , in moment need stop movement of character or disable keys movement character. please me , thanks... in thirdpersoncharacter, try use following method. public bool isstop; public void move(vector3 move, bool crouch, bool jump) { if (isstop) { m_rigidbody.velocity = vector3.zero; return; } ... } the bool test. in computer, works. hope can help.

javascript - How to get PhpStorm to recognise a function only used in a separate ts file -

i'm working on production code , there .js file function defined in used in .ts file. .ts file has working /// <reference path="..."/> .js file, , when ctrl -click on function call in .ts file, takes me straight function definition in .js file. however, in .js file, function reported unused function ... . i'd able both fix warning (without disabling it), , ctrl -click on function definition find of uses. when that, says no usages found in project files . phpstorm has linked .ts file .js file, how recognise .js file linked .ts file?

ios - Converting an NSColor to a UIColor from an NSAttributedString -

i trying check colour of specific words in attributed string. can access attribute can't convert attribute dictionary uicolor. first enumerate on attributed string, returns, each different attributed, dictionary of attributes. can closer @ each. nsattributedstring * attributes = self.textview.attributedtext; [attributes enumerateattributesinrange:nsmakerange(0, attributes.length) options:0 usingblock:^(nsdictionary<nsstring *,id> * _nonnull attrs, nsrange range, bool * _nonnull stop) { }]; when return attrs dictionary (with hkwmentionattributename being subclass using): { hkwmentionattributename = "<0x610000243450> (hkwmentionsattribute) text: abc name 1, id: uy5vv8qzbxhpob8jtxubebmtaed3, no range"; nscolor = "uiextendedsrgbcolorspace 1 0 0 1"; nsfont = "<uictfont: 0x7fd388558ce0> font-family: \".sfuitext\"; font-weight: normal; font-style: normal; font-size: 19.00pt"; } i access color attrs[@&qu