Jump to content

  • Log In with Google      Sign In   
  • Create Account

Wyrframe

Member Since 28 Jun 2000
Offline Last Active Yesterday, 04:46 PM

Posts I've Made

In Topic: how can i use the CreateTimerQueueTimer()?

18 May 2016 - 05:28 PM

        ULONG flags;
        DWORD dwPeridic;
        if(blnPeriodic==true)
        {
            flags = WT_EXECUTEDEFAULT;
            dwPeridic=(DWORD)intInterval;
        }
        else
        {
            flags = WT_EXECUTEDEFAULT | WT_EXECUTEONLYONCE;
            dwPeridic=0;
        }

        WT_SET_MAX_THREADPOOL_THREADS(flags,500);

Why not use the macro that actually exists, the way the documentation describes? The error you were getting is because the first parameter to the macro must be an assignable expression (an lvalue). Why do you need up to 500 threads to service your timer callbacks in the first place?

 

I have no idea what your (1) is asking.

 

As for your (2)... SetTimer() and KillTimer() deliver timer events as WM_EVENT events, and require a window handle. CreateTimerQueueTimer lets you specify arbitrary callback functions and callback parameters instead. AFAIK this design decision has nothing to do with the periodicity or precision of the timers associated with them.


In Topic: Introducing Stanza: A New Optionally-Typed General Purpose Programming Langua...

18 May 2016 - 05:11 PM

Trying to take prisoners in one of programming's holy wars is not user-friendly.

 

Maybe the language is useful. I can see some of the nicer features I got used to in Objective Caml hiding under the surface. Maybe the library is even robust and the compiler optimization fantastic.

 

But I don't have faith that any of these are true, after reading...

 

 

Indentation is important in Stanza programs. Be careful when trying out the examples.

And don't use tabs. Stanza won't let you. We don't like tabs.

 

Well, good for you. But this aggressive, inflammatory approach to user-friendliness just lost you an entire market of potential users who aren't even going to give the time of day to that attitude. It comes across as petty, and that's not something you want a reputation for. If you have a technical reason for blacklisting \t, put that in the documentation instead.

 

 

 

Also, a bug report: on 64-bit Ubuntu with 2 GB of RAM, after following the instructions to install Stanza and successfully running `stanza version`, I try to compile the "Hello World" example, and this causes `cc` to crash with an out-of-memory error while trying to consume a 7.6 MiB "tmp1.s" assembly.

[dispos@vbox: ~/mystanza]$ time ./stanza examples/helloworld.stanza -o helloworld
cc -std=c99 'tmp1.s' '/home/dispos/mystanza/runtime/driver.c' -o 'helloworld' -lm
Cannot allocate memory

real    0m38.292s
user    0m5.576s
sys     0m1.796s

[dispos@vbox: ~/mystanza]$ cc -v 2>&1 | tail -n 1
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

[dispos@vbox: ~/mystanza]$ date -R --reference=../lstanza.zip
Wed, 18 May 2016 15:40:50 -0700

In Topic: how can i use the CreateTimerQueueTimer()?

18 May 2016 - 04:18 PM

Exactly as it says in the documentation: Due Time is how long until the timer first fires. Period is how long AFTER THAT it will fire again, and then again, and then again... unless it is zero. If you are getting a crash when you use a nonzero period, it sounds like something about your handler is crashing on the second or some subsequent timer firing.

 

If you expect the timer to fire once, and then never again, give a Period of zero. If you need it to fire multiple times over time, give it a period and debug your callback for what's really going on.

 

 

Also, on a resource waste note... you are creating a TimerQueue (a somewhat heavyweight object) for each of your timers, and then creating only one TimerQueueTimer (a lightweight object) in each of them.


In Topic: Detect if someone is live-streaming the game

28 April 2016 - 07:25 PM

I think it's worth pointing out that there are people that would be offended by a game that sniffs around the system and tries to figure out what other programs are doing. (I'm one of them.) Telling those people that it's to help them would make the problem worse rather than better.

 

Be careful about things like this.

 

Really strongly seconding this. Dunno if anyone's aware, the Android Netflix app? Requires that you grant it permission to use Promiscuous mode on your wifi. Why? "It's a copyright protection measure", support tells me. F*** that. You don't get a blank check for all my and my neighbour's wifi traffic (remember, 802.11 packet headers aren't encrypted, only the payloads are) just because you're paranoid.

 

I use a virus scanner supplement called ThreatFire, which instead of looking for known dangerous signatures, watches applications for untrustworthy behaviour. It would spot this process-scanning nonsense pretty quick, and you'd get a 0-star review for your trouble.


In Topic: Optimizing Chunks [Distance]

07 April 2016 - 06:22 PM

Spotted it. You're gonna kick yourself.

for (int y = minY; x <= maxY; y++)
{
    float dY = y * 16 - playery;
    for (int z = minZ; x <= maxZ; z++)

Hint: what variable are you testing against in your Y/Z bounds checks?

 

And this is why we use an IDE that highlights all occurrences of a variable when you put the caret or mouse over it, folks. :)


PARTNERS