Search found 820 matches

by 0xBADFEED
Wed Mar 23, 2011 3:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

Javascript is beautiful and awesome. It's such a shame it suffers from Very poor documentation. Very outdated documentation. Terrible debugging capabilities. I don't understand why this isn't a stand-alone language. If you clean out all the DOM gunk and give it access to some system calls, it could...
by 0xBADFEED
Sat Feb 26, 2011 7:20 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

Yes. It would be consistent with the closure behavior, if nothing else. It would also be consistent with other languages that use default parameters, like C++, where if you have "foo(param = expression)", the expression is evaluated each time the function is called without that parameter....
by 0xBADFEED
Sun Jan 16, 2011 6:11 pm UTC
Forum: Computer Science
Topic: Optimizing spacing of mesh containing a given set of points
Replies: 6
Views: 2179

Re: Optimizing spacing of mesh containing a given set of poi

I'm not sure you've fully specified the problem. It sounds like what you really want to do is maximize the spacing between points while minimizing the spacing variance. Is this correct? What I mean is consider the case of, N = 10 knowns = [4.5, 5.5] min = 0, max = 10 In this case, the way you've spe...
by 0xBADFEED
Sat Jan 15, 2011 7:43 pm UTC
Forum: Coding
Topic: try catch finally
Replies: 18
Views: 4039

Re: try catch finally

To echo some of what phlip said you use finally blocks when you want to run some code regardless of whether or not an error occurs. Specifically, code in a finally block is guaranteed to execute no matter how the try block exits. Typically that means you put code that deals with releasing resources ...
by 0xBADFEED
Thu Dec 16, 2010 3:29 pm UTC
Forum: Coding
Topic: Does anyone like the way Swing programs look?
Replies: 9
Views: 1766

Re: Does anyone like the way Swing programs look?

I don't like it, and there is virtually no excuse for making a swing UI. If you need a cross platform swing-style GUI that also conforms to the operating system's appearance, make it web-based. There are tons of reasons that a Swing UI might be justified. Sure there are better looking cross-platfor...
by 0xBADFEED
Thu Nov 18, 2010 3:42 am UTC
Forum: Coding
Topic: Java Swing UI - textfield bloat
Replies: 15
Views: 2105

Re: Java Swing UI - textfield bloat

If you're going to be using Swing to make UI's you should really invest some time in learning GroupLayout (provided you can use Java 1.6). It basically subsumes all other layouts and makes them largely unnecessary.
by 0xBADFEED
Mon Nov 15, 2010 3:06 pm UTC
Forum: Coding
Topic: Java Swing UI - textfield bloat
Replies: 15
Views: 2105

Re: Java Swing UI - textfield bloat

