Posts

Showing posts from February, 2015

c++ - how" set jump" and "long jump" differs from "try catch" in stack pointer modification? -

there discussion on difference between how setjmp , longjmp , "try catch" handles allocation on stack. after jump routines finishes restore stack pointer do have in same context or same function block happen when have function call in "try" section of "try catch" after call stack pointer returned if got catch section exception.

python 3.x - pandas SettingWithCopyWarning, returning view vs copy -

i quite confused when settingwithcopywarning raised. example: import pandas pd df0 = pd.dataframe([["fruit", "apple", 12, 0.3], ["fruit", "orange", 23, 0.2], ["dairy", "milk", 4, 1], ["dairy", "cheese", 1.0, 9.5], ["meat", "pork", 8, 11], ["meat", "buffalo", 2, 18], ["fruit", "strawberry", 45, 2.2]], columns=["type", "item", "quantity", "price"]) df1 = df0.loc[df0.loc[:, "price"] < 10, ["type", "item", "price"]] # copy(?) df2 = df0.loc[df0.loc[:, "price"] < 10] # copy, maybe not case? df1.loc[1, "item"] = "banana" # works fine df2.loc[1, "item"] = "banana" # raises...

java - Change string place android studio -

i've got: txtlistchild.settext(preferenceconnector.readstring(_context, preferenceconnector.countrysymbol, " $") + offeramt /*+ " " + this._listdataheader.get(groupposition)*/); which giving example pln50 . how change it, 50 pln ? please me guys! change order in string s concatenated: txtlistchild.settext(offeramt +" "+ preferenceconnector.readstring(_context, preferenceconnector.countrysymbol, "$"))

c++ - How to print a nested map-map-vector -

i having issues loading , printing map-map-vector data structure. think it's on printing side, since not 100% sure how use iterators. i created , loaded data structure store data here: (i created inner_test , myvector because looked needed them iterators. i'm not sure how iterators know inner_test , myvector part of test though.) map<int, map<string, vector<string>>> test; map<string, vector<string>> inner_test; vector<string> myvector; ifstream thisfile; const char *file1 = argv[1]; thisfile.open(file1); string filler; while( thisfile >> filler ){ string sortedfiller = filler; sort(sortedfiller.begin(), sortedfiller.end()); test[filler.length()][sortedfiller].push_back(filler); } thisfile.close(); i tried print this, don't think quite understand i'm doing here. map<int, map<string, vector<string>>>::iterator itr1; map<string, vector<string>>::iterator itr2; vector<strin...

web - Is there Axure RP alternative -

