WYSIWYG

http://kufli.blogspot.com
http://github.com/karthik20522

Monday, June 25, 2012

My useless engineering degree

As a software engineer/developer/programmer for past 6 yrs I have come to realize that both my bachelors of engineering in computer science and my masters of science in computer science were both a plain waste of a degree. As a engineering graduate in computer science I have realized that my education had no correlation to the work that I am performing at my job ,well, except for the OOP's class which by the way most programmers including myself don't follow as instructed.

In my bachelors of engineering, the courses involved object oriented programming, AI, electrical and electronic, theory of computation, basic civil and mechanical engineering and networks 101 like networking algorithms like shortest path etc. And in my masters were more around data structures, networks and object oriented programming etc. To best of my knowledge in my past 6 yrs I have never used any knowledge or concept that I have gained/read during my academics. So does having a engineering degree make any difference is my question!

Let's take all my 6yrs of experience as a programmer into lime light:

- my first job was at Albany international where I initially started working on a enterprise application written in Dotnetnuke and c#. this application was a employee directory fetching information from active directory. My major project at this company was a conversion of a vc++ application to a managed c++ application and implemented click once deployment and some authentication and authorization functionality to support this windows application. Quite complex for a beginner to say the least.

- my second job was a 3 month stint at URS where my boss had "stick with the book" attitude which annoyed me and thus making me to explore new opportunity.

- my 3rd Job was at Travelocity with all young blood in my team. My work was mainly around .net 2.0 framework and some simple web-services and database functionality (heavy CRUD operations). But as easy as it sounds, the job was quite tricky as the code had to be optimized for high throughout with limited hardware.

- in my 4th Job (Getty images, my current job) where I worked on image processing and image related programming which was quite complex; besides that I worked on windows services, web services, ui, web, JavaScript etc..

My point with above is that with all my above experience, I have never used anything that I learned during my undergrad or grad program! Thus my question arises, is my 80000$ (give or take) worth of education any good or was it just a justification to get a job and a ticket to United States? Would I have been the same and programming today if I had a history major considering the fact that my first personal webpage that I hosted was when I was in 10th grade 1998 (php), infra48x.tripod.com, if any of my old buddies remember that site! FYI, tripod no longer exists and my first site is lost!

Labels:

Wednesday, June 20, 2012

Take Home Interview Question (s)

Question 1:

Overview:
We are having web server uptime problems and we observe that the web servers running .NET website crash on a daily basis. More specifically, a web server "crash" results in users receiving a “server unavailable” result or very long page load times exceeding 30 seconds. We observe that during this "crash" period the overall CPU utilization hits 100%, and specifically the .NET worker process uses 100% CPU utilization for an extended period of time (several hours) without recovering. Under normal conditions, CPU utilization on the web server is less than 5%. We notice that the first step is an increase in the CPU utilization to 20-25%. Then finally we see a step to nearly 90-100% CPU utilization. It is at this point that the website starts to perform very slowly. Our website runs .NET pages and receives about 20,000 visitors per day and 80,000-90,000 page views per day. We would like your help in recommending how to prevent this type of system crash.

System Details:
Windows 2003
IIS 6
Dual processor 3.0 Ghz processors
4 GB Ram

Observations:
1)We observe that web server processor utilization increases in a “step manner” over time across all of our webservers. The site performs very slowly when processor utilization reaches 50% and more. Y Axis on this graph and all the others is the % processor utilization.

Data source: IIS performance monitor


2) We observe that memory utilization increases marginally over a 16 hour period. See graph below.


3.We have also graphed Webserver utilization vs. DB utilization to see if there is some relationship between DB processor and Webserver processor utilization. While there is not a direct relationship, it may still be true that deadlocking is causing problems in our webserver.

Labels: , ,

Thursday, June 14, 2012

Javascript - My programming guidelines

JavaScript in general becomes hard to maintain for large projects when the code gets fragmented. So as a general rule of thumb following guidelines are what I follow:

Javsacript files
  • All javascript files must be placed in /content/JS folder
  • All plugins must be placed in /content/JS/plugins folder
    • Plugins are files that are extensions to default UI or binding behavior.
    • Example: Autocomplete, Watermarking, Lazyloading, livequery etc.
  • When building a custom UI behavior that potentially could be used in other pages should be placed in /contents/JS/Shared folder.


Shared UI functionality
In situations where functionality has subtle differences, option based extension model is preferred to avoid duplication of code. For example:



Javascript Classes
  • This would help in avoiding function name collisions.
  • Each view probably should have its own javascript class using {view name} as the naming convention. This class must hold all local variables and functions associated to that view.

Two ways of defining classes in javascript:


Inline Scripting / UI Binding
  • No inline scripting must be used
  • No html based inline property scripting must be used either. For example: "input type=”test” value=”hello world” class=”cs1” id=”test1” onClick=”callSomeFunction();” "
  • Instead all binding must be declared in the class’s init() function. The init() function could/should be called in document.ready() method.

Labels: ,

Tuesday, June 12, 2012

SimpleDotImage - Image Processing framework in CSharp

==Update: Fixed memory & threading issue while processing 100's of images in batches==

SimpleDotImage is a CSharp based Image Processing library to perform simple image processing operation like Image Resizing, Image Watermarking etc. Check it out at Github [https://github.com/karthik20522/SimpleDotImage]

Example usage:

Resize:
Watermark using Image:

Watermark using Text:

Watermark positioning:

Watermark using Both Text and Image:

Rotate Image:

Flip Image:

Convert To Gray Scale:

For more howto's check out the test cases at my Github https://github.com/karthik20522/SimpleDotImage page.

Saturday, June 2, 2012

Code Snippets - June 2012 Edition

I keep coming across scenarios where I need to check if an Object is truly empty and not just NULL. Part of the solution was to do perform conditional checks (if-then-else) on every property but it turned out to be very manual, high maintenance and time consuming work. Following is a quick and dirty way to check if a class is truly empty:


One of the most annoying part of statically typed programming language is the problem of NULL exceptions. Again "if-the-else" was the initial solution and following is a dynamic way of handling NULL values of any type. The following code takes in any property of an object (the object can be NULL by itself) and if the property is NULL it would spit out the default value that was provided.

Labels: ,

Friday, June 1, 2012

Beers in my belly - VI


Baba yaga


En el bosque

Labels: