This file contains hidden or 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
| <?php | |
| if(isset($_COOKIE["count"])) { | |
| $count = $_COOKIE["count"]; | |
| $count++; | |
| setcookie("count", $count, time() + 600); | |
| } else { | |
| $count = 0; | |
| setcookie("count", $count, time() + 600); | |
| } | |
| ?> <html> |
This file contains hidden or 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; | |
| typedef struct elem{ | |
| int value; | |
| int acc; | |
| }tipoElem; | |
| void printVet(int v[], int n){ |
This file contains hidden or 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
| http://stackoverflow.com/questions/14291636/what-is-the-proper-way-to-convert-between-mysql-datetime-and-python-timestamp |
This file contains hidden or 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 csv | |
| import urllib2 | |
| url = 'http://winterolympicsmedals.com/medals.csv' | |
| response = urllib2.urlopen(url) | |
| cr = csv.reader(response) | |
| for row in cr: | |
| print row |
This file contains hidden or 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
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| response = urllib2.urlopen('http://python.org/') | |
| print "Response:", response | |
| # Get the URL. This gets the real URL. | |
| print "The URL is: ", response.geturl() |
This file contains hidden or 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 <iostream> | |
| #include <cstdio> | |
| #define maxV 10000 | |
| using namespace std; | |
| int cnt = 0, lbl[maxV], movimentos, V, A; | |
| int adj[100][100]; |
This file contains hidden or 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
| Star (URI1233): [ Intermediario / Matematica ] É possivel ver que se um numero K tem algum fator comum com N, entao ele ira voltar para a posicao inicial em alguma rodada. Alem disso, para cada coprimo X de N, as estrelas formadas por X e N - X sao iguais. Dessa forma, o resultado final é phi(N) / 2. |
This file contains hidden or 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; | |
| typedef long long ll; | |
| typedef vector<ll> vi; | |
| ll N; |
This file contains hidden or 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
| // C implementation of search and insert operations | |
| // on Trie | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdbool.h> | |
| #define ARRAY_SIZE(a) sizeof(a)/sizeof(a[0]) | |
| // Alphabet size (# of symbols) |
This file contains hidden or 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> | |
| #define endl '\n' | |
| #define DV(value) cout << "[" << value << "]"; | |
| #define DPI(p) cout << "[" << p.first << "," << p.second << "]"; | |
| #define MAX 10000 | |
| using namespace std; | |
| typedef pair<int,int> pii; |