Posts

Showing posts from June, 2014

How to change view angle in Google Static Map? -

is possible change angle of view in google static map, how can changed in case of google maps api - here check settilt() function. https://developers.google.com/maps/documentation/javascript/reference?hl=en something similar available google static map can passed in url parameter. not possible in static maps api. there's feature request: issue 3796: enable access 45° imagery through static maps api .

Count number of slots in a template in haskell -

i need write function, count number of slots in template. such template ({})foo{}{} = 3 . have function prototype template :: template -> int templatey (template xs) = and helper functions: data slot = slot deriving (show, eq) data template = template [either string slot] deriving eq instance show template show (template xs) = concat $ map f xs f (left x) = x f (right x) = "{}" data def = def [template] deriving eq i wrote that: temp = template [right slot] , guess need use map somehow check if input template matches temp. but, can't find way how it. highly appreciated. something should work: template :: template -> int template (template xs) = sum $ map (\x -> either (\_ -> 0) (\_ -> 1) x) xs in case seeing value of right value constructor, returning 1 else 0 . , sum number of slots. or yuuri points out, more elegant: template :: template -> int template (template xs) = sum $ map (e...

javascript - Proper way to pop from a react component's array-type state attribute? -

let's have react component like: var mycomponent = react.createclass({ getinitialstate: function() { return { mystack: [] }; }, ... pop: function(a) { // concise , elegant way pop array type state? } } maybe write pop: function() { var clone = _.clone(this.state.mystack); clone.pop(); this.setstate({mystack: clone}); } but looks ugly... know works looking @ code becomes annoying when write these codes. is there nice way popping array type react component state? i implemented push() like push: function(a) { this.setstate({mystack: this.state.mystack.concat([a])}); } in single line. i believe there nice 1 line solution pop , too. use array.prototype.slice : pop: function() { this.setstate({ mystack: this.state.mystack.slice(0, -1) }); }

How to get list of branches on a atlassian-stash project using REST call in JAVA -

i have found stash provide rest api details created projects in repository.i newbie stash api.please let me know how can list branches under stash project via rest call. sample stash project path https://stash.test.local/projects/dev/repos/central-project/browse under above central-project contains multiple branches like, master feature/test feature/test1 i want list of branches via rest call. i have found way it.for rest call used rest-assured in java. restassured.baseuri = "https://stash.test.local"; restassured.basepath = "/rest/api/1.0/projects/dev/repos/central-project/branches"; restassured.authentication = restassured.preemptive().basic( username, password); response response = restassured.get(); string branchjson = response.asstring();

authentication - Protect routes with middleware Laravel -

