Slashdot Mirror


User: Lord_Naikon

Lord_Naikon's activity in the archive.

Stories
0
Comments
74
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 74

  1. Re:Dumbest Decision Ever on Free Desktop Software Development Dead In Windows 8 · · Score: 1

    Cool, thanks for the information. Not that I will be programming for Windows 8 anytime soon but at least now I wont spread misinformation :-)

  2. Re:I thought these were pretty much known already on 350-Year-Old Newton's Puzzle Solved By 16-Year-Old · · Score: 1

    Finding out where a projectile lands given a certain initial angle and velocity is a lot easier than finding out at what angle to shoot given a certain destination and velocity. I guess he found out how to do that because I was unable to solve it myself (when the total force on the projectile is dependent on its velocity).

  3. Re:Dumbest Decision Ever on Free Desktop Software Development Dead In Windows 8 · · Score: 1

    Also their new Metro APIs require the use of a new syntax (^ suffix) in C++ which is obviously unportable and IMHO Microsoft should be ashamed of doing that.
    You'll see stuff like: bla::bla(foo^ bar) { ... }

    COM wasn't nice to use in C++ but at least it was all C++.

  4. Re:Well, it's not a simple system on 'Social Jetlag' May Be Making You Fat · · Score: 2

    3000 calories is only 1lb of fat when all of it is actually digested by the body. If I eat a whole pot of peanut butter right now I can guarantee you that I will just excrete almost all of it. So the notion that if you eat 100 cal less you will lose a pound in a month is simply wrong. The balance between the amount of calories burnt and the amount of calories extracted from the food we eat is very delicate and hard to influence (largely dependent on genetics), hence the problems people are having with losing weight unless they are willing to basically starve themselves.

  5. Re:Yeah sure on 'Social Jetlag' May Be Making You Fat · · Score: 1

    On the contrary, your typical athlete sustains far more injuries than an average person and has a lower life expectancy due to all kinds of internal wear and damage. They are not healthier than average.

  6. Re:Comments mean your code is BAD on Ask Slashdot: Getting Feedback On Programming? · · Score: 1

    Challenge accepted ;-)
    I would like to show you some complex asynchronous and multithreaded I/O code I've written for $job but that wouldn't fit in a slashdot comment so here's another example.
    This is an excerpt from some code I wrote a while ago for a friendly competition about calculating the number of primes below 1000000000. It is highly optimized.

    static void countPrimes(block *b, uint8_t data[BLOCK_SIZE_HALF]) {
      const prime_t start = b->start;
      const prime_t end = b->end;
      const prime_t max = (int)ceil(sqrt(end));
      const prime_t bsize_half = (end - start) >> 1;

      for(int i = 0; primeDivisors[i] <= max; i++) {
        const prime_t prime = primeDivisors[i];

        prime_t multiple = ((start + prime - 1) / prime) | 1;
        if(multiple < 3) {
          multiple = 3;
        }

        prime_t index = (multiple * prime - start) >> 1;
        while(index < bsize_half) {
          data[index] = 0;
          index += prime;
        }
      }

      int count = 0;
      for(prime_t i = 0; i < bsize_half; i++) {
        count += data[i];
        data[i] = 1;
      }
      b->count = count;
    }

    The actual code has documented in comments:
    - preconditions: data should be initialized to all 1s, primeDivisors should contain all primes up to ceil(sqrt(b->end)), except the prime 2, etc.
    - postconditions: data will contain all 1s, b->count the number of primes.
    - why data is a parameter and not allocated on the stack/heap
    - what the meaning of multiple and index is and how they are calculated
    - how the inner loop works.
    - why the function works in the exceptional case of b->start = 0 and why that even is an exceptional case.

    This code is optimal (it won the competition). It has comments so that when I read this code in say 6 months time I can still understand it.

  7. Re:Comments mean your code is BAD on Ask Slashdot: Getting Feedback On Programming? · · Score: 1

    Slashdot ate his code. It's supposed to reinterpret_cast x as an integer. Same goes for the second cast, where it should reinterpret_cast i as a float. See http://betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/ for an explanation.

  8. Re:Comments mean your code is BAD on Ask Slashdot: Getting Feedback On Programming? · · Score: 1

    IMHO depending on algorithm complexity comments should be used to explain WHY code is structured in a certain way, so that the next guy who refactors the code doesn't break all kinds of invariants or opens up new race conditions.

  9. Re:Rasterization on 2000x GPU Performance Needed To Reach Anatomical Graphics Limits For Gaming? · · Score: 1

    With rasterization everything depends on the efficiency and accuracy of the invisible geometry culling algorithms. If all you have left is a visible primitives set then rasterization is _always_ going to be faster because you are then looking at constant time rendering (per pixel). In realtime graphics we can use the scene's spacial coherence to to amortize time spent in geometry sorting and culling algorithms over multiple frames. Ray casting/tracing doesn't look so good then. Where ray tracing really shines is stuff where rasterization basically fails: dynamic global illumination, shadowing, reflection, refraction etc. So for really high quality dynamic scenes rasterization is unusable. Because of that we will eventually simply _need_ to start ray tracing to gain image quality, not because it is faster (which it is not).

  10. Re:advantages of multiple inheritance on PHP 5.4 Released · · Score: 1

    Proper multiple inheritance makes it possible to share a common base class in a subclass instead of duplicating it (storage or code). For instance consider a Square baseclass which has a property called "width". We can now define two subclasses ColoredSquare and RoundedSquare with properties "color" and "radius" respectively. However wouldn't it also be nice to have a ColoredRoundedSquare? By subclassing from both ColoredSquare and RoundedSquare it inherits both the "color" and "radius" properties as well as the property of "width" _once_. In other words, the inherited functionality and storage from Square is now shared by both ColoredRoundedSquare's superclasses. That is something you cannot do without multiple inheritance. In Java you can fake the above by using interfaces but it leads to code duplication, because you need to redefine one superclass's instance variables (either radius or color) in ColoredRoundedSquare, or memory duplication because the ColoredRoundedSquare must proxy calls to one of the superclasses resulting in Square being instantiated twice.

  11. Re:legal? on Project Bifrost: (Fission) Rockets of the Future? · · Score: 1

    I don't disagree with you, my comment was merely an attempt to clarify things, however I botched things up when I wrote "thrust" when I meant "velocity". The factor of 1/2 is not relevant in this case but when you wrote in a imho condescending way that E=mv^2 and explicitly stated the units I felt compelled to correct it, hence my reply :-)

  12. Re:legal? on Project Bifrost: (Fission) Rockets of the Future? · · Score: 1

    I think you make some mistakes in your calculations. First, it's E = 1/2 * m * v^2. Secondly, the force the engine generates is proportional to m*v (impulse). The energy required to create an impulse of m*v is indeed 1/2mv^2. In other words, as the amount of thrust doubles, the required energy quadruples. Hence the need for a nuclear reactor. Basically energy efficiency is lower for high velocity rocket engines. In this case that is not a problem because this engine doesn't require much mass to operate resulting in high specific impulse (but low energy efficiency). Normally though, in chemical rockets, it is a tradeoff.

  13. Re:Stupidity at Google, guess they have the money. on Google Deploys IPv6 For Internal Network · · Score: 1

    Really? Please back up your statements with some arguments. The NAT traversal problem has not been solved by a long shot. Sometimes software can configure the the NAT remotely (UPnP) but that obviously doesn't work when your ISP starts NATting you.
    To me it looks like you miss some basic information about how client-server networking actually works and why NAT is a serious hindrance to correct internet functionality.

    Care to elaborate on why IPv6 introduces more problems than it solves?

  14. Re:Stupidity at Google, guess they have the money. on Google Deploys IPv6 For Internal Network · · Score: 2

    While the rest of the world can use their instant messenger software to share files or make calls, you are stuck on IPv4 and must use slow 3rd party servers to proxy data between you and your other IPv4 friends because your NAT won't allow them to connect directly. I'm sorry, but the problem is not about running out of IPv4 addresses internally, it is about connectivity with the rest of the world.

  15. Re:SuperMicro MicroCloud w/ 8 NVidia GPUs? on Ask Slashdot: Parallel Cluster In a Box? · · Score: 1

    Good advice, because I've found out in practice that unless the problem set can be divided up in CPU core cache size blocks (i.e. 512k or less), memory bandwidth is going to be the major bottleneck. More machines = more memory bandwidth.

  16. Re:Radeon may save them... on AMD Confirms Commitment To x86 · · Score: 1

    It's not only the driver itself, but the whole Catalyst plus installer package is a complete WTF. For example, I have here a Radeon HD4350 AGP. If you download the normal drivers from AMDs website, they won't detect the card. No, I have to download a special "hotfix" drivers because the card is AGP... go figure. Then you are presented with what can only be described as an installer from the Windows 3.11 era, in looks and functionality. After clicking a bunch of "next.. next..." the installer will actually fail to install the Catalyst control center. Why? Because it by default has a space in it's install path (C:\Something\ATI Technologies). After removing that space the install will continue. After all is done, you are still left with a non-functioning control center because the installer never let you know that you also need a certain version of the .NET runtime.
    Then the struggle gets even harder when you try to get GPU HD decoding working...

    I am NEVER going to buy ATI again, even if their graphics cards are twice at fast as the competition, until they fix that god awful mess their driver is.
    Even thinking about it gets me aggravated again :-(

    Contrast this to nVidia's super streamlined drivers: Download -> Click install -> Done. No need to reboot even. Also the performance and quality of their Linux and FreeBSD drivers is on par with Windows (at least in the areas I care about: OpenGL acceleration), another major plus.

  17. Re:Nonsense on Physicist Uses Laser Light As Fast, True-Random Number Generator · · Score: 1

    I shouldn't have said accurately because that may be unfeasible in practice. but given a repeated throw using the exact same starting situation I would be surprised if the outcomes were truly random. I believe in Craps they make you throw in a certain way (hard enough) to basically guarantee unpredictability.

    Anyway, the point was that even though predicting dice may not be feasible in normal situations, it still can be (theoretically) done in controlled situations. Not so for "true random" stuff, like the laser-through-a-diamond method mentioned in the article. That makes it different.

  18. Re:Nonsense on Physicist Uses Laser Light As Fast, True-Random Number Generator · · Score: 1

    I find your examples weak. Dice can be accurately predicted and are in no way random. Digitized sound noise sources are also not very random in my experience, even after eliminating bias. The cup of water measurement randomness depends on the accuracy you measure it with and is hardly a practical source of randomness.

    The author meant to say that "the measurements are random in a way that they are in no way predictable, unlike our ordinary surroundings".

  19. Re:"Truly random numbers" on Physicist Uses Laser Light As Fast, True-Random Number Generator · · Score: 1

    So they don't pass your statistical test. That doesn't prove they aren't random. What if he only gave numbers between 0-9? What if the distribution of his numbers is not uniform?

  20. Re:Take your time, let software catch up. on AMD Cancels 28nm APUs, Starts From Scratch At TSMC · · Score: 1

    Creating multithreaded software isn't hard. Creating efficient multithreaded software can be anything from trivial to very hard or impossible depending on the problem at hand.

    For instance I'm working on a lock free oct tree implementation where multiple threads can do updates on the tree without getting into each others hair, while another thread renders the whole thing to the screen asynchronously. Debugging it is very hard, thinking of all the possible interactions between threads working on a common data structure is very hard.

    Do you actually know why python and ruby cannot efficiently utilize multiple threads? Have you looked into it and found an "embarrassingly easy" solution? I think not.

  21. Re:Once Again... on In the EU, Water Doesn't (Officially) Prevent Dehydration · · Score: 2

    They didn't claim that water will hydrate you, but they claimed that water prevents dehydration. That's not the same thing. If you are suffering through cholera and as a result are dehydrated, "bottled water" alone isn't going to stop the dehydration, nor will it prevent cholera and as a result the dehydration.
    See http://en.wikipedia.org/wiki/Oral_rehydration_solution for something that will.

  22. Re:Practically ACID on First Look: Oracle NoSQL Database · · Score: 2

    No sharding solution can guarantee consistency in the event of node failures, unless you completely block writes or reads until the nodes are back up. It's great that they bind a key to a particular server, but I can think of several other NoSQL solutions which do the same thing. Basically everything that uses hashrings and do lookups based on that. Oracle NoSQL is hardly unique in that respect.

  23. Re:Linux isn't untweakable on In Favor of FreeBSD On the Desktop · · Score: 1

    How is kernel compiling easier in Linux than in FreeBSD?
    cd /usr/src
    make kernel
    How hard can it be?

  24. Re:the way to go on Tough Tests Flunk Good Programming Job Candidates · · Score: 1

    That only works well when the keys are randomly distributed, which is rarely the case. Multiplying the key by a prime number (with respect to the size of the array) first avoids a lot of the degenerate cases occurring in practice, but is still not truly "random" as a proper hash function should be.

  25. Re:What this means and how seriously is this on Indian Mathematician Takes Shot At Proving Riemann Hypothesis · · Score: 2

    Thank you for your explanation. Learn something new everyday :-)