1,684 Posted Topics
Re: just store the data in an organized fashion in the first place. | |
Re: [QUOTE=Shon05]Is anyone familiar with lisp programming? If so can you please respond back. I have a program due and it deals with lisp type checking! I would really appreciate it. ;)[/QUOTE] I am. | |
Re: You could say you have an irrational number, but what you really have is a pseudo-random sequence of bytes, that you're using to xor to the bytes of your plaintext. This is called a synchronous stream cipher. And if you're capable of sending beforehand a one time pad that tells … | |
Re: Well, you'd have to have a pointer to the top of the map, so that'd be 7*4 for the pointers, but of course that depends on what you formally define the 'map' to be in terms of calculating memory usage. And there's also the fact that your memory manager will … | |
Re: [QUOTE=unclepauly;295336]heres a question: i understand that array insertion is carried out in constant time - O(1) - but if the array is 2D (n*n), then would this still hold true if i wanted to insert the same value into each array?[/quote] Now what do you mean, saying array insertion is … | |
Re: 1. Sam I am. 2. I do not like to eat green eggs and ham. 3. Reading that book was the first time I realized that names were not unique. 4. Reading [url]http://qntm.org/[/url] was the first time I realized that it is possible to find a person who has the … | |
Re: [QUOTE=WaltP;288533]It can't.[/QUOTE] It's proven that in any Turing-complete language you can create a program that writes its own code as output. | |
Re: That doesn't sound like research to me... arh, how about you write a compiler? Make a compiler for the Scheme programming language. Write the compiler in Scheme, too. Think about what optimizations you can make. Especially when it comes to dealing with call-with-current-continuation. Oh, and have the target language be … | |
Re: My favorite number is the smallest uninteresting positive integer. | |
Re: Also, more portable, since you're not making assumptions about character set. | |
Re: What happens when you compute fact(13)? The number is too large to be represented by a long (which has range up to 2^31-1, approximately 4 billion). That messes up the computations at that point. | |
Re: Output the characters in a loop. Keep track of the previous character you've output. If it was a space, then if the current character is a space, don't output it. | |
Re: That, of course, depends on what university you go to. Some schools offer bioinformatics majors. I don't think any have CS students deal with quantum computing as any big thing -- that field is just undeveloped so far. | |
Re: No, you can do it without a pointer (or by using a pointer that would be there already, like the stack pointer). When you call a function with the C calling convention, you push the last argument, the second-to-last argument, the third-to-last argument, ..., and finally the first argument onto … | |
Re: It depends what they are teaching in the discrete math class, because there's a few parts to the subject. You've got graph theory: that's good to have knowledge for, for some algorithms, or in designing data structures. You've got basic modular arithmetic: I find myself using my experience with modular … | |
Re: This is not a place where people do work for you. You need to explain why you are unable to do this yourself, and then people might be able to give you information that would make you able to do this yourself. | |
Re: There are so many better ways you could spend your effort 'helping' children than turning down the job. If you want to do the most amount of good in the world, the right way is to find the most efficient use of money you can (maybe the most efficient charity … | |
Re: I think they end up reporting these stories just because they love using the phrase 'bus plunge'. | |
Re: srinivasdama: Note that 1/4 + 1/16 + 1/64 + 1/256 + ... is equal to 1/3. You can multiply an integer by 1/4, 1/16, and other powers of 2 with the >> operator. | |
Re: You're using XML to preprocess [i]TeX[/i] files! TeX! There's already a way to preprocess TeX files; the TeX language itself! It has features for that! Why would you use this? Seriously. Also, you have several problems: First, you're using XML. That makes things harder. Second, what's with the 'print' element? … | |
Re: You 'read many books about c++'? Have you actually written anything in the language? You could try making a program that scans people's written words and makes fun of them for not being able to put sentences together. | |
Re: [url]http://eternallyconfuzzled.com/tuts/hashing.html[/url] | |
Re: [QUOTE=Mushy-pea;276655]Hello everyone. I recently came accross the concept of Turing completeness (in languages). I was wondering, is there a general method for determining if a language is Turing complete? Or is it one of those intuitive things where you just have to look at it for a while and go … | |
Re: Who cares? Both ways are perfectly fine. If you want your cars to be smart enough to understand direction strings, that works as well as having them be dumb. You've got to put the intelligence somewhere. | |
Re: It has to do with the C++ standard. The standard says, "use int", so that's what you should use. The reason you should use int is, void main is not necessarily accepted by every compiler. | |
Re: Why would you need help? Specifically, what don't you know how to do? More specifically, if somebody asked you to run a program manually, on paper, would you not know how to do it? You should know how to do that... If so, then you should be able to write … | |
Re: Look at the source code for some free, open source editors out there and see what they do. I'd imagine I'd make a mini-language for describing source code colorization and then use that to colorize source code. | |
Re: [QUOTE=server_crash]The best language for a beginner, in my opinion, is Java. I haven't seen a language yet that displays all the concepts of OO in such a friendly and understanding manner.[/QUOTE] I don't understand this OO-mindedness that people have. Learning CS isn't about learning how to think in an object-oriented … | |
Re: The best way to verify the correctness of your answers is to try a few example values for your parameters and see what happens. See if you can notice a pattern. For example, if I were given the code [inlinecode]for (i = 0; i < 2 * n; ++i) { … | |
Re: I do not know what you mean by 'scripting language,' so I'll take it to mean 'a language with garbage collection, rapid development, and general ease of use.' [QUOTE=~s.o.s~;246756]PERL, Python, LUA, PHP etc.[/QUOTE] Perl is a good language for short programs that need to chop text around, and it's a … | |
What's the coolest programming language? And why? Oh boy this should be fun :-> | |
Re: I'm sure it's perfectly fine to - use i and j without having declared them first, - use the mystical !! binary operator, - fill values of 1 into the triangle where values of 1 do not belong, - print the contents of your datastructure without putting spaces in between … | |
Re: Many operating systems' source code are freely available. They certainly are not written in HTML, though... | |
Re: [QUOTE=Mushy-pea;267519]C and C++ should be abandoned (or substancially modified) as the default languages used for the writing of native executables and operating systems.[/quote] The Linspire team has already abandoned C and C++ and use Haskell as their preferred language for core OS development. That doesn't mean the kernel shouldn't be … | |
Re: You can pass command line arguments by changing @ARGV. It is best to make a local copy. For example, inc.pl: [CODE]#!/usr/bin/perl use strict; # just for kicks for my $item (@ARGV) { print "$item\n"; # print what we think are our command line args! }[/CODE] tmp.pl: [CODE]#!/usr/bin/perl use strict; # … | |
Re: Look on your search engine of choice for 'stringstream'. | |
Re: [QUOTE=001]Thanks Comatose, It worked , but I still experience problems with the output when there are errors in the program. It justs spits out the output and its difficult to read. What do i do. 001[/QUOTE] You could show us what you mean by pasting the difficult to read output … | |
Re: What? Why are you having problems? I think it would be helpful if you told us what course you're taking, and what expectations they have of you. Is this an intro compsci class? It sounds like it's not. You said in the other thread that you're a masters student in … | |
Re: operator() lets your values look like functions. For example [code]struct greeter { std::string greeting_text; int operator()(const std::string& greetee) { std::cout << greeting_text << ", " << greetee << "!" << std::endl; return 12345; } }; // later: greeter alien_greet, programmer_greet; alien_greet.greeting_text = "Greetings"; programmer_greet.greeting_text = "Hello"; int x; x = … | |
Re: Heck, it's even legal to download material protected by copyright law... if you have the author's permission. For example, I just downloaded J_Search's post. | |
Re: I don't see why a math person would have any problem with that reasoning. | |
Re: I like how they get their terminology wrong, misusing the word, 'set'. | |
Re: You can use % 10 to find the units digit of a number. For example, n % 10 gives the units digit of n. You can then use / 10 to divide an integer by ten. For example, n / 10 divides n by ten. So, 1697 % 10 simplifies … | |
Re: Haven't you read the homework policy? Do your own homework. | |
Re: What is preventing you from doing this yourself? |
The End.