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<bits/stdc++.h> | |
using namespace std; | |
#define SET(t,v) memset((t), (v), sizeof(t)) | |
#define ALL(x) x.begin(), x.end() | |
#define UNIQUE(c) (c).resize( unique( ALL(c) ) - (c).begin() ) | |
#if __cplusplus > 199711L | |
#define ItREP(it,c) for(auto it = (c).begin(); it!= (c).end(); it++) | |
#define REP(i,n) for(decltype(n) i=0;i<n;i++) |
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
""""""""""""""""""""" | |
"""" COMPETE STUFF | |
map <S-F2> :!g++ -std=c++11 % -o %:r.out<CR> | |
map <F2> :!g++ -std=c++11 -DDEBUG -Wfatal-errors % -o %:r.out<CR> | |
map <F3> :!./%:r.out < %:p:h/input<CR> | |
map <S-F3> :!./%:r.out < %:p:h/input \| diff %:p:h/answer - <CR> | |
map <F4> :!javac %<CR> |
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
All-IT Superstore | |
================= | |
Date: 12 January 2016 | |
Receipt No: 87129380982 | |
Item : Quantity : Price (per item) | |
----------------------------------------------------- | |
1. Kicap : 5 : RM 5.50 | |
2. Gigabyte G502 : 1 : RM 309.00 |
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
/** | |
* Its a copy of the built in transformer, but instead of a somewhat | |
* two stage approach, it pass directly to babel, which allow things like | |
* sourceMap merging. | |
* | |
* Also, it assume .babelrc is always available | |
*/ | |
const babel = require('babel-core'); | |
const externalHelpersPlugin = require('babel-plugin-external-helpers'); |
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
// @flow | |
import * as _ from 'lodash' | |
import invariant from 'invariant' | |
/** | |
* A LoadableResource is a monad that wraps a resource, which may be in the | |
* four state | |
* - missing | |
* - pending | |
* - error |
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
import { | |
Component, ComponentFactoryResolver, Directive, Input, OnDestroy, OnInit, TemplateRef, | |
ViewContainerRef | |
} from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import { Subscription } from 'rxjs/Subscription'; | |
import { ReplaySubject } from 'rxjs/ReplaySubject'; | |
/** | |
* Do you love reactive streams? But hate subscribing to them, setting them to a local |
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
import com.github.jsonldjava.core.RDFDataset | |
import com.github.jsonldjava.core.RDFDatasetUtils | |
import org.apache.commons.codec.binary.Hex | |
import org.apache.commons.codec.digest.DigestUtils | |
import org.apache.commons.collections4.iterators.PermutationIterator | |
/** | |
* Normalize jsonld-java's RDFDataset using URDNA2015 specification | |
* | |
* Passes json-gold tests |
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 serde::Deserialize; | |
use serde_json; | |
use chrono::{DateTime,Utc,NaiveDateTime,NaiveDate}; | |
#[derive(Debug, Deserialize)] | |
struct TheStruct { | |
#[serde(deserialize_with = "datetime_deserializer")] | |
time: DateTime<Utc>, | |
} |