i have implemented middleware roles , permissions control in app, cannot figure out why allows me define 1 '/' route. second 1 still pointing '/home' though override authcontroller redirectto variable. my routes: route::group(['middleware' => 'role:user'], function() { route::get('/', 'scorescontroller@user'); }); route::group(['middleware' => 'role:admin'], function() { route::get('/', 'pagescontroller@home'); }); in case after authentication user user role redirecting '/home'. like simon says second route override first 1 load controller wich redirects page via redirect() or write route itself. could this: route::get('/', function(){ $user = auth::user(); if($user->is('admin') { return redirect('admin'); }else{ return redirect('user'); } }); route::get('admin', ['middleware' => ...

c# - state manager for xaml SplitView pane inside frame -

that's kind of long title. have shell.xaml content .xaml's <grid> <visualstatemanager.visualstategroups> <visualstategroup> <visualstate> <visualstate.statetriggers> <adaptivetrigger minwindowwidth="720" /> </visualstate.statetriggers> <visualstate.setters> <setter target="shellsplitview.displaymode" value="compactinline"/> </visualstate.setters> </visualstate> <visualstate> <visualstate.statetriggers> <adaptivetrigger minwindowwidth="0" /> </visualstate.statetriggers> <visualstate.setters> <setter target="shellsplitview.displaymode" value="overlay"/> </visualstate.setters> </visualstate> </visualsta...

javascript - gulp - how to pipe tasks -

i have task: var path = require('path'); var gulp = require('gulp'); var conf = require('./conf'); var svgsprite = require("gulp-svg-sprites"); var clean = require('gulp-clean'); gulp.task('sprite-make', function () { //first task gulp.src([path.join(conf.paths.src, '/assets/svg/*.svg'), '!' + path.join(conf.paths.src, '/assets/svg/sprite.svg')]) .pipe(svgsprite({ preview: false, svgpath: path.join(conf.paths.src, '/assets/svg/sprite.svg'), cssfile: ('_sprite.scss') })) .pipe(gulp.dest(path.join(conf.paths.src, '/app/styles'))); //second task gulp.src(path.join(conf.paths.src, '/app/styles/svg/**/*')) .pipe(gulp.dest(path.join(conf.paths.src, '/assets/svg'))); //third task gulp.src(path.join(conf.paths.src, '/app/styles/svg'), {read: false}) .pipe(clean()); }); what want execute tasks 1 after (create spr...

objective c - How can I run a terminal command in my swift menu bar app? -

i have made menu bar app , want command run on press rm -rf ~/.trash/* the code have this: @ibaction func toggleclicked(sender: nsmenuitem) { let task = nstask() task.launchpath = "/bin/sh" task.arguments = ["rm", "-rf", "~/.trash/*"] task.launch() task.waituntilexit() } but when run this, following error: /bin/rm: /bin/rm: cannot execute binary file i dont understand why i'm getting error since can open terminal , run /bin/sh, enter in rm -rf ~/.trash/* , works expected. edit i have tried change commands nothing happens: task.launchpath = "/bin/rm" task.arguments = ["-rf", "~/.trash/*"] to make /bin/sh read command line string need pass -c argument. your code needs changed follows: let task = nstask() task.launchpath = "/bin/sh" task.arguments = ["-c", "rm -rf ~/.trash/*"] task.launch() task.waitun...

amazon web services - Solr or SolrCloud in Aws? -

i have add solr search server in aws-ec2 instance.right have solr installed in aws-ec2 instance ram 8gb , disc space 50gb.its working fine, wondering if changing solrcloud improve performance.should go normal solr or should go solrcloud? if solrcloud,why? it's impossible say, both work. "regular" solr allows scale infrastructure adding replicas cores, while solrcloud adds hidden complexity easier handling of replication , query distribution . if works now, wouldn't fret it. keep track of query times , re-evaluate if run issues need add instances cluster quickly. regular, simple solr setup http replication in cases fine.

html - How to make <input> and <a> element inline in a <div> -

i have div containing input , a element: .wrapper { width: 300px; display: inline-block; } .custom-input { display: block; width: 100%; } .button { width: 20px; height: 20px; background-color: #ccc; display: block; } <div class="wrapper"> <input class="custom-input" type="text" /> <a class="button"></a> </div> here's jsfiddle . i want input , button inline. input button has 100% width of wrapper. in cases, want remove button. input has 100% width of wrapper div. it inline when use inline-flex wrapper. want able run on old browsers (ie 8-9), , want input , element have 100% width of wrapper. how can it? using width: 100% on input make take horizontal space available, pushing button line below. this should work : .wrapper{ width: 300px; display: inline-block; } .custom-input{ display: inline-block; } .button{ width: 20p...

c++ - How to use previous versions of g++ -

i running debian jessy g++'s version 4.9. reason need compile code in g++-4.7 or previous version. i got files of gcc-4.7 , g++-4.7 debian wheezy of friend has g++-4.7. i tried make apt-get install, seemed have worked gcc not g++. put files in /bin, doesn't seem locate g++-4.7 package. when try compile code specify g++-4.7 error : g++: error trying exec 'cc1plus': execvp: no such file or directory any idea how figure out? my advise add wheezy repositories /etc/apt/sources.list , install g++-4.7 using apt-get. using method bugfixes etc. i guess, you're having dependency problems. these solved when use apt-get.

python - Unable to run Django project under Apache -

i have django project nice , running @ 127.0.0.1:8000. run via: $ python manage.py runserver now, want run under apache . this tried: installed , enabled mod_wsgi. working indeed, because when installed saw in console: "apache2_invoke: enable module wsgi" edited 000-default.conf file in way: <virtualhost *:80> wsgiscriptalias / /home/jacobian/django/apps/apps/wsgi.py <directory /home/jacobian/django/apps/apps/> <files wsgi.py> require granted </files> </directory> errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined that's it. i'm not sure i'missing, after restart apache , go localhost , in browser see page /var/www folder. whereas expect see django application. guess need edit apache2.conf (how?) , other magic tricks (like download , install magic stuff, make magic apache configuration etc). i tried dozens of tutorial, none of them helped - either apache n...

c# - Extending WCF Compact / Custom Headers -

i'm developing app deployed across various platform including windows phone. because of this, have access wcf compact / portable classes. i need able catch every outgoing request , incoming response in order apped headers request, , read headers response. when extending standard wcf able achieve using custom behaviour, in wcf compact not supported, so, able use following code append headers specific request: calculatorserviceclient client = new calculatorserviceclient(); using(new operationcontextscope(client.innerchannel)) { // use custom class called userinfo passed in messageheader userinfo userinfo = new userinfo(); userinfo.firstname = "john"; userinfo.lastname = "doe"; userinfo.age = 30; // add soap header outgoing request messageheader amessageheader = messageheader.createheader("userinfo", "http://tempuri.org", userinfo); operationcontext.current.outgoingmessageheaders.add(amessageheader); ...

Looping through all nodes in xml file with c# -

i have xml document setup similiar this: <invoice> <issuedate>2015-09-07</issuedate> <invoicetype>380<invoicetype> <accountingsupplierparty> <party> <endpointid></endpointid> <partyname> <name>company test</name> </partyname> </party> </accountingsupplierparty> </invoice> this little piece of entire xml document, show how file looks. i check elements see if have empty values, such endpointid in example (i need replace empty values na). this have far: public static void addtoemptyelements() { xmldocument xmldoc = new xmldocument(); xmldoc.load("testxml.xml"); xmlnodelist nodes = xmldoc.documentelement.childnodes; foreach (xmlnode node in nodes) { console.writeline(node.name); } } however, code loop through childs of root node , not grandc...

c++ - Appropriate way to forward rvalue reference -

i have following code: #include <iostream> #include <string> using std::cout; using std::endl; void bar(const std::string& str) { cout << "const str - " << str << endl; } void bar(std::string&& str) { cout << "str - " << str << endl; } void foo(std::string&& str) { bar(str); } int main() { foo("hello world"); } in above code void bar(const std::string& str) overload gets called. if want void bar(std::string&& str) overload called either have write bar(std::move(str)); or bar(std::forward<std::string>(str)); obviously forward code longer, makes more sense me. question more commonly used , prefered. writing bar(std::forward(str)); best solution imo, not option :) citing effective modern c++ from purely technical perspective, answer yes: std::forward can all. std::move isn’t necessary. of course, neither function necessary, ...

html - When to use element.style selector in css? -

Image
this question has answer here: element.style in chrome element inspector? 1 answer the following list of selector types increasing specificity: universal selectors (i.e., *). type selectors (e.g., h1) , pseudo-elements (e.g., :before). class selectors (e.g., .example), attributes selectors (e.g., >>[type="radio"]) , pseudo-classes (e.g., :hover). id selectors (e.g., #example). in addition above selectors, there default selector called, when prefer using selector? how css specificity rule applies selector? here's specificity value selector specificity specificity in large base inline-style 1 0 0 0 1000 id selector 0 1 0 0 100 class,pseudo,attribute selector 0 0 1 0 10 type selector , pseudo...

build functions with str2func command in matlab -

i want build series of different function matlab , integrate , differentiate results. mathwork says output of str2func can't access variable or bot used other function. 1 me problem? i want create these function: f1= @(x,l) x.*(l-x); f2= @(x,l) x.^2.*(l-x).^2.*(l/2-x).^2; f3= @(x,l) x.^3.*(l-x).^3; f4= @(x,l) x.^4.*(l-x).^6.*(l/2-x).^4; f5= @(x,l) x.^5.*(l-x).^5; f6= @(x,l) x.^6.*(l-x).^6.*(l/2-x).^6; f7= @(x,l) x.^7.*(l-x).^7; f8= @(x,l) x.^8.*(l-x).^8.*(l/2-x).^8; f9= @(x,l) x.^9.*(l-x).^9; f10= @(x,l) x.^10.*(l-x).^10.*(l/2-x).^10; i write function: syms x l f=cell(10,1); fun=cell(10,1); i=1:10 if mod(i,2) ~= 0 f{i}=['x','.^',num2str(i),'.*','(l-x)','.^',num2str(i)]; els...

javascript - I keep getting NaN and i can't find out how to fix it -

it happens when gets cost2 . think problem might in trying define price2 , else works fine. i'm new javascript i'm sure it's simple mistake, great! <html> <body> <h1>gas mileage</h1><br></br> </body> <script type="text/javascript"> var mpg, price1, distance, gallons, cost1, price2, cost2; mpg = prompt("enter car's miles per gallon"); document.write("your car gets "+mpg+" miles per gallon."); document.write("<br>"); price1 = prompt("enter current cost of gas"); document.write("gas costs $"+price1+" per gallon."); document.write("<br>"); distance = prompt("enter amount of miles travel"); gallons = distance/mpg; cost1 = gallons*price1; document.write("to travel "+distance+" miles, cost ...

java - Spring RestTemplate - Log on request sometimes hangs awaiting response -

i use rest template in java client log onto server , receive required headers upgrade connection secure websocket. here code: private static void loginandsavejsessionidcookie(final string user, final string password, final httpheaders headerstoupdate) { string url = "http://localhost:" + port + "/websocket-services/login.html"; new resttemplate().execute(url, httpmethod.post, new requestcallback() { @override public void dowithrequest(clienthttprequest request) throws ioexception { system.out.println("start login attempt"); multivaluemap<string, string> map = new linkedmultivaluemap<>(); map.add("username", user); map.add("password", password); new formhttpmessageconverter().write(map, mediatype.application_form_urlencoded, req...

angularjs - Underscore mixin error -

i trying learn grunt tasks below example https://github.com/song-rate-mvc/angular-song-rate/tree/0.0.3 after command npm install, bower install during grunt dev below error "referenceerror: can't find variable: _" in app.js file the error occurs in file app.js @ angular.module("myapp", [ 'myapp.filters', 'myapp.services', 'myapp.directives', 'myapp.controllers' ]); //error occurs in below line. _.mixin(_.string.exports()); am missing anything...

org mode - org-metaup/down deletes line instead of swapping it up/down -

i using emacs 24.5.1 , not understand how shift outlines up/down in org-mode let's have following list: * title 1 ** section ** section b ** section c i swap sections b , c. according manual achieved using keys m-up/down items or m-s-up/down subtree items. if try m-down on "section b" instance, expect following: * title 1 ** section ** section c ** section b but instead get: * title 1 ** section ** section c the command deletes current line ! seems work tickbox lists... i checked key-bindings c-h k , calling right commands. displayed in org-mode menu. tried execute commands (org-shiftmetadown) (org-move-subtree-down) (org-move-item-down) directly in minibuffer same behaviour (line deleted). thought conflict cua-mode disabling not help. i missing ? how move outline items up/dow in org-mode ? it shows m-up bounded command org-metaup in case. , moves subtree or table row depending context. please try command org-metaup , see if works? ...

android - Item in listview is repeating -

i have following arrayadapter . public class smsarrayadapter extends arrayadapter<string> { list<string> smsbody; list<boolean> status; list<string> time; list<string> smsmessageid; context context; private static layoutinflater inflater = null; string fromnumber; public smsarrayadapter(context context, int resource, list<string> smsbody, list<boolean> status, list<string> time, list<string> smsmessageid, string fromnumber) { super(context, resource, smsbody); this.smsbody = smsbody; this.status = status; this.context = context; inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); this.fromnumber = fromnumber; this.time = time; this.smsmessageid=smsmessageid; } public string getstr(int position) { return smsbody.get(position); } pu...

umbraco6 - empty content tree pickers in Umbraco 6.2.4 -

i experiencing problems concerning empty content tree pickers. i'm running umbraco 6.2.4 in iis7 (sql server 2008). have page several content tree pickers (with same datatype) , 1 of them not showing content (not same contentpicker interestingly). in debuggers network section call data content picker keeps pending (/umbraco/webservices/treeclientservice.asmx/getinitapptreedata) deleting temp directory, recycling app pool, changing doc type or datatype not solve problem. experiencing similar problems or know how solve issue? thanks in advance it's possible content cache corrupted somehow? right click on content folder in cms , select "republish site" should clear cache. see if solves problem.

java - Is there a method reference in JDK for subtracting doubles? -

double::sum method reference adding doubles, ie. (a,b) -> a+b . why there not method reference minus in jdk? i.e. (a,b) -> a-b ? the primary purpose of methods double.sum aid use cases reduction or arrays.parallelprefix since minus not associative function, not appropriate use case. adding 3rd party library dependencies sake of such simple method, not recommended. keep in mind, can create own method, if prefer named methods on lambda expressions. e.g. static double minus(double a, double b) { return a-b; } and using myclass::minus informative thirdpartyclass::minus …

javascript - Redmine plugins scripting -

i'm new javascript, redmine , ror. far have read , understood plugin development tutorial . when try things on own won't work... if use this: <% content_for :header_tags %> <%= javascript_include_tag 'script', :plugin => 'my_plugin' %> <% end %> it generate correct link code on page source there no scripts loaded redmine_root/public/plugin_assets . supposed happen? i make hello world example work. but far can understand, never work on whole redmine app if scripts don't loaded redmine_root/public/plugin_assets . if can me out understand why scripts not loading , how use scripts under redmine grateful. is code sample copy-paste project code? or typed manually misprints? % , = signs missed in places, must <%= ... %> or <% ... %> what content of redmine_root/public/plugin_assets folder? must have plugin folder named same plugin, images , javascripts , stylesheets folders, here: redmine_root ....

c++ - implement waiting timer using only the standard library -

what standard c++ ways exist implement waiting timer? is, code trigger timer callback , , wait timeout occur (not waste any, or little, cpu cycles). there must finite number of ways std:: . using <thread> , timeout feature of condition variables . seems wasteful have spawn thread each timer. std::this_thread::sleep_for() , std::this_thread::sleep_until() useful unless you're spawning new thread, cannot other work @ same time.

How to solve method delegation with scala implicits -

how can solve simple problem. class conversion has typed method from wich takes 2 type parameters , b , returns b a . have defined implicits in companion object provide default beahviour. my problem when try forward call conversion class within typed method has same signature not work. here in example try forward call function myfun conversion class. i got following error not enough arguments method from: (implicit f: => b) i wondering why makes problems. can explain me why , how overcome problem ? here code object myconversions { implicit val inttostr = (f:int) => f.tostring() implicit val doubletostr = (f:double) => f.tostring() implicit val booleantostr = (f:boolean) => f.tostring() } class conversions{ def from[a,b](a:a)(implicit f:(a) => b) = { f(a) } } import myconversions._; def myfun[a,b](a:a){ // error new conversions().from[a, b](a) } // working println( new conversions().fro...

How to get the Docker version using the Remote API -

is possible docker service version using remote api, is, similar passing version parameter command line client? docker --version yes; it's the /version endpoint . from docs: example request: get /version http/1.1 example response: http/1.1 200 ok content-type: application/json { "version": "1.5.0", "os": "linux", "kernelversion": "3.18.5-tinycore64", "goversion": "go1.4.1", "gitcommit": "a8a31ef", "arch": "amd64", "apiversion": "1.20", "experimental": false }

forecasting - Error in R tbats function -

i have 548 weeks of data , trying use tbats little success. following error: error in checkforremoteerrors(val) : 3 nodes produced errors; first error: function cannot evaluated @ initial parameters my data: weeklyu <-structure(list(v1 = c(18594l, 13593l, 9854l, 12040l, 12920l, 13302l, 12500l, 13073l, 13801l, 12895l, 13199l, 21568l, 19848l, 13418l, 13188l, 13560l, 21327l, 17724l, 11875l, 12475l, 15130l, 14497l, 16289l, 22388l, 17091l, 21104l, 19579l, 18432l, 13234l, 16728l, 15368l, 18105l, 14715l, 16763l, 16788l, 15701l, 17331l, 18725l, 24336l, 16186l, 14299l, 15144l, 17444l, 19384l, 17035l, 18611l, 25946l, 32773l, 41676l, 59446l, 74874l, 19839l, 18325l, 17417l, 14025l, 15225l, 15323l, 16075l, 14756l, 15567l, 19416l, 15190l, 14349l, 19137l, 17714l, 22033l, 20182l, 16660l, 23325l, 19769l, 19465l, 16379l, 20762l, 19084l, 17395l, 21461l, 17616l, 25190l, 22671l, 21138l, 15302l, 19633l, 18951l, 20609l, 16493l, 18680l, 19583l, 18474l, 17654l, 20000l, 26003l, 17507l...

javascript - Why can I not capture the value in my input field? (JS/HTML) -

i trying create validation function input field, problem cannot capture in input field!! when run test , put in input field, returns nothing... this code <form id="myform" name="myform" onsubmit="test();"> <style type="text/css"> .botlayout{ padding-right:130px; margin-right:20px; } </style> <div class="botlayout"> <div name="title" align="left" style="font-size: 13px;"> <font size="4"><b> register </b></font> </div> <div name="indic" align="right" style="font-size: 13px;"> <font size="1"> <font color="#ff0000">*</font>required field </font> </div> <b style="font-weight: bold;"> <div> <div> <div> <b style="font-size: 13px;">first name</b><b> <div style="display: inline !impor...

wpf - Click Event not working anymore when using Helixtoolkit.SortingVisual3D -

i want add transparency objects (without loosing click-event). google told me try sortingvisual3d. without sortingvisual3d (except transparency) worked well, click-events also. now tried implement (simplified code): public sv3d new helixtoolkit.wpf.sortingvisual3d public model3dui new modeluielement3d 'apply geometry model3dui.model = geometry 'skipped geometry code in post 'add click event addhandler model3dui.mouseleftbuttonup, addressof clickevent 'add sortingvisual3d sv3d.children.add(model3dui) 'add viewport viewport.children.add(sv3d) 'setup sortingvisual3d sv3d.sortingfrequency = 2 sv3d.method = helixtoolkit.wpf.sortingmethod.boundingboxcorners sv3d.issorting = true basically works fine, renders should , transparency working too. reason click event doesn't work. has idea i'm doing wrong? i'm not experienced helixtoolkit, way wrong.

odoo - How can I delete the "sheet" node keeping its content intact? -

i remove node <sheet></sheet> form view. instance, have view: <record id="view_account_period_form" model="ir.ui.view"> <field name="name">account.period.form</field> <field name="model">account.period</field> <field name="arch" type="xml"> <form string="account period"> <header> [...] </header> <sheet> <group> <group> <field name="name"/> <field name="fiscalyear_id" widget="selection"/> <label for="date_start" string="duration"/> <div> <field name="date_start" class="oe_inline" nolabel="1"/>...

gradle - Unable to compile transitive dependency of aar from android project -

there questions regarding transitive dependencies in gradle none of them solved problem. i took following steps: created new android studio project: a . created new "android library" module: b in project. added dependency in build.gradle of module b as: compile ('com.abc:sdk:0.8.0@aar') added dependency in app level build.gradle as: compile project(":b") after step android studio automatically generated aar file b . created android studio project: b , imported aar file module in project. everything working fine in project a. getting noclassdeffounderror when try run project b. explicitly adding dependency of abc:sdk in project b solves problem purpose compile abc:sdk without explicitly adding dependency project b. the aar file doesn't contain transitive dependencies. it means that, if importing aar file, have specify dependencies in project. using maven repository, not have same issue. gradle downloads dependencie...

github - What's a simple way to add the git branch in jenkins "changes" screen? -

Image
we're using jenkins git plugin (github remote), , in "branches build" specify "**", builds branch changed. however, "changes" screen displays git commits sha1 , commit message. there simple way add branch name text? or better, jenkins build id? might related how receive local git branch name jenkins git plugin? , not sure how use info... the answer using build name setter plugin . install build name setter plugin. check here if don't know how install jenkins plugin. in job config page, scroll down build environment section, set build name #${build_number}_${git_branch} after that, can see branch name either in build label or in changes screen.

Creating a binary factor form ordinal data in R -

i have ordinal variable ranges 1 through 67 summary(var) min. 1st qu. median mean 3rd qu. max. 1.0 4.0 8.0 10.2 15.0 67.0 i want recode binary variable first level being score of 1 on original variable , second level – all other scores combined. i assume have use factor() function, can't figure out how aggregate of values (excluding 1 ) second level. thanks. yes, factor() function works. use: factor(var == 1, labels=c("other", "one")) the condition split data you, , labels assign relevant names (otherwise names "false" , "true").

Can't throw exception from inside symfony security Voters -

i using custom symfony voters , using unanimous strategy. access decision manager loops on voters , isgranted return boolean. we can't throw exception inside voter know why access denied. want know voters has denied access , why can show appropriate messages user take action e.g. upgrade perticular subscription. best way ? a algorithm be: throw exception inside voter catch manager, store array or object , continue after chain (loop) finished, check if manager "collected" exception , behave accordingly

javascript - How to decode the JSON array into two varibale? -

in given function i'm passing data in json format [{"date":"2014-12-12 18:52:10","ttc":"0"},{"date":"2014-12-12 18:52:10","ttc":"0"},{"date":"2014-12-12 18:53:10","ttc":"0"},{"date":"2014-12-12 18:53:10","ttc":"0"},{"date":"2014-12-12 19:02:11","ttc":"0"}] the json array long , want store date date array , ttc ttc please parse this. function drawchart(data){ console.log(data); var date = []; var ttc = []; for(var i=0; i<data.length; i++){ date.push(data[i]['date']); console.log(date); ttc.push(parseint(data[i]["ttc"])); //console.log(ttc); } } try way: var data = [{ "date": "2014-12-12 18:52:10...

gorm - Grails - ERROR errors.GrailsExceptionResolver -- Not able to navigate to the next pages -

Image
in image shown below(at end of post), not able navigate next pages in webpage. if click on next page : getting error : toindex - 11 error message : grails> | error 2015-09-21 18:04:21,491 [http-bio-8080-exec-2] error errors.grailsexceptionresolver - indexoutofboundsexception occurred when processing request: [post] /clindata/dailyjobactivity/show - parameters: id: 402 sort: id max: 10 order: asc name: action: show controller: dailyjobactivity offset: 10 user: clindata admin toindex = 11. stacktrace follows: message: toindex = 11 line | method ->> 962 | sublistrangecheck in java.util.arraylist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 954 | sublist in '' | 42 | docall . . . . . in com.datumrite.securityfilters$_closure1_closure3_closure9 | 195 | dofilter in grails.plugin.cache.web.filter.pagefragmentcachingfilter | ...

percona - mysql restarted occassionally -

at night our mysql server restarted occassionally(innodb engine) , in log see following: 150921 1:58:44 innodb: page checksum 2064838754 (32bit_calc: 866699801), prior-to-4.0.14-form checksum 400856538 innodb:stored checksum 1847129036, prior-to-4.0.14-form stored checksum 42278670 innodb: page lsn 0 3564194321, low 4 bytes of lsn @ page end 2315587073 innodb: page number (if stored page already) 80945, innodb: space id (if created >= mysql-4.1.1 , stored already) 0 innodb: page may index page index id 116 innodb: (index "idx_cru_type" of table "fisheyedb"."cru_login_cookie") 150921 1:58:44 innodb: assertion failure in thread 139799134877440 in file rem0rec.c line 569 innodb: intentionally generate memory trap. innodb: submit detailed bug report http://bugs.mysql.com. innodb: if repeated assertion failures or crashes, innodb: after mysqld startup, there may innodb: corruption in innodb tablespace. please refer at http://bugs.percona.c...

Android studio can't resolve org.junit import -

i'm growing pretty desperate. follow jetbrain guide install , use junit in android app of mine. so dependency imported in gradle app file: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.google.android.gms:play-services:7+' compile 'com.android.support:support-v4:22.+' testcompile 'org.robolectric:robolectric:2.4' testcompile 'org.mockito:mockito-core:1.+' testcompile 'junit:junit:4.12'} i've switched build variants on unit tests. but android studio can't resolve typical annotation symbols of junit neither import packages "org.junit". i've try find here , on google, try invalidate cache , restart. i've try use junitgenerator plugin, , write test in src/test/java/ self... to me seems gradle not import junit jar @ all. ideas how solve issue? issue? thanks.

visual studio - What is creating these files with a jmconfig extension? -

i've got multiple visual studio projects , solutions have .jmconfig file in root directory project or solution. noticed file shows when checking project source control , tells me .jmconfig new. here sample: <?xml version="1.0" encoding="utf-8"?><configuration xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"><dontshowagaininsolution>false</dontshowagaininsolution></configuration> this justmock trying save settings don't reminded upgrade time.

pdf - Making catalogue in Illustrator (Saving options?) -

i have old catalogue editing it's up-to-date. old catalogue on 66 pages , comes 140mb. i have far made 5 pages new version of catalogue , i'm 67mb. @ moment use "high quality print" option when save catalogue pdf, still seems awful big size 5 pages, considering other catalogue 66 pages , 140mb(without significant loss in quality seems like). i chose high quality print option since print catalogue later on, optimal saving options keep file size down while getting enough quality print it? uncheck "preserve illustrator editability" box, , may see big reduction in file size when outputting pdf files.

c - C99 Variable Length Array Max sizes and sizeof Function -

i experimenting use of variable length arrays (vlas) in c code , trying iron out understanding of should , shouldn't do. i have following snippet function: void get_pdw_frame_usb(pdws_t *pdw_frame, pdw_io_t *pdw_io) { ... unsigned char buf[pdw_io->packet_size]; unsigned char *pdw_buf; memset(buf, '\0', sizeof(buf)); pdw_io data structure containing, amongst other things, packet_size , of type size_t the char array buf used store contents of usb bulk transfer packet i'm trying instantiate here automatic variable using c99 vla approach. i'm trying ensure contents zeros. i'm having few issues. firstly, if pdw_io->packet_size set 8 (quite small), buf set reasonable looking value, i.e. debugging gdb can inspect follows: (gdb) p buf $27 = 0xbffe5be8 "\270", <incomplete sequence \370\267> if pdw_io->packet_size set 12008 (fair bit larger), following doesn't good: (gdb) p buf $29 = 0xbffe2d08 "" is 120...