Browse files

Merge branch 'master' of github.com:massemanet/dotfiles.mac Conflicts:

	centos.txt
  • Loading branch information...
2 parents 89512f8 + c73be14 commit 1eb52aae3ce061f55ba6d28f1fcdb1589ac227d2 mats cronqvist committed Apr 10, 2012
Showing with 49 additions and 31 deletions.
  1. +2 −1 .gitignore
  2. +21 −13 centos.txt
  3. +26 −17 clr.erl
View
3 .gitignore
@@ -22,13 +22,14 @@ foo*
/.Xauthority
/.aspell.*
/.bash_history
+/.config/
/.dropbox/
/.emacs.d/
/.fontconfig/
/.gem/
/.lein/
/.lesshst
-/.local/share/googlecl/
+/.local/
/.m2/
/.pip/
/.sh_history
View
34 centos.txt
@@ -6,42 +6,50 @@ sudo gem update
sudo gem install vagrant
## per box
-NAME=centos-6.2
+NAME=oneiric
BOX=http://timhuegdon.com/vagrant-boxes/ubuntu-11.10.box
+NAME=centos-6.2
BOX=http://packages.vstone.eu/vagrant-boxes/centos/6.2/centos-6.2-64bit-puppet-vbox.4.1.10-3.box
+
vagrant box add $NAME $BOX
mkdir -p ~/boxes/$NAME
+ln ~/.ssh/id_rsa ~/boxes/$NAME
cd ~/boxes/$NAME
vagrant init $NAME
## per session
vagrant up
-vagrant ssh
+vagrant ssh -- -X
## my files
ln ~/Dropbox/masse/rpm/*rpm ~/boxes/$NAME
-# on the centos box
+# on the linux box
+
+#UBUNTU
+sudo aptitude install git tmux python-software-properties deborphan
+sudo add-apt-repository ppa:cassou/emacs
+sudo aptitude update
+sudo aptitude install emacs-snapshot-nox
+# CENTOS
## oneshot normal RPMs
FORGE=rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
wget http://pkgs.repoforge.org/rpmforge-release/$FORGE -O/tmp/$FORGE
sudo rpm -i /tmp/$FORGE
sudo yum --assumeyes update
sudo yum --assumeyes install git bash-completion man tmux
-## oneshot dotfiles
-(cd /tmp ; git clone git://github.com/massemanet/dotfiles.centos.git)
-mv /tmp/dotfiles.centos/.git ~
-rm .bash*
-git fetch
-git reset --hard
-
-## oneshot keys
-sudo mv /vagrant/id_rsa* /home/vagrant/.ssh
-
## oneshot private RPMs
sudo yum --assumeyes install /vagrant/liblockfile-1.08-9.el6.x86_64.rpm
sudo yum --assumeyes install /vagrant/emacs-filesystem-24.0.93-3.el6.x86_64.rpm
sudo yum --assumeyes install /vagrant/emacs-common-24.0.93-3.el6.x86_64.rpm
sudo yum --assumeyes install /vagrant/emacs-nox-24.0.93-3.el6.x86_64.rpm
+
+## oneshot dotfiles
+rm .* *
+cp /vagrant/id_rsa ~/.ssh/
+sudo aptitude install git
+(cd /tmp ; git clone git@github.com:massemanet/dotfiles.centos.git)
+mv /tmp/dotfiles.centos/.git ~
+git reset --hard
View
43 clr.erl
@@ -10,9 +10,11 @@
-export([octree_new/1
,octree_put/3
,octree_get/2
+ ,octree_clear/2
,octree_first/1
,octree_last/1
- ,octree_clear/2]).
+ ,octree_next/2
+ ,octree_prev/2]).
go() ->
mk_table(),
@@ -68,18 +70,6 @@ octree_clear([I|K],Tree) ->
SubTree -> sete(I,Tree,octree_clear(K,SubTree))
end.
-%% return value V associated with kwy K
-%% throw error if K does not exist
-octree_get([],_) ->
- error(no_such_key);
-octree_get([I|K],Tree) ->
- case element(I,Tree) of
- {} -> error(no_such_key);
- {K,V} -> V;
- {_,_} -> error(no_such_key);
- SubTree -> octree_get(K,SubTree)
- end.
-
%% store value V associated with key K.
%% K is a list of integers between 1 and N
%% N is the cardinality of the tree
@@ -97,28 +87,47 @@ octree_put([I|K],V,Tree) ->
sete(I,T,V) -> setelement(I,T,V).
-%% ccreate an empty tree with cardinality N (defaults to 8)
+%% create an empty tree with cardinality N (defaults to 8)
octree_new() -> octree_new(8).
octree_new(C) -> erlang:make_tuple(C,{}).
+%% return value V associated with kwy K
+%% throw error if K does not exist
+octree_get([],_) ->
+ error(no_such_key);
+octree_get([I|K],Tree) ->
+ case element(I,Tree) of
+ {} -> error(no_such_key);
+ {K,V} -> V;
+ {_,_} -> error(no_such_key);
+ SubTree -> octree_get(K,SubTree)
+ end.
+
+%% return first Key in Tree
octree_first(Tree) ->
edge(1,1,Tree).
+%% return last Key in Tree
octree_last(Tree) ->
edge(tuple_size(Tree),-1,Tree).
edge(I0,Inc,Tree) ->
- case subtree(I0,Inc,Tree) of
+ case next_subtree(I0,Inc,Tree) of
{key,K} -> K;
{I,SubTree} -> [I|edge(I0,Inc,SubTree)];
{} -> []
end.
-subtree(I,Inc,Tree) ->
+next_subtree(I,Inc,Tree) ->
try element(I,Tree) of
- {} -> subtree(I+Inc,Inc,Tree);
+ {} -> next_subtree(I+Inc,Inc,Tree);
{K,_} -> {key,[I|K]};
Subtree -> {I,Subtree}
catch
_:_ -> {}
end.
+
+octree_prev(_,_) ->ok.
+
+octree_next(Key,Tree) ->
+

0 comments on commit 1eb52aa

Please sign in to comment.