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
| def tupleListForPageView(pvld: PageViewLogData): TupleList = { | |
| import com.yieldmo.hadoop.scalding.DiscreteVariableStates._ | |
| val isCell = (Option(pvld.getCellular()) getOrElse false).asInstanceOf[Boolean] | |
| val location = Option(pvld.getLocation()) getOrElse { new Location } | |
| var metro = "other" | |
| var country = "other" | |
| Option(location).foreach { loc: Location => | |
| if (loc.getMetroCode != 0) metro = "" + loc.getMetroCode | |
| Option(loc.getCountryCode) foreach { x: String => country = getCountry(x) } | |
| } |
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
| def tupleListForPageView(pvld: PageViewLogData): TupleList = { | |
| import com.yieldmo.hadoop.scalding.DiscreteVariableStates._ | |
| val network = if ((Option(pvld.getCellular()) getOrElse false).asInstanceOf[Boolean]) "cell" else "wifi" | |
| val location = Option(pvld.getLocation()) getOrElse { new Location } | |
| val (metro: String, country: String) = { | |
| Option(location) map { loc: Location => | |
| val x1 = if (loc.getMetroCode != 0) "" + loc.getMetroCode else "other" | |
| val x2 = Option(loc.getCountryCode) map { x: String => getCountry(x) } | |
| (x1,x2) | |
| } getOrElse {("other", "other")} |
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
| #!/bin/bash | |
| DESTINATION=/usr/local/Cellar/tomcat/7.0.41/libexec/webapps | |
| SOURCE=/Users/agallego/workspace/tld/portal/target/ROOT.war | |
| rm -rf $DESTINATION/ROOT* | |
| cp $SOURCE $DESTINATION | |
| /usr/local/Cellar/tomcat/7.0.41/bin/catalina run | |
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
| #!/bin/bash | |
| DESTINATION=/usr/local/Cellar/tomcat/7.0.42/libexec/webapps | |
| SOURCE=/Users/agallego/workspace/tld/portal/target/ROOT.war | |
| export JAVA_OPTS=" -Xrunjdwp:transport=dt_socket,address=localhost:9999,server=y,suspend=n -Dshard_id=1027 $JAVA_OPTS" | |
| case "$1" in | |
| -i) | |
| echo "Deploying intranet" |
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
| (require 'package) | |
| (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) | |
| ;; (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t) | |
| (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t) | |
| (package-initialize) | |
| (when (not package-archive-contents) | |
| (package-refresh-contents)) |
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
| package main | |
| import ( | |
| "bitbucket.org/agallego/log" | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "net/http" | |
| ) |
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
| $ git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done |
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
| # don't put duplicate lines in the history. See bash(1) for more options | |
| # ... or force ignoredups and ignorespace | |
| HISTCONTROL=ignoredups:ignorespace | |
| # append to the history file, don't overwrite it | |
| shopt -s histappend | |
| # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) |
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
| function workLog { | |
| dirs=$(ls $HOME/workspace) | |
| for d in $dirs | |
| do | |
| d=$HOME/workspace/$d | |
| if [[ -d $d/.git ]]; then | |
| cd $d | |
| gituser=`git config user.name` | |
| echo "Project: $(pwd):$gituser" | |
| # git --no-pager log --author='$gituser' --oneline --decorate |
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
| % FactorProduct Computes the product of two factors. | |
| % C = FactorProduct(A,B) computes the product between two factors, A and B, | |
| % where each factor is defined over a set of variables with given dimension. | |
| % The factor data structure has the following fields: | |
| % .var Vector of variables in the factor, e.g. [1 2 3] | |
| % .card Vector of cardinalities corresponding to .var, e.g. [2 2 2] | |
| % .val Value table of size prod(.card) | |
| % | |
| % See also FactorMarginalization.m, IndexToAssignment.m, and | |
| % AssignmentToIndex.m |