git shows that I deleted all the files in my repo and staged them for commit after I did a git pull. Why? stackoverflow.com/q/9867957/1235…— Jason Bosco (@jasonbosco) March 26, 2012
Working on assignment
Need to test code on nunki (USC server)
Spawn 10 background instances of the program to see if they work in all cases
Hmmm, only one instance spews out output. Whatever happened to my other instances.
ps aux | grep java
No more instances show up
But hey look there’s another user running a similar program, using the same package name
There’s someone else doing the assignment at this hour!
I wonder who it could be?
USC campus directory -> Search for user name (from ps output) -> Get full name
Hmmm, do I know this guy?
Ctrl+T -> facebook.com
Search for full name
Hey look we have 5 mutual friends
Wonder how these guys know each other
Hey look he’s worked here here AND here!
What oh what would I have done without Facebook
Now where was I?
Oh snap, I’m writing this post.
Back to my assignment.
It’s incredibly frustrating when someone launches a DOS attack on a free service like Scribble. Come on, we host the app and give you cloud sync for free, paying for the server resources ourselves and then someone does this. So not cool.
Well, I guess there’s no point complaining. We’ll do our best to tackle the attack.
I happened to stumble on this site which embeds the SQL query in their URL!
http://www.s-cube-network.eu/refbase/search.php? sqlQuery=SELECT%20author%2C%20title%2C%20type%2C%20year%2C%20publication%2C %20abbrev_journal%2C%20volume%2C%20issue%2C%20pages%2C%20keywords%2C %20abstract%2C%20address%2C%20corporate_author%2C%20thesis%2C %20publisher%2C%20place%2C%20editor%2C%20language%2C%20summary_language%2C %20orig_title%2C%20series_editor%2C%20series_title%2C%20abbrev_series_title%2C %20series_volume%2C%20series_issue%2C%20edition%2C%20issn%2C%20isbn%2C %20medium%2C%20area%2C%20expedition%2C%20conference%2C%20notes%2C %20approved%2C%20call_number%2C%20serial%20FROM%20refs%20WHERE%20serial %20%3D%20494%20ORDER%20BY%20author%2C%20year%20ASC%2C%20publication &client=&formType=sqlSearch&submit=Display&viewType=&showQuery=1&showLinks=1 &showRows=30&rowOffset=&wrapResults=1&citeOrder=&citeStyle=APA&exportFormat=RIS &exportType=html&exportStylesheet=&citeType=html&headerMsg=
As you can imagine, the first thing that occured to me was to change that SQL query to something fitting, may be replace the SELECT query with a DELETE? Nah.. I shouldn’t be malicious I thought. And so I tried a simple UPDATE of one of the attributes, something which if it went through, I could easily revert back and not cause any damage. And so I tried an UPDATE query. Good for them, they atleast restricted the DB user to only perform SELECTs on the table.
Here I am thinking “I should sanitize all my input” worrying about SQL injection and stuff. And I see this. Made my day or should I say year. Happy New Year!
When Kishore and I iterate over product designs, I often feel the need for a tool that will allow me to propose changes to a HTML mockup by simply clicking and dragging DOM elements from within the browser, instead of taking a screen shot of the page and editing the image.
Thus was born Shifty - a Chrome extension to move DOM elements or edit text on any webpage, from within the browser. My workflow is now as easy as turning the extension on, moving elements around and editing text and finally taking a screenshot to capture my changes.
You should give the extension a shot and let me know how it goes: https://chrome.google.com/webstore/detail/dlkpkmehbgbpobaidinekoedabkdidnb
Here are some screenshots of the extension in action:
In the near future, I plan to add a way to take screenshots from within the extension. More feature suggestions, feedback and bug reports are welcome!
When I connect to a virtual machine running Ubuntu 10.04 LTS on Hyper-V, the refresh rate of the console used to be terribly slow. It would refresh the screen line by line with each line taking 1 second! It was painfully slow. So, all this while, I used putty to SSH into the VM just to avoid using the console. And then came a situation where I locked myself out of the instance (thank you DenyHosts for doing your job well) and I had disabled remote root login. So I was forced to use the console and it was time I find a solution for the slow refresh rate. It was quite simple:
Add the line
and restart the virtual machine. And now the refresh rate is back to normal.
Today I had a question for Apple Sales and I googled for “apple live chat”. The third link in my search results pointed to this page: http://www.apple.com/r/store/livechat/ - “Apple Store - Live Chat”.
It looks like it is an old page just lying around on apple.com. Ah the classic “Mac look” back in the day. It reminded me of the first time I saw a Mac at a design studio in a digital press when I was in 8th grade.
I tried submitting values into the form and it didn’t work. The form points to chat.info.apple.com which resolves to 18.104.22.168.
This is a handy tool that I use to pretty-print JSON especially when I’m working with APIs:
I’ve always wanted to do something like this:
UPDATE table1 SET (col1,col2)=(SELECT x,y FROM table2 WHERE table1. CommonColumn =table2.CommonColumn);
Finally I got around to looking it up and found the answer to how to do it on SQL Server:
UPDATE table1 SET table1.col1 = table2.x, table1.col2 = table2.y FROM table1 INNER JOIN table2 ON table1.CommonColumn = table2.CommonColumn
However, in MySQL this is not supported. To achieve the same effect in MySQL I came up with this:
UPDATE table1 INNER JOIN table2 USING (CommonColumn) SET table1.col1 = table2.x, table1.col2 = table2.y
The UPDATE syntax for MySQL is here: