Search found 108 matches

by jimrandomh
Mon Feb 02, 2009 5:13 pm UTC
Forum: Coding
Topic: Parsing MAC addresses in C
Replies: 4
Views: 6909

Re: Parsing MAC addresses in C

int parseMac(char mac[], u_int8_t addr[]) ... sscanf(mac, "%2x:%2x:%2x:%2x:%2x:%2x", (unsigned int *)&addr[0], (unsigned int *)&addr[1], (unsigned int *)&addr[2], (unsigned int *)&addr[3], (unsigned int *)&addr[4], (unsigned int *)&addr[5]); This is a type error. D...
by jimrandomh
Sun Feb 01, 2009 12:24 am UTC
Forum: Coding
Topic: Using Java to access dynamic system resources
Replies: 7
Views: 1293

Re: Using Java to access dynamic system resources

I am going to involve with my personal project which is my own idea, to create virtual RAM. Since the amount of energy consumed by system at run time has not been utilized appropriately and there can be a possible mechanism to use those resources to provide application centric features. it can be d...
by jimrandomh
Sun Feb 01, 2009 12:13 am UTC
Forum: Coding
Topic: Need help using OpenGL libraries.
Replies: 5
Views: 707

Re: Need help using OpenGL libraries.

Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib It says that you don't have a main function. The code you copy/pasted did not include one, so I assume it is correct. If you believe otherwise, show us the source file it's in. I thou...
by jimrandomh
Sat Jan 31, 2009 8:09 pm UTC
Forum: Coding
Topic: Need help using OpenGL libraries.
Replies: 5
Views: 707

Re: Need help using OpenGL libraries.

If you want help, you MUST provide the original error messages. Always. Otherwise, we cannot help you.
by jimrandomh
Tue Jan 13, 2009 9:33 pm UTC
Forum: Coding
Topic: A PageRank-like User Reputation System?
Replies: 16
Views: 1625

Re: A PageRank-like User Reputation System?

The problem with this scheme is that users will rate each other based on posts, not on moderations. A malicious user could make good posts but give good votes to trolls and bad votes to legitimate users. You also have to deal with all the known abuses of pagerank, such as automatically-created users...
by jimrandomh
Tue Jan 13, 2009 9:27 pm UTC
Forum: The Help Desk
Topic: Win. XP theme creation
Replies: 3
Views: 1025

Re: Win. XP theme creation

The program you are looking for is called Litestep. It replaces the Windows default shell, and provides things like the taskbar and desktop icons in an extremely customizable way.
by jimrandomh
Thu Nov 27, 2008 5:12 pm UTC
Forum: Coding
Topic: Binary vs Text Files
Replies: 4
Views: 1234

Re: Binary vs Text Files

More precisely: On Windows only, text mode will replace "\n" with "\r\n" when writing, and will replace "\r\n" with "\n" when reading. This is almost always a bad thing.
by jimrandomh
Sun Nov 23, 2008 3:58 pm UTC
Forum: Coding
Topic: Need a bit of help modularizing UNIX (sh)
Replies: 4
Views: 971

Re: Need a bit of help modularizing UNIX (sh)

Works for me. It sounds like secondscript isn't running at all. Have you tried running it directly? Have you checked that it's executable, and has a proper #! header?
by jimrandomh
Sun Nov 23, 2008 3:22 am UTC
Forum: Coding
Topic: Need a bit of help modularizing UNIX (sh)
Replies: 4
Views: 971

Re: Need a bit of help modularizing UNIX (sh)

I don't understand what you mean. How does echoing text keep you from modularizing? Outputting text is a function call/program invocation just like any other.
by jimrandomh
Fri Nov 21, 2008 1:47 pm UTC
Forum: Computer Science
Topic: Honest necessity of calculus in computer Science
Replies: 30
Views: 29053

Re: Honest necessity of calculus in computer Science

Yakk, may I ask what you base your estimation on? I have never heard of any application for group theory or fields in games. Game developers usually don't roll their own physics engines, and they never roll their own error correction or encryption. I've never seen procedural content generation invol...
by jimrandomh
Thu Nov 20, 2008 2:42 am UTC
Forum: Computer Science
Topic: Honest necessity of calculus in computer Science
Replies: 30
Views: 29053

