Install this theme
Windows services in C++

Not too long ago I had to write a Windows service in C++. Now, C# has a template for that that one can use and write a service quickly. But C++? Yeah, you have to build that one up from the ground.

Inspired by C# ServiceBase class, I created my own C++ ServiceBase class that helped me quickly write a service that would track users logging on and off the system, as well as locking/unlocking the PC.

Link to GitHub repo


kr-studios:

kr-studios:

The benefit of C++ is that you can fall back to C style coding. i.e. instead of using loops & the new/delete operators, I’m just going to use malloc() & free().

Oh, calloc() is a thing.

realloc() is a thing too.

But that doesn’t mean that you have to use C functions in C++ if you want to allocate memory without calling a constructor. void ::operator new(size_t size) is still a thing, you know.

And C++ has a placement new, which is a great thing for memory pools.


the-analytical-engine:

Lecture 3 - Algorithms & Analysis: Brute Force

Copyright 2013 RMIT - Shane Culpepper


Note to self: Learn to focus on important things.


what-if-i-just-shat-myself:

pool party!!! more like thread pool party haha am i right

I’ll invite you to my memory pool party!


The thing about programming is that no matter what your level of experience might be, an elusive bug can still bring you to your knees in a sobbing fit.
(via thethingaboutprogramming)

YES THIS

(via cjbrowne)

That was fun, Google

That was fun, Google


Application design can repulse developers

Yes, Metro interface and WinRT, I’m talking about you…

Your design made a module I was developing unusable for Metro applications.
Why would you kill ALL IPC methods!? Initially I was using sockets, but you can’t connect to localhost anymore from WinRT, neither can you use named pipes.


Rotating NxN matrix by 90 degrees

I’ve been struggling with this problem for quite a while! At first I was thinking about in-place and one-go method. But the code for that would become unreadable and hard to understand.

The best thing programmer can do is split the problem into smaller pieces.
So by doing that, much better idea was born!

At first you wanna transpose the matrix (flip around the main diagonal) to rotate counter-clockwise and around another diagonal to rotate clockwise.

Then just reverse each column and that’s it!

Read More


sodamnrelatable:

OK I DONT KNOW IF YOU GUYS HAVE NOTICED ON GOOGLE BUT THERE WAS THIS THING

image

SO I CLICKED IT RIGHT

image

AND IT BROUGHT ME TO THIS PAGE AND I CLICKED THE FUCKING LINK

image

AND I CLICKED SMELL

image

AND THEN I PUT MY FACE ON THE SCREEN RIGHT

image

AND IT DIDNT FUCKING WORK SO I CLICKED NEED HELP

imageAND IT BROUGHT ME TO THIS SHIT STAINED PAGE

FUCK YOU GOOGLE

Best joke ever!