Sunday, January 17, 2010

Download and Cache Youtube/FLV files with Firefox

If you want to cache/copy youtube videos for later use, go tor you firefox cache and just copy the flv files over.

My Name\Local Settings\Application Data\Mozilla\Firefox\Profiles\rxxs25wm.default\Cache

----

The filenames are like:
B7922209d01

Add .flv as your file extension and then open a valid flv player.

Look for the files that are over 2mbs. And normally you have to watch a complete youtube video, wait until it caches and then close firefox for the cache to be saved to disk.

----

And another note, I watch a lot of youtube videos. Every youtube download may cost you 15mbs of bandwidth. So I would consider watching the videos from file.

I ate up 20gigs of bandwidth last month. I think my isp is considering charging me extra.

Friday, January 15, 2010

A Look at the Internet Troll


What is an Internet Troll?

"In Internet slang, a troll is someone who posts inflammatory, extraneous, or off-topic messages in an online community, such as an online discussion forum, chat room or blog, with the primary intent of provoking other users into an emotional response[1] or of otherwise disrupting normal on-topic discussion." -- Wikipedia.

Here are some classic responses from top trollers on the site, CrazyOnTap. If you look at most of the responses, you cannot even tell what is being discussed. This is the classic tell of a troll post. The topic of discussion could be economics or the Iraq war, it doesn't matter because the classic troll will completely stray off-topic.

Discussion about Creationism:

"that's from reddit.
and this is a troll. foad." -- argv
http://www.crazyontap.com/topic.php?TopicId=62411#648817

"well, i have it on good authority that you have some batshit insane ideas as well.
the difference? you lack the courage of your convictions to post what you believe on your cubicle." -- argv
http://www.crazyontap.com/topic.php?TopicId=62411#648833

Discussion about Jaron Lanier and the recent NY Times entry on the hive-mind:

"Dude, I can't even take you seriously anymore, when you ask too many of these questions in a row." -- STH
http://www.crazyontap.com/topic.php?TopicId=62409#648788

"To answer the original, stupid, and banal question: no, CoT isn't a mob. Neither is the Internet.
The reason that it's a stupid question is that you can't simplify the dynamics of a huge system of interaction to a yes or no" -- Ward
http://www.crazyontap.com/topic.php?TopicId=62409#648788

On the tragedy in Haiti:

"Toast doesn’t toast toast, toast toast toast." -- argv
http://www.crazyontap.com/topic.php?TopicId=62317#648493

On Java vs C Performance:

"Hell that article is ugly. I couldn't even bring myself to skim it." -- Wayne
http://www.crazyontap.com/topic.php?TopicId=62233#647867

On Tiger Woods

"you probably think that because he's black, right? or maybe it's because of the lifestyle you lead?" -- argv
http://www.crazyontap.com/topic.php?TopicId=59269#637366

There you have it, trolls will start discussions about nothing.

References

-- http://crazyontap.com
-- Dodo bird image from wikipedia.

------

Tuesday, December 15, 2009

Most recent software projects and why

Here are my recent open source projects: (Most of these are proof of concepts, source included projects. Use subversion to check out any project).

botnodetoolkit - A complete Clojure/J2EE framework that makes it easy for developers to taking care of browser and server-side components. And other server applications.

haskellnotebook - The Haskell Notebook (another Haskell Cookbook) contains some common and not so common Haskell programming idioms that are contained in a collection of working/compilable examples. There is also a collection of source code from other functional programming languages including Lisp and Erlang. This project is similar to other cookbook projects that you may find on the web for various other programming languages.

iphonenotebook - Octanemech - simple opengl iphone demo. keywords: objectivec, opengl, iphone3, xcode

