Today I was trying to connect to SQL Server from my OSx Mac and I was getting "Unable to connect: Adaptive Server is unavailable or does not exist".I was able to connect to another sql server in the same farm from laptop.Found out by default --> TCP connectivity is disabled for SQL Server.Microsoft SQL Server 2008 R2 > Configuration Tools > SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for MSSQLSERVERProtocol Name: TCP/IP (Enable)Thats all :))
Who knew Le Peep had so many locations around the country from Colorado to Texas to New Jersey?! They are famous for their breakfast and lunch. The place tends to have that diner type feel which shows up in the quantity of the food as well, though I think the experience is not as casual. […]
I have big data problems.I need to analyze 100s of millions of rows of data and tried hard for 2 weeks to see if I can use R for this. My assessment so far from the experiments...1) R is best for data that fits a computer's RAM (so get more RAM if you can).2) R can be used for datasets that don't fit into RAM using Bigmemory and ff packages. However, this technique works well for datasets less than 15 GB. This is in line with the excellent analysis done by Ryan. Another good tutorial for Bigmemory.3) If we need to analyze datasets larger than 15 GB, then SAS, MapReduce and RDBMS :( seem like the only option as they store data on file system and access it as needed.Since MapReduce implementations are clumsy and not business friendly yet, I wonder if its time to explore commercial analytics tools like SAS for big data analytics.Can Stata, Matlab or RevolutionR analyse datasets in the range of 50 - 100GB effectively?Referenceshttp://www.bytemining.com/2010/07/taking-r-to-the-limit-part-i-parallelization-in-r/http://www.austinacl.blogspot.com (image)
How to make prototype.js and jquery.js work together….?Answer is in fact very simple and indeed jquery did it all for you already following is the code snippet on how to do it:<script src=”.../prototype.js></script><script src=”.../jquery.js></script><script>jQuery.noConflict();</script> and replace your $ of jQuery with jQuery that it guys you are good to go :)
VMWare launched Colud foundry, an open extensible PaaS cloud built entirely on Ruby. VMWare is focusing on the following 3 key differentiatorsMulti-cloud - Enables seamless transition between Private, public and hybrid cloudsMulti-framework - Spring (Java), Rails (Ruby) and Node.js - extensible to other frameworksMultiple applicationsCheckout this quick intro VMWare is pitching the Cloud Foundry directly to the developer community. This strategy is well summarized by this quote by one of the VMWare developers "Developers should write code, not IT trouble tickets"..Time will tell how well the developer community adopts this new service. Nonetheless, VMWare has managed to set itself apart from the multitudes of 'also ran's (read other run of the mill cloud service providers).
I’m a massive fan of Notepad++, the lightweight Windows based text editor, it has a tiny footprint but packs enough features to make it my go-to Windows text editor. Up until quite recently however, I’d been missing snippets, but not … Continue reading →
Having searched around for a while, looking for a set of CSS3 ‘buttons’ and not finding anything exactly right for my needs, I decided to create a set from scratch. Being the generous kind of bloke I am, I though … Continue reading →
Ken Collins from EngineYard released TinyTds, a ruby gem that uses dblib to connect to MS SQL server. It has no hassles of managing ODBC connection. Read the blog for detailed explanation.Before TinyTDS:The steps for setting libraries to connect to MS SQL on *nix environment. Follow the steps religiously to succeed. Enter TinyTDS:TinyTDS helps ODBC-less connection which means no pain of installing all the ODBC libraries. It took a min to set-up the connection using the steps. Goodies: Steps on Mac OSx Snow Leopard
Search optimization is a very fancy field these days. Many people do it right, but many wrong. I like to think of it as something that helps me provide ma users with better content. Also, I tend to look at it from a different point of view. These are the main pillars of this article.
We have been using "Capistrano" to automate the deployment of our Rails apps. Capistrano is very powerful helps to execute any command on the remote machines. It has before/after "callback" hooks that helps to execute commands your application might depend on before running "cap deploy".Capistrano assumes all the remote machines have the same credentials. Imagine you want to run commands on different remote machines each having different credentials.Added a small extension for capistrano to prompt for password again when connecting to another server.Drop the code in your Rails.root/lib directory.You will have to add:in you recipes to force capistrano to prompt.Bonus: Create ssh public keys and enjoy password-less deployment. Next step: fork capistrano to add method for connecting to multiple servers
India and Pakistan have intense rivalry. They are siblings, who like each other deep down but fight often.Their love isn't apparent. You see it in their appreciation of each other's culture, entertainers and sportsmen, and even politicians e.g. Indian movies and movie stars are popular in Pakistan and Benazir was popular in India. You also see their love when Indian and Pakistani people meet in a 3rd country, where their media and politicians don't brainwash them. Their they get to know each other really well. I'm from India and one of my best friends is from Pakistan.Their fights on the other hand are much more evident. Their fights have translated into wars (1965, 1971, 1999), political battles (UN, US/USSR, local politics), movies (Border) and sport rivalries (Cricket, Hockey). We compete in sporting events with fanaticism and millions follow it closely.One such battle took place in Cricket World Cup 2011. It started with Pakistan's inspiring performance in preliminary rounds and then them knocking out West Indies (the weakest team in quarter finals) in quarter finals easily.India was expected to make it to final eight and did. India had to play Australia (4 time world champions) in quarter finals. Australian cricket isn't as strong anymore with many superstars retiring Gilchrist, Hayden, Warne and McGrath). In a thrilling contest, India beat Australia in Motera, Ahmedabad. Indian bowlers restricted Aussies to 260 and the batsmen scored 261.This setup up a thrilling contest between India and Pakistan for a place in finals.I was in India during Cricket World Cup 2011 and got to witness this battle in Mohali, Chandigarh. This is my travelog for this particular contest.60 HOURS OF INDIA-PAKISTAN WORLD CUP CRICKET THRILLMar 29- Baroda to Mumbai by air (12:30pm - 2pm)- Pick brother from office at 6pm and head to the airport- Dinner at Mumbai airport at 7pm while watching Sri Lanks vs. New Zealand semi-final match- Mumbai to Delhi by air (9:30pm - 11:30pm)Note: There were no direct flights from Baroda to Chandigarh, so I had to go to Mumbai. And then to Delhi from Mumbai as all direct flights from Mumbai to Chandigarh were sold outMar 30- Delhi to Panipat by car (12 midnite to 2:30am)- Dinner at dhaba (street restaurant) in Murthal - yummy food- Slept for 2 hrs. Woke up at 5:30pm. Dressed in Indian team T-shirt and shorts. Grabbed my lucky Indian flag that I bought in Motera, Ahmedabad during India-Australia game- Panipat to Chandigarh by car (6:30am to 10am)- Collected tickets at 10:30am- Drove to Mohali stadium by car- Found entrance 1C (11am) after driving around the stadium twice (need better instructions on the road for stadium gates)- Easy checkin into stadium (20 mins in general first-level security and 2 mins in 1C gate security)- Sat in block A Pavillion Terrace on south side (11:30am). Good luck with seats: no direct sunlight, beautiful weather- Watched preparations (wicket and field care, opening cermony preparations, team preparations)- Toss@2pm- India started batting at 2:30pm- We were snacking, hydrating thru out the innings- Our section was filled with top-brass from Chandigarh, Delhi, Mumbai. Beautiful girls from Delhi, Mumbai, and Chandigarh- Celebrity sighting: Arbaaz Khan was sitting in our section. Amir Khan, Preity Zinta, Indian PM Manmohan Singh and Indian businessmen were sitting in stands above us. Amir acknowledged the crowd, enjoyed the match thruout.- Requested others with camera phones to click our pics and email it to us (eagerly awaiting those pics). I guess its time for me to upgrade my Blackberry and get one with a good camera.- Duel with Pakistani fans sitting above us (noisy, beautiful girl, Afridi's brother, 4 adults, 4 - 6 kids). "Jeetega bhai jeetega India jeetega" would always overshadow "Jeetega bhai jeetega Pakistan jeetega".- Good gesture from crowd: no booing, no Pakistan hai-hai, friendly, sporting, knowledgeable crowd- Indian PM, Manmohan singh and Pak PM, Ghelani, met with the teams during opening. Everyone clapped. No one shouted anything bad! Indians love Sachin a lot and everything he does, so the focus was on him instead of the 2 head of states. Someone even shouted "Sachin for Prime Minister"- India scored less than anticipated batting first (260 instead of 300+). Started well with Sehwag's blisterning (though short) knock but others could not capitalize. Even Tendulkar's inning wasn't impeccable (4 dropped catches)Innings break- Pakistanis start well but wickets keep falling afterwards to push them towards defeat- Pakistani tails crumbles but not before giving the crowd a few anxious moments (Misbah's 6s)- Exciting match, tense crowd. Anyone could've won till 90th over in the match!- Sporting behavior on-field as well. No fights, no verbal duels. Nehra dismissed a close floored catch- Great gestures off-field: India-Pakistan PMs; Players joking, laughing, shaking hands; Pakistan fan holding the Indian flag after Pakistan lost- Match presentations: Sachin man of the match. Stadium acoustics suck. No one could hear the captains during the toss, interviews in the presentation ceremony (it was bad in Motera, Ahmedabad too). Punjab Cricket Association please fix it- Peaceful exit at 11:30pm, decent, helpful crowd. Found car in 10 mins (quite amazing given the number of people and cars)Mar 31- Chandigarh to Panipat by car (12 midnite)- Dinner@dhaba (line hotel) 2am - 2:40am. Yummy tandoori parathe (hail Punjab and Haryana for such great places to eat all along the road)- Reached Panipat at 3:30am and crashed for 7 hours- Panipat to Delhi by car (11:30am to 1:45pm)- Remebered and thanked god for bringing us back safely. Car driving in Delhi, Punjab, Haryana highways is no joke. Its like playing a video game - you play chicken all the time, you expect others to brake for you, lanes have no meaning. If you're tempted to drive yourself, I would advise against it. These roads, laws (or lack thereof) are best known and handled by seasoned drivers in these conditions.- Watched highlights of the game at the airport (thx Hyundai for sponsoring big screens)- Delhi to Mumbai by air (3pm to 5pm)- Mumbai airport to home by car (5:30pm - 6:30pm)Next up, is watching the finale between India and Sri Lanka at Wankhede stadium in Mumbai.
Just wanted to quickly share the awesome new ActiveRecord Relational Algebra. I am sure there are many others but this one is a gem.For long conditions like these:Post.where("(body like ? OR subject like ?) AND comment_count > ? AND created_at > ?", criteria, criteria, 5, 3.days.ago)It becomes really difficult to match the order of parameters. Welcome to ARel, the same query can be written as:Post.where("(body like :criteria OR subject like :criteria) AND comment_count > :count AND created_at > created_date", :criteria => criteria, :count => 5, :created_date => 3.days.ago)See the binding variables in place of hard to remember question marks. It is important to note, in case the same variable is repeated multiple times, passing the variable once is sufficient. More goodies to come !!
Run the 'bundle install' command on your terminal and wait for bundler to install the gems. It is pathetically slow.It appears that RubyGems is slow. This is because of how Rubygems manages index of gems . It has 3 indexes:1) Index of new version of the gem2) Index of all the versions3) Index of pre releaseDoing "gem install , fetches the index of the latest version of the gem. Apparently, bundler downloads #2, all the indexes. These indexes are gzipped and Marshal'd array of gem name, version and platform. Parsing this huge array is the first spot of slow down.Now as we know bundler has intelligent algorithm for dependency management, which means when we do "bundle install", it will install all dependencies of the gem. This is achieved via .gemspec file which bundler downloads unzips and "UnMarshal's". To reduce the slowness there few options, lets explore them:1) "bundle pack" the .gems inside vendor/cache - force bundler to install from local cache then going across the wire2) have your gems in "Gemfile" to be locked to a version or use PessimisticVersionConstraint.I have used a combination of both and found substantial improvement in the time taken by "bundle install/update".There are few other options like - MirrorBrain, rubygems-mirror, murder etc. Keeping a watch on gemcutter mailing list for better ways of doing this.
Today while doing "bundle update" my server started to throw weird error.Somehow I was not able to relate it to bundler and doing # gem update updating installed gems ERROR: While executing gem … (ArgumentError) marshal data too shortexplained that gem specs on the server is corrupted. I still need to figure out the reason why that happened in first place.This error kept popping up – no matter what commands I wanted to run with rubygems (update, update –system, install…)Googling did not give any solution on this topic. I had a feeling it is messing with ~/.gems directory - and found out to be true.I deleted all entries inside the ~/.gems directory. I had to just just reinstall all my gems.Any better ways to solve this problem ?