Sreenath H B

Pen and paper | Fingers and keyboard

Home     Blog     Links     Site Map     Contact Me      
See your SMB Ad here!
 
 
Blog Sections

 - Chronological

 - Technomaniac

 - Mental Escapes

 

My Live Space: http://ubshreenath.spaces.live.com and complete blog http://ubshreenath.spaces.live.com/blog 

 

 

 

 

 

Contact Me:  (Comments/Feedback/Business)

* First name (required):

* Last name (required):
* E-mail address (required):

Phone number:
* Message (required):


 

 

Quote Unquote
 

I don't have a religion. I believe in a God. I don't know what it looks like but it's MY god. My own interpretation of the supernatural. - Jennifer Aniston

 

You cannot shake hands with a clenched fist. - Indira Gandhi

 

If I'd had some set idea of a finish line, don't you think I would have crossed it years ago? - Bill Gates

 

I'm that dog who saw a rainbow, only...none of the other dogs believe me. - Quote from the movie Kate & Leopold.

 

I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals. - Sir Winston Churchill

 

Success is the ability to go from one failure to another with no loss of enthusiasm. -  Sir Winston Churchill

 

There are a terrible lot of lies going around the world, and the worst of it is half of them are true. -  Sir Winston Churchill

 

The weak can never forgive. Forgiveness is the attribute of the strong. - Mahatma Gandhi

 

I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. - Albert Einstein

 

- First: Openness to learn - Openness to subordinate your ego to take ideas from others.

- Second: Meritocracy - The best ideas are adopted and implemented using data to arrive at the best decision.

- Third: Speed - Assuring you do things faster compared to yesterday and last quarter.

- Fourth: Imagination - You continually bring better ideas and better innovation to the table.

- And finally, Excellence in Execution: That is implementation of these great ideas with a higher level of excellence today than yesterday. - Five elements of success by N R Narayana Murthy 

Blogroll

August 11

DO NOT DRINK AND DRIVER! Seriously..

Found this awesome warning near the EPIP entrance in Whitefield.

I even asked an innocent Policeman sitting inside the chowki to stand out of the booth so I can take the pic. He believed I was from the Press and that I am reporting the pathetic state of the footpath to a news agency.

Only then did I realize the pathetic state of the footpath. :P

I could not tell him that I am a lame software engineer just out to have some fun so I carried his assumption forward and told him that im a journo for Bangalore Mirror. Ya rite!

DSCN4674



11:55 AM GMT  |  Read comments(2)

August 06

jQuery, jQuery UI, ASP.NET Web Services and SharePoint for Feed Syndication using Argotic Framework

Okay, so I recently completed building an end to end  Feed Viewer Web Part for SharePoint 2007.

I used jQuery for AJAX calls and DOM manipulation.

jQuery UI for creating Tabs and a ‘custom’ Accordion control

ASP.NET Web Services

Argotic Syndication Framework  to get, aggregate and generate feeds. (This free library is real cool stuff. Let me add a Web 2.0 styleicontexto-drink-web20-rss banner in cheers to it!)  

‘No Server Code’ User Control to load the Feed Viewer entirely using JavaScript code.

WSPBuilder to code, build and package my web part, lists and the custom Web Service into SharePoint.

While building this, I faced a lot of technical issues and built workarounds on them to finally roll it out successfully.

Let me foreach over the issues and workarounds.

1. ASP.NET Web Service does not accept an AJAX Call using a GET Request. Also, it does not honor the AJAX request if the content type is not explicitly specified as contentType: "application/json” in your AJAX call.

So you can right away throw the jQuery AJAX methods – get(), post() and getJSON() methods out of the window when your server side is an ASP.NET Web Service. Why – How can you explicitly specify the content type using these methods?

So we are left with the low level $.ajax jQuery call (its actually pretty neat to be called low level.) and here is a sample code snippet:

