Posts

javascript - How can I validate 3 select elements with jQuery? -

i'm trying validate 3 select fields on form, application score keeping application hockey, , recording scoring plays. goal scorer, b primary assist, , c secondary assist. have following validation rules: a must not empty b cannot equal or c c cannot equal or b if b empty, c must empty so in other words, a, ab, or abc valid combinations, must unique. disabling submit button applying disabled bootstrap class/html attribute submit button. in actual code, = awaygoal, b = awaypassist, c = awaysassist i have following jquery code: var awaygoal = $("#awaygoal"); var awaypassist = $("#awaypassist"); var awaysassist = $("#awaysassist"); var awaygsubmit = $("#submitawayscore"); $('#awayscore select').change(function() { if(awaygoal.val() != "" && awaypassist.val() != awaygoal.val() && awaygoal.val() != awaysassist.val()) { if(awaypassist.val() != "" && awaysassist.val() != ...

installation - Python: TypeError when running script but not in interpreter -

i trying run python file via command line or within interpreter using: import sys import subprocess subprocess.call([sys.executable, "file.py", "arg1", "arg2", "arg3"]) however program returns typeerror: "cannot concatenante 'str' , 'numpy.float64' objects". what can not understand, when run program line line in interpreter, there no such errors , fine. i have no idea start debugging suspect have setup. i have 64bit version of python , 32bit version of python installed in windows 7. both versions of python 2.7. (this due usage of modules available in 32 bits - such program above being running in 32 bit version). environment path variable has been edited use 32bit version. i'm not sure other information relevant please let me know , i'll dig up. basically want able run program command: python program.py arg1 arg2 arg3 any appreciated you passing arguments function without converting ...

android - Using AsyncTask to implement API and updating result to UI -

i'm using asynctask in api carry out network operations. @ ui part there button, clicking on triggers api execute request/async task. api implementing callback updated onpostexecute() method. api gets right data populated once onpostexecute() passes data on callback. works good. i'm getting conceptual problem while updating ui. want achieve: 1- click "button" on ui 2- want update api's response string ui. response string after executing asynctask. the problem api return null response in current thread of execution. once ui thread done, see api/asynctask data coming in. know i'm missing trivial, important. know whats right way update api response on ui? [update] here ui code includes clicking button triggering async task via api (just class implements callbacks getting server response) button.setonclicklistener(new onclicklistener() { public void onclick(view v) { api api = new api(); request request ...

Removing Characters within a string-Java -

i keep getting error removing character within string. have tried find on site , nothing has worked. not post. rather maybe answer explains why shows , how fix in case else encounters issue. without further due, here code: public jtextfield clean() { string cleaner = topfield.gettext(); cleaner=cleaner.tolowercase(); int length = cleaner.length(); stringbuilder combiner = new stringbuilder(cleaner); (int x=0;x+1<length;x++) { char c = cleaner.charat(x); char c1 = cleaner.charat(x+1); if(c==' ' && c1==' ') { combiner.deletecharat(x); cleaner=combiner.tostring(); } if(c!='a' && c=='b' && c!='c' && c!='d' && c!='f' && c!='g' && c!='h' && c!='i' && c!='j' && c!='k' && c!='l' && c!='m' ...

Java - Creating an image -

i'm working on game in java , trying create background without using image files. image consists of square split 4 triangles, each of different color. if point me towards of using graphics2d , saving bufferedimage , great. i recommend: first create bufferedimage using constructor takes 3 ints: width, height, , bufferedimage type, bufferedimage.type_int_argb work well, , width , height constants in program. you extract graphics2d object out of bufferedimage calling creategraphics() method. then draw graphics object using drawxxx(...) methods of have many select from. to change color, call setcolor(color c) on graphics/graphics2d object. when done drawing, sure dispose of graphics object via dispose() method. edit per adrian blackburn, check out bufferedimage tutorial part of standard oracle java tutorials.

xaml - ApplicationBarIconButton throwing AccessViolationException when i try to make any change -

i have set of applicationbariconbuttons on 1 of xaml page, looks on xaml: <shell:applicationbariconbutton x:name="button1" iconuri="/images/yourimage.png" text="button 1"/> in xaml.cs: button1.iconuri = new uri("/images/yourimage2.png", urikind.relative); when add execute change of iconuri or text, throws accessviolationexception i wonder what's going on over net, that's way such simple/straightforward change. , image file changed "content", build action "do not copy", i've tried sorts of combination it's still throwing errors. i've recreated whole solution. but i'm having problem whereby xaml doesn't updated when make change, way me update app on device deleting , reinstalling. another strange thing that, when run code analysis, i'm getting this: ca0001 error running code analysis ca0001 : following error encountered while reading module 'xxx': not resolve memb...

c# 4.0 - ASP.NET MVC 4 AttributeRouting Multiple POST Actions in same controller -

i not sure doing wrong here. whenever post request controller update action invoked. calling: http://localhost/members/login/ however update keeps getting request. have tried switching order of actions in controller no avail. [routeprefix("members")] public class memberscontroller : apicontroller { [post("{member}")] public void update(member member) { //do stuff } [post("login/{member}")] public httpresponsemessage memberlogin(member member) { //do stuff } } any appreciated. thanks! that because api routing same. this article explain how routing , action selection done in web api. if not want split them 2 controllers make update put request. should tell routing engine 2 different actions.