Search found 106 matches

by Karrion
Sun Jan 05, 2014 2:27 am UTC
Forum: Coding
Topic: Request for input/assistance on project concept
Replies: 2
Views: 2790

Re: Request for input/assistance on project concept

For detecting media insertion, you can recieve DBUS signals from the freedesktop HAL subsystem (which should be available even on headless setups I think); here's some test code I wrote (some years ago, so YMMV) that just dumps the kind of event information you can get to standard out: /* * eg see h...
by Karrion
Tue Oct 19, 2010 5:09 am UTC
Forum: Coding
Topic: Class implementation? (C++)
Replies: 3
Views: 898

Re: Class implementation? (C++)

Well, you can't use the value of a variable as a variable name itself, because the value won't be known at compile time. (Also, you can't name a variable "1", "2", etc because a variable can't start with a numeral). And in any case, creating a large number of separate variables s...
by Karrion
Mon Jul 05, 2010 12:22 pm UTC
Forum: Movies and TV Shows
Topic: The Extraordinary Adventures of Adèle Blanc-Sec
Replies: 3
Views: 1907

Re: The Extraordinary Adventures of Adèle Blanc-Sec

Zohar wrote:All you need to know about this movie


I need to know one more thing: A date for its release with English subtitles.
by Karrion
Mon Mar 01, 2010 2:10 am UTC
Forum: Coding
Topic: Shared Libraries / DLL's... wuuuuuuuuuuuuuuuuuut?
Replies: 9
Views: 1303

Re: Shared Libraries / DLL's... wuuuuuuuuuuuuuuuuuut?

Import library, that's a static library that is produced with a DLL right? When you compile some code as a shared library two files are produced, the shared library (.dll/.so) and the import library (.lib/.a). The shared library contains the actual functional code. The import library just contains ...
by Karrion
Wed Jan 20, 2010 5:47 am UTC
Forum: Coding
Topic: Is there any real-world use for Objective C?
Replies: 18
Views: 2304

Re: Is there any real-world use for Objective C?

Objective C is heavily used for Mac, and especially iPhone/iPod development, so it's a fairly big niche.
by Karrion
Tue Oct 20, 2009 3:03 am UTC
Forum: Movies and TV Shows
Topic: Stairgate: Universe
Replies: 763
Views: 68159

Re: Stargate: Universe

SG-1 season 9: Vala was burned to death while using one and didn't get put back in her own body Then how did she make it out of that again? I forgot. A Prior resurrected her. IIRC, it was on the somewhat flimsy premise of wanting to question her and Daniel about other dissidents in the village ...
by Karrion
Mon Oct 19, 2009 11:45 pm UTC
Forum: Movies and TV Shows
Topic: Stairgate: Universe
Replies: 763
Views: 68159

Re: Stargate: Universe

Sockmonkey wrote:Don't they switch back if one of the users is killed or am I remembering wrong?

SG-1 season 9:
Spoiler:
Vala was burned to death while using one and didn't get put back in her own body
by Karrion
Fri Oct 09, 2009 4:39 am UTC
Forum: Coding
Topic: Will i really cry after learning how to use the debugger?
Replies: 16
Views: 1633

Re: Will i really cry after learning how to use the debugger?

Eclipse CDT (at least on unix, not entirely sure about on windows) has an integrated frontend for gdb. It's not quite as smooth as the JDT debugger but it behaves in essentially the same way.
by Karrion
Thu Sep 03, 2009 6:03 am UTC
Forum: Coding
Topic: gcc and linking external libraries
Replies: 15
Views: 3693

Re: gcc and linking external libraries

How do I determine which are the automagically linked libraries (like stdio.h) and which aren't (like math.h)? Be careful not to confuse two different concepts here. stdio.h and math.h are header files which provide declarations of functions (etc). Libraries (which you specify at link time) provide...
by Karrion
Mon Mar 30, 2009 3:00 am UTC
Forum: Coding
Topic: Copying between DOM documents
Replies: 4
Views: 616

Re: Copying between DOM documents

Does PHP's DOM Document not implement the standard importNode method?
by Karrion
Sun Mar 29, 2009 11:08 am UTC
Forum: Movies and TV Shows
Topic: Robot Movie Marathon
Replies: 18
Views: 1595

