Search found 497 matches

by korona
Mon Nov 24, 2014 3:33 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

OpenGL / Direct3D generally don't require that much boilerplate (maybe ~50 lines) if you just want to render simple things. Those APIs do not distinguish between 2D and 3D nowadays as there is no fixed-function pipeline anymore. They offer the greatest level of control and are thus the fastest optio...
by korona
Thu Nov 20, 2014 4:08 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I just tried to develop a C++ app on Windows. I wanted to use SDL + OpenGL + Chrome Embedded Framework (CFE) to render a nice HTML UI in front of some 3D image. ⋅ SDL has a "#define main SDL_main". Wtf? ⋅ Windows cannot link (static?) libraries linked with /MT (link lib...
by korona
Tue Nov 18, 2014 5:48 pm UTC
Forum: Coding
Topic: intercepting and modifying peripheral driver outputs?
Replies: 1
Views: 2616

Re: intercepting and modifying peripheral driver outputs?

This should be possible but it is not easy; it probably means that you have to write a driver that intercepts the position from the Wacom driver and corrects it. Take a look at the windows driver kit.
by korona
Mon Nov 17, 2014 1:21 pm UTC
Forum: Coding
Topic: Algorithmically generating 3D objects
Replies: 7
Views: 4240

Re: Algorithmically generating 3D objects

Can you give concrete examples (e.g. videos or screen shots) of shapes and effects you want to create? Building anything more complex than very basic shapes (spheres, boxes, arrows, ...) algorithmically will be cumbersome. There are techniques (for example skeletal animation) that allow you to model...
by korona
Sun Nov 16, 2014 10:14 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

LLVM and .NET have distinct goals. LLVM is an instruction set independent assembly language while .NET is a high-level virtual machine like Java. .NET handles things like classes, reflection, method calls, concurrency and garbage collection while LLVM does not. .NET can be compiled to LLVM but LLVM ...
by korona
Sun Nov 16, 2014 12:44 am UTC
Forum: Mathematics
Topic: What is the future of Mathematic and mathematicians?
Replies: 10
Views: 4100

Re: What is the future of Mathematic and mathematicians?

First order theorem proving is not in NP. It does not have a bounded complexity.
by korona
Mon Nov 10, 2014 4:21 pm UTC
Forum: Computer Science
Topic: Choosing the best quiz team
Replies: 8
Views: 3992

Re: Choosing the best quiz team

Brute force (i.e. using an existing SET COVER solver) should really be feasible for 5 persons and 40 questions.
by korona
Mon Nov 03, 2014 6:06 pm UTC
Forum: Mathematics
Topic: What is the future of Mathematic and mathematicians?
Replies: 10
Views: 4100

Re: What is the future of Mathematic and mathematicians?

Automated theorem proving is incredibly difficult. We can prove only the simplest theorems using automated theorem solvers. Even for propositional logic the proof complexity is exponential in the size of the theorem. For first-order or higher-order logic proving theorems gets arbitrarily complex. Ho...
by korona
Fri Oct 31, 2014 3:13 pm UTC
Forum: Coding
Topic: Coding an MMO
Replies: 16
Views: 7018

Re: Coding an MMO

Assets are certainly a problem for independent MMOs. While coding an MMO engine can be done by a single programmer (for an independent MMO; let's say 1-3 for a major title) in one year things like 3D modelling and animation, texture drawing and map/content design require much more work hours.
by korona
Fri Oct 31, 2014 11:57 am UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 137199

Re: Funniest/Most Annoying Code Comments

I don't think realloc is cheaper than free :D But hey this eliminates fragmentation!
by korona
Tue Oct 28, 2014 12:58 pm UTC
Forum: Coding
Topic: Coding an MMO
Replies: 16
Views: 7018

Re: Coding an MMO

Java and other garbage collected languages are not a great choice for games or other real-time applications. Their performance (= throughput) is quite good and comparable to that of C/C++ but the garbage collector can introduce long pauses. If your game runs at 30 FPS server-side you really cannot ...
by korona
Sat Oct 25, 2014 11:13 am UTC
Forum: Coding
Topic: Coding an MMO
Replies: 16
Views: 7018

Re: Coding an MMO

I would start with just one server for everything. That's easier to implement and it should not be too hard to transition to multiple servers if you have to. For scalability you probably want one server per zone with some central character management that is updated on each zone change (or every few...
by korona
Fri Oct 24, 2014 3:57 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I'm not sure if I like it that a cast involves a memory allocation and object construction and that if x is of type A then (A)(B)x != x.
by korona
Wed Oct 22, 2014 1:11 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double That just seem fundamentally wrong. Well Double and Integer are classes; they behave like any other class does. As Integer does not inherit from Double or vice versa that cast is illegal. But anyway, what generated t...
by korona
Wed Oct 15, 2014 5:58 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I don't know about the current ARM processors but I remember that programming some of the older ones (I think it was ARMv3?) was not much better than programming x86. They also have multiple operation modes IIRC. I don't know how ARM handles backwards compatibility; if they keep their processors bac...
by korona
Wed Oct 15, 2014 1:57 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I recommend anyone who really wants to understand how computers work to write a toy kernel / operating system. The x86 architecture is very well documented so this is not as hard as it sounds. Doing so will certainly make you understand the design decisions that went into C. The fact that the docum...
by korona
Wed Oct 15, 2014 8:39 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I recommend anyone who really wants to understand how computers work to write a toy kernel / operating system. The x86 architecture is very well documented so this is not as hard as it sounds. Doing so will certainly make you understand the design decisions that went into C.
by korona
Mon Oct 13, 2014 8:28 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

Normally this stuff is configured by software developers using Spring where the substitution isn't too bad [...] The Spring framework - a large library that neatly solves problems nobody ever had before using the framework. Well, that is my impression of such frameworks but I'm a low level develope...
by korona
Mon Oct 13, 2014 9:19 am UTC
Forum: Computer Science
Topic: Stupid question about 3D graphics programming
Replies: 4
Views: 3921

Re: Stupid question about 3D graphics programming

Yes. Basically each object you see in a 3D game is made of some large vertex buffer. Usually they are passed to a vertex shader where they are multiplied with some matrices in order to animate them and project them to the 2D screen. After that a pixel shader is applied that computes the color of eac...
by korona
Sat Oct 11, 2014 10:44 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

I haven't used it much (I usually develop in Linux using vim/gcc/gdb) but Visual Studio seems to be a decent IDE.
by korona
Wed Oct 01, 2014 10:47 am UTC
Forum: Mathematics
Topic: Assumptions in Math (Calculus) word problems
Replies: 254
Views: 40213

Re: Assumptions in Math (Calculus) word problems

Note that Grice's maxims are applied a posteriori. Most mathematicians (including myself) never thought about how we make assumptions in word problems. I never heard about this "cooperative principle" before reading this thread. Yet I never had any difficulty understanding what word proble...
by korona
Mon Sep 29, 2014 4:39 pm UTC
Forum: Mathematics
Topic: The Ironic Paradox of Normalcy [Is my argument sound?]
Replies: 42
Views: 10514

Re: The Ironic Paradox of Normalcy [Is my argument sound?]

I second that it's probably not appropriate to include such posts in college applications. That post is certainly not written in scientific language, independent of the factual truth of the argument. That is not necessarily terrible as you're usually not expected to be able to use scientific methods...
by korona
Sun Sep 28, 2014 12:52 pm UTC
Forum: Coding
Topic: Whats the point of query builders in scripting languages
Replies: 10
Views: 5011

Re: Whats the point of query builders in scripting languages

To be honest I don't think that abstracting over different database engines makes much sense. In my experience you usually have to use database specific features for performance optimization anyways.
by korona
Sun Sep 28, 2014 12:24 pm UTC
Forum: Mathematics
Topic: Assumptions in Math (Calculus) word problems
Replies: 254
Views: 40213

Re: Assumptions in Math (Calculus) word problems

Is it so hard to accept that all assumptions depend on context and common sense and that there is no general rule?
by korona
Fri Sep 19, 2014 1:10 pm UTC
Forum: Mathematics
Topic: Assumptions in Math (Calculus) word problems
Replies: 254
Views: 40213

Re: Assumptions in Math (Calculus) word problems

If your meta-assumption contains the words "must always" it is almost certainly false.
by korona
Thu Sep 18, 2014 7:46 pm UTC
Forum: Coding
Topic: Poll! What is the value of this constant?
Replies: 47
Views: 12947

Re: Poll! What is the value of this constant?

Note that I'm only talking about imperative languages with relatively poor support for algebraic types, like Java or C++! Hey, speak for Java. optional<T> works perfectly fine in C++ with little syntactic overhead at point of use. Yes, optional<T> works fine in C++ and I'm happy that it made it's w...
by korona
Wed Sep 17, 2014 8:45 pm UTC
Forum: Coding
Topic: How to refactor a O(n^3) problem
Replies: 3
Views: 2911

Re: How to refactor a O(n^3) problem

There is no recipe for this. You could try things like: ⋅ Don't calculate results for all things ⋅ Precompute some intermediate values ⋅ Use a different algorithm that is not O(n^3) (yeah, this is very helpful, I know) ⋅ Optimize (e.g. use different data struc...
by korona
Mon Sep 15, 2014 8:15 pm UTC
Forum: Mathematics
Topic: The Shortest String Containing all Permutations of n Symbols
Replies: 29
Views: 24241

Re: The Shortest String Containing all Permutations of n Sym

I wrote a short conversion of the Hamiltonian path problem (see Robin Houston's paper on arXiv) to (Max-)SAT. The encoding uses roughly (n!)^2 variables, so it won't scale to large n but it may be possible to tackle the n = 6 case with this approach. However in order to do that we need to encode mor...
by korona
Thu Sep 11, 2014 4:58 pm UTC
Forum: Coding
Topic: Javascript - Slicing up AJAX uploads, now with progress bar
Replies: 10
Views: 5339

Re: Javascript - FormData objects and slicing up AJAX upload

I edited my post above with an explanation why this happens. According to MDN IE9 supports bind. EDIT (I edit way too often :D): If you don't want to use bind you could just use: (function(xhr) { xhr.onreadystatechange = function(e) { [...] }; })(xhr); or just wrap the whole xhr code in a (function(...
by korona
Thu Sep 11, 2014 4:44 pm UTC
Forum: Coding
Topic: Javascript - Slicing up AJAX uploads, now with progress bar
Replies: 10
Views: 5339

Re: Javascript - FormData objects and slicing up AJAX upload

I don't really understand your problem. Is xhr a global variable that is reassigned after the onreadystatechange handler has been set? That is pretty bad design; but if you absolutely cannot change that and make the xhr variable local then I suggest using a closure: xhr.onreadystatechange = (functio...
by korona
Wed Sep 10, 2014 10:13 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 526102

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

Wow, that is really horrible.
by korona
Tue Sep 09, 2014 10:20 pm UTC
Forum: Coding
Topic: Poll! What is the value of this constant?
Replies: 47
Views: 12947

Re: Poll! What is the value of this constant?

Using a Null Object instead of null only makes sense if that object can provide a meaningful implementation of all methods. Using a Maybe/Optional/etc. return type makes sense when an empty result is part of the semantics of your function. You say you disagree on almost every point, then you echo w...
by korona
Tue Sep 09, 2014 9:17 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

With about 50 blocks like this: for (BaseType x in y.Stuff) { if (x is DerivedType1) { ((DerivedType1)x).foo(); } else if (x is DerivedType2) { ((DerivedType2)x).bar(); } //A bunch more else if (x is DerivedType10) { ((DerivedType10)x).baz(); } } I really wish I could just do something like this: i...
by korona
Mon Sep 08, 2014 10:10 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

Or you could do as I already suggested... catch the checked exception and throw an unchecked exception. That works if I want to say "this definitely explodes", but what I actually want to say is "this explodes unless something higher up the call stack can handle it". Unless you'...
by korona
Sun Sep 07, 2014 12:35 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

In my experience there are two legitimate use cases for exceptions: ⋅ Signaling errors to the calling code, e.g. Java's IOException. This use case is more or less equivalent to returning error codes. Checked exceptions have the slight advantage that you are forced to handle the error, whil...
by korona
Thu Sep 04, 2014 9:41 am UTC
Forum: Coding
Topic: Poll! What is the value of this constant?
Replies: 47
Views: 12947

Re: Poll! What is the value of this constant?

In general, if you store data in a format that admits meaningless values, then there's a risk of errors from using meaningless values. You might forget an error check, or someone else may misunderstand the documentation and add buggy code. By picking the right format, you declare what values are me...
by korona
Thu Sep 04, 2014 9:03 am UTC
Forum: Coding
Topic: Programmatically perform a search-by-image on google?
Replies: 2
Views: 2918

Re: Programmatically perform a search-by-image on google?

Programmatically crawling Google results is probably against their terms of use. For a specialized application like identifying Magic the Gathering cards using something like OpenCV to recognize the images does almost certainly yield better results.
by korona
Tue Sep 02, 2014 8:56 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 526102

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

I'd suggest using an existing logging library as there are many good ones (e.g. the ones from Boost or Google) and you're really reinventing the wheel here.
by korona
Wed Aug 27, 2014 6:01 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9890
Views: 1832013

Re: Coding: Fleeting Thoughts

In most programming languages != is more "correct" as ^ involves a cast to int and back in most programming languages.
by korona
Tue Aug 19, 2014 11:08 pm UTC
Forum: Coding
Topic: Filesize unit conversion algorithm
Replies: 9
Views: 3442

Re: Filesize unit conversion algorithm

It's O(log(n)). Integer division by a power of 2 if fast because it translates to a bitwise shift. It doubt that there is anything faster than an unrolled divide-and-check approach.

Go to advanced search