Search found 820 matches

by 0xBADFEED
Sun Jun 06, 2010 3:13 pm UTC
Forum: Coding
Topic: Looking for a scripting language to use with java.
Replies: 4
Views: 1258

Re: Looking for a scripting language to use with java.

I don't know anything about Android development, but what about any of the plethora of the more dynamic languages that can compile to Java bytecode? Jython, JRuby, Groovy, Clojure are probably the top contenders. I have no idea if there are any gotchas trying to deploy these on the Android platform,...
by 0xBADFEED
Mon May 31, 2010 1:37 pm UTC
Forum: Coding
Topic: What did YOU major in?
Replies: 4
Views: 1077

Re: What did YOU major in?

I've been looking at colleges, since in two years I'm going to be there. What I've been wondering is what the hell I should actually take once I get in there. I'm planning on being a software engineer (which as far as I have been able to discern is just a programmer with a few more degrees who make...
by 0xBADFEED
Mon May 31, 2010 1:14 pm UTC
Forum: Coding
Topic: A good environment to play a bit with graphics?
Replies: 12
Views: 1214

Re: A good environment to play a bit with graphics?

I thought GTK and QT where more aimed at GUIs, and less at graphics in general? With an emphasis on standardized buttons etc? Behind every GUI toolkit there's a painting API that's responsible for filling screen rectangles with colors. Qt offers a pretty full-featured 2D drawing API. I believe it a...
by 0xBADFEED
Sat May 29, 2010 5:26 pm UTC
Forum: Coding
Topic: swing checkbox text question
Replies: 2
Views: 530

Re: swing checkbox text question

I doubt it. It's not even clear if the JToggleButton uses a full JLabel or other JComponent for its textual component. I don't see anything after glancing at the docs that would require this to be true. It may just draw the text directly. The cleanest thing is probably be to make a new class that bu...
by 0xBADFEED
Tue May 18, 2010 2:37 pm UTC
Forum: Coding
Topic: Object Oriented Programming... In Java!
Replies: 12
Views: 2562

Re: Object Oriented Programming... In Java!

Read Design Patterns: Elements of Reusable Object-Oriented Software by the Gang of Four. It's a classic, and by far the best explanation of the key ideas behind OOP that I know of. The examples are written in C++ and Smalltalk, but that won't be a problem because it only hinges on the concepts. Don...
by 0xBADFEED
Mon May 17, 2010 10:38 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

given a specific computer, could a program be written which would destroy that computer? FT: Just how many different parts of an average computer can you design a program to physically burn (or for bonus points, light on fire or make explode)? I only know how to do this to the RAM. 0x00000000 : HCF
by 0xBADFEED
Wed May 12, 2010 11:53 pm UTC
Forum: Coding
Topic: C# programming - what is a DLL?
Replies: 19
Views: 2809

Re: C# programming - what is a DLL?

Cleverbeans wrote:Ok so a DLL is not related to C-languages, it's a Microsoft thing?

A DLL file is a Microsoft thing but a dynamically-linked library is much broader concept. Linux (.so files) and pretty much any other operating system you're likely to use also support them.
by 0xBADFEED
Sun May 09, 2010 9:39 pm UTC
Forum: Coding
Topic: Stupid python question...
Replies: 20
Views: 2721

Re: Stupid python question...

Hey, thanks :) Although this gives an error when you have integers in there...it wants strings. Is there a different way to do it without turning the ints into strings? I would have thought you'd just change the %s to %d, but nope. You can convert an int (or really anything) to a string by applying...
by 0xBADFEED
Wed May 05, 2010 11:58 pm UTC
Forum: Religious Wars
Topic: Java vs C/C++
Replies: 88
Views: 23114

Re: Java vs C/C++

TheChewanater wrote:And Java code from that era was any good?

There's a lot less of it and it tends to be easier to work with than C++ code from that era.
by 0xBADFEED
Wed May 05, 2010 2:21 pm UTC
Forum: Religious Wars
Topic: Java vs C/C++
Replies: 88
Views: 23114

