% psql -c 'create table t (x integer not null)'
CREATE TABLE
% psql -c 'insert into t (x) values (0)'
INSERT 0 1
% psql -c 'select * from t'
x
---
0
(1 row)
This file contains 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 main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
This file contains 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
(function() { | |
Tombloo.Service.extractors.register({ | |
name : 'Photo - Danbooru', | |
ICON : 'http://danbooru.donmai.us/favicon.ico', | |
URL : 'http://danbooru.donmai.us/', | |
check : function(ctx) { | |
const DANBOORU_LIKE_SITES = [ | |
'://danbooru.donmai.us/post/show/', | |
'://yande.re/post/show/', | |
'://konachan.com/post/show/', |
This file contains 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
fn main() { | |
for j in [ | |
r#"{"type": "foo", "subtype": "bar", "a": 1}"#, // Deserialize to Foo(Bar(...)) | |
r#"{"type": "foo", "subtype": "baz", "b": "1"}"#, // Deserialize to Foo(Baz(...)) | |
r#"{"type": "foo", "c": true}"#, // Deserialize to Foo(Qux(...)) | |
r#"{"type": "foo", "subtype": "other", "c": true}"#, // Error | |
r#"{"type": "hoge", "subtype": "fuga", "d": 2}"#, // Deserialize to Hoge(Fuga(...)) | |
r#"{"type": "hoge", "subtype": "piyo", "e": 3}"#, // Deserialize to Hoge(Piyo(...)) | |
] { | |
let s = serde_json::from_str::<S>(j); |
This file contains 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
std.join(' + ', [std.format('{ xs+: [%d] }', i) for i in std.range(0, 10000)]) |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <mach-o/loader.h> | |
#include <mach-o/nlist.h> | |
#include <assert.h> | |
void *find_function(char *obj, const char *name); | |
int main(void) |
This file contains 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
{ | |
"items": [ | |
{"type": "A", "foo": "bar"}, | |
{"type": "B", "hoge": "fuga"} | |
] | |
} |
This file contains 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
use rayon::prelude::*; | |
fn main() { | |
std::thread_local!(static CLIENT: std::cell::RefCell<Option<reqwest::Client>> = std::cell::RefCell::new(None)); | |
rayon::ThreadPoolBuilder::new() | |
.num_threads(8) | |
.build_scoped( | |
|thread| { | |
CLIENT.with(|c| { | |
*c.borrow_mut() = Some(reqwest::Client::new()); |
This file contains 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
extern crate env_logger; | |
extern crate rusoto_ec2; | |
fn main() { | |
use rusoto_ec2::Ec2; | |
env_logger::init(); | |
// my VPC case in ap-northeast-1 region | |
let image_id = "ami-7a1be605"; |
This file contains 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
function! s:encodeURIComponent(str) | |
let s = '' | |
for i in range(strlen(a:str)) | |
let c = a:str[i] | |
if c =~# "[A-Za-z0-9-_.!~*'()]" | |
let s .= c | |
else | |
let s .= printf('%%%02X', char2nr(a:str[i])) | |
endif | |
endfor |
NewerOlder