Posts

Showing posts from August, 2013

javascript - Loading Highcharts in an iframe -

i'm trying load chart (using highcharts) in iframe, load highcharts console returns $(...).highcharts not function $('<iframe id="panel_frame_container" frameborder="0"/>').load(function(){ $('#panel_frame_container').contents().find('body').append("<div id='panel_chart_container'></div>").end() .find('body').append('<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"><\/script>').end() .find('body').append('<script src="https://code.highcharts.com/highcharts.js"><\/script>').end() .find('body').append('<script src="https://code.highcharts.com/highcharts-more.js"><\/script>').end() ...

ios - Parse Swift UITableView Accessory -

i have following code, , trying implement accessory uitableview. data parse, though there tutorials out there helping out on how normal accessory, unable find 1 teaches on how if getting data online db parse. // // listdoctors.swift // ihealthtwo // // created david on 10/1/16. // copyright © 2016 ƒ. rights reserved. // import uikit import parse class listdoctors: uitableviewcontroller { @iboutlet var listdoctors: uitableview! var doctorname = [string]() var doctorrate = [nsinteger]() var doctordetail = [string]() var refresher: uirefreshcontrol! func refresh() { let query = pfquery(classname: "doctors") query.orderbydescending("createdat") query.findobjectsinbackgroundwithblock( { (listll: [pfobject]?, error: nserror?) -> void in if error == nil { // find succeeded. print("successfully retrieved \(lis...

debugging - Java Flow of execution - overridden method gets executed first than the constructor -

i have following code, in same java file. import javax.swing.swingutilities; import java.io.file; public class mainclass2{ public static void main(string[] args){ swingutilities.invokelater(new runnable(){ public void run() { javax.swing.jfilechooser jfc = new myfilechooser(); file file = jfc.getselectedfile(); } }); } } class myfilechooser extends javax.swing.jfilechooser{ public myfilechooser(){ system.out.println("constructor call"); } @override public java.io.file getselectedfile(){ system.out.println("call getselectedfile"); return null; } } when run it, output gives me call getselectedfile constructor call call getselectedfile shouldn't output be constructor call call getselectedfile i'm using java 5. myfilechooser 's constructor equivalent to: public myfilechooser() { super(); // ***...

Are C/C++ fundamental types atomic? -

are c/c++ fundamental types, int , double , etc., atomic, e.g. threadsafe? are free data races; is, if 1 thread writes object of such type while thread reads it, behavior well-defined? if not, depend on compiler or else? no, fundamental data types (e.g., int , double ) not atomic, see std::atomic . instead can use std::atomic<int> or std::atomic<double> . note: std::atomic introduced c++11 , understanding prior c++11, c++ standard didn't recognize existence of multithreading @ all. as pointed out @josh, std::atomic_flag atomic boolean type. guaranteed lock-free , unlike std::atomic specializations. the quoted documentation from: http://open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf . i'm pretty sure standard not free , therefore isn't final/official version. 1.10 multi-threaded executions , data races two expression evaluations conflict if 1 of them modifies memory location (1.7) , other 1 reads or modifies sam...

c# - How to convert System.Drawing.Brush to string -

this question has answer here: c# brush string 3 answers i cannot find correct solution this string colorname = ...converting... brushes.brown; colorname should have 'brown' is possible? to desired result, can use: string colorname = nameof(brushes.brown); now colorname should have value 'brown' .

powershell - test-path not working when in a scheduled task -

i have script return list of database backup files on number of remote database servers. i use test-path check if unc path exists, if exists returns list of files using get-childitem . when test script test-path works @ command prompt when run script in scheduled task returns false. i have tried number of different ways use test-path none of them work. script runs under same account @ command prompt , schedule task. the schedule task runs highest privileges , whether user logged on or not. the script located on script server , called via unc, tested way @ command prompt , in scheduled task on mssql database server. if(test-path -path "filesystem::$targetuncfolder") { ... } and $localuncfolderexists = test-path -path $targetuncfolder if($localuncfolderexists -eq $true) { ... } and if($(try {test-path -path $targetuncfolder} catch {$false})) { ... } if bypass test-path , allow drop get-childitem, returns number of items correctly foreach ...

postgresql - Postgres - Convert Date Range to Individual Month -