Re: Java vs C/C++

If you can plausibly argue that Java is safer than C++, that would be the first real advantage of Java over C++ so far. However, I'm not convinced yet. The argument is again over pointers in C++. It is true that it is possible to use pointers in an unsafe way in C++. However, it is also possible to...
by 0xBADFEED
Tue May 04, 2010 2:31 pm UTC
Forum: Religious Wars
Topic: Java vs C/C++
Replies: 88
Views: 23114

Re: Java vs C/C++

If you agree that I seem to have proper technical knowledge about C++, then you should also agree that I'm likely to be informed on the related technical aspects of Java. What? That's a terrible line of logic and no one should assume that. I have intimate knowledge of both Java and C++, so you can ...
by 0xBADFEED
Mon May 03, 2010 4:45 am UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 785710

Re: Coding: Hacks and Snippets

Right, thanks! Round 2 now: Let's say that in the course of the computations for constructing a 'base', I obtain a value that I then need to use to initialize a member of 'derived'. There is nowhere to store the value (it certainly can't be stored directly into the member of 'derived') so is there ...
by 0xBADFEED
Mon May 03, 2010 4:42 am UTC
Forum: Coding
Topic: Quick QT Question
Replies: 2
Views: 507

Re: Quick QT Question

You have to emit the signals 'beginRemoveRows' and 'endRemoveRows' (or something like that) when deleting rows from your model if you want the view classes to know about changes to the model. Otherwise you'll have to wait until the next redraw event for your changes to show up.
by 0xBADFEED
Sun May 02, 2010 8:54 pm UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 785710

Re: Coding: Hacks and Snippets

Oh wow, that's painfully obvious, but I also oversimplified a bit. It's more like: struct base { base(const string& a, const vector<int>& b, const vector<float>& c); base(); }; But applying your solution yields, similarly: struct derived : base { derived :base(calculateBase()) { } }; <K...
by 0xBADFEED
Sun May 02, 2010 3:19 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

I've been writing my PHP in Python-style for a while now, so it was all right. What pisses me off is the need for a colon when starting any block. I miss adding them almost every single time. >_< The colons become semi-automatic after a while, but I will admit that omitting colons is my main syntax...
by 0xBADFEED
Sat May 01, 2010 7:23 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

Argh, I'm pissed that I never learned Python before. Just took a nice free class for it at work, and am headdesking at how simple it makes so many things. Yeah, it's not perfect but Python is the best "get shit done" language I've found so far (although possibly because I never took to Pe...
by 0xBADFEED
Fri Apr 30, 2010 12:26 am UTC
Forum: Religious Wars
Topic: Java vs C/C++
Replies: 88
Views: 23114

Re: Java vs C/C++

Contrast this with the following compiler error horror scenario, borrowed from Boost: /usr/include/c++/4.1.2/bits/stl_algo.h: In function ‘void std:: __insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<std::complex<float >*, std:...
by 0xBADFEED
Sun Apr 25, 2010 3:46 pm UTC
Forum: Religious Wars
Topic: Java vs C/C++
Replies: 88
Views: 23114

Re: Java vs C/C++

