637 Topics

Member Avatar for
Member Avatar for pepyrs

Hey guys, I have a few Lists of strings containing elements saved from a Gridview on the page. (2 different gridviews with datasource from same database and table but showing different information) I need to write a logic which is ~10 if statements checking some conditions and then write a …

Member Avatar for sankit
0
309
Member Avatar for tingwong

Hi everyone I am having trouble finding the nth node of a binary search tree in an inorder traversal. I am getting NullPointerExceptions for any numbers other than 2 and 3 and even those print out the wrong values. If anyone could help it would be greatly appreciated. The method …

0
132
Member Avatar for deadsolo

Hi everyone! I am having troubles making the second IF statment execute in my code: Pattern dl_noise_rates_p = Pattern.compile("\\d+\\s(.+)\\s(.+)\\s(.+)\\s(.+)"); Matcher dl_noise_rates_m = dl_noise_rates_p.matcher(lineString2); if(dl_noise_rates_m.find()){ String s_dl_nr1 = (dl_noise_rates_m.group(1)); //checking for non numbers pulled in the regex if(s_dl_nr1 == "NaN"){ //| s_dl_nr1 == "NaN" | s_dl_nr1 == " NaN" System.out.println ("OMGOMGOMGOMGOMGOMGOMGOMGOMG …

Member Avatar for bguild
0
183
Member Avatar for dreday92

I am having a few compiling errors due to the syntax confusion on some the functions, Im confused to what im doing wrong, I know its a simple solution I've just been looking at this for hours and cant figure it out. //Header File #ifndef BST_H #define BST_H #include <iostream> …

Member Avatar for rubberman
0
265
Member Avatar for Xorlium

Hello! I'm writing some mathematical iterators over some big classes that I don't want to store in memory at all, but I still want to be able to iterate through them. As an example (but I have a few of these), think of a class `Combinations({0,1,2...7}, 3)`, which means I …

Member Avatar for Xorlium
1
323
Member Avatar for Vijaysurya

hai everybody, i need help in multiple true if condition IF (condition 1 is true) { $('.cCal').css('border-color','red'); return false; } and (condition 2 is true) { $('.cCal2').css('border-color','red'); return false; } (condition 3 is true) { $('.cCal3').css('border-color','red'); return false; } this syntax working only one condition is true. more than one …

Member Avatar for Troy III
-1
155
Member Avatar for Dum_Bass

I am trying to create a simple scoring function using sprite collision. I have my sprite ids defined under a seperate header and my class is in order. LEFT_SCORE is animated using a sprite sheet (obviously). int Ball::leftGoal( ) { int leftScore = 1; if (dbSpriteCollision (BALL, 12)) {++leftScore;} dbSetSpriteFrame …

Member Avatar for Dum_Bass
0
164
Member Avatar for tiffany.leroux.7

I am doing huffman coding and I have made the tree. Now I am required to traverse the tree to create bit strings associated with the characters. Then I will put the bit string and char into a map to use with encode/decode. I have been working on this for …

Member Avatar for owenransen
0
456
Member Avatar for next_tech

Hi Guys, I am working on a binary search tree and I've been stuck on some code for the last couple of days. There are 2 issues that I can't seem to figure out how to fix. 1) I have a file that has a list of names and ID's …

Member Avatar for bguild
0
409
Member Avatar for HankReardon

Hello, What is the best way to count the number of swaps required to sort an array that is sorted using the Quicksort algorithm? I put a counter in what I believe is in the correct position and the tests that I have run seem to be correct however Quicksort …

Member Avatar for JamesCherrill
0
4K
Member Avatar for masterfact18

!! i was trying to create a simple grading system but my project doesnt work it always shows the last if statement and ignore the other statement...please help here's my code...can someone please tell me what's wrong coz i dont know how to use if/elseif/else statement... newbie here...please help Private …

Member Avatar for tinstaafl
0
285
Member Avatar for while(!success)

Hi guys, I'm hoping you can help me find a more elegant solution to my query inside a foreach loop. Here is the loop in question: foreach (DataRow row in dt_blah.Rows) { SqlCommand sc = con.CreateCommand(); sc.CommandType = CommandType.Text; sc.CommandText = "select blah blah blah .. where S = @s1 …

Member Avatar for AleMonteiro
0
1K
Member Avatar for l.worboyz

basically i am working on a project for uni, which is to create a form of an abacus model. - peg_array[] stores the number of counters/beads present in each of the pegs(lines) of the abacus. i am trying to use 2 boolean methods: "boolean removeCounter(int thisPeg)" "boolean removeCounter(int thisPeg)" thisPeg …

Member Avatar for valdez25
0
305
Member Avatar for ray.tan.507

I was doing some exercise from C++ Primer and one of them required us to copy a set of value from array into a vector container. Then, we are suppose to remove all the even numbers from the vector container. Hoever, when I tried to display them out by incrementing …

Member Avatar for Nick Evan
0
202
Member Avatar for ckjaseem

Hi all , I have a set-interval function inside a for loop and when inside the set-interval function if it meets a criteria give an alert and clear the interval. Below is my code but its not working can anyone tell what the mistake here. var timeCheck = 0; function …

Member Avatar for LastMitch
0
486
Member Avatar for minimee120

Hello all, I'm fairly new to using PHP, and for my assignment I've coded it all but I'm trying to go the extra step, and code something that if the item amount = 0 it doesn't print it out on the order form The items are $LAPTOP $MONITOR $KEYBOARD $PRINTER …

Member Avatar for diafol
0
201
Member Avatar for cdsr

Alright so I've been struggling to find the error but I simply can't. Given the following code: #include <iostream> #include <vector> enum ScriptType { SCRIPT_TYPE_CREATURE_SCRIPT, SCRIPT_TYPE_PLAYER_SCRIPT }; class Script { private: ScriptType type; public: Script(ScriptType type) : type(type) { } ScriptType getScriptType() const { return type; } }; class CreatureScript …

Member Avatar for cdsr
0
294
Member Avatar for CreatorZeus

My while keeps looping and i dont know why: code <?php $result = mysql_query("SELECT * FROM tag WHERE point='$pagename'"); while($row = mysql_fetch_array($result)) { $result = mysql_query("SELECT * FROM tag WHERE point='$pagename'"); //username echo $row["user"] . " ||"; //alias check $result = mysql_query("SELECT * FROM tag WHERE (user='$my_name' && point='$pagename')"); if …

Member Avatar for IIM
0
188
Member Avatar for Helianthus

Ok, so I am working on the hangman game for a school assignment. I have everything doing what I want except for one issue: No matter how many letters are in my word, the number of dashes is always one more than I need. For example: say the word is …

Member Avatar for Helianthus
0
860
Member Avatar for clubberlangMayo

hi everybody, im doing a project in vb 2010 its a simple "guess the number between 1 and 30" i have it all finished working properly , my only remaining issue is, if i enter a character or letter into the combobox, it crashes the system. i got a piece …

Member Avatar for clubberlangMayo
0
277
Member Avatar for adishardis

Hi, I'm transferring data from one table to another and one of the fields is an email field. I would like to check if the emailfield is empty or otherwise faulty and skip that record if it is. This is how it looks at the moment but it's problamatic since …

Member Avatar for adishardis
0
473
Member Avatar for adishardis

Hi, I use this script to extract and insert the desired variables to mysql.It does the job. $xml = new SimpleXMLElement('file.xml'); foreach($xml->loanaccount as $mess){ $account_number= mysql_real_escape_string($mess->account_number); $main= mysql_real_escape_string($mess->main); $type= mysql_real_escape_string($mess->{'application-array'}->{'application-type'}), $date= mysql_real_escape_string($mess->{'application-array'}->{'application-date'}), //insert into databse mysql_query("INSERT INTO account (account_number, main) VALUES ('$account_number', '$main')") or die(mysql_error()); echo "inserted into mysql<br /><br …

Member Avatar for adishardis
0
216
Member Avatar for Duki

Hey guys, I'm trying to understand how radix sort works in C++ : I've looked over the C++ implementation from wikipedia: void radixsort(int *a, int n) { int i, b[MAX], m = a[0], exp = 1; for (i = 0; i < n; i++) { if (a[i] > m) m …

Member Avatar for deceptikon
0
313
Member Avatar for FearlessHornet

I'm currently making a DLL with a collection of code snippets that I find myself commonly using. I have made a search functin that checks if one string is inside of another string. I have also added a vector choice in the case that I want to search many strings. …

Member Avatar for mrnutty
0
226
Member Avatar for Hey90

I have created a basic object oriented database of a list of shoes containing the shoe name, number and shoe size. I am trying to sort the list of shoes alphabetially by name and by shoe size. I have the following code: Shoes.h: #include <iostream> #include <fstream> #include <string> #ifndef …

Member Avatar for Hey90
0
4K
Member Avatar for inuasha

alright so my exact problem is that when I attempt to visit a url stored in a text file I get the error "URLError: <urlopen error no host given>" This is strange because if I type in the urls myself they work fine(opener.open("site.com")) The lines of code causing the error …

Member Avatar for snippsat
0
275
Member Avatar for rfrapp

I'm writing maze traversal for a school assignment, and I've got an issue. The X will move through most of the maze, but then it will get stuck at a position and keep cycling through. This is probably because I'm not checking properly to see if it hasn't been to …

Member Avatar for rfrapp
0
910
Member Avatar for eric.i.perez

1.Make and run a program that will output all the prime numbers from 1-100. (FN do prime) 2.make and run a program that will allow the user to input 10 numbers and display the total number of positive and negative numbers entered. 3. write a program that reads numbers until …

Member Avatar for NathanOliver
0
140
Member Avatar for gtkesh

Hello everybody. Here is my remove method for bst. As you all know, there are 3 cases to consider while removing a node from bst. For the last case, when a node (which is to be removed) has 2 children, I want to use predecessor instead of successor to change …

0
121
Member Avatar for richprich

Although there are many similar questions and answers here and i've tried my best to make it work but no luck. This is my code: $content = "Blah...blah...[image=1], blah...blah...blah...[image=2], blah...blah...blah...[image=1], no more..."; function get_image($content) { $stripper = $content; preg_match_all("/\[image=(.+?)\]/smi",$stripper, $search); $total = count($search[0]); for($i=0; $i < $total; $i++) { $image_id …

Member Avatar for richprich
0
601

The End.