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
Palidromized topcoder | |
string minAdds(string s) { | |
string res,a,b,aux; | |
a=s;b=s; | |
aux=s; | |
reverse(aux.begin(),aux.end()); | |
if(s == aux) | |
return s; |
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
;; TopCoder .cc compile function. (When using .cpp change -3 -> -4 -two times-) | |
(defun tc () (interactive) | |
(compile (concat "g++ " (buffer-name)" -Wall -g -o "(substring (buffer-name) 0 -3)" && ./"(substring (buffer-name) 0 -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
// Sergio Botero | |
// Status: | |
#include <cstdio> | |
#include <string> | |
int main (){ | |
while( 1 ){ | |
for(int i = 0; i < 25; usleep(30000), printf("%s+%s+%s\r", std::string(i++, ' ').c_str(), std::string( 50-(2*i) , ' ').c_str(), std::string(i, ' ').c_str())) fflush(stdout); | |
for(int i = 25; i >= 0; usleep(30000), printf("%s+%s+%s\r", std::string(i--, ' ').c_str(), std::string( 50-(2*i) , ' ').c_str(), std::string(i, ' ').c_str())) fflush(stdout); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \ | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- Contains a unique string that identifies your daemon to launchd. | |
This key is required. --> | |
<key>Label</key> | |
<string>com.gocongress.backup</string> |
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
for (NSDictionary *dict in [samplePlist objectForKey:@"map_points"]) { | |
// NSLog(@"%lf %lf %@", [[dict objectForKey:@"latitude"] doubleValue], [[dict objectForKey:@"longitude"] doubleValue], [dict objectForKey:@"title"]); | |
CLLocationCoordinate2D coord = { [[dict objectForKey:@"latitude"] doubleValue] , [[dict objectForKey:@"longitude"] doubleValue] }; | |
MPoint *point = [[MPoint alloc] initWithCoordinate:coord]; | |
[point setTitle:[dict objectForKey:@"title"]]; |
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
/* @(#)counting_sort_cool.c | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
/* #include "counting_sort.h" | |
*/ | |
int main(int argc, char * argv[]) |
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
if( ((flags & kCGEventFlagMaskAlphaShift) == 0 && | |
(flags & kCGEventFlagMaskShift) == 0 && | |
(flags & kCGEventFlagMaskControl) == 0 && | |
(flags & kCGEventFlagMaskAlternate) == 0 && | |
(flags & kCGEventFlagMaskCommand) == kCGEventFlagMaskCommand && | |
(flags & kCGEventFlagMaskHelp) == 0 && | |
(flags & kCGEventFlagMaskSecondaryFn) == kCGEventFlagMaskSecondaryFn && | |
(flags & kCGEventFlagMaskNumericPad) == kCGEventFlagMaskNumericPad && | |
(flags & kCGEventFlagMaskNonCoalesced) == kCGEventFlagMaskNonCoalesced) && |
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
#!/bin/bash | |
# | |
# | |
# Script name: Que belleza | |
# Author: Sergio Botero sbotero2[a]eafit.edu.co | |
# | |
# | |
## IP | |
readonly ips="10.10.60." |
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
#!/usr/bin/env bash | |
## | |
# Install: | |
# curl -sL https://raw.github.com/gist/2108403/fast.sh | sh | |
# | |
# Share your feedbacks on: | |
# https://gist.github.com/2108403 | |
# | |
# Author: @DAddYE (Twitter/Github) |
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
///// request 1, fetch pet symptoms in http://link.to.pets/in.json | |
{ | |
"petparts": [ | |
{ | |
"partname": "tail", | |
"symptoms": [ | |
{ | |
"id": 1, | |
"name": "long tail" |
OlderNewer