This whole Java-allocation versus C-malloc discussion is a red-herring for the manual memory management vs. GC debate. Memory allocation is completely orthogonal to GC. You could use the exact same allocation/deallocation (grab a big buffer up front and allocate from that) policy in C/C++ (and many ...
by 0xBADFEED
Sat Apr 10, 2010 7:12 pm UTC
Forum: Coding
Topic: Linked List Implementation in C: Type Issues
Replies: 19
Views: 3036

Re: Linked List Implementation in C: Type Issues

Okay. The linux kernel linked list has a struct containing the data and another struct inside the first one holding the pointers to the same type of struct as the second: ... But anyway. If the pointers in list_head are pointers to other list_heads, then how do you iterate through the list and coll...
by 0xBADFEED
Sat Apr 10, 2010 6:08 pm UTC
Forum: Coding
Topic: Linked List Implementation in C: Type Issues
Replies: 19
Views: 3036

Re: Linked List Implementation in C: Type Issues

I think I saw something similar in list.h, but I can't find it now. But now I have another question. If the pointer in list_head points to another list_head, or a variable inside a struct, then how can you read the data inside list? I'm not sure I understand the question. If you're asking how you c...
by 0xBADFEED
Sat Apr 10, 2010 3:54 pm UTC
Forum: Coding
Topic: Linked List Implementation in C: Type Issues
Replies: 19
Views: 3036

Re: Linked List Implementation in C: Type Issues

You could make your linked list definition an X-Macro generalized on the types. So you'd have something like /////////////////////////// llist.def ///////////////////////////// /* Declare LNODE_DATA and LNODE_NAME prior to inclusion */ #define LNODE_ lnode__##LNODE_DATA struct LNODE_ { LNODE_DATA da...
by 0xBADFEED
Sat Apr 10, 2010 3:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

Ugh... They couldn't have thought of more unique names? And what's the point of use (2) anyways? Well, all three cases are doing the same thing, just in different contexts. You're declaring a variable that has static storage at either class, global, or function scope. I think it would be more WTF t...
by 0xBADFEED
Fri Apr 02, 2010 11:03 pm UTC
Forum: Coding
Topic: Linux C++ IDE Recommendations
Replies: 30
Views: 5251

Re: Linux C++ IDE Recommendations

QtCreator is supposed to be good. I haven't used it. For something this small a new IDE you're unfamiliar with will probably complicate your life more than it helps you. Just use a programmer's text editor (Kate, gEdit, Emacs, vim, whatever), the command line, and make files. If you don't already k...
by 0xBADFEED
Sat Mar 27, 2010 5:26 pm UTC
Forum: Coding
Topic: 2D OpenGL Performance Help
Replies: 5
Views: 1452

Re: 2D OpenGL Performance Help

The only drawback to using the z-buffer to control front/back ordering is if you have objects that overlap and have the same z-value you're likely to see some z-fighting. You'll probably have to do some manual z-offsetting to avoid this which, depending on your situation, may degenerate into explici...
by 0xBADFEED
Thu Mar 25, 2010 11:47 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

Oh, object composition is all well and good and rational. Indeed, it's how I write most of my Java code. You don't really give a good reason for class inheritance though. Interfaces gives you polymorphism when you need it, which frankly isn't really that often. I haven't used class-based UI toolkit...
by 0xBADFEED
Thu Mar 25, 2010 1:44 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

Indeed, but that really means you have to a) decide up front where you're using the classes ... The first destroys composability entirely ... The first case is really the only case inheritance is useful, and it ultimately means that to understand a class you also need to understand everywhere it's ...
by 0xBADFEED
Wed Mar 24, 2010 3:10 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2031461

Re: Coding: Fleeting Thoughts

All in all, it wasn't really that big of a bug either. It was elusive, sure, but the cause was eventually rather trivial, the consequences less critical and the fix easier to implement than several other bugs I've seen. Much of the cause and complications were caused by a relatively inane mistake t...
by 0xBADFEED
Wed Mar 17, 2010 7:01 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8273

Re: Is C++ Getting Phased Out?

