Search found 324 matches

by zahlman
Wed Oct 29, 2008 2:24 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0495: "Secretary: Part 2"
Replies: 170
Views: 18542

Re: "Secretary: Part 2"

I think "nacient" works better than "nascent". It could be interpreted as either a typo for "nascent", or else as a typo for "ancient" . Which actually makes quite a bit of sense. In b4 /b/ was never good. I also think "nacient" is a pretty cool guy....
by zahlman
Mon Oct 27, 2008 12:28 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 0494: "Secretary: Part 1"
Replies: 104
Views: 15055

Re: "Secretary: Part 1"

"The blueprints for the Department of the Internet offices call for Ceiling Cat-themed sprinkler heads." Somehow I can't imagine that working too well. Ceiling Cat would just be watching you immolate. Anybody notice the hand movements on the guy? [flip off] [normal] [normal] [one clenched ...
by zahlman
Sat Oct 25, 2008 12:15 am UTC
Forum: Coding
Topic: Approaching Euler 28?
Replies: 6
Views: 1073

Re: Approaching Euler 28?

If you imagine the spiral as a series of rectangular shells surrounding the middle - so the first shell is the 1, the second shell contains numbers 2 through 9, the third shell contains 10 through 25 etc., then (a) each shell contains 4 numbers to sum; (b) the average of those 4 numbers is given by ...
by zahlman
Fri Oct 24, 2008 11:50 pm UTC
Forum: Coding
Topic: Low-level file manipulation in C++?
Replies: 27
Views: 1736

Re: Low-level file manipulation in C++?

Well, the second method I described isn't creating a smaller number, it's just piecing the characters/bytes together into one large number. As for the use of char*'s, I don't think you can accept command-line arguments as strings, can you? You can construct a string from a char*. I forgot about str...
by zahlman
Thu Oct 09, 2008 10:11 pm UTC
Forum: News & Articles
Topic: NDP campaign ads
Replies: 66
Views: 3306

Re: NDP campaign ads

Opinions can be informed by facts and information. Politics contains the tribal "my tribe" "your tribe" considerations, but people do occasionally reject their tribe, and not everyone votes on that basis. So talking about facts and information is actually useful, when you want t...
by zahlman
Thu Oct 09, 2008 10:09 pm UTC
Forum: News & Articles
Topic: Youtube implements "Audio Preview"
Replies: 46
Views: 8164

Re: Youtube implements "Audio Preview"

gzero wrote:It also has turned out that the way Youtube requests and provides the audio data is very simple:
http://www.youtube.com/preview_comment?q={whatever}&a=&s=&l=


I see what they did there.
by zahlman
Thu Oct 09, 2008 4:13 am UTC
Forum: Coding
Topic: Find the average of two numbers
Replies: 146
Views: 27993

Re: Find the average of two numbers

