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
//Convierte un numero N en base B a decimal | |
public int toDecimal(int n, int b) | |
{ | |
int result=0; | |
int multiplier=1; | |
while(n>0) | |
{ | |
result+=n%10*multiplier; | |
multiplier*=b; |
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
set<int>f,s,tmp; | |
set_intersection(all(f),all(s), inserter(tmp, tmp.begin())); |
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 <algorithm> | |
#include <iostream> | |
#include <cmath> | |
#include <cstring> | |
#include <string> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
using namespace std; |
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 <iostream> | |
#include <cstdio> | |
#include <cmath> | |
#include <cstring> | |
#include <string> | |
#include <cstdlib> | |
#include <vector> | |
#include <set> | |
#include <map> |
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 <iostream> | |
#include <set> | |
using namespace std; | |
const int MAXN = 50005; | |
int p[MAXN]; | |
int find(int u){ | |
if (p[u] == u) return u; | |
return p[u] = find(p[u]); |
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
export ARCHFLAGS="-arch i386 -arch x86_64" ;sudo gem install --no-rdoc --no-ri -v=2.7 mysql -- --with-mysql-dir=/opt/local/bin/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config |
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
$("#dialog").dialog({ | |
bgiframe: true, | |
autoOpen: false, | |
height: 600, | |
width: 500, | |
modal: true, | |
buttons: { | |
'Lend Asset': function() { | |
$("#new_lending").submit(); | |
$(this).dialog('close'); |
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
cat .ssh/id_rsa.pub | ssh [email protected] "cat >> .ssh/authorized_keys" |
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
(defun toggle-fullscreen () | |
(interactive) | |
(set-frame-parameter nil 'fullscreen (if (frame-parameter nil 'fullscreen) | |
nil | |
'fullboth))) | |
(global-set-key [(meta return)] 'toggle-fullscreen) |
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
alias rmb='echo -n "Really clean this directory? [y/n] "; | |
read yorn; | |
if test "$yorn" = "y"; then | |
rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp core a.out; | |
echo "Cleaned"; | |
else | |
echo "Not Cleaned"; | |
fi' | |
# alias emacs='open /Applications/Emacs.app' |
OlderNewer