679 Posted Topics
Re: [QUOTE=samsons17;1100465]why in this code the "codeArray[]" is used?? what does its really means?? [CODE]void FunctionTwo (int codeArray[]){ cout<<codeArray[1]; }[/CODE][/QUOTE] When you declare a function parameter as an array, what really happens is that a [I]pointer[/I] to the first element of the array is passed, not the entire array. It's basically … | |
Re: [QUOTE=mostafanageeb;1041754]I am now making the huffman algorithm. I have generated the tree but I cannot generate the codes.. please if anyone can help tell me how?[/QUOTE] See [URL="http://rosettacode.org/wiki/Huffman_codes"]this article[/URL] for a quick explanation and some examples. From the article: [QUOTE]Traverse the constructed binary tree from root to leaves assigning and … | |
Re: [QUOTE=TheManual;1096061]I have written a working calculator program but it will not work out negative inputs. For example, 3+2 = 5.0, but, -2+5 = Wrong type of expression (error message). The user inputs the calculation which is called "expression". I have two stacks, one for operators and one for operands and … | |
Re: A port is just an extra number tacked onto your IP address. Basically, they exist so multiple applications can use the same IP address simultaneously when they use different ports. I recommend [URL="http://beej.us/guide/bgnet/"]Beej's Guide to Network Programming[/URL] for increased understanding. The [URL="http://beej.us/guide/bgnet/output/html/multipage/ipstructsdata.html#portnums"]section on port numbers[/URL] has a bit more explanation. | |
Re: Further reading: [url=http://en.wikipedia.org/wiki/Dissociated_press]Dissociated press[/url] [url=http://en.wikipedia.org/wiki/Markov_chain]Markov chain[/url] | |
Re: [QUOTE=skyyforever;1090240]I'm trying to implement windows form with data grid (or anything you say is better) which should represent a hierarchical data. This data are stored in a xml file which structure is as follows: I would be very grateful if someone could tell me what is the best way to … | |
Re: [QUOTE=moroshko;1093229]I see that myCircle2 lying at the edge of myCircle. How can I define the stroke style of myCircle such that myCircle2 will lie in the middle of myCircle ?[/QUOTE] I'm not aware of any way to change the stroke to make it display the way I think you want … | |
Re: [QUOTE=JayOne;1090837]If I develop an app, and sell it on, would the end user need anything installed?[/QUOTE] That depends on what kind of database you want to use... if it's a server-based database, like MySQL, and you don't want to host it yourself, then yes. I don't recommend actually requiring users … | |
Re: [QUOTE=Ancient Dragon;1058034]File compression/decompression is a pretty complex task.[/QUOTE] For that matter, so is [URL="http://en.wikipedia.org/wiki/Encryption"]encryption[/URL]. What you're doing barely qualifies; it's a [URL="http://en.wikipedia.org/wiki/Caesar_cipher"]Caesar cipher[/URL], which provides no real security. It's fine as a quick and easy substitute in a homework assignment, but you'd never use it in the "real" world. [QUOTE=kawal.singh;1057888] … | |
Re: Your original "if" statement mutated into a loop there... let's look at the "if" by itself first. A basic assembly "if" block might look like this: [CODE] cmp a, 80 jne notequal ; a == 80, do something here jmp done notequal: ; a != 80, do something else here … | |
Re: [QUOTE=RichardCrickets;1080846]I am trying to create a collection that will store boolean relationships between a list of numbers. Normally I would create a 2d array but these numbers will always be dynamically changing. Sometimes there will be more numbers and sometimes less. What collection type can I use to store an … | |
Re: [QUOTE=Bench;1080950]My first guess would be that seed could mean a number to pass to the [icode]srand[/icode] function, for random numbers.[/QUOTE] That's one of the more common uses of the term. In crytography, you'll see "[URL="http://en.wikipedia.org/wiki/Initialization_vector"]initialization vector[/URL]" more often. In general, I'd understand "seed" to mean "initial value(s)"--in this case, values … | |
Re: [QUOTE=lordofdarkness;1080098]i have a path from 1 to n and this is a straight line. every line has a value. i need a way where the cost is smallest. [/QUOTE] That's the [URL="http://en.wikipedia.org/wiki/Shortest_path_problem"]shortest path problem[/URL]; for any single source and/or destination, you'll probably want to use [URL="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm"]Dijkstra's algorithm[/URL]. | |
Re: [QUOTE=sathya8819;1057964]Hi, I am implementing a project where I have to use adaptive thresholding on an image. That is, the threshold value must not be global, but must adapt itself with the image. I have thought a lot, but am unable to get a logic. It would be really helpful if … | |
Re: [QUOTE=Blackeagle;1058454]how can i print the number in SI on the screen?[/QUOTE] You'll probably need to copy the value of SI to a variable first, but it all depends on what libraries you have (or don't) for printing numbers in the system for which you are developing. Could you post some … | |
Re: [QUOTE=StaticX;1072677]I am currently running on windows and have and issue when i try to read/write files,the problem being that it just doesn't happen.[/QUOTE] That doesn't give us very much to work with; it would help if you could clarify what "just doesn't happen" means. Is it truly not happening, as … | |
Re: [QUOTE=shopnobhumi;1065075]what would be the recursive implementation of the following c program: [CODE=C]int fact(int n) { if (n == 0) return (1); else return(n*fact(n – 1)); }[/CODE][/QUOTE] That [I]is[/I] recursive. You've defined [ICODE]fact[/ICODE]--a function that calls itself. Did you mean "what would be the [I]non[/I]-recursive implementation"? Also, this should probably be … | |
Re: [QUOTE=zachattack05;1074151][CODE=C#]string host = this.HostAddress.Text.Replace(@"\", @"\\");[/CODE] Immediate reports host as: "C:\\\\Program Files (x86)" When it should report it as: "C:\\Program Files (x86)" the original text was: "C:\Program Files (x86)" Any thoughts?[/QUOTE] Your call to [ICODE]Replace[/ICODE] is correct, as you can demonstrate by running the following tests (the third one is supposed … | |
Re: [QUOTE=abhipro;1071300]I have a Windows Application which contains functions for Encrypt/Decrypt which is working fine when both the functions are put together as a single code. Now, I wanted to call encrypt and decrypt functions independently of each other, thus, I split the code temporarily in say, function1() and function2() for … | |
Re: [QUOTE=smart.java6;1070869]Can mutation testing be successfully used in an industrial environment?[/QUOTE] In general, I think it could. In practice, I haven't heard about anyone using it recently. Also, by "industrial," do you mean any software development company, or did you have a specific type of business in mind? [QUOTE=smart.java6;1070873]Can anyone also … | |
Re: [QUOTE=ItecKid;1069362]This is the algorithm I am working on, however, I believe it is not working properly because it chooses points that are very close to each other to be centers: If anyone can offer any insight on this, I would greatly appreciate it. The algorithm seems to only be selecting … | |
Re: [QUOTE=adams161;1070354]whats going on?[/QUOTE] Read about [URL="http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems"]floating point accuracy[/URL]. [QUOTE=adams161]how to get rid of this fuzyness particularly in cases where i know i'm just adding .1.[/QUOTE] You might try sticking with integers and using [URL="http://en.wikipedia.org/wiki/Fixed-point_arithmetic"]fixed-point math[/URL]... with the example you posted, you could use a scaling factor of 100: [ICODE]y[/ICODE] would … | |
Re: [QUOTE=mahela007;1061733]I'm having trouble understanding the concept of an API. Could someone please explain what exactly and API does? A simple code example (if that's possible with this subject) would be really useful and much appreciated.[/QUOTE] API == [URL="http://en.wikipedia.org/wiki/Application_programming_interface"]Application Programming Interface[/URL]. [U]Application[/U]: You have an existing piece of software you'd like … | |
Re: [QUOTE=Dex02;1065095]I now the problem is in cout and in x. Can anyone help![/QUOTE] You're not using [ICODE]cout[/ICODE] properly in the loop. It looks like you want [ICODE]cout << x[/ICODE]. [URL="http://cplus.about.com/od/learning1/ss/clessontwo_4.htm"]Here are some examples[/URL]. Also, the [ICODE]for[/ICODE] loop isn't right. [URL="http://cplus.about.com/od/learningc/ss/clessonfive_2.htm"]Here's a description of how they work[/URL]. What you want is: … | |
Re: [QUOTE=murid;1057969]I wonder, what is picture/ image especially JPEG n GIF format ?? Is it lines of bit, byte, or binary ??[/QUOTE] They are represented as sequences of bytes, which themselves are composed of bits, all of which is binary... I'm not sure what exactly you're asking there. Graphics file formats … | |
Re: Looks like your problem is that the [ICODE]for[/ICODE] loop is incrementing [ICODE]n[/ICODE], but you're also incrementing it at the end of the loop: [CODE=C]for (n = 0; n < 49; n++) { putchar(bstr[n]); ++n; }[/CODE] That'll print every other character in the string, which is what you appear to be … | |
Re: [QUOTE=xcrypted;1045728]When the user clicks submit I want the textbox information entered and any selections made in the ddl's to be emailed to the siteadmin(for example: [email]siteadmin@admin.com[/email]). I cannot find anything on the web about how to code that submit button to do something like this and the jargon in the … | |
Re: [QUOTE=puneet21;1053305] [CODE=xml]<Root><Subject>xyz</Subject></Root> <Root><Subjects><Subject>xyz</Subject></Subjects></Root> <Root><Hierarchy><Subjects><Subject>xyz</Subject></Subjects></Hierarchy></Root>[/CODE] Adding minOccurs="0" to Hierarchy/Subjects element does not suffice the requirement since then it doesnot expect Subject element.[/QUOTE] That's because [ICODE]minOccurs[/ICODE] only indicates how many times that element may appear; it doesn't relax any restrictions on the structure of conforming XML documents. If you want the root … | |
Re: [QUOTE=Fong~;1035262]Can anyone tell me what the assembly type for bottom assembly program? #DEFINE PAGE0 BCF $03,5 #DEFINE PAGE1 BSF $03,5 INDF: .EQU $00 ;page 0, 1, 2, 3 TMR0: .EQU $01 ;page 0, 2 OPTION: .EQU $01 ;page 1, 3 PCL: .EQU $02 ;page 0, 1, 2, 3 STATUS: .EQU … | |
Re: [QUOTE=algo_man;1041820] I solve the request properties as Boolean fields. The question is How can I decide which available fax machine can handle my request?[/QUOTE] One way you might approach this problem is to start with a list of fax machines and go through it, removing machines that don't support the … | |
Re: [QUOTE=tintin.iitk;1041596]Returning to the original problem, even Java suffers from this risk of falling into infinite loops dues to recursive function calls.[/QUOTE] [QUOTE=jbennet;1041582]C is designed with the assumption that if the the programmer does something, however strange it seems, it is because he means to do it.[/QUOTE] C is notorious for … | |
Re: [QUOTE=ovidiu82;1041317]Where are my sins?[/QUOTE] As a general recommendation, you should read some technical documentation on the x86 instructions... [URL="http://home.comcast.net/~fbui/intel.html"]this page[/URL] is a good start, but the [URL="http://www.intel.com/products/processor/manuals/"]Intel processor manuals[/URL] are the real deal. As for your specific questions: [CODE]mul 5 ; ERROR Argument needs type override & Illegal immediate[/CODE] operands … | |
Re: [QUOTE=rigidboss;1040753]I wanna create a new Prog language . I give input as a abstract sentence. Eg Input : Let A be 10 , B be 10 . C be Sum of A & B. SO the output to the compiler must be int a=10, b=20 , c; c = a+b; … | |
Re: [QUOTE=lukeser;1039204]Whenever I create a new database from a C# program and create tables for that database, the tables always show up under the creator's default database instead of being listed under the newly created database.[/QUOTE] Hi again! If you're using the same connection string that created the database to send … | |
Re: [QUOTE=lukeser;1035928]My code structure to create a new Access database is in this order: 1. Create the database 2. Open the database 3. Create a database table Is this the same order that I should apply for creating a mySQL database?[/QUOTE] It's not quite the same; Access is a file-based database … | |
Re: More food for thought... this probably goes beyond your current question, but I think it helps to demonstrate the modelling process: The unmentioned "Class" object could be the true parent here... a Class would have (among other things) a Teacher who teaches the class, and a Classroom where the class … | |
Re: [QUOTE=kadamora;1034333]hi...i'm making a game that uses the direction arrows and fires with space...the problem is that when i keep holding 2 keys it makes only the behavior of one....can any1 tell me what i shall do[/QUOTE] Could you post the code you're using to track key up/down status? That would … | |
Re: Simple, yes... but not something I'd allow into production code. See [url=http://odetocode.com/Blogs/scott/archive/2004/08/20/401.aspx]these[/url] [url=http://stackoverflow.com/questions/819773/run-single-instance-of-an-application-using-mutex]links[/url] for some discussion. Here's an alternative... first, a method to try to create a mutex unique to the application: [code=csharp] private Mutex GetSingleInstanceMutex() { bool createdNewMutex; Mutex mutex = new Mutex(false, @"Global\" + SomethingUnique, out createdNewMutex); if … | |
Re: [QUOTE=Goalatio;1031259]...I found that a word (dw) will only hold the last thing passed to it. You can type "abcdefg", but the word will only hold the value "g"...[/QUOTE] Right. [icode]store[/icode] will always refer to the same memory location, so every time you write to it, whatever value was there is … | |
Re: [QUOTE=nunos;1034246]I am looking for a DFA that accepts the language that consist of an even number of 0's and an even number of 1's. Any ideas?[/QUOTE] Since you can't track a count of zeros and ones in a DFA, try looking at having a state for each possible outcome as … | |
Re: [QUOTE=Wtyy;1034299]I am writing a number guessing game, but it request to give hints to player when he guess wrong. And I need to narrow the range to be the hints, what should I write to do this function?[/QUOTE] The simplest hint that actually narrows the range is to tell the … | |
Re: [QUOTE=Gage84;1027682]Does anyone know what is ment by fabricated products & softwares?[/QUOTE] The phrase "fabricated software" doesn't ring any bells for me, but it might refer to [url=http://en.wikipedia.org/wiki/Component-based_software_engineering]component-based software engineering[/url]. It's a place to start, anyway... I'd clarify with your teacher exactly what was intended. | |
Re: [QUOTE=ching]can anyone give me a example of a radix sort[/QUOTE] Here's an explanation to complement Abu's code example: A radix sort works with the digits of a number, working from the least significant digit to the most. Here's a sample set of numbers: [indent]423 586 403 171 92 536 234 … | |
Re: [QUOTE=blackbetty76;1024966]Do I need to complete a program in order to know my test results?[/QUOTE] No; you're creating a set of simple [url=http://en.wikipedia.org/wiki/Test_data]test data[/url] for the conversion program. A program that generates test data would essentially be the same as the conversion program, which defeats the purpose of generating test data. … | |
Re: You might try [URL="http://www.libsdl.org/projects/SDL_net/"]SDL_net[/URL]. It is free and cross-platform, and should cover both of your requirements: [LIST] [*]Server detection using UDP to broadcast to the local network (though which side does the broadcasting is a different conversation) [*]Communication between server and client using TCP (if you care about sequencing and … | |
Re: You can't link directly to a COM library; you have to link to a .NET interop library. The VS IDE secretly generates this library for you when you add a COM project reference. Since you're using the command line, you'll have to generate it yourself. Use [URL="http://msdn.microsoft.com/en-us/library/tt0cf3sx(VS.80).aspx"]tlbimp.exe[/URL]; it comes with … | |
Re: If "Poisson RNG" means "pseudorandom number generator that generates Poisson-distributed numbers," you can [URL="http://en.wikipedia.org/wiki/Poisson_distribution#Generating_Poisson-distributed_random_variables"]generate your own from a uniform distribution[/URL]; there's no need to locate a special Poisson generator if you already have a uniform PRNG that meets your requirements. It sounds the real issue, though, is finding a generator … | |
Re: You can't update the database using `OleDbDataReader` or any other `DbDataReader` subclass. They provide forward-only, read-only access to data. You need something else. There's more than one way to do this. Here's one: * Create an [OleDbDataAdapter](http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter(VS.71).aspx) using your `SELECT` statement. * Create a [OleDbCommandBuilder](http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbcommandbuilder_methods.aspx) from your adapter. * Set … | |
Re: [QUOTE=DARKSTAR]sir actually i wana check that the barcode i have generated are valid or not... i dont have barcode reader and i just want a simulation of that.[/QUOTE] Simplest way to check actual barcodes without a reader is to find a barcode generation service--like the one Killer_Typo suggested--for the barcode … | |
Re: [url=http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsEnvironment.html]java.awt.GraphicsEnvironment[/url] has what you need: [font=courier]GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(<your_application_frame_here>);[/font] Setting an application full-screen can be extremely annoying; make sure you're doing it for the right reasons. |
The End.