conversation of the cutting-edge techs
link to subscribe feed
conversation of the cutting-edge techs
link to subscribe feed
#include "brt.h" | |
#include <windows.h> | |
#include <psapi.h> | |
struct WorkingSetParams { | |
HANDLE process_handle; | |
size_t min_working_set; | |
size_t max_working_set; | |
DWORD flags; |
$mingwPath = "C:\MinGW\bin" # Replace with MinGW path from $ENV:PATH | |
$pathArray = $ENV:PATH.Split(";") | |
$newPath = "" | |
Foreach ($p in $pathArray) { | |
if (!$p.Equals($mingwPath)) { | |
$newPath += ";" | |
$newPath += $p | |
} | |
} |
// File format: | |
// | |
// Roughly based on INI style configs. | |
// | |
// 'Key=Value' pairs, one pair per line. If a line contains more than one '=', | |
// the first is taken to be the deliminator and the rest are included as part | |
// of the value string. | |
// | |
// A line containing a key but no value (i.e., no '='), will be parsed as an | |
// entry with an empty value string. |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import random | |
from collections import defaultdict | |
class MarkovPrefix(object): | |
def __init__(self, n): | |
if n < 1: |
#include <stdlib.h> | |
#include <stdio.h> | |
typedef struct tokenize_state_t { | |
const char * position; | |
} tokenize_state_t; | |
int check_delim(char c, const char * delim) { | |
for (const char * cur = delim; *cur != '\0'; ++cur) { | |
if (c == *cur) { |
class QuadTree | |
{ | |
private: | |
static const int MAX_ENTITIES = 20; | |
std::vector<Entity *> m_entities; | |
sf::Vector2i m_position; | |
sf::Vector2i m_size; | |
QuadTree * m_nodes; | |
int getIndex(const Entity * e) const |
template<typename T> | |
class DoubleBufferedMap | |
{ | |
private: | |
size_t m_width; | |
size_t m_height; | |
T * m_front; | |
T * m_back; | |
public: |
class ElevatorRequest(object): | |
def __init__(self, from_floor, to_floor): | |
self.from_floor = from_floor | |
self.to_floor = to_floor | |
def __cmp__(self, other): | |
return self.from_floor == other.from_floor | |
def __str__(self): | |
return "<ElevatorRequest: From %d to %d>" % (self.from_floor, self.to_floor) |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |