- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
An extremely introverted individual (at least in "real life") who loves learning about the world around him.
- Interests
- Reading, programming, cooking, archery (beginner).
- PC Specs
- Ubuntu Linux Arch Linux Windows XP
This is a simple, but complete (pseudo) random password generator. Examples of usage: [code] $ ruby pgen.rb soovmuvytv $ ruby pgen.rb --length=20 bynnugipyeeghdbihcdn $ ruby pgen.rb --length=20 -n v3ji3awj1trzjlda5oax $ ruby pgen.rb --length=20 -np :sa6vafpummpttjp?qo: [/code] For complete usage guidelines, run [inlinecode]$ ruby pgen.rb --help[/inlinecode] This (hopefully) serves as both … | |
Re: [QUOTE=Ancient Dragon;493972] >>this removal would only make sense if you already had a provably superior replacement. There already is a superior replacemenmt -- its the functions in stdio.h. There are a few (very few) things I like about iostreams but for the most part fprintf() is a lot easier to … | |
Re: In your definition for [I]squareEach[/I], you are saying that it takes a list of numbers as a parameter. When you call the function, you are not giving it any parameters. The correct definition in this case would be: [code=python] def squareEach(num): print [i * i for i in nums] # … | |
Re: I can't say that this is "correct', but this is the way I'd approach the problem. :) [code=ruby] #!/usr/bin/ruby def yes_no(question) print question if gets.chomp =~ /^[yY]/ return true else return false end end delete_list = [] Dir.new(".").each do |file| if file =~ /\w+\~/ delete_list << file end end puts … | |
Re: Hash tables (called unordered_map) are part of tr1, which is mostly being implemented for the next version of C++. GCC has implemented most of tr1 and it happens to include an implementation of unordered_map. Here's an example mapping names (as std::string) to ages (as int). I am not an expert, … | |
Re: I don't exactly understand the question, but have you considered using something like boost::tokenizer? [url]http://boost.org/libs/tokenizer/index.html[/url] | |
*Hopefull this hasn't been done already* Write a program that when run, will print out the numbers 1 through 10. The program can be in any language, and can be as complicated or simple as you want. Lets see how creative people are, and get up to 500 unique ways! … | |
Re: A [I][inlinecode]for()[/inlinecode][/I] loop is best used when you know (either based on a variable's value, or a set number) how many times a loop should run. For example, if I wanted to have a message printed exactly 5 times, I would do this: [code] for(int x = 0; x < … | |
| Re: I know this works, but I don't know if it is a best practise. [code] #include <iostream> #include <string> void changeFirstLetter(char *str) { *str = 'J'; } int main() { std::string msg = "Hello, world!"; std::cout << msg << std::endl; changeFirstLetter(const_cast<char *>(msg.c_str())); std::cout << msg << std::endl; } [/code] OUTPUT: … |
Hello all. I was just browing some websites and thought I'd join. I program as a hobby (Some C, intermediate C++, and I'm improving my Python and Ruby), and I'm sure I'll be asking more questions then I will be answering. :D This website looks great (very "Web 2.0"-ish), and … |