Posts

Showing posts from February, 2011

javascript - How to pass parameters to a URL from a select form? -

i want pass values select form url in order connect external website using iframe solutions. i'm new .php & javascript. please me out. this form created data users pass specific url. <form action="selectcourier.php" method="get"> <h1>select courier service</h1> <select> <option value="select">select courier service</option> <option value="1">dtdc</option> <option value="2">afl</option> <option value="3">bluedart</option> </select> consignment number: <input type="text" name="cnum"><br> <center><input type="submit"></center> </form> selectcourier.php <body> <form><center><h3><a href="http://dtdc.com/tracking/tracking_results.asp?action=track&sec=tr&ctlactiveval=1&ttype=awb_no&strcnno=h60874238&ges=n&tr...

How can I add a 2-column legend to a Matlab plot? -

Image
consider following code: t=0:.01:(2*pi); y=[sin(t);sin(t-pi/12);sin(t-pi/6);sin(t-pi/4)]; figure(1) clf subplot(6,1,5) plot(t,y) xlim([0 2*pi]) legend('1','2','3','4') it produces following figure: is there way change legend 2-column lay-out? be --- 1 --- 3 --- 2 --- 4 instead of --- 1 --- 2 --- 3 --- 4 so legend boundary lined not cross graph boundary lines. i found gridlegend script, prefer code directly. you can hack sort of thing making second invisible axis on top of first, this: t=0:.01:(2*pi); y=[sin(t);sin(t-pi/12);sin(t-pi/6);sin(t-pi/4)]; figure subplot(6,1,5) plot(t,y) xlim([0 2*pi]) l1 = legend('1', '2'); pos = l1.position; set(l1, 'position', pos - [pos(3) 0 0 0]); legend boxoff ax2 = copyobj(gca, gcf); set(ax2, 'visible', 'off', 'clipping', 'off') kids = ax2.children; set(kids, 'visible', ...

ruby on rails - Integration Tests: Filling Autocomple Dropdown in Rails_Admin using Capybara for -

in rails app, i'm using rails_admin. want fill relationship. say, post belongs author. want set author. rails_admin uses autocomplete form selection of data, i.e. xhr. how select value , submit data using capybara. normal select doesn't work here. i'm assuming need take following actions click on carrot icon, select first value dropdown or there other approach fill such data, i.e execute script etc. how do that? edit : as of now, i've started using selenium driver , i'm using following solution within '#post_user_id_field' find(".input-group-btn").click end page.execute_script(%q{$("ul#ui-id-3").find("li")[1].click()}) suggest better approach. thanks in advance, i took @ using capybara rspec found helpful information. without seeing of code, can following (taking link above): describe 'some stuff requires js', :js => true 'will use default js driver' 'will switch 1 ...

Cannot read property 'oFeatures' of undefined datatables -

i getting error cannot read property 'ofeatures' of undefined datatables using bubble editing of datatable editor <script type="text/javascript"> var editor; $(document).ready(function(){ // use global submit , return data rendering in examples editor = new $.fn.datatable.editor( { ajax: 'http://52.77.155.163/web/index.php?r=ivision/productprices/datatable', table: '#example', fields: [ { label: "id:", name: "id" }, ], formoptions: { inline: { onblur: 'submit' } } } ); $('#example').on( 'click', 'tbody td', function (e) { var index = $(this).index(); if ( index === 0 ) { editor.bubble( ); } }); var table=$('#example').datatable( { ...

winforms - How to fit C# application in every resolution -

i want know how fit c# application in every resolution c# application open in computer perfect when install application on client machine it's show half application. what have tried: this.windowstate = formwindowstate.maximized; this.location = new point(0, 0); this.size = screen.primaryscreen.workingarea.size; this won't work all, need desing application responsive. need use panels, groupboxes , objects these , need anchor these objects inside form, need user screen resolution , set application. summary: code may works not not perfect resolution. absoluty need anchoring objects. desktop application have pain matter.

d3.js - Angular2 / Typescript + D3v4 - manually include typings? -

i've been trying d3 , running angular2 app. there seems issue new d3v4 , available typings file, i.e. trying use new methods such scalelinear() instead of no longer available scale.linear() result in error property 'scalelinear' not exist on type 'typeof d3'.   since tomwanzek seems on issue , trying create new definitions on @ https://github.com/tomwanzek/d3-v4-definitelytyped wondering if there way manually include available typings files in angular2 project? in reference arlo's answer, let me expand brief history , current answer. created repo https://github.com/tomwanzek/d3-v4-definitelytyped develop new d3 version 4 typescript definitions, when d3 v4 not yet final , typescript 2 on horizon. latter major factor, because changed way definitions written , can acquired, i.e. @types. with few noted nods collaborators listed on repo, finalized definitions , migrated them definitelytyped . actively maintained in types-2.0 branch of defi...

java - For what purpose one would want to create a class's instance inside the same class's main? -

i came across kind of example , had difficulty understand it's actuall purpose: class yielddemo extends thread { static boolean finished = false; static int sum = 0; public static void main (string [] args) { new yielddemo ().start (); (int = 1; <= 50000; i++) { sum++; if (args.length == 0) thread.yield (); } finished = true; } public void run () { while (!finished) system.out.println ("sum = " + sum); } } i've never seen kind of implementation - why initiating new class inside same class object , not outside class? there particular reason? in fact outside of class object itself. main method static method, has no dependency on object instance. you move main method other java file . in general work. however, need put static methods in file. every java file needs class, may put method in class works for. example, class math in java pure ...

apache - Searching for the proper xampp/htdocs/index.php code -

first of went through asked question related xampp/htdocs/index.php. (eg.: this , this , this , may more other) still cant reach proper xampp/index.php file (or other way xampp/index.html). ask ( can reach the following screen(s), displayed @ 6:30 in youtube tutorial ). cause can reach following schreen: displayed @ 16:25 in youtube tutorial . the code see in default index.php this: <?php if (!empty($_server['https']) && ('on' == $_server['https'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_server['http_host']; header('location: '.$uri.'/dashboard/'); exit; ?> wrong xampp installation :-( and tried modify line: header('location: '.$uri.'/dashboard/'); header('location: '.$uri.'/**xampp**/'); . (in htdocs/xampp folder tried search page displayed in tutorial linked first). so ones again want reach somehow...

rpm - fiware could not be installed -

i trying install contextbroker following doc: https://github.com/telefonicaid/fiware-orion/blob/develop/doc/manuals/admin/install.md#using-yum-(recommended) the yum installation did not work, therefore tried download https://forge.fiware.org/frs/?group_id=7 install rpm -i contextbroker-1.2.0-1.x86_64.rpm then shows error:error: contextbroker-tests-1.2.1-1.x86_64.rpm: not rpm package (or package manifest): could please tell me happened? thanks i downloaded it, , looks webserver misconfigured. inserting html @ beginning of rpm , corrupting it. need use utility strip text beginning. dd easiest once figure out how junk remove. original answer (useful keep because tells file , yum ): "not rpm package" sounds download corrupted. try running " file " on , see tells it. didn't see hash on download page, can't verify that. yum nicer interface rpm can try " yum localinstall contextbroker-1.2.0-1.x86_64.rpm "...

html - PHP cancel redirection after script execution -

i have simple post script php sends email, when click submit button executes , goes script directory (ex: localhost/sendmail/test.php). possible post alert box, , stay on page instead of going script , redirecting onto submit page? this script. <?php $subject = 'your website: contact'; // subject of email $to = 'myemail'; // enter recipient's e-mail address $emailto = $_request['email']; $headers = "mime-version: 1.1"; $headers .= "content-type: text/html; charset=iso-8859-1"; $headers .= "from: " . $emailto . "\r\n"; // sender's e-mail $headers .= "return-path:". $emailto; $body = 'you have received new inquiry!' . "\n\n"; $body .= 'name: ' . $_request['name'] . "\n"; $body .= 'email: ' . $_request['email'] . "\n"; $body .= 'phone: ' . $_request['phone'] . "\n\n"; $body .= 'message: ' . $...

javascript - CKEDITOR: How to add additional input to image upload form -

i spent whole day trying add additional input image upload form in ckeditor dialog. need send value through post when image uploaded. i've tried add input manualy of course doesn't work. ideas? here javascript ckeditor.on('dialogdefinition', function(ev) { var dialogname = ev.data.name; var dialogdefinition = ev.data.definition; if (dialogname == 'image') { dialogdefinition.onshow = function () { var dialog = ckeditor.dialog.getcurrent(); var element = dialog.getelement(); var iframe = $(element).find('iframe.cke_dialog_ui_input_file'); var form = iframe.contents().find('form'); form.append('<input type="hidden" name="addinput" value="myvalue">'); }; } }); ...

sql server - Crystal Reports not loading data vb.net -

Image
in project, have button that, when clicked, supposed print contracts active, sql server database. there hundreds of active contracts, @ moment, when press button, report form loads report doesn't. i'll best demonstrate using images , code, able suggest why happens? // code print button private sub btnprintactive_click(sender object, e eventargs) handles btnprintactive.click try dim objlist new reportdocument objlist.load(readini("reports", directorypath & "connectionpaths.ini") & "\contractlist.rpt") dim info crystaldecisions.shared.tablelogoninfo info = new crystaldecisions.shared.tablelogoninfo() info.connectioninfo.databasename = "" info.connectioninfo.servername = readini("contractstring", directorypath & "connectionpaths.ini") info.connectioninfo.password = "" info.connectioninfo.userid = "" ob...

twitter bootstrap - Module @angular/core/index has no exported member "SimpleChanges" -

i'm trying use ng2-bootstrap inside angular 2 application struggling basics. have installed package via npm , trying load tabs solution. component includes lines import {core_directives} '@angular/common'; import {tab_components} 'ng2-bootstrap/ng2-bootstrap'; ... , minified js file referenced in index.html file. when try , transpile using gulp build following error error ts2307: cannot find module '@angular/forms' ... when install angular forms error reverts to module ... @angular/core/index has no exported member "simplechanges" can please point novice in right direction.

How can I make my JUnit tests run in random order? -

i have classical structure tests, have test suite of different suites databasetests, unittests etc. suites contains other suites slowdatabasetests, fastdatabasetests etc. what want randomize running order of tests make sure not dependent each other. randomization should @ every level, suite should shuffle test class order, , test class should shuffle test method order. if possible in eclipse best. you have sortable can't see how use it. you extend blockjunit4classrunner , have computetestmethods () return randomized copy of super.computetestmethods(). use @ runwith set runner use. e.g. package com.stackoverflow.mlk; import java.util.collections; import org.junit.runners.blockjunit4classrunner; import org.junit.runners.model.initializationerror; public class randomblockjunit4classrunner extends blockjunit4classrunner { public randomblockjunit4classrunner(class<?> klass) throws initializationerror { super(klass); } ...

Restricting output classes in multi-class classification in Tensorflow -

i building bidirectional lstm multi-class sentence classification. have in total 13 classes choose , multiplying output of lstm network matrix dimensionality [2*num_hidden_unit,num_classes] , apply softmax probability of sentence fall 1 of 13 classes. so if consider output[-1] network output: w_output = tf.variable(tf.truncated_normal([2*num_hidden_unit,num_classes])) result = tf.matmul(output[-1],w_output) + bias and [1, 13] matrix (assuming not working batches moment). now, have information given sentence not fall given class sure , want restrict number of classes considered given sentence. let's instance given sentence, know can fall in 6 classes output should matrix of dimensionality [1,6] . one option thinking of put mask on result matrix multiply rows corresponding classes want keep 1 , ones want discard 0, in way lose of information instead of redirecting it. anyone has clue on in case? i think best bet is, seem have described, using weighted cro...

google spreadsheet - Apply conditional formatting to whole rows only if multiple rows render true? -

i have advertising campaign tracker have rows name, jobcode, startdate , endate. multiple lines have same job code, each of them can have different end date. need apply conditional formatting rows have enddate has passed – if end date has passed rows same jobcode. have searched forum , various places online without luck, appreciate advice on this. i have created sample sheet may at. have created formatted sample of want achieve @ bottom. feel free play on top one. sample spreadsheet thanks in advance! this formula work when applied a3:g8 (or further down spreadsheet): =countifs($d$3:$d$8,$d3,$g$3:$g$8,">="&today())=0 the $d in $d3 keep formatting formula locked on column d applied across columns a:g . use in custom formula option of conditional formatting

Import table from R into PostgreSQL DB -

i loaded spatial data postgresql db r of rpostgresql-package , st_astext : dbgetquery(con, "select id, st_astext(geom) table;") after having done analyses want go way. geom column stil formated character / wkt. unfortunately dbwritetable doesn't accept similar arguments dbgetquery . what best way import spatial data r postgresql? up way found, importing data db , using st_geomfromtext in additional step geometry data type. i created table on db using dbwritetable() , postgistools-package insert data (it must spatialpolygonsdataframe). ## create empty table on db dbwritetable(con, name=c("public", "<table>"), value=(dataframe[-c(1:nrow(dataframe)), ])) require(postgistools) ## insert postgis_insert(con, df=spatialpolygonsdataframe, tbl="table", geom_name="st_astext") dbsendquery(con, "alter table <table> rename st_astext geom;") dbsendquery(con, "alter table <table> alter c...

awk - set "\x3b" as a delimiter -

i have file including genes in following format. want process file , make each row show 1 gene (separate multiple genes in 1 line multiple lines). c10orf32 c10orf32,c10orf32-asmt c19orf33\x3byif1b c19orf73,lin7b c19orf73,ppfia3\x3blin7b i used following command , want set "," , "\x3b" delimiters, "\x3b" still in outfile, show below awk 'begin {fs=",|\x3b";} {for (i=1;i<=nf;i++) {print $i}}' file.txt output: c10orf32 c10orf32 c10orf32-asmt c19orf33\x3byif1b c19orf73 lin7b c19orf73 ppfia3\x3blin7b but want c10orf32 c10orf32 c10orf32-asmt c19orf33 yif1b c19orf73 lin7b c19orf73 ppfia3 lin7b what doing wrong? awk 'begin {fs=",|\\\\x3b"} {for (i=1;i<=nf;i++) {print $i}}' file.txt this works. don't know why though, many time double backslash again work...

android - Menu Button on ViewPager toasts wrong position -

i loading local htmls in webview using viewpager. works fine , right page loaded webviewfragment viewpager activity. scroll or swipe works fine, added menu button title of current webview, , toast it. menu button returns webview title of next 2 webview pages in viewpager. reducing setofscreenlimit 1 toasts webview title of next webview page in viewpager. cant setofscreenlimit 0. probable way current item's webview title when menu button clicked. need , save db. code: viewpager viewpager pager = (viewpager) findviewbyid(r.id.pager); tabspageradapterenglish pageadapter = new tabspageradapterenglish(getsupportfragmentmanager()); bundle extras = getintent().getextras(); int value = 0; if (extras != null) { value = extras.getint("keyhtml"); } pager.setadapter(pageadapter); pager.setcurrentitem(value); pager.setoffscreenpagelimit(1); adapter public class tabspageradapterenglish extends fragmentpageradapter { private ...

android - Custom view is measured incorrectly when placed with another view elements -

i created custom view want place in relativelayout button under it. problem i'm having if put button under custom view using android:layout_below="@id/customview", customview takes full height, there's no space on screen place button, it's placed below bottom border of screen , therefore invisible. size receive @ last call of customview's onmeasure() method should calculated, i.e. view sizes should taken account, seems in case height of button not. here's layout: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/darkbluebackground" tools:context="com.example.timepickeractivity"> <com.example.timepicker android:layout_width="match_parent" android:layout_height="match_parent" andro...

c++ - Why does C++17's std::any not allow returning a movable value by any_cast? -

while implementing c++17's std::any according specification available in wiki stumbled across seemed nonsensical me: in definition of free function std::any_cast , used retrieve values std::any instance, overload r-value references supplied (it's third one): template< class valuetype > valuetype any_cast(any&& operand); // (3) now, there requirement listed below synopsis applies overloads 2 , 3 (that means including r-value overload): 2-3) returns *any_cast<std::remove_reference_t<valuetype>>(&operand) the definition does not seem allow moving data! the function call redirected pointer-based overload; information temporary nature of operand is lost! is intended can't move out of instance? error in wiki? wrong here? the issue in wp status @ time of writing this, which means : wp - (working paper) - proposed resolution has not been accepted technical corrigendum, full wg21/pl22.16 committee has voted a...

python - How can I check if each row in a matrix is equal to an array and return a Boolean array containing the result? -

how can check if each row in matrix equal array , return boolean array containing result using numpy? e.g. a = np.array([[1,2,3],[4,5,6],[7,8,9]]) b = np.array([4,5,6]) # expected result: [false,true,false] the neatest way i've found of doing this, is: result = np.all(a==b, axis=1)

java - mocked JSONObject cannot retrieve value that was added -

i think there's wrong when i'm trying spy jsonobject using mockito . here's code unit test method: jsonobject json = new jsonobject(); json.put("token","value"); jsonobject spyjson = mockito.spy(jsonobject.class); powermockito.whennew(jsonobject.class).withanyarguments().thenreturn(spyjson); service.gettoken(json.tostring()); here's beggining of method gettoken() : public loginresponsedata gettoken(string response) throws jsonexception { jsonobject resjson = new jsonobject(response); //resjson = {} here //do stuff } in build.gradle i've added: testcompile 'org.json:json:20140107' i think code have written fine. make sure library( java-json.jar ) jar using correct one. i've re written same code of yours in custom created class jsontest bellow , works fine. i've downloaded java-jason.jar form here has same package mentioned in comment " org.json.jsonobject " (you can try using li...

python - Should I use `__setattr__`, a property or...? -

i have object 2 attributes, file_path , save_path . unless save_path explicitly set, want have same value file_path . i think way __setattr__ , following: class class(): ... def __setattr__(self, name, value): if name == 'file_path': self.file_path = value self.save_path = value if self.save_path == none else self.save_path elif name == 'save_path': self.save_path = value but looks it's going give me infinite loops since __setattr__ called whenever attribute set. so, what's proper way write above , avoid that? this looks kind of unpythonic. can use attributes. 3 lines of code: >>> class class: ... def __init__(self, file_path, save_path=none): ... self.file_path=file_path ... self.save_path = save_path or file_path ... >>> c = class('file') >>> c.file_path 'file' >>> c.save_path 'file' >>> c...

bash - Airflow pass parameters to dependent task -

what way pass parameter dependent tasks in airflow? have lot of bashes files, , i'm trying migrate approach airflow, don't know how pass properties between tasks. this real example: #sqoop bash template sqoop_template = """ sqoop job --exec {{params.job}} -- --target-dir {{params.dir}} --outdir /src/ """ s3_template = """ s3-dist-cp --src= {{params.dir}} "--dest={{params.s3}} """ #task of extraction in emr t1 = bashoperator( task_id='extract_account', bash_command=sqoop_template, params={'job': 'job', 'dir': 'hdfs:///account/' + time.now().strftime("%y-%m-%d-%h-%m-%s")}, dag=dag) #task upload in s3 backup. t2 = bashoperator( task_id='s3_upload', bash_command=s3_template, params={}, #here need dir name created in t1 depends_on_past=true ) t2.set_upstrea...

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e...

mysql - How to fix breaking changes with flyway? -

i have mysql database. in 1 of earliest schema versions there script created table null primary key (yes bug in mysql <= version 5.6) when upgrading server mysql57 migration stops @ point , cannot continue because of migration script not compatible anymore. i mean, cannot fix migration script schema v3 when in v11 now, , has checksum also. how handle kind of situations? it seems, 1 possible solution modify old migration script , call repair before migration correct checksums.

c# - Visual Studio 2015: WebTest Validate Response with Regex -

i'm try use regex validate response text in webtest. validationrulefindtext class, have option use regex validate response text web request. example: response text: {"success":true, "data":"foo bar"} validationrulefindtext validationrule = new validationrulefindtext(); validationrule.findtext = @"/(/""success/"":true)/ig"; validationrule.ignorecase = true; validationrule.useregularexpression = true; validationrule.passiftextfound = true; foobarrequest.validateresponse += new eventhandler<validationeventargs> (validationrule3.validate); for reason it's not recognizing validationrule.findtext regex , fails because literally can't find /(/"success/":true)/ig in response. if familiar this, appreciated :) this easy work out using visual studio. take .webtest file can used sandbox file. add find text validation rule correct settings , run "generate code" command. correct c...

Android: How do I get text to label my Floating Action Button from the XML file? -

Image
this question has answer here: floatingactionbutton text instead of image 4 answers the following code creates blank floating action button (fab): <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:c android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" app:fabsize="auto" app:tint="@color/white" /> i know can add overlay image android:src="@drawable/ic_add" or similar, possible use text directly? the floatingactionbutton extends imagebutton, not support text.

vba - Fetch the last value of a range of cells -

i (dynamically) fetch last value of range. therefore have following code. range("c13").select range(selection, selection.end(xldown)).select x1 = selection.end(xldown).select msgbox (x1) this gives true in stead of looking (the actual value of cell). thoughts on should value? replace lines one: msgbox cells(rows.count,3).end(xlup).value it return value of last cell in column c has value.

osx - How to set environment variables for apps on El Capitan -

i'm trying set environment variables programs launch (e.g. eclipse) can access. tried plist, doesn't work, not because of plist per se, launchctl setenv isn't doing expect. example: $ /bin/launchctl setenv aaa ccc $ echo $aaa $ where going wrong? for reference, plist file contents this: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>label</key> <string>setenv.flex_home</string> <key>programarguments</key> <array> <string>/bin/launchctl</string> <string>setenv</string> <string>flex_home</string> <string>/users/me/dev/apps/flex</string> </array> <key>runatload</key> <true/> <key>serviceipc</key> ...

How to access a network excel file with different credentials using vba? -

i've created vba code group of people in our company can "stamp" word document unique number stored in excel sheet on network drive (essentially giving serial#). these people not have access said network drive, i'd them able execute vba code. i've been reading on various articles on site , others last couple days, , able adapt this post work me. however, if try , execute vba code more once, "multiple connections" error described in original answer. seems, then, mapped drive not being removed. simple syntax issue? or missing in removenetworkdrive statement? servershare = "\\servername\path" username = "domain\username" password = "password" set networkobject = createobject("wscript.network") set fso = createobject("scripting.filesystemobject") networkobject.mapnetworkdrive "", servershare, false, username, password str_wbpath = servershare & "\mrl number generator.xlsm"...

html - Less than and Greater than symbols are converting to '->' on the browser -

i working on spring mvc web application have static text inside jsp. using tiles render views declared <meta charset="utf-8"> in baselayout jsp add import on top of jsp "<%@ page language="java" contenttype="text/html;charset=utf-8"pageencoding="utf-8"%>" i confused why browser converting > , < symbols wired direction symbols -> , <- this code snippet <p>it's white powder > 90-95% degree of acetylation , ph of 7.0-8.0</p> i have used &gt; no luck please help.

VBA - Array or Collection -

i'm trying wrap head around jagged arrays, or array of arrays, , having difficulty locating more advanced resources. i've seen lot of buzz collections being far superior arrays, non-rectangular data sets. my original thought create 4 static arrays , 1 4-dimensional array, couldn't them work dummy data set. real data set: u.s. air force hierarchy. flights in squadrons squadrons in groups groups in wings 4 sets (wings, groups, squadrons, flights) if there 3 items in every set (let's [a, b, c]) how end array or collection , function? 1 optimal? how know answer? (this sounds test question, i'm trying learn. plus, takes vba classes nowadays anyway?) posted mobile app.

python - How to parse an XML file to a list? -

i trying parse xml file list python. have looked @ solutions on site , others , not make them work me. have managed in laborious way seems stupid me. seems there should easier way. i have tried adapt other peoples code suit needs not working not sure of reading. this xml file: <?xml version="1.0"?> <configuration> <location name ="location"> <latitude>54.637348</latitude> <lathemi>n</lathemi> <longitude>5.829723</longitude> <longhemi>w</longhemi> </location> <microphone name="microphone"> <sensitivity>-26.00</sensitivity> </microphone> <weighting name="weighting"> <cweight>68</cweight> <aweight>2011</aweight> </weighting> <optionallevels name="optionallevels"> <l95>95</l95> <l90...

python - Avoid reading all data into memory from hdf5 file when performing operations -

i'm new hdf5 format, , i'm using h5py these operations. i'm wondering happens when have large data set , perform kind of operation on it. instance: >>> f = h5py.file("mytestfile.hdf5", "w") >>> dset = f.create_dataset("mydataset", (100000000,), dtype=np.float64) >>> dset[...] = np.linspace(0, 100, 100000000) >>> myresult = f["mydataset"][:] * 15 # graph myresult, or is entirety of myresult in memory now? dset in memory? there way read disk memory part part, 100,000 points @ time or so, avoid overflow (let's assume might end data far larger example, say, 50gb worth)? there way efficiently, , in modular fashion (such saying data * 100 automatically operation in chunks, , stores results again in new place)? in advance.

java - Android call javascript function with parameters without webview -

i call javascript function parameters java in android app, don't need load in webview need call , results js file in assets folder. i did on ios using javascriptcore, can't find same functionality in android. looked androidjscore , rihno docs , tutorials not clear on subject. i load js file string , further can't go how send parameters , results. here how load file string : assetmanager assetmanager = getassets(); string jsfile; // load js file inputstream input; try { input = assetmanager.open("authenticate.js"); int size = input.available(); byte[] buffer = new byte[size]; input.read(buffer); input.close(); // byte buffer string jsfile = new string(buffer); resulttv.settext(jsfile); log.d("tag", jsfile); } catch (ioexception e) { e.printstacktrace(); } the parameters send come edittexts. the javascript function take 2 paramet...

Jmeter java -jar ApacheJMeter.jar doesn't pickup -t option -

if used java -jar /absolute/path/to/apachejmeter.jar -t test.jmx, start gui without test.jmx if used java -jar ./apachejmeter.jar -t test.jmx, show gui test.jmx opened. thanks if use absolute path -jar option you'll need include absolute path test.jmx -t option. e.x. -t /absolute/path/to/test.jmx , unless test.jmx happens in current directory.

Followed git-flow model, not sure if branches are correct -

Image
i tried follow git-flow branching model in github repo. after following instructions, arrived @ point of merging release branch develop branch. did no issues, , proceeded remove release branch (also no issues). now i'm positioned in develop branch, , when git status tells me there commits need pushed: $ branch ahead of «origin/develop« 3 commits. these 3 commits did on the, merged , deleted, release branch. at point i'm not sure should getting notice, git push anyway git asking me to. finally got github , @ network, looks this: is how these 2 branches supposed after following git-flow model? green line confuses me, would've expected see 2 lines: master , develop . you expected: the black line is the green line come far left the unexpected: i suppose branched develop release branch in case fine if branch future release branches develop branch. the 2 blue dots see after branching of green line equivalent green do...

How to set different inner page log in wordpress theme -

i have purchased wordpress skilled theme development want know how set different logo different pages, i have used transparent header logo color white that's why want change inner pages logo's. link :- www.iihr.edu.in you can create widget position logo & use widget logic plugin https://wordpress.org/plugins/widget-logic/

shinyapps - Make panels invisible based on an input from another panel - Shiny R -

assume have 3 sidebarpanels, 'cond. 1', 'cond. 2' , 'treatment'. i need make sidebarpanels (cond. 1 , cond. 2) disappear on choosing value 'treatment' drop down menu. if no value chosen treatment, need keep cond. 1 , cond. 2. how done? pl @ screenshot further reference. thanks! shiny dashboard

javascript - I need change this meta refresh redirect structure to window.location method -

i have web-app in nodejs make redirects in using method meta refresh. problem method incompatible firefox (in firefox not work meta refresh). , need redirect goes in browsers , versions. understand best way use window.location method, right? the structure of code make actual redirect is: module.exports = (outcome) => { return "(function(document) {"+ "var meta = document.createelement('meta');"+ "meta.setattribute('http-equiv', 'refresh');"+ "meta.setattribute('content', '0;url=" + outcome + "');"+ "document.head.appendchild(meta);"+ "})(document);"; } how final code window.location method? thank much! you can use window.location.href . a simple example be: window.location.href = 'http://example.com'; or wrapped in function: module.exports = (outcome) => { return "(function(document) {"+ "window...

html - Multi-column flexbox layout rendering as single line in IE11 -

in chrome/firefox/safari, nice three-column layout. in ie11, 1 long line of text. the height of .row equal line-height of text. i've created simple jsfiddle illustrate issue. why happen? body { background: -webkit-linear-gradient(left, #09c 0, #ad258c 28%, #eb2a31 53%, #f8ec2c 77%, #00a255 100%); background: linear-gradient(to right, #09c 0, #ad258c 28%, #eb2a31 53%, #f8ec2c 77%, #00a255 100%); box-sizing: border-box; max-width: 1024px; margin: 0 auto; color: black; padding: 0 7px 7px 7px; } .row { display: -webkit-box; display: -ms-flexbox; display: flex; } .row section { position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-flex: 1; -ms-flex: 1 1 0; flex: 1 1 0; background: white; margin-top: 7px; margin-right: 7px; } .row section:last...

.net 4.0 - Visual Studio 2015 with Update 3 crashes -

starting today visual studio 2015 update 3 crashes ones sees code in text editor. can open solution without opening files fine, error below if text editor open code. more exact can open default.aspx files, crashes on default.aspx.vb file! i tried repair visual studio. didn't work. tried reinstall visual studio, didn't work either. found corrupt files on windows 8.1 related .net framework, after repairing still error. update: extension problem. uninstalling ajax control toolkit didn't resolve problem though. uninstall of visual studio , cleaning install directory (c:\program files (x86)\microsoft visual studio 14.0\common7\ide\extensions) , reinstall didn't work. in end reinstalled windows , installed update 3, worked. this error in event viewer: application: devenv.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.componentmodel.composition.compositionexception @ system.runtime.compilerser...

In Java, how do I overwrite a specific part of a line in a file? -

this question has answer here: java replace line in text file 6 answers i have csv file thats formatted id,text . here example: hellotext,how goodbyemessage,some new text change errormessage,oops went wrong now lets example want edit text part of goodbyemessage some new text change , see later the resulting csv should this: hellotext,how goodbyemessage,see later errormessage,oops went wrong i have code can write file when code finishes executing, resulting csv file: hellotext,how goodbyemessage,some new text change errormessage,oops went wronggoodbyemessage,see later i know occurring because set filewriter's append value true . if don't gets wiped. i have tried using filewriter.newline() make better not trying achieve. still want same number of line in file. myapp.java public static void main(string[] args) throws filenotfoundexception...

python - How would I collapse rows based on a value in a column? -

i’ll describe mean in more detail here. suppose have data sheet looks this: +-----------+---------+---------+---------+---------+---------+---------+--------------+ | | person1 | person2 | person4 | person4 | person5 | person6 | city | +-----------+---------+---------+---------+---------+---------+---------+--------------+ | january | - | - | yes | - | yes | - | sanfrancisco | | febuary | yes | - | - | - | - | - | sanfrancisco | | march | - | - | - | - | - | - | sanfrancisco | | april | - | - | - | - | - | - | newyork | | may | yes | - | - | - | - | - | newyork | | june | - | - | - | - | - | - | newyork | | july | - | - | - | - | yes | - | newyork | | august | - | ...

coreclr - Switched shared PCL to target .NET Platform Standard, now receive BadImageFormatException -

Image
i have pcl going use in asp.net core project. on pcl project viewed properties > library , clicked "target .net platform standard". went down hill fast. reverted changes using tfs. now, though tfs showing no changes project, if try run webapi 2.2 project (within same solution) depends on pcl, error: edit: if publish web api project iis works, debugging broken.

is it correct to add self like in this case in ruby on rails -

i trying make available repost post in app...i see in youtube video code.. class pin < activerecord::base validates_presence_of :bio belongs_to :user mount_uploader :image, pictureuploader def repost repost_pin = self.dup repost_pin.save end is correct use self here? , possible change this: def repost dub end in end repost called on instance variable @post(@post = post.find(params[:id]) ) .... maybe misunderstanding here...anyone can help? you can skip self when clear context reading current instance's attribute or calling method. when writing should more careful this: def write test = 'test' end will create local variable test if there attribute same name. alternatively, this: def write self.test = 'test' end will assign value current instance's attribute named test . in example skip self since dup method of object , therefore available in current context valid identifier: def repost repost_pin =...

Swift: Programmatically add UIButton above keyboard -

i'm trying add (custom corner radius of 25.0) uibutton hover above keyboard in view controller. i have tried accomplishing on own adding button toolbar following code, however, not looking toolbar: let toolbar = uitoolbar(frame: cgrectmake(0, 0, self.view.frame.size.width, 50)) toolbar.barstyle = uibarstyle.default loginbutton.titlelabel?.textcolor = uicolor.whitecolor() loginbutton.backgroundcolor = uicolor.redcolor() loginbutton.titlelabel?.text = "sign up" loginbutton.addtarget(self, action: #selector(signup), forcontrolevents: .touchupinside) let custombutton = uibarbuttonitem(customview: loginbutton) toolbar.items = [custombutton] toolbar.sizetofit() //... //when credentials valid, show/enable button... usernameemailfield.inputaccessoryview = toolbar how can add uibutton hover above keyboard @ times? thank you. this 1 works me. please try this //create toolbar object let donetoolbar: uitoo...