Live for Today!

People like you live only for tomorrow. People like you get f****d up by the people living for today. I live for today.

Movie – Man from Nowhere

Quote | Posted on by | Leave a comment

So (too) many languages (in India)

The other day I was going to the post office, or more accurately, trying to find the post office to collect my passport. I checked the Google maps and got the (waking) directions, it was around 1.7 km from my place and decided to walk.

I was suppose to take a right turn near the “New English School” and the post office should have been around the corner. So, I started walking and when I reached near the school I started looking for signs (of the school, in English). I crossed one school which didn’t seem like much and the arch sign was (fully and only) written in Marathi (or Hindi) and I assumed that since I was looking the “New English School” they would written the name in English. I crossed the school and continued walking straight thinking it was ahead. For some reason I decided to stop and ask someone (again) where the school was and to my surprise it the same school that I had just crossed.

Not only did I realized that assuming was wrong, but also learning the (local) language would have been so much more help. It also got me thinking about the many languages in this country. All languages are great and unique in their own way, but at some point it all becomes too much.

I also noticed that in many states (most metropolitans) they emphasize local language to the point where it practically becomes difficult for non-native (shit, that almost sounds like we are foreigners in our own country) people in their daily activities. Things like: bus numbers, government papers/forms, etc.. are in local language. Some times even enforced. Too much, if you ask me.

Are you suppose to worry about settling into the new place and start doing our jobs or spend time getting localized.

Posted in Personal | Leave a comment

Get User Identity in your log4net

rd1089:

Since I had my log4net.Config.XmlConfigurator in AssemblyInfo.cs, I included the custom param (user) variable in Application_Start in Global.asax.cs. Kept everything else the same. Worked like a charm.

Originally posted on Wilsonhut:

You want your website’s log4net logs to have the authenticated user’s name. Here’s all you do.

(credit to Gian Marco Gherardi)

Add this in your code (right after you call XmlConfigurator.Configure(…) would be fine.)

	GlobalContext.Properties["user"] = new HttpContextUserNameProvider();

Then…

	public class HttpContextUserNameProvider
	{
		public override string ToString()
		{
			HttpContext context = HttpContext.Current;
			if (context != null && context.User != null && context.User.Identity.IsAuthenticated)
			{
				return context.User.Identity.Name;
			}
			return "";
		}
	}

The, in your log4net config, you can use it with “%property{user}”
like so…

<conversionPattern value="%date %-5level %property{Category} [%property{user}] - %message%newline" />

Like a charm.

View original

Posted in Uncategorized | Leave a comment

My First Post

I would like to start by saying that this has been an idea (to start blog) long due. Writing is hard, I mean how many times have I thought about writing but never really got to doing it, and it’s tough!

But, here I am, finally writing my first post for my blog! Never really thought this would be done on a Sunday, I mean, since when are people getting anything productive done on a Sunday? Just kidding! Thanks to the people who have been pushing me to get this started for a more than a year or so (just so you know I do get around to doing things, in my own time which sometimes may be based on IST standard).

This blog would mainly be a collection of my thoughts on various subject matters that interest ME! I also would like to think of this as a dairy where I can record events, realizations (would be interesting because I don’t have many ;)), technical stuff (stuff for punk nerds, yeah that’s me category), etc…

This brings to me to introducing myself. How many times did you get the oportunity to say all the good things about yourself? Not many!

I started programming when I was 19 in C on Linux (credit to my father for insisting Linux).  I have explored a vast range of technologies, languages (both programming and the traditional meaning of the word), operating systems and gadgets! I love Linux and open source software and the freedom to share knowledge and keep it open for all. I believe in sharing what I’ve learned, simple. The best things in life are always free.

I got into web based application development a few years back and still continuing in the web arena. Started web based development in PHP and continued for a couple years before I switched to C#. Right now you are probably thinking how a guy who loves open source is working on an M$ technology, well it’s simple, I do it for the MON$Y. It’s not what I love but something that sustain me to keep doing what I love.

I spend a lot of time with JS frameworks, HTML & CSS building usable user interfaces. I love programming and understand that it’s a process like everything else in this world and SAM’s “Teach yourself programming in 7 days” will get you nowhere.

That’s enough for now and would like to conclude my first post here. Thank you for reading, if you have gotten this far :)

If you like what you see and feel like leaving comment(s), well, come and join the party. Would love to hear from you (be nice now :))!

Happy Blogging people!

Posted in Personal | Tagged | 2 Comments

Hello world!

For some weired reason (still unknown to me) ever since I got into programming this is how I start doing/learning something new. And like the many programmers, the first program I wrote did print “Hello world!”.

So I am going to go ahead and keep this post here.

Posted in Uncategorized | 1 Comment