my advice would be to use a proper ui toolkit. if you have to use java, i would recommend qtjambi. Swing is as capable a ui toolkit as any other. What exactly, pray tell, makes Swing not a "proper" ui toolkit? It may not look so great (by default, customization can have it looking fairly ...
by 0xBADFEED
Mon Nov 08, 2010 2:40 pm UTC
Forum: Coding
Topic: End Program in Python
Replies: 23
Views: 17918

Re: End Program in Python

I wouldn't be too happy with this. Now you have to make explicit rules about what parts of the game are allowed to throw GameOver and SystemExit, and inevitably someone is going to abuse those rules. Much better if subroutines are always expected to give control back to their calling routine (actua...
by 0xBADFEED
Mon Nov 08, 2010 1:46 pm UTC
Forum: Coding
Topic: End Program in Python
Replies: 23
Views: 17918

Re: End Program in Python

sys.exit or throw are also options, but not ideal... sys.exit will quit the program entirely (so you it would be hard to add, say, a "do you want to play again?" prompt at the end), whereas exceptions should only be used for actual errors, not stuff that happens normally during the game (...
by 0xBADFEED
Sat Oct 23, 2010 3:36 pm UTC
Forum: Coding
Topic: Coding Careers and the path to get there
Replies: 17
Views: 2425

Re: Coding Careers and the path to get there

I've also been told that computer science as a major is not actually that helpful towards getting employment. What are the requisites for some person coming out of high school or college to get into a coding position? A CS degree is the standard/traditional educational entry-token to the software i...
by 0xBADFEED
Sat Sep 11, 2010 4:26 pm UTC
Forum: Coding
Topic: coworker rants
Replies: 92
Views: 13961

Re: coworker rants

Pesto wrote:I'm working on getting up to speed on git-svn so we won't have this merging headache in the future.

Git-svn can have it's own merging headaches if someone forgets to play by git-svn's rules. It's better but doesn't completely solve the branching/merging headaches with SVN.
by 0xBADFEED
Fri Sep 03, 2010 1:02 am UTC
Forum: Coding
Topic: The C Killer
Replies: 62
Views: 9714

Re: The C Killer

squareroot wrote:...there's a standard Java style guide?

http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
by 0xBADFEED
Thu Sep 02, 2010 2:21 pm UTC
Forum: Coding
Topic: The C Killer
Replies: 62
Views: 9714

Re: The C Killer

What's wrong with a pretty-printer? Having multiple styles in a language is a bad thing. Having a definitive style to point to as the "official" style is a great thing, because it means that everyone formats their code the same way. Definitely. And it's something you have to specify at th...
by 0xBADFEED
Sun Aug 29, 2010 2:35 pm UTC
Forum: Coding
Topic: Lua: Detect intersection between 2D rotated lines/rectangles
Replies: 10
Views: 4279

Re: Lua: Detect intersection between 2D rotated lines/rectan

I've done a lot of 2D geometry programming. It's something that's deceptively hard. It's very easy to miss special cases and come up with non-robust solutions that fail in unexpected ways. This is doubly true if you don't have a decent understanding of linear algebra and plane geometry. You might wa...
by 0xBADFEED
Thu Aug 19, 2010 3:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

Would the hotkey be more convenient/safe? I think it is F6. I use the hotkeys, but sometimes I'm already at my mouse and it's more convenient to use the context menu. And sometimes I want an incremental build of a specific project, without building any other higher-level projects and it's easier to...
by 0xBADFEED
Thu Aug 19, 2010 2:50 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

VS is the greatest IDE on the planet... End of story. Why oh why did they put the "Rebuild" right next to "Build" in the C++ project context menu? Thanks VS I really wanted a 20 minute full rebuild when a 10-second incremental build would have been fine, because my pointer was o...
by 0xBADFEED
Thu Aug 19, 2010 2:24 pm UTC
Forum: Coding
Topic: XML - which is better?
Replies: 2
Views: 939

Re: XML - which is better?

Barring the typo, the second version is probably the most idiomatic as far as XML is concerned, and probably the best choice. As thedufer points out it's an incredibly bad idea to just create arbitrary tags at runtime. It makes it virtually impossible to write a schema (which you'll thank yourself f...
by 0xBADFEED
Sun Aug 01, 2010 4:38 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

So I was compressing some 500 mb large postscript files down to about 1.5mb using winrar, which was all well and good except those large files were just intermediary files that I didn't want to store on a harddrive. ... For this to happen though I need to figure out a way to make it compress better...
by 0xBADFEED
Sat Jul 31, 2010 6:52 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

My main point with unicode was that it, if anything, canonically says what is in a string and it has a code point for 0. What happens with various encodings wasn't even on my mind. (Incidentally, I think you can put any unicode character except 0 into a utf8-encoded, null-terminated string. Most la...
by 0xBADFEED
Sat Jul 31, 2010 6:40 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

If it has a \0, it's not a string, but some sort of binary array. Most languages, unicode and I would disagree with you. You can put Unicode in an NTBS just fine... provided you use UTF-8. You can't put UTF-16 or UTF-32 in an NTBS and expect it to play nicely since many code-point encodings will co...
by 0xBADFEED
Sat Jul 31, 2010 4:57 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

Well, I don't know how C# does things, but I'd have thought signaling end-of-string with \0 was the convention. It's a C convention. Prepending the string with its length is an earlier convention. It was fairly standard in BASIC, and Pascal. Sure, you'd expect C# to follow C conventions, but you ou...
by 0xBADFEED
Sun Jul 18, 2010 12:03 am UTC
Forum: Coding
Topic: Simple python raise statement question
Replies: 7
Views: 3409

Re: Simple python raise statement question

That's just as bad. You want to use isinstance(x, str) ... Except that doesn't do the same thing at all. I was just trying to show the appropriate way to test equivalence between types (and preserve the semantics of his code). Whether he really wants equivalence or not is a separate matter and deba...
by 0xBADFEED
Sat Jul 17, 2010 5:57 pm UTC
Forum: Coding
Topic: Simple python raise statement question
Replies: 7
Views: 3409

Re: Simple python raise statement question

To check for type equivalence relations don't do this: str(type(x)) == "<type 'str'>" Do this: type(x) is str type(x) is not str type(x) is int etc.... I want the traceback to point to the user code as the last issue, not the module raise statement! How do I eliminate that? No you don't. I...
by 0xBADFEED
Fri Jul 16, 2010 11:39 pm UTC
Forum: Coding
Topic: The eternal XML argument: attribute vs. element
Replies: 13
Views: 2794

Re: The eternal XML argument: attribute vs. element

Anything that's a simple data-type (string, number, enum, etc.) I map to an attribute. Anything else is an element. The up-shot is that writing a reader for the format tends to be a lot simpler as attribute API's tend to be a lot easier to work with than the raw text-nodes of elements. The pseudo-do...
by 0xBADFEED
Thu Jul 15, 2010 11:46 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

I don't suppose anyone happens to know if there's a way to pass a member function pointer that takes 2 or more arguments? Isn't really important but I done the following which works only 1 argument, but can't find any one that would take an arbitrary number of arguments: std::bind1st(std::mem_fun(&...
by 0xBADFEED
Sun Jul 11, 2010 4:54 pm UTC
Forum: Coding
Topic: Independent Study Topic?
Replies: 21
Views: 3222

Re: Independent Study Topic?

I wouldn't write-off OpenGL just yet. Out of all the things you've listed OpenGL is probably the most useful. Even if you never use OpenGL ever again the concepts you learn concerning graphics programming will be transferable to pretty much any high-performance graphics system. You'd be amazed at ho...
by 0xBADFEED
Sun Jul 11, 2010 3:32 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9955
Views: 1934318

Re: Coding: Fleeting Thoughts

It was only 10 minutes thinking about a game premise. 3 hours later, I'm still going through the PNG specification so I can write a PNG reading/writing library, which I'll then use to write out the results of procedural map generation, which I may then get around to working into some kind of game. ...
by 0xBADFEED
Mon Jul 05, 2010 1:29 pm UTC
Forum: Coding
Topic: Emacs not supporting python?
Replies: 10
Views: 1779

Re: Emacs not supporting python?

The easiest and most typical solution would probably be to just add the python directory to your Windows search path.
by 0xBADFEED
Wed Jun 30, 2010 11:24 pm UTC
Forum: Religious Wars
Topic: Comic Sans
Replies: 57
Views: 22246

Re: Comic Sans

You, sir, name? wrote:
flying sheep wrote:firefox uses ligatures automatically.

Firefox has support for kerning and ligatures, but uses them quite sparsely by default.

Ah OK. I didn't know it had ligature support.
by 0xBADFEED
Wed Jun 30, 2010 2:04 pm UTC
Forum: Religious Wars
Topic: Comic Sans
Replies: 57
Views: 22246

Re: Comic Sans

It seems to mostly boil down to typesetting though. Text in webbrowsers, and most GUI widgets appear to be typeset by howler monkeys, while say LaTeX is fully capable of generating quite readable seriffed text. To really get decent looking serifed fonts you also need to do things like replace "...
by 0xBADFEED
Tue Jun 29, 2010 2:45 pm UTC
Forum: Religious Wars
Topic: Can a machine be conscious?
Replies: 162
Views: 29384

Re: Can a machine be conscious?

You've misread me. I wasn't just talking about survival against Darwinian natural selection. I wasn't suggesting that you were. I was talking about survival against an arbitrary selection process. In this case "survival" means beating the "selection process". In the case of livi...
by 0xBADFEED
Mon Jun 28, 2010 2:57 pm UTC
Forum: Religious Wars
Topic: Can a machine be conscious?
Replies: 162
Views: 29384

Re: Can a machine be conscious?

Ok, well, if you want to define consciousness that way then I'll agree to change my terminology to suit. But the most important point (the one which directly relates to the thread) still stands - consciousness is no more than a very complex computational process aimed at enhancing fitness. In this ...
by 0xBADFEED
Sat Jun 26, 2010 4:16 pm UTC
Forum: Religious Wars
Topic: Can a machine be conscious?
Replies: 162
Views: 29384

Re: Can a machine be conscious?

Your definition of consciousness is fine for day to day conversation but it won't work for science or philosophy because it's circular. "Things are conscious if they act like things that are conscious". I think my conclusion only seems silly because you're still holding onto an incorrect ...
by 0xBADFEED
Wed Jun 23, 2010 12:13 am UTC
Forum: Religious Wars
Topic: Can a machine be conscious?
Replies: 162
Views: 29384

Re: Can a machine be conscious?

I disagree about 70%, and I hope you're still kicking around in this thread because its something I'd really like to discuss. I think you may have mentioned at some later point that higher mammals have a degree of consciousness? If I'm wrong I apologise. Yes, I think consciousness exists on a spect...
by 0xBADFEED
Mon Jun 21, 2010 2:07 pm UTC
Forum: Computer Science
Topic: Encyclopedia of Algorithms?
Replies: 4
Views: 1402

Re: Encyclopedia of Algorithms?

I've found the Dictionary of Algorithms and Datastructures to be occasionally useful.
by 0xBADFEED
Tue Jun 15, 2010 1:05 pm UTC
Forum: Coding
Topic: What is good code?
Replies: 38
Views: 6675

Re: What is good code?

Formal verification (currently) quickly spirals out of reach in almost any non-trivial piece of software. are operating systems non-trivial? according to wikipedia, two operating systems were formally verified as of 2009. Operating systems are not trivial. But: seL4 is a third-generation microkerne...
by 0xBADFEED
Mon Jun 14, 2010 2:05 pm UTC
Forum: Coding
Topic: What is good code?
Replies: 38
Views: 6675

Re: What is good code?

Formally verifiable code is good code, and can be recognized as such in the obvious manner. The rest of code is bad, not bad like Hitler but bad like adding the cheese powder to Kraft Dinner before draining the water you cooked the noodles in. What? Formal verification (currently) quickly spirals o...
by 0xBADFEED
Mon Jun 14, 2010 1:23 pm UTC
Forum: Coding
Topic: Ordering a list in python
Replies: 5
Views: 1092

Re: Ordering a list in python

I think your method seems fine, it's straight-forward and easy to follow. You could do something like: max = 16 g = [] for x in range(max / 2): a, b = x, max - x - 1 g += [b,a] if x % 2 == 0 else [a,b] print g It's less code but the guts are the same, I've just removed the unnecessary counters and c...
by 0xBADFEED
Sun Jun 13, 2010 4:29 am UTC
Forum: Coding
Topic: Sum of the digits in a number (python)
Replies: 40
Views: 16803

Re: Sum of the digits in a number (python)

Or as an alternative to Pomegranete's scheme is to use map and list rather than a generator. sum(map(int,list(str(n)))) I call this Pilate style, for obvious reasons. Well, obvious to me and Biggus Dickus anyway. There's no reason to convert the string to to a list. A Python string is already a seq...
by 0xBADFEED
Sat Jun 12, 2010 3:13 pm UTC
Forum: Coding
Topic: Shared library linking - undefined symbol
Replies: 10
Views: 2526

Re: Shared library linking - undefined symbol

I have't done any coding that involves making shared libraries for many years, and that was on the Amiga, so feel free to ignore me, but I suspect that you have some kind of name-mangling issue. It seems like everything is being declared with C-linkage correctly and the symbols do not appear to be ...

Go to advanced search