$.ajax({
            type: "POST",
            url: "http://myserviceurl/service.asmx/WebMethodName",
            data: "{}", // Pass empty parameter list - must for POST request to have content length tag
            contentType: "application/json; charset=utf-8",
            dataType: "json", // Specify return type - try xml, text etc here.
            success: function(msg) {
                alert(msg.d); // returned JSON data is encapsulated in msg.d
            },
            error: AjaxFailed
        });

Read about this restriction from The Gu. So that leaves us with another crippling limitation – We cannot make a cross site/domain (XSS) jsonp call to our web service. (Coz jsonp can be used only with GET requests and not POST.) SO this means our web service will have to be hosted within SharePoint’s domain itself and not on a separate web application even on the same server so that our jQuery web part can make a call to it.

Another headbanger: If you want to simply display SharePoint data on a web page (outside SharePoint) through this web service, then you will have to enable forms authentication on your SharePoint site or do a Windows Authentication Handshake before making this web service call. Not getting into that detail as its a very rare case of implementation.

Read more in detail about making jQuery calls to ASP.NET AJAX Web Services here. Thanks Dave for such a wonderful series!

Did I mention that the plain vanilla ASP.NET 2.0 Web Service is not capable of handling scripted requests (as in from JavaScript). Yes, that’s true. You either need to install the AJAX Extensions 1.0 for ASP.NET 2.0 or upgrade your .NET Framework to 3.0 or 3.5. Then you will be able to add the following tag to your web service class to make it accessible via scripted calls:

    [System.Web.Script.Services.ScriptService]

There is of course more to making your service and web site AJAX enabled. Discover options to AJAX enable an existing web service here. Neat video.

Best workaround for these problems: Use WCF! Works with GET; ContentType not restricted to json; REST support using UriTemplates and more. I tried this too but since upgrading to .NET 3.5 on the production server was a little too much to ask for this, I stuck to Web Services. If you are giving WCF a trial, might I also suggest the OOB Syndication Framework support in WCF. (Might help if your clients are against using open source plugins such as Argotic in their production environments.) It has support for RSS and ATOM as well as a Generic Syndication format which one can extend/override and use as you wish.

Now to the UI:

jQuery UI is a neat framework which provides OOB Javascript Tab controls complete with CSS themes (choose your theme and download the CSS). It also provides a neat ICON sheet with different colour overlays for different UI states. Check it out too.

View jQuery UI Demos here.

There are tabs and accordions available OOB for me to use. This was all I needed for my feed viewer web part. The root categories would be the tabs, sub-categories would be placed into accordion panels. Alas, I was too happy too early. jQuery UI is great, no doubt. But when it comes to nesting one control in another, it fails miserably. Maybe it wasn’t built for it but it surely made my life difficult just when I was thinking things were going smooth.

So I used the tabs from the UI. Then wrote my own jQuery code to create an accordion control which would load feed data from a SharePoint list on expanding. Of course, I made use of the library’s CSS classes for the accordion – active, inactive states etc.

My final UI looks like this:

Feed Viewer

Of course, how can I forget my friendly jQuery Plug-ins: jFeed and Pager

Now over to the server.

On the Server I needed a Web Service which my Web Part would call:

1. Get a category hierarchy for my tabs and accordions to render. I chose to send an xml string with sub-categories nested under categories in the xml with important data such as CategoryId which I hid into hidden fields in the accordion.

2. Get an aggregated feed data on a per category basis once user expanded a certain sub-category panel. This would require me to send information such as CategoryId, PageNo and pageSize to the web service via an Ajax call.

My Web Service method signature was like this:

[WebMethod]
    public string getAggregateFeed(int categoryId, int pageNo, int pageSize)

 

and my AJAX call looks like this:

$.ajax({
            type: "POST",
            url: "~/_layouts/service.asmx/getAggregateFeed",
            data: '{ "categoryId" : "' + 1 + '", "pageNo" : "' + 1 + '", "pageSize" : "' + 2 + '"}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(result) {
                renderFeed(result.d, divId, pageNo, pageSize);
            },
            error: AjaxFailed
        });

