Skip to main content

Posts

Advantages of working remote

There are many disadvantages of working remote   but there are many advantages of working remote. You are saving time on commute so you get more time for family if you are disciplined enough to start/stop work at office times (rarely happens on all days but still better than getting stuck in traffic) Less people coming and distracting you by just walking into cubicle to discuss office politics Less people coming and asking you things that they can just google for themeselves. Due to the above points you get more work done in less amount of time. You RTFM more than usual. If you are stuck on an issue you are the only one who can find the solution as the luxary of walking into someone's cubicle for help is gone, In a sense its a double edged sword but as you are left with no choice in the end you come up as winner and you become more and more of problem solver on your own. This way you tend to research things in detail and increase your arsenal of skills.

openoffice and NFS file saving issue

I recently integrated a file preview application in our application with team, so now users can preview most of the files without downloading them. The hard part was to deal with NFS issues due to locking and caching. We chose to buy v/s build for the file preview and bought some third party service. The third party service lets call it APreview had a http api where you can pass the source and target file path. It would have been much better if we could stream the input and it could stream the output but that option was not there. Because we can only pass paths to it the natural solution was to use NFS paths. So we ran into two major issues: 1)The APreview application internally uses openoffice to convert word/PPT/Xls files to pdf and then it converts pdf to swf. openoffice has some issues with writing to NFS and we could use vi and other tools to write files but openoffice would just refuse to save the file as pdf. Finally I found that commenting these two lines in /usr/lib64/openof...

Disadvantages of working remote

Just ranting it out loud, I am working remote for the past two years for a startup and there are many advantages of working remote but there are many disadvantages also. Its hard to chase people over phone. As people wont pick up the call or they wont reply to Instant Messages. So you are stuck in your chain of thoughts cursing the monitor. You miss the coffee talk. You miss what's going on in the office and really dont know whats going in the company. In meetings you could be writing code and its easy to get distracted over phone. Some people prefer to chat over talk and thats a pain because you already miss the social connection and typing is always a pain. You miss all company dinners and lunches. Because you save time on travel you tend to overwork. Worse if you are working in a different timezone then people would disturb you off hours. Lots of time is spent in trying to screen share or do go to meeting. People will prefer to talk to person in house and unless you ...

Jesey writing an authentication filter

It seems there are two ways to add authentication to Jersey REST apis 1) You can add a servlet filter. public class RestAuthenticationFilter implements Filter {     @Override     public void destroy() {         // TODO Auto-generated method stub            }     @Override     public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {          try {            User user = BasicAuthHelper.authenticateUser(request);             if (user == null) {                 response.sendError(HttpServletResponse.SC_UNAUTHORIZED);             } else {         ...

Jersey Rest API html documentation

There are various ways to generate REST api documentation but how can you do it with minimal effort. Unless you are looking into very sophisticated documentation like twitter https://dev.twitter.com/docs/api, the below should suffice. If you though however want to generate twitter like documentation then also 70% of what I highlighted would work. Jersey by default supports WADL generation by default. WADL is machine readable rest api description simliar to what WDSL was to soap. In order to get to default wadl generated by jersey you can just call http://localhost:8080/application.wadl . This WADL is a XML document so all you need now is to render it with a stylesheet. WADL has documentation tags that can be used to document a resource byt unfortunately jersey by default doesnt generate documentation tags. So to get real html documentation the steps are: 1) Document you rest services using Java docs for the resource class and resource method. The down side of using java docs i...

Generating pdf out of html using Java

I had this requirement of generating PDF out of HTML content. Users can add any kind of html content on a Rich text editor from few lines to a full paragraph as notes for a file and save it on the server. Now I had to notify other users when some user adds a note. Now in the past I have generated PDF for reports but that was on a structured data straight out of database so I could easily use something like itext or jasperreports but  this one seems an interesting problem as user can do any free form html in the editor. Ultimately the solution came to be: Convert the html added by user into xhtml using JTidy  Use flying saucer's ITextRenderer ( http://code.google.com/p/flying-saucer/ ) to generate the pdf out of xhtml. Here is a sample code public class TextSectionConverter { private String notesContent; public TextSectionConverter(String notesContent) { this.notesContent = notesContent; } public void writeAsPdf(FileOutputStream fos) throws Exception { ...

biggest concern with moving your applications to the cloud?

wow I wrote about enterprise cloud adoption and found this poll on my linkedin profile that validates my thinking of security and reliability being biggest concerns for cloud adoption by enterpries.