Search found 835 matches

by Pesto
Fri Jul 16, 2010 10:15 pm UTC
Forum: Coding
Topic: The eternal XML argument: attribute vs. element
Replies: 13
Views: 2880

The eternal XML argument: attribute vs. element

We're designing some API calls that use data structured as XML. One thing I've always had trouble wrapping my head around is when something should be an element, versus when it should be an attribute. I've done a little reading on the the web, but most everything I've found is a little to abstract f...
by Pesto
Thu Jul 15, 2010 11:22 pm UTC
Forum: Coding
Topic: What is good code?
Replies: 38
Views: 7091

Re: What is good code?

This is an idea I was going to put forward, and I'd sum it up in two points. Good code is elegant. Good code is not "clever". The essense of good code is clarity . Your intention should be clearly expressed. It should be easy for a maintainer to understand what you wanted. It should be ea...
by Pesto
Wed Jul 14, 2010 11:58 pm UTC
Forum: General
Topic: The cutest dinosaur?
Replies: 42
Views: 14379

Re: The cutest dinosaur?

@Litof: Is that Sue?
by Pesto
Wed Jul 14, 2010 11:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

I'm able to listen to and comprehend podcasts while coding, but not while writing or reading emails.

Similarly, I'm able to listen to and comprehend podcasts while doing sudoku, but not crosswords.
by Pesto
Wed Jul 14, 2010 12:51 am UTC
Forum: Coding
Topic: coworker rants
Replies: 92
Views: 14611

Re: coworker rants

STOP PUTTING PRINT STATEMENTS IN YOUR UNIT TESTS!!!

edit: Holy shit. Not only is she printing stuff. She's faking the output of the unit testing suite from within her tests.
by Pesto
Tue Jul 13, 2010 12:04 am UTC
Forum: Coding
Topic: Fake Programming Language
Replies: 210
Views: 31732

Re: Fake Programming Language

An esoteric programming language called Smiley. Everything is a smiley of some sort. >:3

I don't have a concept of how the language is actually structured. Just a random thought I had.
by Pesto
Sun Jul 11, 2010 7:21 pm UTC
Forum: General
Topic: I Shouldn't Have To Say This
Replies: 2609
Views: 396923

Re: I Shouldn't Have To Say This

ISHTST: When I'm fiddling around with the configuration on the Xbox, it is not okay for you to walk across the room, grab the controller while it's in my hands and start pressing buttons. ISHTST: Most of the fun of playing a game is solving the puzzles on your own. If your offer of a hint is met wit...
by Pesto
Thu Jul 08, 2010 2:02 am UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

Blind, so the subject doesn't know which glass they are drinking from. Not to mention having a larger sample size than one.
by Pesto
Thu Jul 08, 2010 1:58 am UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

But different shaped glasses can change the way a beer tastes in subtle and not-so-subtle ways. I don't buy it. Unfortunately, I can't think of a way of testing this scientifically. I know this is true for wine, but I've never heard it for beer. It has to do with the way odors come off of the liqui...
by Pesto
Mon Jul 05, 2010 3:18 am UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

SurgicalSteel wrote:But different shaped glasses can change the way a beer tastes in subtle and not-so-subtle ways.

I don't buy it. Unfortunately, I can't think of a way of testing this scientifically.
by Pesto
Tue Jun 29, 2010 7:48 pm UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

About like this.

Image

Probably cropped a bit more, and a little less pretty, but not terribly gross.
by Pesto
Tue Jun 29, 2010 4:39 pm UTC
Forum: General
Topic: Sleep-time holodeck experiences
Replies: 3408
Views: 796031

Re: What were your dreams last night?

I think I saw a nipple. That's all I remember.
by Pesto
Tue Jun 29, 2010 4:11 am UTC
Forum: Coding
Topic: Epic coding moments
Replies: 127
Views: 22742

Re: Epic coding moments

I think when playing golf, you need to compare apples to apples. In meat-space golf, you don't have one player at Pebble Beach and another at the local par three.
by Pesto
Tue Jun 29, 2010 4:01 am UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

Of course it sure would be nice if instead of two lists of places to look for headers (quotes and angle brackets), you had an arbitrary number of lists to play with. But perhaps that idea would fall under "too much rope."
by Pesto
Mon Jun 28, 2010 1:04 am UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

