- Upvotes Received
- 5
- Posts with Upvotes
- 4
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- Programming;Gaming
- PC Specs
- i7-2630QM-4GB DDR3-640GB-2GB ATI Radeon 6770HD
60 Posted Topics
Re: I tried designing the Tic-Tac-Toe game in C(command-line) and it took some 1100 lines of code.The AI was designed to allow the user a chance to start a game.If it is multi-player,then it can be designed very easily.Even two-player chess will be less sophisticated to design. | |
Re: Okay here is the deal.I want the user to enter only a positive value number of the data-type `unsigned long`.If he enters a string or some negative or decimal number,then he should be presented with an error message.The difficulty here is to overcome the **wrap-around** .This came into my mind … | |
I have created a Web-Gallery where photos are uploaded,can be tagged with one or more tags,and can be viewed by Users/Tags/Likes/Date of Upload/Title. I am to create a navigation like "Prev" and "Next". But what category should I choose to implement this and how ? What I thought of was … | |
What are some features that are essential in an online photo management system ? I have already implemented the following: ~Uploading a photo plus adding general info like a title and description ; ~Tags(Multiple) ; ~Approval/Discarding/Editing of uploaded photos by an Administrator ; ~Certain Admin tasks like adding/removing/editing tags ; … | |
Re: What I infer from this `var_dump` is that your main array consists of 10 elements,each of which is an associative array(again some of them are associative).So to say,output them,the following may help you(assume `$data` to be the main 10-element array: <?php $data = Array(.... /*Whatever you have given,here we assume … | |
Re: Getting value from a textarea in PHP is similar to getting value from a textbox.It's done like: <?php $skills=$_POST['skills']; ?> But assuming that you want to put it in an array,I assume that the string is a collection of skills separated by some delimiter,like a comma for which you can … | |
Re: `SELECT * FROM people WHERE skills LIKE '%cpppl%' OR skills LIKE '%javapl%' ` That should do it. | |
I wish to implement a tag system for a gallery,I have a huge number of images and all of them are to be associated with one or more tags. The number of tags is also large,but not exceeding say 500,isn't constant.Tag texts may also be large in certain cases. What … | |
Re: Well testing for primes can be a very bad job when you deal with a mathematical problem involving very big numbers.The test for prime for a number x should be carried up to less than equal to sqrt(x). //I came across a program to find the sum of all primes … | |
Suppose that I have a resumable link to a URI on the web.Is there any method I can setup a streaming script/service that simply redirects the data by downloading it from a source to destination(assume that the destination is the file requestor) ? Like what happens at http://unrestrict.li/home .They say … | |
I have a PHP script that generates a PNG captcha(set by Content-Type header).It can be embedded in an HTML page by just using `img`. I want to convert that image to base64 format for displaying.How do I go about doing that ? Using the normal method for encoding as given … ![]() | |
Note:It is possible that the title may not fit the content of the question. Out of <a> Participating in coding competitions and <b> Taking up some projects in specific (programming) languages what do you think makes a better programmer ? My Opinion:The second one,because programming contests like those on CodeChef … | |
Re: Web based apps are usually developed keeping in mind that the user is always connected to the internet.But that is not the case everywhere,is it ? Also,I personally don't trust the cloud to store data and with the recent revealations about PRISM and all,intellectual data isn't safe on web servers. | |
I have had a hard time setting up OpenGL to work with Visual Studio 2010,but no luck so far.I included `glut.h`,`gl.h`.I have linked the requisite `.lib` files in the Project Properties,but still I get this error `error LNK2019: unresolved external symbol _glutMainLoop referenced in function _main` ind six more like … | |
Re: import java.util.*; class DW001{ public static void main(String args[]){ String mon = "€ 10,00"; String exploder= "$€£"; //Add any other currency symbols,chars here.They have to be of the proper encoding StringTokenizer gen = new StringTokenizer(mon,exploder); System.out.println(gen.nextToken().trim()); } } And regarding the comma,it would be better if it were a decimal.Then … | |
Re: Of course,you can always call JS from PHP.Since the `POST` method points to the same page,use something like this $yourJS = '<script type="text/javascript"> window.onload = dothis(); function dothis(){ alert("I believe you have something to say to the world"); //Replace the above code with anything you want.Just make sure you escape … | |
Re: It is unclear what you wish to achieve by seeing the query you have posted. To simply select max from a column/attribute `SELECT max(sal) FROM EMP` //Displays maximum salary for the EMP table It may be noted that group functions can't be used after the `where` clause A second guess … | |
Re: That's because you have enclosed the `<script>` tags in the loop.So use it after the loop.If you want to show how many items were deleted,just use a variable to achieve it. | |
I hate to sound redundant,but can anyone point out step by step how to configure my localhost WAMP server installation to send e-mail.I do have a GMail a/c. It would be highly appreciated if anyone explained every step of the process.Tried to configure PEAR,PHPMailer,sendmail but with no luck. | |
Re: The function seems `foldersize_formatted()` seems to be working fine.Tried large numbers and it worked(always got the corresponding suffix).Just for debugging `echo` the `$total_size` variable before passing it to the function.As far as I know,PHP doesn't have a concept of overflow(not for numbers in the range we are dealing with here).The … | |
Re: I hate to post a link to a different page but the explanation there seems clear. [Click Here](http://stackoverflow.com/questions/338206/switch-statement-with-strings-in-java) Summarizing it,the if-else_if-else statements will perform better in general cases because of the hash computation of the string that takes place when using switch statement with a String.To view the fully explained … | |
I have this simple first multiprocessing code in pyton,but I encounter a BSOD when running it.Can anyone please point out what is wrong with it ? import multiprocessing def cracker(): print "Hello" return procs = [] for i in range(8): p = multiprocessing.Process(target = cracker) procs.append(p) p.start() for p in … | |
The above code computes the value of a mathematical expression supplied at command line by using the concept of converting infix to postfix,then evaluating the postfix expression. Any comments are appreciated. | |
I have a variable x which varies from -160 to 160 through steps of 10. `x = -160:10:160;` I have a matrix T1 which is of the form ` cos(x) 0 +sin(x) 0.00; sin(x) 0 -cos(x) 0.00; 0.0000 1 0.00000 0.67; 0.0000 0 0.00000 1.00 ` How can that be … | |
<?php $filename = $_FILES['file']['name']; $tempname = $_FILES['file']['tmp_name']; if(isset($filename)){ //echo $filename; $directory = 'E:/php_uploads/'; move_uploaded_file($tempname,$directory.$filename); echo 'Done'; } else{ echo 'No file selected'; } ?> <form method="POST" action= "fileupload.php" enctype = "multipart/form-data"> <input type="file" name="file"><br/><br/> <input type="submit" value="Submit"> </form> The enctype is correct.The element names correspond to those in the php … | |
http://mondaymorning.nitrkl.ac.in/ This is my institute's website.The problem here is while initial loaading,the content("Headlines") on the left overlap making it look ugly.But once loading is complete,the elements are able to position themseleves accurately.What I have done so far is inspected the elements relating to that area,but I can't understand what's actually … | |
Re: You mean to say the output updates with time when the program runs? | |
What is the component called in a GUI ? I am designing an application where I need to show certain usernames besides along with the points they have scored in a game.I don't want to do it in a table.I want to use the component shown in the picture below.But … | |
We had been assigned a problem in our Data Structures Laboratory that goes like this: Fill 4 queues with 10 numbers each(Ranging from 1 through 20).Each number need not be unique,i.e a number may be repeated in a queue.Remove an element from each queue.Say 1,3,11,6 are removed from queues 1,2,3 … | |
Re: There exist many such examples.But the best example is the Charamichael number 1105.It can be expressed as the sum of squares of two integers in 4 different ways or so. In general let the statement that the numbers be x,y and z which satisfy: x^2 + y^2 = z be … | |
Re: The `Runnable` **Interface** requires that the class which implements it must over-ride the `run()` method.And yes,you are declaring a function immediately inside a function which is illegal.Hence run would need to be declared outside main and in the same level as main,i.e. in the class. `t.join()` encsures that the daemon … | |
Re: Where are you storing the converted integers? Writing like: int bet=Convert.ToInt32(betTextbox.Text); int funds=Convert.ToInt32(fundsTextbox.Text); will help.The you can add them like integers and then assign the value with a concatenation with "" to the output field. | |
Re: Yes deceptikon is right and in addition to that,you need not check till the number itself,just check till the sqaure-root of the number and store it in an array and accordingly print them in sorted order. | |
Re: Pointer to pointer is not necessary here as I understand.The concept of pointer to pointer comes into use when you pass a multidimensional array into a function or pass a pointer by reference to a function where you wish to change its value.For excample you want to create a linked … | |
Re: You have to first create a class that `inherits` the Exception class because that is how a try-catch block is implemented.Throw an error if the input number is less than zero. Hope you have been taught exception handling. But if it weren't for an assignment,seriously,I do not get the point … | |
Re: In the scanner object,use a while loop with the condition `hasNextDouble()` method.By this the user can input any number of doubles at a single go. | |
Re: It is perfectly fine with respect to the code,but giving blank hrefs is usually done when the site is under construction.Take care of that when it is fully developed. ![]() | |
Re: Well,you need to define different functions that check for different patterns.If the patterns is very large,then it would be tedious to write the amount of code to verify any pattern.For exampl to check if a line numbered n from a vxv dimensional array contains a pattern defined like: n1,n2,n3 are … | |
Re: As said,the overhead for function calling is negligible.And of course,that can be avoided too by declaring small functions(Small here is relative) inline.That is likely to generate a lot of object code,but is said to be faster. | |
Re: Yes,looped linked-list is useful in the implementation of circular queue. | |
Which of the following code is likely to take less time to get executed? /*Format 0*/ main(){ int a=3,b=5; printf("%d",a*b); } /*Format 1*/ int mult(int a,int b){ return a*b; } main(){ printf("%d",mult(3,5)); } /*Format 2*/ inline int mult(int a,int b){ return a*b; } main(){ printf("%d",mult(3,5)); } As of now,I understand … | |
Re: You can use the `abs` function from the `math.h` header file to get the aboslute value of the generated random number and then operate as necessary. | |
![]() | Re: Unless you wish to use libraries to proceed/switch to C++ to use the BigInteger class,you would have to implement all arithmetic on character arrays and operate on them carefully.It will take a whole lot of coding and wastage of time since it is already implemented in Java/C++. |
Re: Strings can be considered as wrapper classes for character arrays(But they are not so in reality.).The first two lines of your code refer to the same String literal **Cat**.But declaring another String f like this: String f=new String("Cat"); will casue it ti point to another memory location in the heap.The … | |
Re: Well,doesn't seem like you can do this without an input stream.If you have been taught about `Scanner` class in the `java.util` package,then that should help you to accept input from the user.Maximum and Minimum finding functions are available in the `Arrays` Class in the java.util package.Refer to the Java's API … | |
Re: Completely mathematical problems at: [1] projecteuler.net [2] programmingpraxis.com [3] cstutoringcenter.com You most probably won't get questions related to GUI. | |
Re: Define a static `Class1` object and inside the constructor's declaration for `Class1` assign this to the `static` object.Then you can access the `Class1` object by simply calling `Class1.<static_obj_ref_name>.<method_name()>/<var_name>` | |
Re: Okay,if your classes Rectangle and Circle implement the interface Centered,then you must use the `implements` keyword while declaring classes Rectangle and Circle like: public class Rectangle implements Centered{ } Then you must provide definitions for the methods `getCenterX()` and `getCenterY()` in your class `Rectangle` and `Circle` else your classes will … | |
Re: A `JFileChooser`'s `showSaveDialog` method accepts a `Component` reference.This must refer to the parent `JFrame` over which the Dialog is created. |
The End.