information  TIP: To ensure that my web part is configurable, I need to allow the user/admin to configure the parameters such as List Names, Service URLs etc. Now since all my functionality is on the client, I needed to make sure that any Web Browsable Property I create gets added as a hidden input control to the Web Part controls so that my jQuery can pick it up. Remember to add a unique class name to the hidden control and not to use the ID to identify the control in jQuery, since ASP.NET adds its own additional meta characters to uniquely ID server controls but maintains class names as they are.

Next was a simple task to reference the Argotic Library in my web service and do the needful. The Argotic library is available in both .NET 2.0 assemblies as well as .NET 3.5 assemblies. It provides abstraction to fetch feeds, aggregate them and create new feeds and save them to XmlReader streams. Pretty neat stuff.

Now since I was using a jQuery plug-in that accepted either ATOM or RSS feed data and converted them to html, I only needed to aggregate multiple feeds into one Feed object on the server and then save the contents into a stream to return to my client. The plug-in would then parse the xml for available fields and generate appropriate HTML. I needed only the title and link to the item so I modified the feed a little to render only items I need.

And the majority of my functionality is done. Now remained to enhance it to make the Paging work, add a refresh button which would refresh the feed data and set an auto timer for it to refresh it automatically every 5 minutes and the likes.

I added all my JS code to a User Control. Created a WSP Builder Project and created a Web Part that would load this control and also add appropriate Web Properties. Added features to package my dependent SharePoint Lists and their instances and also a feature to deploy my custom web service to SharePoint and add my dlls to the GAC.

Read about deploying lists and list instance using features and solutions on André Vala’s blog. This is the blog series I have referred the most till date. Thanks André!

Read about hosting a Custom Web Service in SharePoint: newbie tutorial | msdn walkthrough

It was a thoroughly enlightening experience building this web part. Adios for now!



1:59 PM GMT  |  Read comments(0)

June 18

No Entry Load on Mutual Funds from 18th June, 2009

SEBI has scrapped the Entry Load that is levied on investors investing in Mutual Funds. Now if an investor invests Rs.100 to purchase the units of XYZ Mutual Fund, all of that amount will go to purchasing units of the fund and no deduction will be made towards Entry Load.

Last year SEBI had passed a regulation to the effect that frees investors from the entry load on Mutual Funds if they invested directly without the help of a broker/intermediary. However, since most mutual fund schemes are confusing and the application forms are difficult to fill and submit directly to the mutual fund house, the majority of investors hardly found this move bringing them any joy. They would usually end up going through a broker and getting slapped with an entry load ranging from 2.25% to 3% of their investment, most of which is usually paid out the the broker/distributor in the form of commission. This means a loss of Rs.30 on every Rs.1000 you invest, right at the time of purchase.

From 18th June, 2009, SEBI has removed the concept of Entry Load on mutual funds, irrespective of whether you invest directly to the mutual fund house or go through a broker. This move may bring some cheer to investors but there is always a clause one has to watch out for in such rulings. And here is the catch. You have to pay a commission to the broker if you choose to invest through him. SEBI has issued in its statement that the investor will choose the amount of commission payable to the distributor. How this is supposed to work and what are the benchmarks for such a commission are unclear as yet but most brokers may choose to not accept any commission at all to keep up with competition and act as advisors to investors. All in all, a good move with respect to the investor in these troubled times. The markets are down in the dumps and are predicted to remain so for at least another year with marginal improvement. Hence investing in an Equity Mutual Fund through SIP is the best bet at present. Note that Mutual Funds only provide best returns in long term (over 3 yrs).

More: 1 2 3



10:07 PM GMT  |  Read comments(0)

April 04

Setting up PKS - Podcasting Kit for SharePoint Pt.1

When I first heard of , I wondered whether this is really gonna be of so much use, especially in the world of SharePoint. I mean, who would want to setup a site like YouTube on a SharePoint server?

Even today people would raise such questions but I am actually amazed at the number of client requests that I am coming across who want a site in their SharePoint intranet/blog/public website where they can simply upload a video and others can watch it plus have some additional social networking features such as rating and commenting a video, viewing the video publishers bio, tagging videos and searching based on keywords, show a thumbnail of every video uploaded etc. Imagine if you had to built such a site on SharePoint yourself? And for those who are still unaware, is the solution for the above requirement and it provides even more features and configuration options.