Re: Robot Movie Marathon

Metropolis
Westworld
And if you want something really, really, terrible, Robot Monster
by Karrion
Sun Mar 08, 2009 11:48 am UTC
Forum: Coding
Topic: sleep, SIGINT, ctrl c, etc.
Replies: 13
Views: 1603

Re: sleep, SIGINT, ctrl c, etc.

Apparently despite its name, SIGQUIT does not actually cause the application to quit. The default behaviour on SIGQUIT is to terminate the process. However, you've associated your own signal handler with it, thus replacing the default behaviour. So if you still want the process to terminate, your h...
by Karrion
Sun Mar 01, 2009 5:45 am UTC
Forum: Coding
Topic: Font size vs. Pixel Size
Replies: 19
Views: 5106

Re: Font size vs. Pixel Size

But currently computers don't have a way to query the actual physical size of the monitor Actually they do; the EDID of the monitor contains the physical size of the screen. On linux for example you can see it by running xdpyinfo: dimensions: 1680x1050 pixels (474x303 millimeters) resolution: 90x88...
by Karrion
Fri Feb 27, 2009 12:40 pm UTC
Forum: Coding
Topic: Multiple inheritance gives "ambigous resolution" error (C++)
Replies: 23
Views: 1072

Re: Multiple inheritance gives "ambigous resolution" error (BASI

Both std::iterator and std::reverse_iterator define an operator*; because your class extends both of those, the compiler can't determine which implementation you want your class to inherit.
by Karrion
Wed Feb 25, 2009 11:50 pm UTC
Forum: Coding
Topic: Can comments affect performance?
Replies: 19
Views: 3169

Re: Can comments affect performance?

The only instance I can think of where comments are actually interpreted by the compiler (to an extent) are javadocs, and those aren't even looked at during a normal compile routine. Javadocs aren't the only comments interacted with by external tools. Java does actually have a special case where th...
by Karrion
Fri Feb 20, 2009 4:52 am UTC
Forum: Coding
Topic: Compiling a GTK app on Windows
Replies: 5
Views: 1388

Re: Compiling a GTK app on Windows

See http://www.gtk.org/download-windows.html for binaries and source for windows versions of GTK+ and its dependencies.
by Karrion
Wed Feb 18, 2009 2:05 am UTC
Forum: Coding
Topic: Memory management(array of char arrays)
Replies: 12
Views: 1441

Re: Memory management(array of char arrays)

Unfortunately, reserving space is complicated, as I do not know in advance how long the names or urls will be. I realize I could declare my "strings" as arrays rather than pointers, but I'm looking to make a very efficient program. Reserving extra space isn't what I'm looking for. Normall...
by Karrion
Wed Jan 21, 2009 12:10 am UTC
Forum: Coding
Topic: switch statements in Java run in O(n) time for n cases.
Replies: 35
Views: 8367

Re: switch statements in Java run in O(n) time for n cases.

As a baseline, I think that it'd be useful to do the same thing in C, and see what the graph looks like there. We've all said that "of course it's O(1) in C" but nobody's actually gone and proved that. Repeating my experiment in C: Results: results.png f( x ) = -0.0000445411 x + 7...
by Karrion
Tue Jan 20, 2009 9:30 pm UTC
Forum: Coding
Topic: switch statements in Java run in O(n) time for n cases.
Replies: 35
Views: 8367

Re: switch statements in Java run in O(n) time for n cases.

My results: X axis is number of branches in the switch Y axis is the wall time in milliseconds to randomly switch 100000 times. results.png f( x ) = 0.00649424 x + 130.33 Observations: Since we're measuring wall time, execution time can be affected by other activity in the system. This is li...
by Karrion
Mon Dec 29, 2008 1:03 am UTC
Forum: Coding
Topic: A question on my Midterm
Replies: 21
Views: 1732

Re: A question on my Midterm

Nitpick, but:
0xBADFEED wrote:It just so happens that UTF-16 codepoints 0-127 contain the latin-alphabet characters.


Specifically, unicode codepoints 0-127 are the same as ASCII, which is what makes UTF-8 such a nice encoding.
by Karrion
Sat Nov 29, 2008 12:13 am UTC
Forum: Coding
Topic: OBJ-C/Cocoa: Programming for OS X
Replies: 19
Views: 2875

Re: OBJ-C/Cocoa: Programming for OS X

kovan wrote:Oh, the only way of parsing XML on the iPhone is by using their idiotic SAX-style event-driven bullshit.


You can apparently use libxml2 on the iPhone
by Karrion
Thu Nov 13, 2008 10:00 am UTC
Forum: Coding
Topic: OBJ-C/Cocoa: Programming for OS X
Replies: 19
Views: 2875

Re: OBJ-C/Cocoa: Programming for OS X

I know nothing of Cocoa, so I'm not sure if it's good for a beginner, but a friend of mine writes Cocoa With Love. (/shamelessplug)
by Karrion
Tue Aug 05, 2008 9:41 pm UTC
Forum: Coding
Topic: Problems with Galleria and Jquery
Replies: 5
Views: 1775

Re: Problems with Galleria and Jquery

Hmm... thinking about it some more I'm not sure if the element will exist in the DOM when that line gets executed. You might be able to move the <script> down below the </ul>, but really it should probably go inside a document ready handler, i.e.: <head> <title>...</title> <script type="text/ja...
by Karrion
Tue Aug 05, 2008 8:41 am UTC
Forum: Coding
Topic: Problems with Galleria and Jquery
Replies: 5
Views: 1775

Re: Problems with Galleria and Jquery

I don't see anywhere that you actually execute the galleria function... assuming it's not in one of the include files, you need a <script> block after the <ul> with the line

Code: Select all

$('ul.gallery').galleria();
by Karrion
Fri May 16, 2008 6:49 am UTC
Forum: Coding
Topic: Multithreading: Coordinating multiple steps
Replies: 2
Views: 1104

Re: Multithreading: Coordinating multiple steps

Berengal wrote:I'll need something to keep track of the threads, to know when they're all finished and can move on to the next phase.


Sounds like you want a Barrier
by Karrion
Thu Mar 20, 2008 3:45 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9871
Views: 1782736

Re: Sandwich

I got bored... decided to code http://xkcd.org/149/ in a few languages: 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?) Linux does not prevent you from changing the username on [the root] account, ...
by Karrion
Sat Mar 01, 2008 9:19 am UTC
Forum: Coding
Topic: Some regular-expressions-foo
Replies: 3
Views: 1195

Re: Some regular-expressions-foo

If you control the source of the program generating the output, you could add a command line option to suppress the output, or detect whether the output is a terminal with isatty() (on a posix system). Otherwise you could try some combination of the head and tail commands to give you the lines you n...
by Karrion
Fri Feb 29, 2008 4:26 am UTC
Forum: Coding
Topic: Worst (Best?) Hacks
Replies: 50
Views: 7405

Re: Worst (Best?) Hacks

There's a bunch of 16-bit fields in the class file format, which limits the size of various things. In particular a method can't be more than 64KB of bytecode, more than 64K local variables, or more than 64KB in the UTF-8 encoding of its name; a class can't have more than 64K fields, methods, consta...
by Karrion
Wed Feb 20, 2008 1:59 pm UTC
Forum: Science
Topic: Only a Theory
Replies: 39
Views: 5915

Re: Only a Theory

Evolution is not a law of the universe Actually it really is. Anytime you have self replicating entities, where the copying process occasionally makes changes*, and an environment that can change, you're going to get evolution. In addition to people not understanding the word 'theory', a lot also m...
by Karrion
Mon Feb 04, 2008 7:42 am UTC
Forum: Religious Wars
Topic: Homework help! -- ideas for and against typeless languages
Replies: 9
Views: 3852

Re: Homework help! -- ideas for and against typeless languages

To answer the OP's second question, yes. So in a 'typeless' or 'weakly typed' or 'dynamically typed' (take your pick of terminology), you can do something like: $foo = 1; $foo = "foo"; $foo = new Object("bar", 3); By contrast, in a strongly typed language, that would be an error,...
by Karrion
Thu Jan 31, 2008 10:48 pm UTC
Forum: Coding
Topic: Braindead Code
Replies: 98
Views: 9611

Re: Braindead Code

I would say that if it's a standard abbreviation in the world, in programming, or in the project you're working on, you can (and sometimes should) abbreviate. If it's something that you're writing the function and are like "how can I abbreviate this", then no, you shouldn't. Agreed - I sl...
by Karrion
Thu Jan 24, 2008 3:41 am UTC
Forum: Science
Topic: How do you discuss science with a non-scientist?
Replies: 61
Views: 5440

Re: How do you discuss science with a non-scientist?

I'm pretty sure all his points have been made, and debunked, hundreds of times before . I suspect that any rebuttals will be lost on him, however, since he sounds like he's so invested (or indoctrinated) in his beliefs that rational argument may not even be possible. But in brief: 1) When scientists...
by Karrion
Tue Jan 22, 2008 4:25 am UTC
Forum: Movies and TV Shows
Topic: Give me Vampires!
Replies: 34
Views: 4200

