Posts

Showing posts from March, 2010

php - Unable to parse JSON web service response with json_decode() -

i'm struggling parsing web service response json in cases service returns error. example json - success flow: { "response": [{ "iconpath" : "/img/theme/destiny/icons/icon_psn.png", "membershiptype": 2, "membershipid": "4611686018429261138", "displayname": "spuff_monkey" }], "errorcode": 1, "throttleseconds": 0, "errorstatus": "success", "message": "ok", "messagedata":{} } example json - error flow: { "errorcode": 7, "throttleseconds": 0, "errorstatus": "parameterparsefailure", "message": "unable parse parameters. please correct them, , try again.", "messagedata": {} } now php: function hitwebservice($endpoint) { $curl = curl_init($endpoint); curl_setopt($c...

transform - OpenCV RANSAC returns the same transformation everytime -

i confused how use opencv findhomography method compute optimal transformation. the way use follows: cv::mat h = cv::findhomography(src, dst, cv_ransac, 5.f); no matter how many times run it, same transformation matrix. thought ransac supposed randomly select subset of points fitting, why return same transformation matrix everytime? related random number initialization? how can make behaviour random? secondly, how can tune number of ransac iterations in setup? number of iterations based on inlier ratios , things that. findhomography give optimal transformation. real question meaning of optimal . for example, ransac you'll have model minimum reprojection error, while lmeds you'll have model minimum median error. you can modify default behavior by: changing number of iteration of ransac setting maxiters (max number allowed 2000) decreasing (increasing) ransacreprojthreshold used validate inliers , outliers (usually between 1 , 10). regard...

Mapping subclass list in Java using hibernate annotations -