Re: Honest necessity of calculus in computer Science

Basic calculus comes up in machine learning and signal processing, I've never had a need for any of the differential equations and fancy integrals that come up in later calculus classes. Sometimes programmers are forced to deal with physics problems, in writing simulations, which involves a lot of m...
by jimrandomh
Wed Nov 19, 2008 6:22 pm UTC
Forum: Computer Science
Topic: Learning chatbot
Replies: 4
Views: 2473

Re: Learning chatbot

There is no known right answer to this question, mainly because no one has written a chatbot which can avoid outputting wallbangers. Successful chatbots have used horrible tricks, like picking randomly from a list of responses like "How does <recently-used-NP> make you feel?", plus trigger...
by jimrandomh
Tue Nov 18, 2008 9:03 pm UTC
Forum: Coding
Topic: Posting coding projects in my blog
Replies: 9
Views: 1434

Re: Posting coding projects in my blog

You need to create a manifest and package it together with all the .class files into a JAR file. The manifest file looks like Manifest-Version: 1.0 Main-Class: ClassWithMainFunction (There are other, optional fields you might put in there, but that's all you need for now.) Then package it with jar c...
by jimrandomh
Mon Nov 17, 2008 4:45 am UTC
Forum: Computer Science
Topic: Algorithm Choice
Replies: 13
Views: 2465

Re: Algorithm Choice

You could do Huffman encoding/decoding with an expanded trie. That's where, rather than having two children for each node and handling one bit, you handle n bits and have 2^n pointers. It has the same computational complexity as doing one bit at a time, but much better constant factors. Rather than ...
by jimrandomh
Mon Nov 17, 2008 3:02 am UTC
Forum: Serious Business
Topic: Drugs in America, the War on Drugs, and What Should Change
Replies: 191
Views: 14609

Re: Drugs in America, the War on Drugs, and What Should Change

I think the problem is that there are a lot of people who only think in sound bites, who can't understand that crack (which seriously harms its users and causes crime) is not the same thing as marijuana (which doesn't). All Americans from my generation received extensive anti-drug propaganda in grad...
by jimrandomh
Sun Nov 16, 2008 7:39 pm UTC
Forum: Coding
Topic: SDL, C++: image from array
Replies: 4
Views: 1387

Re: SDL, C++: image from array

SDL_CreateRGBSurfaceFrom() does what you want. You will have to think a bit about your in-memory image format, and provide information about it to that function. In the overwhelming majority of cases, however, you just want to use the SDL_Image library to load JPEGs or PNGs.
by jimrandomh
Sat Nov 15, 2008 9:39 pm UTC
Forum: Coding
Topic: The J Programming Language (and other array languages)
Replies: 30
Views: 4169

Re: The J Programming Language (and other array languages)

You misunderstood what I said about curly braces. I didn't say they're always used for statement grouping, I said they're always used for grouping. Some languages use them for array, list or set declaration, some use them as quotelike delimiters, some don't use them at all, and there are probably ot...
by jimrandomh
Sat Nov 15, 2008 7:20 pm UTC
Forum: Coding
Topic: The J Programming Language (and other array languages)
Replies: 30
Views: 4169

Re: The J Programming Language (and other array languages)

djn, I'm not saying that it's different , I'm saying that it's bad . You quoted a supporting argument but left out the main point: It's easy to figure out what an identifier means, since it's named in English and you can search for it in documentation, but it's not easy to figure out what an operato...
by jimrandomh
Sat Nov 15, 2008 6:32 am UTC
Forum: Coding
Topic: Scala
Replies: 7
Views: 2370

Re: Scala

I don't know much about Scala specifically, but I do know the pattern that these languages tend to fall into. They seem great when you're just playing around with them, but when you try to do a nontrivial project, they bite you in the ass in unexpected and sometimes very imaginative ways. It ultimat...
by jimrandomh
Thu Nov 13, 2008 5:19 am UTC
Forum: Coding
Topic: REALbasic Property
Replies: 5
Views: 1014

Re: REALbasic Property

You need to save it to a file when the program quits, and load it from the same file when it starts.
by jimrandomh
Wed Nov 12, 2008 3:50 pm UTC
Forum: Coding
Topic: The J Programming Language (and other array languages)
Replies: 30
Views: 4169

