Login or register    

This is another sandbox for new users to test functionality

Mako template for city index

<%inherit file="base.mako" />

<div class="grid="15">

<em> There are ${count} cities in ${state['name'].title()} to browse:</em>

<br />

<% letters = 'abcdefghijklmnopqrstuvwxyz'%>

<div id="index">
% for letter in letters:
   % if cities[letter]:
       <a href="#${letter}">${letter.upper()}</a>
   % else:
       ${letter.upper()}
   % endif
% endfor
</div>

% for letter in letters:
   % if cities[letter]:
       <a href="#index" id="${letter}" class="letter-link">${letter.upper()}</a>
       <ul>
       % for city in cities[letter]:
           <% city = city.lower() %>
          <li><a href="/${state['short'].lower()}/${city.replace(' ','-')}">${city.title()}</a></li>
       % endfor
       </ul>
   % endif
% endfor

</div>

Game DB Schema

CREATE TABLE game (
       id VARCHAR(16) NOT NULL,
       user1_id VARCHAR(16),
       user2_id VARCHAR(16),
       token CHAR(1),
       turn_id VARCHAR(16),
       winner_id VARCHAR(16),
       createdate DATETIME,
       modifydate DATETIME,
       board BLOB NOT NULL,
       PRIMARY KEY (id),
       FOREIGN KEY(user1_id) REFERENCES user (id),
       FOREIGN KEY(user2_id) REFERENCES user (id),
       FOREIGN KEY(turn_id) REFERENCES user (id),
       FOREIGN KEY(winner_id) REFERENCES user (id)
)

CREATE TABLE user (
       id VARCHAR(16) NOT NULL,
       name VARCHAR(32),
       email VARCHAR(32),
       PRIMARY KEY (id)
)

Game DB Schema2

CREATE TABLE game (
       id VARCHAR(16) NOT NULL,
       token CHAR(1),
       turn_id VARCHAR(16),
       winner_id VARCHAR(16),
       createdate DATETIME,
       modifydate DATETIME,
       board BLOB NOT NULL,
       PRIMARY KEY (id),
       FOREIGN KEY(turn_id) REFERENCES user (id),
       FOREIGN KEY(winner_id) REFERENCES user (id)
)

CREATE TABLE user (
       id VARCHAR(16) NOT NULL,
       name VARCHAR(32),
       email VARCHAR(32),
       PRIMARY KEY (id)
)

CREATE TABLE usergame(
       id VARCHAR(16) NOT NULL,
       user_id VARCHAR(16),
       game_id VARCHAR(16),
       PRIMARY KEY (id)
       FOREIGN KEY(user_id) REFERENCES user (id),
       FOREIGN KEY(game_id) REFERENCES game (id),
)

Some linux commands for server monitoring

http://www.shanghaiwebhosting.com/web-hosting-tips/a-few-useful-linux-ssh-commands-to-show-and-monitor-server-resources-memory-disk-usage

uptime

df

free or free -m

ps -ef

w

tload

like it ?

test

(env)$ pserve development.ini

Comments

foxhop 08:58 PM 10-08-2010

test

foxhop 09:23 PM 10-08-2010

Another test

foxhop 05:59 PM 06-02-2011

This is pretty sweet I think, and yes, I like it.

foxhop 11:29 PM 07-08-2011

Thanks for that chooper! I'm sure this will come in handy for somebody.

Leave a comment

Please login or register to leave a comment!