Posts

Showing posts from September, 2010

get struts2 multiple checkboxlist value without checkboxlist -

i create multiple checkboxes using iterator in case can't use checkboxlist <s:iterator value="tree" status="statusvar"> <s:property value="opentag" escape="false"/> <s:if test="%{closetag==null}"> <s:checkbox name="%{lable}" fieldvalue="%{lable}" value="%{lable}"/> </s:if> <s:property value="lable" escape="false"/> <s:property value="closetag" escape="false"/> </s:iterator> how can selected values checkboxes

visual studio 2013 - Installing VS Shell Isolated on Windows 8.1 using SCCM 2012 -

first off, know bug happens when installing visual studio 2013 on windows 8.1 using sccm 2012. however, believe bug fixed in update 3. http://blogs.msdn.com/b/vsnetsetup/archive/2014/10/29/error-26403-failed-to-add-user-to-group.aspx i have downloaded , installed visual studio premium 2013 update 4. i have downloaded latest available version of visual studio 2013 shell (isolated). https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx . , when installing sccm 2012, still getting error message present in pre-update 3 versions of visual studio. error 26403.failed add user group. (-2147463168 system performance log users ) does have workaround installing vs shell (isolated) onto windows 8.1 machine sccm 2012 ?

ios - Automatically set height of custom UIView based on its contents? -

i’ve taken lot of time read other questions before asking one, , haven’t managed solve issue yet – can help. i have custom alert view, uiview subclass. i’m trying state width fixed, , height grows dynamically based on height of 2 labels ( title , message ), , dynamic number of action buttons can set with. i’ve used autolayout set controls, working fine, i’m still manually setting frame of view in initialiser. what need have view’s height calculated height of 2 labels, , n buttons, plus spacing between them. i’ve tried providing intrinsiccontentsize view, method never called, , doesn’t ask it, i’m stumped how proceed. to summarise: need ios9’s uistackview , don’t have luxury, need bake similar ios 7 / 8. i’ve looked @ oastackview i’d rather not use external dependency. just quick thought: have tried create view in interface builder? give fixed width priority: 1000. add no height constraint center view vertically in superview. then set view's vertical con...

drop down menu - C# - Nested KeyValuePairs for a dropdown list -

i have dropdown control placed on winform. today datasource dropdown keyvaluepair<'string','string'> , hence easy directly assign 'displaymember' property of dropdown 'value' keyvaluepair. one of requirements has caused datasource changed keyvaluepair<'string', keyvaluepair<'string','string'>. poses problems me when run code. thats because 'displaymember' being set 'value' causes dropdown item shown ('ab') (where 'a' , 'b' respective strings in keyvaluepair<'string','string'> of new datasource). i want assign 'displaymember' property of dropdown 'key' in keyvaluepair<'string','string'> changed datasource. old requirement - keyvaluepair<'string','string'>('a','b') dropdown item shows - 'b' new requirement - keyvaluepair<'string',keyvaluepair<...

How to host a .com or a .net website in Windows Azure? -

i new windows azure, , have read online appears website hosted in windows azure needs .azurewebsites.net website. so, if had website www.mysite.com hosted elsewhere, seems cannot host same site in windows azure, since have use mysite.azurewebsites.net website url. question : above fact true? not find documentation or online article on this. you can host own domain using azure, detailed in this support article (which links walk-through). you can bind domain website or cloud service, believe available in paid tier. (follow-up: using domain available in shared, basic or standard mode .)

php - javascript: scroll to top of page if div becomes visible? -

i using following javascript check see if div visible , if scroll top of page? jquery.php <script> $(document).ready(function() { if ($(".message_box_prompt").is(":visible"); ) { $(".message_box_prompt").scrollintoview(); }); }); </script> my div message_box_prompt being echoed out using session after mysql query executes: mysql / process.php $_session['message'] = '<div class="message_box_prompt"><div class="boxclose2" id="boxclose2" style="float:right; margin:10px; cursor:pointer; cursor:hand;" onclick="this.parentnode.parentnode.removechild(this.parentnode);">&#10006;</div><div class="message_box_text"><strong>oooops!</strong> account limited. cannot make changes account @ time.</div></div>'; header('location: ' . $_server['http_referer']); my session echoed in index.ph...

uibinder - GWT 2.5.1: dynamic required field indicator -

