Search found 103 matches

by maafy6
Wed Sep 12, 2012 4:59 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1107: "Sports Cheat Sheet"
Replies: 178
Views: 35081

Re: 1107: "Sports Cheat Sheet"

My version of this chart is just entirely baseball. Especially now that I can even enjoy being a Nationals fan.

Euler wrote:Canada:
February 16-24, curling.


Also in America every four years during the Winter Olympics. We do find it oddly fascinating.
by maafy6
Wed Mar 28, 2012 12:43 am UTC
Forum: Coding
Topic: Coding is English?
Replies: 32
Views: 7707

Re: Coding is English?

Same reason why we own the moon - we Americans got there first. Tongue in cheek, people. Tongue in cheek. Even outside of the keywords of a language, it seems relatively widespread (though naturally less likely) that non-English speakers will code everything else in English as well. e.g. you're more...
by maafy6
Fri Dec 02, 2011 9:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

EvanED wrote:Also: never run a SunOS box. :-)


FTFY

Granted, I probably have an irrational hatred of SunOS thanks to being forced to work on a system on Solaris 8 at work. So happy with that.

So very happy.
by maafy6
Wed Nov 30, 2011 4:38 am UTC
Forum: Coding
Topic: (C++) Ending a count early.
Replies: 16
Views: 2316

Re: (C++) Ending a count early.

See, this is what happens when I don't get any sort of formal education in programming. I end up writing complex programs utilizing a fair amount of advanced programming concepts and then I miss out on something like this. This is the only single reason I sometimes regret that I don't have formal e...
by maafy6
Fri Nov 04, 2011 3:30 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0972: "November"
Replies: 131
Views: 55417

Re: 0972: "November"

For me, the thing to appreciate in this comic is the Peanuts homage blended in with a poke at all the bullshit awareness months that idiots make up with a fun play on words.
by maafy6
Mon Oct 31, 2011 5:22 am UTC
Forum: Coding
Topic: Base Conversion Program
Replies: 4
Views: 1420

Re: Base Conversion Program

