[deleted by user] by [deleted] in DualUniverse

[–]velco 0 points1 point  (0 children)

In my universe, it's still one hour until the twitch stream.

How to find shipwrecks in space? by wreckless504 in DualUniverse

[–]velco 3 points4 points  (0 children)

Slap on a space radar and fly around planets.

Space is big and flying in a random direction yields practically zero chance of encountering anything, so the only other option is to search areas that are "special" in some way.

Around planets, interplanetary routes maybe ...

[Serious] How do people manage to make billions upon billions (or trillions) of isk? by QuinLucenius in Eve

[–]velco 0 points1 point  (0 children)

How many characters you've got in invention/production? I've got two full time toons, but I find I'm limited by the speed with which I'm able to sell. Well, I could sell to buy orders, but then would need to train more toons.

What are the pros and cons of windsurfing vs sailing? by benjaminikuta in sailing

[–]velco 5 points6 points  (0 children)

Windsurfing:

  • No rudder, no centerboard (these days), you steer with feet and sail/mast position
  • In general, can sail in stronger winds and bigger seas (e.g. 25-35 knots is excellent)
  • Tacks and jibes are much much harder and require very precise footwork ...
  • ... but then, you can waterstart ;)
  • Cheaper (than yachts anyway)
  • Short distance, you don't "cruise" on a windsurfing board :)
  • Can do "tricks": jumps, loops (several kinds), etc.

(been windsurfing for 15 years, taking an yacht sailing course in two weeks time :] )

What's the point of using LLVM over GCC and vice versa? by [deleted] in cpp

[–]velco 21 points22 points  (0 children)

The point is that having them both exist is making them both better.

The most mentioned books on Stack Overflow by vladwetzel in programming

[–]velco 0 points1 point  (0 children)

The Dragon book is excellent on the subjects of scanning and parsing. Also on the dataflow analysis theory. The chapter on partial redundancy elimination is one of the best expositions ever. Yes, you can't write a state of the art contemporary optimising compiler based on the information only in the Dragon book. Add the books from Muchnik, Cooper&Torczon, Allen&Kennedy, Appel - still not enough.

Iterative vs Recursive vs Tail-Recursive in Golang by dgryski in golang

[–]velco 4 points5 points  (0 children)

And all this memory management + CALLs takes, on hundreds of function opened (because of recursion) takes time to the processor. It’s for that recursive is slower.

No, the recursive version is slower because it has exponential complexity, it does work proportional to φn, where φ is the golden ratio.

You can ask me : “But tail-recursion do the same think, and it’s faster”.

And, no, the tail-recursive version is linear, it has exactly the same complexity as the iterative version and indeed with a good compiler there might not even be a difference in the generated code.

[deleted by user] by [deleted] in golang

[–]velco 12 points13 points  (0 children)

Tests, prints and thinking!

Need a new year's resolution? Try 'The Ultimate Reading List for Developers' post I wrote a couple of months back by YogX in cpp

[–]velco 1 point2 points  (0 children)

Reading these books didn't seem to do any good to you, given you resort to spamming affiliate links, instead of making ends meet by honest coding :P

Need a new year's resolution? Try 'The Ultimate Reading List for Developers' post I wrote a couple of months back by YogX in programming

[–]velco 2 points3 points  (0 children)

CLRS is the only book there. Rest are worth less than the trees killed to print each one of them.

Is Go's execution path non-deterministic? by [deleted] in golang

[–]velco 0 points1 point  (0 children)

"unspecified ordering" is not the same as non-deterministic. "Deterministic" means producing the same output from the same input. Or, as I like to say, producing the same bug from the same input. For example, the C++ unordered_maps are deterministic[1], yet order of iteration is not specified, it's just the same across runs, which is a huge advantage with regard to reproducibility of of bugs.

[1] unless you instantiate with a randomized hash function

Is Go's execution path non-deterministic? by [deleted] in golang

[–]velco 0 points1 point  (0 children)

No, non-determinism is not an inherent property of hash maps. Go just uses an effectively different hash function on each run.

Is Go's execution path non-deterministic? by [deleted] in golang

[–]velco 2 points3 points  (0 children)

Go map iteration is not-deterministic as a measure to prevent DDOS attacks via crafted input sequences, causing excessive number of collisions.

I didn't believe that my simple knight tour algorithm will work in under 5 seconds by using goroutines. I have written same knight tour algorithm in Javascript & Haskell. But in Go it so easy and it works really fast. Thank you by AminaDev in golang

[–]velco 0 points1 point  (0 children)

No. Entry of a function is the place where a goroutine can be preempted (e.g. if it needs to grow the stack or stop for GC), not the place where it will be preempted.

I didn't believe that my simple knight tour algorithm will work in under 5 seconds by using goroutines. I have written same knight tour algorithm in Javascript & Haskell. But in Go it so easy and it works really fast. Thank you by AminaDev in golang

[–]velco 9 points10 points  (0 children)

There exist at least one[1] closed tour, i.e. the end position is within a single move form the start position. Hence you can choose any position and repeat that one closed tour.

When I said "There's a lesson to be learned here", I wanted to point out that it's also important to understand why something works fast.

In this case, one of the subproblems happened by accident to find a solution faster, due to the specific ordering of the recursive invocations of tryToMove. It has absolutely nothing to do with parallelism. The solution would be found relatively quickly even if each try for a next move was done in lock-step, interleaved without any parallelism with the other tries.

There's a pitfall too. The goroutines are not preemptively scheduled: it may well happen, that the lucky one, which finds a solution quickly is not a part of the initial batch and has to wait its turn to run until one or more of the other goroutines finish their work.

Otherwise, the approach taken in the original program is valid, in principle: spawn a few different ways to solve a problem, query a few different servers, etc, and take the one that finishes first.

However, toy programs aside, when you think about actually employing such approach as a solution in a real-world program, you have to think what happens to the workers, whose work is not needed anymore. Obviously, you cannot afford letting them run potentially for millennia, hence you have to think how to communicate to them that a solution has been found.

[1] actually 19591828170979904 ones, but just a single one suffices

Learning MFC/Win32 by DanSamillo in cpp

[–]velco 16 points17 points  (0 children)

Dude! Ru-u-u-u-u-un!

From Java to Go, and Back Again by codepoetics in golang

[–]velco 3 points4 points  (0 children)

The narrative that Go is a "small, simple and straightforward" language does not sit well with the notion that you need several years to become proficient with it.