what better approach displaying dynamic required field indicator (in case, display '*' next field if empty, hide if user type something, display again if user clears input field) ? indicator called requiredfieldhighlight in code below. myvalueboxeditordecorator.java public class myvalueboxeditordecorator<t> extends composite implements haseditorerrors<t>, iseditor<valueboxeditor<t>> { interface binder extends uibinder<widget, myvalueboxeditordecorator<?>> { binder binder = gwt.create(binder.class); } @uifield divelement label; @uifield simplepanel contents; @uifield divelement requiredfieldhighlight; @uifield divelement errorlabel; private valueboxeditor<t> editor; private valueboxbase<t> valuebox; /** * constructs valueboxeditordecorator. */ @uiconstructor public myvalueboxeditordecorator() { initwidget(binder.binder.creat...

Importing Electron classes with Typescript -

how can import electron classes typescript file, intellisense functioning? for example, i'd turn this: var browserwindow = require('browser-window'); var app = require('app'); app.on("ready", function() { var mainwindow = new browserwindow({ width: 600, height: 800 }); }); into (doesn't work): /// <reference path="./typings/github-electron/github-electron.d.ts"/> var app = githubelectron.app; app.on("ready", function() { var mainwindow = new githubelectron.browserwindow({ width: 600, height: 800 }); }); use type annotations on return values of require function calls: var browserwindow: githubelectron.browserwindow = require('browser-window'); var app = githubelectron.app = require('app'); app.on("ready", function() { var mainwindow = new browserwindow({ width: 600, height: 800 }); });

apache - Set and check STS Header is present -

Image
i have (hopefully) set apache issue sts header https traffic described in how set hsts header .htaccess on https i hoping able verify working looking @ response header in chrome dev tools there doesn't seem in there related it: is there way check functioning correctly? appreciated. you can check working correctly looking strict-transport-security header in response headers (in dev tools have taken screenshot). if try same request you've made dev tools https://accounts.google.com/ , example, should see entry this: strict-transport-security:max-age=10893354; includesubdomains you on right track, there's wrong way you've configured server.

php - Server SIde My code Not working -

i have integrated paypal php. working in xampp localhost. after code move server showing error ? warning: require_once(e:\web\dotnetpo/abaceu/lms/conf.php) [function.require-once]: failed open stream: no such file or directory in e:\web\dotnetpo\project\abaceu\shopping_cart\paypal.php on line 42 fatal error: require_once() [function.require]: failed opening required 'e:\web\dotnetpo/abaceu/lms/conf.php' (include_path='.;c:\program files (x86)\php\v5.3\pear\pear') in e:\web\dotnetpo\project\abaceu\shopping_cart\paypal.php on line 42 how resolve error? try change e:\web\dotnetpo/abaceu/lms/conf.php to e:\web\dotnetpo\abaceu\lms\conf.php i think it's problem '\' , causes directory issue.

javascript - How to split an array of objects into multiple normal arrays where each array is populated by one property's values? -

i have array of objects follows: var gom = [{name:"kuroko",ability:"misdirection"}, {name:"kise",ability:"perfect copy"}, {name: "akashi", ability: "emperor's eye"}]; is possible split 2 arrays using predefined function in lodash or native javascript(not foreach). ["kuroko","kise","akashi"] , ["misdirection","perfect copy","emperor's eye"] i know can this: var names = []; var abilities = []; gom.foreach(function(member){ names.push(member.name); abilities.push(member.ability); }); but looking way. looks there nothing shorter 2 pluck's lodash: var data = [ {name:"kuroko",ability:"misdirection"}, {name:"kise",ability:"perfect copy"}, {name: "akashi", ability: "emperor's eye"} ]; var names = _.pluck(data, 'name'); var ...

neo4j - SDN 4 - Neo4jOperation.convert() deprecated -

with sdn 3 possible use neo4joperations.convert(object value, class type) convert results cypher query returns iterable<map<string, object>> neo4j domain class (annotated @nodeentity). example: map<string,object> results = repository.findsomething("john"); for(map<string,object> row : results) { person person = neo4joperations.convert(row.get("person"), person.class); ... } // repository method @query("match (person:person)-[rel]->(node) person.firstname = {firstname} return distinct person, count(rel) order count(rel)" iterable<map<string,object>> findsomething(@param("firstname") string firstname); as t convert(object value, class type) no longer exists in neo4joperations in sdn 4, what's equivalence in sdn 4? http://docs.spring.io/spring-data/neo4j/docs/4.0.0.m1/reference/html/#reference_programming_model_simple-mapping doesn't cover how mapping/conversion done explicitly or...

Getting a users complete achievement list through Google+ API -

i run cross-platform achievement tracker, user can gather , show achievements xbox, psn, steam etc. now want add support achievements attached users google account (google+ achievements). can through api somehow? been searching can't find anything.

javascript - Using a webservice to Create PDF only works when the service is called directly -

i'm novice webservices, 1 has me stumped. have created webservice (eventually) accept block of html , create pdf file it. keep simple, i'm not passing parameters service; i'm creating pdf document "hello world" in it. in debug mode, when call service directly (i.e. start debugging asmx page), can invoke exportpdf() method , results perfect -- creates pdf i'd hoped. the problem when call webservice javascript, nothing happens. i've set breakpoint inside service, know it's getting called, , mentioned there no parameters being passed in, don't understand why works when it's invoked directly, not when it's invoked javascript call. my javascript , webservice code below...any greatly, appreciated!! javascript: function getpdf(elem) { var param = { html: elem.innerhtml }; $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: "../webservices/export...

android - RecyclerView not displaying without error -

i have started android development , till had no problem tried insert recyclerview layout , fine there no error recyclerview not displaying. code seems right me. here's code: mainactivity.java : public class mainactivity extends appcompatactivity { private toolbar toolbar; private rvadapter adapter; private recyclerview recyclerview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar = (toolbar) findviewbyid(r.id.app_bar); setsupportactionbar(toolbar); getsupportactionbar().setdisplayshowhomeenabled(true); navigationdrawerfragment drawerfragment = (navigationdrawerfragment) getsupportfragmentmanager().findfragmentbyid(r.id.fragment_navigation_drawer); drawerfragment.setup(r.id.fragment_navigation_drawer, (drawerlayout) findviewbyid(r.id.drawer_layout), (toolbar) findviewbyid(r.id.app_bar)); recyclerview = (recyclerview) findviewbyid(r.id.go...

java - Making built.io calls from Spring -

i have spring web service gets data form , using built.io store information. not sure how create built.io objects spring client. need make rest call json object spring or there library? yes, have make rest calls there no specific sdk available.

javascript - Material UI / material-ui appbar leftnav toggle not working -

i'm using meteor react-packages , have appbar displayed properly, can't nav toggle work. i'm using code straight out of examples , read code in material-ui repo , it's seems should working. doing wrong? let {appbar, leftnav} = mui applayout = react.createclass({ menuitems: [ {route: '/profile/bio', text: 'bio'}, {route: '/profile/photos', text: 'photos'}, {route: '/profile/videos', text: 'videos'}, {route: '/profile/filmography', text: 'filmography'}, {route: '/profile/settings', text: 'settings'}, {route: '/profile/accounts', text: 'accounts'} ], _toggle(e){ e.preventdefault() this.refs.leftnav.toggle() }, render(){ return ( <div> <appbar onlefticonbuttontouchtap={this._toggle} title='react+meteor' /> <leftnav ref="leftnav" docked={false} menuitems={this.menuitems...

c# - Merge duplicate values from a gridview in asp.net -

i have 2 gridview's in page (gridview inside gridview) in main gridview want merge duplicate values of first cells. binding both gridview @ runtime. please help aspx: <asp:gridview id="maingridview" runat="server" autogeneratecolumns="true" showfooter="true" skinid="gridviewmast" emptydatatext="no records found." rowstyle-wrap="true" alternatingrowstyle-wrap="true" cellpadding="6" onrowdatabound="maingridview_rowdatabound" onrowcreated="maingridview_rowcreated"> <columns> <asp:templatefield headertext="action item" itemstyle-horizontalalign="left" itemstyle-wrap="false"> <itemtemplate> <asp:gridview id="grditemnested" runat="server" allowpaging="true"> <columns> </...

ios - Dragging UIImageView into UIViewController -

Image
i working on app, have rootviewcontroller relationship between navigation controller , dashboard controller. can't drag normal uiview, or uiimageview controller anymore in interface builder, doing wrong?

php - Symfony Form with subform -

i have user form , contact form in user form tried add contact form user form when tried add $builder->add( 'contact', new contacttype() ); it failed with you cannot add children simple form. maybe should set option "compound" true? tried set compound didnt work /** * {@inheritdoc} */ public function configureoptions(optionsresolver $resolver) { $defaults = array( 'compound' => true, 'inherit_data' => true, ); $resolver->setdefaults($defaults); } the compound option default set true . how did extend form type class? abstractformtype , or else? did override getparent() method? this explain compound being set false .

oracle - sysdate and current_date have different types? -

the oracle docs sysdate , current_date claim both return dates: sysdate current_date this test, though: alter session set plsql_warnings = 'enable:all'; create table test(x date); create or replace procedure test1 authid definer cursor s select x test current_date > x; begin x in s loop null; end loop; end; / show errors drop table test; drop procedure test1; produces output: errors procedure test1: line/col error 3/42 plw-07204: conversion away column type may result in sub-optimal query plan using sysdate not give same warning. suspect substituting current_date sysdate in queries runs risk of altering query plan, if date columns indexed. edit: select dump(current_date) dual; select dump(sysdate) dual; gives: dump(current_date) typ=13 len=8: 223,7,7,9,11,23,55,0 dump(sysdate) typ=13 len=8: 223,7,7,9,11,23,55,0 1) current_date returns current date in session time zone. need current_date? if not, stick sysdate. work procedure 2...

linux - Remove redundant braces from code -

i trying use tr command or similar command perform specific text manipulation block: if (/*condition*/) { statement1; } int a=3; if (a) { statement1; statement2; } else { statement1; statement2; statement3; statement4; ///may more lines } i want remove single line commands , this: if (/*condition*/) statement1; int a=3; if (a) { statement1; statement2; } else { statement1; statement2; statement3; statement4; ///may more lines } i've tried tr -s '{}' ' ' <file.txt squeezes of braces, not specific single line format. thanks you can set record separator either { or } , check how many fields have. if there more one, print brackets around: $ awk -v rs=[{}] 'nf>1{$0="{"$0"}"}1' file if(true) statement; if(false) { statement1; statement2; }

php - phpunit Google_Client mock -

attempting unit testing ga processing class, can't figure out how correctly mock client object. i'm getting error mock code below. call undefined method google_client::__phpunit_cleanup() public function getmockgaclient() { return $this->getmockbuilder('google_client') ->setmockclassname('google_client') ->getmock(); } to bit preemptive, i'm setting mock name passes parameter check.

ios - Resizing and placing a rotated view in landscape: updating constraints or translating/changing frames? -

Image
i've subview have placed @ bottom of screen in portrait orientation: i've set constraints in storyboard orientation pin leading, trailing, , bottom space superview, fixed height of subview. i want subview @ right side of screen when device in landscape orientation this: in uiviewcontroller subclass behind, apply m_pi/2 radians rotation subview in viewwilltransitiontosize:withtransitioncoordinator: , result: i tried place subview right side of screen want, after rotation call [self.view setneedsupdateconstraints]; , tried set new constraints orientation, i'm not able result want. so, i'm not sure if i'm trying wrong thing... thought setting new constraints pin subview right side of screen, resize height , refresh x , y values... or maybe right way translate rotated subview , change frame? how solve this? thanks edit: example of constraints i'm programmatically setting landscape: nslayoutconstraint *customsubviewconstrainttop = [nslay...

javascript - dynamically change header based on angular js partial view -

i know this question identical, implementation needs changed , can't quite work out do. in answer linked, solution involved using app.config(['$routeprovider', '$locationprovider', function($routeprovider, $locationprovider) { $routeprovider. when('/test1', {template: 'page 1', controller: test1ctrl}) ... app.factory('page', function(){ var title = 'default'; return { title: function() { return title; }, settitle: function(newtitle) { title = newtitle; } }; }); function test1ctrl($scope, page) { page.settitle('title1'); } ... within app.js file. however, , have config of form: ... $routeprovider .when("/", { templateurl: "partials/landing.html", controller:"landingctrl" }) with controller landingctrl defined in file, controllers.ts , this: class landingctrl { public isfirstplay: any; constructor($scope) { $scope.vm = t...

javascript - Sum up cells in a dynamic table -

i have set table using javascript. note have reduced number of rows 1 ease. after loading, user input values in cells. there 3 cells on each row. when value typed in either cell1 or cell2, cell3 should updated automatically. formula cell1(in column: score1) + cell2(in column: score2) = cell3(column: total) however not working. keep getting nan in cell3. can me this? <!doctype html> <html> <head> <title>mp</title> <style type="text/css"> th {font-weight: bold; text-align: left; font-size: 14px; border: 1px; border-style: solid; margin: 0px; border-colapse: colapse; border-spacing: 0px;} td {font-weight: normal; font-size: 14px; border: 1px; border-style: solid; margin: 0px; border-colapse: colapse;} .sn {text-align: right;} .fin {text-align: right;} </style> </head> <body> <table id="pr"> <tbody> <tr class="thd"> <th>score a</th> <th>score b...

php - can't convert date from string -

i want date's timestamp string. i'm trying: datetime::createfromformat("y-m-d", "2015-05-18t23:45:21.604z"); but returns nothing. don't know format this. try this, $date = date_create_from_format('d/m/y:h:i:s', '2015-05-18t23:45:21.604z'); $date->gettimestamp();

swift - Splitting touchesMoved across a single SKSpriteNode -

using spritekit, have created skspritenode called lightsaber, , using touchesmoved method, able either rotate skspritenode or translate left or right. there way make 1 or either depending on grab skspritenode? (e.g. blade or handle) you position of touchevent via cgpoint location = [touch locationinnode:self]; this give capability add custom logic touch screen. example: if(location.x > 300) { //do } else { //do } you make sword in 2 pieces, i.e 2 nodes , name each node , listen touch event on both nodes. get node within touchesbegan by sknode *node = [self nodeatpoint:location]; if([node.name isequaltostring@"handle"]) { } else if ([node.name isequaltostring@"blade"]) { }

Call Python in background from PHP and get output -

i calling long-running python script inside php using exec command. works, , can output using $output parameter exec command. however, php page starts loading bar while exec command running , can't update ui in meantime. basically, trying create loading bar python scripts execution, needs update. doesn't need update based on actual loading time, keep user occupied, know happening. how can start python process, , of output, still have php page able other things @ same time?

How to plot the equalized histogram of an image with Python? -

Image
so code. variable img original image. variable eq equalized image. from matplotlib.pyplot import imread, imshow, show, subplot, title, get_cmap, hist skimage.exposure import equalize_hist img = imread('images/city.tif') eq = equalize_hist(img) subplot(221); imshow(img, cmap=get_cmap('gray')); title('original') subplot(222); hist(img.flatten(), 256, range=(0,256)); title('histogram of origianl') subplot(223); imshow(eq, cmap=get_cmap('gray')); title('histogram equalized') subplot(224); hist(eq.flatten(), 256, range=(0,256)); show() now when run, code, histogram of original fine. histogram of equalized incorrect. of output what doing wrong ?!?! edit: builtin matlab commands the answer works fine particular image it looks it's converting image uint8 format (integer values between 0 , 255 inclusive) float32 or float64 format (floating point values between 0 , 1 inclusive). try eq = np.asarray(equali...

php - PDO insert validation -

i've got code insert correctly, failing give me success message. returns failed add device database, go check database , in fact successfull. ideas? <?php // start or resume session session_start(); //check ensure user authorized view page if (isset($_session['loggedin']) && $_session['loggedin'] == true) { // include header include("includes/header.php"); echo " <div class='form_description'> <h2>french lick resort</h2> <p>status - add ingenico device inventory</p> </div> <form id='update' class='fieldset' method='post' action=''>"; $serial=$_post['serial']; $model=$_post['model']; $devicecondition=$_post['devicecondition']; $sealcondition=$_post['sealcondition']; $location=$_post['location']; $deploydate=$_post['deploydate']; $weigh...

c++ - Return lvalue reference from temporary object -

is, returning lvalue reference *this , allowed when *this rvalue? #include <iostream> #include <string> using namespace std; class { public: a& f() { return *this; } string val() const { return "works"; } }; int main() { cout << a{}.f().val(); } is there scenario value returned f() dangling reference @ point? does calling f() prolongs lifetime of caller if rvalue in example? *this never rvalue in case, (a reference to) temporary. temporaries valid objects until statement defined completed, i.e. until code reaches terminating ; , or until end of controlling expression for , if , while , do , , switch statements, e.g. in if (a{}.f()) { something; } , temporary valid until last ) before body of condition ( { something; } ).

byebug - Need help getting rails server to work -

so feel incredibly frustrated. doing www.railstutorial.org , require specific version of rails (4.2.2). have installed wanted. put in gemfile specs on "hello_app" app provided. when run "rails server" error message saying "byebug" erroring. try install earlier , later versions of bye bug , same error message. can please me? feel pretty lost. the tutorial @ url below. https://www.railstutorial.org/book/beginning#code-hello_action alopex@alopex-th55-hd:~/workspace/hello_app$ more gemfile source 'https://rubygems.org gem 'rails', '4.2.2' gem 'sass-rails', '5.0.2' gem 'uglifier', '2.5.3' gem 'coffee-rails', '4.1.0' gem 'jquery-rails', '4.0.3' gem 'turbolinks', '2.3.0' gem 'jbuilder', '2.2.3' gem 'sdoc', '0.4.0', group: :...

c# - How to protect slash in asp.net mvc and avoid "Failed to map the path" error? -

i've got razor html in area in asp.net mvc project: <td> @html.displayfor(x => x.amoaresponsible, model.amoaresponsible ?? string.empty) </td> everything ok when value of amoaresponsible "lorem ipsum". value "amoaresponsible" contains slash (e. g. "lorem/ipsum") , following error: failed map path '/areas/dashboard/views/psr/displaytemplates/lorem/ipsum.aspx'. i have no idea how fix this. can protect "/" ? your using this overload of @htmldisplayfor() second parameter templatename , specifies name of displaytemplate use render property if value of amoaresponsible (say) "lorem", method search /views/yourcontrollername/displaytemplates folder , search file named lorem.cshtml or lorem.aspx , wont exist, searches in /views/shared/displaytemplates wont exist, uses default displaytemplate (no exception thrown - wasted processing time) if value lorem/ipsum start searching i...

android - How to search word/terms on a webview -

i made button, when clicked search inside of webview. works dont know how implement next/previous , how remove highlight of words. realized can't remove =/ the button: testesearch.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { search("t"); } }); } and method is: public void search(string query) { wv.findallasync(query); } how can next or previous , remove highlight of letters? thx.

ruby - Starting server in rails app dont lead me on the root page. Prototyp.js error occurs in console -

some months ago tried out aptana radrails changed sublime. now whenever start application following console log errors, on localhost:3000 see "welcome aptana radrails" , apart root problem application works still fine. i don't know why happens, because root in routes totally different site. tells me prototyp.js, rails.png , effects.js missing never used them. error in console: started "/images/rails.png" ::1 @ 2015-07-09 00:21:36 +0200 activerecord::schemamigration load (15.0ms) select "schema_migrations".* "schema_migrations" actioncontroller::routingerror (no route matches [get] "/images/rails.png"): actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' web-console (2.1.2) lib/web_console/middleware.rb:37:in `call' actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app' railti...

angularjs - Angular Chart.js not displaying Chart (Legend is Displaying) -

Image
i using angular-chart.js package: http://jtblin.github.io/angular-chart.js/ when load page, legend @ bottom of page shows, chart not displayed. i added divs verify data populated. here code have far: <div> <span> vm.bvpsdata - </span> {{vm.bvpsdata | json}} </div> <div> <span> vm.bvpslabels - </span>{{vm.bvpslabels | json}} </div> <div> <span> vm.bvpsseries - </span>{{vm.bvpsseries | json}} </div> <canvas id="bvpschart" class="chart chart-line" data-data="vm.bvpsdata" data-labels="vm.bvpslabels" data-legend="true" data-series="vm.bvpsseries"> </canvas> when run page , @ code, rendered in html: <div class="ng-binding"><span>vm.bvpsdata -</span>[ [ "6.88", "6.95", "4.31", "4.33", ...

python - Possible to set the x values used in OpenPyxl? -

Image
i'm trying achieve following in openypxl. want use delay times values xaxis. can proper series added chart fine, having issues delay. graph representing desired output. possible? chart_object= charts.linechart() x_axis= charts.reference(overall_stats_sheet, (11,2), (11, 5)) chart_object.set_categories(x_axis) continuing discussion here: https://groups.google.com/forum/#!topic/openpyxl-users/pgl9-9k-xok

wolfram mathematica - Is right-to-left operator associativity in R possible? -

i'm new r, , discovered suffer bracket phobia (see comment in link). way magrittr notation %>% works, because avoids nested parenthesis in situations, , makes code more readable. came mathematica , there similar native // notation %>% does. here r , mathematica comparisons: #r notation c(1.5,-2.3,3.4) %>% round %>% abs %>% sum #mathematica notation {1.5,-2.3,3.4}//round//abs//total so far good, but, question is: is there way mimic mathematica @ notation , right-to-left associativity in r ? here how works in mathematica, solve same code above: total@abs@round@{1.5,-2.3,3.4} in mathematica can write as: total[abs[round[{1.5,-2.3,3.4}]]] just in r be: sum(abs(round(c(1.5,-2.3,3.4)))) but more clean (and cool) have in r this: sum@abs@round@c(1.5,-2.3,3.4) ps: know @ used in s4 classes, , not idea. illustrative comparison. the backpipe package designed , created purpose. provides backpipe (right-to-left) o...

javascript - Convert c# datatable to json array to pass to Google charts -

i want pass c# datatable result chart error saying 'argument given addrows must either number or array' c# string result = ""; result = "["; foreach (datarow row in dt.rows) { result += "['"+row[0]+"',"+row[1]+"],"; } result = result.trimend(',')+"]"; txtjsondata.value = result; javacsript var data = new google.visualization.datatable(); data.addcolumn('string', 'page'); data.addcolumn('number', 'followers'); var chartdata = document.getelementbyid('txtjsondata').value; data.addrows(chartdata); sampledata "[['@flu',401],['@weightloss',1068],['@heartdiseases',223],['@diabetesfacts',356]]" your variable chartdata contains string. need parse before passing addrows . data.addrows(json.p...

random - prevent repetition of the numbers by not use of Collection Shuffle [Java] -

i used random function in code dont know how prevent repetition.also read questions subject dont want use "shuffle". thanks , clues. set doesn't allow duplicates set set = new hashset(); while (set.size() < 20) { set.add(r.nextint(100)); }

php - $_POST in array? -

i have script put terms array , database. below find snippet. working fine, cannot $ post code work correctly. need contains value of 'app ' combined $album['id'] submitted form. pretty sure doing wrong here. can me out? thanks. global $wpdb; $post_id = get_queried_object_id(); $post_author_id = get_post_field( 'post_author', $post_id ); $albums = $wpdb->get_results( $wpdb->prepare( 'select * wp_wppa_albums owner = "' . get_author_name( $post_author_id ) .'"' ), array_a ); $input_terms = array(); if ( $albums ) foreach( $albums $album ) { $input_terms[] = 'app_'.$_post[$album['id']]; //this goes wrong } whoops, bad. easy fix $input_terms[] = sanitize_text_field($_post['app_'.$album['id']]); worked me!

c# - Show binary code of external files/program -

one way or another, digital data stored in 0 , 1. that's principle of binary data, guess. is there method or package can show binary code of file/single-exe-program of how being stored in 0/1 format?? i see like: - import certain, random file - convert it's 0/1 format - store the 1/0-data in txt (streamwriter/binarywriter) if yes, available in .net language (pref: c#)? essentially need break 2 steps: convert file bytes convert byte binary string the first step easy : var filebytes = file.readallbytes(somefilename); the second step less straightforward, but still pretty easy : var bytestring = string.concat(filebytes.select(x => convert.tostring(x, 2).padleft(8, '0'))) the idea here select each byte individually, converting each 1 binary string (pad left each 1 8 characters, since many bytes have leading zeroes), , concatenate of single string. (courtesy in part of @xanatos' comment below.)

ios - Filter NSMutableArray on the base of filtering another NSMutableArray -

i have 3 nsmutablearray s of identical size. "linked" means corresponding index have related each other. tabledata = [nsmutablearray arraywithobjects:@"egg benedict", @"mushroom risotto", @"full breakfast", nil] thumbnails = [nsmutablearray arraywithobjects:@"egg_benedict.jpg", @"mushroom_risotto.jpg", @"full_breakfast.jpg",nil] preptime = [nsmutablearray arraywithobjects:@"10min", @"15min", @"8min",nil] this comes tutorial i'm playing on. i'm filtering tabledata array this: nspredicate *resultpredicate = [nspredicate predicatewithformat:@"self contains[cd] %@", searchtext]; searchresultsdata = [[tabledata filteredarrayusingpredicate:resultpredicate] mutablecopy]; where searchtext string containing filter (for example "egg"). works great, mean have correct filtering. ( se...

scala - How can i avoid for loop for KNN search? -

my goal have k nearest neighbours of each data point. avoid use of loop lookup , use else simultaneously on each rdd_distance point, can't figure out how this. parseddata = rdd[object] //object have id , vector attribute //sqdist1 output double var rdd_distance = parseddata.cartesian(parseddata) .flatmap { case (x,y) => if(x.get_id != y.get_id) some((x.get_id,(y.get_id,sqdist1(x.get_vector,y.get_vector)))) else none } for(ind1 <- 1 size) { val ind2 = ind1.tostring val tab1 = rdd_distance.lookup(ind2) val rdd_knn0 = sc.parallelize(tab1) val tab_knn = rdd_knn0.takeordered(k)(ordering[(double)].on(x=>x._2)) } is possible without use loop lookup ? this code solves question (but inefficient when number of parseddata big). rdd_distance.groupbykey().map { case (x, iterable) => x -> iterable.toseq.sortby(_._2).take(k) } so more appropriate solution. import org.apache.spark.mllib.rdd.mlpairrddfunctions._ ...

javascript - Trying to create a function nodejs express -

im trying create function dont use same code again , again keep getting internal error.i data , internal error if change need refresh page updated.i cant understand why error.here error get http://localhost:3000/api/pages 500 (internal server error) object {data: "", status: 500, config: object, statustext: "internal server error"} code: function get(some,that,res){ return some.find(function(err,that) { if (!err) { return res.send(that); } else { return res.send(500, err); } }); }; router.get('/pages', sessioncheck, function() { get(page,pages,res); }); update: might doing wrong lets take start.how can create function dont reuse same code again , again. router.get('/pages', function(request, response) { return page.find(function(err, pages) { if (!err) { return response.send(pages); } else { return response.send(500, err)...

meteor - How to render content from a sidebar menu into main content area? -

i have user profile page sidebar menu links render/display main content area upon clicking 1 of links without whole page re-rendering. ideas best way go doing task? you use front-end framework angularjs or ember. if static data or simple, use tabs functionality built jquery: https://jqueryui.com/tabs/

php - Retrieving boolean values with Doctrine's DBAL in Symfony -

i'm using dbal in symfony project access data in mysql database. when querying tables boolean fields (created tinyint) tinyint values in php booleans. somehow, i'd same mapping using doctrine directly. i thought mapping conversion (from mysql php) implemented in dbal, i'm not sure if it's suppose work way (this layer mapping values back). i have tried registering custom mapping following one, no success: $this->conn->getdatabaseplatform()->registerdoctrinetypemapping('tinyint', 'boolean'); $sql = " select se.survey_id, se.anonymous survey_edition se "; $stmt = $this->conn->prepare($sql); $stmt->execute(); $result = $stmt->fetch(); in case 'anonymous' tinyint(1) field in mysql, $result['anonymous'] boolean instead of integer. do know if possible boolean values in php mysql query through doctrine's dbal? thanks. without using orm cannot (as f...

python - Regex to model the below mentioned type of expressions -

++++++++++++++++++++++++++++++++++++++++++++++++ | site | morning | afternoon | evening | night | ++++++++++++++++++++++++++++++++++++++++++++++++ | long 144 - lat 18 | 100 | 150 | 10 | 5 | ++++++++++++++++++++++++++++++++++++++++++++++++ | long 161 - lat 122 | 100 | | | 5 | ++++++++++++++++++++++++++++++++++++++++++++++++ | long 100 - lat 134 | 100 | | 5 | | ++++++++++++++++++++++++++++++++++++++++++++++++ | long 190 - lat 14 | | | 158 | 5 | since don't see pattern i'm stuck on how model regular expression extract values site, morning, afternoon, evening , night. example regex should able scrape ('long 144 - lat 18', '100','150','10','5') first row , ('long 161 - lat 122', '100','','','5') second row, on. i'm able scrape 'site' column can't think of model scrape rest. main thing don't have "|", "+" , ...

node.js - Access multiple mongo databases with mongoose -

from within single nodejs app, how can switch between mongodb instances? for context, i'm writing queue worker nodejs/zeromq/mongoose. i have multiple nodejs/mongo apps running on same server, each own mongo database, push jobs queue. my worker app pulls , processes jobs sequentially. depending app sent job, needs connect appropriate mongo database through mongoose. apps use same mongoose models, same models available in worker app. i'm having trouble switching connections , i'm afraid listing details of attempts/results muddy question here. it doesn't matter if it's limited 1 @ time, or if maintain collection of connections. any insight appreciated. use createconnection . see docs here: http://mongoosejs.com/docs/api.html . haven't done myself, believe create models attached each schema var mongoose = require('mongoose'); var db = mongoose.createconnection(..); db.model('venue', new schema(..)); var ticket = db.model...

i'm not getting result with jquery form validation -

this html code , below jquery code..my problem in jquery code have 4 if statments , 1 else statment...my code going first 2 if statement , skipping next 2 if statements , directly goes last else statement..i have check alert function in each if statement , got alert first 2 statements , last else statement...can tell solution??? please tell me how can errors of when call $("#errors").html(errormsg); wrote errors if doesn't show on screen please give reply of both questions thanks. <head> <style> #container{ width:500px; margin: 0 auto; } #errors{ color:red; margin-left:200px; } </style> </head> <body> <div id="errors"></div> <div id="container"> <form id="validationform"> <label for="email">email</label> <input name="email" id="email"/> <label for="phone">telephone</label> ...