Entire thread is tl;dr. This should do the trick, making as few assumptions as possible. (Note that Java guarantees a lot of things that C++ won't.) It sure won't be fast, though. I've defined the average to round towards the floor, instead of towards zero, adding to the degree of difficulty. Of cou...
by zahlman
Thu Oct 09, 2008 3:40 am UTC
Forum: Coding
Topic: C++: identify derived class from instance of base class
Replies: 31
Views: 6130

Re: C++: identify derived class from instance of base class

The main one, of course, is your classes have to have a vtable. This is inaccurate in two ways. First, your classes never "have to have" a vtable, because the C++ spec doesn't say anything about how these features are implemented. And second, if your compiler does use 'vtables', then you ...
by zahlman
Thu Oct 09, 2008 3:30 am UTC
Forum: Coding
Topic: Help with a C++ Assignment
Replies: 12
Views: 1352

Re: Help with a C++ Assignment

Hica wrote:Yeah, my solution is below. Again, thanks for all of your help and ideas. Looping would have been a lot less typing.


Yes, you should do that. You should also make a helper function to do the "print to both streams and add a newline" task, since that also gets repeated a few times.
by zahlman
Thu Oct 09, 2008 3:27 am UTC
Forum: Coding
Topic: Low-level file manipulation in C++?
Replies: 27
Views: 1736

Re: Low-level file manipulation in C++?

I'm interested in writing a very simple encryption program, since I like cryptography and have [I think] enough theoretical knowledge of cryptography to try this out. So, ideally, I'm going to want to be dealing with files at the bit level. I do not know how to do this. The most file manipulation I...
by zahlman
Thu Oct 09, 2008 3:20 am UTC
Forum: Coding
Topic: Dumbass Encryptions
Replies: 6
Views: 1047

Re: Dumbass Encryptions

So, I wrote a Python program that encodes a given piece of text by ROT13'ing it, converting it to morse code, and replacing each dot with a random number under 4 and each dash with a random number above 4 (but below 8, saving 9 and 0 for delimeter use). It works perfectly, but I have to ask... Is t...
by zahlman
Thu Oct 09, 2008 3:14 am UTC
Forum: Coding
Topic: XKCD doesn't comment his code?
Replies: 48
Views: 5843

Re: XKCD doesn't comment his code?

Slightly off-topic rant: The XKCD intrade code pained me to read, mostly because, in order to fetch data from the internet and do *very simple* parsing, instead of using any of several built-in standard library Python for internet connectivity and built-in string split/replace functions, it uses a d...
by zahlman
Thu Oct 09, 2008 2:23 am UTC
Forum: Coding
Topic: Python exercises
Replies: 18
Views: 1803

Re: Python exercises

by zahlman
Tue Oct 07, 2008 11:43 pm UTC
Forum: News & Articles
Topic: NDP campaign ads
Replies: 66
Views: 3306

Re: NDP campaign ads

My riding is a safe Liberal one. I am SO NDP right now. Also, "NPD" is valid, also; that's the result when you translate into French and re-acronymize. Bilingualism GET! The NDP got their chance in Ontario because people momentarily got sick of the other two parties, and not so much becaus...
by zahlman
Tue Oct 07, 2008 11:15 pm UTC
Forum: News & Articles
Topic: Oprah pwned by /b/
Replies: 82
Views: 7178

Re: Oprah pwned by /b/

Babamthegrunt wrote:Meh, I'm a geezer I gurantee it.


Needs moar Zimmer! Also, all your base are belong to us!
by zahlman
Tue Oct 07, 2008 11:07 pm UTC
Forum: News & Articles
Topic: Palin's Speechwriters Phonetically Spell Nuclear
Replies: 113
Views: 7422

Re: Palin's Speechwriters Phonetically Spell Nuclear

Regarding all the terms starting with hetero-: Were y'all really arguing about whether it is acceptable to emphasize the perspective of the majority, in the context of a federal election?
by zahlman
Tue Oct 07, 2008 10:52 pm UTC
Forum: News & Articles
Topic: Sarah Palin supporter wants to kill Obama
Replies: 107
Views: 5146

Re: Sarah Palin supporter wants to kill Obama

All things said, I'm sometimes surprised that McCain and Bush haven't been shot yet, considering they've done considerably worse. Republicans seem to be resorting to little more than mudslinging lately. :? There have been attempts. [citation needed] . Sounds like an interesting story which I have m...
by zahlman
Tue Oct 07, 2008 10:34 pm UTC
Forum: News & Articles
Topic: Porn Star/Producer Convicted of Obscenity in (obv) FL
Replies: 49
Views: 4337

Re: Porn Star/Producer Convicted of Obscenity in (obv) FL

It's ridiculous that this guy is being charged, let alone convicted for *distribution*, yes; but aren't there several charges they could lay instead regarding his *production* methods? I've heard lots of not-nice things there. Also, how could the foreman of the jury say "After all, that's why w...
by zahlman
Tue Sep 30, 2008 4:37 am UTC
Forum: Coding
Topic: Optimizing a Javascript Timer
Replies: 6
Views: 1277

Re: Optimizing a Javascript Timer

I understand that writing to the DOM is a slow process, but in this application I feel that the displayed time needs to be accurate and not skip two every so often. Second, what do you mean when you say "the way you're doing it compounds the error?" And finally, I realize that the Javascr...
by zahlman
Tue Sep 30, 2008 4:29 am UTC
Forum: Coding
Topic: Text-Based Adventure Game Help
Replies: 8
Views: 964

Re: Text-Based Adventure Game Help

arrays, vectors, lists, etc. are kinds of containers. A vector behaves like an array, but it can automatically resize itself when you append elements to the end. However, you still can't reference elements that are beyond the end of the container. In general, we store elements directly in containers...
by zahlman
Tue Sep 30, 2008 4:10 am UTC
Forum: Coding
Topic: Overloading Methods
Replies: 9
Views: 1088

Re: Overloading Methods

Where do you people live!? My high school offers no programming classes, my community college only has "beginning programming in C", even then you have to take prereq's on using Vista/Word (challenge exams are on Vista terminology...). I'm... speechless. And sorry, PatchMonster. Where do ...
by zahlman
Tue Sep 30, 2008 4:07 am UTC
Forum: Coding
Topic: Optimizing a Javascript Timer
Replies: 6
Views: 1277

Re: Optimizing a Javascript Timer

One, it's never going to be perfect, timeouts have leeway. Plus there's the amount of time it takes to run the javascript, and the way you're doing it compounds the error. But on top of that, you're accessing and modifying the DOM. That's the slowest of them all. If you want it to be perfect, save ...
by zahlman
Wed Sep 24, 2008 10:03 pm UTC
Forum: Coding
Topic: Overloading Methods
Replies: 9
Views: 1088

Re: Overloading Methods

If you're going to use members of the class in a method, don't add anything to that method's parameter list for those members. You get access to those members automatically, simply because the method is a method of that class. Any parameters that you declare, with the same names, are separate values...
by zahlman
Wed Sep 24, 2008 9:57 pm UTC
Forum: Coding
Topic: Help with Pointers in C++
Replies: 9
Views: 1223

Re: Help with Pointers in C++

Wow, I seriously wrote delete where delete[] was needed. ::shame::
by zahlman
Fri Sep 19, 2008 12:32 pm UTC
Forum: Coding
Topic: Good beginner projects in C?
Replies: 34
Views: 3857

Re: Good beginner projects in C?

Whats a pointer? Id assume, through sheer common sense, %x is because it points to a variable? Not quite. A pointer is a variable that instead of holding a value (such as the number 153.45123 or the letter 'c') it holds the memory address of another variable. Nit (and something that, not being full...
by zahlman
Fri Sep 19, 2008 12:39 am UTC
Forum: Coding
Topic: Good beginner projects in C?
Replies: 34
Views: 3857

Re: Good beginner projects in C?

segmentation fault wrote:it wont work for std::string unless you use the objects c_str() method, just to clarify.


Of course, that's a horrible thing to do, and we're talking about C rather than C++ anyway.

@OP: What do you *mean by* "input a power"?
by zahlman
Thu Sep 18, 2008 2:05 am UTC
Forum: Language/Linguistics
Topic: Mnemonics you love
Replies: 187
Views: 76612

Re: Mnemonics you love

For remembering the order of sharps & flats in musical scales: Sharps: "Father Charles Goes Down And Ends Battle" (FCGDAEB) Flats: "Battle Ends And Down Goes Charles' Father" (BEADGCF) I heard this as "Father Charles Goes Down And Empties Bottle; Bottle's Empty And Down...
by zahlman
Wed Sep 17, 2008 2:59 am UTC
Forum: Coding
Topic: Help with Pointers in C++
Replies: 9
Views: 1223

Re: Help with Pointers in C++

Thanks for the help. It's my sophomore year and my third semester at school. I go to a private school and half the people in the course are computer engineers (including myself), so there's a lot of focus on C notation even though we're using C++. That may have something to do with it. alkdsjflkajf...
by zahlman
Tue Sep 16, 2008 12:42 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0475: "Further Boomerang Difficulties"
Replies: 128
Views: 35772

Re: "Further Boomerang Difficulties" Discussion

DBirnbaum wrote:http://www.mrphlip.com/boomerang/?panels=23+23+-27

I finally decided to sign up for this forum. Hello!


You just won the thread. Welcome to XKCD!
by zahlman
Tue Sep 16, 2008 12:20 am UTC
Forum: Coding
Topic: Python assistance (extreme basics)
Replies: 6
Views: 949

Re: Python assistance (extreme basics)

Although, in practice, I never got to use any of your assistance because my internet connection decided to suicide, thanks exetel . Er? Why would your internet connection cause any problems with using the code? You saw the code, yes? Your internet connection came back (as evidenced by the fact that...
by zahlman
Mon Sep 15, 2008 8:46 am UTC
Forum: Coding
Topic: Idiot question: what's wrong with my bubble sort?
Replies: 8
Views: 1111

Re: Idiot question: what's wrong with my bubble sort?

As far as I can see, my code is exactly what the wikipedia thing says. I don't think C++ has an explicit swap-elements-in-an-array function, so I've had to swap them with 3 lines of code (although I should probably define another function to do that). The standard library does; it's called std::swa...
by zahlman
Mon Sep 15, 2008 8:42 am UTC
Forum: Coding
Topic: Stuck on a beginners Java program
Replies: 6
Views: 884

Re: Stuck on a beginners Java program

There isn't anything difficult about this, so I don't understand what you mean by "Java in college is so much more different and challenging then the Java I did in high school.". What were you doing in high school? If you took an entire course, you should have seen all the code constructs ...
by zahlman
Mon Sep 15, 2008 8:32 am UTC
Forum: Coding
Topic: Python assistance (extreme basics)
Replies: 6
Views: 949

Re: Python assistance (extreme basics)

That's a rather strange data structure for the map. Without getting into classes, might I suggest: 1) it makes more sense for each entry of the "map" to represent a room. 2) the rooms are identified by number, so we should have a tuple of whatever it is we use to represent a room. 3) given...
by zahlman
Mon Sep 15, 2008 7:55 am UTC
Forum: Coding
Topic: Python: redo loop
Replies: 4
Views: 2004

Re: Python: redo loop

# I don't understand why you need a separate "bind parameter" and "column"? In fact, if they're just unique identifiers, why can't you just use the prompt? # In fact, I would simplify things this far, without knowing any better: data = { "First Name": None, "Last ...
by zahlman
Fri Sep 12, 2008 9:43 pm UTC
Forum: Coding
Topic: C++ competency
Replies: 16
Views: 1517

Re: C++ competency

I think people are being a little severe here. That's because it's C++, and there are therefore a lot of gotchas lurking around. It's easy to get the impression that you know what you're doing, when in fact you invoke undefined behaviour all over the place. Especially because of the freakish longev...
by zahlman
Fri Sep 12, 2008 9:41 pm UTC
Forum: Coding
Topic: noob python - function returns None - don't know why
Replies: 6
Views: 2387

Re: noob python - function returns None - don't know why

Some ideas for code simplicity: # Name functions that primarily calculate a value (instead of having side effects) in a "descriptive" rather than "imperative" way. # "num" is a more common abbreviation than "numb" in programming for "number", but the...
by zahlman
Fri Sep 12, 2008 9:02 pm UTC
Forum: Language/Linguistics
Topic: 日本語 (Japanese Practice)
Replies: 552
Views: 173017

Re: 日本語 (Japanese Practice)

That's just how the language is spoken by its native speakers. When you're not yourself fluent, it seems like you can barely figure out what they said well enough to reproduce the sounds, let alone understand what it actually means. Some languages seem like that to me (French, Portuguese, Japanese)...
by zahlman
Fri Sep 12, 2008 4:41 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0475: "Further Boomerang Difficulties"
Replies: 128
Views: 35772

Re: "Further Boomerang Difficulties" Discussion

Aura Nightbane wrote:meh, i was hoping for more on the LHC, but this was pretty funny as well.


It just so happens that my first thoughts were along the same lines. Therefore, thy will be done:

Image
by zahlman
Wed Sep 10, 2008 8:44 pm UTC
Forum: Coding
Topic: One MIDI. Many PCs.
Replies: 16
Views: 2023

Re: One MIDI. Many PCs.

Heh, I'm not the only one who writes "raise hell". :)
by zahlman
Wed Sep 10, 2008 8:04 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 0474: "Turn-On"
Replies: 178
Views: 25287

Re: "Turn-On" Discussion

skagedal wrote:I thought there were seven quarks. Or was that dwarfs? What's the difference, anyway?


A quark is one of a coloured triple; a dwarf, WRT being taller, is crippled.

(Not quite as good as the difference between Evil Knievel and the Rockettes, but you get the idea...)

Go to advanced search