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 <stdio.h> | |
void revertWord( char *start, char *end ) { | |
char temp; | |
while( start < end ) { | |
temp = *start; | |
*start = *end; | |
*end = temp; | |
++start; | |
--end; |
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 <sstream> | |
#include <stack> | |
using namespace std; | |
// using stack | |
string revertStack( string sentence ) { | |
stringstream inout(sentence); | |
string word, news; |
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
sentence = "The quick brown fox jumped over the lazy dog." | |
print "before: ", sentence | |
sentence = " ".join( sentence.split()[::-1] ) | |
print "after: ", sentence |
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
######################################################################## | |
# $HeadURL $ | |
# File: TypedList.py | |
# Author: Krzysztof.Ciba@NOSPAMgmail.com | |
# Date: 2012/07/19 08:21:16 | |
######################################################################## | |
""" :mod: TypedList | |
======================= | |
.. module: TypedList | |
:synopsis: typed list |
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
//Standard Java imports | |
import java.io.IOException; | |
import java.util.Iterator; | |
import org.apache.commons.lang.StringUtils; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.*; | |
import org.apache.hadoop.mapred.*; | |
public class Batting { |
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
######################################################################## | |
# $HeadURL $ | |
# File: Graph.py | |
# Author: Krzysztof.Ciba@NOSPAMgmail.com | |
# Date: 2012/09/27 07:22:15 | |
######################################################################## | |
""" :mod: Graph | |
======================= | |
.. module: Graph |
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/sh | |
REPOS="$1" | |
TXN="$2" | |
AEOLUS=/PATH/TO/REPO/hooks/aeolus.py | |
#line endings | |
$AEOLUS -t "$TXN" "$REPOS" || exit 1 | |
exit 0 |
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 python | |
# @file aeolus.py | |
# @author Krzysztof Danile Ciba (Krzysztof.Ciba@NOSPAMgmail.com) | |
# @brief svn pre-commit hook for checking correct line endings | |
import os, sys | |
import re | |
import svn | |
import svn.fs | |
import svn.repos | |
import svn.core |
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
class IncludeRegexpStrategyRule(StrategyRule): | |
"""Include symbols matching pattern.""" | |
def __init__(self, pattern): | |
try: | |
self.regexp = re.compile('^' + pattern + '$') | |
except re.error: | |
raise FatalError("%r is not a valid regexp." % (pattern,)) | |
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
[Fri, 04 Nov 14:17 E0][cibak@localhost:~/test]> python test.py | |
##### creating child | |
in child, gX is there? False | |
in child, foo is there? False | |
##### baseClass.run() execution | |
in base class run | |
gX = 1 | |
function foo called | |
##### testChild.myRun() execution | |
in testChildMyRun |