Re: The J Programming Language (and other array languages)

Why are you all being so apologetic? Shaftusmaximus, your example of "readable J" is completely unreadable to me. It's partially because of all the non-standard meanings for standard operators; I'm not sure what all those operators mean, but I can tell that { and } are not grouping, % is n...
by jimrandomh
Wed Nov 12, 2008 2:37 am UTC
Forum: Computer Science
Topic: md5(x) = x [and other properties of md5]
Replies: 39
Views: 27188

Re: md5(x) = x [and other properties of md5]

MD5 has a fixed size (128-bit) output, so md5(x)=x implies that x is 128 bits long. MD5 operates on 512-bit blocks, so this gets padded out with zeroes (on the right). Since the length is fixed, each output bit o[1..128] is a fixed boolean function of the 128 inputs i[1..128], and we can get that fu...
by jimrandomh
Mon Nov 10, 2008 3:31 pm UTC
Forum: Coding
Topic: Removing scrollback
Replies: 3
Views: 1075

Re: Removing scrollback

It sounds like rather than incrementally updating the screen, you're positioning the cursor at the bottom of the screen, and drawing a whole new screen from top to bottom with newlines, forcing the old one to scroll up. What you should be doing instead is to move the cursor directly to the part of t...
by jimrandomh
Sun Nov 09, 2008 9:07 pm UTC
Forum: Coding
Topic: Lost in C Pointers
Replies: 9
Views: 1580

Re: Lost in C Pointers

To make an array of 10 strings of length up to 100, you would use char strs[10][100]; Note that if you pass the wrong type of pointer to printf or scanf, it will probably crash. If you are using the gcc compiler, you should turn on warnings (with the -Wall option) if you haven't already; it should t...
by jimrandomh
Sun Nov 09, 2008 8:44 pm UTC
Forum: The Help Desk
Topic: windows vista programming problems
Replies: 3
Views: 757

Re: windows vista programming problems

If is very likely that the problem has nothing to do with the operating system, but rather is a bug in your program. You should try running it inside a debugger; that may tell you what really happened.
by jimrandomh
Sun Nov 09, 2008 8:37 pm UTC
Forum: The Help Desk
Topic: PC can't find harddrive
Replies: 16
Views: 1465

Re: PC can't find harddrive

Condolences on your loss (of data). If the problem is that the drive won't spin up, then tapping it may help. Some people have had luck chilling their drives (by putting them in the freezer) before startup (but be careful about condensation). If the problem is with the control circuit, then you can ...
by jimrandomh
Sun Nov 09, 2008 8:27 pm UTC
Forum: Hardware
Topic: Considering building a computer for the first time, tips?
Replies: 21
Views: 3472

Re: Considering building a computer for the first time, tips?

The video card only matters for playing recent games, so if you're sure you aren't going to do that, you can cheap out there. The 700W power supply is definitely overkill. The fan that comes with your CPU is already variable-speed; the CPU has a sensor which reports its temperature to the motherboar...
by jimrandomh
Sun Nov 09, 2008 12:08 am UTC
Forum: Serious Business
Topic: Objections to the Social Contract theory?
Replies: 21
Views: 10205

Re: Objections to the Social Contract theory?

A legal contract requires offer, acceptance, and consideration, but almost no one explicitly agrees to a social contract. This isn't just a problem for people who are unqualified to enter into agreements; people who are qualified but who never explicitly think about the social contract, it would see...
by jimrandomh
Sat Nov 08, 2008 8:34 pm UTC
Forum: News & Articles
Topic: Yes We STILL Can: Change.gov
Replies: 34
Views: 3785

Re: Yes We STILL Can: Change.gov

A white house web forum would never work; it'd be quickly become the most heavily trolled site in existence, and exposing techno-illiterate voters to that would be a disaster. My guess is that Obama will have staffers pick through the submissions, and produce a series of "X people are for posit...
by jimrandomh
Sat Nov 08, 2008 4:31 pm UTC
Forum: Coding
Topic: Need a project...
Replies: 1
Views: 860

Re: Need a project...

You could always join an existing open-source project. Jump in and add a feature you've always wanted. The established projects have ready-made infrastructure and an effectively unlimited supply of bug reports and feature requests to deal with, and you can walk away without dooming the project. The ...
by jimrandomh
Sat Nov 08, 2008 12:03 am UTC
Forum: Coding
Topic: Help with code
Replies: 4
Views: 1140

