Tags » C-2

Dutch National Flag Problem

Given `N’ objects coloured red, white or blue, sort them so that objects of the same colour are adjacent, with the colours in the order red, white and blue. 92 more words


Expire All Cookies in C#

public static class CookieUtility
	public static void ExpireAllCookies(HttpRequestBase request, HttpResponseBase response)
		// Get all cookies associated with MYA
		List<HttpCookie> cookies = new List<HttpCookie>();

		var cookieKeysArray = request.Cookies.AllKeys;

		for (int i = 0; i < cookieKeysArray.Length; i++)
			HttpCookie cookie = request.Cookies];

		// Expire all cookies
		foreach (var cookie in cookies)
			if (cookie != null)
				CookieUtility.ExpireCookie(response, cookie);

// From a controller
public virtual ActionResult LogOut(string logOutUrl)
	CookieUtility.ExpireAllCookies(Request, Response);

	return Redirect(logOutUrl);

// From Global.asax
var requestWrapper = new HttpRequestWrapper(Request);
var responseWrapper = new HttpResponseWrapper(Response);
CookieUtility.ExpireAllCookies(requestWrapper, responseWrapper);


Simple Memory Scanner Example

Wrote this for someone that was asking for help on Cheat Engine’s forums. This is a very very basic and light-weight memory scanner that will scan for 4 byte values. 484 more words


C++ Log - Entry #15

Fuck polymorphism. Seriously. I’m not talking about polymorphism as a “feature” of C++ itself, but the fact that nobody can explain thoroughly what it’s used for. 448 more words


Getting Windows Snap to Play with WPF Borderless Windows

In making the Dragablz library I quickly realised I needed be able to push the tabs higher up the window as we see in Chrome, and also, to achieve the IE affect, I really needed Window transparency. 434 more words


Late Binding using dynamic

Hey smarty-pants :D back with another one. I found the time to do a post today as well. Hopefully it’ll be the same in the future. 666 more words


Tool Window Enhancements

Time for another quick look at what’s happening with tool windows in Dragablz.

You can now take a tab, tear it out, and then drop it straight back in, but as a tool window…neat!   103 more words