i have found similar help, issue more complex, basics of sql , striking out here. handful of columns a,b,c,startdate,enddate , need parse data out multiple rows depending on how many months within range. eg: a,b,c,1/1/2015, 3/15,2015 become: a,b,c,1/1/2015,value_here_doesnt_matter a,b,c,2/1/2015,value_here_doesnt_matter a,b,c,3/1/2015,value_here_doesnt_matter does not matter if start date or end date on specific day, thing matters month , year. if range included day in given month, i'd want output start days each month in range, 1st default day. could have advice on direction begin? i'm attempting generate_series, unsure if right approach or how make work keeping data in first few arbitrary columns consistent. i think generate_series way go. without knowing rest of data looks like, start this: select a, b, c, generate_series(startdate, enddate, interval '1 month')::date my_table

symfony - Payum - Dispatched event on capture? -

i'd know if payum (or payumbundle) dispatch event when payment captured? aim send confirmation email customer. i found nothing doc, , found 3 events in code source : payum.gateway.pre_execute payum.gateway.execute payum.gateway.post_execute but guess has no connection payment itself. btw, seems never dispatched stripe payment. thanks. payum not dispatch events default. designed extended extension. example if want stuff on instance push notification (paypal ipn) can add extension 1 described here: http://payum.org/doc/1.0/core/instant-payment-notification there extension dispatch events . have manually create , add payum.

c# - why is my passed object getting edited -