Yeah, I didn't understand that. I guess when the manual said "Add the directory dir to the head of the list of directories to be searched", it meant that this list is what is searched after searching in the current directory. I thought the current directory was part of that list and would ...
by Pesto
Mon Jun 28, 2010 12:26 am UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

No matter how you do it, there are going to be nasty corner cases where the compiler will pick up the wrong header. Such as? The behaviour is clearly documented by your compiler. Angle brackets to search system and additional include directories. Quotes to search local directory, then system and ad...
by Pesto
Sun Jun 27, 2010 11:52 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

I don't want to use the -I directive. That's why. But why on earth not? Because I don't want the compilation options to be different between compiling the app and compiling the tests. No matter how you do it, there are going to be nasty corner cases where the compiler will pick up the wrong header....
by Pesto
Sun Jun 27, 2010 11:23 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

No, #includes with quotes will search paths in -I too. It'll just try the current dir first. The spec says that if "" can't find a file, then it should treat it as <> and try again. From the gcc manual. -Idir Add the directory dir to the head of the list of directories to be searched for ...
by Pesto
Sun Jun 27, 2010 11:01 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

Yes, it will.

The -I option registers directories to search for includes using angle brackets. The -iquote option registers directories to search for includes using quotes. Either way, I don't want to be messing with it.
by Pesto
Sun Jun 27, 2010 8:36 am UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

Back to before and after pics... I can't remember exactly what the product was, but it was some dental hygiene product. The before pictures struck me as very unhealthy looking, and the after as very healthy looking. The difference? In the after pictures, the tongue was pressed up against the back o...
by Pesto
Sun Jun 27, 2010 7:07 am UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

I had the same problem a while ago. I just dumped everything into the same directory. I suppose you could also have a master include file and at that to -I. I want to avoid relying on the -I directive for compiling the tests. Imagine you have the following tree. app |-- foo.c |-- foo.h |-- main.c `...
by Pesto
Sat Jun 26, 2010 8:06 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

Here's something of a kludge that I just thought of. Each directory under the test tree could have a symlink to the corresponding directory of the app. It could be called something like ".link". That way a given test file, some_test.c, could use "#include ".link/some.h". I'm...
by Pesto
Sat Jun 26, 2010 12:46 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

I had considered using the -I or -iquote options of gcc, but there's a complication with that. color_test.h, lang_test.h and util_test.h each define a test suite. These test suites are bound together with a single file test_suites.h. app |-- main.c |-- modules | |-- color.c | |-- color.h | |-- lang....
by Pesto
Sat Jun 26, 2010 12:15 pm UTC
Forum: Coding
Topic: What is good code?
Replies: 38
Views: 7091

Re: What is good code?

Clever hacks are sometimes mistaken for elegant code, and I've read code that was so incredibly simple and obvious that it seemed trivial and not at all elegant. This is an idea I was going to put forward, and I'd sum it up in two points. Good code is elegant. Good code is not "clever". S...
by Pesto
Sat Jun 26, 2010 11:49 am UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Re: Computed includes in C

Well, here's what I was trying to do. I'm working on a unit testing framework in C. I wanted to have a directory for tests that mirrors the directory structure of the application's source, like so. app |-- main.c |-- modules | |-- color.c | |-- color.h | |-- lang.c | `-- lang.h |-- tests | |-- modul...
by Pesto
Thu Jun 24, 2010 11:26 pm UTC
Forum: Coding
Topic: Computed includes in C
Replies: 26
Views: 3178

Computed includes in C

Here's some code I've got in C. #define ROOTDIR /home/user/project/ #include ROOTDIR "foo.h" #include ROOTDIR "bar.h" Hopefully what I'm attempting to do is clear. I'd like to include the files "/home/user/project/foo.h" and "/home/user/project/bar.h", but I c...
by Pesto
Tue Jun 22, 2010 1:01 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

Speaking of cosmo, I'm learing about REST and idempotence at the moment. Would a quine be considered idempotent?
by Pesto
Tue Jun 22, 2010 12:57 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