i'm wondering, if there axure rp alternative better price. used other apps, ended axure rp because of 2 fundamental advantages: it's not wireframe tool, lets me prototype whole web/app functional demonstrations it generates/exports prototype , customers can try personaly (it's html site , upload server , clients email link follow) so, there else axure rp meeting 2 criteria better price? apps i've seen fail in second condition. you can use moqups.com , it's web app. lets make prototypes linked pages , more . lets share design through url on site.

android - update percentage to reclyerview -

i'm developing chat app using xmpp (samck).i have showed conversation using reclycerview. want show percentage while image uploading server(using rest api). used intentservice , update percentage through localbroastreceiver. couldn't able scroll reclycerview. couldn't able show percentage on image. please give comments. progressrequestbody.java percentage have used class. public class progressrequestbody extends requestbody { private file mfile; private string mpath; private string stanzaid; private uploadcallbacks mlistener; private static final int default_buffer_size = 2048; public interface uploadcallbacks { void onprogressupdate(int percentage,string standzid); void onerror(); void onfinish(); } public progressrequestbody(final file file, string stanzaid, final uploadcallbacks li...

In HTTP connection pooling, What happened to write_buffer in case receiver gets time out -

most of use httpclient , connection pooling connection gets reused multiple client thread. now if 1 client gets read-timeout, releases connection pool may used other threads. but curious know happens @ server side. server still processing request , may try write data write_buffer. since connection not closed, how write_buffer gets cleared before other request comes in using same tcp connection. what happens server worker thread , write_buffer when reader gets timeout. does reader(httpclient) interrupt or send ack server when gets timeout.

sass - How to get webpack to inline css into the generated html file -

i'm trying webpack inline scss generated html file use app-shell css. the idea webpack bundle scss file ending in '-file.scss' css file , inline scss in files ending '-shell.scss'. this way app-shell style before react or else loads. by inline mean put in style tags in generated html file. the css part of webpack is: { test: /\.css$/, include: [paths.appsrc, paths.appnodemodules], // disable autoprefixer in css-loader itself: // https://github.com/webpack/css-loader/issues/281 // have postcss. loader: extracttextplugin.extract('style', 'css?-autoprefixer!postcss') }, { test: /-shell\.scss$/, include: paths.appsrc, loaders: ['style', 'css', 'sass'], }, { test: /-file\.scss$/, include: paths.appsrc, loader: extracttextplugin.extract('...

text processing - linear table to matrix format -

i convert linear table matrix format. my input table looks , called "linear_table.tab": transcript ortho transcript_1 ortho_1 transcript_2 ortho_2 transcript_3 ortho_3 transcript_4 ortho_4 transcript_5 ortho_5 transcript_6 ortho_6 transcript_7 ortho_5 transcript_8 ortho_1 transcript_9 ortho_4 transcript_10 ortho_5 transcript_11 ortho_2 transcript_12 ortho_7 transcript_13 ortho_8 transcript_14 ortho_5 transcript_15 ortho_2 transcript_16 ortho_9 what matrix table like: transcript_1 transcript_2 transcript_3 transcript_4 transcript_5 transcript_6 transcript_7 transcript_8 transcript_9 transcript_10 transcript_11 transcript_12 transcript_13 transcript_14 transcript_15 transcript_16 transcript_1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 transcript_2 0 0 0 0 0 0 0 0 0 0 1 0 0 0 ...

java - Using Protocol Buffers and Netty 4.1.6 -

i have following server , client initializers (both have extremely similar code sch changes cch client, both representing respective handlers). @override public void initchannel(socketchannel ch) throws exception { ch.pipeline().addlast("handler", sch); ch.pipeline().addlast(new commonclasshandler()); ch.pipeline().addlast("framedecoder", new protobufvarint32framedecoder()); ch.pipeline().addlast("protobufdecoder", new protobufdecoder(server.mymessage.getdefaultinstance())); ch.pipeline().addlast("frameencoder", new protobufvarint32lengthfieldprepender()); ch.pipeline().addlast("protobufencoder", new protobufencoder()); } i wish use binary format when sending commands/actions client or server, therefore, i'm using google's protocol buffers . here create builder when dealing client's input: while (channel.isopen()) { ...

sql - MySQL 5.7 GENERATED ALWAYS column defined as subquery -

i can't seem find issue query. have 4 tables: agency_info equipment_taken equipment_weight mission_overview in mission_overview column totalweightinkg , want calculated selecting equipment_taken.qty (which int), , equipment_weight.equipweightinkg (which float), , multiply them. so far have column definition: float generated (select qty, equpweightinkg, (qty*equpweightinkg) totalweightinkg equipment_taken, equipment_weight) stored ; i can't head around it... read documentation on select queries , joins still can't seem come right query... https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html says: subqueries, parameters, variables, stored functions, , user-defined functions not permitted. to you're trying do, you'll have write triggers before insert , before update query other tables , populate float column.

java - Dynamically creating file inside the deployed war -

inside web-inf folder have added new folder , code dynamically creates file when have tested in local. but when entire project exported war file , deployed inside server, file not getting created.while hitting server,i trying access file throwing exception. i using weblogic server, spring project. please suggest me resolution.

r - reshaping a data frame duplicating IDs -

this question has answer here: reshaping multiple sets of measurement columns (wide format) single columns (long format) 4 answers this dataframe: df <- data.frame(id = c(1,2,3), a1 = c("a1","a3","a5"), b1 = c("b1","b3","b5"), a2 = c("a2","a4","a6"), b2 = c("b2","b4","b6")) and result want this: id b 1 1 a1 b1 2 1 a2 b2 3 2 a3 b3 4 2 a4 b4 5 3 a5 b5 6 3 a6 b6 i tried approach solution, had no luck. we can use melt data.table can take multiple measure patterns convert 'wide' 'long' format. library(data.table) melt(setdt(df), measure = patterns("^a", "^b"), value.name = c("a", "b"))[, variable := null][order(id)] # id b #1: 1 a1 b1 #2: 1 a2...

java - Is it correct to use CallableStatement in JSF -

i'm still learning jsf in past created project using swing jdbc , mysql rdbms . right i'm working on web project become more familiar jsf . most of examples saw online used preparedstatement , haven't seen used callablestatement i asked because think i'll need use sql transactions perform tasks. so, callablestatement me , used callablestatement in past. also, noticed in examples saw, never used try-with-resources syntax has auto-closing of resources consider method below. public void register() throws sqlexception{ string myfirstname = this.getfirstname(); string mylastname = this.getlastname(); string mymiddlename = this.getmiddlename(); string myemail = this.getemail(); try{ context context = new initialcontext(); datasource = (datasource)context.lookup("java:comp/env/jdbc/mydb"); }catch(namingexception e){ e.printstacktrace(); } if(...

java - Using WebElements from PageFactory POMs in my test class -

basically, make assertion (from test class) webelement contains text(). since of webelements defined in page.class, think have make them public this. i running few problems webdriver , elements, , think may because multiple test classes accessing webelements page class simultaneously. question is: there reason webelements must private? code example: all pagefactory tutorials have seen make webelements private, @findby(xpath = "//*[@id='searchstringmain']") private webelement searchfield; but assert element contains text (from class), have define them this: @findby(xpath = "(//*[contains (text(),'hrs')])[2]") public static webelement yourloggedtime; consider example: package org.openqa.selenium.example; import org.openqa.selenium.by; import org.openqa.selenium.support.findby; import org.openqa.selenium.support.how; import org.openqa.selenium.webelement; public class googlesearchpage { // element looked ...

Android Update specific Json -

lets have 2 different json's in database how can update/add more values json name user123 without affecting region , name values. { "region": "eu", "name": "user12345", } { "region": "eu2", "name": "user123", } json in database table plain string. need fetch it.. modify it.. , insert again database table.

Autocomplete from any position in python -

i have requirement in need show autocomplete results in pyqt's qlineedit widget based on entered text @ position. far able start of text for ex : "hi, slim shady" , here can see text in autocomplete when type "hi " need have functionality can enable me search between or position of sentence. my code :- from pyside import qtcore, qtgui class autocompleteedit(qtgui.qlineedit): def __init__(self, model, separator = ' ', addspaceaftercompleting = true): super(autocompleteedit, self).__init__() self._separator = separator self._addspaceaftercompleting = addspaceaftercompleting self._completer = qtgui.qcompleter(model) self._completer.setwidget(self) self.connect( self._completer, qtcore.signal('activated(qstring)'), self._insertcompletion) self._keystoignore = [qtcore.qt.key_enter, qtcore.qt.key_return...

javascript - Uploading image to server gives "URI formats are not supported." exception -

i have wcf service function upload images below: public function upload(uploading stream) uploadedfile implements iservice.upload dim strpath string = io.path.getdirectoryname(system.reflection.assembly.getexecutingassembly.codebase) dim upload__1 new uploadedfile() { .filepath = path.combine(strpath & "/pps/", guid.newguid().tostring()) } strpath = new uri(strpath).localpath dim length integer = 0 using writer new filestream(upload__1.filepath, filemode.create) dim readcount integer dim buffer = new byte(8191) {} while (inlineassignhelper(readcount, uploading.read(buffer, 0, buffer.length))) <> 0 writer.write(buffer, 0, readcount) length += readcount end while end using upload__1.filelength = length return upload__1 end function i added line: strpath = new uri(strpath).localpath in attempt solve problem suggested many posts, did not work. call fu...

elasticsearch - Regex on Term aggregations with phrase -

how can aggregate term filter based on phrase? field auto analyzed shingle analyzer.the below query works fine single keyword without whitespace when there whitespace fails. better way of doing it? { "query" : { "prefix" : { "auto" : "hello wo*" } }, "aggregations" : { "auto" : { "terms" : { "field" : "auto", "size" : 1000, "include" : "hello wo.*" } } } }

javafx - Implement Path Navigation bar (Breadcrumb bar) control -

Image
i want generate ui can navigate through path of tree structure. here example of want, taken javafx scene builder. depending on actual position in treeview, ui updated. clicking on individual items tree updated. my question: nodes/controls best used approach? (no full code required. mention name of controls). my first idea generate row of buttons closely each other, maybe there better ideas. thanks. you can use controlsfx 's breadcrumbbar breadcrumbbar<string> samplebreadcrumbbar = new breadcrumbbar<>(); treeitem<string> model = breadcrumbbar.buildtreemodel("hello", "world", "this", "is", "cool"); samplebreadcrumbbar.setselectedcrumb(model); samplebreadcrumbbar.setoncrumbaction(new eventhandler<breadcrumbbar.breadcrumbactionevent<string>>() { @override public void handle(breadcrumbactionevent<string> bae) { selectedcrumblbl.settext("you clicked ...

html - Why is my nested table rendering outside the table in DOM? -

i creating email, , have main table , nested tables inside of it. 1 of tables displaying outside table on dom , cannot figure out why. <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <title> *|subject|*</title> <style> .bodycontent{ color:#505050; font-family:helvetica; font-size:16px; line-height:150%; padding-top:20px; padding-right:20px; padding-bottom:20px; padding-left:20px; text-align:left; } .bodycontent a:link, .bodycontent a:visited, /* yahoo! mail override */ .bodycontent .yshortcuts /* yahoo! mail override */{ color:#45b5dd; font-weight:normal; text-decoration:underline; } .bodycontent img{ dis...

bash tab completion filter out options -

i make tab completion in bash bit more intelligent. let's have folder src file .lisp, , compiled version of file .fasl. type vi filename [tab tab], , .lisp autocompletes option. is, it's not want vim open compiled binary, don't have in list of autocomplete options cycle through. is there way can keep flat list of extensions autocomplete ignores, or somehow customize vim, autocomplete ignores particular file extensions when bash command starts vi ... any ideas appreciated. thanks! the bash complete command seems want. here linux journal link 'complete' command video . , here follow-up page more on using bash complete command the links explain quite well, , here related question/answer: bash autocompletion across symbolic link

javascript - Returns true if it is a vowel, false otherwise -

below code finding out if character vowel or not. when run it, doesn't print out true or false. can please me see doing wrong? var vowel = function(str) { var matches = str.match(/[aeiou]/gi); var count = matches ? matches.length : 0; document.getelementbyid('p').innerhtml = "'" + str + "contains" + count + "vowel(s)"; return false; } vowel(str); <form> <input type="text" name='t1'> <input type='submit' value="submit" onclick='return vowel(this.form.t1.v'> <div id="p"></div> </form> instead of document.getelementbyid try document.getelementbyid

php - Is it possible to catch JS and CSS files Magento loads and make it load corresponding local ones instead? -

i have started learn magento's , oberver architecture. had been thinking if possible prevent magento store loading js , css files in normal way , instead making load locally stored js , css files. the point of idea have control on third party resource loading and, ideally, the possibility defer js/css resources. for example, can merge , defer or change js files in page.xml layout normal, want make module see js file loaded , make load js file from, say, var/resources . third party resources, e.g. trustpilot js, found, intercepted , pointed locally downloaded version of files var/resources . and complete cake - ability specify insert element on page, before tag. so can (reasonably?) done magento module? how should go doing that?

swift - auto run a function in background in ios app when local notification triggers -

i want auto run function once local notification gets triggered in ios. didreceivelocalnotification comes in handy in scenario when app in foreground. once app in background, didreceivelocalnotification has no affect. research found out didreceivelocalnotification meant run in foreground only. so, there other way achieve scenario demands? app strictly requires local notification can't use push notifications , didreceiveremotenotification .

ggplot2 - How to format the scatterplots of data series in R -

Image
i have been struggling in creating decent looking scatterplot in r. wouldn't think difficult. after research, seemed me ggplot have been choice allowing plenty of formatting. however, i'm struggling in understanding how works. i'd create scatterplot of 2 data series, displaying points 2 different colours, , perhaps different shapes, , legend series names. here attempt, based on this : year1 <- mpg[which(mpg$year==1999),] year2 <- mpg[which(mpg$year==2008),] ggplot() + geom_point(data = year1, aes(x=cty,y=hwy,color="yellow")) + geom_point(data = year2, aes(x=cty,y=hwy,color="green")) + xlab('cty') + ylab('hwy') now, looks ok, non-matching colors (unless became color-blind). why that? also, how can add series names , change symbol shapes? don't build 2 different dataframes: df <- mpg[which(mpg$year%in%c(1999,2008)),] df$year<-as.factor(df$year) ggplot() + geom_point(data = df, aes(x=cty,y=...

machine learning - Remove Biasing effect on predictive model caused due to unequal ratio of values in one column -

i running predictive model using decision forest regression. there 1 categorical column called "type" has 2 levels "ab" , "cd". data available has more records "ab" compared "cd" (75:25). , therefore model biased more towards "ab" , hence predicts output better "ab". how can reduce biasing effect? i thinking of converting "type" numeric (0,1) , calculating weighted mean, can please elaborate approach or suggest other approaches, new predictive modeling. thanks!

Aurelia quick start doesn't work -

did tutorial says. totally copy , pasted ran in firefox doesn't render. 1 thing quick start doesn't address put html files create in tutorial. put them in src folder or main folder? tried both doesn't work anyway . have no file structure @ end show. i'm sure comments of show code not asking. asking file structure should like. they have created cli experience totally rocks beginners. check out. further faster.

javascript - Motion-ui animation triggered onLoad -

i have motion-ui working on foundation site , know working mobile menu folds out nicely in animated kind of way. i want have page elements fade in view when page first loads , read elsewhere following scss , html it. @import 'motion-ui'; .animate-fade { @include mui-animation(fade); } <div class="row animate-fade"> ... /div> am missing something? need javascript call or or should work? i can post better working example if needed take while , hoping know motion-ui

c# - Access obfuscated property -

Image
i need access property not in interface of current objecttype , has encrypted name. can see in following picture: context of type idesigncontext idesigncontext contains property activemodelgraphics . now, in activemodelgraphics, there selected encrypted property. searching way access property , enumerate ilist . thanks help. if need to, process of obfuscation redundant. need key, reference original code or way of knowing data pre-scrambling if wanted un-obfuscate it.

python - Gensim Extracting TF-IDF value of a word in a corpus -

i'm using gensim tfidfmodel model. code: dictionary = corpora.dictionary(line.lower().split()) line in open('aaa.txt')) class mycorpus(object): def __iter__(self): line in open('aaa.txt'): yield dictionary.doc2bow(line.lower().split()) corpus = mycorpus() tfidf = models.tfidfmodel(corpus) corpus_tfidf = tfidf[corpus] now want extract tf-idf value of each word, know in corpus_tfidf variable , tried codes below view of words tf-idf have word 'banana' , want find tf-idf value. there access find each word in dictionary dictionary.token2id['banana'] how can tf-idf of each word? {dictionary.get(id): value doc in corpus_tfidf id, value in doc} my corpus has 6501598 documents, 585499 features, 64106768 non-zero entries, , it's important value of each word in minimum time.

what does multiple class references in css do? -

so question need bit more explaining. what difference between this: .class1 .class2 {blahblah} this: .class1, .class2 {blahblah} and this: .class1 > .class2 {blahblah} i'm having trouble understanding differences. i'd explained in detail possible. haven't found anwhere breaks down me in way i'm looking for. thank you. .class1 .class2 {blahblah} affects element class2 ancestor element having .class1 .class1, .class2 {blahblah} means css rules affects element having class1 or class2 .class1 > .class2 {blahblah} means .class1 needs parent of class2. examples: <elementa class="class1"> <elementb class="class2"></elementb> </elementa> element b child element both .class1 .class2 {} , .class1 > .class2 {} definition affect it. <elementa class="class1"> <elementc> <elementb class="class2"></elementb> </elementc> </ele...

javascript - Callback unique filename with jquery php -

i using html2canvas , canvas2image create png image canvas , save server unique filename. i know how retrieve , show unique filename after gets generated. jquery $(function() { $("#convertcanvas").click(function() { html2canvas($("#mycanvas"), { onrendered: function(canvas) { thecanvas = canvas; document.body.appendchild(canvas); // convert sharing var img = canvas.todataurl("image/png",1.0); $.ajax({ url:'save.php', type:'post', data:{ data:img } }); php <?php $data = $_post['data']; $data = substr($data,strpos($data,",")+1); $data = base64_decode($data); $file = 'images/myfile'.md5...

windows - Xperf through a Fast Boot cycle -

i need write small program/script run xperf collect etw events (os , drivers) through windows fast boot (aka fast startup) cycle. how able preserve program , xperf processes, can collect events until moment os hibernates , os initializing again? windows performance recorder (wpr) can need write own other reasons.

vulkan - Is this understanding of VkDescriptorPoolCreateInfo.pPoolSizes correct? -

in vulkan, understand descriptor pool used allocate descriptor sets of layout use in shader, in vkdescriptorpoolcreateinfo passed vkcreatedescriptorpool , there field ppoolsizes takes bunch of objects containing descriptor type , number. the documentation seems vague, saying given descriptor pool can have certain, predetermined amount of each type of descriptor allocated in descriptor sets? if so, how determine how many need beforehand? happens if runs out? your understanding of descriptor pools correct. if so, how determine how many need beforehand? that's , application's needs. if application needs flexible , freeform, need create descriptor pools dynamically needed. if application has greater foreknowledge of scene like, application need fewer of such gymnastics. many serious vulkan applications try avoid having number of descriptor sets based on number of objects in scene. push constants and/or dynamic ubo/ssbo descriptors allow different per-ob...

razor - GlassMapper Render Link add Target for external Links -

Image
we on sitecore 8.1 glassmapper 4.4.1.188. we rendering image in anchor below: using (beginrenderlink(item, x => x.carousellink, iseditable: true)) { @renderimage(item, x => x.carouselimage, iseditable: true) } all works well. how can force renderlink insert html target attribute based on sitecore input general link? so, if content editor picks "external link" need link generated target="_blank" when select external link, use new browser option: this cshtml code: @using (html.glass().beginrenderlink(model, x => x.link)) { <span>aaa</span> } and html output: <a href="http://google.com" target="_blank"><span>aaa</span></a>

c# - Read IP Address using SQLDataReader -

working asp.net application pull ipv4 information sql database using sqldatareader. when reading ip sql data type binary , not sure best way handle this. since there no method sqldatareader.getipaddress() seems need use sqldatareader.getbytes()? many examples online around how since getstring simple hoping there simpler way use getbyte() or method bring in ip. while sqlreader.read() dim lastcom system.datetime = sqlreader.getdatetime(0) debug.writeline(lastcom.tostring("mm/dd/yyyy hh:mm:ss.fff")) debug.writeline(sqlreader.getstring(1)) debug.writeline(sqlreader.getboolean(2)) debug.writeline(sqlreader.getstring(3)) debug.writeline(sqlreader.getstring(4)) label_ip = sqlreader.getstring(1) label_model.text = sqlreader.getstring(4) loop i making assumptions how ip address stored in database (and supporting ipv4 addresses), try this: dim ipaddr(3) byte ' assuming column ...

android - stack=java.lang.StackOverflowError: stack size 8MB -

i'm getting stackoverflow error, understand fully, issue im not dealing big data, how can error produced ? i have activity, framelayout, fragment, 3 options. in fragment, when click on 1 of options, re-create fragment , put random numbers, max 15 , not big, error happens when user click fast on options cause overflow. this code generating, ideas "enhancing" ? don't know if code bad practice momery using. private static list<integer> savednumbers; public static void setupsavednumberslist(){ savednumbers = new arraylist<>(); } static list<integer> range; private static void adddiff(int mmax){ range = new arraylist<>(); for(int = 0 ; < mmax ; i++){ range.add(i); } range.removeall(savednumbers); } private static int returnifduplic(int mmax){ adddiff(mmax); return new random().nextint(range.size()); } public static int returnuniquesavednumber(int mmax){ int random = returnrandom(mmax); ...

Mapbox iOS SDK Polygon Annotation View Not in Center -

i have set of polygon annotations i'm added mglmapview. in delegate callback mapview:viewforannotation: add annotation view polygons, view shows in top right corner of polygon, not centroid. thought coordinate value of polygon centroid. if has idea on how attach annotation view center of polygon annotation cool.

vb.net - Formatting DataGridView Column using CultureInfo? -

i'm using vb.net 2015 (framework 4.5.2). i want format column currency using cultureinfo since currency not static , couold different other places in program use currency. default not work. tried dgvselectedbooks.columns("price").defaultcellstyle.format = string.format("c2", globalization.cultureinfo.createspecificculture("en-gb")) but no success. not give error, nothing.

photoshop - Continue processing bat file after opening executable -

i calling .jsx script via .bat script (the .bat necessary startup script users). .jsx launching photoshop specific color settings. after .jsx runs .bat not continue. i can quit photoshop manually , .bat continue. 1 have ideas how allow .bat carry on after calling .jsx? .bat script: "c:\program files\adobe\adobe photoshop cs6 (64 bit)\photoshop.exe" "path\ps_color_settings.jsx" .jsx script: setcolorsettings(); function setcolorsettings() { var desc = new actiondescriptor(); var ref = new actionreference(); ref.putproperty( charidtotypeid( "prpr" ), stringidtotypeid( "colorsettings" ) ); ref.putenumerated( charidtotypeid( "capp" ), charidtotypeid( "ordn" ), charidtotypeid( "trgt" ) ); desc.putreference( charidtotypeid( "null" ), ref ); var colorsettingsdesc = new actiondescriptor(); colorsettingsdesc.putstring( stringidtotypeid( "workingrgb...

c++ - In char x[10]="hello" , why cout<<x; doesn't print out the array's address? -

this question has answer here: why cout print char arrays differently other arrays? 4 answers as in int x[3] = {1, 2, 3, 4}; cout<<x; would print out x address. if choose character array, char x[10]="hello"; it prints out string hello and let's compiler smart enough understand in case of char array , point less print out address , prints out string instead, how print char array address? and consider statement char *ptr = "hello"; why legal, aren't pointers supposed store address? it prints "hello" because operator << has overload const char* (which you're passing if pass x ) prints out single char , moves next char until nul-character found. "hello" has compiled-added nul-character @ end, string "hello\0". to address can cast void* remove overload of const ...

NetSuite Advanced PDF/HTML - Get rid of Currency Symbol before Rate -

how go getting rid of currency symbol netsuite outputs on printed form? <td align="right" colspan="4">${item.rate}</td> instead of €3.00, want output 3.00 i have found answer... ${record.rate?html?replace("€","")}

c# - Consuming web service without ajax doesn't return all data -

i have problem went consume web service ajax, dont bring date especific data consulting database, went test web service in test mode work fine, here code, problem? this webservice code [webmethod] public string getname(string name) { var registeredusers = new list<person>(); string nombre = ""; string enstock = ""; int id = 1; if (connect()) { items oitem = (sapbobscom.items)ocompany.getbusinessobject(boobjecttypes.oitems); if (oitem.getbykey(name)) { nombre = oitem.itemname; enstock = oitem.quantityonstock.tostring(); id = 3; } id = 0; } var json = ""; registeredusers.add(new person() { personid = id, name = nombre, stock = name }); var serializer = new javascriptserializer(); json = serializer.serialize(registeredusers); ...

c++ - Comma operator with static_assert() -

when trying evaluate comma operator static_assert argument compilation fails void fvoid() {} int main() { int = (1, 2); // a=2 int b = (fvoid(), 3); // b=3 int d = ( , 5); // ^ // error: expected primary-expression before ',' token. ok int c = (static_assert(true), 4); // ^~~~~~~~~~~~~ // error: expected primary-expression before 'static_assert'. why? } it looks static_assert() doesn't resolve void after compiling. didn't manage find regarding in standard. there way use comma operator or use in line other expression (without semicolon)? no, there not. language grammar requires semicolon @ end of static assert declaration . n4140 §7 [dcl.dcl]/1 static_assert-declaration : ​ ​ ​ ​ static_assert ( constant-expression , string-literal ) ;

python - Finding max and min value every N rows in columns of CSV data -

i have csv file looks ~5m rows: 11/8/2016 2.495418222 2.501995109 2.488331492 2.504259694 11/8/2016 2.495759632 1.213707641 2.137418322 2.501118589 11/8/2016 2.495565218 3.050992103 0.870950956 2.500971719 11/8/2016 2.494934557 2.500041484 2.489212707 2.455110626 i trying find both max , min values of 10000-row sample, , iterate until end of data. (finding trend of multiple max , mins). code grabs value every 10000 rows instead of require above. lcd = pan.read_csv('daq_test_2016-08-11.csv',usecols=[0,2,3,4,5],skiprows=[0,1,2],na_filter=false) lcd = np.array(lcd) tslen2 = len(lcd[:,0]) rph2 = 57600 sfr2 = tslen2/((tslen2/rph2)*(2)) currentdata = (lcd[0::sfr2]) you can try this: lcd = pan.read_csv('daq_test_2016-08-11.csv',usecols=[0,2,3,4,5],skiprows=[0,1,2],na_filter=false) # group every 10,000 rows groups = lcd.groupby(pd.cut(lcd.index, range(0,len(lcd), 10000))) groups.min() groups.max()

excel - How to print a turtle variable equivalent to item 0 in a list in Netlogo? -

i trying export turtle variable value <= item 0 of patch list. these values interested in recording, having trouble getting code right that. i've tried below: file-print turtles [turtlevariable <= item 0 patchlist] i know that's not right getting number of turtles, , not turtle variable value. run model 1000 times , unsure how create code file manageable manipulate in excel. i'm pretty sure there simple answer, can't figure out! appreciated. you have multiple questions here. need post each question separately. take on following: how can list of values turtlevariable , values < item 0 patchlist . globals [patchlist] turtles-own [tvar] patches-own [pvar] test ca ask patches [set pvar random-float 1.0] set patchlist [pvar] of patches let _p00 item 0 patchlist ;;compute once crt 100 ask turtles [set tvar random-float 1.0] let _tset (turtles [tvar < _p00]) let _tvals [tvar] of _tset print _tvals end you can file-pri...

php - Use IF statement on Eloquent -

there way use if statement on eloquent? i have 1 table called 'invoices' .. invoices(invoiceid,debt,status) status represents if invoice payed or not, , debt debt on invoice. i'm asking if there quick way update status in such way when make payment.. if invoice.debt = 0 invoice.status = 0 else invoice.status = 1 i'm using laravel 5.3. thank you! it seems you're going in right way, you can as: $invoice = invoice::find(1); $status = ($invoice->debt == 0) ? 0 : 1; $invoice->status = $status; $invoice->save(); hope helps!

JUnit AssertionFailedError: Text in the file differs in java -

i using junit test testing purposes, facing problem of assertionfailederror. using command line arguments pass test cases main class. below main.java code public class main { public static void main(string[] args) throws ioexception { //storing commands, words, files arraylist<string> commands = new arraylist<>(); arraylist<string> words = new arraylist<>(); arraylist<string> files = new arraylist<>(); for(string arg: args){ if(arg.contains(".")) files.add(arg); else if(arg.contains("-") && !arg.contains("--")) commands.add(arg); else{ if(!arg.contains("--")) words.add(arg); } } for(string file : files ){ file originalfile = new file(file); //check if textfile exists if(originalfile.exists()){ if(words.size() == 2){ string = words...