Having made a couple of installations of recently, I do admit that its not really just double clicking an .msi and you are ready. But the effort spent configuring it is well worth it if you have the requirement. I would say you need about 2 person days to set it up from scratch by following the quick installation guide that comes with the package, leaving configuration of search which would need another day and of course customizing the UI based on your needs would take its own time. PKS comes with its own masterpage and most likely you would want to change that so the portal look and feel is consistent with the rest of your site. And the amount of customization you need decides time needed for your UI trimming but my guess is it should not take more than a couple of days. So you can have a Podcast Publishing Site up and running in about one work week. The effort saving and the value it adds to your website is just amazing. Have you tried video marketing with the products you make? I suggest this is a good time for that since print ads and ads on the telly probably don't reach out to the customer bracket you want to approach and also what better way to sell your product by showcasing it on your own website without additional cost - directly to the person who has come there in search of it. When you do decide for that, go for .

So what does have - Insider tips:

  • installs a few pages, lists and some web parts on your SharePoint site when you run the setup.
  • stores the videos you upload to a network file share and not the SharePoint database so it wont overload your content DB.
  • offers features for Video Rating, Commenting, Viewing the Podcaster's information, Reporting features on videos uploaded/viewed/downloaded etc, Automated thumbnail generation on video upload, integrated video conversion to compatible format, mobile/zune/iPod/RSS support, tag clouds, search videos using tags, progressive playback of videos using etc.
  • Documentation for is exhaustive, clear and precise which makes the setup experience extremely smooth and also empowers you to extend it. There are video tutorials too! In fact its so good, I really wonder why any one would actually read this blog post.
  • It needs MOSS 2007. Won't work on WSS 3.0.
  • is needed for to work. Thumbnail generation, duration detection and encoding to Silverlight are all done using that integrated into the PKS site.
  • There is still a bug in the thumbnail generation process for videos which are initially not in compatible format but are converted using Expression Encoder. The thumbnail wont get generated in this case as the application that queues videos for encoding tries to generate a thumbnail first and encode later. Hope this gets rectified soon.

Tomorrow I will cover the basic steps in configuring a simple PKS site. But the real resource is on the site itself.



12:13 PM GMT  |  Read comments(2)

March 22

BE Computer Science / Information Science Fresher Interview/Written Test Tips and Topics

I was asked by a friend of mine to help his cousin who is doing his BE in Computer Science for placements and I jotted down a lengthy email regarding what topics he should be concentrating on. Then when I read that email myself, I thought - "Hey this can go beyond a mail and help more people too. So here it is:


Short intro to my interview experience to give you a context on my ability: I have taken Siemens, TCS, Sapient and CTS interviews as a fresher. Among these, Siemens and TCS were in my 5th Sem (on campus) and Sapient and CTS were post 8th Sem (off campus). I did not clear the written round in Siemens. I got offers from TCS (did not join due to low pay, relocation to Kolkata and 2 year bond), CTS (rejected offer since I had Sapient already whose pay was better) and Sapient(opted for the offer due to their friendly HR and now very happy with that decision).

My Profile

College: RNSIT, Channasandra, Bangalore

University: Visweswaraya Technological University

Branch: Information Science and Engineering

Batch - 2002 - 2006


So now to our business:

For freshers in their 3rd year and those just out of college, the following are the most important topics quizzed on:

General Topic: Aptitude:

This is a common section in most written tests and constitutes atleast half of the weightage of your test score. Good books to practice from would be RS Aggarwal and also Shakuntala Devi's Puzzles (my fav.). Instead of trying to practice solving more and more problems, try to solve a couple of generic ones in each topic in R  S Aggarwal and understand the methodology and the thought process of solving such problems. If possible, also devise your own algorithm/logic to solve the problem. The questions will never be directly from the book so practicing every problem in the book still would not guarantee your clearing the test. 