Re: Help with code

Go do your own homework. So far you've posted three times here: twice you've posted only code, with no error message or other indication of what's wrong, and expected people to proofread it; the third time, you just copy/pasted a homework problem and asked for hints. That's not what this forum is fo...
by jimrandomh
Fri Nov 07, 2008 5:14 pm UTC
Forum: Serious Business
Topic: The Last Eight Years
Replies: 31
Views: 4297

Re: The Last Eight Years

I talked to a co-worker yesterday, mentioning my concern that having a democratic president, house, senate may lead to things passing quickly and possibly without the discussion and revision they deserve From Obama's position paper on ethics (http://www.change.gov/agenda/ethics): Sunlight Before Si...
by jimrandomh
Tue Nov 04, 2008 3:34 am UTC
Forum: Coding
Topic: Non-blocking Python
Replies: 25
Views: 4715

Re: Non-blocking Python

The function you are looking for is 'select'; I'm surprised no one's mentioned it. Threads will work, but they carry a heavy price in both complexity (they're famously hard to debug) and system resources. Setting a timeout works but only poorly, because it forces you into a tradeoff between unnecess...
by jimrandomh
Sat Nov 01, 2008 4:07 am UTC
Forum: Computer Science
Topic: Stop packet spoofing without modifying IP
Replies: 5
Views: 1534

Re: Stop packet spoofing without modifying IP

If you know the other computer's public key, then you can just use SSL. The problem is that you have to discover that key some how, and if someone's messing with your traffic, then they can intercept both the connection and the key-discovery system. That's why you require that all keys be signed by ...
by jimrandomh
Fri Oct 31, 2008 4:36 am UTC
Forum: Serious Business
Topic: How much knowlege of religion is necessary?
Replies: 35
Views: 2954

Re: How much knowlege of religion is necessary?

How much you need to know depends on what you plan to do. If you want to write a book about religion, you need to know quite a lot. If you want to argue about religion with a friend, you need to know the highlights; but the more you know, the more likely you are to win that argument. If you keep to ...
by jimrandomh
Thu Oct 30, 2008 9:05 pm UTC
Forum: Coding
Topic: LINQ Problem
Replies: 2
Views: 946

Re: LINQ Problem

You didn't provide an error message, or any indication of what's not working. You can't just paste some code and say "proofread this".
by jimrandomh
Wed Oct 29, 2008 5:05 am UTC
Forum: Coding
Topic: C -how to refer to file type once DIR is open
Replies: 2
Views: 1039

Re: C -how to refer to file type once DIR is open

Go read the readdir() man page. The d_type field is platform specific; it appears in Linux and some BSDs, but it is not specified by POSIX. If you want to determine whether a file is a directory, you need to stat() it.
by jimrandomh
Sat Oct 25, 2008 9:55 pm UTC
Forum: Coding
Topic: (over)Usage of Boost?
Replies: 17
Views: 1779

Re: (over)Usage of Boost?

That's a nifty one; I've generally dealt with that idiom by instantiating the map with nothing in it, creating a class whose sole purpose is to do something in its constructor, and hiding that class behind macros. For example, in my current project, guishell, I handle builtins like this: // In Built...
by jimrandomh
Sat Oct 25, 2008 7:29 pm UTC
Forum: Coding
Topic: (over)Usage of Boost?
Replies: 17
Views: 1779

Re: (over)Usage of Boost?

C++ is unusual in that it has multiple dialects. The important thing is to use a dialect which is a good fit for the project, and to keep it consistent within each project. I've done projects in which I used boost::auto_ptr exclusively, and projects in which all memory management was manual; project...
by jimrandomh
Fri Oct 24, 2008 5:35 pm UTC
Forum: Coding
Topic: Tracking Mouse Speed
Replies: 13
Views: 4938

Re: Tracking Mouse Speed

Recording mouse movement is pretty trivial, but I'm having trouble seeing how that could make for a good experiment. If you're converting instrument data into mouse motion, you'll find that mouse acceleration and the edges of the screen mess you up. If you're giving cues and asking a user to do some...

Go to advanced search