Friday, October 22, 2010

A server client socket example in java

Well I wrote this in eclipse in preparation for a school project, the idea was to write a server that can take and talk to multiple connections at the same time, or send data to a specific client. You must import the package in eclipse to run unless you want to compile from command line.

Download It Here:
http://gitorious.org/simple-server-client-messaging-experiment/simple-server-client-messaging-experiment/trees/master

To start the server: navigate in the package explorer to src> MultiConnectionTests> MultiConnectionServer.java and  right click, run as "Java Application" you may get a firewall warning, just allow it. The server uses the console for its io.

To start a client: navigate in the package explorer to src>Tests>hostageclient.java and right click run as "Java Application". This uses a swing interface for its i/o. It take the ip of the server as a cmdline instruction and assumes localhost if none is given.

Once you have a server and one or many clients open you can start communicating. The client must talk to the server so all you have to do is type into the text box at the bottom of the applet window to send a message to the server. The server however can talk to all clients at once, or one at a time. Each client is given a number when he connects to the server, if you want to talk to a single client, then prefix your message with the space separated client number. EX:

server~$ 1 hi there client one

sends the message "hi there client one" to client 1. If you want to send a message to all clients, you simply dont put a number there.


server~$ hi there all

sends the message "hi there all" to all the clients.

Balling Eh?

Thursday, October 21, 2010

Database Closure and Candidate Key Solver

This program uses sets to determine all the candidate keys and all non trivial closures of a given a list of single letter attributes and a set of functional dependences. Written in c++. As a learning exercise for my database class


TODO:
-make it find canonical covers

get it here, you will not need git to download 
http://gitorious.org/database-closure-and-candidate-key-solver/database-closure-and-candidate-key-solver/trees/master


Colloquium Paper
10/18/10
President Meets Representatives from Vulcan!
In a incredible turn of events the President of the United States as well as the leaders of several other nations have met with the Alien race called the 'Vulcans'. The crucial initial meeting was almost jeopardized by a group of political activists and conspiracy theorists that claimed a rendezvous on the Vulcan's nuclear powered space ship could simply be a clever ruse by the aliens to assassinate or assimilate the leader of the free world and his compatriots. Arguing that the ship's powerful reactor could easily release enough radiation to fry the President, the activists lead a full media assault against the meeting. The various world leader began to suspect the worst upon hearing this news and nearly all but the President refused to attend. While the Vulcan's fair skin, pointy ears and psychic powers might insinuate a bad attitude, their reaction to the activist's theories couldn't have been more compliant and logical. The Vulcans teleported all of their ship's reactor designs directly to the President's Oval Office and gave the President their personal assurance that no harm would come to him or the other leaders. Sources inside the White House claim the the reactor is powered by cold fusion and, stored inside a lead lined cavity in the heart of the ship. Despite the obvious proof from the teleportation device that the Vulcans could easily harm the leaders without an elaborate ruse; there was much concern over the leaders safety and the long term effects of the radiation. Conspiracy theorist Duke Taft argued that the radiation was designed to kill the world leaders in the long run and would simply serve to create mass political instability across the globe after their death. At which time the Vulcans would seize control and experiment on us. There was considerable confusion amongst the various world leaders upon reading Luke's blog post. Undeterred the President reviewed the reactor documents and after discussing them with his Science Staff, he concluded that the ship released about 80 rem of radiation. This number only fueled the activists concerns, but the President, determined to further humanity argued in a golden oratory that a radiation level of less than 100 rem was safe for healthy humans. “My health will remain unaffected by the radiation on this ship. In what is described as a 'threshold' effect my body will naturally repair the damage of the radiation below 100 rem. The long term possibility of cancer is not a danger as well, because of the limited time I will be in the ship. The cancerous effects of this limited dose of radiation would come long after my presidential term, if ever. As a result I have concluded that there is little health risk, the Vulcans and I will meet in their ship on Wednesday”. The activists and world leaders were put at ease by this news excluding the dictators and monarchs as their 'presidential terms' would never end. Regardless of their lack of attendance the negotiations continued as planed. The summit held between the world leaders, led by the President of the United States and the leader of the Vulcan people and the Vulcan High Counsel was reportedly a complete success. Not only did the President return unharmed but it seems that the Vulcans pose no threat to us and have even offed to take several emissaries back to their home world to sample its culture.
If you are looking for a program like artmoney on linux apparently scanmem is a good eqivilent. I have been looking for something like this for some time, so this is very exciting for me. It looks like its got a bit of a learning curve though. Let me know if you know of any, graphical or not programs that do this. GDB seems promising. Its in the ubuntu repo

sudo apt-get install scanmem

Wednesday, June 9, 2010

Yes. It is hypocritical to say "don't copy" when everybody I know is a copyist. I'm certainly on the wrong side of copyright law at least once a day for things like pasting articles into emails. I've been an avid copyist all my life, if it wasn't for mix tapes, my entire adolescence would have been celibate! I can't do my job unless I have the source material around so I scan records and photocopy library books I can't take out. It's how we all learn to do stuff. That's how we are, we are descendents of molecules formed a million years ago because they figured out how to replicate themselves. We have a name for things that don't copy themselves: dead.

-- Cory Doctorow (craphound.com)

Thursday, January 28, 2010

Critique of Nietzsche's Solution to Morality

This is my paper for I wrote for Honors Colloquium. I put it together very late at night so I'm sure its a little scrambled; I really enjoyed reading "On the Genealogy of Morality" and writing it though.

Honors Colloquium

Due 1/27/10

