Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
curl http://pkgsrc.smartos.org/packages/Darwin/2012Q2/bootstrap.tar.gz \
| (cd /; sudo gnutar -zxpf -)
PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH
sudo pkgin -y update
sudo pkgin install mtr
@objectsyndicate
objectsyndicate / gist:1459260
Created December 11, 2011 08:05
Thoughts on Java and Python 1
count = 1
multiplier = 2
while count:
if count <= 20:
print "Powers of 2^%s = %s" % (count, multiplier**count)
count = count + 1
@objectsyndicate
objectsyndicate / gist:1459256
Created December 11, 2011 08:03
Thoughts on Java and Python
public class week02_ex3 {
public static void main(String[] args) {
int count = 1;
int multiplier = 2;
while (count <= 20) {
System.out.println("Powers of 2^"+ count +"=" + java.lang.Math.pow(multiplier,count));
count++;
}
}
@objectsyndicate
objectsyndicate / gist:1459244
Created December 11, 2011 07:59
PostgreSQL Create Language post 3
-bash-3.2$ psql
Password:
[user@server ~]$ psql -U pltcltest
Password for user pltcltest:
Welcome to psql 8.3.11, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
@objectsyndicate
objectsyndicate / gist:1459225
Created December 11, 2011 07:56
PostgreSQL Create Language post 2
postgres=# select * from pg_pltemplate;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler | tmplvalidator | tmpllibrary | tmplacl
-----------+-------------+---------------+-----------------------+-------------------+------------------+---------
plpgsql | t | t | plpgsql_call_handler | plpgsql_validator | $libdir/plpgsql |
pltcl | t | t | pltcl_call_handler | | $libdir/pltcl |
pltclu | f | f | pltclu_call_handler | | $libdir/pltcl |
plperl | t | t | plperl_call_handler | plperl_validator | $libdir/plperl |
plperlu | f | f | plperl_call_handler | plperl_validator | $libdir/plperl |
plpythonu | f | f | plpython_call_handler | | $libdir/plpython |
(6 rows)
@objectsyndicate
objectsyndicate / gist:1459215
Created December 11, 2011 07:55
PostgreSQL Create Language post 1
-bash-3.2$ psql
Password:
Welcome to psql 8.3.11, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
@objectsyndicate
objectsyndicate / gist:1459204
Created December 11, 2011 07:54
PostgreSQL Create Language post
pltest=> create language plperl;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>
!>
!>
!> \q
[user@server~]$
@objectsyndicate
objectsyndicate / Square.java
Created December 11, 2011 06:52
A Month Of Java Class
/**
* Do problem 3.29 from the book, but call your program Square.java. The text
* for this question is:
* Write an application that prompts the user to enter the size of the side of
* a square, then displays a hollow square of that size made of asterisks. Your
* program should work for squares of all side lengths between 1 and 20.
*
* A Note From Dr. B.
* There are 3 parts to this problem. The first is the top row of stars. After
* you have code that prints the top row of stars correctly, focus on printing
#!/bin/bash
/usr/sbin/locale-gen en_US.UTF-8
/usr/sbin/update-locale LANG=en_US.UTF-8
add-apt-repository ppa:cherokee-webserver
aptitude update
aptitude -y install build-essential python-dev python-psycopg2 python-software-properties rrdtool libxml2-dev libxslt-dev git-core cherokee libcherokee-mod-rrd postgresql