jvmnotebook - The Java Virtual Machine ( Sun's JVM is called HotSpot ) is a java bytecode interpreter which is fast, portable and secure. Jython, JRuby, Scala, ABCL (Common Lisp) are popular language implementations that run on the JVM that allow for the jvmcookbook sugar of their particular languages.

lightscalaplugin - A Light Eclipse Plugin for the Scala Programming Language

lighttexteditor - Light (also known as LTEC) is a text editor application for editing, viewing and searching through raw text documents.

websecuritynotebook - The web is one of the most pervasive technologies created. The hacker community knows this and will take advantage of web application vulnerabilities. This set of cookbook examples provide tips, tools and utilities to aid against cross-site scripting attacks, injection attacks and other resources.

openbotlist - Botlist is an example application, a proof of concept demo to demonstrate how to use a JVM Language (JRuby) in a J2EE environment. It could possibly work as a complete solution, but it is mostly an example implementation of a web application. The source is fully available and I encourage J2EE web application developers to browse the source.

octanemech - Octane Mech is a 3D, OpenGL based Mech game written in Haskell.

octaneos - The Octane OS Project started with the intent to design a lightweight Operating System. It has a small kernel for an x86 system. The host development environment is designed to work with the Bochs x86 emulator or VMWare. The base shell environment will be with the Factor programming language.

Thursday, November 12, 2009

Google Testability Blog

http://misko.hevery.com/

Great testability blog

Monday, October 5, 2009

Healthcare Reform in America is about public safety not about taking access

What is wrong with the debate?

One issue I have with the entire health care reform debate is not with any particular bill or any particular person that is for or against reform. I take issue with how they frame the debate. They never look at the crisis with our health care system as a safety issue. People will get sick and people will die prematurely if they don't have the proper insurance or access to health care. The alarms should go off at this startlingly revelation. People will die and could potentially spread disease to others if they are hesitant about seeking medical care. According to the Department of Medicine at Cambridge Health Alliance, 46 million people will die because of lack of insurance.

"The Harvard report, finding 45,000 excess deaths linked to uninsurance, made news partly because it was so much larger than past estimates. Why the big difference between the Urban Institute/IOM numbers and the latest report? Dr. Woolhandler explains that the Harvard researchers aimed to replicate what IOM had done back in 2002 but with more recent data" -- factcheck.org

Why should the federal government be concerned with our safety with these indirect dangers but don't jump at the oppurtunity to remedy some of the issues that we know are directly causing the death of many Americans right now. Why spend billions for wars in Iraq in Afghanistan? Terrorists might potentially attack us at home from the foreign land. Why go there when we know tens of thousands will die to heart disease and cancer and other ailments, some prematurely because they don't have adequate health care insurance. Or their health insurer will deny their claims. These problems that exist in the health care industry aren't a fuzzy satellite photo where a potential threat might exist. These are people in the US that have diseases and have to wait out for their cancer or diabetes or other chronic illness because the companies that can protect them are out to make a profit.

FactCheck.org Related Posts:

Dying from Lack of Insurance

"A new study from researchers with the Harvard Medical School found that 46,000 deaths a year can be attributed to the lack of health insurance."

http://www.factcheck.org/2009/09/dying-from-lack-of-insurance/

----

"From 2002 through June 30, 2009, six of the largest insurers operating in California rejected 47.7 million claims for care – 22 percent of all claims.""

http://www.factcheck.org/2009/09/denial-of-claims/

----

"A study determined that 46.2 percent of bankruptcies were attributable to a major medical reason. Debtors cited at least one of the following specific causes: illness or injury (28.3 percent of respondents), uncovered medical bills exceeding $1,000 in the past two years (27 percent)"

http://www.factcheck.org/2008/12/health-care-bill-bankruptcies/

Thursday, September 24, 2009

Modify javap to output to String, view decompiled information at runtime.

I asked the following question on Stackoverflow:

"I am working with an application webserver and have complicated classloading issues. I want to be able to download or print information that would normally get printed by javap (the methods, etc).
I may also need to get the raw binary class data, to perform a binary diff.
How would you do this?"

I was not satisfied with the responses from stack. Sure, I could have used reflection to print information on a particular class from the web, but I was looking for the output from javap.

Javap is essentially a decompiler that comes with Sun's set of Java tools, it is used to print the method names and other information for an associated class.



It is a useful tool, how do you run the tool on code that is deployed on a server, at runtime?


It seemed obvious that javap was written in Java, so I naturally assumed that the source was available with openjdk. Source for javap is available GPL licensed in the mercurial repository. There is no use of the java.lang.Reflection API, all data collected on the class is based on the binary content of the class.

http://hg.openjdk.java.net/jdk7/jaxp/langtools/

I used the source to add small modifications to run javap in a web environment, simply converting the data to a string.



I made two major changes to extract the class information dynamically. One: return the current thread, current classloader and then find the class resource. Two: instantiate a bytearrayoutputstream object and use the outputstream to write the javap information. Then use the bytearrayoutputstream to convert the data to a string object. After performing those steps, use the string data in any environment you need to.
   
public void displayResults(InputStream classinMem) {
final InputStream classin = classinMem;
try {
// actual do display
JavapPrinter printer = new JavapPrinter(classin, out, env);
printer.print();

} catch (IllegalArgumentException exc) {
error(exc.getMessage());
}
}
public void entry(String[] argv) {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
this.out = new PrintWriter(baos);
try {
this.perform();
} finally {
out.close();
} // End of the try - Catch Finally //
}
public void perform() {
final InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(classNameParm);
if (input == null) {
throw new IllegalStateException("Invalid class resource, classname=" + classNameParm);
}
displayResults(input);
}

Shown in the screenshot below, we get similar output as String content.



Download the Full Source
Download the source, tested with Java 1.5 compiler and runtime.

http://jvmnotebook.googlecode.com/svn/trunk/misc/javap/
http://jvmnotebook.googlecode.com/files/javap_to_string.zip

Disclaimer: I didn't have time to re-compile the code after some changes. So, you may have to make obvious edits to get all of the code to work. And the build.xml is not working.

------------------------

Thursday, September 17, 2009

Random Software Developer Thoughts - Entry Number One

I have these thoughts that pop into my head related to software. I always say I need to write these downs. Here is my first entry, writing down these thoughts. They are amazingly random, in a list format. Sometimes I may need to elaborate. I write software for a living, if you don't work in software, maybe this will help you get into the mind of a software developer.
Note: a lot of the comments are geared towards J2EE java development.

Entry Number One

  1. Software development can be very boring sometimes. Think about it, you sit in a cubicle/office eight hours a day, staring at a computer screen. For major portions of your life.
  2. Software development can be very interesting sometimes. You write software that thousands or millions or no one uses regularly. The user normally doesn't have a clue how the software gets written and there are all kinds of fixes, hacks, and easter eggs left in code. You as a developer may have minutes or hours that can effect a major release. A change that can cost millions of dollars. It kind of sucks that developers don't get good coffee.
  3. No one understands the importance of quiet. A noisy office is an unproductive office.
  4. I don't understand how git is so much better than svn. I guess Linus says so, so it must be true. Hasn't svn been used in production environments? Will git make a project better? Shrug
  5. Mac hardware is pretty nice. Mac software isn't so bad either, the software just runs
  6. Microsoft Windows software is functional. There are definitely times when Microsoft Windows XP needs to be slapped around. Why did it take 15 minutes for my machine to boot. It booted in 2 minutes a couple of months ago? Why did my software just lockup?
  7. I haven't ever seen the blue screen of death on a WindowsXP, Win2k machine.
  8. I rarely saw the blue screen of death on a Win98 machine.
  9. Linux is also functional. Distros like Ubuntu Linux could work on polishing some of the user interface, making things easier. Sure Ubuntu Linux is a lot easier than Redhat 5.0 back in the mid 90s. But is usability as easy as on Mac? Software evolves. Ubuntu Linux will get better over time. Right now, it is not amazingly great. Think about it. Is Ubuntu Linux 9.04 better than Redhat5? Yes. Will Ubuntu Linux version 20 work better than Ubuntu 9.04? Yes. Is Apple's Snow Leopard a better user experience than Ubuntu Linux 9.04? Maybe. For me it is.
  10. Eclipse IDE can suck
  11. Eclipse IDE sucks
  12. Why does Eclipse IDE take 1.5 gigs of ram to run, according to the Windows Task Manager? There is only one project.
  13. Java development can suck.
  14. Companies pay money for Java developers to write code
  15. There are a lot of companies looking for Java developers
  16. Can Java developers program?
  17. What about Python? Can they program? Are a lot of companies paying python programmers?
  18. I hate the idea of contracting. Maybe I am too lazy to convince people to personally give me money.
  19. Contractors make a lot of money
  20. Most contractors I have met aren't worth a percent of a percent what they are paid
  21. Especially Java Contractors
  22. Why are programmers so egotistical and angry (this is based on my observations on Internet forums). "How do I read a file in Java?" "You suck, go read the Java API" "Get out of here". Never heard that in ##java.
  23. I wondering if you asked "Where are the political books in a bookstore"? Would the salesperson tell you to RTFM? Would Gandhi?
  24. Lisp
  25. Common Lisp and Scheme are interesting syntactically
  26. Scala, Haskell, Clojure are interesting languages.
  27. ObjectiveC is pretty fast
  28. There are a lot of women programmers. Everywhere I have worked, the percentage has been 40%/60% female/male or 30%/70%.
  29. Yet another myth
  30. I am male, I don't see any differences in the way that womem work? Why would there be?
  31. Developers at startups are normally young.
  32. Developers at startups are young, dress like hippies and hover around major California cities.
  33. Startup developers always seem distracted and unprofessional
  34. Developers are major companies are older
  35. Is web application programming, building web systems really programming?
  36. Is making a simple configuration change, calling a Java API programming?
  37. Why does lunch for software developers always include Chinese food?
  38. Software developers are diverse, where are all the American born programmers?
  39. J2EE Application Servers are Slow.
  40. J2EE Application Servers are slow and eat up a lot of memory. Maybe that is why they are slow? Too many garbage collections. Garbage collects are slow.
  41. Public Internet service sites like google, yahoo are pretty fast. Must be heavy used of Memcache type systems.
  42. Web development can suck
  43. Java Server Pages are horrible templating systems. They allow a developer to break many fundamental programming paradigms. Do you use jsp:include? How do you structure your document? What about all of these taglibs that do the same thing? Scriptlets. We should sue Sun.
  44. There are a lot of Java frameworks out there? But not that many. There are only a dozen or so popular ones. Hibernate, Spring, JSF, Struts.
  45. Game Development with OpenGL is hard
  46. But not that difficult.
  47. I never did learn Perl but I did OK with scripting in Python
  48. Ruby Language
  49. I wonder what the software development world is like in Japan
  50. Are most software developer atheist?
  51. Isn't programming a lot easier now than 40 years ago?
  52. Bill Gates helped work on Microsoft Basic
  53. Am I done yet?


Those are today's thoughts.