i have problem mapping list of subclasses: model situation - have abstract class: @entity @inheritance(strategy=inheritancetype.single_table) @discriminatorcolumn( name="shapetype", discriminatortype=discriminatortype.string ) public abstract class shape{ @id @generatedvalue(strategy=generationtype.identity) protected long id; @column(name="owner_id") private long ownerid; @manytoone @joincolumn(updatable=false, insertable=false, name="owner_id") private owner owner; } and subclasses: @entity @discriminatorvalue(value="triangel") public class triangel extends shape { } and: @entity @discriminatorvalue(value="circle") public class circle extends shape { } then, have class owner , has list of subclasses: @entity public class owner { @id @generatedvalue(strategy=generationtype.identity) private long id; @onetomany(fetch = fetchtype.lazy, mappedby = ...

php - Display the result of the search bar in codeigniter -

good day have trouble in codeigniter suppose display data (the first name , student id of student) in oracle database depending on type in search box. example the name of student search box when click submit button display data of student. try search code , use displayed error 404 page not found. here code this view mysearch.php <form action="<?php echo site_url('search/search_keyword');?>" method = "post"> <input type="text" name = "keyword" /> <input type="submit" value = "search" /> </form> this controller search.php class search extends ci_controller { function __construct() { parent::__construct(); $this->load->database(); $this->load->model('mymodel'); } function search_keyword() { $keyword = $this->input->post('keyword'); $data['results'] = $this->m...

python - ipdb / set_trace() bug on Windows? -

i getting strange output when running python script , setting break point ipdb in program: import sys import ipdb parents, babies = (1, 1) while babies < 100: ipdb.set_trace() print 'this generation has {0} babies'.format(babies) ipdb.set_trace() parents, babies = (babies, parents + babies) it works fine when running script @ first, stopping @ first break point , printing variables. approach second break point doesn't matter if step through or continue, these kind of weird characters output in console: c:\pythontest>python ipdb_test2.py > c:\pythontest\ipdb_test2.py(6)<module>() 5 ipdb.set_trace() ----> 6 print 'this generation has {0} babies'.format(babies) 7 ipdb.set_trace() ipdb> n generation has 1 babies > c:\pythontest\ipdb_test2.py(7)<module>() 6 print 'this generation has {0} babies'.format(babies) ----> 7 ipdb.set_trace() 8 ...

scala - How does spray.routing.HttpService dispatch requests? -

disclaimer: have no scala experience now, question connected basics. consider following example (it may incomplete): import akka.actor.{actorsystem, props} import akka.io.io import spray.can.http import akka.pattern.ask import akka.util.timeout import scala.concurrent.duration._ import akka.actor.actor import spray.routing._ import spray.http._ object boot extends app { implicit val system = actorsystem("my-actor-system") val service = system.actorof(props[myactor], "my") implicit val timeout = timeout(5.seconds) io(http) ? http.bind(service, interface = "localhost", port = 8080) } class myactor extends actor myservice { def actorreffactory = context def receive = runroute(myroute) } trait myservice extends httpservice { val myroute = path("my") { post { complete { "pong" } } } } my question is: happens when control reaches complete block? question seems general,...

Many-To-Many Cassandra Database -

let have users. users can have access multiple projects. project can allow multiple users. so model 4 tables. users (by_id), projects (by id), projects_by_user_id , users_by_project_id. ----------- ------------ -------------------- -------------------- | users | | projects | | projects_by_user | | users_by_project | |---------| |--------- | |------------------| |------------------| | id k | | id k | | user_id k | | project_id k | | name | | name | | project_id c | | user_id c | ----------- ------------ | project_name s | | user_name s | -------------------- -------------------- so storing user_name in users_by_project , projet_name in projects_by_user table querying. the problem have when user updates project_name, of course update projects table. data consistency need update each partition in projects_by_user table. as far can see, possibl...

Inject HttpContext in ASP.Net 5 -

i want inject httpcontext controller's constructor. knows how configure in configureservices()? thanks injecting httpcontext directly in dependencies not recommended approach. instead, should use ihttpcontextaccessor : public class mycomponent : imycomponent { private readonly ihttpcontextaccessor contextaccessor; public mycomponent(ihttpcontextaccessor contextaccessor) { this.contextaccessor = contextaccessor; } public string getdatafromsession() { return contextaccessor.httpcontext.session.getstring(*key*); } } that said, it's not needed in controller, can retrieve current httpcontext using context property. of course, due way controllers created, property unavailable when instantiate controller, don't try access constructor. in case, try refactor code avoid accessing httpcontext there or use ihttpcontextaccessor replacement.

How do I access a php array value containing a forward slash -

this question has answer here: special characters in property name of object 2 answers i've been around these yer' internets many time , seem able find answer. have tried every combination can think of. i have array ["results"]=> array(20) { [0]=> object(stdclass)#5 (6) ["area"]=> string(9) "flint, mi" ["tag/_text"]=> string(11) "sevenseas" .... i'm trying access "tag/_text" within loop can't seem to foreach ($holder $dets) { $tag = $dets->tag/_text; $area = $dets->area; } how $tag value? you might want read http://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex explains can use curly brackets create complex expressions. you can access property of object following expression $dets->{'tag/_text'} ...

java - Android - optimal way to present a list of appointments -

i developing android app doctors. somewhere in app, doctor can choose view of appointments 1 given month. the thing 1 specific patient may have more 1 appointment doctor in month, maybe 2, 3 or more. , let's doctor doesn't have 1 patient, lots of them. so, have let's 10 different patients, each of them having 3 different appointments given month doctor. sums 10x3=30 appointments particular month. i thought of managing appointments using listview (or recyclerview ) sort of custom item views . thing don't think that's going optimal way present ordered, important data doctor. nor going visually appealing (should appalling?). maybe there kind of android ui component helps me , missing it. if doing such app, use listview patients , times of appointment @ each patient view. doctor should tap patient view appointments in detail.

symfony - Authentication request not working -

i tried set authentication process, works fine, when use memory providers such as: encoders: symfony\component\security\core\user\user: algorithm: bcrypt cost: 12 providers: in_memory: memory: users: ryan: password: $2a$12$lcy0mefviec3typhv9snnuzofyr2p/axigoqjeds4am4jwhnz/jl roles: 'role_user' admin: password: $2a$12$lcy0mefviec3typhv9snnuzofyr2p/axigoqjeds4am4jwhnz/j2 roles: 'role_admin' when try use entity providers (in security.yml) such as: security: encoders: appbundle\model\entity\user: bcrypt providers: database_users: entity: { class: appbundle\model\entity\user, property: username } firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false default: anonymous: ~ htt...

abstract syntax tree - Groovy - Add Class to script via AST transformations -

i'm creating groovy dsl looks this: types { "http://some.namespace.here" b "..." } testmethod(a a, b b) { ... } the user defines several types , methods on these types. need create a , b classnode s in ast groovy can find them. to so, created following ast transformation: @groovyasttransformation(phase = compilephase.semantic_analysis) class generateclassestransformer implements asttransformation { @override public void visit(astnode[] nodes, sourceunit source) { classnode = createclass("a") classnode b = createclass("b") modulenode module = sourceunit.getast() module.addclass(a) module.addclass(b) module.getclasses().each { println "class: " + } } private classnode createclass(string classname) { new astbuilder().buildfromspec { classnode(classname, classnode.acc_public) { classnode ob...

c# - How to assign the listview text to be on the right in print preview -

i have listview in form1 , in print preview use below code column text on listview on right when view them in print preview.. they on right please me how make them on right when print preview display. int[] x = { 40, 100, 160, 540, 650 }; //relative left margin510 int y = 450; //relative top margin font f = listview3.font; brush b = new solidbrush(listview3.forecolor);// (int = 0; < listview3.items.count; i++) { (int j = 0; j < listview3.items[i].subitems.count; j++) { e.graphics.drawstring(listview3.items[i].subitems[j].text, f, b, x[j], y );// } y += f.height; }

back-button doesn't work properly ionic famework -

i have flow in ionic app... login.html page(which "ion-view")->side-menu page(side-menu ionic framework)->page2.html page(which "ion-view"). want implement "ion-nav-bar" "ion-nav-back-button" in it. when want go page2.html app should sent me side-menu page....instead, app, sent me login page. seems side-menu not have "ion-view" in , not recorded in app flow. suggestion how can solve ? thank you there no state side menu, can not 'go back' open side menu. in normal, login view, should disable state temporally. app not 'go back' login view. can this: $scope.dologin = function () { auth.login($scope.logindata, function () { console.log('login success'); $ionichistory.nextviewoptions({ disableback: true }); $state.go('home'); }); }; and can clear view history of ionic avoid going with: $ionichistory....

matlab - Different colours for maximum and minimum of data -

Image
i have data normalised beween 0 , 1 continuous values inbetween. possible make colour map highlight 1 particular value? in case, want max value of 1 custom defined colour , rest use normal colour map. have tried editing colour map appending on desired colour plot uses colour values close 1 well. suggestions appreciated. function cplotdemo clc; close all; clear all; data = peaks; data = (data - min(data(:))) / ( max(data(:)) - min(data(:)) ); figure, contourf(data) colormap(jet2) colorbar function j = jet2(m) if nargin < 1 m = size(get(gcf,'colormap'),1); end n = ceil(m/4); u = [(1:1:n)/n ones(1,n-1) (n:-1:1)/n]'; g = ceil(n/2) - (mod(m,4)==1) + (1:length(u))'; r = g + n; b = g - n; g(g>m) = []; r(r>m) = []; b(b<1) = []; j = zeros(m+1,3); j(r,1) = u(1:length(r)); j(g,2) = u(1:length(g)); j(b,3) = u(end-length(b)+1:end); j(end,:)=[(256/2)/255,(0)/255,(256/2)/255]; i think happening because of way contourf works. example posted there shoul...

Separating AJAX requests and success callbacks in jQuery -

i've defined function capture mouse clicks on links data-remote tag follows. // global ajax request handler $(document).ready(function() { $(document).on('click', 'a[data-remote]', function(event) { var target = $(event.target); var url = $(this).data('url'); var method = $(this).data('method'); $.ajax(url, {type: method, data: $(this).data()}) .done(function(data){ target.trigger('complete', data); }) .fail(function(data) { target.trigger('failure', data); }); }); }); the function captures done , fail events , proceeds trigger new custom event ( complete or failure ) on element clicked start whole thing off. elsewhere, it's possible like... $('#list').on('complete', 'a[data-remote]', function() { $(this).hide(); }); ...to hide element clicked, providing ajax call suc...

java - Why is my "Notes" tab crashing? -

i've tried searching answer i'm relatively new area of programming , using android studio. firstly, error i'm receiving when emulator crashes. bear me theres lot of code , first time posting. --------- beginning of crash 08-16 16:59:46.930 1861-1861/com.example.richard.stopandsearch e/androidruntime﹕ fatal exception: main process: com.example.richard.stopandsearch, pid: 1861 java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.textview.settext(java.lang.charsequence)' on null object reference @ com.example.richard.stopandsearch.mainactivity$noteslistadapter.getview(mainactivity.java:157) @ android.widget.abslistview.obtainview(abslistview.java:2347) @ android.widget.listview.measureheightofchildren(listview.java:1270) @ android.widget.listview.onmeasure(listview.java:1182) @ android.view.view.measure(view.java:17547) @ android.view.viewgroup.measure...

SQL Server 2008 / 2012 - views & sql formatting -

hopefully newbie question. so if have kind of long set of selects in sql , couple of sub-selects within clause, i'm less satisfied formatting in view designer, appears way display/show views after saved. so, in short, there way directly edit views within ssms, , have views retain formatting in code? i.e.; select case /*comment */ when = 5 b = 2 else b = 4 /* why b 4 */ end field_1, dt field_2,... get's mashed up select case /*comment */ when = 5 b = 2 else b = 4 /* why b 4 */ end field_1, dt field_2,... or along lines. are using query designer? instead, use ssms query window. ssms object explorer, right-click on view , select script view as-->alter to-->new query editor window. format view source in query window , run script change view. formatting preserved.

angularjs - Title and legend alignment? -

example: https://jsfiddle.net/zh1g5305/13/ i new google charts , angularjs , in above example in jsfiddle can see title in right side , legend in left. how can move top of pie chart title , legends should vertically aligned. suggestions welcome.thanks

Can we nest an IF inside a COUNTIFS in Excel? -

Image
i have been working on attendance sheet , trying make monthly reports automatic. have asked my previous question on same issue , got idea accomplish task. but have stuck @ 1 place. have below formula: =countifs(c5:c27,">0", e5:e27,"g", f5:f27,"cat1") the value in cell "c" in above coming below formula (in cell "c") =if((countif(g5:ak5,"p"))>0,1,0) i had add column ("c") supply input fist formula. question - "can merge if function inside countifs result in 1 go , eliminate use of column (column c)"? to perform these cell reference acrobatics need switch array formula . array formulas chew calculation cycles logarithmically practise narrow referenced ranges minimum. 'helper' column such you've used in column c can reduce calculation cycles , make worksheet more 'user friendly'. a countifs function requires ranges being examined not same size same shape. loo...

r - Conditional formatting FlexTable -

i looking way conditionally format flextable reporters using percentage figures. below small example. packs <- list("reporters","scales") lapply(packs,require,character.only = true) dat <- cbind.data.frame(rep("abcd",2),c(0.07,0.11),c(0.03,0.01)) colnames(dat) <- c("a","b","c") dat[,2] <- percent(dat[,2]) pp = pptx() pp = addslide(pp, "title , content") datft = flextable(data = dat) cname <- c("b","c") (i in cname) { if (i=="b") { datft[dat[, i] <= 10, i] = cellproperties( background.color = "green" ) datft[dat[, i] > 10, i] = cellproperties( background.color = "red" ) } else if (i=="c") { datft[dat[, i] <= 0.02, i] = cellproperties( background.color = "green" ) datft[dat[, i] > 0.02, i] = cellproperties( background.color = "red" ) } } pp = addflextable(pp, datft) writedoc(pp, p...

apache - Updating an arugement of a ModSecurity Core Rule -

i have big form needs send 1000 post data arguments @ most. triggers false alarm rule 960335 of owasp core rulset. looked rule in modsecurity_crs_23_request_limits.conf can't figure out how set max_num_args higher on specific form. in modsecurity_crs_60_customrules.conf , have tried: <locationmatch "/form.php"> secruleupdatetargetbyid 960335 args:"@gt %1000" </locationmatch> but syntax check gave me error `updating target id no ruleset in context` can tell me how set max_num_args higher? here's rule 960335 : secrule &tx:max_num_args "@eq 1" "chain,phase:2,t:none,block, msg:'too many arguments in request',id:'960335', severity:'4',rev:'2',ver:'owasp_crs/2.2.9',maturity:'9', accuracy:'9',tag:'owasp_crs/policy/size_limit'" secrule &args "@gt %{tx.max_num_args}" "t:none,setvar:'tx.msg=%{rule.msg}', setvar:tx.an...

google app invites - Get suggested invitees failed due to error code: 3 -

i'm trying run app invites demo on kitkat device returns get suggested invitees failed due error code: 3 and after create invitations failed error code: 3 what kind of error it? can find error list? in experience, happens when sha-1 signature of app not compatible android api key specified in google developer console if don't care app invites you, might want consider removing app/signature restrictions. otherwise, add them.

c# - List<T> get random element doesn't work -

i have following piece of code: private random r = new random(); private list<t> randomelement<t>(iqueryable<t> list, expression<func<t, bool>> e, int items = 3) { list = list.where(e); return list.skip(r.next(list.count())).take(items).tolist(); } the problem when call , want example return 3 random items list, returns 3 2, 1 ? i want @ time 3. what doing wrong? if have 10 elements in list, , ask 3 "random" items, in solution if random number generator returns 8, skip first 8 elements , has 2 items available return (items 9 , 10). why happening. if want random items, instead shuffle list , not skip any, take number want. randomize list<t>

javascript - Format of data array in D3 bar chart, array of values into an array of objects -

i have simple interactive bar chart. mike bostock's http://bl.ocks.org/mbostock/3885304 tooltip on bar. the 2d array elements have has format "word" string, frequency number in... good,5 hello,4 bye,2 aloha,1 ... i tried concatenating "letter:" , "frequency:" 2d array elements follow code. not working anyway. string concatenate casting frequency number string type. @ sure how work this. is there way concatenate string number in array elements preserve type, of number? or there way load data better current array array of objects?? i working files in future. arrays suggestions... <pre> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> - bar chart demo</title> <script type='text/javascript' src='http://d3js.org/d3.v3.min.js'></script> <style type='text/css'> body {...

Expression Criteria for Access -

i've created database 15000 records , want create form filters records according entries inputed in textboxes through query. of columns i've used expression : like "*" & [forms]![testform]![testtxt] & "*" i use "like" if user decides not input in textbox, query ignores parameter. when comes dates (i have 2 columns contain dates) can't make ignore empty textbox when user decides not write anything. can me make expression below show records in query if datetesttxt empty ? > [forms]![testform]![datetesttxt] if you're using query designer, add condition is null so visually in query builder like: criteria: > [forms]![testform]![datetesttxt] or: null update: this should work single expression: is null or > [forms]![testform]![datetesttxt] and more correct solution in case if have conditions on more 1 column

android - Alarm "onReceive" not being called -

i'm trying create alarm fix lost connections google cloud messaging occur due heartbeat bug, found here how avoid delay in android gcm messages / change heartbeat however, alarm's onreceive class have being set called every 1 minute testing never being called. i've looked in several of other questions pertaining topic, , of them concentrate on spelling , declaring receiver in manifest, i've checked several times. here relevant code: mainactivity.java //alarm created here gcmheartbeatalarm gcmalarm = new gcmheartbeatalarm(); gcmalarm.setalarm(this); gcmheartbeatalarm.java public class gcmheartbeatalarm extends broadcastreceiver { private alarmmanager alarmmgr; private pendingintent alarmintent; @override public void onreceive(context context, intent intent) { //the part supposedly going fix gcm connection dropped bug, needs called every 5 mins or via alarm keep //gcm connection open //commented out // c...

compression - Mass image optimization server side to Google Page speeds standards? -

i compressed images gd library , size 1/3 of original size google page speed showing me can still optimize images. have lot of images on server , downloading them , uploading them take eternity, best if possible through script or api ? i researched little , found question: google page speed-like image optimization but smush api seems down , can't install mod_pagespeed because i'm running site on shared hosting service. do have recommendations optimize images google pagespeed satisfied ? you can use tools such optipng, deflopt, jpegoptim etc. of these command line tools dedicated compressing various image formats. depending on whether want static assets or dynamically uploaded content, there 2 ways integrate them web page. if use static assets (such company logo, icons etc.), optimize them manually - or if use deploy script such grunt.js , check out if there modules can automatically when run script. if want optimize dynamic content, need able invoke t...

unity3d - Wait function on Unity -

i want wait until "next" button pressed continue child.addchild(tmp); childrenadded.push(tmp); neighbor.getcomponent.<renderer>().material.maintexture = null; -wait until click on next button continue- toexpand.push(tmp); any idea? tried: while(true) { if(gui.button(rect(500,680 ,100,30),"next")) break } but doesn't work; freezes. instead of waiting, can have code called when button clicked, this: void ongui() { if(gui.button(rect(500,680 ,100,30),"next")) toexpand.push(tmp); } } if possible, consider using unity 4.6 or later can use new ui easier work with.

php - Can I look for broken resources on my homepage with Codeception? -

i want make sure none of scripts / css / images failing. there this? $i->wantto('verify resources loading'); $i->amonpage('/'); $i->seefailingresourcecountis(0); something fail if image can't loaded, or causes server error, etc. in php can check if of files legit. ' /> but, cannot check if resources loads via php, because php handle creation of page. you need use in javascript check successful loading of images, ecc.

c# - How can I select the year in each row -

Image
i trying list of dates of year of manufacture determining age of vehicles. column looks this: and code looks this partial void reports_initializedataworkspace(list<idataservice> savechangesto) { // year of manufacture var yom = insurancequotations.selecteditem.myear; var bday = convert.todatetime(yom); datetime today = datetime.today; int age = today.year - bday.year; if (bday > today.addyears(-age)) age--; age = convert.tostring(age); } i can select fist date in column. how loop through dates in column? you can loop through insurance quotes: foreach (insuarancequote item in insurancequotes) { var yom = item.myear; .... } note: i'm making presumptions here. 1 grid of insurance quotes of type insurancequote , 2 data collection on screen called insurancequotes .

How to list the contents of a zipped uploaded to google drive folder using API? -

many large zip-files uploaded google drive. before downloading need preview zip-archive understanding files in it. on google drive website can preview zip-archive , see files\directories list. is possible if use google drive api? thank lot!

c# - if statement error: int conversion to boolean -

public static void main(string[] args) // method called "main". called when program starts. { random numbergenerator = new random(); int userinput1; int userinput2; int finaluserinput; int thecorrectanswer; //generating random numbers. 1 10. 11 exclusive. userinput1 = numbergenerator.next(1, 11); userinput2 = numbergenerator.next(1, 11); //asks user solve multiplication problem. console.write("what " + userinput1 + " x " + userinput2 + " ?"); finaluserinput = convert.toint32(console.readline()); thecorrectanswer = userinput1 * userinput2; if(finaluserinput = thecorrectanswer) hi. when try set if statement conditions, error message pops saying cannot implicitly convert int boolean. i'm not trying @ all. i'm quite lost. help! you setting value of thecorrectanswer variable finaluserinput using single = . , statement returns value – integer one. you need use =...

Making CSS Drop Down Menu 2 Columns -

long time lurker posting first time. i've been searching around , found solution i'm looking reason i'm getting weird result. basically menu has many items see them in 2 columns. searching found needed make "ul" twice wide "li" , float "li" left. working i'm getting blank space in 2nd row. #cssmenu { padding: 0; margin: 0; border: 0; width: auto; } #cssmenu ul, #cssmenu li { list-style: none; margin: 0; padding: 0; } #cssmenu ul { z-index: 597; } #cssmenu ul li { float: left; min-height: 1px; vertical-align: middle; } #cssmenu ul li.hover, #cssmenu ul li:hover { position: relative; z-index: 599; cursor: default; } #cssmenu ul ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; width: 100%; } #cssmenu ul ul li { float: left; width: 250px; } #cssmenu ul ul ul { top: 0; left: 250px; width: 500px; height: 20px; } #cssmenu ul li:hover > ul { visibility: v...

jquery - Sub menu slides up then back down if it is already down selected (bug) -

hello having problem jquery vertical accordion style menu. if click sub menu, drops down. if click on different sub menu, current 1 slides , 1 clicked slides down. i using .slideup() jquery function default sub menus position before sliding next 1 down. the problem when click on sub menu, drops down, click on same sub menu, slides , slides down again. how can prevent happening? instead want submenu slide if down. please see jsfiddle: http://jsfiddle.net/o5w37zva/ your problem in selector. use below selector slideup others submenus , slides submenus in nav. $("#nav ul") if use selector, need modify .not() function , remove current,$(this) element in function. $("#nav ul").not($(".submenu-customers")).slideup(); with selector, if user click opened submenu, slideup only. can see demo: http://codepen.io/ogzhncrt/pen/bdypbk

apple push notifications - APNS certificate expiry date error with MobileFirst Platform 7.0 -

when deploying apns certificate in .wlapp file in mfp 7.0, i'm seeing null-pointer exception when validates end-date, though has one. ( openssl pkcs12 -in apns-certificate-sandbox.p12 | openssl x509 -noout -enddate returns valid date in future). seems others have made work, i'm guessing must doing wrong...has else resolved similar issues valid apple push notification service certs failing deployed on mfp relevant lines log: 947: "com.ibm.worklight.admin.services.applicationservice e fwlse3000e: server error detected.", "948: com.ibm.worklight.admin.common.util.exceptions.validationexception: fwlse3119e: apns certificate validation failed. see additional messages details.", "949: @ com.ibm.worklight.admin.util.pushenvironmentutil.validateapnsconfiguration(pushenvironmentutil.java:232)", "950: @ com.ibm.worklight.admin.util.pushenvironmentutil.validatepushconfiguration(pushenvironmentutil.java:220)", [ ... lots more trace her...

ASP.NET Session State values swapping -

we have old asp.net 2.0 web forms application running on customers hardware makes extensive use of session state. website running on old windows 2003 web server (due replaced soon) , configured use sql server session state store. we have discovered issue appears session data being swapped between sessions when different users hit same page @ same time. these users unrelated, have different session id's , coming different ip addresses. in particular there 1 variable being swapped. array holding number of different pieces of information , data types (strings, integers , dates). hangover asp roots. both users have pushed button on same page generating 2 post requests within few milliseconds of each other. our logging has recorded of values session state. response these post requests redirect next page in process. the logging has recorded 2 requests 200 milliseconds apart next page , has recorded session state information these 2 requests. session state variables correct ex...

java - Issue converting array to array list -

trying write java code single row battleship style game, , when tried convert array arraylist, game started returning "miss" no matter what. public class simpledotcomgame { public static void main(string[] args) { int numofguess = 0; scanner sc = new scanner(system.in); simpledotcom dot = new simpledotcom(); int rannum = (int) (math.random() * 5); arraylist<integer> locations = new arraylist<integer>(); locations.add(rannum); locations.add(rannum + 1); locations.add(rannum + 2); dot.setlocationcells(locations); //think you're running // separate program parameters set cells "locations" boolean isalive = true; while (isalive == true) { system.out.println("enter number"); string userguess = sc.next(); string result = dot.checkyourself(userguess); //run program // check if cells hit...

android - Libgdx - rendering many small sprites VS a few big ones -

i working on effect game have several (200) stars coming edges of screen, moving towards middle while fading out. i want render each star on own (as it's own object) stars can have randoms speed, fade times, size , position. i'm afraid might effect older phones in performance, change alpha , rendering 200 sprites each frame 20 seconds (i recreate them when fade out). as alternative use larger chunks of stars same sprite (one image) means i'll have sacrifice random effects , stars fade out @ same time, obv won't good. i have no way test on older phones i'll ask here, looping through 200 sprites each frame (small images alter alpha each frame , position)? there alternative doesn't force me give random behaviour of each star? or have bite bullet , render larger images (maybe 3-4 different images several stars in each)? you try flyweight pattern , explanation , tutorial found here . have default model of sprite (in case, star) , draw @ different p...

Polymer 1.0 binding properties to inline styles in template -

i in polymer... <dom-module id="logo-standard"> <style> :host { display: block; } </style> <template> <div class="logo-wrap"> <div style="width: {{logowidth}}px;"> awesome logo </div> </template> <script> (function() { polymer({ is: 'logo-standard', properties: { logowidth: { type: string, value: '400' } } }); })(); </script> </dom-module> i.e. dynamically style element using property. is possible? if so... how? this question has been answered me here as of polymer 1.2.0 , can use compound bindings to combine string literals , bindings in single property binding or text content binding like so: <img src$="https://www.example.com/profiles/{{userid}}.jpg"> <span>name: {{lastname}}, {{firstname}}</span> and example <div style$="width: {{logowidth}}px;">...