Skip to main content

Posts

Showing posts with the label tips

Spring MVC: mvn sonar fails when mvn test passes

Stranger things have happened. But this blows many a mind. mvn test on a restful services project with spring mvc succeeds but mvn sonar:sonar fails with 404s on controllers. This happens when the controllers are marked @transactional for the restful service to be exposed as a unit of work. Don't fret. Its easy to solve this.

Groovy Camel Processors

Fuse ESB 7.0 comes with Camel 2.9 components. Camel has groovy support from 2. 8 9 to create predicates and expressions. There is a GroovyRouteBuilder in 2.9 that lets you build dsl in groovy, albeit with java api. This is especially un-groovy when you have to write a .process .

Appcache manifest file issues/caveats

Application cache (appcache) is a powerful feature in HTML5. However, it does come with baggage. Many (see links below) advocated ferociously against it due to tricky issues it comes with. For someone who is just testing waters, these issues may throw them off grid. Knowing them before hand helps reduce some unpredictable effects.

3 reasons to migrate to Disqus commenting platform

Over the last weekend, I evaluated DisQus commenting platform. I saw compelling reasons why Blogger's default commenting is primitive in comparison. Today I am launching DisQus on this blog. Here are 3 most important reasons that made this decision easy.

Eclipse Indigo without mylyn

Eclipse's new release Indigo (3.7) comes pre installed with Mylyn. And unlike previous installations Mylyn is tightly integrated with Eclipse platform package. The "installed features" does not show it as a separate feature to uninstall. It appears as if it cannot be uninstalled at all.

Why Acer a500 ICS update's distribution strategy is a failure

Acer released the Android Ice Cream Sandwich (ICS, aka 4.0) update on Apr 27th 2012, for its A50x line of tablets. The owners were ecstatic about the news. Nevertheless, the process of deployment for Acer and the installation for the end-users was nothing short of a disastrous saga .

MySql Copying Table Structures.

Some times you need to copy only table structures across databases. This article describes two ways of doing it. If the whole database schema need to be exported, mysqldump is very effective. A --nodata flag will dump all tables' schema. Like this. mysqldump --nodata -p -u username databaseName But if you want to copy a specific table, individually, you could use "create table like" feature. You could create it even from a different database. However it must be on the same mysqld instance. Like this. create table newtable like oldtable; --Or from a table in other database create table mytable like otherdatabase.tablename;

Developing Userscripts for Chrome (caveats)

To develop Chrome extensions, crx is the best way. But the user scripts that are developed in general for Greasemonkey can also be delivered for Chrome, if a few easy rules are followed. 1. @required and @resource don't work. By default, atleast for now, These two Userscript metatags donot work on Chrome. If you need to load a js file, instead of using @required - try to use document.createElement. Similarly with @resource. 2. Some GreaseMonkey helper methods don't work or are restricted. Methods with GM_ prefix from userscript api may not work. Particularly, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue are not supported. GM_xmlhttpRequest will work but not only on the same domain. 3. @include s are not shown while installing. This may not be a deal breaker for developers, but sure is for users. The patterns used in @include is not shown while installing. Instead a generic message is shown as below. This message may scare the users away. ...

Reduce Yahoo mail neo header space for more room

Update: Yahoo mail with new layout renders this obsolete. The newer Yahoo mail beta (neo) really is a faster UI. However, The large header with room that is unused is a let down.  This one time, it appears that, Yahoo did not take into account the importance of real estate on top of the page, hitting User Experience. Reduce Yahoo mail neo header space for more room by installing SarathOnline's " Spacier Yahoo Neo " userscript below Install YNeo UserScript by SarathOnline Before: After: The user script is fairly simple. You could install it in Firefox as a Greasemonkey script. Or install it on chrome directly. If you are new to UserScripts, follow these instructions to install them on your browser. Be assured, it has no malicious code. All it does is install a correcting css to the document. The css file is located here .  And the script itself. (function(){ var d=document,sid='__sar__yneo', fn='http://www.sarathonline.com/dyn/sfs/userscripts/y...

Installing Userscripts in Firefox, Opera, Chrome

Want to install a userscript on your browser. Go no further. Here are simple instructions and caveats for installing Userscripts in Firefox, Opera, Chrome. If you want to author your own scripts, here is a beginner's tutorial .

Tips for Chrome developer tools

They say if you don't have Firebug you are not a developer. But Chrome developer tools, is just as sweet developers in chrome. Firebug is a very powerful tool in itself. Chrome dev tools adds a few more features that make it a pleasure to develop on chrome. Here is a quick video that may have your head turn to Chrome.

3 simple steps to update Samsung Captive to Froyo

Are you one of those people who don't  have Gingerbread on your captivate. Still with Éclair, because you don't want to *root* your phone or scared about voiding the warranty? You are in luck, Samsung released its AT&T stock update to froyo. You have to get this using Samsung's "Kies Mini" program. Kies is a windows application that will safely (no warranty voids here) flash your phone. You are still recommended to save ALL your data before you do anything with the phone. Unfortunately, there is no love for Linux/mac users.

7 errant UI features in IE9

