Skip to content

Instantly share code, notes, and snippets.

View eltonvs's full-sized avatar
🏠
Working from Home

Elton Viana eltonvs

🏠
Working from Home
View GitHub Profile

To find elements without space between the content and '{'

((?! ).{)
@eltonvs
eltonvs / 10258.cpp
Created August 12, 2016 21:19
adsaassadsagthçVJÇ
#include <iostream>
#include <vector>
#include <sstream>
struct Problem {
int id;
bool solved;
};
struct Team {
@eltonvs
eltonvs / 540.cpp
Created August 19, 2016 21:22
kjdvdsknbdcbj k KÇN KMÇcCJ
#include <iostream>
#include <string>
#include <queue>
#include <list>
int main() {
int n, c = 1;
int map[1000000];
int t_map[1001];
std::string line;
@eltonvs
eltonvs / asdasdasdsad.cpp
Created September 20, 2016 14:37
asdasdasdas
// Tire isso dps, to usando so pra n me preocupar com os includes kkk
#include <bits/stdc++.h>
#define POS_NUMBER 12
#define POS_NAME 10
#define POS_ENTOURAGE 18
#define POS_CITY 41
#define POS_STATUS 16
struct Candidate {
@eltonvs
eltonvs / beagle_compiler_installer.sh
Created October 19, 2016 13:01
A shell to make the cross compiler installation (from BeagleBone Black) quick and easy
# get file from source
wget -c https://releases.linaro.org/14.03/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux.tar.xz
# uncompress file
tar xf gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux.tar.xz
# copy uncompressed file to /opt/
sudo cp -r gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux /opt/
# remove downloaded files
@eltonvs
eltonvs / jekyll_installer.sh
Created October 19, 2016 13:03
Install jekyll and ruby (with all required dependencies) on debian based systems
sudo apt-get -y update && sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev && cd /tmp && wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p481.tar.gz && tar -xvzf ruby-2.0.0-p481.tar.gz && cd ruby-2.0.0-p481/ && ./configure --prefix=/usr/local && make && sudo make install && gem install jekyll bundle
#include <thread>
#include <cstdio>
#include <chrono>
#include <vector>
#include <sched.h>
#include <unistd.h>
using namespace std;
#define NUMTHREADS 10
@eltonvs
eltonvs / operator.cpp
Created November 7, 2016 02:27
aaaaaaaaaaaaaaaaaaaaa
#include <iostream>
using namespace std;
class Base {
public:
Base() {}
virtual ~Base() = 0;
ostream& print(ostream &o) const {
o << "id: " << id << "\n";
@eltonvs
eltonvs / operator2.cpp
Created November 7, 2016 02:45
aaaaaaaaaaaaaaaaaaaaaaaaa
#include <iostream>
using namespace std;
class Base {
public:
Base() {}
virtual ~Base() {};
virtual ostream &print(ostream &o) const = 0;
@eltonvs
eltonvs / get_proc_data.cpp
Last active November 21, 2016 01:35
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
struct Proc {
int pid;
int ppid;
double memory;