Find it here: https://github.com/bitemyapp/learnhaskell
# -*- coding: utf-8 -*- | |
""" | |
wakatime.amqp | |
~~~~~~~~~~~~~ | |
Setup for Celery distributed task queue. | |
""" | |
import socket |
macro _arms { | |
rule {(default => $value:expr)} => { | |
else { | |
return $value; | |
} | |
} | |
rule {(rule {$cond:expr} => $value:expr)} => { | |
if($cond) { | |
return $value; | |
} |
pub fn main() { | |
let f = action(floats(), p); | |
let parser = spaces() << string_s("vertex") << string_s("[") << | |
f << spaces() << f << spaces() << f << spaces() << string("]"); | |
let input = ParserInput::new(std::os::args()[1]); | |
let result = parser.parse(&input); | |
} |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"github.com/golang/groupcache" | |
"github.com/ha/doozer" | |
"io" |
Force RGB mode in Mac OS X to fix the picture quality of an external monitor (Original)
Update: I have heard that 10.8.3 has solved this problem for some people, so I rolled back my changes and installed the update. No change on my monitor. Nevertheless, it’d be a good idea to update OS X before trying this, since it may fix the issues with your particular hardware.
I recently bought a MacBook Pro (with ‘Retina’ screen), but when I hooked it up to my Dell U2410 monitor via HDMI cable I was shocked by the poor picture quality. The contrast was all wrong and text was misshapen. No amount of calibration in the monitor or software would fix it.
Short answer: OS X thinks my monitor is a TV, and is using the YCbCr colour space rather than RGB. I had to override an EDID setting to force the RGB colour space, and it is now working correctly.
Long answer: I haven’t owned a Mac for a while and h
I wanted to set up one of my Raspberry Pi's as a data dashboard, pushing sensor data to a web interface that's easy to digest. I decided to use Shopify's Dashing framework. Dashing is based on Sinatra, and is pretty lightweight.
Dashing does require Ruby 1.9.3 to run. In addition, it makes use of the execjs
gem, which needs to have a working Javascript interpreter available. Originally, I tried to get therubyracer working, but decided to switch over to Node.js when I ran into roadblocks compiling V8.
One warning: The RPi is a very slow system compared with modern multi-core x86-style systems. It's pretty robust, but compiling all this complex software taxes the system quite a bit. Expect that it's going to take at least half a day to get everything going.
If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:
In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):
- Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
- Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
- Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
- Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
- Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
- Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
from django.contrib.auth.decorators import login_required | |
from django.utils.decorators import method_decorator | |
from django.views.generic import TemplateView | |
class LoginRequiredMixin(object): | |
@method_decorator(login_required) | |
def dispatch(self, *args, **kwargs): | |
return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) | |
class LoginRequiredTemplateView(LoginRequiredMixin,TemplateView): |