2,040 Posted Topics

Member Avatar for Troy III

Nice snippet. One note for practicality, doing white-list sanitization is better than black-list when it comes down to security. In other words, reject any thing if found any value that is not in expected values rather than attempt to remove unwanted values which may or may not be foreseen. It …

Member Avatar for Troy III
2
274
Member Avatar for felgall

Many people think that setTimeout() is a sleep for the caller. No, it is not. To me, it likely works as a fork (threading) but not quite. Looking at the script in the post above, the function will fire each process for each i value. Then each process will wait …

Member Avatar for Troy III
0
367
Member Avatar for basamdamdu

@degasdad Isn't line 14 reading the value of shirt volume? Also, line 18-20 are the computation including the volume of the price already? By the way, in the computation of line 18-23, I believe that you do not need 'parseFloat()' because the variables are already declared as 'float' inside the …

Member Avatar for etshirt
0
2K
Member Avatar for chuckc

If the only resource that are using to run the app is CPU %, not mem %, you may need to check "paging" activity as well. See if the paging occurs and how high it is. Because you said there seems to be no memory leak but the app increasingly …

Member Avatar for chuckc
0
243
Member Avatar for aiki985

1.function gID(name) { 2. name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 3. var regexS = "[\\?&]"+name+"=([^&#]*)"; 4. var regex = new RegExp( regexS ); 5. var results = regex.exec( window.location.search ); 6. if( results == null ) 7. return ""; 8. else 9. return results[1]; } Line 1, declare function prototype (name & arguments) …

Member Avatar for aiki985
0
186
Member Avatar for soapy.thomas

Look at NathanOliver algorithm and I have two questions... Is string "*+0.5*" a float? Or Is string "*+.7*" a float? That may clear up a bit for the algorithm...

Member Avatar for m4ster_r0shi
0
400
Member Avatar for jalpesh_007

Ok, given assumptions as... 1) A user enters a correct identifier number. 2) The same user enters correct column numbers needed to find the minimum value in the data. 3) The csv file contains correct data format & number of identifier. Lines 13~17, you are asking a user to enter …

Member Avatar for Taywin
0
3K
Member Avatar for rotten69

The advantage of closure is to capture variable scope. Below is a use of closure in order to pass keyboard event which is the only way to pass in or the argument value is wrong. This is the prototype style I do by the way. // The acceptKeyBoard() function is …

Member Avatar for iamthwee
0
306
Member Avatar for jalpesh_007
Member Avatar for Taywin
1
123
Member Avatar for ihiroshi30

You have no idea what NormR1 said, haven't you? If you literally copy what NormR1 said, you will get an error. What you need to apply is the number range to all of your for-loop condition (lines 58, 64, 60, 75, etc)... For example... for(iMonth=0; iMonth<lbl1.length; iMonth++) { ... }

Member Avatar for JamesCherrill
0
244
Member Avatar for Baka_Kuma

If it is only to receive an input from a user via a system (which does both input and output), then yes it would have 2 arrows going going to and from the same system. It is just a flow of data, so a loop-liked is still fine as long …

Member Avatar for Baka_Kuma
0
118
Member Avatar for pocix

It will depends on how you define *controller*... To me, a controller is a layer between model and view. Model deals purely with database calls (read & write). View deals with data that does not call for database but display what the data is (its data structure may be completely …

Member Avatar for pocix
0
457
Member Avatar for Sobakaa

You need a JOIN for sure. The only different is how to use your JOIN. This is from the top of my head... You may try... SELECT user.USERNAME, user.FIRSTNAME, user.LASTNAME, user.LOCKED, user.EMAILADDRESS, role.ROLENAME FROM user INNER JOIN userrole ON user.id=userrole.user_id INNER JOIN role ON role.id=userrole.role_id

Member Avatar for WayneZ
0
161
Member Avatar for calomari

There are a few reasons why it does not go to 0. 1. You are displaying 361 months instead of 360. You have already computed the interest, capital, and remaining balance before you go into the loop. That's the first month but you did not display it. 2. The payment …

Member Avatar for Taywin
0
127
Member Avatar for penet.biz

Use alert(string) box to pop up messages at any time you want inside javascript. It is one of the easiest way to debug. Though, do not attempt to use the alert() inside a loop without a condition for it, or you would keep getting the pop up that easily annoys …

Member Avatar for Taywin
0
75
Member Avatar for raj26061990

The program is not useful at all. There are only 4 of 3-digit numbers that are Armstrong numbers -- 153, 370, 371, and 407. Besides, if a user does not pass an argument or passing in an argument which is not an integer, the program breaks.

Member Avatar for vinnitro
1
512
Member Avatar for jakubee

Deep copy means you need to recreate a new object for each item in the list before you add to the new list. In other words, create a new empty ArrayList, copy the object from the old list, and add the new copy object to the new list. In your …

Member Avatar for JamesCherrill
0
1K
Member Avatar for borchu

NormR1, I am not sure that the port number 8880 is a typo? Shouldn't it be 8080 which is a very common port number?

Member Avatar for borchu
0
3K
Member Avatar for wheels031799

How it does not work? One thing I can tell you right now is that your variables *stob*, *rob*, and *swop* should be declared with **var** outside any function. PS: I tested the script and it ran. Not sure what the result you are looking for though. By the way, …

Member Avatar for wheels031799
0
148
Member Avatar for chixm8_49

On another forum [here](http://stackoverflow.com/questions/5757233/find-s-algorithm-simple-question), the person who asked gives a good example (which is very simple) and the person who answered gives a very clear explanation. You should be able to apply to your problem from looking at what he did. If not, I would like to see all the …

Member Avatar for Taywin
0
2K
Member Avatar for PhilEaton

Assuming that the *field* argument is a HTML object. Try $(field).css instead? If it is still not working, you may need to pass in the field name instead of the object but still need the $() thing.

Member Avatar for Taywin
0
277
Member Avatar for katties

JorgeM has already given you the correct answer. You seems to miss certain things here. Where do you place `function showQuantity1(...)`? It looks like you did not place it inside a tag `<script type="text/javascript">...</script>` or you did not include the correct Javascript file to the HTML file. If you have …

Member Avatar for Taywin
0
112
Member Avatar for eirene08

Why are you making it so complicated? Also, what you really only need is **translate** and some **rotate** point using the angle from a center point in order to get the location of the draw string. Why do you use AffineTransform? Here is a method I implemented that returns an …

Member Avatar for Taywin
0
579
Member Avatar for dospy

I think you may need to look into packet sniffing... Though, there would be even more interesting detail you may like to read.

Member Avatar for Taywin
0
119
Member Avatar for lewilaloupe

What are you using to do the fading? What you may need to do is to create a script in object oriented fashion. Then create an object of the script to handle each spot where you displays images.

Member Avatar for Taywin
0
1K
Member Avatar for scarletfire

>The printBackward method should be written **recursive** in a singly list backward. That's the keyword, **recursive**. :) Your implementation is not recursive but rather iterative. Do you know what recursive is?

Member Avatar for JamesCherrill
0
209
Member Avatar for wheels031799

Also, using javascript to do all the work (generate a random value and use it as the final result) is very bad. Why? I could override your function or just manipulate certain values and I will always win prizes. ;)

Member Avatar for wheels031799
0
94
Member Avatar for rahul.ch

Using James's explanation, you should be able to see why the second statement is invalid. //Second statement: int[][] it2 = new int[]{0}[0][0]; //Invalid Statement //This means the initial value of 'new int[]' is {0} //The [0] is to access the first element of {0} which is 0 //The 0 is …

Member Avatar for rahul.ch
0
161
Member Avatar for nobuts

You could use document.getElementById() as fpsasm said; however, I would not use *eval* function. It is not a really good way to learn a language with eval; besides, it is more of hard-coding, not easy to maintain, and no error checking. From your HTML, you may do your JS as …

Member Avatar for Taywin
0
2K
Member Avatar for jckb188

You didn't give much information at all... The function you gave is simply switching a supposedly an image from one source to another. If you want to generate a new div, where are you going to attach/append the newly element to? You can generate but you need to tie it …

Member Avatar for Taywin
0
503
Member Avatar for xjshiya

Your current design doesn't allow what you want to do (add multiple itenerary) because the JQuery script is being tied (hard-coded) to a specific HTML element (select tag with ID "it"). I am not an expert in JQuery because I don't use it. I can understand the code from reading …

Member Avatar for xjshiya
0
1K
Member Avatar for jackfusion

Hmm... To keep running a script behind (using observefield of ajax) is OK but I would rather run a script when an event is fired. What I would do instead is to add onchange() or onfocus() event to all of the input fields and whatever in each function may be …

Member Avatar for jackfusion
0
83
Member Avatar for Webintraining

>window.onerror=processErrors(); I don't think it is correct because the function takes 3 arguments but the assignment takes none. It could be `window.onerror = function(...) { ... }` but the homework said to create a function called processErrors. To explain what you need to do, I will break everything down into …

Member Avatar for Webintraining
0
243
Member Avatar for Vish0203

1)Did you forget to initilise *tmp*? Where does it start from? 2)You need to check whether or not your linked list is empty. If it is empty, what would you do? 3)If it is not empty, is the given index within the range? If it is out of range, what …

