This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Put me in ~/.irssi/scripts, and then execute the following in irssi: | |
## | |
## /load perl | |
## /script load notify | |
## | |
use strict; | |
use Irssi; | |
use vars qw($VERSION %IRSSI); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nl.ncim.alc.models | |
import aj.slick.auth._ | |
trait EndpointComponent { this: ActiveSlick => { | |
import jdbcDriver.simple._ | |
case class Endpoint( | |
id: Option[Int], | |
mac_address: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import blogimplicits._ | |
class BlogCtrl(db: Database) extends RestFullCtrl(Blogs, db) { | |
def parseId(s: String) = s.toInt | |
override val deserializer: PartialFunction[JValue, Blog] = { | |
case jobj:JObject => (jobj ~ ("author_id", 1)) | |
.extract[Blog](defaultFormats, implicitly[Manifest[Blog]]) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Node { | |
val connections: ListBuffer[Connection] = new ListBuffer[Connection] | |
} | |
case class Connection( | |
from: Node, | |
val to: Node, | |
val cost: Int, | |
private val directed: Boolean = true | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import routers, serializers, viewsets | |
from django.conf.urls import url, include | |
from core.views import * | |
class BatchRouter(routers.DefaultRouter): | |
routes = [ | |
routers.Route( | |
url=r'^{prefix}{trailing_slash}$', | |
mapping={ | |
'post': 'batch_create', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AssertionError at /api/1.0/product | |
Expected view ProductViewSet to be called with a URL keyword argument named "pk". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly. | |
Request Method: OPTIONS | |
Request URL: http://localhost:8000/api/1.0/product | |
Django Version: 1.7 | |
Exception Type: AssertionError | |
Exception Expected view ProductViewSet to be called with a URL keyword argument named "pk". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#define GPIO_BASE 0x20200000 | |
extern void halt(); | |
volatile unsigned int* gpio_fs4 = (unsigned int*)(GPIO_BASE+0x10); | |
volatile unsigned int* gpio_set_1 = (unsigned int*)(GPIO_BASE+0x20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/kernel.o: file format elf32-littlearm | |
Disassembly of section .text: | |
00000000 <kernel_main>: | |
0: e3a0083f mov r0, #4128768 ; 0x3f0000 | |
4: e59f2040 ldr r2, [pc, #64] ; 4c <__delay_22+0xc> | |
8: e592c000 ldr ip, [r2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xft.antialias: true | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.autohint: true | |
Xft.hintstyle: hintfull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_∉_ : ∀ {n m} {A : Set n} → A → Vec A m → Set n | |
a ∉ v = ¬ (a ∈ v) | |
postulate take' : ∀ {n m} {A : Set n} → (i : Fin m) → Vec A m → Vec A (toℕ i) | |
-- take' i v = ? | |
postulate indexof : ∀ {n m a} {A : Set n} | |
→ (v : Vec A m) → (p : A → Set) | |
→ Dec (∃ λ i → p (lookup i v) × a ∉ (take' i v)) | |