Skip to content

Instantly share code, notes, and snippets.

View joffilyfe's full-sized avatar

Joffily joffilyfe

  • 20:33 (UTC +01:00)
View GitHub Profile
@joffilyfe
joffilyfe / troca.c
Created April 29, 2015 13:09
troca!
#include <stdio.h>
void troca(int *x, int *y);
int main(void) {
int x, y;
x = 10;
y = 20;
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>Olar</title>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script>
var app = angular.module(['app'], []);
@joffilyfe
joffilyfe / doubly_linked_list.c
Created May 8, 2015 01:27
Lista duplamente encadeada com cabeçalho
#include <stdio.h>
typedef struct head {
int * first;
int * last;
int count;
} head_t;
typedef struct node {
struct node *prev;
@joffilyfe
joffilyfe / doubly_linked_01.c
Last active August 29, 2015 14:20
Doubly Linked list without header - insert, remove, list, initialize and search.
#include <stdio.h>
typedef struct node {
struct node * prev;
struct node * next;
int val;
} node_t;
typedef struct head {
node_t *first;
@joffilyfe
joffilyfe / linked_list.c
Last active August 29, 2015 14:20
Linked list with header (first, last, count)
#include <stdio.h>
typedef struct node {
int val;
struct node *next;
} node_t;
typedef struct head {
node_t *first;
node_t *last;
@joffilyfe
joffilyfe / artilheiros.py
Created May 29, 2015 18:23
POP Questão C - Artilheiros
import sys
def toNum(data):
result = []
for n in data.split():
result.append(int(n))
return result
def goals(data):
result = toNum(data[:7])
@joffilyfe
joffilyfe / POP-A.py
Created May 31, 2015 20:36
Questão da maratona de programação olímpica (POP) - Transformar as palavras repetidas de uma entrada em #
# Funcoes
def appendWord(line, vector):
l = line.split()
for i in l:
vector.append(i)
def subWord(word):
w = ""
for c in range(len(word)):
w += "#"
@joffilyfe
joffilyfe / lista_encadeada.c
Created June 7, 2015 12:38
Lista encadeada (será que tá certo?)
#include <stdio.h>
#include <stdlib.h>
// Estruturas
typedef struct caixa {
int dado;
struct caixa *proximaCaixaPonteiro;
} Caixa;
typedef Caixa *PonteiroParaInicio;
@joffilyfe
joffilyfe / l.c
Created June 8, 2015 14:55
Lista encadeada, exemplo.
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int data;
struct node *next;
} Node;
void initialize(Node **list);
@joffilyfe
joffilyfe / start.py
Created June 12, 2015 01:37
Vislumbre de um crawler para o lattes.
# -*- coding: utf-8 -*-
import mechanize
import cookielib
from lxml import html
from lxml import etree
HEADERS = [('Accept-Language', 'en-us,en;q=0.5'),
('Accept-Encoding', 'deflate'),
('Keep-Alive', '115'),
('Connection', 'keep-alive'),