In the test, dont concentrate on solving max. number of problems. Concentrate more on getting all the questions you attempt correct. That will fetch you more marks than attempting 90% of the questions and getting most of them wrong due to silly mistakes made in a hurry to complete the paper. For example, in my college, in the Siemens paper-> There were 50 questions in the Aptitude section to be answered in 60 minutes (3 marks for each right answer, -1 for each wrong). Imagining to answer all 50 (right or wrong) is just a farce. Instead one should attempt to get all the questions he attempts right. The highest score in that test (in aptitude) was 16. Which is effectively just 6 answers right and two wrong of the attempted 8 questions (of a total of 50 questions!!). Simple to beat if I look back today. Think about it, all you would need is to get 10 out of those 50 questions right to top the college, and you have 60 minutes to do it (6 minutes per question!). Easy right!

Tech/Software Sections:

  • SQL - Writing simple SQL statements to select data from a table given a condition.

-> Theory based questions too are common - like the Types of Joins - Outer Join, Left and Right Outer Joins, Inner Joins etc, Normalisation - 5 levels of normalisation - What are they and how are they important for good database design. Good book to refer for this would be the prescribed syllabus book. 

  • C++ - Most important. Would be asked to explain object orientation concepts such as Polymorphism, Inheritance, encapsulation etc and how it can all be achieved in C++. Syntax for virtual functions are also common questions. Would be asked to write small programs such as generate fibonacci series, replace a character in a string without using any inbuilt string functions etc. An interview tip would be to explain concepts with as many real world examples as possible. For example, instead of explaining inheritance in text book fashion as to say one class inherits functionality from its parent class, you could explain to the interviewer with a real world example say a Car class as the base class having turn, stop and start as primary implementations and then classes that inherit from it could be Ford,Hyundai etc. which inherit the base functions plus add their own and override on existing functions as well (if necessary, to say Hyundai i20 has ABS brakes so it has its own custom Stop function) to make custom implementations. Now that would convince the interviewer that you have understood the concept rather than just mugging up the text book.

  • Data Structures: Important to understand all types of queues, linked list etc. Most common questions are -> Reverse a linked list, Traverse a linked list, sort a linked list etc. Merits and Demerits of each type of data structure -> Arrays, Stacks, Queues, Linked Lists.

  • Algorithms: Sorting algorithms are most common written round questions. Either direct or indirect. Binary search, quick sort, string search etc. Common problems such as Travelling Sales Person, Towers of Hanoi etc are also common. Techniques to determine the complexity of an algorithm may be asked too - like determining Oh, Omega and Theta of a particular algorithm.

  • Computer Networks: Would be a crucial subject if applying for companies such as CISCO, HP etc. Hot Topics: OSI Layer, TCP/IP model, Routing algorithms *** (very important) and types of network discovery.

  • Operating Systems: Crucial subject for companies that build low level system programs such as Symbian, Intel etc. Hot topics: Processor Scheduling, Memory Management and Page File Swapping techniques. Deadlocks - what, detection, avoidance and resolution, semaphores and other locking principles.

  • Java: Since most universities cover Java in the end of 3rd year and placements usually happen before that, on campus interview dont focus much on Java. However, for off campus and post 8th Sem interviews, Java is a must (unless you are a MS guy like me and would rather stick to C# in which case proficiency in C# and .NET are required) There wouldn't be very detailed questions on Java or C# for freshers and basic knowledge should be sufficient. If you do your 8th Sem project in Java or C#, it would be more than sufficient for you. So wisely choose your 8th Sem project. It could make up your career. And please please please implement your own project in your own code. Don't download the code and showcase it. Your project is your portfolio in all the interviews you will face and your academic project will be the only project where you will implement end to end (all tiers) so this is a very important part of your career - to implement your own idea into a project and deliver it.

Apart from this, there may be certain niche areas that specialized companies may ask for but being strong in the above topics should get you through 98% of all interviews as a fresher.

Do post any questions you may have as a comment and I will get back to you.

Cheers

Sreenath

http://sreenath.net



1:25 PM GMT  |  Read comments(8)