Posts

Showing posts from January, 2010

actionscript 3 - How insert a custom shape in imported external dynamic text in flash -

Image
is possible insert arrow or in imported external text in flash. this: with var textfield:textfield = new textfield(); textfield.htmltext = "<img src='../image.gif'>" + externaltext; you can embed custom images in textfield. see adobe documentation more. another way use special characters. in windows: open character map clicking start button, clicking programs, clicking accessories, clicking system tools, , clicking character map. copy-paste special characters code: textfield.htmltext = "► " + externaltext + "♫♪♫";

Trying to create a "provider" in scala using generics -

i trying create provider class in scala return correct object when called trait trait remotevalidator[a <:widget]{ def processremotevalidation(request: eventrequest[_], widget: a): future[seq[widget]] } class extending trait class resourceinstancelistremotevalidator @inject() extends remotevalidator[instancelistwidget[instancewidget]] { override def processremotevalidation(request: eventrequest[_], widget: instancelistwidget[instancewidget]): future[seq[widget]] = { //stuff } provider class remotevalidatorprovider[t] @inject()(resourceinstancelistremotevalidator: resourceinstancelistremotevalidator) { val validators = map("resources" -> resourceinstancelistremotevalidator) def getremotevalidator(key: string): option[remotevalidator] = { validators.get(key) } } the issuse when call provider.processremotevalidation(request, instancelistwidget) "type mismatch expected type a, actual instancelistwidget[instancewidget]. know work in j

jquery - error messages were produced once only -

i have below jquery code check start , end dates , error message shows once , if user changed end date wrong values no error messages produced. there i'm missing ? $('input[name="enddate"]').change(function(){ var startdate=$('input[name="startdate"]'); var enddate=$('input[name="enddate"]'); var errorspan= $('.errorspan'); $.ajax({ url:'${createlink(controller:'empref', action: 'checkservicedatesajax')}' , type:'post' , data:{startdate:startdate.val(), enddate:enddate.val()} , success: function(xmlhttprequest, textstatus, jqxhr) { }, error: function(xmlhttprequest, textstatus, errorthrown) { errorspan.html("&nbsp;&nbsp;&nbsp;&nbsp;<font color='red'>"+xmlhttprequest.responsetext+"</font>").fadeout(5000); enddate.focus(); }

VHDL component output returns zeros -

i'm writing in vhdl essay , i'm facing strange situation. i've written components, simulated , tested them, , seems works fine. however, when simulating top entity, i'm getting zeros result! please take @ following listings: top entity: library ieee; use ieee.std_logic_1164.all; entity foobar port ( data_i : in std_logic_vector(39 downto 0); sum_12bit_o : out std_logic_vector(11 downto 0) ); end foobar; architecture behavioral of foobar --declare components component four_10bit_word_adder port( --input signals a_byte_in: in std_logic_vector(9 downto 0); b_byte_in: in std_logic_vector(9 downto 0); c_byte_in: in std_logic_vector(9 downto 0); d_byte_in: in std_logic_vector(9 downto 0); cin: in std_logic; --output signals val12bit_out: out std_logic_vector(11 downto 0) ); end component; -- signal declaration signal int: std_logic_vector(11 downt

C++ regex parsing numbers out of string -

i trying extract numbers string in same row format. following code extracts numbers, not record last row of 4s. how should change regex repeated row of numbers? #include <iostream> #include <vector> #include <string> #include <regex> using namespace std; const string data ="4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4," "4,8,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,7,8,3,3,3,3,3,3,7,8,3,3,3,3,3,3,7,4," "4,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,6,1,1,1,1,1,1,5,6,1,1,1,1,1,1,5,4," "4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4"; int main() { regex e("[1-9]"); sregex_token_iterator rit(data.begin(), data.end(), e); sregex_token_iterator rend; int = 0; std::vector<std::vector<int>> double_array; double_array.reserve(4); std::vector<int> row; row.reserve(40); while(rit != rend)

email - I have this code to send mail from java showing error -

package controller; import java.util.properties; import javax.mail.*; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage; public class sendmail { static string = "******@gmail.com"; static string pass ="*****"; static string = "****@gmail.com"; static string host = "smtp.gmail.com"; public static void main(string[] args) { properties properties = system.getproperties(); properties.put("mail.smtp.starttls.enable", "true"); properties.put("mail.smtp.host", host); properties.put("mail.smtp.user", from); properties.put("mail.smtp.password", pass); properties.put("mail.smtp.port", "587"); properties.put("mail.smtp.auth", "true"); session session = session.getdefaultinstance(properties);

function - Local variable referenced before assignment in Python -

truel="" count = 0 finle_touch=false #true after find first 3 upperletter # check if there 1 lower letter after 3 upper letter def one_lower(i): count=0 if == i.lower: finle_touch=true truel=i # check 3 upper letter def three_upper(s): in s: if count == 3: if finle_touch==true: break else: one_lower(i) elif == i.upper: count +=1 print(count) #for debug else: count ==0 finle_touch=false stuff="dsfsffsfsssfsfsffssfsssssssss......." three_upper(stuff) print(truel) so got alot of string on 'stuff' , find 1 lowercase letter sorrund 3 uppercase letter. but when run code get: traceback (most recent call last): file "c:\python33\mypy\code.py", line 1294, in <module> three_upper(stuff) file "c:\python33\mypy\code.py", line 1280, in three_upper if count == 3: unbo

matrix - Parallelization Fortran 90 -

i started learn how parallelize programs in fortran , trying include in program. the problem using lapack (to calculate eigenvalues , eigenvectors) , apparently creating conflict parallelization routine, because depending on matrix size calculates eigenvalues (wrong values small sizes, , doesn't compute them @ matrices equal or bigger 10x10). when run program 1 thread works correctly. program nuevo use omp_lib implicit none integer ::i,j,k,l,kk,jj,red,ok,info,lwork,stat1 integer :: m,n,q,rea,i0,j0,chunk,chunksize !!!! rea= number of realizations >1 parameter(m=10,n=10,rea=12,lwork=2*m*n,ok=m*n,chunksize=rea/2) complex*8 t,aa,tt,ww !! caution dimension of variables integer, dimension(1):: seed, old integer, parameter :: ikind=selected_real_kind(p=15) real (kind=ikind) :: pi real ( kind = 8 ) wtime real*8 d, dd(m,n),zz, x(2*m*n*rea), xx(m*n,2*rea), ss, hh, harvest(2*n*m*rea), w complex*16 a(m*n,m*n), work(3*n-2,3*n-2) real*8 rwork(2*m*

javascript - Error with multiple components/classes for TabBar in react-native? -

in react-native app, have implemented tabbar , aiming have various components (each defined in own classes) load upon selection of each tab. however, i'm getting error: "onlychild must passed children 1 child", when try select tab on tabbar. var create = require('./create'); var feed = require('./feed'); var icon = require('react-native-vector-icons/ionicons'); var homepage = react.createclass({ render: function() { return ( <tabbarios tintcolor="white" bartintcolor="darkslateblue"> <icon.tabbaritemios title="feed" iconname="ios-star" selectediconname="ios-star" selected={this.state.selectedtab === 'feed'} onpress={() => { this.setstate({ selectedtab: 'feed',

How to understand `JavaScript static methods are also not callable when the class is instantiated` -

i read on mdn . original is: the static keyword defines static method class. static methods called without instantiating class , not callable when class instantiated. i thought static in js similar static in java sentence in question confuses me. it similar. however, java allows calling static methods on instance: p1.distance(p1, p2); which same thing as point.distance(p1, p2); the first 1 not allowed in javascript.

Copy command for folders with \..\ and \= names with .bat files -

i searched everywhere on google , there doesn't seem solution. xcopy, copy, robocopy, parsing literal string via variable, wildcard characters.. copy c:\soulworker\datas\bin\table\nf2\data12.v c:\soulworker\datas\=true_english\ /r c:\soulworker\datas\bin\table\nf2\english\ %%f in (*.res) copy %%f c:\soulworker\datas\bin\table\nf2\data12.zip\..\bin\table\ on = equals sign in path or file name, read cmd syntax: escape characters, delimiters , quotes : delimiters delimiters separate 1 parameter next - split command line words. parameters separated spaces, of following valid delimiters: comma (,) semicolon (;) equals (=) space ( ) tab ( ) to keep delimiter in file or path name, use double quotes follows: copy c:\soulworker\datas\bin\table\nf2\data12.v "c:\soulworker\datas\=true_english\" on using .. doubled full stop , read naming files, paths, , namespaces : use 2 consecutive periods (..) dir

java - Store Jtextfield input in Arraylist then print contents of Arraylist -

this first time creating gui. can create text fields fine, having trouble collecting user input , storing input arraylist. import java.awt.flowlayout; import java.awt.event.actionlistener; import javax.swing.jtextfield; textfield1 = new jtextfield("enter resident name",20); add(textfield1); textfield2 = new jtextfield("how many accounts enter data for?",20); add(textfield2); textfield3 = new jtextfield("enter account #",20); add(textfield4); textfield3 = new jtextfield("enter data account",20); add(textfield5); if user enters "4" textfield2, "enter account #" , "enter data account" appear 4 times (resulting in 8 new textfields) i user able click "store" button places textfields 1-5 (and more if want enter lot of accounts) arraylist can later retrieved , print all stored array info (show resident , accounts info), similar below: arraylist accounts = new arraylist<>()

How to Go to New Screen/Page in Android Studio? -

i have quick question regarding android studio. so first of new thing don't me wrong if make mistake. so doing have created title screen app called "canada quiz". , below title have "start" button. , done far have attached code this: once start button clicked hide it. question. how make once clicked should hide start button , show question , true , false button. have this. want questions appear person taps start button. , in content_main.xml have phone model witch displays start button , canada quiz. please me out possible thank you! package com.example.nilesh.myapplication; import android.os.bundle; import android.support.v4.view.viewpager; import android.support.v7.app.appcompatactivity; import android.view.view; import android.view.menu; import android.view.menuitem; import android.widget.button; import java.util.arraylist; public class mainactivity extends appcompatactivity { private button startbutton; private button truebutton;

reactjs - How to publish a jsx file to npm? -

i want publish react component npm, found out it's difficult. file simple, es6 syntax. steps or solution publish npm can install , run locally installed react? have read article http://chadly.net/2015/04/publishing-react-to-npm/ , seems outdated , failed following it. use babel-cli transpile file es5 , publish file. put source-files in 1 folder, e.g. src , install babel , add build entry npm scripts (package.json/scripts): "build": "babel --out-dir=lib src" . no every time call npm run build . transpiled code in lib folder. in index.js refer lib folder-folder. of course can add build script npm hooks such "prepublish": "npm run build" or similar,

php - Laravel Handling Undefined offset: 0 -

in view in input value field using {{ old('facebook', $sitesocialdata->facebook)}} , in controller have below code. is there way can hide offset db error if there no data in db? db empty. controller: $sitesocialsettingsdb = socialsettings::get(); $sitesocialsettingsdata = $sitesocialsettingsdb[0]; if write: $sitesocialsettingsdb::first(); it returns instance of model if exists, , null if doesn't.

node.js - Writing mocha test for nodejs -

i beginner nodejs, need know how write mocha test nodejs variable definitions. for example, if had object this, var objectname = { filename : '', filepath : '' } then how can write mocha test variable definition. please me write test code. in advance! i don't test kind of stuff usually, can make (using chai.expect) : var obj = { name:'' }; describe('my object definition', function(){ it('should give me empty name', function(){ expect(obj.name).to.equals(''); }); });

java - How do I split a string with any whitespace chars as delimiters? -

what regex pattern need pass java.lang.string.split() method split string array of substrings using whitespace characters (' ', '\t', '\n', etc.) delimiters? something in lines of mystring.split("\\s+"); this groups white spaces delimiter. so if have string: "hello[space][tab]world" this should yield strings "hello" , "world" , omit empty space between [space] , [tab] . as vonc pointed out, backslash should escaped, because java first try escape string special character, , send that parsed. want, literal "\s" , means, need pass "\\s" . can bit confusing. the \\s equivalent [ \\t\\n\\x0b\\f\\r]

parsing - PHP Parse/Syntax Errors; and How to solve them? -

Image
everyone runs syntax errors. experienced programmers make typos. newcomers it's part of learning process. however, it's easy interpret error messages such as: php parse error: syntax error, unexpected '{' in index.php on line 20 the unexpected symbol isn't real culprit. line number gives rough idea start looking. always @ code context . syntax mistake hides in mentioned or in previous code lines . compare code against syntax examples manual. while not every case matches other. yet there general steps solve syntax mistakes . references summarized common pitfalls: unexpected t_string unexpected t_variable unexpected '$varname' (t_variable) unexpected t_constant_encapsed_string unexpected t_encapsed_and_whitespace unexpected $end unexpected t_function … unexpected { unexpected } unexpected ( unexpected ) unexpected [ unexpected ] unexpected t_if unexpected t_foreach unexpected t_for unexpected t_while unexpected t_do

android - Java static modifier query -

if declared class static , it's content static mean contents of class no longer static? here's happened, used viewholder in custom adapter in android. when code this: static class viewholder { static textview blah; //more widgets } the listview had repetitive data , rows shuffled on scroll. however, when did this, no duplicates created. there 1 instance of each list item created , items didn't shuffle on scroll. static class viewholder { public textview blah; //more widgets } now, know public default access specifer , did not have change. double static cancel each other out? double negative positive? the static modifier on class makes sense if inner class. static inner class implies instance of inner class can exist independently without instance of outer class. the static modifier on member variable implies there 1 copy of variable instances of enclosing class. so, there no effect of static modifier on class on static mod

javascript function internal scope property -

what difference in internal scope property assigned on function declaration , on entering function execution context? definition: [[scope]] property written , stored in function object. [[scope]] in contrast scope (scope chain) property of function instead of context. link:( http://dmitrysoshnikov.com/ecmascript/chapter-4-scope-chain/#function-creation ) what mean :as function gets declared assigned scope property or during execution time scope property gets assigned. this closure concept. worded differently here normal. there 2 things going on -- first have closure, variables declared locally context of function definition made available function. "scope chain" refers to. in addition, locally defined variables (var statements within function) don't exist until function starts @ "execution context". (typically these stored on stack or heap).

android - Superpowered native functions not available at runtime -

i have got cross example android studio 2.0 i successful build , deploy android device moment runs fails java main activity can't find native methods built in example cpp file. cpp building correctly. java.lang.unsatisfiedlinkerror: no implementation found void com.clayteq.audiosupertest.mainactivity.superpoweredexample(java.lang.string, long[]) (tried java_com_clayteq_audiosupertest_mainactivity_superpoweredexample , java_com_clayteq_audiosupertest_mainactivity_superpoweredexample__ljava_lang_string_2_3j) @ com.clayteq.audiosupertest.mainactivity.superpoweredexample(native method) @ com.clayteq.audiosupertest.mainactivity.oncreate(mainactivity.java:57)`` i'm missing somewhere! appears object cpp operation not being included. the superpo

Implementing section indexer in list view android -

i want add section headers in list view in android attached image. can 1 me code. don't want implement side section indexer in contacts. image this custim list adapter have created- public class customlistadapter extends baseadapter { private activity mcontext; private list<string> mlist; private layoutinflater mlayoutinflater = null; public customlistadapter(activity context, list<string> list){ mcontext = context; mlist = list; mlayoutinflater = (layoutinflater)mcontext.getsystemservice(context.layout_inflater_service); } @override public int getcount() { return mlist.size(); } @override public object getitem(int pos) { return mlist.get(pos); } @override public long getitemid(int position) { return position; } @override public view getdropdownview(int position, view convertview, viewgroup parent) { return super.getdropdownview(posi

node.js - nodejs npm unable to install globally from github URL -

i able install locally using git url how install npm package github directly? however, once add "-g" flag - fails. here entire log guym@guym-ubuntu:~/dev_env/projects_git/cosmo/gs-tmp$ sudo npm -g install git://github.com/visionmedia/express.git npm http https://registry.npmjs.org/connect/2.8.3 npm http https://registry.npmjs.org/commander/1.2.0 npm http https://registry.npmjs.org/range-parser/0.0.4 npm http https://registry.npmjs.org/mkdirp/0.3.5 npm http https://registry.npmjs.org/cookie/0.1.0 npm http https://registry.npmjs.org/buffer-crc32/0.2.1 npm http https://registry.npmjs.org/fresh/0.1.0 npm http https://registry.npmjs.org/methods/0.0.1 npm http https://registry.npmjs.org/cookie-signature/1.0.1 npm http https://registry.npmjs.org/send/0.1.2 npm http https://registry.npmjs.org/debug npm http 304 https://registry.npmjs.org/connect/2.8.3 npm http 304 https://registry.npmjs.org/range-parser/0.0.4 npm warn package.json range-parser@0.0.4 no repository field. n

javascript - jquery pagination refersh (pagining not remembering the changed styles in previous pages ) -

i returning list of items view controller. in view using j query plugin pagination show list in pages. action method is public actionresult messages() { list<message> listmessagesheader = new list<message>(); listmessagesheader.add(new message(){data="hi", isstared=false, messageid=11}); listmessagesheader.add(new message(){data="hi", isstared=false, messageid=0}); listmessagesheader.add(new message(){data="hi", isstared=false, messageid=1}); listmessagesheader.add(new message(){data="hi", isstared=false, messageid=2}); listmessagesheader.add(new message(){data="hi", isstared=false, messageid=3}); listmessagesheader.add(new message(){data="hi", isstared=false}, messageid=4); listmessagesheader.add(new message(){data="hi", isstared=true}, messageid=5); listmessagesheader.add(new message(){data="hi", isstared=true}, messageid=6); listmessag

java - Values in the array when inserted in the loop -

i'm unable figure out why myarray[i] in program below printing 0 3 times. int[] myarray = new int[6]; (int = 0; <= 5; i++) { myarray[i] = i++; system.out.println("myarray:"+myarray[i]); //need know how print object myarray[i]? } system.out.println("outside for" +arrays.tostring(myarray)); my output is: myarray:0 myarray:0 myarray:0 outside for[0, 0, 2, 0, 4, 0] i'm not understanding why myarray 0.. the default value of int in java zero. therefore int array initialized 0 in of it's indexes. during first iteration of loop following variable states... myarray = [0, 0, 0, 0, 0, 0]; = 0; the value of 0 therefore 0 inserted myarray[0]. incremented. printing value of myarray [1] '0'. @ end of loop following state of variable... myarray = [0, 0, 0, 0, 0, 0]; = 1; now value of incremented loop , value of becomes 2. inserting value of 2 myarray [2] . , value of incremented because of post increme

algorithm - Placing archers on wall -

Image
i have matrix (with 0 , 1), representing castle wall , surroundings. my task place n archers on wall in way, covers surroundings can. there 2 rules: 1 : every archer has range 1 - means, can shoot on adjoining tiles (each tile has 8-neighbours), aren't wall (friendly fire banned in army!). 2 : if happens, multiple archers can shoot @ same tile, tile counts one. i struggling find effective solution - partially because don't know, if there exist in polynomial time. is there any? i guess first step use bfs algorithm rate every tile on matrix, don't know how effectivelly solve second rule. brute force solution quite simple - rate every position , try of them, very uneffective - think o(|possible placements|^n), isn't nice. simple example: the grey-colored tiles represents wall. numbers inside tiles representing coverage of archer placed on tile. sure, added orange ones, representing coverage of archer standing on tile b2. , last information - correct solu

sql server casting some data -

i got numeric(8,0) date column, values 20130101 . need cast date format , queries. my test query looks this select * hund isdate(hund.hfdat) = 1 , cast((left(convert(varchar(8),hund.hfdat),4) + substring(convert(varchar(8),hund.hfdat),5,2) + right(hund.hfdat,2)) datetime) between '20050101' , '20300101' i error conversion failed when converting date and/or time character string. i guess 'date' column bad data. suggestion write in other way? i want jack this, dogs not older 10 years select ras_.rasnamn 'ras', count(distinct person.personid) 'antal ägare', count(distinct jbv_aegare.hundid) 'antal djur' jbv_aegare inner join hund on jbv_aegare.hundid=hund.hundid inner join ras_ on hund.ras=ras_.raskod inner join person on jbv_aegare.personid=person.personid inner join postnummerlan on person.postnr=postnummerlan.pn_postnummer inner join land on postnummerlan.pn_lan=land.landkod postnr <> 0 ,

java - Configure security schemas and contexts in Springfox and Spring MVC -

i have simple rest services implemented spring mvc. decided describe them springfox , swagger 2.0. seemed ok until started adding security schemas , contexts. use http basic authentication endpoints , token-based authentication others. whatever do, cannot see option set http basic authentication credentials or specify token in swagger ui. below configuration. simplicity's sake apply both schemas endpoints here. @configuration @enableswagger2 public class swaggerconfig { @bean public docket apiv1() { return new docket(documentationtype.swagger_2) .select() .apis(requesthandlerselectors.any()) .paths(pathselectors.any()) .build() .pathmapping("/api/v1") .securityschemes(newarraylist(new basicauth("xbasic"), new apikey("x-auth-token", "xauthtoken", "header"))) .securitycontexts(newarraylist(xbasicsecuritycontext(), xauthtokensecuritycontext()

javascript - Understanding Cranium.js code -

i reading cranium.js ( https://gist.github.com/addyosmani/3769967 ) code addy osmani , not understand 2 lines of javascript do. entire code following: // mix in object in order provide custom events. var events = cranium.events = { channels: {}, eventnumber: 0, trigger: function (events, data) { (var topic in cranium.events.channels){ if (cranium.events.channels.hasownproperty(topic)) { if (topic.split("-")[0] == events){ cranium.events.channels[topic](data) !== false || delete cranium.events.channels[topic]; } } } }, on: function (events, callback) { cranium.events.channels[events + --cranium.events.eventnumber] = callback; }, off: function(topic) { delete cranium.events.channels[topic]; } }; the first line don't understand is: if (topic.split(&

datawindow - Accessing nested report powerbuilder -

datawindow ldwc_addpay dw_1.getchild("dw_addpay",ldwc_addpay) if ldwc_addpay.rowcount() <> 0 li_nestctr = 1 ldwc_addpay.rowcount() ls_payamt = ldwc_addpay.getitemstring(li_nestctr,"pay_amt") if not isnull(ls_payamt) , trim(ls_payamt) <> '' ls_payamt = in_cryptoapi.of_decrypt(ls_payment,"key") ldwc_addpay.setitem(li_nestctr, "pay_amt_dummy", double(ls_payamt)) setnull(ls_payamt) next end if 2nd row , returns nothing (zero) 1st row return exact value. **every row has salary deduction etc.. getchild() won't do. use dot notation instead.

xamarin.ios - Implement error handling and script messages receiving in one WebViewRenderer in Xamarin IOs -

now have code web view renderer like: public sealed class mywebviewrenderer : viewrenderer<webview, wkwebview>, iwkscriptmessagehandler { private const string scriptmessagehandlername = "native"; private wkusercontentcontroller usercontroller; private wkwebview m_nativeview; protected override void onelementchanged(elementchangedeventargs<webview> e) { base.onelementchanged(e); var visualwebview = (imwebview)element; if (control == null && e.newelement != null) { this.usercontroller = new wkusercontentcontroller(); var config = new wkwebviewconfiguration { usercontentcontroller = this.usercontroller }; this.usercontroller.addscriptmessagehandler(this, scriptmessagehandlername); m_nativeview = new wkwebview(this.frame, config) { weaknavigat

javascript - weird ~infinite loop with $http.get -

i'm doing loop polling, wait events, , i'm having trouble infinite loop. here code: var app = angular.module('mainapp', []); app.factory('userevents', function ($http) { var manageevent = function (event) { //do work here //and then, poll: window.settimeout(poll, 0); } var poll = function () { $http({ method: 'get', url: '/get-events', }) .success(function(event, status) { manageevent(event) }); } service = { poll: poll, } return service }); function maincontroller($scope, userevents) { userevents.poll(); } once first event received success method of $http.get executed without request being done, creates loop. @ point magically stops, sending request. it's if function 'poll' using previous $http.get promise, resolved (???) if set timeout of 200ms in 'manageevent' function, pro

android - Change default animation on StackView -

is possible change default animation (in/out) of android stackview (using native android methods)? thanks! http://doc.qt.io/qt-5/qml-qt-labs-controls-stackview.html#popenter-prop transitions the animations can customized assigning different transitions pushenter, pushexit, popenter, popexit, replaceenter, , replaceexit properties of stackview.

python - How to fit data by exponential curve -

Image
i little problem project because have set of data, plot in order 2 curves , fit plots exponential curve. i watched post : fitting exponential decay no initial guessing . example kind different. this i'm getting data : my script following : mask_g = np.bitwise_and( tbdata['g'] < 99.99, tbdata['gerr'] < 0.2) mask_r = np.bitwise_and( tbdata['r'] < 99.99, tbdata['rerr'] < 0.2) g_corrected = tbdata[mask_g] r_corrected = tbdata[mask_r] fig13 = plt.gcf() fig13.set_size_inches(16, 9) fig13, (ax1,ax2) = plt.subplots(1,2) fig_error_g = ax1.plot(g_corrected['g'], g_corrected['gerr'], '.') ax1.set_xlabel('g') ax1.set_ylabel('gerr') ax1.set_title('evolution de gerr en fonction de g') fig_error_r = ax2.plot(r_corrected['r'], r_corrected['rerr'], '.') ax2.set_xlabel('r') ax2.set_ylabel('rerr') ax2.set_title('evolution de rerr en fonction de r

Why does Javascript cast null to string at variable assignment? -

this question has answer here: using variable “name” doesn't work js object 3 answers in firefox 45 on osx , when fetch item localstorage key not exist, function call returns null . tested in console. if instead assign call result variable, , print value in console, "null" , i.e. string. why variable assignment of not defined variable cast call result string? used code (in console): localstorage.getitem("non-existing-key"); // returns null var x = localstorage.getitem("non-existing-key"); x // returns "null" edit: both versions seem behave correctly on chrome 50.0.2661.86 on osx (both return null ) edit2: mistake. used variable name in tests (specifically: var name ). now, if let console return value of variable name , returns window.name , property of window of type string, defaulting "null" . so,

Execute Perl script from Java tomcat returns ever 255 exit code -

i have problem, i'm trying execute perl script allocated on server. if execute command in linux shell, script run correctly. if execute script allocating perl script in same server of apache tomcat, runs ok, when try execute script through ssh tomcat, end error code 255. perl script: #!/usr/bin/perl $sleeptime = 10; sleep($sleeptime); $argumento=$argv[0]; if ( $argumento eq "a" ) { exit 0; } else { exit 192; } now, code in java file string command = "ssh root@myserver.com '/usr/bin/perl /var/www/testperl.pl a'"; process = runtime.getruntime().exec(command); process.waitfor(); if ( process.exitvalue() == 0 ) { system.out.println("show icon ok"); } else { system.out.println("show error"); } if change command variable to string command = "/usr/bin/perl /var/www/testperl.pl a"; the return code ok ( 0 or 192 ) is mandatory execute remotely, can't copy real perl tomcat directory. did loca