Feeds:
Posts
Comments

Archive for January, 2009

Obama’s Inauguration

Obama’s inauguration is more evidence of the “non-change” coming our way. Costing $170 million dollars and coupled with extreme perks for the wealthy it is clear nothing has changed.

His swearing into off IS a huge moment in United States history, but that is exactly what makes it the perfect moment for him to make it clear that we can no longer continue our ways of the past. Instead it is full of wasteful spending and ties to the CEO’s of this nation that thrive on the inequalities he claims to want to fight against.

This is the moment he should speak against these massive inequalities. However, now if he does it will feel empty as you look towards the VIP section and the runways of local airports filled with private jets.

Get real change, dump the bosses and politicians off your back.

Read Full Post »

Paul Krugman had a post today spelling out what he sees wrong with the Obama administration’s current economic stimulus plan and what he suggests to do.

Let me put on my capitalist hat really quick…

Assuming I care to save the economy and not take the chance that a depression and then bankruptcy of the United States would lead to a socialist revolution…

As I am not an economist anything I say can just be swept away, but I think its clear tax cuts are not whats needed. To make sure no one assumes my beliefs when I have my capitalist hat on, neither are tax increases. My understanding is situations like this occur due to having too much stuff and no one to sell it to. How is giving the ability to make more stuff for no one to buy a solution? While we need to get banks lending again to help people keep their jobs and stores able to put products on their shelves, the people who need money are at the the bottom, they are the ones who do the consuming.

Spending on creating jobs, increasing time allowed on unemployment, increasing spending on social programs, getting health care for all, etc to me seem like the obvious places the government should be pushing its money to not only help the people who need it but to keep disastor away.

If money that would be thought of as “tax cuts” is instead spent on infastructure projects it means more jobs, more money in the hands of those likely to spend it and better cities, towns, highways, …

Why would anyone let the Republicans (or the Democrats) get in the same old bullshit solution of tax cuts.

My projection: The bailouts and stimulus packages will continue coming for years and years since this attempt will not do enough, and especially not put enough money where it needs to be. This will lead to either a economic stagnation like we’ve seen in other countries before or a depression if things go very bad.

Or maybe we’ll get “lucky” and another bubble will form waiting to be popped later.

My solution: Replace capitalism’s booms and busts with planned socialism.

Read Full Post »

To continue with my descriptions of my experiences with being on Paxil, in hopes those also scouring the Intenret for information on their own experiences will find this, I’ll be talking about its effect on my dreams.

Before, I would rarely remember dreams or have very vivid dreams. I have on occasion had the experience of waking the next day and not being sure if a dream was a real memory or just a dream, very rarely though. For a while now I’ve been having extremely vivid dreams that then mix into my real memories. The day I awake I spend time trying to sort out the real from the made up. Sometimes upon waking up, others would pop into my head throughout the day and need to be sorted out.

I don’t know why, but I’d almost say the actual dreams are more work than the sorting out the next day. Its like being awake 24/7. I’d like to just be asleep and not have to do the same things I do during the day even while I’m sleeping.

From my research this is a common side effect and I have not seen anything that would lead me to believe it gets worse. So, thats all for now, I’ll write about the dreams again if anything changes.

Read Full Post »

On ABC’s “This Week” today Obama, when questioned about investigating the crimes of the Bush administration, said he wants to ‘look forward’ instead of backwards.

While he did not out right say he would investigate and did not say he would not appoint a special prosecutor, his ‘looking foward’ quote says it all to me. This is the same line we’ve heard from all top Democrat officials. The problem is, how is investigating the crimes of a past administration and prosecuting them not looking forward? Letting the crimes go is saying just what the Democrats claim they disagree with, some are above the law.

An investigation, and eventually procecutions, make it known that no one is above the law and sets a precedent for all future administations. Not going forward with an investigation is a slap in the face to the people and proof of the Democrats worthlessness when it comes to implementing real “change”.

Read Full Post »

Tilda: Alive and Moving

Tilda is alive. Thanks to Dan Krol a number of patches were merged, so look forward to many new features. Also, I’ve moved Tilda development to Git and I am hosting the code on GitHub now.

Read Full Post »

Nitrogen is a new Erlang web framework. It is event driven and a very natural fit for Erlang and makes web programming almost enjoyable.

The documentation is much better than when I first started with Nitrogen but there is still some lacking that requires searching through the source code. Here I’ll describe how I implemented users for a current project, still very much in its infancy, I am working on using Nitrogen and Mnesia.

The functions I reference can be found in the source code for the beerenthusiats.org project on github. I will not link directly to the source file for each module but instead the source directory, in case a filename changes or is moved to a subdir in the future. The source for the actual page generation of even the simple pages is long for a blog post so please view those through the github interface. Nitrogen’s templating system and callback system are very simple and you can learn those from Nitrogen’s documentation, thus I don’t bother to explain how the pages work.

We’ll have simple user accounts storing just username, password (hash) and email address. Thus we need a page that allows users to enter this data, look at web_register.erl in the git repo.

This module sends the data to another Erlang module, db_backend, for checking and insertion to the database. The database backend must hash, we’ll use sha1, the password and check that the username is not already in use and finally insert.

First, we need a record that describes the users table:

-record (users, {username, email_address, password}).

Next, we have an init/0 function that is only run once that creates the database and the table.

