More unix goodness
Ohh the unix command prompt, I love thee! Can you guess what these commands do? 1 2 # grep -l <regex> # find . -name <regex> -delete
Ohh the unix command prompt, I love thee! Can you guess what these commands do? 1 2 # grep -l <regex> # find . -name <regex> -delete
Since my last post, I’ve had a couple of replies, a few more tweets, and few minutes of talking about unsigned types in Java, and why it doesn’t support them. I still retail the view that unsigned types are unnecessary for the majority of Java developers. The only kind that should care, are those who deal with network information (like representing an ipaddress or macaddress). Everyone, put down your forks, and do not touch the unsigned. ...
An interesting thing for me, is that if I am active on twitter during daytime in India (now that I’m here on vacation), I get to have some interesting conversations about design and development. Today, I chanced to talk about the lack of unsigned values support in Java. veechand is there unsigned int in #java support your answers 10 Jul 2010 from TweetDeck shiva @veechand nope. but use char instead. If you really want a type, you can define your own class backed by char 12 Jul 2010 from Twitter for iPhone in reply to veechand ...
Recently I got asked, what the best way to do a join between two large lists, into another list was? I always tend to answer that question with: it depends. Just like any other algorithm, there is no silver bullet. It is a trade off between CPU and memory utilisation. Sometimes, we do have to think about these things (this is code in c++ on a device with scarce resources, to say the least). ...
I got really sick of using Adobe AIR apps that take up more and more of system memory for an app that does twitter. I’ve decided to put my “coding for myself” hat on and write a QT based C++ application (that should be cross-platform). No name as yet, but I will find something soon. QtTwitter is taken. Mebbe, once I have a working version, I can get ownership of the project on google code. ...
Over the last few months, I have re-discovered some unix commands (it’s been such a long time) Eliminate duplicate lines from a file #sort -u filename > filename.new List all lines that do not match a condition #grep -v ajsk filename Copy contents of two files to one #cat file1 file2 > file3 Append output of a command to a file #cat file1 >> file2
The simple way to retreive the list of changed files would be to update the tree, which would then list the files updated. #cvs update . > filelist.dat The problem with this, is that if there have been changes to other files after your last update, you will have to manually glean the files that you have changed. I tend face this, particularly during the last couple of weeks before a release, since you don’t want to risk updating your tree everyday, but still have to make 2/3 checkins. I did some googling today, and found how to find the list of files changed without updating your tree. ...
After several months of keeping away from updating or changing my website, I broke the fast today. I found a wonderful plugin, sideRSS, which allows display of RSS feeds within a blog’s sidebar. As usual, I needed a specific functionality that was not supported the way I wanted it. I hacked it a little bit, renamed the plugin, and posted a custom version for download on my website. If you need to share Google Shared Items, on your blog, but hate to include javascript (like I do), then use this. You can download it here (right-click and use “Save Target As…”) and find install information here. ...
I had to compare machine hardware today, and found information on that here. **#prtdiag -v - **Gives hardware information about FSB, Sparc Model, CPU speed, RAM, Harddisks, USB drives (ie. PCI and networking slots) etc. Click on the image below, for a detailed overview of prtdiag’s output #psrinfo -p - lists number of physical processors . #psrinfo -p -v - list number of virtual processors (cores) per physical processor. #psrinfo -v - detailed information for each virtual processor. ...
I have been twidling with HTTP Persistent connections in the last few weeks. Let me start at the beginning I needed to replace CORBA in a legacy application with something new. Ofcourse, there are a few alternatives out there, but I needed something very lightweight. The problem had two major parts Command Execution - Let the client, execute a function on the server-side and process the output data Eventing - Make clients register for events and wait until some events occur and the server transmits the required objects to the client side. The Command execution was simple. Expose all services provided by the server as SOAP services and make the clients talk SOAP/XML, however SOAP involves a lot of overhead in terms of serialising the object into an XML stream and later decoding that. Since both the client and server were completely in Java, I just had to transport the Java object itself The event part, however, provided a challenge. I had restrictions on opening ports on the clients (Issues like firewalls, NAT, SSL support etc etc). So I chose to use HTTP itself to do eventing. ...