Posts

Showing posts from June, 2011

Multiple Windows sessions on one PC using TeamViewer -

is possible connect remotely pc-a pc (let's pc-b) using teamviewer , work on pc-b, without interrupting local user working pc-b? for example, want use microsoft word , local user want work powerpoint @ same time. possible? this not possible. can remote control pc-b pc-a, means user in front of pc-a , user in front of pc-b both see desktop of pc-b , both can control same (windows) session on pc-b (with appropriate teamviewer settings). the way achieve want use windows terminal server support , connect different windows terminal server session on pc-b pc-a. see teamviewer faq here .

Using Wunderground API in Swift -

my current project needs able display weather forecasts, , have decided use wunderground. because using api uncharted territory me, have two-part question. best way retrieve data it, , far can tell there quite few, , can wunderground use coordinates? idea have in mind: http://api.wunderground.com/api/56968011acc3e3eb/conditions/q/+35.70206910,+139.77532690.json for retrieving data, you'll want swiftyjson parse json data api returns. then, once it's parsed , have json object representation of info, can access dictionary required fields. far using coordinates accessing api, took straight website, yes can. this: http://api.wunderground.com/api/your_key/geolookup/q/37.776289,-122.395234.json

ruby on rails - JBuilder as_json to_json -

does jbuilder use as_json or to_json render? i attempting override as_json , to_json alias, similar below: module bson class objectid def as_json(*args) to_s end alias :to_json :as_json end end then use jbuilder render return object. however, acts if using neither to_json or as_json render.

python - KeyError when reading from Excel data into dataframe -

Image
i have excel file 2 sheets , trying read both of them dataframe in code below. however, error keyerror: "['months_to_maturity' 'asset_id' 'orig_iss_dt' 'maturity_dt' 'pay_freq_cd'\n 'coupon' 'closing_price'] not in index" in line return df[['months_to_maturity', 'asset_id', 'orig_iss_dt', 'maturity_dt' , 'pay_freq_cd', 'coupon', 'closing_price']] in secondexcelfilereader() function. however, both sheets have headers asset_id orig_iss_dt maturity_dt pay_freq_cd coupon closing_price months_to_maturity i return df follows order in want columns. def excelfilereader(): xls = pd.excelfile('d:/usdatarecently.xls') df = xls.parse(xls.sheet_names[0]) return df[['months_to_maturity', 'asset_id', 'orig_iss_dt', 'maturity_dt' , 'pay_freq_cd', 'coupon', 'closing_price']] d

javascript - Save web pages with Firefox addon using file -> save as pop-up window -

let me start off saying new add-on development. using add-on sdk, trying create simple firefox add-on that, when button pressed, acts pressing ctrl-s hotkey, or following file -> save page save page pop window. have looked @ similar questions on here, seem going around built in save functions, , not utilizing "save page as" window. the end goal run other functions before save call made. user see save page window normal. i unaware of ways send hotkey signals, or accessing file drop down menu within add-on. one way invoke save as dialog if user had clicked on "save page as..." menu item ( id="menu_savepage" ). can executing docommand() method of menu item. following assumes event passed in command event button user clicked. function launchsaveasfrombutton(event) { var window = event.view; //create common variables if not exist. // should work firefox context. // depending on context in function being run, /

How to resolve the error 'fe_sendauth: no password supplied' in Rails using PostgreSQL? -

i've tried create rails app postgresql database, when started rails server , got error: fe_sendauth: no password supplied here're actions step step: $ sudo apt-get install postgresql postgresql-contrib $ gem install pg $ rails new timetracker --database=postgresql --skip-unit-test my database.yml file looks this: default: &default adapter: postgresql encoding: unicode pool: 5 host: localhost username: postgres password: development: <<: *default database: timetracker_development test: <<: *default database: timetracker_test production: <<: *default database: timetracker_production and here's pg_hba.conf file: # database administrative login unix domain socket local postgres peer # type database user address method # "local" unix domain socket connections local pe

hadoop - Does Morphline convertTimestamp command work for multiple fields in solr schema -

hi have multiple date fields in solr schema , in different formats. using morphlineindexertool index data , load in solr. i not having problems indexing 1 date field if try index multiple date filed using converttimestamp command in morphline conf not able see data indexed. how wrote mrphline.conf multiple timestamps. {converttimestamp { field : timestamp1 inputformats : ["yyyy-mm-dd't'hh:mm:ss.sss'z'", "yyyy-mm-dd't'hh:mm:ss", "yyyy-mm-dd"] inputtimezone : america/los_angeles outputformat : "yyyy-mm-dd't'hh:mm:ss.sssz" outputtimezone : utc }} {converttimestamp { field : timestamp2 inputformats : ["yyyy-mm-dd't'hh:mm:ss.sss'z'", "yyyy-mm-dd't'hh:mm:ss", "yyyy-mm-dd"] inputtimezone : america/los_angeles outputformat : "yyyy-mm-dd't'hh:mm:ss.sssz" outputtimezone : utc }} is right way in morphlines? can't see examples online multipl

twitter bootstrap 3 - How to set the specificity of a css over-ride class for XPages -

Image
this starts previous question asked think know needs done not how. have block of code defines pager in bootstrap , applies bootstrap style it: <xp:pager partialrefresh="true" id="pager1" for="repeat1" panelposition="left" styleclass="bootstrappager"> <xp:pagercontrol type="previous" id="pagercontrol1" styleclass="bootstrappagerprevious"> <xp:this.value><![cdata[«]]></xp:this.value> </xp:pagercontrol> <xp:pagercontrol type="group" id="pagercontrol2" styleclass="bootstrappagermiddle"> </xp:pagercontrol> <xp:pagercontrol type="next" id="pagercontrol3" styleclass="bootstrappagernext"> <xp:this.value><![cdata[»]]></xp:this.value> </xp:pagercontrol> </xp:pager> then in css load have over-ride boot

ruby - Is it possible to conditionally add item to OpenStruct? -

i want add string openstruct this: link = link.split(",") openstruct.new(title: link[0].strip, url: link[1].strip) sometimes, contains third variable, want add well: openstruct.new(title: link[0].strip, url: link[1].strip, id: link[2].strip) i check link[2] , create 2 openstruct.new s lines, there way add id afterwards? prepare hash , modify that conditionally. unconditionally pass openstruct. link = link.split(',') os_args = { title: link[0].strip, url: link[1].strip } os_args[:id] = link[2].strip if link[2] openstruct.new(os_args)

c# - text files with string arrays get position substring -

i having problem following: i loading file c# , splitting lines code. // splitting line original file string[] lines = showtext.split(new string[] { "\r\n", "\n" }, stringsplitoptions.none); now need loop go through lines , substring lines, separately. here trying accomplish, in way: for (int = 0; < lines.length; i++) { int[] testing = new int[i]; testing[i] = int.parse(lines[i].substring(16, 1)); textbox1.text = testing.tostring(); } the error here is: index outside bounds of array. here picture better idea i'm trying do. http://s30.postimg.org/jbmjmqv1t/work.jpg textbox1.text = lines[0].substring(16,1) + " " + lines[0].substring(23,9); textbox1.text = lines[1].substring(16,1) + " " + lines[1].substring(23,9); //etc could me this? you creating array in loop, being created each line , wrong length. instead of part of code: for (int = 0; < lines.length; i++) { int[] testing = new i

C# Linq XML get text from multiple elements with the same name -

i want retrieve product info , store in collection ienumerable. however, information 2 products being returned. tried change code element elements threw error. orderlist.xml: <?xml version="1.0" encoding="utf-8"?> <listorderitemsresponse xmlns="https://mws.amazonservices.com/orders/2013-09-01"> <listorderitemsresult> <amazonorderid>002-1893166-3105064</amazonorderid> <orderitems> <orderitem> <asin>b00hux1w1g</asin> <sellersku>nx-chag-ut0q</sellersku> <orderitemid>37783785306314</orderitemid> <title>polyethylene glycol (peg) 200, acs, reagent grade, 1 quart bottle</title> <quantityordered>1</quantityordered> <quantityshipped>0</quantityshipped> <itemprice> <

javascript - Mixing Ajax and Html Beging Form -

i have shared layout this: <div id="bodyform"> @renderbody() </div> <div id="modal-price" tabindex="-1" role="dialog" aria-labelledby="modal-price-label" aria-hidden="true" class="modal fade"> <div id="divreplacment" class="modal-dialog dialog-width-80-xs"> <div class="modal-body"> <span>loading....</span> </div> </div> </div> <div id="modal-referalid" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" aria-labelledby="modal-price-label" aria-hidden="true" class="modal fade"> <div id="divreferalreplacment" class="modal-dialog dialog-width-80-xs"> <div class="modal-content modal-c

html - Is inline javascript garbage collected when document body is replaced? -

consider have below webpage written in html (body section only): <body> <p> ... </p> <script> function fn() { // stuff } </script> </body> now, if replace innerhtml of document.body javascript say, div, body part becomes: <body> <div> ... </div> </body> ... fn object eligible garbage collection if no references exist anywhere in rest of code (any context)? it subject garbage collection if no other references made context. however, there 1 small reference holding on function, global window object. because function (and entire script section shown) scoped globally. reference still exist even if entire document.body's innerhtml replaced. there few ways free object shown in exact example global object , make eligible collection. deleting property on global object not option because declared function , not property. overwrite

MySQL, python update row if null -

i have database contains 7 fields, field 1 unique , rest not. field 2 , 3 null. trying update database information csv file fill in nulls cannot work. field null or field contain information. db=mdb.connect('localhost','username','password','db') cur=db.cursor() inputinfo=csv.reader(open('insert.csv','r'),delimiter=',') row in inputinfo: inserthostnames=("""update filesort set hostnames=values(hostnames) hostnames not null""") cur.execute(inserthostnames,row[1]) insertipaddress=("""update filesort set ipaddress=values(ipaddress) ipaddress not null""") it not work , gives me error traceback (most recent call last): file "test.py", line 57, in <module> inserttaddm() file "test.py", line 47, in inserttaddm cur.execute(inserthostnames,row[1]) file "/usr/lib/python2.7/dist-packages/mysqldb/cursors.py", lin

insert - Copying rows from remote database oracle -

i using oracle xe 10.2. trying copy 2,653,347 rows remote database statement insert autoscopia (field1,field2...field47) select * autos@remote; i trying copy 47 columns 2 million rows locally. after running few minutes, however, error: ora- 12952 : request exceeds maximum allowed database size of 4 gb data. how can avoid error? details: have 3 indexes in local table (where want insert remote information). you're using express edition of oracle 10.2 includes number of limitations. 1 you're running limited 4 gb of space tables , indexes. how big table in gb? if table has 2.6 million rows, if each row more ~1575 bytes, want isn't possible. you'd have either limit amount of data you're copying on (not getting every row, not getting every column, or not getting data in columns options) or need install version , edition allows store data. express edition of 11.2 allows store 11 gb of data , free express edition of 10.2 easiest option. can

java - Is there a limit on the number of open JDBC ResultSets? -

i'm using jdbc mysql, , i'm wondering whether there limit on number of resultset objects can open @ given time. wasn't able find answer anywhere else on or in documentation. i'm asking because program can potentially generate , manipulate high number of these resultsets, , i'm afraid of consequences have. alternative create set of classes mimics resultset methods need, require such class every table in database (and have many of them). each resultset belongs statement , , each statement associated database cursor, limited resource in databases. mysql doesn't have upper limit, having many open cursors affect database performance you don't have close resultset s (for example closed , reopened if re-execute statement) must close statement s or leak database resources. from resultset documentation : a resultset object automatically closed when statement object generated closed, re-executed, or used retrieve next result sequence of mul

security - Java 8 keytool is not using -providerName option correctly -

i have found that, when using keytool (windows, java 8 u45) generate csr ec keypair, stored in keystore , using custom provider specified via -providername , that, csr not signed using algorithm i've specified my provider (the provider seems, working specify keystore). why, when i've told tool use, use "some" operations? i've got work listing provider default provider in java.security, but, makes little sense me should have when i've explicitly told tool "use provider". is bug in program, or bug in understanding?

java - MapReduce Multiple Outputs: File Could Only Be Replicated to 0 Nodes, Instead of 1 -

i have reduce job , getting above error file replicated 0 nodes instead of 1. have searched online , saw problem data node, running other mapreduce jobs in workflow working. difference see using multiple outputs , specifying folder, sure path correct. here multiple outputs write line: mos.write("mosname", new longwritable(key), value, outputfilepath); the exact error getting is: org.apache.hadoop.ipc.remoteexception(java.io.ioexception): file xxx replicated 0 nodes instead of minreplication (=1). there 7 datanode(s) running , no node(s) excluded in operation. any appreciated. i've had same issue, did not replicate when writing output context instead of multipleoutputs. far can tell it's caused fact multipleoutputs holds more data in memory longer. the solution combination of: (1) performing compression on output fileoutputformat.setcompressoutput(job, true); fileoutputformat.setoutputcompressorclass(job, gzipcodec.class); (2) giving job

sql - Count how many columns have a specific value -

i have table looks this: id x1 x2 x3 x4 1 20 30 0 0 2 60 0 0 0 3 10 30 0 0 4 30 30 30 30 i want able query , return id number of columns have more 0 value in row. result this: id count 1 2 2 1 3 2 4 4 try this: select id, z.cnt mytable cross apply (select count(*) cnt (values (x1), (x2), (x3), (x4)) x(y) x.y > 0) z this query makes use of table value constructor create in-line table rows columns of initial table. performing count on in-line table, can number of columns greater zero. i think scales if have more 4 columns. demo here

android - Trying to save an SQLite database from command line but it's not giving *.sqlite nor *.db, just saves a filename without any extension -

so go directory sqlite3.exe , open double click type in following commands (i'm including foreign keys pragma need in future): pragma foreign_keys=on; create table `countries` ( `country_id` integer not null, `name` text not null unique, primary key(country_id) ); insert `countries` values (1,'japan'), (2,'china'); .save countries this gives me file no extension type, only: countries but tutorials see opening pre-made/existing database in android use open file extensions such example.db or example.sqlite what missing? when try open file ormlite get: java.sql.sqlexception: problems executing runexecute android statement: create table `countries` (`name` varchar , `country_id` integer primary key autoincrement )

java - Can some one tell me whats wrong with my JPQL query throwing me The basic mapping 's.surname' cannot be used in conjunction with the = operator error -

i trying compare name typed text box , name inside table keep getting error exception in thread "awt-eventqueue-0" java.lang.illegalargumentexception: exception occurred while creating query in entitymanager: exception description: problem compiling [select s salesmen s s.name = linus order s.name asc]. [31, 37] basic mapping 's.name' cannot used in conjunction = operator. my query is select s salesmen s s.name = linus order s.name asc your query should select s salesmen s s.name = 'linus' order s.name asc . linus must quoted, since varchar . add query building strategy (assuming v2 linus ): ... v1 + " '" + v2 + "' " + ob ...

How to end this loop in Java (Updated Quest.) -

i beginner programmer learning java first time. cant figure out how make program repeat until user enters 0. here problem: application should allow user input many model numbers needed. use 0 sentinel end user input. enter car's model number or 0 quit: 195 car defective. must repaired. enter car's model number or 0 quit: 119 car defective. must repaired. enter car's model number or 0 quit: 0 public class carrecall { // main method public static void main(string[] args) { int model; //model number scanner input = new scanner(system.in); { system.out.print("enter car's model number or 0 quit: "); model=input.nextint(); input.close(); } while (model>0); { if (model==119) { system.out.print("your car defective. must repaired."); } else if (model==179) { system.out.print("your car defective. must repaired."

java - the listview is not working android not null pointer exception -

i trying display data website in listview not showing data. think there error in `asynctask, i want view 2 text json file getting. help me learn mistake. tried using ipadress , domainname nothing works , not exception here code package com.itdc.shashank.avdeal1; import android.app.activity; import android.app.progressdialog; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.menu; import android.widget.listview; import android.widget.toast; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import java.io.ioexception; import java.util.arraylist; public class itemview extends activ

compression - Compressed files using php won't work in windows -

i trying compress video files on fly using php , forcing compressed file download. below code have written. $files_todownload_string = ' movie1.mov movie2.mov ' header('content-type: application/x-gzip'); header('content-type: application/octet-stream'); header('content-disposition: attachment; filename="file.zip"'); header( 'content-transfer-encoding: binary' ); $fp = popen('zip -v - ' . $files_todownload_string, 'r'); $bufsize = 8192; $buff = ''; while( !feof($fp) ) { $buff = fread($fp, $bufsize); echo $buff; print " "; } pclose($fp); the compression done , zip file downloaded successfully. however, when trying open zip file in windows os, won't open. says compressed file corrupted. any helps guys? in advance. remove print " "; you're adding bytes.

Eclipse java JAX-RPC web service import generates an interface instead of a class -

Image
therefore, when trying instantiate object of class, error is cannot instantiate type does know why eclipse generate interface instead of class? web service written in vb.net can replicated following simple example given here start eclipse project. add new web service client http://www.webservicex.net/currencyconvertor.asmx?wsdl write code... package test; import net.webservicex.www.currencyconvertor; import net.webservicex.www.currencyconvertorsoap; import net.webservicex.www.currency; public class convert { public static void main(string[] args) { currencyconvertor cc = new currencyconvertor(); // gets implementation of interface can use // contact web service. currencyconvertorsoap ccs = cc.getcurrencyconvertorsoap(); // send soap request server , result web service double conversionrate = ccs.conversionrate(currency.gbp, currency.usd); system.out.println("£1 worth $" + conversionrate );

drupal commerce line item display -

i'm trying learn how use commerce module in drupal 7, , here i'm confused. in ( admin/commerce/products/types/product1/display/) can manage display of product1 (for example) .it clear default display used in nodes , teaser used ofcourse in teaser mode, "line item" doesn't make sense. display? display used? and there 1 under store > config > line item types > product 1 > manage display (admin/commerce/config/line-items/product1/display). what's difference between , one? these used for? a line item display how product displayed in cart / order. line item can product, discount, shipping, etc

apache - Is it possible to check a .htaccess file using the -t option of the apache2 command? -

i've got .htaccess file copied 1 apache httpd server , deployed onto another. unfortunately, foolishly didn't check version of destination server , put file in place; site stopped working because it's apache 2.4 , file has 2.2 syntax. reverted previous version , hoped nobody noticed! now, of course, i'm paranoid. i tried copying broken-on-2.4 version elsewhere , using apache2 -t .htaccess find out what's wrong, error: apache2: not open configuration file /etc/apache2/.htaccess: no such file or directory if supply full path (i.e. apache2 -t /path/to/it/.htaccess ) get: ah00534: apache2: configuration error: no mpm loaded. this error appears unrelated same error message , exit code (1) regardless of whether or not there's error in .htaccess file. so question is: can use apache2 -t [...] test .htaccess file, , if not, can use instead (aside manual)? there this site doesn't seem allow me version of apache check against. i ha

php - Laravel 5.1 Adding MySQL Column at the Front of a DB Table -

i've noticed there other questions on stack exchange how add columns db table (for example, here ), none of them address how add column table first column in table. i've seen can add ->after('column_name') add column after column within table, there "->before('column_name')" use (or sort of smarter equivalent)? well, luck have it, jumped gun bit question , managed find own answer. in laravel 5.1, can use column modifier ->first() in order place column first in table.

sql server - T-SQL NOT IN works, but NOT EXISTS does not -

as new records added table, need mark old records 'level' old. can not in, not exists not work. suspect has subquery correlation explained here: not exists query doesn't work on informix while same query not in works don't understand why & use further explanation. here's example code: create table t2 (id int, level int, somedate datetime, mostrecent int) go insert t2 select 1, 1, '1/1/2010', 1 union select 2, 1, '2/2/2010', 1 union select 3, 2, '3/3/2010', 1 union select 4, 3, '4/4/2010', 1 union select 5, 3, '5/5/2010', 1 union select 6, 3, '6/6/2010', 1 union select 7, 4, '7/7/2010', 1 union select 8, 5, '8/8/2010', 1 union select 9, 6, '9/9/2010', 1 union select 10, 6, '10/10/2010', 1 union select 11, 8, '11/11/2012', 1 go -- doesn't work update t2 set mostrecent = 0 t2 not exists (select * t2 join (select level, max(somedate) somedate t2 group

how to change background color of a label in QT -

i developing calculator using qt framework. have put label display entered number , answer want change color of label. how can that. label = new qlabel("0",this);//label text inputs label -> setgeometry(qrect(qpoint(75,25),qsize(50,200))); please help you can use qt style sheets qlabel* label = new qlabel("hello"); label->setstylesheet("background: red");

(Java) - how to display the output we set -

this java code, how can display example: public static void main(string[] args) { // todo code application logic here int = 1; int j = 1; (i = 1 ; <= 10; i++) { (j = 1; j<= 5; j++) { if (i % 2 == 0 ) { system.out.println ( j + "/5 = " + /10.0); //the output should // 1/5 = 0.2 // 2/5 = 0.4 // 3/5 = 0.6 // 4/5 = 0.8 // 5/5 = 1.0 } } } system.out.println("--------------------"); } } how can display output 1/5 = 0.2 2/5 = 0.4 3/5 = 0.6 4/5 = 0.8 5/5 = 1.0 you're doing way here. this: public static void main(string[] args) { (int = 1; i<= 5; i++) { system.out.println ( + "/5 = " + / 5.0); } system.out.println("--------------------"); } output: 1/5 = 0.2 2/5 = 0.4 3/5 = 0.6 4/5 = 0.8 5/5 = 1.0 --------------------

Java Swing JTextfield resets after every 2 seconds -

Image
currently i'm programming chat , noticed whenever write in jtextfield without sending server current contents of jtextfield resets "". in code string parts in german shouldnt big problem hope. first here screenshot of empty jtextfield: write in jtextfield: , after test text "hg.." gets deleted after 2-4 seconds without pressing anything. public class clientwindow extends jframe implements runnable{ private static final long serialversionuid = 7413464033743652908l; private jpanel contentpane; private jmenubar bar; private jmenu datei; private jmenu option; private jmenu features; private jmenuitem verlaufspeichern; private jmenuitem w; private jmenuitem ww; private jtextarea history; private jtextfield text; private jbutton send; private defaultcaret caret; private client client; private thread run, listen; public clientwindow(string name, string address, int port){ clien

javascript - Check if a line and a mesh intersect in three.js -

i have cilinders in scene. when user clicks on specific points, i´m drawing line (three.line) between points. need check if line intersects of cilinders (three.mesh). this not working myline.intersectobjects( arrayofcilinders , true) is possible draw ray on line? in case use myray.intersectobjects( arrayofcilinders , true) thanks! from three.js documentation: ray(origin, direction) origin -- vector3 origin of ray. direction -- vector3 direction of ray. so if have pointa , pointb clicks of user, can: (pseudo code) origin = pointa direction = (pointb-pointa).normalize() myray = three.ray(origin, direction) you can same three.raycaster()

git - Gitlab import repos creates groups but no projects -

Image
after gitlab upgrade, have lost configuration, , found backup made empty, not restore backup. i've found still have repos in /home/git/repositories/ i've copied them /var/opt/gitlab/git-data/repositories , changed user recursively gitlab user. now have used command gitlab-rake gitlab:import:repos , has processed repositories , has created groups output this: processing fib/sdx.git * created sdx (fib/sdx.git) processing fib/sdx.wiki.git * skipping wiki repo the problem although has created groups , can see them in gitlab web interface, shows each group has 0 projects ¿how can recover these repos? solved @ gitlab issue tracker. the problem imported repos had simlynk hooks pointing undefined folder. https://gitlab.com/gitlab-org/gitlab-ce/issues/2082

VBA MS-Word How to import only determinated styles from a template -

does know how it? i'm importing of styles template, want impot 1 or 2. in advance application.organizercopy [path source template], activedocument.fullname, [style name 1], wdorganizerobjectstyles application.organizercopy [path source template], activedocument.fullname, [style name 2], wdorganizerobjectstyles

sms gateway - PDU SMS message not receiving -

i using wavecom gsm modem , implemented logic send sms in pdu mode. operators getting : +cmgs response not receiving message. , few more operators idea, airtel, vodafone etc, few sims getting +cms error : 38, i.e., network out of order , few proper response not receiving sms. has faced these kind of problem? , can missing something? is network operator issue? and tested quectel modem, same result. regards, sowmya have tried sending message using terminal. use @ commands configure in pdu mode , send text message through terminal. probably, might have missed endline characters or something. however, if getting cms error there must wrong network registration. please feel free ask more issue. thanks

c# - Processing a ManagementObjectCollection using Parallel.ForEach(...) -

i'm using following code process items in managementobjectcollection in parallel: using (managementobjectcollection results = this._searcher.get()) { // type arguments method parallel.foreach<tsource>(...) cannot inferred usage parallel.foreach(results, (mo, loopstate) => { // process mo }); } if specify type, complains this using (managementobjectcollection results = this._searcher.get()) { // cannot convert managementobjectcollection [..].ienumereable<managementobject> parallel.foreach<managementobject>(results, (mo, loopstate) => { // process mo }); } how can make work properly? , why second code block not work (afaics, managementobjectcollection implements ienumerable why complaining)? it implements non-generic ienumerable interface, hence making ienumerable<object> , not ienumerable<managementobject> . i'd suggest casting using cast<t> cast each element iterat

Insert Unique Records in Vertica with COPY query -

i new vertica db, worked mysql previously. wanted insert unique records in vertica table, vertica doesn't support unique constraints while insertion. inserting records in table copy query. can't check each records before insertion, exist or not. can 1 me optimized way unique insertion. thanks in advance:) you can add no commit copy , run analyze_constraints before commit : dbadmin=> create table tbl (a int primary key); create table dbadmin=> copy tbl stdin no commit; enter data copied followed newline. end backslash , period on line itself. >> 1 >> 2 >> 2 >> 3 >> \. dbadmin=> select * tbl; --- 1 2 2 3 (4 rows) dbadmin=> select analyze_constraints('tbl'); schema name | table name | column names | constraint name | constraint type | column values -------------+------------+--------------+-----------------+-----------------+--------------- public | tbl | | c_primary | prima

android - Why everytime I click on delete chat message the app stop working? -

every time when click on delete chat message, app stop working. did check code based on errors got i'm still not sure what's wrong code. @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.action_delete: getcontentresolver().delete(uri.withappendedpath(contentprovider.content_uri_messages_chat, profilechatid), null, null); getcontentresolver().delete(uri.withappendedpath(contentprovider.content_uri_profile, profileid), null, null); finish(); return super.onoptionsitemselected(item); } below chat menu layout. <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_delete" android:showasaction="always" android:icon="@android:drawable/ic_menu_dele

spring mvc - How to get process instance id in WSO2 BPS -

i have bpel process invoked spring web application. in process there approval flow. in web app want analyze process determine process being. example : if process has 2 approvals received want know whether first approval has been returned or likewise. want keep process instance id in application database. can invoke admin services data process. there way can achieve target ? , @ same time want confirmed whether there admin service process status. know possible human tasks. i'm using wso2 bps 3.2.0 the instance id available in variable $ode:pid . in order query process state, refrain using admin api rather implement event handler @ root (or lower) scope, listens getstatus operation , uses piid correlation property. reply approval status. bpel compliant not hack using pm api.

python - pandas to_csv arguments float_format and decimal not working for index column -

background i doing simulations resp. system analysis variing parameters (in case rpm only) , append every last line of results dataframe results_df summarizing dataframe df containing giving baviour of system in depencence of varied rpm . in order appropriate index plotting , data analysis converted varied values (here rpm ) list pandas series ser , concat series summarizing dataframe df containing results interested in. since results of each calculation interested in last line of each calculation extracting data results dataframe results_df using .tail(1) . what have done far shown in following snippet: rpm = [0.25, 0.3, 0.5, 0.75, 1.0, 1.5, 2.0] ser = pd.series(rpm, name='rpm') df = pd.dataframe() df_list = list() i, val in enumerate(rpm): results_df = get_some_data_from_somwhere() df_list.append(results_df.tail(1)) df = df.append(df_list, ignore_index=true) df = pd.concat([df, ser], axis=1) df.set_index('rpm', inplace=true) open('

javascript - Based on angular js -

i have array called favouriteproducts=[deptname="",item:object(it contains product info pid,name,brand)] example favouriteproducts[0]=deptname:"fresh food" item:object productid:4356178 brand:brand_name favouriteproducts[3]=deptname:"drinks" item:object productid:4356110 brand:brand_name favouriteproducts[4]=deptname:"drinks" item:object productid:4356111 brand:brand_name when display result ouput (using ng-repeat in html) fresh food productid:4356178 fresh food productid:4356179 drinks productid:43561710 drinks productid:43561711 but want output in way fresh food productid:4356178 productid:4356179 drinks productid:43561710 productid:43561711 can suggest me how this?? want array favouriteproducts[0]=deptname:"fresh food"

parallel processing - how the execution time drops sharply (more than expected) as the number of processors increase? -

i executing programme 5000000 times in parallel using "parallel.for" f#. average execution time per task given below. number of active cores : execution time (microseconds) 2 : 866 4 : 424 8 : 210 12 : 140 16 : 106 24 : 76 32 : 60 provided fact, by doubling number of cores, maximum speedup can get, should less than 2 (ideally can 2). what can reason sharp speedup. 2 * 866 = 1732 4 * 424 = 1696 8 * 210 = 1680 12 * 140 = 1680 16 * 106 = 1696 24 * 76 = 1824 32 * 60 = 1920 so increase parallelism, relative performance improves , begins fall. improvement possibly due amortization of overhead costs jit compilation or in algorithm manages parallelization. the degradation degree of parallelism increases due sort of resource conte

c# - Why does this simple .NET console app have so many threads? -

this simple program starts 15 threads - according count. during lifetime drops few, come back. class program { static void main(string[] args) { while (true) { console.writeline(process.getcurrentprocess().threads.count); thread.sleep(500); } } } i expecting process have 1 thread (and intuition backed this ) without debugger, process has (!) 4 threads. surely clr stuff hidden process? what count this? process have many threads? why? try running outside debugger (i.e. press ctrl+f5 instead of f5). should see 3 threads - main thread, gc thread & finalizer thread iirc. other threads see debugger-related threads.

build - Listing all failed targets -

i'm attempting build large legacy code base has troubles building under new toolchain. in order speed fixing problems, run make -k to build can built, can later focus on unbuildable stuff. single make takes minute figure out next problem work on (this code base uses tangled mess of makefiles take ages parse). is there way list targets failed during single make -k run? i'd redirect make -k output file , error patterns in it. use vim , i'm typically looking these: make:\ \*\*\* \*\*\*\ \[ a (custom) log parser can written needed.

c# - Foreign Key Association and Independent Association, Whose priority is higher? -

if have entity in ef , have foreign key property in entity. want update related record. if use both foreign key association , independent association , preferred entity framework , why ? case : suppose if assign different entity navigation property , different enityid in foreign key property. saved in database ? i think foreign key in case. independent key table's itself

c# - Changing method from Dictionary to Struct -

i have method below use dictionary set 2 values nl. id , name / key , value . understand dictionary can take two values, need change method can allow more values added type. best way this? public dictionary<int, string> getquoteoptionlist(quoteoptiontype optiontype) { dictionary<int, string> result = new dictionary<int, string>(); using (truckdb db = new truckdb()) { switch (optiontype) { case quoteoptiontype.bodytype: db.bodytypes.tolist().foreach(x => result.add(x.id, x.name)); break; ... case quoteoptiontype.reardropside: db.reardropsides.tolist().foreach(x => result.add(x.id, x.name)); break; case quoteoptiontype.extras://example: (x.id, x.description, x.stockitem, x.minimumstock) add more 2 values db.extras.tolist().foreach(x => result.add(x.id, x.description));

Python - Extract private variables from a function? -

i have function f2(a, b) it ever called minimize algorithm iterates function different values of , b each time. store these iterations in excel plotting. is possible extract these values (i need paste them excel or text file) easily? conventional return , print won't work within f2. there way extract values , b public list in main body other way? the algorithm may iterate dozens or hundreds of times. so far have tried: print console (can't paste data excel easily) write file (csv) within f2, csv file gets overwritten within function each time though. append values global list. values = [] def f2(a,b): values.append((a,b)) #todo: actual function logic goes here then can @ values in main scope once you're done iterating.

javascript - How do I reset a form in angularjs? -

see fiddle: http://jsfiddle.net/hejado/7bqjqc2w/ i'm trying form.reset() form using angular. html: <div ng-controller="formctrl"> <form name="resetme" id="resetme"> <input ng-model="text" type="text" /> <input file-model="file" type="file" /> <button type="button" ng-click="resetform()">reset</button> </form> </div> js: .controller('formctrl', function($scope) { $scope.resetform = function() { //$scope.resetme.reset(); document.getelementbyid('resetme').reset(); }; }); please note: i'm using kind of form ajax-upload file. page not refreshing , don't want use reset-buttons. (i'm using 1 in fiddle simplicity.) want call reset-function after fileupload finished (via http success). i'm using <input type="file" /> so can't reassign empty values input