The std::str documentation is also quite good.
// Create a string from a literal
let hello: &'static str = "Hello!";
let hello2: &str = "Hello!";
/* | |
* Demonstrate a trivial filesystem using libfs. | |
* | |
* Copyright 2002, 2003 Jonathan Corbet <[email protected]> | |
* This file may be redistributed under the terms of the GNU GPL. | |
* | |
* Chances are that this code will crash your system, delete your | |
* nethack high scores, and set your disk drives on fire. You have | |
* been warned. | |
*/ |
#!/usr/env python | |
import urllib2 | |
from HTMLParser import HTMLParser | |
import os | |
def downloadFile(url, filename): | |
u = urllib2.urlopen(url+'?format=txt') | |
localFile = open(filename, 'w') |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/d3-collapsible-tree |
/* | |
* This is an example Linux daemon that communicates via dbus. | |
* When run, it will daemonize and print to standard output two lines: | |
* | |
* 1. The PID of the daemon process, which can be used to kill it later with `kill -s SIGINT <pid>' | |
* 2. The unique D-Bus address it will be listening to | |
*/ | |
#include <signal.h> | |
#include <stdio.h> |
Binary files dbxml-2.5.16.orig/db-4.8.26/dbinc/.atomic.h.un~ and dbxml-2.5.16/db-4.8.26/dbinc/.atomic.h.un~ differ | |
diff -ruN dbxml-2.5.16.orig/db-4.8.26/dbinc/atomic.h dbxml-2.5.16/db-4.8.26/dbinc/atomic.h | |
--- dbxml-2.5.16.orig/db-4.8.26/dbinc/atomic.h 2013-06-03 21:04:07.000000000 +0200 | |
+++ dbxml-2.5.16/db-4.8.26/dbinc/atomic.h 2013-06-03 21:10:53.000000000 +0200 | |
@@ -144,7 +144,7 @@ | |
#define atomic_inc(env, p) __atomic_inc(p) | |
#define atomic_dec(env, p) __atomic_dec(p) | |
#define atomic_compare_exchange(env, p, o, n) \ | |
- __atomic_compare_exchange((p), (o), (n)) | |
+ __atomic_compare_exchange_db((p), (o), (n)) |
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
#include <stdio.h> /* fprintf() */ | |
#include <stdlib.h> /* exit() */ | |
#include <sys/types.h> /* socket(), wait4() */ | |
#include <sys/socket.h> /* socket() */ | |
#include <netinet/in.h> /* struct sockaddr_in */ | |
#include <sys/resource.h> /* wait4() */ | |
#include <sys/wait.h> /* wait4() */ | |
#include <pthread.h> /* pthread_create */ | |
#include <netdb.h> /* getnameinfo() */ | |
#include <string.h> /* strlen() */ |
./bootstrap | |
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi --without-zlib --without-lzma | |
make | |
-> static binary in build/sbin/kexec |
The std::str documentation is also quite good.
// Create a string from a literal
let hello: &'static str = "Hello!";
let hello2: &str = "Hello!";
#!/usr/bin/env python | |
""" | |
restapi.py Learn REST API with Python script | |
Usage: restapi.py [options] | |
Options: | |
-e --exer <number> exercise number | |
-h this help | |
Mail bug reports and suggestion to : Larry Cai <larry.caiyu AT gmail.com> |