FT: I'm testing out unit testing frame works. I want to try them out by using TDD, which means I need something to code. I've chosen Cosmo! Example: Fourteen is eight. Eight is five. Five is four. Four is COSMO! You take f(x), where x is an integer. f(x) is the number of characters i...
by Pesto
Fri May 28, 2010 7:56 am UTC
Forum: General
Topic: I Shouldn't Have To Say This
Replies: 2609
Views: 396923

Re: I Shouldn't Have To Say This

ISHTST: When I want change for a five dollar bill, don't offer me another five dollar bill.
by Pesto
Tue May 25, 2010 8:02 am UTC
Forum: General
Topic: Conservapedia - Most Accurate Shite On The Web*
Replies: 342
Views: 55130

Re: Conservapedia - Most Accurate Site On The Web*

:shock: They have their own YouTube channel.
by Pesto
Tue May 25, 2010 1:17 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

FT: git-svn clone pulls the oldest revision first. It would be better if it were to do a checkout to get the latest working copy, then work backwards to fill in the history in the background so you can start looking at code immediately.
by Pesto
Mon May 24, 2010 7:48 pm UTC
Forum: Coding
Topic: do errors 'hurt' my PC?
Replies: 117
Views: 11708

Re: do errors 'hurt' my PC?

Depending on what you're doing, and the type of error, it could cause data loss or corruption.

Physical damage? Don't worry about it.
by Pesto
Sun May 23, 2010 11:25 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

You can't use the C standard library in kernel space, either, so I don't see that as a valid argument. This bit, however... Before you can properly use new and delete, you have to implement some sort of memory management. You also have to implement both operators (including their array counterparts)...
by Pesto
Sun May 23, 2010 10:32 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

Is there an reason why OSes aren't actually written in C++? This might shed a little light on that. C++ isn't used in system code because Linus Torvalds is a bastard ? Note: My question was not, "Why isn't C++ used in the Linux kernel?" It was, "Why isn't C++ used in system code?"
by Pesto
Sun May 23, 2010 10:23 pm UTC
Forum: Coding
Topic: Object Oriented Programming... In Java!
Replies: 12
Views: 2565

Re: Object Oriented Programming... In Java!

Usually I agree to 0xBADFEED or I am convinced by his arguments, but this time I think he's wrong. The book starts with an elaborate case study, about the design of a (hypothetical) word processor. I'm reading GoF right now, and I skipped right past the case study. It seemed to be very GUI centric,...
by Pesto
Sun May 23, 2010 10:14 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

A quick quote from Linux Device Drivers from O'Reilly We can consider the file to be an “object” and the functions operating on it to be its “methods,” using object-oriented programming terminology to denote actions declared by an object to act on itself. This is the first sign of object-oriented pr...
by Pesto
Sun May 23, 2010 9:45 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 0743: "Infrastructures"
Replies: 269
Views: 64678

Re: "Infrastructures" discussion

My most recent OpenOffice :x moment...

In Calc, when you open a CSV file, it launches and displays the file in Write.

:x :x :x
by Pesto
Fri May 21, 2010 1:53 am UTC
Forum: Coding
Topic: Programs that print their own source code
Replies: 100
Views: 26587

Re: Programs that print their own source code

This thread inspired me to implement my own programming language, called quine. In quine, every program is a quine. The syntax is quite simple, as any ASCII text file is a valid program. You can install my quine interpreter on any Linux machine with the following command. alias quine='cat' I have no...
by Pesto
Tue May 18, 2010 8:30 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034612

Re: Coding: Fleeting Thoughts

I've heard similar stories, and I think it's true you could get the drives to "walk." I read an account about a programmer that found a security hole in an early OS. He alerted the powers that be, but they had no interest. He kept raising a stink, but since no one would listen, he took ano...
by Pesto
Sun May 16, 2010 4:20 am UTC
Forum: General
Topic: Logical fallacies/douchebaggery in commercials.
Replies: 4973
Views: 761712

Re: Logical fallacies/douchebaggery in commercials.

Back to before and after pics... I can't remember exactly what the product was, but it was some dental hygiene product. The before pictures struck me as very unhealthy looking, and the after as very healthy looking. The difference? In the after pictures, the tongue was pressed up against the back of...

Go to advanced search