Member Avatar for Vish0203
0
141
Member Avatar for Viped

So you are asking for an algorithm to detect it? Hmm... On the top of my head, the way I would do is to find whether there is an intersection between those 4 line segments of the rectangle and the ellipse. If there is an intersection (or even touch), it …

Member Avatar for Taywin
0
912
Member Avatar for Cragsterboy

An example/tutorial of generic programming is [here](http://www.tutorialspoint.com/java/java_generics.htm). From there, you should be able to implement a non-generic programming.

Member Avatar for Taywin
0
204
Member Avatar for jellej

Well, lines 21~24 will increment the tab number for you before it changes the value. Why do you need to increment the id value (id2)?

Member Avatar for Taywin
0
264
Member Avatar for Krokcy
Member Avatar for Krokcy
0
287
Member Avatar for gAb1

> id="mac-wow-full-EU-es_ES-320" Looking at the id above, you would get ["mac", "wow", "full", "EU", "es_ES", "320"] as a result from splitting the ID string. Now go back to your code... var rel = target.split('-'), region = rel[3], game = rel[1], client = rel[2], lang = rel[4], ver = rel[1], //not …

Member Avatar for Taywin
0
462
Member Avatar for wiliams.kikert

To generate a random fully filled sudoku table is easy, but the challenge is to eliminate certain numbers until it becomes a puzzle. In other words, you need to have an algorithm to solve a sudoku puzzle before you can randomly generate a new one. If you have no good …

Member Avatar for Taywin
0
314
Member Avatar for lbgladson

1)What ArrayList data type are you creating in order to keep BankAccount data? Currently, you are using String which is incorrect. You need another class that can hold BankAccount data. 2)You have a loop up to *n* tims to collect bank account data. Once you have all information (name, number, …

Member Avatar for NormR1
0
2K
Member Avatar for zoreli

What you did only to prevent if there is an error message. If there is no error message (length==0), what would you do next? Redirect or display something else? In other words, what are statements for *else* condition?

Member Avatar for zoreli
0
322
Member Avatar for ezekel

From glancing, why does Infix has size of 1 but you attempt to use a for loop on it? That doesn't make sense...

Member Avatar for ezekel
0
590
Member Avatar for thedancingbug

Not sure what you mean... How about this... var monthName = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; Would that be simplier?

Member Avatar for thedancingbug
0
188
Member Avatar for MisterMustard

Just for a quick look, you have mismatch call for function. The DNFUNCTION is returning 8 values at once, but you attempt to put them all in 2 variables when you call. > function [x1,y1,x2,y2,x3,y3,x4,y4]=DNFUNCTION(a,b,d,t); > ... > [x1, y1]=DNFUNCTION(a,b,d,t); Try to add variables to accept all return values. PS: …

Member Avatar for Taywin
0
145
Member Avatar for complete

I don't know C# but I looked it up on the Internet to see how split() works. Anyway, I think you should use Regex class instead to do the split. The reason is that it might not read in the way you want. Though, I am not sure whether all …

Member Avatar for Taywin
0
165
Member Avatar for Ashenvale

If you are storing number up to the total you need (i.e. need to store 42 numbers which is from 1 to 42), how about creating an array of size 42 and stores number 1 to 42 in order. Then, randomly swap 2 number each time up to *m* times. …

Member Avatar for Bladtman242
0
155
Member Avatar for jemz

You can look at this [link](http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html) or this [link](http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/otherFeatures/nimbus_laf.html) for how to enable Nimbus look and feel...

Member Avatar for jemz
0
749
Member Avatar for Ashenvale

NormR1, I don't think the data type is necessary because it will be an empty file. However, I believe that it would be a simple ASCII storage. The file name should be *data.dat* and the way to create an empty file is depended on what OS you have. On Linux, …

Member Avatar for Taywin
0
116
Member Avatar for turt2live

Also, when you say distribute data, how do you handle duplicated item in these lists? Do you want to clone the list items? For example, an array of {1,2,3} is the smaller list and {1,4,7,8,9} is the larger one. What would be the result?

Member Avatar for JamesCherrill
0
182

The End.