2,040 Posted Topics
Re: One way to debug this is to delete some blocks of the code and recompile. If the error still exists, put back the deleted blocks and delete the next set of code blocks. Recompile agian. If the error still persist, keep doing it until it compiles. Then the deleted blocks … | |
Re: Quick sort is one of the worst sort algorithm (O(n^2)) even though the average/best big O is nlogn. If you want to sort it, use other [sort algorithms](http://en.wikipedia.org/wiki/Sorting_algorithm). Anyway, what does "*as efficient as possible*" mean? Does it include both space and time? One way to deal with is to … | |
Re: My problem is that I do not know how much you know about Java. When you said you are a beginner, it is even worse to me because programing GUI requires fundamental Java programming knowledge. If the basic is not firm enough, I am not sure you would understand the … | |
Re: I'm sorry, this is **Ruby** forum. You may be looking for JavaScript/DHML one. To answer your question, your JavaScript call may be invalid. The last variable '*refreshConditionOptions*' is a global variable from somewhere? | |
Re: >it checks whether the list is null or not ,and it is null;then it adds data to the list That's partially correct. It actually serves 2 purposes here. If your original list is empty (null) -- call the function for the first time ever, then it creates the *head* node … | |
Re: First you need to read in each line content from the file. An explanation to read & write file in perl can be found [here](http://www.perlfect.com/articles/perlfile.shtml). Then extract the number portion you need (the last 3 number groups in a line) using [match](http://www.comp.leeds.ac.uk/Perl/matching.html) functionality (something similar to `$string =~ m/regex(capture_group)regex/`). Take … | |
Re: Please read [this](http://stackoverflow.com/questions/4181884/after-and-before-css-pseudo-elements-hack-for-ie-7), someone has already suggested a solution. | |
Re: It looks like you don't even know what [HTML5](http://www.w3schools.com/html/html5_intro.asp) and [JavaScript](http://www.w3schools.com/js/default.asp) mean... They are two separated topics. Please read the links I provided for you for more understanding. | |
Re: Since noone has replied this, I will just put some notes on. Here is an [example](http://perl.about.com/od/appliedprogramming/ss/servicemonitor.htm) to deal with checking server status. And here is [one](http://www.revsys.com/writings/perl/sending-email-with-perl.html) of many [samples](http://www.google.com/#hl=en&sugexp=les%3B&gs_rn=1&gs_ri=hp&gs_mss=perl%20check%20se&pq=perl%20check%20server%20status&cp=12&gs_id=p2&xhr=t&q=perl+send+email&pf=p&tbo=d&sclient=psy-ab&oq=perl+send+em&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&bvm=bv.1357700187,d.b2U&fp=e3ddb9331e73c428&biw=1680&bih=939) for sending email. | |
Re: The $pid is the process ID created by the fork() if it is successfully created. The `if(!pid)` should be `if($pid)`. I think it is just a typo. You should always use strict when you write Perl script. | |
Re: >My get request isnt working What does that mean? Not working means millions of things... Have to taken a look at [Socket doc](http://perldoc.perl.org/Socket.html)? | |
Re: Do you want to inherit or hack the existing model? Do you have the source from [github](https://github.com/spree/spree)? Or how are you using it in your application right now? One way to extend this model is to create a new table & model file (by running migration). Then implement methods that … | |
Re: If you think the problem is in lines 59~63, how about adding printf() to print out something at line 60, and between line 61 and 62? I mean if the bug is really there. (Simple debugging approach) | |
Re: Hmm... You don't need to have function() to create an object unless you are going to init it later on inside another function or let a function init a new class object. Simply create it (and must be) after the constructor function. <script type="text/javascript"> function person(firstname,lastname,age,eyecolor) { this.firstname=firstname; this.lastname=lastname; this.age=age; … | |
Re: There are many implementations & approaches to achieve what you want, but most of them will require JavaScript (please don't use flash for this). One way to do is to load all your images in thumbnails and change the image display URL to the image your mouse is over. You … | |
Re: Why do you want to trigger the click event of a button by simulating the click? Why can't you call the same function that the click event is calling instead? | |
Re: Too vauge question. Also, please read the [forum rules](http://www.daniweb.com/community/rules) for how to post a question... | |
Re: Do your original images that used as icons are different sizes? If so, you may need to scale it before you add to the JLabel, or simply scale the size of images and resave them yourself. | |
Re: It depends on your image format. java.awt library provides classes that deal with image processing -- BufferedImage, BufferedImageOp, ColorModel, etc. (brief answer for brief question) | |
Re: I can't seem to find a newer version for Window object in W3C... Anyway, according to the [version](http://www.w3.org/TR/Window/) I found, opening a new window is not set as standard. Yet, when I look at how the function should be used at [W3school](http://www.w3schools.com/jsref/met_win_open.asp), it shows that you could specify the URL … | |
Re: The problem is in line 15 `var index1 = eachFilter[i].match(re1);`. Do you understand how *match()* function works? Have you ever tried to print out what value returned by *match()* function? If you do not have grouping in your regex, the function (in JavaScript) will return an array size of 1 … | |
Re: Bad variable naming... Very difficult to follow... Anyway, line 78, you declare array size of 2 to each ply. In your *while* loop, you use *i* as index pointing to your array value (in your fun_ply()). You keep increasing the value of *i* (line 271) when the answer is not … | |
Re: Those warning are old bugs and it seems that FF doesn't fix it yet... https://bugzilla.mozilla.org/show_bug.cgi?id=671515 for unable to read chrome manifest file https://bugzilla.mozilla.org/show_bug.cgi?id=636367 for XUL box warning ![]() | |
Re: This line <SCRIPT language="JavaScript"> Chant it to <Script type="text/javascript"> | |
Re: You need to implement ActionListener and implement actionPerformed() to accept your button click event. Inside the method, you could use setText() to your text area object. Please refer to [oracle link](http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html). | |
Re: Line 27, you declared a variable with upper case, but then later on you use it with lower case. It means that the variable created in that line has no use. Better declare & initiate it at the same time at line 38 `var userChoice = ...`. | |
Re: Have you attempted to rebuild the jar file using Java 7? | |
Re: Next time, please copy & paste the error shown by runtime. Your assumption may be correct, but it may be incorrect under certain circumstances. If you look at the method in Logger class, there is a variable *this.input* inside the method. The variable *input* and *this.input* are not the same. … | |
Re: I guess you should read this [site](http://guides.rubyonrails.org/testing.html) to help you in writing unit tests. The test requires another module (`require 'test_helper'`) & the test class should inherit from ActiveSupport::TestCase. To be honest, your tests after line 3 (4+) don't seem to be that helpful. If an object of a Product … | |
Re: 1)The isNaN() function doesn't check for string but rather for not-a-number. Anything that is not a number is not equal to String. 2)Your boolean check is not valid. In JavaScript, it is tricky when it comes to boolean. Have you ever tried 0==false or 1==true? Both will return true. That's … ![]() | |
Re: Even though it looks like zero value is in the middle between positive and negative because the opposite of all-zero-bit is all-one-bit, it is not. Because 0 is (somewhat) being included in the positive side, there are 2^31 positive integer (0 up to (2^31)-1) and 2^31 negative integer (-1 up … | |
Re: @Proglearner, Your script is not working... 1)Line 6, `j = Math.abs(Math.random() * 10);`, the Math.abs() does nothing for you. The value returned from Math.random() is between 0 and 1 (a float), so it is always a positive number anyway. 2)Line 11, `oneString=String(oneArray[Math.abs(Math.random() * 10)]);` would almost always produce undefined. (Also … | |
Re: From glancing, you initiate SimpleDataSource in your **main()** but that does not have anything to do with your **ATM** class. In other words, they are 2 separated objects. If you want to relate the source with ATM class, you should not use *static* modifier but rather instantiate an instance and … | |
Re: The answer for your first question is that your mouse event covers only when the mouse cursor is hovered over the selected element. But when the mouse cursor is moved to be over your new panel, the moustout event is called and that will cause your panel to be hidden … | |
Re: To create Date object, you can use... var date1 = new Date("2013-01-09") var day = date1.getDay() // 9 var month = date1.getMonth() // 0 is Jan var year = date1.getYear() // 113 counted from 1900 var timeInMilli = date1.getTime() Then you can loop through the different time you want to … | |
Re: After I searched and looked at their github, I don't see anything that talks about blur effect. I am guessing that the library does not support blur effect at the moment. You may have to deal with it using regular HTML5 (without the library). | |
Re: Does your database support the character type though? | |
Re: There is no custom tags in Ruby if you are talking about arbitrary tag name as in JSP. What are you trying to do by the way? Maybe *partial* in Ruby would be what you need? | |
Re: My question is that why you need to revert the checked property after you apply CSS? checkbox.prop("checked", !checked); By the way, wouldn't [find()](http://api.jquery.com/find/) return all elements it could match with the given condition? In other words, shouldn't it return all checkboxes instead of only one (as your script is expecting)? … ![]() | |
Re: I'm not sure that the code works as the explanation. I do not see where the total value of sale from an agent is added with its previous value read. Line 119 will retrieve the existing value and reassigns to the key in line 121. In other words, it is … | |
Re: What is the syntax of funcion *add()* for *Banner* object? Are you sure that you add it correctly? Have you taken a look at the source (using view source)? | |
Re: Could you please tell us **what is wrong** with it? You just said **not working** and that means million of things. 1)Did you include jquery library file to your page? Because the script is using jquery. 2)What did you change in the script? ... | |
Re: >String[] fields = line.split("[\\s}"); Do you know what regular expression is? If you do, then I would ask you to go back and read about [regular expression](http://www.regular-expressions.info) format. If you don't, I am telling you that your regular expression is wrong. You must need to know what '[' and '}' … | |
Re: Are you sure that you created your date object correctly? I tested by plugging in the date string you gave and it worked. var d1 = new Date("2012/12/29") var d2 = new Date("2012/12/29") if (d1.getTime()>d2.getTime()) { alert("d1:"+d1+"\n GREATER THAN\nd2:"+d2) } else if (d1.getTime()==d2.getTime()) { alert("d1:"+d1+"\n EQUAL TO\nd2:"+d2) } else { … | |
Re: >1) The format of the form changes after the event. I would like the new question to be identical the other questions in the form. The text is not center aligned and the input box is smaller and not aligned. The layout is changed because you are using *table* tag … | |
Re: Line 5 `Connection conn = JavaConnect.ConnectDB();` I don't know how your JavaConnect class looks like. Also, it is odd to see a method name starts with an "uppercase" letter. The reason is that the method name does NOT follow the naming convention... Line 165, when you deal with SQL as … | |
Re: If you do a regular refresh (using only F5), a browser will not completely ditch whatever changed on the page but rather keep it on there even though the page is reloaded. If you want it to really clear it off, you must call another javascript function after those elements … | |
Re: It is very difficult to give you an idea because different systems may have different requirements involved (including restrictions & constraints). When you said you know the *main system function*, does it mean you know only the abstract level of the process? Or you know all details of it? What … | |
Re: The AI field involves a lot of mathematics & statistics (more on statistics though). It is very difficult to explain if you don't have knowledge base of those requirements. If you don't get it at all, you may not be ready to deal with this subject yet. If you insist … | |
Re: > Scanner file = new Scanner(new File("text.txt")).useDelimiter("[^a-zA-Z]+"); I just want to clarify your program on this line. Do you intend to count only words that contains only alphabets? If there is a word with a hyphen in the middle, do you count them as 2 words or one? (i.e. Is … |
The End.