i pass 'global' object param method. init new instance of object , set equal original, in head have 2 instances of object. why when change second instance first instance change? never used 'ref'. namespace mynamespace { public class myclass { private myobjectclass myglobalinstance; public void mymethod() { dosomething(myglobalobject); } private string dosomthing(myobjectclass myobjectinstance) { myobjectclass newobject = myobjectinstance; newobject.variable1 = "boo"; //this seems change both newobject.variable1 required , myobjectinstance.variable1 , calling classes object } } } you copying reference object thats problem. create object same properties use memberwiseclone : public class globalobject { public globalobject getcopy() { return (globalobject)memberwiseclone(); } } but have understand difference between shallowcopy , deepcopy your...

Setting value of a specific child element mongodb -

i have following database: > db.test.find().pretty() { "_id" : objectid("56b4c13d7db9acd913ce6e08"), "state" : "helloworld", "items" : [ { "guid" : 123, "uniqueid" : 0 }, { "guid" : 124, "uniqueid" : 1 } ] } and want set guid of items.uniqueid = 1 field 125, result be: { "_id" : objectid("56b4c13d7db9acd913ce6e08"), "state" : "helloworld", "items" : [ { "guid" : 123, "uniqueid" : 0 }, { "guid" : 125, "uniqueid" : 1 } ] } i tried: > db.test.update( {'items.uniqueid' : 1} , { $set : { 'items.guid' : 125 }} ) writeresult({ "nmatched" : 0, "nupserted" : 0, ...

javascript - How do I reset Highcharts bar color back to it's original color? -

i have highcharts version 4.1.10 i have bar chart change color of bar when value exceeds threshold. //timeout calls @ regular interval function mytimeoutfunction() { var xmlrequest = $.ajax({ datatype: "json", url: applicationpath + 'mywebapi/valuestomeasure', cache: false, success: myfunctiononsuccess, error: myfunctiononerror }); } function myfunctiononsuccess(mydata) { if (mydata.value > 500000000) { myseriesdataarray.data.push({ y: mydata.value, color: "rgb(255, 0, 0)" }); } else { myseriesdataarray.data.push({ y: mydata.value); } //... myseries.setdata(myseriesdataarray.data,true); } the series data updated on interval using timeout. when value exceeds threshold works expected , colors bar red. but when value goes below threshold bar stays red. assume color style gets held onto. is there way tell highcharts reset color original color highchar...

c# - How to create serviceclientcredential to be used with Microsoft.azure.Management.compute -

i trying programmatically retrieve hostedservices microsoft.azure.management.compute using c#. requires serviceclientcredential , not know how it. can please me? able them using microsoft.windowsazure.management.compute. here returns instances under resourcemanager not classic instances. thanks in advance. jayashri 1st need create active directory application. use link create ad app https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/ sample code use microsoft.azure.management.compute 13.0.1-prerelease sdk url: https://www.nuget.org/packages/microsoft.azure.management.compute/13.0.1-prerelease public class customlogincredentials : serviceclientcredentials { private string authenticationtoken { get; set; } public override void initializeserviceclient<t>(serviceclient<t> client) { var authenticationcontext = new authenticationcontext("https:/...

c# - How to navigate to a special frame with prism for store apps in Windows 8.1 -

i relative new in sector of app developement windows rt , uwp , have windows 8.1 project want use prism. app (a quiz game) consists of 3 pages , want implement page header same on pages. searched lot don't found solution how implement prism store apps. without prism navigate mainpage , call function "mytargetframe.navigate(typeof(secondpage));" how in scenario prism, possible. thank in advance here's how it. public sealed partial class app : prismunityapplication { public app() { initializecomponent(); } protected override uielement createshell(frame rootframe) { var masterpage = container.resolve<masterpage>(); masterpage.myframe = rootframe; return masterpage; } protected override task onlaunchapplicationasync(launchactivatedeventargs args) { navigationservice.navigate(keys.mainpage, null); return task.fromresult(true); } } and then. public sealed partial...

javascript - How to build a panel that detects both swipe and click events -

using dojo.gesture.swipe i'd able listen swipe event on panel , change it's content accordingly: on(mypanel, swipe.end, lang.hitch(this, function(e) { if (e.dx < -100) { //do e.stoppropagation(); event.stop(e); } })); this piece of code working fine detect swipe event , if swipe movement big enough. however on panel have other listeners on buttons click not work anymore: on(mybutton, 'click', lang.hitch(this, 'onmybuttonclick'))`); any idea go wrong ? thanxs i missing listener on 'tap' event : on(mybutton, tap, lang.hitch(this, onmybuttonclick)); that means when using dojo.gesture , 1 should listen click , tap event if targeting both touch , classic screen.

printing - R force print before function is run -

i have small bit of code want print console before runs user know if(save_data == "y"){ print("please select file folder information populated") file = choose.dir() file.dir=dirname(file) } is there way code print in console before choose.dir() run? you need explicitly flush console if want message reliably appear prior dialog box flushdemo<-function() { cat("please select file folder information populated\n") flush.console() file <- choose.dir() return(file) } flushdemo()

email - Sending Mail via Gmail Stopped -

our system sending emails fine until now. i'm getting following response. can help? the error seems related authentication, password hasn't changed. advise appreciated. 220 smtp.gmail.com esmtp a21sm25596087pfj.40 - gsmtp ehlo rd00155d50d7af.domain 250-smtp.gmail.com @ service, [137.117.9.62] 250-size 35882577 250-8bitmime 250-auth login plain xoauth2 plain-clienttoken oauthbearer xoauth 250-enhancedstatuscodes 250-pipelining 250-chunking 250 smtputf8 auth login 334 vxnlcm5hbwu6 c3vwcg9ydebiawxsaxzpbmcuy29t 334 ugfzc3dvcmq6 amjqyjeymzq= <> please log in via web browser , 534-5.7.14 try again. 534-5.7.14 learn more @ 534 5.7.14 https://support.google.com/mail/answer/78754 a21sm25596087pfj.40 - gsmtp 534-5.7.14 <https://accounts.google.com/continuesignin?sarp=1&scc=1&plt=akgnsbu3x 534-5.7.14 qqwdxkeicbe55evyz8u5pozdceuewmf1echblk4ykmdot0ltgv1bddq_jnms8gkfyw_zaq 534-5.7.14 rmojkajqaxfzrevqobn8mhh8hmmsctmmmvjsux5z805sazschbkmytkfbbrjwali6rtnix 534-5.7.14 ...

Android incompatible types error -

upon compiling i'm getting error: error: incompatible types: <anonymous webviewclient> cannot converted context the error coming line: progress = progressdialog.show(this, "", "loading...", true); this meant class context , think it's this, don't understand context or how fix it. mainactivity.java public class mainactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { progressdialog progress; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); webview webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.setwebviewclient(new webviewclient() { drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout); @override public boolean shouldoverrideurlloa...

javascript - How to change value of input type file in Jquery -

this question has answer here: dynamically set value of file input [duplicate] 4 answers i have got html code <img src="../img/1.jpg" class="img"> <img src="../img/2.jpg" class="img"> <img src="../img/3.jpg" class="img"> <img src="../img/4.jpg" class="img"> <input type="file" name="file" id="file" onchange="bgchange(this)" > and jquery $(".img").click(function(){ var srcat=$(this).attr('src'); $("#file").attr('value',srcat); alert($("#file").val()); }); but not changing value stays empty.is there anyway can change that? you not allowed change value of input[type="fil...

sql server - Join two tables where a date is in the other tables date range -

i'm trying write sql in ssms join 2 tables date. table holds actual date transaction happened select a.client, a.trndate, dbo.transation client trndate 00011547 2001-07-17 00:00:00.000 00011547 2013-07-04 00:00:00.000 00011547 2013-11-13 00:00:00.000 00011547 2014-12-14 00:00:00.000 00011547 2014-12-14 00:00:00.000 table b holds rates transactions should cost effective date. select b.client, b.effdate, b.rate dbo.chargerate b client effdate rate 00011547 2008-04-01 00:00:00.000 1223 00011547 2013-05-28 00:00:00.000 1224 00011547 2013-10-01 00:00:00.000 1302 00011547 2014-01-01 00:00:00.000 1355 00011547 2014-04-01 00:00:00.000 1376 00011547 2014-07-01 00:00:00.000 1397 as can see transaction date can fall inbetween effective periods joined table below. client trndate rate 0...

rest - jboss 6 dojo error 415 Unsupported Media Type -

i know error quite common, things i've read , tried , nothing works. @get @path("test") @produces(mediatype.application_json + ";charset=utf-8") //@produces(mediatype.text_html) //@produces(mediatype.text_plain) public string test() { return "{\"name\":\"stewie\"}"; } and in dojo xhr("/csh/rest/test/", { handleas : "json" // headers: {"accept", "application/json"} }).then(function(data) { console.log(data); }); it works fine in tomcat 7. not in jboss 6. please note not using resteasy, jersey. thank much. it comes down this: dojo sucks. how come in official documentation find things tagged "not known @ time" ? the answer problem switch jquery. here , there had specify datatype="json" in call , it.

How to configure an alternate remote desktop public port for an Azure Resource Manager virtual machine -

i trying configure alternate remote desktop port (other default 3389) azure resource manager virtual machine (the new kind, not legacy classic one). i know how classic kind (via endpoints), can not find option new resource manager one. the furthest got discovering can manipulate rules network security group associated vm, don't see option there map specific public port 3389 private port given vm. any ideas? many thanks! i think below sample template looking for https://github.com/azure/azure-quickstart-templates/blob/master/101-vm-with-rdp-port quote above sample "rdpport": { "type": "int", "defaultvalue": 50001, "metadata": { "description": "public port number rdp" } }

Garbage Collection for String Class in Java -

in code have declared initialized string variable , printed hashcode, reinitialized value , invoked garbage collector clear dereferenced objects. but when reinitialize string variable original value , print hashcode, same hashcode getting printed. how? public class testgarbage1 { public static void main(string args[]) { string m = "java"; system.out.println(m.hashcode()); m = "java"; system.gc(); system.out.println(m.hashcode()); m = "java"; system.out.println(m.hashcode()); } } hash code relates object equality, not identity. a.equals(b) implies a.hashcode() == b.hashcode() (provided 2 methods have been implemented consistently) even if gc taking place here (and weren't referencing strings in constant pool), wouldn't expect 2 string instances same sequence of chars not equal - hence, hash codes same. string = new string("whatever"); str...

file - Why do I get this output? (Python) -

numbers.txt has 2 lines: 123 , 456 when run this: list = open('numbers.txt').read().splitlines() print list it gives me output: ['{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf340', '{\fonttbl\f0\fswiss\fcharset0 arialmt;}', '{\colortbl;\red255\green255\blue255;}', '\paperw11900\paperh16840\margl1440\margr1440\vieww8860\viewh6060\viewkind0', '\deftab720', '\pard\pardeftab720\sl480\sa144\partightenfactor0', '', '\f0\fs32 \cf0 \expnd0\expndtw0\kerning0', '123\', '456}']

Kentico text/xml transformation conditional statmement -

i have transformation, used repeater, slider. working well. have slide caption, isn't required. i'm struggling conditional statement caption tag doesn't show. here's transformation: <section class="imageslide"> <figure role="group"> <img src="{% slideimage %}" alt="{% slidealt %}"> <figcaption><p>{% slidecaption %}</p></figcaption> </figure> </section> what i'm hoping not render figcaption if there no slidecaption. slidecaption isn't required item. had though if using jquery change display type of <p></p> tags empty, want avoid lot of dom manipulation. i know syntax this, haven't found example can use base solution. {% if(....) %} something should work. didn't test it, may need tweaks. {% ifempty(slidecaption, "","<figcaption><p>" + slidecaption + "</p...

c++ - How to use VC++ modules in CMake -

ms visual c++ 2015 update 1 implements modules proposal . here example of how works: sources: // c.ixx | // b.ixx | // a.cpp module gm; | import gm; | import fm; export void g() {} | module fm; | int main() { f(); } | export void f() { g(); } | build commands: set cl=/ehsc /experimental:module # default flags cl.exe cl.exe /c c.ixx # produces c.obj, gm.ifc cl.exe /c b.ixx # depends on gm.ifc, produces b.obj, fm.ifc cl.exe /c a.cpp # depends on fm.ifc, produces a.obj link.exe a.obj b.obj c.obj # produces a.exe dependency graph: c.ixx → gm.ifc → b.ixx → fm.ifc → a.cpp ↘ ↓ ↙ c.obj b.obj a.obj ↘ ↓ ↙ a.exe each module has 1 file.ixx exports. file compiled modulename.ifc , file.obj . if file imports module m , m.ifc ...

typescript - Can ngClass use ternary operator in Angular 2? -

in angular 1, code below works well. <div ng-class="$vara === $varb ? 'css-class-1' : 'css-class-2'"> but when try similar thing in angular 2. not work. i added directives: [ngclass] <div [ngclass]="vara === varb ? 'css-class-1' : 'css-class-2'"> how should write in angular 2, thanks! edit: mistake, accidentally added { } whole vara === varb ? 'css-class-1' : 'css-class-2' . ngclass still can use ternary operator in angular 2. yes. wrote works: <div [ngclass]="vara === varb ? 'css-class-1' : 'css-class-2'"> plunker the result of expression on the right-hand side has evaluate 1 of following: a string of space-delimited css class names (this expression returns) an array of css class names an object, css class names keys, , booleans values maybe had other error in code?

css3 - Disabling back ground of the popup using angularjs without using bootstrap -

i want have popup , background screen disabled using divs, ng-class, ng-style , css3 styles. not want use bootstrap modal. have been struggling work. trying show , hide popup doing disabling screen without displaying popup. below code html code <div id="popupbackground" class="popupmodal-backdrop" ng-if="newuser===true" ng-style="{'display': (newuser===false || newuser===undefined) ? 'none':'block'}"> <div id="popupbackgrounddialog" class="popupmodal-dialog"> <div class="popupmodal-content"> <div class="popupmodal-body"> <p style="margin-left: 20px;"> <strong>is user transferring dept?</strong> </p> <p style="margin-left: 40px;"> <input ng-click="" name="transfer" value="yes" type=...

javascript - Change CSS if input value has specfic text ( Using plus minus buttons) -

i have input box plus , minus buttons want show div pete (display: block) if input box reaches value 50. tried using keyup works if manually put 50 value , not using plus minus buttons (in case, have disabled input). js fiddle <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <p id="pete" style="display:none;">pete</p> <div class="sp-quantity"> <div class="sp-minus fff"> <a class="ddd" href="#">-</a> </div> <div class="sp-input"> <input type="text" class="quntity-input" value="52" disabled /> </div> <div class="sp-plus fff"> <a class="ddd" href="#">+</a> </div> </div> jquery : $(".ddd").on("click", function() { var $button = $(this); var oldvalue = $bu...

html - Looking for the right MS FrontPage code in listbox -

i want update online amendments on existing content in table field (access database). for update syntax found necessary (frontpage) codes here : https://support.microsoft.com/en-us/kb/240090 (i use fp 2003) before changing content want online-user sees existing content of specific field cell , structure input. therefore coded listbox (combobox): <tr> <td valign="top" width="110"><b>team1:</b></td> <td width="100"><select name="team1" size="1" valign="middle"> **<option selected value="<%=fp_fieldhtml(fp_rs,"team1")%>"></option>** <option value="john">john</option> <option value="joseph">josé</option> <option value="next">next</option> ... <option value="alan">alan</option></select></td></tr> the codeline in bold should display exi...

ios - Having trouble launching with scrollview in 'Closed' state -

i using scrollview 2 containers in order add slide out menu tabbed app working on. when app launched, if user logged in, main page presented , left slide menu closed. however, if user not logged in , has main page via login button, main page presented menu open. cannot figure out how present closed. in mainviewcontroller func used close menu initially func closemenu(animated:bool = true){ scrollview.setcontentoffset(cgpoint(x: leftmenuwidth, y: 0), animated: animated) } in viewdidload call following close menu dispatch_async(dispatch_get_main_queue()) { self.closemenu(true) } i using nsnotifications toggle menu open , closed via button on main page. tried post 'togglemenu' notification when login button tapped not work pfuser.loginwithusernameinbackground(username!, password: password!) { (user: pfuser?, error: nserror?) -> void in if user != nil { print("successful login") ...

iMacro to generate random text or random numbers for twitter -

i want tweet randomly won't message twitter saying tweeted that. here code isn't working random text. how can add can enter random text/numbers tweet? code: version build=8961227 recorder=fx tab t=1 url goto=https://twitter.com/ wait seconds=1 event type=click selector="#tweet-box-home-timeline" button=0 wait seconds=2 events type=keypress selector="#tweet-box-home-timeline" chars="#twitter " wait seconds=2 event type=click selector="#timeline>div:nth-of-type(2)>div>form>div:nth-of-type(2)>div:nth-of-type(2)>button" button=0 wait seconds=4 if want random text set defined you, try this: tab t=1 url goto=https://twitter.com/ wait seconds=1 event type=click selector="#tweet-box-home-timeline" button=0 wait seconds=2 ' define , add texts here set texts "['randomtext1', 'randomtext2', 'randomtext3']" set rndtext eval("var texts = eval('{{texts}}...

ruby - Mongoid; ERROR Mongo::Error::OperationFailure: not authorized for query -

i creating application using ruby/grape , mongoid. when try create or find document in collection using mongoid, example admin.create following error: error mongo::error::operationfailure: not authorized query on databse.collection i can log in mongo console , create/find documents fine credentials use in mongoid.yml. mongoid.yml: production: clients: default: database: my_db hosts: - myhost:port username: db_user password: my_password you're format off. try this production: clients: default: database: my_db hosts: - myhost:port options: user: db_user password: my_password notice options section , username user

java - Android studio 2d game fps issue -

i trying develop may first android game in 2d. intend build scratch without use of engine. have manage create following thread: import android.graphics.canvas; import android.view.surfaceholder; public class mainthread extends thread { private int fps = 30; private double averagefps; private gamepanel gamepanel; private surfaceholder surfaceholder; private boolean running; public static canvas canvas; public mainthread(surfaceholder surfaceholder, gamepanel gamepanel) { super(); this.surfaceholder = surfaceholder; this.gamepanel = gamepanel; } @override public void run() { long starttime; long timemillis; long waittime; long totaltime = 0; int framecount = 0; // how many milliseconds take run through loop long targettime = 1000 / fps; while (running) { starttime = system.nanotime(); canvas = null; // try lock canvas pixel editing try { canvas = this.surfaceholder.lockcanvas(); ...

parameters - Statistics: Maximum Likelihood and Method of Moments -

i trying find maximum likelihood estimators , method of moments of following: g(x;w;s) = pdf = 1/we^((-x-s)/(w)), x > s for finding mee of s , w, know have solve following 2 functions: (1) xbar = mu (2) 1/n summation xi^2 = mu^2 + var i found e[x] = mu = integral s infinity x*1/we^((-x-s)/w)dx = e^(-2s/w)(w+s) i found e[x^2] = var = integral s infinity x^2*1/we^((-x-s)/w)dx = e^(-2s/w)(2w^2+2ws+s^2) from here have 2 equations: (1) xbar = e^(-2s/w)(w+s) (2) 1/n summation xi^2 = mu^2 + e^(-2s/w)(2w^2+2ws+s^2) now know need solve 2 systems of equations, having difficult time solving them. wanted solve first equation either w or s, , substitute second equation, cannot figure out. wondering if integrated on correct bounds? made sense me, might wrong. since couldn't further using mme, attempted method of maximum likelihood , got following: p(x1=x1, x2=x2,...,xn=xn) = p(x1=x1)p(x2=x2)...p(xn=xn) = g(x1;w;s)g(x2;w;s)...g(xn;w,s) = 1/we^((-x1-s)/w) * 1/we^((-x...

html - Vertical align button in the middle of the column- bootstrap -

i using bootstrap , trying vertically align button in column. note : cant use flex , can't define height per standards. if use margins won't work in tablet , mobile devices. so below code : .col-xs-2, .col-xs-6 { display: inline-block; } .col-xs-2 { vertical-align: middle; } <div class="container"> <div class="row"> <div class="col-xs-4"> <h4>some large label wrap multiple lines in small screens</h4> </div> <div class="col-xs-6"> <h4>some large label wrap multiple lines in small screens</h4> </div> <div class="col-xs-2"> <button class="btn" style="color: #660066;"> <i class="fa fa-arrow-left" data-ng-click="onclickback()"></i> </button> </div><!--...

using the $app object inside a controller (Lumen) -

ok im farly new lumen , laravel , im trying make api https://packagist.org/packages/codenexus/lumen-geoip work in lumen, installed via composer , im able use , obtain locations based on ip given when im inside routes.php but when i'm using same code inside controller doesnt let me proceed cause $app variable not defined. this code works inside routes $app->geoip->getlocation('148.210.21.180')->country->names['en'] i have been reading service container me in solution feel lost... in advice help. the $app variable not available inside controllers, may use app() method anywhere in code access application object. so, try in controller: app()->geoip->getlocation('148.210.21.180')->country->names['en']

python - Transform and remap an equirectangular image with a 90° roll -

Image
i have transform , remap equirectangular image other equirectangular image 90° roll. i did pano2vr . the problem have programmatically server side . can't use g.u.i. it. first, oriented research imagemagick . tried fred imagemagick scripts not find want do. moreover, processing time of image appears long compared pano2vr . i directed investigations opencv , libgnomonic . it's presently interesting way. library allows te user transform projections (equirectangular rectilinear , vice versa) or make equirectangular mapping transformation . played norama-suite wich contains scripts deal library. example, convert rectilinear image equirectangular the output black background image (why ? didn't find answer). however, second link resolve problem. have image : and want transform image well, i'm not comfortable @ c. think should use 2 files : https://www.github.com/foxelsa/libgnomonic/blob/master/src/gnomonic-transform.h https://www.github.com/fox...

java - Two parameters in struts.xml -

i working on struts2, have action, , want pass 2 parameters action, .jsp i doing this: <action name="inscribirse" class="tdp.proyectoweb.manejadorjugadoraction" method="executeinsertarjugador" > <result name="success">mensajes.jsp?m=jugador confirmado</result> <result name="error">mensajes.jsp?m=error: no se puede agregar al nuevo jugador</result> </action> see use ?m=message pass 1 parameter, want pass two. tried this: <result name="success">mensajes.jsp?m=message1&d=message2</result> but didn't work how can solve this?

url - PHP cURL - ★ symbol? -

i need json bitskins, create code. (below) code works urls, have problem url: https://bitskins.com/api/v1/get_price_data_for_items_on_sale/?api_key=xxx&code=xxx&names=★ bayonet,★ bayonet | blue steel (battle-scarred),★ bayonet | blue steel (factory new) my code: $url = urlencode('https://bitskins.com/api/v1/get_price_data_for_items_on_sale/?api_key=xxx&code=' . $totp . '&names=' . $string); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/41.0.2228.0 safari/537.36'); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_returntransfer, 1); $output = curl_exec($ch); $output = json_decode($output, true); i tried without urlencode(), still nothing. symbol ★ or comma in url? (in browser url works well) thank much! you wouldn't want encode entire u...

Java : How to create a 64 bit array in java to store larger than Integer_max-value -

i trying find sum of primes. execute in smaller time have precomputed in long array last 2 test cases appearing wrong. reason overflow i.e. max value can accommodated in integer.max_value trying provide large value. need large value : test link : https://www.hackerrank.com/contests/projecteuler/challenges/euler010/ this code : import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class solution { public static void main(string[] args) { /* enter code here. read input stdin. print output stdout. class should named solution. */ scanner sc = new scanner(system.in); int count,n,t; long ans[] = new long[10000001]; ans[0] = 0; ans[1] = 1; ans[2] = 2; ans[3] = 5; ans[4] = 5; // ans[2] = 5; for(int m=5;m<100000;){ count = 0; if(m%2==0){ count++; } // for(int i=3;i<=...

clojure - IndexedSeq VS. PersistentVector -

can explain me, difference between 'indexedseq' , 'persistentvector'? i bumped this, when updating vector in data structure via 'rest'. here's repl excerpt shows transformation. => (def xs [1 2 3]) ... (type xs) cljs.core/persistentvector => (def xs2 (rest xs)) ... (type xs2) cljs.core/indexedseq i'm holding list in app-state atom, needs shifted once in while, first item must disappear. cool, if give me hint data structure might preferable here in terms of performance. elements pushed end of list well, guess it's lifo mechanism i'm creating here. from last paragraph, sounds you're using stack. taken together, pop , peek , , conj form stack interface can used either lists or vectors (working on front of list or end of vector). use those. if you're using functions, don't think there should significant performance differences (all 3 functions should constant time).

javascript - Use current web directory when navigating to page or url -

i'm updating old web app (webforms) works in ie 6-9. not written me. also, i'm not expert @ web development, solution might simple. one issue extensive use of window.showmodaldialog , ie specific call opens new browser window disables browser window opened it, popup message. has been replaced jquery modal dialog, there's issue 'url' gets passed it. here's simplified reproduction of issue. there's javascript function takes url , id. function openedit(url, id) { ... this function existed in original version, except had code open modal popup window. replaced necessary jquery. however, url value gets passed in doesn't have enough information. also, assume have no control on value gets passed here. let's main page @ localhost/testsite/main.aspx . there number of frames within page display other pages, localhost/testsite/products/productlist.aspx - clicking item on page might open window localhost/testsite/products/productdetails.aspx . the...

html - How to align text to center this image? -

i have sample: link code html: <div class="col-md-4 tab-bottom"> <div class="tab-bottom-img"><img width="380" height="380" src="http://dg-design.ch/bagel/wp-content/uploads/2016/02/1-380x380.png" class="attachment-news wp-post-image" alt="1"> </div> <div class="tab-bottom-content"> sed perspiciatis <p>sed ut perspiciatis unde omnis iste natus error sit<br> voluptatem accusantium doloremque laudantium,<br> totam rem aperiam, eaque ipsa quae ab illo inventore<br> veritatis et quasi architecto beatae vitae dicta sunt<br> explicabo.</p> </div> </div> code css: .tab-bottom-content { position: absolute; text-align:center; top: 0px; } image width , height vary ... should in m...

javascript - change id and use ajax -

i'm trying change id of button , use ajax, doesn't work. can me? my html code: <form action="" method="post" class="button"> <input type="hidden" id="userid" value="<?=$_get["userid"]?>" /> <button id="button" class="btn btn-primary"> wait </button> </form> my jquery code: <script type="text/javascript"> jquery(document).ready(function ($) { $('#button').countto({ interval: 1000, startnumber: 2, endnumber: 0, onloop: function (self, current, loop) { $(self).text('wait: ' + current); }, onfinish: function (self, current, loop) { document.getelementbyid("button").innerhtml = "close"; document.getelementbyid("button").id = "go"; } }); }); </script> ...

python - Pass Pandas DataFrame to Scipy.optimize.curve_fit -

i'd know best way use scipy fit pandas dataframe columns. if have data table (pandas dataframe) columns ( a , b , c , d , z_real ) z depends on a, b, c , d, want fit function of each dataframe row (series) makes prediction z ( z_pred ). the signature of each function fit func(series, param_1, param_2...) where series pandas series corresponding each row of dataframe. use pandas series different functions can use different combinations of columns. i've tried passing dataframe scipy.optimize.curve_fit using curve_fit(func, table, table.loc[:, 'z_real']) but reason each func instance passed whole datatable first argument rather series each row. i've tried converting dataframe list of series objects, results in function being passed numpy array (i think because scipy performs conversion list of series numpy array doesn't preserve pandas series object). your call curve_fit incorrect. the documentation : xdata : an m-length sequence o...