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
# encoding: utf-8 | |
require 'benchmark' | |
require 'json' | |
json_normal = <<-EOS | |
[ | |
{ | |
"order": { | |
"checkin_id": 298486374, |
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
/* | |
* CuboRobot.java | |
* Este programa demuestra el concepto de "Scenegraph". | |
* Se arma un "dedo" articulado y el ángulo de rotación se cambia con las | |
* flechas. | |
*/ | |
import java.applet.Applet; | |
import java.awt.BorderLayout; | |
import java.awt.Frame; |
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
User.where(:first_name => 'Scarlett').first_or_create!(:last_name => "Johansson", :hot => true) | |
# => #<User id: 1, first_name: "Scarlett", last_name: "Johansson", hot: true> | |
User.where(:first_name => 'Scarlett').first_or_create!(:last_name => "O'Hara", :hot => false) | |
# => #<User id: 1, first_name: "Scarlett", last_name: "Johansson", hot: true> |
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
using namespace std; | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <numeric> | |
#include <sstream> | |
#include <fstream> | |
#include <cassert> | |
#include <climits> | |
#include <cstdlib> |
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
int num[256] = {0}; | |
vector<string>::iterator iter = text.begin(); | |
while (iter != text.end()){ | |
string st = *iter; | |
for (int i = 0; i < st.size(); i++){ | |
int pos = st[i]; | |
num[pos]++; | |
} | |
} |
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
using namespace std; | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <numeric> | |
#include <sstream> | |
#include <fstream> | |
#include <cassert> | |
#include <climits> | |
#include <cstdlib> |
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
using namespace std; | |
#include <algorithm> | |
#include <iostream> | |
#include <iterator> | |
#include <numeric> | |
#include <sstream> | |
#include <fstream> | |
#include <cassert> | |
#include <climits> | |
#include <cstdlib> |
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
int D[3000]; | |
int len; | |
int Mod(int x) { | |
int res = 0; | |
for (int i = len-1; i >= 0; --i) | |
res = (res * 10 + D[i]) % x; | |
return res; | |
} | |
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
100 120 -20 -100 -160 160 | |
10 8 5 5 5 4 | |
10 8 5 5 10 5 | |
10 8 5 5 10 10 | |
4 2 1 1 1 3 | |
4 2 2 1 2 3 | |
4 2 2 1 4 1 | |
4 2 2 1 6 1 | |
4 2 1 1 2 1 | |
4 2 0 1 4 3 |
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
// Andrés Mejía | |
#include <cstring> | |
#include <iostream> | |
#include <vector> | |
#include <sys/time.h> | |
using namespace std; | |
const int MAXN = 1e9, MAXM = 10; | |
char d[MAXN+1]; | |
char p[MAXM+1]; |