IE9 has some really cool tech upgrades .Here are a few errant UI features that makes IE9 less than perfect. It almost gives the impression that the UI engineers did not do a stellar job. or IE9 UI is a half baked cake.

cssh, PuTTYCS - keyboard replicators for clustered administration

If you administer a bunch of identical Linux boxes, and have to run same commands on all of them, say like manual deployments, restarts etc. – you probably log in to each of them manually and run commands. Or at best you would have a script looping through them and executing an ssh on each. However there are times when you need to be interactive on each box, yet run the same and/or series of commands. In those cases, cssh on Unix (with X) and PuTTYCS on windows are a godsend for any administrator.

Windows: acting weird, wakes up spuriously?

When you suspend Windows, you expect it to live in the slumber. And only act when you command it to wake up. However, Sometimes, Windows wakes up, apparently for various reasons. And it wont tell you why, like most other things it wont tell. But if you are wearing one of those investigator hats today, get to the bottom of it. Using Windows Event Viewer. To fire up Event Viewer, available in Control Panel > Administrative tools. You can apply filters to the events displayed, by using the controls on the right. You could use Event Sources (look for power*, for spurious wake ups), and/or keywords. Or you could manually go through all of the logs.

11 things the students did not and would not learn in school

EDIT1: Mar 4 2011, 11:23 EST - At this time, This list seems to have been incorrectly credited to Bill Gates (thanks for pointing out, @Mat ). MICROSOFT’S billionaire Bill Gates recently gave a speech at an American high school at which he spoke about how feel-good, politically correct teachings created a generation of kids with no concept of reality and how this concept set them up for failure in the real world. Well looks like He copied from Mr. Sykes. To buy the book click on the image. Life is not fair — get used to it! The world doesn’t care about your self-esteem. The world will expect you to accomplish something BEFORE you feel good about yourself. You will NOT make US$60,000 a year right out of high school. You won’t be a vicepresident with a car phone until you earn both. If you think your teacher is tough, wait till you get a boss. they called it opportunity. If you mess up, it’s not your parents’ fault, so don’t whine about your mistakes, learn from them. Befo...

Beginning with Android.

Got a new Android? This is the first place you should be looking at these tutorials . Online Search for Market Apps: If you are looking to search for market apps, and thinking that there no such online search tool? There may not be an official Google hosted online market replica, but appbrain.com gives one. Installing Apps: Most websites you browse on the laptop/computer, have what are QR codes (eg. shown below). These are like images that link to urls on other sites or market apps. So first you have to manually go to market place and search for " Barcode Scanner " and install an app by ZXing. From then, you can use the scanner to install various apps that can be looked up by QA Codes. This app can also get you product lookups (however there are specialised apps for that) Appbrains.com app: Appbrains has an app manager that can manage your apps, installing them and their updates. You create a profile online and all your installations are synced to your device. This...

Import Mysql data (or a CSV file) into MongoDB

You have MySQL database. And want to move either all, or some of the data into MongoDB. There is no direct way to do it, as such, It can be done in two steps. (If you are here because you have a csv file instead (or directly) move on to Step 2.) Step 1. Export all of your MySQL data as a CSV file. select columns INTO OUTFILE ' /path/to/csv ' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' from table [ where clause ] Step 2. Import the CSV into MongoDB. Assuming you have MongoDB running (on local, defaults) run the following command mongoimport -d dbname -c collname -type csv -f fields-sep-by-coma --drop /path/to/csv if your csv file has a header row add --headerline . p.s.: for more options on mongoimport look here More tips on mongodb, coming

Use E-Tags and Cache-Control: Caching your Dynamic web Content Better

This site rendered js and css (now even images) dynamically. Contents of files are stored in Google BigTable Datastore and are served by a DynServlet. The DynServlet maps the name of the file to content of the file in DB. This was slowly using up a lot of resources. Adding a layer of memcache, saved some Datastore API calls. But the memcache calls were still significant. So an ETag mechanism is introduced. A Global ETag is generated on any file posted or updated, and (G-ETag is) stored in Datastore. To save App Engine resources (which are counted to cost), the ETag header is obtained from each request checked with GDTS from backend. If it is the same a "304 – Not Modified" response is sent back, asking the client to use the local cache copy. If it is not exactly same, a the request is passed through and rendered dynamically. This guarantees all content will be served fresh after every deployment. Requests in between deployments may be served from client-side cache, because ...

MySQL > java.sql.SQLException: Error writing file '/tmp/MY1kynpA' (Errcode: 28)

Recently, a heavy burst of traffic into our production webservice caused this error. As with all Mysql errors, this shows little information. Like any sane person would think, we checked if the filesystem was full. We found the /tmp has 98% free space. Permissions are all fine. No locks on table. Increasing /tmp partition - NoGo. Just crazy error message. However, the issue was beating us time and again. It took us a couple of days and we realized the cause was a select query. The query was fetching from a table of about 2 million records. Although it was fetching a limited subset, the column in the order by had no index. This was causing mysql to load records into pagefile in tmp for sorting, apparently. Created the index on the sort column seemed to have solved the problem. We also augmented it with the following options in my.cfg sort_buffer_size=2M table_cache=1800 thread_cache_size=384 tmp_table_size=64M