637 Topics
| |
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 … | |
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 … | |
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 … | |
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> … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
!! 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 … | |
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 … | |
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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.