init () ->
  mnesia:create_schema ([node()]),
  mnesia:start(),
  mnesia:create_table (users, [{attributes, record_info (fields, users)}, {disc_copies, [node()]}]),
  mnesia:stop().

The create_table function takes a list of attributes, here we use the record_info function to get that list from the users record, and parameters describing how and where the data is to be stored. Here we use disc_copies and only send node(). This means that the data in users should be stored on disk, but also in main memory, as opposed to storing only on disk or only in memory. Sending node() tells Mnesia we are only storing this table on the current node. Obviously, we can see it would be very easy to store the database across multiple Erlang nodes.

Lastly, we have a start/0 function that is run each time the app is started to start Mnesia and crypto, which is used for hashing the password.

start () ->
  crypto:start(),
  mnesia:start().

The add_user/3 (called from web_register) function inserts the record (a table row) to the users table with the write/1 function that you can view in the db_backend module’s source and see how it works and how it uses transactions. You can ignore the call to couchdb_util:db_create/1. However, if you are interested in how I work with Couchdb those files are in the repo as well.

add_user (Username, EmailAddress, Password) ->
  <PasswordDigest:160> = crypto:sha(Password),
  Row = #users{username=Username, email_address=EmailAddress, password=PasswordDigest},
  case write (Row) of
    {atomic, Val} ->
      couchdb_util:db_create (Username),
      ok;
    {aborted, Reason} ->
      io:format ("Adding user failed!~nRow: ~s aborted.~nReason: ~s~n", [Row, Reason]),
      aborted
end.

Now a user is in the database, users must be able to login. web_login is the module containing beerenthusiasts.org basic login page. Here is the main event function from that login page that is called when the user tries to login from that page:

event (login) ->
  case db_backend:validate(hd(wf:q(username)), hd(wf:q(pass))) of
    {valid, _ID} ->
      wf:flash ("Correct"),
      wf:user(hd(wf:q(username))),
      wf:redirect("your_page");
    _ ->
      wf:flash ("Incorrect")
  end;

This page uses the function validate/2 which takes a username and password from the fields and checks if it matches in the users database:

validate (Username, Password) ->
  <PasswordDigest:160> = crypto:sha(Password),
  case do (qlc:q ([X#users.username || X <- mnesia:table(users), check (X#users.username,
           X#users.email_address, Username), X#users.password == PasswordDigest])) of
    fail ->
      not_valid;
    Results ->
      if
        length (Results) == 1 ->
          {valid, hd(Results)};
        true ->
          not_valid
      end
  end.

I won’t go into all the details of how Mnesia is queried, but as you can see from the code above it does not use SQL. Instead, you use list comprehension, the same as anywhere else you use it in Erlang, to query the database tables. qlc:q/1 takes a list comprehension and returns a Mnesia query that can be run, look at the do/1 function in db_backend to see how it is send to Mnesia. List comprehension and the record syntax (X#users.username for example) is a very natural fit for relational algebra and for me personally much nicer than SQL.

Nitrogen provides the function wf:user() to check if a user is currently logged in.

case wf:user() of
  undefined ->
    wf:redirect("register"),
      Header = "";
    _ ->
      Header = "user_header"
  end,

The wf:user/0 function goes to the wf_session module. This module handles creating, destroying and checking sessions. Nitrogen contains a separate process which tracks users and state. This process is queried when a call to a wf function requires knowledge of the current session, if one exists.

Read Full Post »

Watch Gupta on CNN about health care:

http://www.youtube.com/watch?v=JpKoN40K7mA (also many follow ups on CNN’s Larry King)

Lovely, can Obama please appoint ONE goddamn progressive or at least one TRUTHFUL person?!? ONE!

Happy with your “change” yet people?

Read Full Post »

For anyone who reads or watches news media in the United States you know one thing is clear, Gaza deserves to get the shit blown out of them. I mean, really, what if your neighborhood had a rocket land in it? Wouldn’t you want the United States military to attack with full force the people who did it and anyone who lives anywhere near them? And wouldn’t you want your United States government, prior to this rocket, to occupy their land and oppress their people until they fight back to give reason for wiping out their entire population?

Oh… You wouldn’t want either of those…

I don’t know whats more insane, the lies and backing of Israel or that the best defense of Israel is, ‘people lobbed a few rockets, so of course they must demolish all of Gaza’.

The complete disregard politicians in the United States have for International Law, treaties, human rights, etc… is appalling and any support for them is just as appalling. Obama won’t say a word because of his, ‘one president at a time’, pledge. What a load of shit. He’ll speak about anything until it comes to an issue that, in my opinion, he knows he should condemn Israel, the love child of the United States, and pledge to pull back support from them, but also knows he must instead support Israel, pledge full support and say, Gaza had it coming.

Maybe I’m wrong… Maybe when he comes out in support of Israel he truely is that stupid. But I find that hard to believe, no matter how much I disagree with Obama I can’t believe him to be that igornant. So, what of all the other politicians? Do they not care about human beings at all? Or instead are they just ignorant? Maybe they are Zionists? Maybe they are Christians waiting for the Jews to either be wiped out or become Christians?

Whatever the case, both Democrats and Republicans show time and again their lack of compassion for people in the United States and the rest of the world. They care about votes, money and power.

The system is broke, get rid of it.

Read Full Post »

Follow

Get every new post delivered to your Inbox.