In “On the Genealogy of Morality” Friedrich Nietzsche deduces the root of social conflict by examining the history of morality. Through Nietzsche's prose the reader discovers that the definition of good is essential to morality and equally essential is good's complement, the evil or bad. Nietzsche proceeds to examine the bipartite nature of morality, morality of the weak, or slave morality (evil), and morality of the strong, or master morality (bad); concluding that in embracing weak morality “We have lost our fear of … our love for man.” It is fear of complacency in mankind that leads Nietzsche to the solution: eliminate slave morality. For Nietzsche, weak morality is the product of resentment, held by the plebeians in response to master morality. It is this fundamental resentment, described as scheming cold and calculating, that Nietzsche believes will be terminal. He choses instead to embrace master morality, which he finds superior. I think that Nietzsche's solution, while on the right track, is ultimately untenable. I would argue that the disoperation between master and slave morality is polarizing and pernicious; if humanity is to flourish, we must excise morality entirely from society. In this paper I will first analyze how Nietzsche's argument for strong morality is presented in the allegory of the birds of prey and the sheep and connect it with his thesis (s. 13); then I will link Nietzsche's endorsement of strong morality over weak to his allegory, and extend his metaphor to explain the need to remove morality; and finally I will conclude with the advantages of expulsion of morality, and address the implications. To prove my thesis I must prove that slave and master morality have a disoperational nature and that to remove one morality, both must be removed.

In section 13 Nietzsche exemplifies the differences of slave and master morality through a metaphor. Weak morality is typified the lamb and strong morality, the bird of prey. Early in the allegory a subtle assumption is made by Nietzsche on the reader's behalf; by using animals and in turn the animal kingdom, he insist there is some hierarchical order imposed likening a food chain to society. While this model in many ways persists in society, it is reasonable to argue that the animal kingdom's variant has far less entropy, thus the separation of predator from prey is not a realistic metric for the two moralities. However, Nietzsche examination of society sits on the limit of time, the war over morality, after all, has been waged for thousands of years and its long term affects should be the concern. This is the frame Nietzsche is creating for the reader. The bird's morality, based on the food chain is there from the very beginning, that superiority develops into master morality where the birds represent good. In this long term the reader sees how the lamb's resentment to the birds of prey festers inside, a lack of power eating them; the lambs morality begins to develop from here: “These birds of prey are evil and whoever is least like a bird is most opposite, like a lamb – is good isn't he?” The allegory is designed specifically to mirror the Jew's reactions to the destruction of the temple. Their religion, their morality, developed into a mechanism to cope with their disappointment over those events, a way to wage a silent war with resentment (s. 12). Christianity sprang forth as well. The meek inheriting the earth, or the spiritual superiority of the weak became the calling card of both the Jewish and Christian churches according to Nietzsche. Belief in a savior, resurrection, and in particular the beatitudes are evidence of the kernel of resentment, fundamental to both Judaism and Christianity. It is not the immediate response that is important here though, it is the long term shift in morals towards slave morality.

In slave morality, Nietzsche imagines humans as animals to whom their domestication, their complacency, their contentedness is an end in and of itself; “they construe weakness as a freedom, and their particular mode of existence an accomplishment.” This is Nietzsche's greatest fear, that man would grow tired of himself, a fear articulated in section 12, that “in losing our fear of man we have also lost our love for him ... we are tired of man.” This fear is valid: by enjoying and seeking weakness, society harms its ability to survive. If a true predator came, society would be more than simply weak, it would be unwilling to fight at all. A society becomes its own enemy, its crippling weakness a result of its mentality of resentment towards power. To survive, society must be strong and fit, and Nietzsche's conclusion regarding the elimination of slave morality is an answer, but it is not the best answer.

Seeing the world as good and bad in any context is deceptive. The situation created by the destruction of the Jewish temple is not unique; given morality of any kind the resentment present at the center of religious belief idolizing the weak will propagate again, even if slave morality were removed entirely. If morality as we understand it today, a choice between good and bad, continues to exist in any form, the bipartite system that is created as a result will only serve to repolarize morality, recreating the barriers between slave and master morality, despite attempted advances. Eliminating resentment of the lambs in the allegory would never fully succeed till the bird of prey shed his similar notions; without that action, the lamb would continue to feel the bad of master morality thrust upon him. To excise slave morality without master morality would be unproductive to the society in question. Equally deceptive is morality's cyclical deprecation, its need to follow a downward spiral. Under the influence of morality it will always be a temptation to equate things that are perceived as good, with the form of good itself. To say something is good simply for good's sake places a false value on the thing, giving it a power it should not have. Inherent in that power is deception, and when the necessity arises to adjust that object, the false value created by morality will only hinder the work. Capital punishment, for instance, should be despicable because of the Christian moral code, war an unthinkable impossibility. Only by bending one's perception of good and evil can one see the world in those 'unthinkable' manners. Morality does not stop us from approaching those 'horrible' ideas it lets us embrace them, it teaches us to better skew ourselves rather seeing the world through impartial immoral eyes. In essence, by eliminating morality, in particular the notions of good and bad, society will flourish without the constraints of false value. The only solution is to eliminate morality, to let slave and master morality persist will ensure society's demise.



To remove morality, good and bad and evil, would not adversely affect society. It is the first step to freedom from objects of falsified value and from a system that recursively creates itself. To live in a moral less society does not imply a lack of laws, each law would have a reason for existence detached from the notion of “because it is good”. Laws would be pure and clean, useful and purposeful. A world without morals does not eliminate the possibility of God, but the delusion created by resentment of the strength of the noble would no longer exist. God would no longer exist to serve the meek, but be regarded as an abstraction beyond our understanding. The recognition of morality as a cycle of ill effect by society would spur man to new places, ones undefined by the false notions of good or bad, rather painted with impartiality, and perhaps “a glimpse of something perfect … a man who justifies man himself”.