Moderators: phlip, Moderators General, Prelates
Workaphobia wrote:The Unix Epoch is the starting point for many integral time representations, and it is defined to be midnight, January 1st, 1970. Your time was exactly 5 hours earlier, so I take it you're on the East Coast.

Workaphobia wrote:Sidenote: is a "fleeting thoughts" thread not supposed to have responses to a particular topic, or do multiple discussions just get multiplexed in here?
evilbeanfiend wrote:iirc the second before the unix epoch starts is used as an error value
fryman wrote:Using CLargeNumber, I wrote a program to calculate the fibonacci sequence up to whatever
M.qrius wrote:
- Code: Select all
boolean ever = true;
for(;ever;) {
[Do stuff]
}
Nice way to write down an eternal loop
#define ever ;;
for(ever)
{
}
unmoored wrote:
- Code: Select all
#define ever ;;
for(ever)
{
}
while(malloc(1024));Sastira wrote:My favorite way to teach C newbies about why they should free() their malloc()s:
- Code: Select all
while(malloc(1024));
while ((dwMem = DPMI_QueryFree()) != 0) {
AddToHeap(DPMI_Allocate(dwMem), dwMem);
}for (dwMem = 0x1000000; dwMem; dwMem -= 0x1000) {
while ((hmem = DPMI_Allocate(dwMem)) != 0) {
AddToHeap(hmem, dwMem);
}
}again:
for (dwMem = dwLinFree; dwMem > 0; dwMem -= 0x8000) {
if ((hmem = DPMI_Allocate(dwMem)) != 0) {
AddToHeap(hmem, dwMem);
goto again;
}
}mrkite wrote:I don't know anything about CLargeNumber, but the "standard" bignum library for C is GMP, which also proclaims to be the fastest.
So you might be able to speed up your code by using it instead...
Being a programmer and the only computer literate person in my family, I get tech support calls from my family all the time. I got a phonecall from a brother-in-law today:
Him: Hey, you're good with computers right?
Me: Yes.
Him: And you know how to program computers?
Me: Yes, thats my job actually.
Him: Could you explain programming please?
Me: I'm sorry, what do you mean?
Him: I want to make a game like Halo, but I don't know how to start. Could you explain what I need to do?
Me: You should probably go to the library and get a book.
Him: Can you just tell me what I need to do?
Me: Wait a minute. Are you asking me to explain how to program computers?
Him: Yeah.
Me: Over the phone?
Him: Yeah.
My brother in law apparently made several unsuccessful attempt to "learn programming" by opening up exes in Notepad. He created a text file with the words "Morph the screen into something cool" and couldn't figure out how to run it, even had the balls to ask me "how do I install my program? Do I just put a shortcut on the desttop".
My dad, a programmer, lent him an unfortunately titled book called "Teach Yourself Java in 24 hours". He immediately flipped to the back of the book and reading sections on server and Swing development, and was very excited to see that he could write his own server after just one day.
In the end, I was unable to teach my brother in law how to make his own Halo over the phone, and he decided that I wasn't a very good programmer.
people are like LDL cholesterol for the internet
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
EvanED wrote:a rant against programs that were written poorly
Another program from Publisher 31 allocates all the memory it can, and each time you start
a new mission, it zeroes out everything.
Program 24b first allocates all the memory in the system into a “spare pool.” When it needs
to allocate memory from the pool, it first attempts to grow the spare pool; if this succeeds,
the application crashes. (How could I possibly make this up?) Otherwise, it shrinks the spare
pool by the amount it wants to allocate, then allocates the desired value. If this second
allocation fails, the application crashes.
EvanED wrote:a rant against programs that were written poorly
Berengal wrote:c) hot client on server multiplayer action
Notch wrote:Good luck! High latency pong is a very interesting problem.
crazyjimbo wrote:pong ping?
One nitpick - what if user account 0 isn't named root? (Note: I wonder if naming your root account something else would help guard against exploits?)ObsidianX wrote:I got bored... decided to code http://xkcd.org/149/ in a few languages:
coppro wrote:One nitpick - what if user account 0 isn't named root? (Note: I wonder if naming your root account something else would help guard against exploits?)ObsidianX wrote:I got bored... decided to code http://xkcd.org/149/ in a few languages:
Linux Administration Handbook wrote:Linux does not prevent you from changing the username on [the root] account, or from creating additional accounts whose UIDs are 0, but both are bad ideas. Such changes have a tendency to create inadvertant breaches of system security.
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
wing wrote:Sometimes I wish someone would write quick reference cards for different languages syntaxes. It's quite annoying to have a language that you know, but don't write often enough to do the syntax by reflex 100% of the time. For example, I am primarily a Java and C# programmer, and I could write those with my goddamn eyes closed. But it inevitably comes to pass that PHP or VB is the only way a given employer is going to let me do anything. I made PHP very, very angry a few dozen times today with simple syntax errors (why is it "if($variable)" but "include '$variable'"?!?!??!)
Xanthir wrote:wing wrote:Sometimes I wish someone would write quick reference cards for different languages syntaxes. It's quite annoying to have a language that you know, but don't write often enough to do the syntax by reflex 100% of the time. For example, I am primarily a Java and C# programmer, and I could write those with my goddamn eyes closed. But it inevitably comes to pass that PHP or VB is the only way a given employer is going to let me do anything. I made PHP very, very angry a few dozen times today with simple syntax errors (why is it "if($variable)" but "include '$variable'"?!?!??!)
Um, it's not. You can uses parenthesis with an include() or require() as you wish - it's entirely optional. If you have the pathname in a variable, you don't need quotes either.
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.
Users browsing this forum: No registered users and 11 guests