Posts

java - Incompatible Types - found:int required:boolean -

i'm trying display: equivalent if first numerical input equal second input. what's wrong code? import java.io.*; public class twonum{ public static void main(string[] args){ int number; int number2; string input1=""; string input2=""; bufferedreader in = new bufferedreader(new inputstreamreader(system.in)); system.out.println("input number: "); try{ input1=in.readline(); }catch(ioexception e){ system.out.println("error!"); } number = integer.parseint(input1); try{ input2=in.readline(); }catch(ioexception e){ system.out.println("error!"); } number2 = integer.parseint(input2); if(number=number2) { system.out.println("equivalent"); } if(number>number2) { system.out.println("gre...

java - JTextArea Displays 0 after calculate button clicked -

i'm writing code university, read user input , calculate charges (its hospital bill) but when press calculate jtextarea displays 0 value i'm newbie guidance appreciated the code is: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class hospitalchargescalculator extends jframe implements actionlistener{ private jlabel hospitalstaylabel; private jlabel medicationlabel; private jlabel surgicalfeeslabel; private jlabel labfeeslabel; private jlabel rehablabel; private jlabel totallabel; private jtextfield hospitalstaytf; private jtextfield medicationtf; private jtextfield surgicalfeestf; private jtextfield labfeestf; private jtextfield rehabtf; private jtextarea totalchargesta; private jbutton calculateb; private jbutton exitb; public static final int width = 500; public static final int height = 350; static int totalstaycharge; static int totalmisc; static int totalcharges; static int totaldays; static int totalmedication; static int t...

java - Elegant way to get Locale in Spring Controller -

i'm looking cleaner way (in spring 3.2) current locale explicitly calling localecontextholder.getlocale() @ start of each controller method. has compatible java annotation, i'm not using xml config. here's i'm doing currently. @controller public class wifecontroller { @autowired private messagesource msgsrc; @requestmapping(value = "/wife/mood") public string readwife(model model, @requestparam("whatimdoing") string iam) { locale loc = localecontextholder.getlocale(); if(iam.equals("playingxbox")) { model.addattribute( "statustitle", msgsrc.getmessage("mood.angry", null, loc) ); model.addattribute( "statusdetail", msgsrc.getmessage("mood.angry.xboxdiatribe", null, loc) ); } return "moodresult"; } } in spring 3.2 reference docs , section 17.3.3, supported method argument types: the following suppo...

python - merge a few lists and regroup them into a dictionary to plot to multi-series Highcharts -

animal = ['hamster', 'dolphin', 'ant', 'hamster', 'hamster', 'ant'] date = [20151007, 20151007, 20151007, 20141007, 20120101, 20010101] total = [27, 5, 5, 5, 18, 40] i want combine these 3 list one. if animal same, should grouped , total should follow asc date. if animal type doesn't have enough date, it'll become 0. example: [{'name': 'hamster', 'data': [0, 18, 5, 27]}, {'name': 'dolphin', 'data': [0, 0, 0, 5]}, {'name': 'ant', 'data': [40, 0, 0, 5]}] i'm trying plot them highcharts dates in own list. [20010101, 20120101, 20141007, 20151007] i can combine lists using: zip(animal, date, total) but how them it's own type , arrange total asc date? edited this how got far. don't think it's efficient. think? improvement suggest? (only pythonic suggestion pls) b = [] k, v in enumerate(animal): counter = 0 in range...

xcode7 - Linker Command Failed With Exit Code 1 after reopening Xcode -

Image
my code not working reason. didn't change name of project or anything, happened of sudden. i'm not sure happened need simulator work! my issue solved deleting framework in project's folders. guess duplicate.

c++ - Does a normal Windows Installation include the MFC100.dll? -

easy question, can't google answer. does normal windows installation include mfc100.dll libary? if so, since when mfc100.dll come windows installation , not vc+ redist 2010? , why isn't windows 10 including newer version of mfc (mfc120.dll) path mfc dll file windows(syswow64)\mfc100.dll sorry horrible english, i'm not native speaker. don't rely on mfc dll being installed on windows. msdn says : if dynamically link application mfc library, have redistribute msvcr100.dll because mfc dlls use shared version of c run-time library (crt). have redistribute mfc100u.dll or mfc100.dll. msdn blog says : windows not mfc delivery channel there no if or when. need mfc dll? must install it. , take care install version linked against (might change visual studio service pack).

javascript - Custom CKEditor Oembed consumer callback is invalid in Symfony -

i using latest ckeditor cdn 4.5.4. trying implement custom oembed consumer described here http://docs.ckeditor.com/#!/api/ckeditor.config-cfg-embed_provider i using symfony endpoint retrieving oembed information. reach url http://localhost/oembed/?url=https://www.facebook.com/someecards/posts/987699161267010&callback=ckeditor._.jsonpcallbacks[78] the url , callback provided me ckeditor , far understand, callback cannot altered. i using https://github.com/oscarotero/embed succesfully sorts of links. problem how choose return data symfony. if choose send response text string, works, on embeds facebook, include <script> tags getting processed , altering return. ideally use proper jsonp method symfony provides this... $response = new jsonresponse($this->payload, 200, array()); $response->setcallback($callback); return $response; however when this, told symfony... invalidargumentexception in jsonresponse.php line 77: callback name not valid. so ckedi...