Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 29 Sep 2011
Offline Last Active Today, 03:52 PM

Posts I've Made

In Topic: how to draw points,vectors in a 3d space

28 June 2015 - 06:11 AM

All drawing is done by shaders nowadays. SharpDX comes with the MiniTri sample, which is basically as simple as it gets. What part specifically are you stuck on?

In Topic: [SharpDX] ShaderBytecode from pass leads to exception

09 June 2015 - 05:00 AM

Have you tried enabling the DirectX debug layer by passing the DeviceCreationFlags.Debug flag when creating the device and enabling "native code debugging" in the project properties? The debug layer usually provides pretty good error messages.

In Topic: Please double check my c# priority queue

29 May 2015 - 04:54 AM

However I don't want to dedicate the time to working out all of the corner cases so I'm going to go with my more hacky approach, though improved based on the feedback that I am getting here.


Working out all the corner cases is exactly what I would be afraid of when calculating the keys like that. The first version of an implementation should always be the "obviously correct" one. I just don't like optimizing "halfway" and if the simple solution really is too slow, I would rather get rid of the SortedDictionary entirely and implement a proper heap-based queue.

class PriorityQueue<TKey, TValue>
    private readonly SortedDictionary<TKey, Queue<TValue>> entries = new SortedDictionary<TKey, Queue<TValue>>();

    public void Enqueue(TKey priority, TValue value)
        Queue<TValue> queue;
        if (!entries.TryGetValue(priority, out queue))
            queue = new Queue<TValue>();
            entries.Add(priority, queue);

    public TValue Dequeue()
        var first = entries.First();
        var value = first.Value.Dequeue();
        if (!first.Value.Any())
        return value;

In Topic: Windows 10 - "The Best Windows Ever" ?

29 April 2015 - 01:48 PM

EDIT: moreover, the GUI designer broke the holy mantra of "If it works, and it works well, don't fucking change it".


That's a stupid "mantra". Every successful new invention is preceded by failed attempts. Most advantages of a new technology only become apparent after it has been implemented. The first human to send a smoke signal was probably very proud of his invention. Smoke signals worked well. And now we have the internet.

In Topic: Why high level languages are slow

15 April 2015 - 01:23 PM

This discussion is soooo old smile.png


The project I work on at my day job is *very* large scale. Some parts of it have hard real-time requirements and are basically written in C with classes. Some parts are C++ because they are compute-bound. But the majority of the components is written in C#, because performance simply isn't the top priority, productivity is.


Use the right tool for the job and be done with it.


Most developers I meet every day are entrenched in "their" world, but I love switching between the worlds and the languages. Spend the morning writing "fast" code, go to lunch and then switch over to writing "nice" code. What really annoys me though, is the fact that everyone and their dog calls themselves a "C# developer" nowadays after reading a few tutorials. It's sad to see so many programmers being completely oblivious of all the nice aspects of the "high level" languages that we willingly paid for by sacrificing performance.