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/python | |
import sys | |
import shutil | |
def copyr(f,t,fnd,repl): | |
""" A simple string replace in files. You may wish to extend it for regex.""" | |
while f: | |
line = f.readline() | |
if len(line) == 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
#in a clojure repls sterted through java -cp {path-to-clojure.jar}:{path-to-clojure-contrib.jar} clojure.main | |
user=> (use 'clojure.contrib.string) | |
java.lang.VerifyError: class clojure.contrib.string$loading__4403__auto__ overrides final method meta.()Lclojure/lang/IPersistentMap; (NO_SOURCE_FILE: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
projects = {'ProjectA' : {'deps' : ['ProjectB']}, | |
'ProjectB' : {'deps' : None}, | |
'ProjectC' : {'deps' : ['ProjectA']}} | |
cont = 0 | |
def deploy(name, desc): | |
""" | |
Detects the order of deploy for projects in a dict. | |
Each dic entry is the name of Projet : {desc}, where desc is a dict containing: |
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
(ns deps) | |
(def projects {:ProjectA {:deps [:ProjectB] | |
:desc "Web tier"} | |
:ProjectB {:desc "Service tier"} | |
:ProjectC {:deps [:ProjectB] | |
:desc "Persistence"}}) | |
(defn dep [s name sup] | |
(println "ini" s name sup) |
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
from fabric.operations import sudo, local, put, run | |
from fabric.api import * | |
from fabric.context_managers import cd | |
import logging | |
env.cwd = '/home/user' | |
env.hosts = ['linx'] |
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
{- learning from http://learnyouahaskell.com/ -} | |
doubleMe x = x + x | |
doubleSmall x = if x > 100 | |
then x | |
else x * 2 | |
len xs = sum [1 | _ <- xs] | |
per = ("Paulo", 28) | |
removeNonUppercase :: [Char] -> [Char] | |
removeNonUppercase st = [c | c <- st, elem c ['A'..'Z']] |
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
a;b;c;d | |
1;3;4;2 | |
2;3;4;1 | |
2;4;3;1 | |
4;3;2;1 | |
4;1;3;2 | |
4;3;2;1 | |
4;3;2;1 | |
1;3;2;4 | |
2;1;4;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
(ns lemo | |
(:use (incanter core io charts stats))) | |
(def lemo (read-dataset "lemo.txt" | |
:header true | |
:delim \;)) | |
(defn bar [data title] | |
(bar-chart ["p" "a" "m" "c"] | |
data |
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
(ns ^{:doc "Helper functions that extends existing Clojure" | |
:author "Paulo Suzart"} | |
collext) | |
(defn | |
^{:doc "Returns a Vector containing f applied to every argument. | |
The f function is supposed to take one argument" | |
:test (fn [] | |
(is (= [1 4 9 16 25 36] (mvector #(* % %) 1 2 3 4 5 6))) | |
(is (= ["TEST"] (mvector #(.toUpperCase %) "test"))))} |
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
2010-09-16 10:38:39.152/670.731 Oracle Coherence GE 3.5.3/465 <Error> (thread=Invocation:Management, member=4): | |
java.lang.NullPointerException | |
at com.tangosol.coherence.component.net.management.model.localModel.ClusterNodeModel.getBufferPublishSize(ClusterNodeModel.CDB:4) | |
at com.tangosol.coherence.component.net.management.model.localModel.ClusterNodeModel.writeExternal(ClusterNodeModel.CDB:5) | |
at com.tangosol.util.ExternalizableHelper.writeExternalizableLite(ExternalizableHelper.java:1994) | |
at com.tangosol.util.ExternalizableHelper.writeObject(ExternalizableHelper.java:2364) | |
at com.tangosol.io.DefaultSerializer.serialize(DefaultSerializer.java:51) | |
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.writeObject(Service.CDB:4) | |
at com.tangosol.coherence.component.net.Message.writeObject(Message.CDB:1) | |
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationResponse.write(InvocationSer |