It was my understanding that the Comeau compiler generates C code from C++ source. If this is true (I've never used it, I may be wrong) then I mean there's really no barrier to using C++ wherever a reasonable C compiler exists. Whether C++ is appropriate for a given platform is completely orthogona...
by 0xBADFEED
Wed Mar 17, 2010 2:42 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8273

Re: Is C++ Getting Phased Out?

It was my understanding that the Comeau compiler generates C code from C++ source. If this is true (I've never used it, I may be wrong) then I mean there's really no barrier to using C++ wherever a reasonable C compiler exists. Whether C++ is appropriate for a given platform is completely orthogonal...
by 0xBADFEED
Mon Mar 15, 2010 11:53 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8273

Re: Is C++ Getting Phased Out?

Speaking of C++ and qt, when they say the creators "modified the C++" language, what exactly do they mean? They added "signals" and "slots" to the standard public/private/protected access specifiers of classes. When you run their special preprocessor over classes using...
by 0xBADFEED
Mon Mar 15, 2010 7:02 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8273

Re: Is C++ Getting Phased Out?

lulzfish wrote:In Qt, I can design a whole form before writing code, and I don't have to use Mono.
Now granted, I've had SHIT luck porting my Qt programs to Windows since I'm not sure what the Qt Runtime requires, but they run fantastically in Linux.

Qt runs great in Windows too.
by 0xBADFEED
Mon Mar 15, 2010 2:07 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8273

Re: Is C++ Getting Phased Out?

I personally use C# for almost everything I do on the computer. It runs on every platform, and has a quick development cycle. How many of you C++ programmers dread GUI? .... Here's creating a ui button in Qt QPushButton* btn = new QPushButton("Hello World",this); connect(btn, SIGNAL(click...
by 0xBADFEED
Mon Mar 15, 2010 4:52 am UTC
Forum: Coding
Topic: Plotting Trouble (Python)
Replies: 5
Views: 972

Re: Plotting Trouble (Python)

Krikkit_Robot wrote:What can I do about that?

From the looks of it you could probably just remove the call to run() from rk4()
by 0xBADFEED
Mon Mar 15, 2010 3:15 am UTC
Forum: Coding
Topic: Plotting Trouble (Python)
Replies: 5
Views: 972

Re: Plotting Trouble (Python)

I only took a cursory look at your code, but rk4() calls run() and run() calls rk4() my guess is stack overflow, i.e. your recursion is too deeply nested. Use a strictly iterative solution.
by 0xBADFEED
Sun Mar 14, 2010 12:36 am UTC
Forum: Coding
Topic: Overload ofstream and ostream?
Replies: 10
Views: 3086

Re: Overload ofstream and ostream?

ISTM that this might be a good use of templates: template <class T> friend T & operator<<(T & ostr, const employee & e); That's what I usually do to avoid worrying about remembering the names of any classes. Is there some down side to this way? That still doesn't address the problem in ...
by 0xBADFEED
Sat Mar 13, 2010 3:08 pm UTC
Forum: Coding
Topic: Overload ofstream and ostream?
Replies: 10
Views: 3086

Re: Overload ofstream and ostream?

I guess the real question is why you think you need to distinguish between the two. If you're writing to a stream you shouldn't care where the stream is going. That's the whole point of streams. I also expect this distinction to bite you in subtle, horrible ways. Consider: void foo(std::ofstream&...
by 0xBADFEED
Sat Mar 13, 2010 2:46 pm UTC
Forum: Computer Science
Topic: What would you do with an infinitely fast computer?
Replies: 818
Views: 228276

Re: What would you do with an infinitely fast computer?

Eh. I mean, I guess if you somehow have an countably infinite storage space and processor power, it's possible, but I still say it makes more sense to interpret it as completing any finite operation instantly. What about considering a computer where each operation takes half the time of the operati...
by 0xBADFEED
Thu Mar 11, 2010 3:34 pm UTC
Forum: Computer Science
Topic: "Computer science" warning symbol.
Replies: 31
Views: 6544

Re: "Computer science" warning symbol.

"Warning: Self-referential sign ahead"
by 0xBADFEED
Sun Mar 07, 2010 3:16 pm UTC
Forum: Computer Science
Topic: What would you do with an infinitely fast computer?
Replies: 818
Views: 228276

Re: What would you do with an infinitely fast computer?

False. They are much faster and make less mistakes, but much stupider. Computers do only exactly what we tell them to do and can't detect that there is an error in what we are doing (unless we tell it what errors to look for). Any mistakes that we put into programming, they make, if they can make i...

Go to advanced search