Two things: 1. You still get a floating point exception when base == 0 2. Not sure where the choice for larger bases came from, (guess there's not so much a standard for base 47, eh), might want to at least make it compatible with base 64 encoding , which goes 0-9A-Za-z+/ It is unfortunately case-se...
by maafy6
Mon Oct 31, 2011 5:01 am UTC
Forum: Coding
Topic: Help with java decision structure program
Replies: 4
Views: 1292

Re: Help with java decision structure program

The biggest issues I see with what you have so far are with the misuse of getters. The point of getters is that they, well, get the value of an attribute stored by the class . A sample class with an int property could look like public class Example { private int property; public void setProperty(int...
by maafy6
Sun Oct 16, 2011 5:07 pm UTC
Forum: Coding
Topic: Is this hard to read?
Replies: 15
Views: 3527

Re: Is this hard to read?

It is certainly readable, though I agree with Jplus that there are definitely too many comments, especially for Python. It's generally meant to be self-documenting, so that just by reading `word=random.choice(WORDS)`, you can figure that you're picking a random entry from the list of words you just ...
by maafy6
Fri Oct 14, 2011 6:49 am UTC
Forum: Coding
Topic: Odd design decisions?
Replies: 55
Views: 8212

Re: Odd design decisions?

// This function cannot throw any exceptions void foo() throw(); // This function can throw whatever it wants void bar(); Understanding the need for backwards compatibility, and the ability to look at throw() as throw empty-set = throw nothing, looking at the two in a vacuum it still makes no damn ...
by maafy6
Fri Oct 14, 2011 3:44 am UTC
Forum: Coding
Topic: c++ problem help please
Replies: 5
Views: 1248

Re: c++ problem help please

When you call a function, it always requires parentheses (even if there are no arguments). Change your calls to games[0].kdRatio() and games[0].score() and you'll be good. Also, you'll want to change those lines to cout << games[0].kdRatio() << endl; Without the endl, it will print everything on the...
by maafy6
Fri Oct 14, 2011 2:47 am UTC
Forum: Coding
Topic: c++ problem help please
Replies: 5
Views: 1248

Re: c++ problem help please

rflrob is right. What you need to do is make score and k/d ratio member functions . (Or, you could update them each time you change kills and deaths, but that would be menial and annoying). It would look something like this: struct scoreboard { // ... int score () { return kills * 50; } float kdRati...
by maafy6
Sat Oct 08, 2011 2:53 am UTC
Forum: Coding
Topic: C Preprocessor Macros
Replies: 16
Views: 8511

Re: C Preprocessor Macros

I am a little happier with the lambda solution. I'll have to check how our compiler at work feels about C++0x. I would be mildly surprised if that was available. Of course, the hurdle after that would be that no one on our team (myself included) really knows any of it. Granted, no one would fight it...
by maafy6
Fri Oct 07, 2011 5:40 am UTC
Forum: Coding
Topic: C Preprocessor Macros
Replies: 16
Views: 8511

Re: C Preprocessor Macros

I have two major uses for macros. (Assume all my examples include the necessary line-continuation characters. I hate trying to line them up in a variable-width font.) The first is one that I usually end up defining in anything using Qt: #define ASSERT_CONNECT(...) do { bool ok = QObject::connect(__V...
by maafy6
Wed Jun 22, 2011 12:28 am UTC
Forum: Coding
Topic: Command line challenges
Replies: 37
Views: 5870

Re: Command line challenges

For #1 - similarish to OP. Relies on the fact that if July 1 is a Friday, so is July 29.

Spoiler:

Code: Select all

for year in {2000..3000}
do
  cal 7 $year | cut -d' ' -f6 | grep 29 &> /dev/null && echo $year
done
by maafy6
Sat Jan 29, 2011 5:19 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

Learned something about C++ today. Access modifier are, apparently, optional to those who are devious enough. Consider the following: // A.h class A { public: A(); virtual ~A(); private: void doStuff() const; }; // A.cpp #include <iostream> #include "A.h" A::A(&...
by maafy6
Sat Jan 29, 2011 4:56 am UTC
Forum: Coding
Topic: Code for the Collatz Conjecture
Replies: 8
Views: 1688

Re: Code for the Collatz Conjecture

MHD wrote:Use [code ] [/code ] tags when you post code.

int main() {
printf("This is ugly.");
}

Code: Select all

int main() {
    printf("This is nice.");
}


It would have looked nicer if you had included an endline character in your printf.
by maafy6
Fri Jan 14, 2011 2:54 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

Why does this work? I can't think of any sane reason why True and False can't be literals. >>> True = False >>> True == False True On the plus side (is there really one, here?), this only becomes problematic if you are directly comparing against them, which is generally un-Pythonic. (e.g. ... >>> T...
by maafy6
Thu Dec 30, 2010 3:43 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

I'm surprised this didn't segfault when I tried it... #include <stdio.h>int main (){    goto foo;        char* str = "Hello, world!";        foo: printf ("%s\n", str);}  It segfaulted for me. It probably only doesn't segfault if you compile with optimization. Unless I'm parsing that tortured senten...
by maafy6
Mon Dec 06, 2010 3:20 am UTC
Forum: Coding
Topic: Objective C Question
Replies: 5
Views: 1222

Re: Objective C Question

Note that the news isn't that bad. You can name parameters in objective C. And those names are part of the 'real name' of the function. The types of them aren't. So the Test(String) one could be Test(Name:"foo") The Test(int) one could be Test(Height:7) The Test(String, String) could be T...
by maafy6
Sat Aug 28, 2010 5:28 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

An open letter to OpenGL: Dear OpenGL and surrounding community, Screw you, too. Best wishes, maafy6 So this past week, I've been working on a bug in some code that uses OpenGL. I've never done anything in OpenGL. The documentation and tutorials that are available for OpenGL, and especially shaders...
by maafy6
Tue Apr 06, 2010 2:51 am UTC
Forum: Coding
Topic: Linux C++ IDE Recommendations
Replies: 30
Views: 5031

Re: Linux C++ IDE Recommendations

In my experience, QtCreator is almost passable. It may have been the version I got, but I found it to be very buggy, with occasional highlighting errors. Depending on your version of Linux, Qt itself may be problematic and prone to random question (RHEL 5.2, I'm looking at you.)
by maafy6
Sun Mar 14, 2010 3:13 am UTC
Forum: Coding
Topic: Is Java that bad?
Replies: 114
Views: 18371

Re: Is Java that bad?

GCC's cpp works on pretty much any language that doesn't use #-comments. You'll want to use "cpp -p" to disable the linemarkers, but beyond that, it should work just peachy. You know, I was thinking to myself earlier this week that it's too bad Java doesn't have conditional compilation. U...
by maafy6
Tue Feb 23, 2010 4:17 am UTC
Forum: Coding
Topic: Getting the most recent comic
Replies: 24
Views: 90827

Re: Getting the most recent comic

Out of curiosity - what is the difference between "title" and "safe_title" in the JSON?
by maafy6
Tue Jan 05, 2010 4:03 am UTC
Forum: Coding
Topic: Coding: New years resolutions
Replies: 36
Views: 3380

Re: Coding: New years resolutions

Actually create an iPhone app.
by maafy6
Tue Jan 05, 2010 3:49 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

Here's how Tokamak does it, at least according to a 3rd-party tutorial: (comments are mine) neV3 impulse; // Dunno what an neV3 is, it's not in the disappointingly short documentation impulse.Set (0, 1, 0); // Yes, the function names are capitalized this way cube->ApplyImpulse (impulse); // wtf?? ....
by maafy6
Sat Jan 02, 2010 7:41 pm UTC
Forum: Coding
Topic: I want to infect my systems
Replies: 41
Views: 4859

Re: I want to infect my systems

The easiest solution is probably: 1. Find a friend with Linux or a Mac (or, alternately, do this before you blow away your machine) 2. Have them download Google Chrome and burn it to disk for you (or put it on a flash drive) 3. Upon reinstall of Windows, install Chrome from CD/flash drive. 4. Update...
by maafy6
Sat Oct 17, 2009 8:12 pm UTC
Forum: Coding
Topic: Woo closures in C!
Replies: 24
Views: 2469

Re: Woo closures in C!

So, we should change the subject title to "Woo closures coming to a C near you!" ?
by maafy6
Sun Sep 27, 2009 2:55 am UTC
Forum: Music
Topic: Discover new bands game.
Replies: 56
Views: 5161

Re: Discover new bands game.

Throwback - Border Crossing

Unfortunately, they were a one album (non)wonder, I believe they've broken up, or else I've been lied to. In any case, the one album they did make, Border Crossing, is forever in my mind as a perfect Autumn album, with hints of maybe Dispatch and Guster.
by maafy6
Sun Jul 12, 2009 4:38 am UTC
Forum: Coding
Topic: Coding Style?
Replies: 23
Views: 2583

Re: Coding Style?

int* x, y; int *x, y; Which one is less confusing? The former seems to indicate that x and y are pointers, while the latter implies that x is a pointer and y is an int. Well, neither is confusing to me since I know C and C++. My brain doesn't trip over either one. I would hope anyone who knows C/C+...
by maafy6
Tue Jun 16, 2009 2:03 am UTC
Forum: Coding
Topic: Shooting yourself in the foot: Part two
Replies: 50
Views: 5081

Re: Shooting yourself in the foot: Part two

You, sir, name? wrote:Quantum computing: You set out to create a new leg, which would explain the leg you sprouted last week. A leather couch appears.


Fix'd for consistency.
by maafy6
Sat Jun 13, 2009 3:37 am UTC
Forum: Coding
Topic: Shooting yourself in the foot: Part two
Replies: 50
Views: 5081

Re: Shooting yourself in the foot: Part two

Qt toolkit: You take the C++ leg, and add two stickers that say, "qmake" and "QApplication". You don't know what they do or how any of it works, but your leg now has Internet, a GUI, touchscreen capabilities, and can sink aircraft carriers from half a world away via satellite-mo...
by maafy6
Fri Jun 12, 2009 3:33 am UTC
Forum: Coding
Topic: Shooting yourself in the foot: Part two
Replies: 50
Views: 5081

Re: Shooting yourself in the foot: Part two

FORTRAN: Every few years, you make a new, slightly better leg with a few more capabilities, but everyone's long since forgotten about you.

Matlab: A graph of your new leg appears.
by maafy6
Sun Apr 12, 2009 5:52 am UTC
Forum: Coding
Topic: Contest #3
Replies: 97
Views: 8221

Re: Contest #3

Here's my insane shell script. #!/bin/sh read a o b case $o in '+')jot - -$b $a 1|tail +2|wc -l;; '-')jot - $b.1 $a 1|wc -l;; '*')jot -b`jot -b1 $a|rs -g0 -w99999` $b|rs -c1 0 1|wc -l;; '/')echo `jot - 0 $a 1|rs 0 $b|tail +2|wc -l` r`jot - 0 $a 1|rs 0 $b|tail -1|rs 0 1|tail +2|wc -l`;; '^')for j in...
by maafy6
Sun Mar 15, 2009 8:40 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

I'm working on one as a way to help teach myself Objective-C. One of the implentations I was going to play around with was an array A from [-N:N-1], where if the function is f : X -> Y, then A[0:N-1] is X and A[-N:-1] is Y such that for i in [0:N-1] f(A[i]) = A[~i]. Unfortunately, for all of its ele...
by maafy6
Sun Mar 15, 2009 5:59 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1933490

Re: Coding: Fleeting Thoughts

I like vi, though not enough to follow one of my coworker's leads into using the Eclipse plugin that lets you edit like vi in the IDE. More pressingly, I'm always kind of annoyed by the fact that most languages' standard libraries don't really include anything like the notion of a bijection. It woul...
by maafy6
Sat Dec 27, 2008 5:50 am UTC
Forum: Coding
Topic: A little question about g++ and code in multiple files
Replies: 6
Views: 1141

Re: A little question about g++ and code in multiple files

Okay, so it turns out the problem was both that and that I needed to put std:: in front of keywords like string and vector, because I'm not using namespace std in the header file (and using namespaces in header files is considered a bad practice, right?). So I just need to do this every time I use ...
by maafy6
Wed Dec 03, 2008 5:01 am UTC
Forum: Coding
Topic: question about binary in C++
Replies: 21
Views: 2307

Re: question about binary in C++

I can't really tell, but my understanding is this: You have a double. What you want to do is have a bool array (of size 64) such that if the i'th bit of that double as stored in memory is set, then the i'th element of the array is 1. (Otherwise, it is 0) In that case, here you go: #include <cstring>...
by maafy6
Mon Sep 01, 2008 12:39 am UTC
Forum: School
Topic: "Ouch" moments in school
Replies: 514
Views: 53753

Re: "Ouch" moments in school

My third year in college I was in an algorithms class. It started out blindingly slow, especially for a math major, while all the gamer comp sci kids (you know, the ones that only chose CS for a major because the only thing they like to do is eat cheetos and play WoW and Halo all day) stumbled over ...
by maafy6
Tue Jun 17, 2008 3:11 am UTC
Forum: Coding
Topic: data storage in matlab
Replies: 3
Views: 2598

Re: data storage in matlab

The easiest thing that comes to mind would be to store the data in an Nx2 matrix where N = (n_1 + n_2 + ... + n_m) + m and m is the number of for loops. The matrix itself would look like this: [ 1 n_1 ] [ n_1 x 2 matrix ] [ 2 n_2 ] [ n_2 x 2 matrix ] ... [ m n_m] [ n_m x 2 matrix] Then, once you hav...
by maafy6
Sun Apr 20, 2008 3:55 am UTC
Forum: Coding
Topic: CSS positioning problem
Replies: 13
Views: 2466

Re: CSS positioning problem

The first solution the comes to mind would be either to modify the table structure to something like this: +--+---+--+ | | | | | | | | | +---+ | | | | | +--+---+--+ or, in the middle cell have it separated out along the lines of <div id="container"> <div id="content">Content...</...

Go to advanced search