Archive for the 'geek out' Category
Netflix Streaming Error 8156-6003, Silverlight Update
I’m getting a streaming error “DRM Error” while trying to stream netflix. I watched an episode of Lost when I got home last night, soon after midnight, and it worked fine. What could be causing this error today?
Since everyone knows that Microsoft Silverlight is a piece of crap, it is the immediate culprit. I noticed that a Silverlight update was installed by Microsoft today or last night.
The Update number is KB982926 and it seems to have broken Netflix’s Streaming capabilities. It contained Silverlight Version 4.
FIX:
1. Go to Windows Update Settings and change it from “Automatically install updates” to “Download updates and ask me when to install” (otherwise silverlight will reinstall itself again)
2. Close your web browser
3. Go to Control Panel -> Uninstall a program -> Remove Silverlight
4. Go to netflix.com and start streaming a movie. It will prompt you to go to microsoft’s site and install Silverlight Version 3.
5. Restart your browser and it should work. Just worked for me on Windows 7.
Concept Map in Processing Library
This code makes a Concept Map with the Processing library / Java. Processing library makes it easy and quick to make graphical representations and animations, among its many features.
/**
* setup is called implicitly by the library when rdraw is called
* it sets the size, drawing method, then in this case draws the graph
*/
public void setup() {
size(boxSize,boxSize);
smooth();
drawGraph();
}
/**
* Draws the graph. req and neighbors must have been
* previously set through the construtor or the setters
*/
public void drawGraph()
{
int halfBox= 150;
//processing uses radians, not degrees
float angle = 2*PI / neighbors.size();
for(int i = 0; i < neighbors.size(); i++)
{
float cur_angle = i*angle;
String s = neighbors.get(i);
//calculate an even dispersal around the central objet
//it depends on how many objects are in your list
float xpos = halfBox*cos(cur_angle)+center;
float ypos = halfBox*sin(cur_angle)+center;
//color=black, draw a line to new item
stroke(0);
line(center,center, xpos,ypos);
//put the item last, on top of the lines
drawCircle(xpos, ypos, s);
}
//put the item last, on top of the lines
drawCircle(center,center,result);
}
/**
* draws a circle with specified text at (x,y)
* @param x the x position of where the circle will go
* @param y the y position of where the circle will go
* @param word the word that will go in the middle of the circle
*/
public void drawCircle(float x, float y, String word)
{
fill(255);
ellipse(x,y,word.length()*10, 40);
fill(0, 102, 153);
textAlign(CENTER);
text(word,x,y);
}
/**
* Makes a graph with req in the middle, surrounded
* by neighbors n. calls the library's super, Papplet.main
*/
public void rdraw(String req, ArrayList<String> n)
{
result = req;
neighbors = n;
PApplet.main(new String[] { "--bgcolor=#ECE9D8", "BrainH.client.ConceptMap" });
}
Compete Source here [ConceptMap.java].
/**
*
*/
private static final long serialVersionUID = 690002409249816629L;
private int boxSize = 500;
private int center = boxSize / 2;
private static String result = “”;
private static ArrayList<String> neighbors = null;
public ConceptMap() {};
public ConceptMap(String req, ArrayList<String> n)
{
result = req;
neighbors = n;
}
/**
* setup is called implicitly by the library when rdraw is called
* it sets the size, drawing method, then in this case draws the graph
*/
public void setup() {
size(boxSize,boxSize);
smooth();
drawGraph();
}
public void setNeighbors(ArrayList<String> arg)
{
neighbors = arg;
}
public void setObject(String req)
{
result = req;
}
/**
* Draws the graph. req and neighbors must have been
* previously set through the construtor or the setters
*/
public void drawGraph()
{
int halfBox= 150;
//processing uses radians, not degrees
float angle = 2*PI / neighbors.size();
for(int i = 0; i < neighbors.size(); i++)
{
float cur_angle = i*angle;
String s = neighbors.get(i);
//calculate an even dispersal around the central objet
//it depends on how many objects are in your list
float xpos = halfBox*cos(cur_angle)+center;
float ypos = halfBox*sin(cur_angle)+center;
//color=black, draw a line to new item
stroke(0);
line(center,center, xpos,ypos);
//put the item last, on top of the lines
drawCircle(xpos, ypos, s);
}
//put the item last, on top of the lines
drawCircle(center,center,result);
}
/**
* draws a circle with specified text at (x,y)
* @param x the x position of where the circle will go
* @param y the y position of where the circle will go
* @param word the word that will go in the middle of the circle
*/
public void drawCircle(float x, float y, String word)
{
fill(255);
ellipse(x,y,word.length()*10, 40);
fill(0, 102, 153);
textAlign(CENTER);
text(word,x,y);
}
/**
* Makes a graph with req in the middle, surrounded
* by neighbors n. calls the library’s super, Papplet.main
*/
public void rdraw(String req, ArrayList<String> n)
{
result = req;
neighbors = n;
PApplet.main(new String[] { “–bgcolor=#ECE9D8″, “BrainH.client.ConceptMap” });
}
}
An Amazing feat of Engineering
Who says geekiness can’t be cool? Even the biggest Luddite should appreciate this.
A Japanese company, Daishin, made this video to commemorate their 50th anniversary. Their milling machine spins on 5 axis. I can’t get over the way the platform and drill head move in synchrony in this video.
Machining Aluminum: How a large block of aluminum is “milled” or sculpted into a finely detailed part. Usually for a mechanical part. You wouldn’t machine a fork or tin can, but there is no other way to make a part for an aircraft or automobile engine.
1 commentInstalling Ruby and Rails 1.9.1 on Ubuntu 9.x
One would think that installing Ruby & Rails on Ubuntu 9.X would be cake, right? WRONG. It is a lot of unexpected work and package additions. It no longer works “out of the box”.
Important Note: Install as many packages as you can before trying to run your Rails project. Once you type “ruby script/server” , the weaknesses of your configuration will be exposed, and who knows how the system will behave. Fill in the missing packages before this happens.
From the beginning
Your best bet for getting started is to use Synaptics Package Manager to install this package that supposedly contains everything you need:
ruby1.9.1-full
While you are at it, get the following dependencies that WILL come back to haunt you later:
rubygems1.9.1
libopenssl-ruby1.9.1
libruby1.9.1
sqlite3 (omit if you’re using MySQL)
libsqlite3-dev (omit if you’re using MySQL)
Accept all of the dependencies that Synaptics asks you for. More is better!
Symbolic Links
Do you want to type “ruby1.9.1″ each time? Nah i don’t think so. Make some symbolic links to help you out.
sudo ln -s /usr/bin/ruby1.9.1 /usr/bin/ruby sudo ln -s /usr/bin/gem1.9.1 /usr/bin/gem sudo ln -s /usr/bin/rake1.9.1 /usr/bin/rake
ln makes symbolic links. Check out the man page on it. You can delete the symbolic links when Ruby1.9.2 or whatever comes out.
Rails
Why doesn’t this come standard? Boggles my mind.
sudo gem install rails
Sqlite3
Status: 500 Internal Server Error no such file to load -- sqlite3
Use Synaptics and install : libsqlite3-dev to get sqlite3.h header file
Then:
sudo gem install sqlite3-ruby
Scrapers
If you use hpricot or any kind of scraper, use Synaptics package manager to get:
libxml2 libxml2-dev libxslt1-dev sudo gem install hpricot sudo gem install mechanize
Random Stuff
Problem: NameError (uninitialized constant ApplicationController) Fix: sudo rake rails:update Problem: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' when "rated" : @movies = Movie.paginate(:al... Fix: In Ruby 1.9, colons in a case statement are disallowed. Replace them with a "then" statement.
Turns out that the new rails renames app/controllers/application.rb to application_controller.rb. This cute rake task will take care of it for you.
sudo gem install hpricot
Can’t compile the example WordCount.java (Hadoop)
http://mail-archives.apache.org/mod_mbox/hadoop-common-user/200907.mbox/%3Cd6d7c4410907201717t672e4caet3f369d7e4327ff7b@mail.gmail.com%3E
Seen this?
Rajat@rtde ~/java
$ javac -classpath /home/Rajat/hadoop-0.20.1/hadoop-0.20.1-core.jar -d
wordcount_classes WordCount.javaWordCount.java:5: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.Path;WordCount.java:6: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.*;
^
WordCount.java:7: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.*;
^
WordCount.java:8: package org.apache.hadoop.mapred does not exist
import org.apache.hadoop.mapred.*;
^
WordCount.java:9: package org.apache.hadoop.util does not exist
import org.apache.hadoop.util.*;
And running CygWin on Windows? Tried everything for your classpath
huh? Try this:
$ javac -verbose -classpath C:\\cygwin\\home\\Rajat\\hadoop-0.20.1\\hadoop-0.20.1-core.jar -d wordcount_classes WordCount.java
(Change your cygwin path, obviously)
Use the -verbose flag to show the entire class search path.
Aircrack NG on iwl3945
The iwl3945 would not go into monitor mode as easily as some of the
documentation says.
To get this to work, I had to go through a peculiar set of steps.
Notice the changing argument, wlan0 or wifi0.
1. airmon-ng stop wlan0
( will say “monitor mode disabled)
2. airmon-ng stop wifi0
(will say nothing much)
3. airmon-ng start wlan0
(now it agrees to go into monitor mode:
(Monitor mode enabled on mon0)


