Monday, March 01, 2004

well any web developer worth thier salt knows this little bit:

courtesy servlets.com

<HTML>

<p>Demo MultipartParser Upload Servlet</p>
<FORM ACTION="/tomcat/servlet/parserupload" METHOD=POST ENCTYPE="multipart/form-data">
What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
Which file to upload? <INPUT TYPE=FILE NAME=file1> <BR>
Which file to upload? <INPUT TYPE=FILE NAME=file2> <BR>
Which file to upload? <INPUT TYPE=FILE NAME=file3> <BR>
<INPUT TYPE=SUBMIT>
</FORM>

/*
* DemoParserUploadServlet.java
*
* Example servlet to handle file uploads using MultipartParser for
* decoding the incoming multipart/form-data stream
*/

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

import com.oreilly.servlet.multipart.*;

public class DemoParserUploadServlet extends HttpServlet {
private File dir;

public void init(ServletConfig config) throws ServletException {
super.init(config);
// Read the uploadDir from the servlet parameters
String dirName = config.getInitParameter("uploadDir");
if (dirName == null) {
throw new ServletException("Please supply uploadDir parameter");
}
dir = new File(dirName);
if (! dir.isDirectory()) {
throw new ServletException("Supplied uploadDir " + dirName +
" is invalid");
}
}

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
response.setContentType("text/plain");
out.println("Demo Parser Upload Servlet");

try {
MultipartParser mp = new MultipartParser(request, 10*1024*1024); // 10MB
Part part;
while ((part = mp.readNextPart()) != null) {
String name = part.getName();
if (part.isParam()) {
// it's a parameter part
ParamPart paramPart = (ParamPart) part;
String value = paramPart.getStringValue();
out.println("param; name=" + name + ", value=" + value);
}
else if (part.isFile()) {
// it's a file part
FilePart filePart = (FilePart) part;
String fileName = filePart.getFileName();
if (fileName != null) {
// the part actually contained a file
long size = filePart.writeTo(dir);
out.println("file; name=" + name + "; filename=" + fileName +
", filePath=" + filePart.getFilePath() +
", content type=" + filePart.getContentType() +
", size=" + size);
}
else {
// the field did not contain a file
out.println("file; name=" + name + "; EMPTY");
}
out.flush();
}
}
}
catch (IOException lEx) {
this.getServletContext().log(lEx, "error reading or saving file");
}
}
}


The issue with this is that you cant parse the request twice, which you may want to do if you want to encode the directions to the action in the result header, then process the request during the action itself in a standard MVC approach. This isn't a problem when using request.getParameter("action"), because you can get parameters out of the request as many times as you want, but since you have to parse the request (or so it seems) when you try to parse it a second time it gives an exception that it has unexpected end of header.

My solution is to create a generic form handler class, that reads the request at the beginning of processRequest(), then is made available as a request attribute. It will handel both regular and multipart forms.

If anyone knows a better way please email me!


cgraham@newobjectivity.com


Monday, February 23, 2004

PLEASE RALPH DON'T RUN! I usta think Ralph Nader was a cool guy, now I really really don't like him. He could have made a giant contribution to our country as a senator or congressman, but instead he is just a spoiler. He makes me think of people like Michael Moore, who say things like "Well it has to get worse before it gets better.", what a spoiler attitude. Its like they want our country to go to hell to prove they were right. Lame.

OK another neccesary bit of info. After being super sick of V$I*A!G)R%A ads showing up I researched sendmail blocking. Here is the definitive sendmail config:

FEATURE(`dnsbl', `sbl-xbl.spamhaus.org')dnl
FEATURE(`dnsbl', `blackhole.compu.net')dnl
FEATURE(`dnsbl', `list.dsbl.org')dnl
FEATURE(`dnsbl', `opm.blitzed.org')dnl
FEATURE(`dnsbl', `spam.dnsrbl.net')dnl
FEATURE(`dnsbl', `bl.spamcop.net')dnl
FEATURE(`dnsbl', `inputs.relays.osirusoft.com')dnl
FEATURE(`dnsbl', `relays.ordb.org')dnl
FEATURE(`dnsbl', `Spamsites.relays.OsiruSoft.com')dnl
FEATURE(`dnsbl', `Spews.relays.OsiruSoft.com')dnl
FEATURE(`dnsbl', `flowgoaway.com')dnl
FEATURE(`dnsbl', `blackholes.intersil.net')dnl

also goto spamhaus...

Wednesday, February 04, 2004

very useful snippet:


public static String getRequestParameters( HttpServletRequest aRequest)
{
StringBuffer aReturn = new StringBuffer("");
Enumeration parameterNames = aRequest.getParameterNames();
while (parameterNames.hasMoreElements()) {
String requestParameter = (String) parameterNames.nextElement();
String[] aValues = aRequest.getParameterValues(requestParameter);
for (int i = 0; i <> 0) {
aReturn.append("&");
}
aReturn.append(requestParameter);
aReturn.append("=");
aReturn.append(aValues[i]);
}
}
return aReturn.toString();
}

}

Wednesday, December 17, 2003

One of the most disturbing projects I have ever seen:

Expert judgment on Markers to Deter Inadvertent Human Intrusion into the Waste Isolation Pilot Plant

And one of the incredible markings associated with the effort to deter human and alien intrusion:


THIS PLACE IS NOT A PLACE OF HONOR
NO HIGHLY ESTEEMED DEED IS COMMEMORATED HERE
NOTHING VALUED IS HERE
THIS PLACE IS A MESSAGE AND PART OF A SYSTEM OF MESSAGES
PAY ATTENTION TO IT!
SENDING THIS MESSAGE WAS IMPORTANT TO US
WE CONSIDERED OURSELVES TO BE A POWERFUL CULTURE

Tuesday, December 16, 2003

Dear Representative:

As one of your constituents, I wish to bring to your attention a very important issue about jobs being lost from the United States, and ask for your support in any and all legislation that will help keep decent middle-class jobs in this country.

Recent studies indicate that U.S. employers will move about 3.3 million white-collar jobs and $136 billion in wages overseas in the next 12 years. The most recent study by Gartner, Inc. ("U.S. Offshore Outsourcing: Structural Changes, Big Impact") reports that an alarming 500,000 IT jobs will move just in 2003 and 2004. That’s about one in 10.

Major high-tech companies, such as IBM, Hewlett Packard, and Microsoft, have already started moving work to cheap labor countries such as India, Russia and China. Do we really want to export our technical know how to China? In many cases, U.S. employees are required to train their foreign replacements, and then they are laid off. With the current economic recession and the depressed state of the high-tech industry in the U.S., this is the most unpatriotic action a company can take.

What is most alarming is that these are highly technical jobs that require advanced college degrees, and commonly become the basis of knowledge for business critical application development and military technology that our nation’s security and economy depends on. We are exporting our know how, and our information based technical specialization that was supposed to replace the Industrial Economy we just shipped overseas last decade.

I am one of many developers who came up from the ranks of IT development to make major contributions to both the private and military sector. Commonly the job boards overflow with requests for highly trained IT professionals with secret clearance, these jobs often remain open for months at a time. On the other hand the mid level IT jobs aren’t available, and developers go without wages for months at a time because the competition is high for the few remaining jobs, and are forced to contract for brief periods with no benefits. How do you expect that our country will be able to fulfill the demands of an information age if we don’t grow that talent internally so that a few large companies with no interest in America can save pennies on the dollar?

I strongly urge you to support any and all legislation that will:

1. Require U.S. employers to disclose the jobs they are moving, and provide incentives for keeping high-tech jobs in the U.S., and provide deterrence to moving them abroad.

2. Eliminate the H-1B and L1 visa's which allow foreign workers to take U.S. high-tech jobs. The IT unemployment rate is high enough that experience U.S. workers can likely fill all available jobs currently being performed by foreigners.

I hope I can count on your support.

Sincerely,

Clay Graham
Software Engineer

Saturday, November 01, 2003

Back to life blogging. We went out for Halloween last night, had a bunch of fun. We went to neighborhood parties. I really like North Park, it is very authentic and way better than fight the boob jobs down at the Gaslamp. We were Edgar Allen Poe and The Rave. It fun reciting lines from the poem within dread, while she yelled "Nevermore".



Clay and Stephanie hamming it up at Bacchus House


















Most of the wierdo we met during the night, they were all fun!
Basically we had a blast.

Just painted a picture with my buddy Tom. Fire breathing aura...

Thursday, October 02, 2003

Ok, its official. Iraq is for sale.

The good ol' boys will show you exactly how to get your foot in the door with the new Iraqi regime, as long as they make their cut along the way.

New Bridge Securities has been set up by a bunch of Bush cronies to help businesses find those gleaming gems of opportunity in the post war Iraq. Wow, this is colonialism in the information economy huh? A website. The site makes it very clear the political relationships that the principals have with the Bush administration, heck its selling point.

Yahoo! News - Washington Insiders' New Firm Consults on Contracts in Iraq

Monday, September 22, 2003

Well I wrote another letter to Rob, why am I doing this?


Rob,

You know today you said one thing I never thought you would say, that
software patents are becoming too large an issue for anybody to manage
or write off. that is very true. IBM is using them against SCO, again a
bad idea.

The GROKLAW letter is about end users who feel threatened small and
powerless compared to the endless PR telling them they are thieves. They
are making an honest attempt to address what they see as the evil in the
world when they meant to do no harm. Totally human.

If they removed your comment I think that wasn't a good idea though, I
am sorry. Believe it or not, I see you as another person with a unique
perspective to be understood and appreciated. Instead you have been made
an enemy, which I think is a bad idea.

I do think that there is just as much of a "dedication" (you like to
call it religion) that some people have for MS as for OSS, and they have
have their cults too, fringe cults who will not listen to the truths
they see before them. They are the ones trying to hold on to their own
dogmas, hold on to what they knew, and don't try to thrive with what may
be coming.

I agree with you on one point, the OSS of today IS DOOMED absolutely,
and the actions of these types of people just bring it it closer to the
next phase where the religion is gone and the business really begins.
The phase that IBM services and the RedFlag distribution has started.
OSS will have a long and full real world business oriented life, and
will become the way of the world. As I mentioned before, regardless of
the trepidations of a few zealots, the shrill harping of an
"intellectual property victim", or the misgivings of a few analysts.

Really, our words are the crickets chirping to the great redwood. They
have little bearing on its success or failure.

Clay



Sunday, September 21, 2003

Every great religion has a dogma, and yes I find that even the best dogmas use censorship and control of their mission for propaganda. I feel like Judas sometimes, "hey I am over here just checking out the truth, and telling it like I see it". Well commonly I find that the powers of the world, even the meager ones who have good intentions, will twist words or edit the voices to their own ends.

Well here, no one can edit my voice, in any way. It is all mine to say what I please so here goes:

I read this article by this guy, Rob E., who said that open source is like religion, its his way of making Open source sound like some fringe cult, anyway here is his article talking about how the open source hippies want free love and free beer.

The battle for belief

Ok, so what open source religion do the governments of China, Korea, and Japan belong to? Maybe its the religion of good sense. Their governments are collectively spending millions to provide a open source Linux based solution for their government data centers, replacing NT, has that sunk in yet? The plan is to remove their dependence on opaque proprietary solutions and control the code base themselves. Over a billion people go that way, you feel the sucking wind blow, hey maybe they got something. Guess what...the three industrial power houses of Asia are bellying up to the bar for "free beer". Look, this isn't about "religion", or hippies wanting their "freedom" its about good economics and complete control of mission critical systems.

The keepers of the dogmas characterize OSS as if we are all going to go to Burning Man and have a Open Source be-in. What is more likely is that all of Asia is going to go to go to the be-in and we'll miss the boat if we fail to look at the trends around us.

Japan, South Korea and China discuss working to promote Linux

Here's what I wrote him:

Rob,

Let me say that when I read your article it made me me think of your perspective. Why would you be coming from this with the angle you did? Do you have your own agenda, because it seems like a tactic of associating open source with a freedom based fringe cult. In your article you align the open source movement with a "religion", this perspective is clear. I contest this perspective strongly.

This is a GIANT mistake, as I have tried to point out to you even if it was in a little tongue in cheek way. It seems that putting the open source movement in the light of something religious, you are aligning it with "spiritual freedom". There may be some in the OSS movement that see it this way but I do not.

The reality I am attempting to establish, and point out, is that MOST of the motivations in the open source movement are entirely business oriented.

Look, when I can install an entire blade rack for my customers data center at a quarter of the cost it would take me to provide the same features using an NT based end-to-end solution the economics are clear. I don't care what type of mumbo jumbo Microsoft tries to tell me that NT costs less, you can't lie to someone who does this all the time. I am not the only one either, entire *industries* are looking at the economics and seeing the same thing.

And the embedded world is seeing the same thing too. There are now Linux kernels running on top of your TV, in MP3 players, and in new game consoles. If you think that China's "unique agenda" isn't entirely business and manufacturing oriented you are not really looking at this issue with an open perspective. The reason Red Flag is growing and will probably take over Asia is *entirely* based on economics, and if we don't face it then we can kiss major US technology dollars goodbye.

This is why SCO doesn't have a chance, except possibly in the USA where litigation commonly defies good sense. Already they have been given fines in Germany for their actions, and are facing the same in Australia if they start sending invoices. So what will be the effect then if they receive their miracle ruling? Open source will thrive in businesses everywhere in the world but in the United States. That sounds great for the American technology economy, huh?

Open source doesn't need to worry about its zealots, it will survive any transgressions they may make, the question is can America survive technically living in a world without OSS?

Clay


I have to say, I am very sorry but OSS *can* be like a religion. Its got its blind patriarchs (and I mean that figuratively) who are busy in the confessional feeling up choir boys and then covering it up by paying millions. It certainly has its own dogma, and lord help you if you point out the inconsistencies of some of the more vocal members. I am wondering if I should just remain an independent, the outward observer, I can stand there be aloof and never make a mistake. That would be allot easier wouldn't it? And I would probably look cooler too.

So from now on I will feel no anger towards SC OX I will feel no emotions whatsoever, I am the great oak. The greatest winds do not sway me. Because when it comes down to it OSS doesn't need me. One billion people want it, they will have it no matter what I do or say, or what SCO does or says, or what Rob E. does or says. We don't matter any more.

So with this I say, both goodbye and hello.

Tuesday, September 09, 2003

In a letter to USA Homland Security chief, the UA is balking at requirements to provide Flight Data to fight "terrorism" as was posted on the "The Practical Nomad". Finally somone is saying, hey you might not mind tromping all over constitutional rights on the other side of the pond old boy, but over here your little police state won't fly. *Thank You*

The RIAA is suing people now, about 216 of them, including a 12 year old girl who's mom just settled for 2000 bucks. Like the Register says, "make her cry!". Next stop, fully 64 byte encrypted key file sharing with trusted PGP key members. I am suprised it isn't already a part of Gnutella.

Well my girlfriend an I had a giant blowup over who cleans more. I will share the chore calendar with you all when I am finished with it. The thing she doesn't understand is I have a digital camera and I am very good at documenting.

Monday, September 08, 2003

Well this weekend sucked.

I spilled about an ounce of diet coke on my laptop and it just *stopped*. Do you know how many hours I spent getting stupid Windows XP to work with my Linux box? Goddamn it has been crippled so you can't use it in a domain, and then they want you to pay another 200 dollars just so it will. Stupid. I hate MS more and more every day.

If Macromedia MX studio was on Linux I would switch in a second.

rant, rant, rant.

Clay

Friday, September 05, 2003

SCO To Invoice Linux Users

"Because SCO's Linux invoices will be based on a disputed claim, analysts question the technique's effectiveness. The invoices 'are an interesting gambit,' Yankee analyst Laura DiDio told NewsFactor. Yet the company 'cannot enforce' its payment demand, because its legal claim is still pending, she noted. "

Thursday, September 04, 2003

If anyone does receive an actual invoice they should immediately file a complaint with the Federal Trade Commision here:

https://rn.ftc.gov/pls/dod/wsolcq$.startup?Z_ORG_CODE=PU01

Demanding payment for a product that they have been given the legal ownerships rights to is as clearly a violation of law.

--Shaun

Tuesday, September 02, 2003

So I have taken an even bigger step to chip in on the fight against SCO. I have donated hosting space and time to GROKLAW. This is a website written by this paralegal who researches all the nasties surrounding SCO and put it out there for all to see. Soon this will be on http://www.groklaw.com/ but for now you can see it by going to http://www.newobjectivity.com/groklaw/

I haven't posted in a while, sorry. I am currently reading the Transmigration of Timothy Archer. It has this great theory about Jesus being a drug hippy fraud. Remember guys, don't be to judgmental, this is fiction.

Tuesday, August 26, 2003

Office of the Attorney General of California
Public Inquiry Unit
P.O. Box 944255
Sacramento, CA 94244-2550

Party Complaining:
Clay Graham
3401 Adams Ave. #A
PMB 164
San Diego California 92116

Complaint Against:
The SCO Group
355 South 520 West
Suite 100
Lindon, Utah 84042
Phone: 801-765-4999
Fax: 801-852-9088

Was a contract signed? Yes, GNU General Public License, attached
Can we send this complaint to the party you are complaining about? Yes


Mr. Bill Lockyer,

I am writing to express my concern over the actions of The SCO Group, Inc. Certain of these actions may have significant negative effect on California individuals and businesses.

In brief, in March of this year SCO filed a complaint against IBM (amended complaint filed June 16) in the US District Court for the District of Utah, alleging contract violations by IBM. In general SCO claims that IBM added intellectual property of SCO to the open source operating system Linux, in violation of the terms of various contracts to which SCO is the successor in interest. Since then IBM filed a counter claim in the same court (August 7), and Red Hat Inc., a Linux vendor has filed for declaratory judgment and injunctive relief in the US District Court for the District of Delaware.

My concern arises from actions taken by SCO since these filings. SCO has shifted their focus from IBM to all users of Linux, claiming that as Linux contains unlicensed intellectual property of SCO, all such users must pay SCO for a license to use Linux. They have further stated that they will vigorously pursue such users, and prosecute them should they not buy this license.

The problem is that the claims that SCO has put forward are generally held to have little, if any merit by expert technical and legal opinion. If this is true, then SCO demanding license fees from users of Linux is questionable at best. Further, if one reads the public statements of SCO executive and SCO press releases on this matter, one sees that SCO has adopted a deliberately and unnecessarily threatening stance.

One responsibility of a party seeking redress in such matters is to mitigate. This SCO has consistently refused to do. The developers of Linux have been unanimous in their request that SCO tell them what parts of Linux are infringing upon SCO IP, so that they may remove it. SCO has stated that they will not reveal this information. In this light, the demand for license fees from Linux users borders on the extortionate.

I believe that it is appropriate for the Office of the Attorney General to make an initial assessment of this situation, with a view to possible further investigation. There are many users of Linux in our state, they use Linux because of the many benefits it confers. All these are under threat by SCO. Private users, charitable institutions, churches and schools may use it by reason of it's cost it is free. SCO has begun invoicing such users to pay them $200 for every desktop, and $700 or more for every server. This price will last till only October 15, after which the prices will approximately double. If they do not pay, SCO promises to sue them for damages.

Corporations choose Linux for technical reasons, not primarily for cost. SCO's actions include a challenge to the GNU General Public License, the terms under which Linux is distributed and developed. Besides the financial burden SCO's licensing would place on small business, SCO would also destroy the mechanism that was fundamental to Linux realizing the technical superiority which caused it's adoption.

In conclusion, I feel that the actions of SCO are unjustified and unwarranted, and if allowed to continue unchecked, will cause material harm to private and corporate citizens of our state. I have presented here only the briefest summary; as with any such controversy there are many factors and issues bearing on one's ultimate conclusions but any study, even brief will tend to support my position.

Should your office make such assessment as I have asked, I urge you not to stop with media pundits, but consult expert and informed opinion. To this end, I have attached a list of resources that that can serve as jumping off points for further research.

Please feel free to contact me at any time. Also please note that I am writing as a private citizen of California, not as an agent of my employer.

Thank you for your consideration of my letter.




Clay Graham
Concerned California Citizen



General Public License - http://www.gnu.org/licenses/lgpl.txt
Rosen Position Paper - http://www.osdl.org/docs/qa_re_sco_vs_ibm_html.html
Open Source Legal Position - http://www.opensource.org/halloween/halloween9.html
Perens Analysis of Disputed Code - http://perens.com/SCO/SCOSlideShow.html
Redhat Legal Position - http://www.redhat.com/about/presscenter/2003/press_sco.html
Monta Vista Software Legal Position - http://www.mvista.com/sco-ibm.html

Monday, August 25, 2003

It has been a little while since my last post, I guess I haven't had any strange dreams, or been consumed with anything too creative. Does that tell you something? I guess I have to say I am happy that I at least have my applications at home, lord knows I haven't been able to code at work in a long time.

I just upgraded my RedHat 9 to XIMIAN Evolution , and I love it. If you are a Linux head just go get it now. The really cool thing about it is that they have an MS Exchange connector, so IT can start migrating over to Linux desktops, at least in some portions of thier company. This means as more and more applications become available for Linux, MS becomes more and more legacy. I know I am not the only one thinking this.

RedHat also just announced that they are going towards a "bundled application server" strategy for RedHat 10, with builds of JONAS built right into the install. Then if you look at Eclipse JDT that has a direct plug in for the application server built in, you are looking at the future of web development for the next two years. I promise.

Ok, enough geek stuff, on to politics. I heard that Warren Buffet was hired by Ahhhnold to head up an economic counsel and then Warren did the unthinkable; he said that property taxes were too low in California. The thing I do like about AS (compared to other elephants) is that he doesn't always tow the same old line as most of those jerks, but he isn't going to win of them over going with Buffet, he is a guy who makes his economic choices other than politics, he makes them based on sound economic thinking. That's something the conservatives continue to bring back Fs on their report cards on. What is pitiful about the Terminator though, and why I can not vote for him, is the first thing he did was discount his expert and say he was wrong. Why hire an expert if you aren't going to listen to them? It just makes me a little cynical that's all, politics isn't about fixing this stuff, its about the appearance of making change, without true expectations or accountability.

Tuesday, August 19, 2003

I had a dream last night that I went to the hot dog stand to get a delicious polish link, and I started talking to this guy while the hot dog vendor prepared it for me. I was kindof distracted by the conversation and I notice it starts to rain. I am so engrosed in conversation that the next time I look over at the cart I see my polish, but its soggy and wet, totally unedible. As I wring the water out I plead with the cart vendor to me me another. Reluctantly he complies.

Fishing on Sunday was great but very tiring. It was so nice of Stephanie to get me that gift, she hates fish and fish smells. To get me that gift was a real sacrifice for her. I really love her. Hopefully the picture that a few software developer guys I met on the trip from Pheonix took of me will come back and I'll show. More on the trip when the picture comes.

Friday, August 15, 2003

I read the most incredible quote this morning while sitting on the pot: "tolerance is the rice pudding of modern behavior", man oh man is that ever true.

Well today is my birthday, and Stephanie made me breakfast in bed. Man if I didn't have her I would be lost. Its strange being 36, well I guess every one of them is strange, but I wonder if I am where I am "supposed" to be. Its a stupid thought I know, but it takes a concious mind to supress the call of Leviathan.

Strange dreams, lost a really fast go cart, and a movie star from Austrialia wanted me to be her butler. NO WAY!

Thursday, August 14, 2003

I read about the blackout on the eastern coast what seems to be millions wandering the streets in some sort of J. G. Ballard world, and my eminent birthday (tomorrow), a vision pops into my tired brain. I had a bad day today, dealing with some people who are so myopic that it is questionable if they even see that they are alive. I am somehow drawn to think of Kali. Kali is a destroyer with a skin color of a storm about to break, she stands over Shiva who represents the consciousness of what IS.



The storm destroys the perceptions of what is, what is possible, and in doing that new possibilities occur. The destruction commonly is quite painful, so often we resist it. I seriously that myself and most of the world around me right now is much like Shiva in this picture. What will the storm be that makes new opportunities possible?