Re: Give me Vampires!

Cronos is a somewhat unusual vampire film...
by Karrion
Fri Jan 18, 2008 5:05 am UTC
Forum: Religious Wars
Topic: Pet Peeves
Replies: 234
Views: 39025

Re: Pet Peeves

enk wrote:Anyways, why not use locate instead?


Because locate relies on your locate database being up to date; if you need to find a file in a big source tree you've just unpacked, it's not going to help you.
by Karrion
Fri Jan 18, 2008 4:09 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 516173

Re: The "IT DOESN'T WORK!" thread

I've never heard of closing a file to throw an exception, but it never hurts to be thorough. public abstract void close() throws IOException You definitely need to have Reader.close() inside the try{} block to avoid a compiler error. Although in practise I don't think a FileReader can throw an exce...
by Karrion
Fri Jan 18, 2008 12:20 am UTC
Forum: Movies and TV Shows
Topic: The Sarah Connor Chronicles (Now with spoilers!)
Replies: 341
Views: 36715

Re: The Sarah Connor Chronicles (Now with spoilers!)

My girlfriend has a theory about her origin, and she's usually right about this sort of thing: (hypothetical major arc spoiler): Cameron's organic components are cloned from Sarah, and possibly thought patterns etc are based on Sarah as well. I doubt this - Cameron is from a future in which Sar...
by Karrion
Thu Jan 17, 2008 8:10 pm UTC
Forum: Movies and TV Shows
Topic: Things you remember watching but can't remember the name of
Replies: 756
Views: 253862

Re: Things you remember watching but can't remember the name of

I remember watching a movie with: A man created by a computer Convicts are sent into a Matrix like world to fight AI. The Guy created from the computer breaks out and wreaks havoc and can only heal him self with glass. One of the convicts stops him. Something like that. If by 'convicts' you mean 'c...
by Karrion
Thu Jan 17, 2008 1:06 am UTC
Forum: Coding
Topic: How many programming languages do you know?
Replies: 119
Views: 32954

Re: How many programming languages do you know?

Several people wrote:SQL


I'm not sure we can count SQL as a programming language. It's a query language, it says so right in the name.

PL/SQL is a programming language though.
by Karrion
Thu Jan 17, 2008 12:59 am UTC
Forum: Movies and TV Shows
Topic: The Sarah Connor Chronicles (Now with spoilers!)
Replies: 341
Views: 36715

Re: The Sarah Connor Chronicles (Now with spoilers!)

Also, is there an explanation for how this is being produced during the writer's strike? It's not. What we're seeing now was filmed ~6-9 months ago. I'm not sure exactly how many they have in the can, but production of further episodes is halted pending the studios getting off their arse and paying...
by Karrion
Wed Jan 16, 2008 3:38 am UTC
Forum: Coding
Topic: How many programming languages do you know?
Replies: 119
Views: 32954

Re: How many programming languages do you know?

Programming/scripting languages I use or have used regularly at some point in my career:

Java
C
C++
Perl
Bash script
Python
PHP
Javascript/ecmascript
Lua
Basic/Visual Basic
Pascal/Object Pascal/Modula-2

Go to advanced search