Saturday, June 25, 2016

The Hackathon Circlejerk

Just like any other competitive activity that exists for students, like sports, or Model UN, hackathons too have their own little culture going. I know this by having attended plenty of these to predict that in the next hackathon I go to, I'm almost sure I'll run into someone I've met at a hackathon before.
However, I'm not convinced that's a good thing. For the sake of all students out there who still have the inspiration to get something meaningful done in their life, I sure as hell hope this doesn't become the next big trend among them unless the way hackathons work start to change, and I'm more than happy to explain why. Let this be a comprehensive guide to hackathons and what's currently wrong with them.
(I hope to cover every vendetta, personal or in general, that I hold against hackathons, so bear with me if this article is a little long)

You could argue that working on your own cool little project for 24 hours among other creative people with free food and drinks sounds petty awesome. And honestly, that would be true if hackathons were fair and perfect.
Unfortunately however, most of them are not; and all the people who frequent hackathons regularly know this as well.


That said though, some hackathons are not so terrible and are actually worth participating in. I'll start with the drawbacks of how hackathons work today, and move on to which ones you might consider going to.

Oh, the horrors


A "hackathon" in today's terms is a horrible combination of:
a) organizers who want to make money,
b) sponsors who want to shamelessly promote their brand which at times isn't even relevant to the event,
c) judges who want to steal ideas that have merit for their own company from unsuspecting college students (I'm obviously exaggerating, but it has happened before), and
d) participants who want to bring their month or year old finished product and compete so they can get an easy win.

So why is the system this bad? This kind of characteristic "circlejerk-esque" behavior is usually the result of an avalanche of moral decay caused by one bad persisting feature after another, such as :

  • Restrictions on creativity :
    • Not a single hackathon that I've been to has encouraged the idea of simply hacking together a neat project. Kind of ruins the central philosophy behind a hackathon, doesn't it? The criteria for winning involves "what can sell" instead of "what is fun". I understand why this might be necessary but maybe the reason why hackathons have such a bad stigma is because they're so unnecessarily commercialized. This has been the biggest shock for me since my first hackathon and I'm still adjusting to it. To me, any good idea has merit regardless of whether or not it can make someone money. This can easily be solved by having an open mind while judging or having a more relatable panel of judges altogether. An example of a parody hackathon that was a great satire against this problem was The Stupid Hackathon.
    • A lot of hackathons have a "theme" that your project is supposed to comply with. That's fine with me, but the shitshow starts to surface when you have to use a certain platform/technology/stack by mandate. These are usually not announced prior to the hackathon commencing and even if you don't have to use it, they provide you some incentive to, which still sways a lot of the participants out of greed to win. This usually happens by intervention of the sponsors and can be solved by keeping the event agnostic to the sponsoring agent.
  • Unfair practices :
    • An overwhelming majority of hackathon winners are people who've begun well before the 24 hour time limit. A lot of people use hackathons as a break from their lives to come together and hack something new and innovative, and people like these who bring their already existing projects into the mix just ruin the spirit altogether. You can't confront them about it either as there are no specific rules in place about the shameless lengths you can go to for winning. Pre-screening projects before submission might be a small fix, but there needs to be a proper solution to this before hackathons turn into a cheap platform to just shout out your startup ideas into an indifferent crowd.
  • Bad commercialization :
    • You are judged by your presentation, not your project. As mentioned before, the judges are almost always swayed by profitable ideas instead of innovative solutions. This is because companies have stopped seeing hackathons as technical endeavors, so they send out people from marketing to judge. As a result, participants with strong presentations are seen as better candidates even if their technical stack aren't even in working condition. Sponsors need to start sending out actual developers and engineers who factor in things like code complexity and technical implementation in selecting the winners.
    • Sponsors don't hesitate to shamelessly advertise themselves right in your face. Sure, I don't mind a brief intro and mentions about technologies I might actually use, but that rarely ever happens. The hackathon might have begun 12 hours ago, but there will still be a guy on stage talking about some weird product or API that has absolutely nothing to do with the hackathon or any of its themes. In retrospect, this is a bit sad to see because no one gives him/her any attention despite them having paid to be a sponsor for the event. Involving only strictly relevant sponsors doesn't sound like an impossible thing to do.
    • Sucking up is more common than it should be. "Open hacks" aren't really open, all it means is "we'll let you code whatever you want, but we'll only favor those that are relevant to the sponsors". As ridiculous as it is for hackathons to expect you to "solve healthcare in 24 hours", it doesn't matter even if you manage to do so, because your neighboring team who wrote a bot with the sponsoring company's API is going to win. I get that there's always going to be some bias or the other from the judges, but maybe the sponsoring and judging entities should be kept isolated for this reason.
  • Bad hygiene :
    • As an 18 year old, going a day or two without sleep might be alright occasionally, but that can soon take a toll on you. Unfortunately, most hackathons encourage you to stay up and push through (even if they don't actually say it), and then act surprised when everyone seems too tired to present their ideas the next morning, and those that do, deliver unenthusiastic and mediocre presentations. This can be solved by increasing the duration of the event, and just having all the participants leave at night, or just halting the event altogether at midnight by turning the lights off and insisting that everyone gets some sleep. Few hackathons have successfully done this before.
    • Junk food is pretty much the go-to solution for hackathons these days. Organizers have started to tie in with indoor caterers or simply bulk order from freshmenu for example, but I'd really like to see this done throughout in other smaller hackathons too.


But they're not all that bad


If you absolutely insist on attending a hackathon or have already been sucked too deep into the culture to quit, there are ways to find out the few that provide a decent experience.

First off, avoid hackathons at colleges or other institutions. They are a perfect example of every horror I've listed above. If you replace professional organizers with a student body, you can't really expect anything different. Do not waste time in one of these unless it's a hackathon happening in your own college, and you don't mind killing a night with your friends.
Second, look for "branded" hackathons with a good reputation through the years. My city doesn't have many of these, but I'm aware that some of the hackathons in the US (some even from institutions) can be a fun experience as they've dealt with and refined the same problems over years and have pretty much turned hackathons into art at this point.
If you can't find anything like that, look for hackathons with only one sponsor overall. You can always tell these apart by the name of the event. You don't need to be a genius to know that the InMobi Hack Day is sponsored primarily just by InMobi. You still might have to deal with biased judges in this instance, but there at least won't be a conflict in themes and commercial interests. You can rest assured that they can afford to have more professional organizers who will help you out better when the need comes.
Lastly, if you do settle on a hackathon, call them up and inquire about the themes, the meals and the winning prizes. If they can't answer any of those questions or tell you that they will be answered at the event, you should consider calling it quits as any reason for doing so is almost always a bad one. This also helps to get a measure of how good or bad the organizers are going to be in general.

If you've finally settled for a hackathon that you're going to attend, whether a good or a bad one, here's a few a good things you can expect along the way :

  • Learning : No matter how simple your idea is, you're going to be surprised how awfully difficult it can be to set things up when you're coding live. You're going to run into bugs you didn't even know could exist, and when it's not a bug, it will be a logical flaw in your planning itself. Dealing with these things under pressure is really an experience and will make you a better developer by the end of it all.


  • Networking : Probably the biggest resource in a hackathon are the people around you. Go ahead and talk to the people and find out what they're hacking. You never know who among them could end up being a future teammate or help you get an internship.
  • Actually build something : You and your friends will come up with a lot of crazy ideas over time and in your leisure, but how many of them are actually worked upon and completed? A hackathon is a really nice way to actually get people together and work on an idea that you've always had. It serves as a social event, and at the same time isn't quite, so you can use it as a convenient excuse to take a small break form your other commitments and responsibilities momentarily.
  •  Bragging rights : Of course, winning a hackathon is always such a sweet feeling. Depending on how popular the hackathon in question is, it could also serve as a neat little badge on your resume. If the winning prize turns out to be decent too, that would be the icing on the cake.


I'm not playing Devil's advocate here though. My overall opinion was and still is, that hackathons suck.
If you've never been to a hackathon, or even fully understand what a hackathon is, that's good because you can't miss something you've never had. Next time someone invites you out for a random hackathon that doesn't match the above criteria, you can take the opportunity to laugh and promptly walk away. You're not missing out on much, I promise. Even if you have this insane idea for an app or website that will floor any competition, the experience of a hackathon is hardly worth the measly prize at the end of it. I'd advise you to just gather a bunch of enthusiastic people and try your luck as a startup instead. Even if it doesn't take off, your productivity and experience with reality along the journey will thank you.


Sunday, March 20, 2016

Your guide to Antialiasing

If you play enough video games, you know that Antialiasing or AA is a software technique for diminishing jaggy-stairstep-like edges that should be smooth.
Even if you don't, here's a quick image comparison.


I recently discovered an old book of mine where I'd written down the different types of antialiasing and how they compare for my own reference. It was a handy little thing to have so I could know which type of antialiasing meant what (there are a lot of them out there, to be honest), and which ones I should use to get the best looks out of my game without taking a huge hit to performance.
I'm going to take this guide out mostly from what I'd written in that book, so depending on when you're reading this post, there is a chance that some new features might not be covered here. You can find the sources of most of the information here by following the links in the titles.

SSAA or FSAA


SS stands for 'supersampling', FS for 'full scene'.
The entire scene is rendered at a larger resolution, and the edge points from that render are used in the actual scene.

Type : Rendering
Performance Hit : Significant, since it involves upscale rendering.
Quality : Genuinely Antialiased

MSAA


MS stands for 'multisample'.
It is a special case of supersampling where only portions of the scene where aliasing might be noticeable are rendered at a higher resolution, like lines or edges.

Type : Rendering
Performance Hit : Tends to be much lower than SSAA, since upscale rendering is only performed to parts of the scene.
Quality : Looks the same as SSAA except in cases where certain edge polygons might go undetected.

CSAA or EQAA


CS stands for 'coverage sample', EQ stands for 'enhanced quality'.
CSAA is by Nvidia, EQAA is by AMD.
Designed to succeed MSAA, it adds more and better coverage sampling in order to produce quality like MSAA would at higher modes, but at only a small performance cost. 

Type : Rendering
Performance Hit : Slightly higher than MSAA at the same sample multiplier.
Quality : Increase in quality as compared to MSAA can range from some to none at all.

FXAA or MLAA


FX stands for 'fast approximation'. ML for 'morphological'.
FXAA is by Nvidia (but also used on other environments due to its popularity), MLAA is by AMD.
There is no rendering involved here. Edges are detected and directly smoothed or blurred.

Type : Post-Processing
Performance Hit : Least. Cheapest form of AA. (Certain benchmarks indicate FXAA to be faster than MLAA)
Quality : Successfully removes jaggies, but normal textures may also have a blurred quality to them.

SMAA


SM stands for 'subpixel morphological'.
It is an upgrade to MLAA where jaggies are removed with better detection without blurring too much.
In my opinion, this is best form of antialiasing due to its perfect balance of good quality for a low performance overhead.

Type : Post-Processing
Performance Hit : Slightly higher than FXAA. Most efficient in terms of performance to quality ratio.
Quality : Better than FXAA or MLAA. Morphs colors and textures appropriately.

TXAA


TX stands for 'temporal'.
It is a mix of filtering and sampling techniques in order to get the best quality at the expense of performance. It's also designed to remove crawling and flickering from moving scenes.

Type : Post-Processing and Rendering
Performance Hit : Most. Much higher than post-processing methods and might even be higher than MSAA.
Quality : Depends on implementation. Might look like a combination of MSAA and FXAA.

I have, to the best of my ability tried to maintain accuracy in this guide, but despite that if you feel something is out of place or needs to be changed, do not hesitate to let me know.
If this guide helped you, you are welcome, though I have a feeling that it is not going to be long before modern games do away with AA tweaking entirely and make it a standard feature of the game engines that they're built on.
Note : Some types of AA were not covered here because they were either too niche, or there was inadequate information available about them, such as TrAA or CFAA. That was intentional to keep things relevant and informative.

Monday, November 23, 2015

Java vs JavaScript

Yesterday wouldn't be the first time an aspiring programmer walked up to someone experienced and asked, "So what does JavaScript have to do with Java?"


The short answer is that it doesn't. They are not related at all, except by name.
However, they are both very popular and useful languages to their own merit, so we'll take an abstract look at them both.

Quick differences :

JavaJavaScript
  • Statically typed (variable datatype needs to be specified beforehand)
  • Dynamically typed (variable type is resolved directly during runtime)
  • Class based (functionality is stored in a way such that it belongs specifically to the instance from which it is accessed)
  • Prototype based (functionality is simply reduced to a property template that executes whenever required)
  • All non block statements should end with a semicolon.
  • Semicolon is optional in most circumstances.
  • Java has an implicit  this  scope, and an implicit class scope.
  • JavaScript has an implicit global scope, and during special events, an accompanying  this  scope.

If you're new to programming and the table above didn't make much sense to you, don't worry. The table just contains some technical details that'll help you to separate how one language works from another in your mind while actually writing code.
Since you're reading a blog post that's basically trying to pitch one language versus another, I'm going to assume that you might be more interested in the difference between these two languages in terms of application and use case.

Every environment has its own set of characteristic features that a programmer needs to keep in mind when developing in it, and I believe that the act of "putting yourself in the respective mindset" of that environment brings out efficient code in the end.
What I'm trying to say is that if you try to eat an orange like you would eat an apple, you might end up successful in your goal, but the overall experience will be messy and unsatisfactory. Hence, becoming thoroughly familiar with the frame of mind you need to be in for your environment first is important.

The Java mindset

A Java developer will have a concrete idea of the structure of every class in his project, like a map of properties and functions, so he knows how each instance will interact with each other. When you need to use a lot of object oriented logic, including inheriting from other classes, polymorphism, and modularization by separating functionality into their own classes, then you're going to be passing instances around a lot. That's how you know that you need a language like Java for your task.

Also useful to note is that Java has its own core set of libraries, and virtual machine platform where code is compiled.

Where to use Java :

  • For standalone apps - If you just want to create a command line or GUI application on the go, to run natively, Java is a good bet. In fact, you can't make Android apps without Java.
  • Browser Applets - Although Java applets are becoming rarer and old, sometimes they are used to extend the functionality of the limited power that web browsers have over your system.
  • Embedded devices - Java was originally written with portability in mind, such that it can easily be made to run in embedded projects due to its scalability.
  • Drivers - Java-like languages like C or C++ are often used to develop software to make hardware work, although you might want to use a language different from Java for this purpose.

The JavaScript mindset

A JavaScript developer will be aware of what's supposed to happen when. Picture a chain of events that fire off one after another. If you're developing in JavaScript, you should know the sequence of that chain and how to manipulate that sequence to get your desired result with only sufficient lines of code. You might have to juggle events by repeating, isolating, overloading, threading and doing just about anything to functionality. This will involve passing functions around a lot.
Yes, if I haven't mentioned it before, functions are treated as objects in JavaScript. You pass them around directly and play with them (along with callbacks, optionally) a lot, especially since this language has to deal with a lot of asynchronous activities. Think of anonymous/lambda functions, but on steroids.

Also useful to note is that as a scripting language, JavaScript has come a long way and has a lot of libraries to make things easier in most contexts. It is no longer limited to just a browser sandbox and is very capable for a language where code is interpreted.

Where to use JavaScript :
  • For anything web related - JavaScript is used primarily in browsers to make web pages dynamic and functional with client side scripting. There are a lot of libraries like JQuery and AngularJS that can use be used to boost its capabilities.
  • For backend or server side - With Node.js, JavaScript can also work on the server end. You can either cater to web pages with server side scripting, or just make a different desktop app altogether. Node Package Manager (npm) will help you get all sorts of libraries so you don't have to re-invent the wheel.
  • For light computation - There exist several JavaScript engines out there, so whether you're using V8, Rhino, or Spidermonkey, you can just run some code off of them in your browser console, or node terminal to quickly get some work done like basic or dynamic math.

By now you should know the difference between Java and JavaScript, not just in syntax and code, but also in usability and application. You should know which type of language to choose for your next project, and hopefully what you learnt in this post will make your project more successful.

Although it is true that a lot of points mentioned in favor of Java or JavaScript can also be applied to many other languages, they are not discussed here because this is just a general comparison post along the lines of "Java-like languages" and "JavaScript-like languages".

Monday, August 31, 2015

Indian engineering colleges are terrible at approaching technology

You might remember the good old Turbo C++ IDE from your common engineering classes. While the nostalgia inducing GUI can look like a smurf threw up pixels on your screen, there are actual reasons why you'll never see a qualified programmer use something that almost literally resembles a makeshift BSoD.

In fact, this isn't a problem that only I've decided to speak up about. Engineering students have long since taken to sites like StackOverflow to express their concerns about this as well :

Now, I don't deny that there might be some hidden superpowers that might make Turbo C an excellent IDE/Compiler, but taking what's common from the answers in the links above, there is a genuine reason to stay away from it: Turbo C is just way too old.

Here's the thing: The way technology works, something obsolete is almost as good as irrelevant.

When it comes to technology, it's in its nature to keep itself changing by constantly updating to newer and more efficient practices. No matter how popular a product in this field is right now, if it can't keep up with these changes, it will soon be forgotten.

There are very few exceptions to this, and I'm sure half of you are already shaking your heads :
But Arvind, for learning programming basics, Turbo C works just fine. Any C++ program that works in a newer compiler will also work on Turbo C, so what's the big deal?
Actually no, it won't. Remember when I said that technology keeps updating itself to follow newer standards? Well some of these standards are not backwards compatible. So if you tried to compile a newer C++ program across an old C compiler, it isn't necessarily going to work.

My issue with the way colleges here teach technology isn't just restricted to the fact they use software older than I am (which is a pretty big problem by itself), but I'm also unhappy with the entire mindset in which these things are taught.
Applying logic and critical thinking isn't generally encouraged. Programs are given to students, and they're expected to memorize the flow for the time being. The components and elements will be explained, but their logical use cases and why they need to be used there are left in the dark.

The entire idea of "finding a solution to the problem" is a foreign concept to students. There is no inspiration for creativity. Why would someone put in the effort to come up with a better or different solution when they know that no one's going to give a crap? It's no surprise that senior CSE or ISE students find their syllabus so hard. They're randomly expected to do new and advanced things after their entire thought process behind coding was built on programming habits they developed by memorizing programs that aren't even relevant to today's technology.
An education system like this helps only to churn out manpower to companies which require constant grunt work and pay very little. They'll have no problem letting you go when that work is done and you've displayed no creative prowess to help the company innovate.

No matter how big of a disadvantage you realize this can all be, there have been people who made it out of this system without lasting damage. Quoting a comment on one of the StackOverflow answers above,
"If you want to gain some real-world experience, take on the challenge of getting the University to update its compiler technology. You will be helping all of the students gain a more relevant education, improving the value of the university program, and learning tons about how to persuade people when you have no direct influence, a key part of any professional's life."
In my college, I intend to at least try to bring about some positive change by communicating with the authorities, and on the off chance that it fails, I could always start a club where we teach ourselves all that which today's graduates sorely need.

Thursday, May 21, 2015

Antiviruses and why they do more harm than good

It's been around four years since I've been using my current laptop and I have not had to deal with a single virus during that entire period (apart from the ones I made myself). To make that point hit you harder, I do not use an antivirus, and yes I run Windows.

I use the internet a lot, and while you might think I'm simply lucky, the truth is that there are loads of people who already do this. The idea is that there really are some foolproof methods you can apply to make viruses perpetually gone. We'll discuss those methods after I explain why antiviruses by themselves are not exactly safe.

Now you might be thinking : What's the big deal? So it's possible to avoid viruses, but I have an antivirus to keep myself on the safer side. It's not like it's doing me any harm.

Well, antiviruses can actually do a lot more harm than you think.

Antiviruses can often act bizarre and erratic. If you're trying to get some work done, this can be a bigger pain in the ass than having to deal with printers that were sent from hell.
The thing is, antiviruses try their best to keep your computer safe. Therefore by nature, it is suspicious of everything in your computer. The antivirus however doesn't know your computer as well as you do, which means that it will often target completely innocent files which can be crucial to keep your system running. As a result, the aftermath is often disastrous, or if you're lucky, just hilarious.
Which is why the really ironic part is this : The better the antivirus is, the harder it gets for the user to get his work done.

For example, this person's antivirus began to delete his system32 files.



Norton too is capable of funny fuckups.


If you've had an antivirus for long enough, you know exactly what I'm talking about. How many times did you download a harmless file for your school/work project only to have your antivirus flag it as malware and remove it from your system?
Not only does your antivirus take up memory and processing power that you could otherwise use for running your apps better, but sometimes antiviruses come with viruses bundled with them.
Pretty smart, huh? The people who make these viruses sure know what they're doing.

Fine, fine. So what do I have to do if I want to live without an antivirus?
I admit, when I first started out on the internet, I used an antivirus. Eventually, when I had to face all these problems, I realized I could do without them. I discovered the best way to avoid viruses is to use common sense.

I'm sorry if that's ambiguous (we will go a little into depth, don't worry), but rational thinking is all you need here to get you on your virus free path. Don't run files downloaded from untrustworthy sources, don't install shady plugins on your browser, don't visit sites that prompt you to install weird apps, etc.

You should pretty much already know these by now. You ignore ads that say you get a free iPad because you're the 10,000th visitor. You check reviews before downloading questionable software. You stay away from torrents that have surprisingly less seeders. All these are general ideas on how you simply have to use your intuition and be safe.

You can't get viruses from an image, or a song, so executables are the only offline resource that you need to be wary about when you download them. So if for some reason, you absolutely want to run such a file, and common sense isn't getting you far, then run the file through an online virus checker such as virustotal.com and if the site says the file is clean, then you're good. That's what I do when I download a crack or patch for a game, and I'm not sure it's safe.
You could even start a Virtual Machine and run the file in it for extreme cases. That will isolate the infection, if any, to only the Virtual Machine.

To be honest, that's all there is to it. Majority of the people I know who've complained about viruses simply missed out on the above in some instance or another. They might have visited a site with a slightly mistyped URL and downloaded something from there, or they installed a certain media player because a random online streaming site asked them to do so. Those were the most popular cases that I encountered.

Whether or not you use your antivirus beyond this point is upto you, but when people ask me what antivirus I recommend, I make sure they know that I don't, and I hope you will one day be a part of that crew, if you aren't already.

Sunday, February 8, 2015

I can't live without the Internet

Really, it's true. They say the first step in solving a problem is to acknowledge it. I've come to terms with it, but I admit, I have no intention of solving it whatsoever.

If you don't already know, I moved out of my old apartment the day before. 15 years in that infernal place, and you'd at least expect me to miss it. But maybe the reason I don't is because I live right next to it. Yeah, the new apartment I moved into is in the same complex. It's in a different "block" as they call it, so I need to walk across the garden whenever I go back and forth. It made carrying all my stuff from one apartment to another considerably easier, so I can't complain.

The internet connection in the new apartment hasn't been applied for yet, so I spent more than a day in the dark abyss that is Offline. Before that, while I was still in the process of moving in and moving out, I'd just sit in my old apartment whenever I wanted to use the internet for a while. Because I'm a lazy little shit, I didn't like walking all the way across just for this, and now that all my stuff had already been moved, I found little point in going there at all. A day passed before I realized that I really really needed the kick that only one thing could deliver.

My desperate little brain just then had an epiphany. Somewhere in the dark crevasses in my memory of all the technical crap I unearthed in my spare time, I remembered something,
The 802.11 specifications allowed a minimum coverage of approximately 100 metres in a straight unobstructed line through air. 
(I didn't expect my memory to actually hold, but according to this Wikipedia article, I was close enough)

I didn't know how far my old apartment's balcony was from my new one's, but I knew that 100 metres was a lot. There was only one way to find out. I went back, found the furthest balcony and kept the router right on the ledge facing the rest of the complex. I propped it up on a couple of books so that even by accident, the router would fall inside the balcony, instead of five stories down. I had some long wires, so I managed to connect the router to the ADSL modem well inside the room. After making sure everything was working fine, I crossed my fingers and went back to my new apartment.

As it turns out, I live less than a WiFi range away. Obligatory celebration dance followed. With my 12th grade board examinations starting this Monday, this is obviously very bad news for my marks.
The connection keeps dropping on my phone unless I'm standing close enough to the balcony, and it's even more unstable in my room, but like I said, as long as I have the Internet, I'll survive.

QQnLBVzgBDOUz78BwlBK3V1x6p3IBqE6IVemk03Dx3QKDUNuJNOQK/vc45eo4mlFYtGjrSGTt76r5GDlDqaSN+evrlrxmJRqLuRJvQi+YIw/oXoCxb+dY0EtY0XzWf8Ifn/+Y1IOXvFCpjSOMHIYs0dGRDhAqgv+IDM/8dANSazo9wGsoiPE8zv+6rpbxAGw0g8GaNKNgXihqp1U7N0Ffl9ktRQusqdxp7a5aBxxuyDojo60fSAUuO5B1sTu+9wwd+Bgi/PYwyRzXcPKtmNNqyVC9SCtl0DmVwZtal0o83obgIMg96wLU17bB2vuwQ1oMAczqa1xnnWoWTiS5AH//Moe9rjpyBYOgJcVPg9VYmuWZutp3CmasUKUikPR4mtDNygnDsdLJHlSS8/ApfpmLZKPyg8MbWkbV6ZuFR8KwS7+u2/yusksGpGaZW8aTVcGzUzsexbEZh0Nywux08g/+I8FW3Xmfhy1FIpwNMBSYU6yynjCXU2GP2b7zY26sVUdv1jWhYu5Rst2CrX1URDosbdM+7n8rvV61GPGZUodEoR7JBwKjuHww4yxtmMvsdT8Ou3hKkk1pdqJCBy46dLYecjMv0MwmBD1zxM53JuaUo393QM4v2TV9WkxFuoddsurBKBh+CEBwGioBWH3cBaYHjUGf8+LykyBLj56oKrmqf0=

Sunday, December 7, 2014

Encrypted paragraphs in this blog are now a thing

If you're going through my blog posts and happen to chance across a paragraph of what appears to be complete nonsensical gibberish, keep your cool. That was a paragraph encrypted with the Advanced Encryption Standard (or AES) with a secret key specific to that post.

In case you've come here directly from a post that has such an encrypted paragraph, then know that the only way you can view that content is by having the right key. Simply use an AES decrypter tool (if I haven't included one in the paragraph already), and then copy paste the text, input the key and run the tool. You may need to decode the text from base64 which I use in my encrypted paragraphs to prevent character encoding problems.
If you're looking for such a tool, you should know that there are several online websites for this. Just give Google a try sometimes, you lazy buffoon.
Keep in mind that if you don't have the right key (the secret bit of text used to encrypt the paragraph and will generate the right cleartext when used while decrypting), then there is little sense in trying this.
The key is specific to the post that contains the paragraph. This means that all paragraphs in one post can be decrypted using the same key, but if two paragraphs exist in different posts on this blog, they will require different keys for successful decryption.

This idea first hit me when a friend of mine did something similar in his own blog.
I realized that when I write posts that include my perspective in general, there's often something I need to include that's personal, offensive, immature or in any other way just unsuitable for my general audience to view.
This could include anything from a rant about how I secretly hate my girlfriend's sister, to a note that I want my future self to read.

So why don't you entirely just hide the paragraph instead, Arvind?
Because I want to let the readers know that whatever legible text they can read, isn't the entire story.
That there is more that needs to be said about what I've written, but at the same time isn't meant for everyone to see.
I want to let the readers know that however astronomical, they have the chance to use the right key and decrypt that paragraph so they can take a look.

Also, to keep things more organized, and for the sake of my own convenience, I've labelled every post that has an encrypted paragraph with the "hidden content" tag.

In fact, to get things rolling already, here's an encrypted paragraph where I write about how I feel about this approach to hide inappropriate content. Since this is a sample, the key to decrypt this is "ogodplswork". Do not expect me to give away the key for any future content that I really wish to hide.

DiOogyrmMwb5IcfyNQjWQ6pXBGKY0ujIKAN761vfZPuRWg/EIg5JkyHLKw/2ULjN5fRkChq3qx/c6+Kv6TonE48T+eHiU6SXm1l4+4raT8Vh5I5YEptBm3VulLvjghT7x1i+KCXOe3CWor5QsIcCgrH9Hp/1RxBOhC2zJhUDPgRxOz2xb5z13LyrAtEELqdjYRlC128eqscsEBWQV00eTAvnNVuoa+8c2Q+edP4C6cZFZArOyUuVglSNmD1pJ7j2f1MgRilgoUQUA7t7n4mkbVuZxl2ZVp/ksnYtr8agIc2f5BLRa1Xe3qj9cKaRkXDAo6QCCvoomrgAA15if9GlVrgemxeun3UNcOH/a7z4WmxaueP3Z8FygT50Zd3oSFlGaunkFwvtr5g5v21IypkUrMPoYjYcCXQEveTWKE+Bng5ayVFCs9ca+soWNS6IvpWiITv4H+KUGsiXSue0vGSlAn7yzu4hFqv0fsSMEIl/xRzuZECPgYST9LRv6kKB71asNc/eKJMaBOFkIozMzudeZEPGsOGRCvsPoDGseSjXhdc5GOgbYZec6DlUSapGR0fcrgY5zmaBIERaxmN5cRX2tNQFTUYssjs/BYrvmsUpu0Ay9tEMNsjFlTVg3uTMvlSgAbPOws8HHbJ2ebk7iU/L4fdOVc0FuFCbuQbfVa/K7fcFAEOaxrVSOJRr8AELDi9iPp4s18H8zFw/dC+aMn0PT6qbOP4IMjiySW416V1afRdddoj122yFwPN3injTkvSoY+L1FBMOvt1EHp3DhtL7diEvHWspvDeGDGhDkeaPgLqzHVTG8JLnZUUPBGq+TOaXaH4KugbVcleZFJadptWytiP5iXrzXn8h8iXDTMyGgZkYlsw1UDY+CQK5hhCPDAf7dAxfbUHShfFxGJktgACbMUEY/K1OtmhzrrT2CYhCSs2EqpDZQJmih5xtB+d4e+xflTIMsZREI1Bjo1FmJ5mZjy4Ro70qHJGHjfsRmB7vzB6yduBnSy5NcP5WOw9wBP7qgotPfc8z6RJI+FZDJ0tQ3iKU3FBzbTKjvoMXmCCXz0nTWtAm2k69GPwAsYATdC0KcT+prTHcycgcwy6S75q0z7nIs8pfwkYuqHcKZVShX/wSWTpBuimMC+u6fMGFckyj7o218poMJwVaOmiSUuoaGg==

Here's another encrypted paragraph. Keys are specific to the post they are in. So the same key should work here too. Try it.

dNx17tL2eSRl+6UyLrd0qsBbQX8iiOnNyxUgfKx5U4ZDWbwr0XnC20NHGGSGL4IQhfjwynAWkC4iI4mhWrWq9PhpQH0SVanQR1wyjFNEcgp2N2S8mFh0cwE+dADCl0Z4RinwOMogawWR8VpiMEuxph/UhSp9vn9ZdMC3n4ViUxNciroHBfh0sA6YWGJw8z/+SeCHjRZ/gstK8dbGoUw2yv04h0W7phdqTus8J3d4g3QVXjxD6Ph+zueiP/ueE4JPI9+Ff4BZv2UfLGmpTBHxpuifIask0jVFklAJ5CboJs33/cnjkkPXnrwcV0tchRvBcpx640V3hYYJer6OnmkwPjhgMhUu9z7w8J+9ujJHbN/U5AH39j8vMYmGZ9f35FSRp7dxK5qLPAXm8QmFKBGXiFaMA/xvGfAOfDlefjoFUmCDpTAu7so0H8BhkEaBiDGo/4laa8gXbn5UiEz/cFzPYP7HQQoTqZfwxdOZLa8eoOCmoqK33sY3uo9uGQ9QcX9NuFoEOq3iBckrKCosU372L9X4zEYbnrMI7mO7RmzJEKejSS8yEnhZYnWnFkp8ZZQpVlNOMfQvVOldbQHNmK2WbzqrPE//cKi+yKB5j0g25TAvncAvBGWIsOe83zMW+7i4n4u8o8qG5x55iSmd00wx9ErdbDlwIaV8Sks+ovMnTMmbRPFMOa5+6K+iNow+m8KbKDZhcXh1I3h+tcR5rnsIPh0f987PxWBSIyATCr4jZsvB+pvgFoNuznO5SZZ8c7/AF+/e40DmCEymg2Egle/UYgYTd7ZD3PaKr21zLd0yknzty08euC5cZWmy3BxHzr2mkMr0hBK4D/JudfqT/RFk5bnAKkh//f74C8EaMd0biSqhxoc6v/k5o/MF8jyrzrL7IotqUhAiOg6H42pZ0eK1RsAa6AIekX7sN42zHrNBEmu0Om3GaaoQbl13d1jzrKoU7NHa5t7+43M/pFGwuoIcw+wTZdCffOIVsNtTV6J7qaS+w+1csk6Vn70zaHfFVTk1AqgAmsv53bzu1kr9MhMaaYhnL9rLvesZl++IAZl6UozJF+5rOwUghCZMqqJYiN/2bLYrBzP56Afi9AFok/mL2LosgL4imfOwGT64DuEzLT2sGPh4yM7MOgEcYW0lya/Kwm61NXHUAG0Eb9pKRBuvSZLmtrr0Klkx+xOZdjARniPRb/TNU2MGQnQpYzgFJbhbTm1hXx1ul+yj/DPzF2qsyA6L0t9Zqm0Z+pjgvznYRblyY8iIsRu3xCHbr8zeE70v7RANsPH+Ijjk8ZKUnuIVt1SwceEGpb9RxYKnkw/gdpV5Fx4+sDz09+s/i/KrKRPGic+zei5S/I3Ngj6KDlZ8APuas6pPX1OIS5q4S7tELHM+hlr/L19uX4z2vSKRmAHsJn/kr2B3uV7Bazhz5vTvSamFW9gI2gQT/SxRkihYavdz+Vbi0eQIYREzKiRHEXmPlwGkISIi6/N7Y5DrVXVO3T4I8P/hKI28SXdrtI+i+jjMA5SG0evKnnw12zaUv6YpRaZcarg88CEGonZtDre2yUPNvCkQFacN3ggoSu1A+kj3GdQPoQlxL1muRU0mNw20pBKi05iQTMq67ZdGLpe8G5A5wKzcccy/TpYGUqoVpVxwrUrMo89W5a70JQUoy0HeNnk7OaVUQSc8B8pVGnjfMkqiypAfO6jLUojSQd3v+on+WZ3EhJNlmwEXmBZ3VkETw8ovejjDn7GkCSwozjlExtc+W/02YTzex5XVnBT3fOZeFULyXih/JQmKZ0ZSi7Dy3onlj0MyQlEGF/AHh81zSXiE0W7okjjrMpCqokibcvQWNET0muKEocDsWSfnK4N95swOFI8z3wJGMj/brsPfdhNqUxMlK5gZe4aEaCPb9c38o+e8jvOgiW2Jg/BO817mGD9YQT9ay0tcU94zxLEGnw==

Friday, November 28, 2014

Running a craftbukkit minecraft server for less than 512MB of RAM

Note: This post is not for those looking to run a server on a Raspberry Pi. There's a lot of guides for that, and you don't need any additional help

If you play minecraft, you probably know how memory demanding this game can be. This is the same with minecraft servers as well, and if you're running craftbukkit with a good amount of plugins involved, you might as well just have sold your RAM sticks to Satan himself.

The problem is, a lot of people like me might not have enough RAM on our systems, but we still want to run one of those fancy community minecraft servers anyway. So what do we do to solve the impossible?

Well in my case, the machine I wanted to run a bukkit server on was a Digital Ocean VPS that I rented primarily to host my website. Unfortunately, my droplet featured only a 512MB memory module and my LAMP package took up a good percentage of that. So that left me with something close to 350MB of memory for anything else.
Having had experience at running heavy bukkit servers on my home desktop before, I knew that if I ever wanted to run a minecraft server off this system, I'd have to come up with a good solution.

If you've done a bit of research prior to reading this post, you'll know that Spigot is an optimized version of craftbukkit for this very purpose. So the first thing I did was simply drop the spigot jar file on my VPS and run this command :

java -Xms192M -Xmx512M -XX:MaxPermSize=128M -jar spigot.jar

Everything loaded up fine, but whenever I connected to it via my Minecraft client, the Java process got killed by the OS. I tweaked around with the Xms and Xmx flags in the command but no matter what, the server process never survived after a player connecting. All I could see was "Killed" before the process exited and I was sent back to the command line.


After lots of searching on Google and posting on forums, I got the same answer everywhere:

I simply did not have enough RAM on my machine. 

Almost ready to give up, I found this post on my VPS company's support forum.
All Digital Ocean droplets came along with SSD drives for hard storage. In that context, the answer made a lot of sense. Even if the java process did use some of my SSD for memory, the fact that they were Solid State Disks, and not regular Hard Disks should reduce the lag issue that arises from this solution by a huge factor.
Turns out, my VPS did not have swap enabled by default, so I followed the guide provided for my version of Ubuntu to set it up.

Once done, I launched the minecraft server, and voila! It's been running ever since, even with a couple of bukkit plugins attached.
So in summary. if you have less memory to run a minecraft server, the most likely solution is to use a swap file/drive along with your system.

Hopefully, this guide has helped you learn some concepts at least if not for directly helping you out with your issue. If you have the time, feel free to drop by my minecraft server. Point your clients to "enkrypt.in" and you should be set.

Friday, November 21, 2014

The new enkrypt.in is here

After more than a year of rigorous development, the new interface is finally out in the open.
Well I'll be honest, the reason it took me so long for this project was because I have a surprising talent for automatically procrastinating. My daily work cycle includes spending the day with the editor in the background, buried by every distraction the internet has to offer; and then pushing code after midnight at a rate that is not recommended for the healthy. I've lost count of how many sleepless nights this website now owes me, but I am indeed glad that it's finally fucking over.


Procrastination wasn't the only thing that held me back though. I did run into a dilemma halfway through the development process. My web host got taken down a couple of months ago (The host was not owned by me), and that's when I realized that I needed a permanent hosting solution instead of migrating from one free host(er) to another.
So now came the issue of retrieving backups from the expired host, painfully shelling out money to buy some new server space, and then configuring it right to host my website (If I ever somehow finished it). Of course, I did finally finish it, but I also bought a sweet VPS for myself from Digital Ocean along the way.

If you haven't noticed yet, my proudest part of enkrypt.in is the way I've made everything dynamic. Page reloads and statically loading content is for wimps. I hand coded most of what you're seeing with the use of barely any plugins. The site design is completely of my creation but I now wish that I'd used some already existing plugins to help me out and save all that work. There's a lot of PHP, a lot more of Javascript and some HTML from me that's holding this place together.
There are still possibly tons of bugs throughout the site even though I think I've smoothed out most issues, so if you're the kind of guy who likes to toy around with fragile, poorly protected webpages for vulnerabilities, then by all means go ahead. But even if you're not, please let me know if you discover a bug, glitch or error that's not supposed to be there so that I can fix it at once.

I again haven't written a blog post in more than a year because I'd promised myself not to, until I'd finished my site since my blog's being integrated into it. So now that that's done, I'll hopefully stick to my new rule: of keeping my content short. (some of my previous posts were way longer than they needed to be), and posting more often.

Well there should be a good amount of content here on this site for you to go through, and hopefully some will interest you. If you like what I've made and think this is neat, there should be some Like, Share and Plus One buttons on this page that I would really thank you for using.

Wednesday, October 2, 2013

Top ten typos that you need to stop making

Spelling right isn't just for Grammar Nazis. It's for anyone who doesn't want to look like an annoying little prick.
Because you know what's more annoying than people correcting your spellings all the time?
That's right, your spellings themselves.

If you're not new to the English language, then I don't see why it's just so hard to spell words right. Some intentionally shorten words for convenience (not very convenient to the person reading it), and at other times, the typos are mere accidents; for which we have a backspace key. Use it.

I've seen enough typos to even compile my own top ten list.
Every time someone makes a typo that's on this list, my dictionary grabs a match and sets itself on fire.



Presenting to you : My own top ten list of words that you need to stop misspelling.

10. Lose and Loose

Lose: Opposite of win
There's no way that I'm gonna lose the grand prize.

Loose: Not tight.
Turns out that the prize was a pair of loose pants.

9. Weird and Wierd

Weird: the 'i' comes after the 'e'.
This word is an exception to the I before E except after C rule.

Wierd: Every time you spell it this way, a dolphin gets run over by a jet ski.

8. Then and Than

Then: used for time
First I got high, then I tried to solve the Rubik's cube while eating an apple.
('then' indicates that one action happened before another. It separates events based on when they occurred)   

Than: used for comparison.
I am much better at eating an apple than eating a Rubik's cube.
(than compares my ability to eat an apple to my ability to eat a Rubik's cube) 

7. A lot and Alot.

A lot: Remember to leave a space there.
Don't forget that there's a lot of space in outer space.

Alot: is not a word.
You don't write alittle, abunch, akangaroo or adouchebag.
So don't write alot.

6. Weather and Whether

Weather: Snow, rain, sunshine, typhoons. All that crap.

Whether: Used this way :
Your correct usage of this word will determine whether or not I kick you in the balls.

5. Advice and Advise

Advice: is used as a noun.
Take my advice. I don't use it anyway.

Advise: is used as a verb.
If Arvind advises you on spelling, you must suck really bad.

4. Definitely

There is no "A" in "definitely".

If you put an A in "definitely", then you're definitely an A-hole.

3. It's and Its

It's: Contraction for "it is" or "it has".

Its: Indicating possession.

It's not fine to tell your dictionary that its the most unused object in the house.

2. Your and You're

Your: indicates that something belongs to you.

You're: Contraction of "you are".

You're really pathetic if your spellings suck.

1. Their, They're and There

This one is every Grammar Nazi's worst nightmare. 3 words that are spelled differently, but sound just the same.

Their: Their cow keeps eating the leftover casserole.
They're: They're gonna get a shovel to the face unless they keep that cow under control.
There: Look over there! The cow turned into an alien.





You can always use Google if you're not sure how to spell a word.
Bad spellings can also make a lot of what you write look very unprofessional, so maintaining a good spelling habit is a good idea is general.
It's even fine otherwise - You know, if the keys on your keyboard are floating around and switching places, you need not worry. Dyslexia is treatable.
Cheers.

(There were no blog posts during September because I had exams + I had way too many distractions to do anything even close to productive)


Source(s) : Personal experience, The Oatmeal.

Friday, July 12, 2013

How to write good blog posts

Being a blogger can be hard sometimes.

Yes it can, and if you're a blogger yourself, chances are that you have to deal with some problem or the other about your blogging habit. Posting regularly, maintaining good content and keeping your audience interested can take a lot of hard work. Friends and enemies will click on your blog every now and then, but not everyone will keep reading till the end. That's where we need to work on.

In this post, I'll try to walk you through some pretty basic tips on making your blog posts captivating enough to last your readers through to the end of your post.

1. Give your post a good title

When people find your blog articles through facebook, twitter or any other social media, the only thing they will get to look at from outside is your post title.
This is why it is extremely important to come up with a good and interesting title for your blog's post. Even if you are blogging on a very boring topic, if you can come up with an eye catching title, you might get those extra viewers. On the other hand, even if your topic is fascinating enough, a lame title can ward of any potential readers as well.
Be creative. A good title ensures that people atleast check your post out. Making them read till the end is the next issue.


2. Use simple English and readable grammar.

Although I am not much of a Grammar Nazi (my friends however would disagree), I put great emphasis on this point. Your audience is going to consist of people from all walks of life. Make sure that they all find your language intelligible. Although I would generally advise unrestrained use of your vocabulary, complicated or hard words should be used only rarely.
Your grammar must be perfect (Unless the context demands otherwise). Even a simple typo or a slip in your grammar can make your post look very unprofessional.
Make your sentences as short as possible. It helps the reader grasp your points quickly without having to drag through a marathon of different perspectives. If you find that you have typed a long sentence, try to rephrase it again to the best of your ability.



3. Stay on topic

When a reader clicks on your post, he expects to read about the topic presented by the title. It is up to you to make your post live up to that expectation. Avoid straying away from the confines of your topic. See to it that everything you type has at least a clear direct or indirect connection to the topic.
If you find it absolutely necessary to convey something that is not strictly relevant, separate out the irrelevant content onto another webpage, and briefly mention about it as a hyperlink on your post.

For example : To see an irrelevant meme, click here.


4. Do your research

Make yourself familiar with the topic that you are going to write on. It helps not only by avoiding factual errors, but also in giving you additional material to write upon. Any fact or detail outlined in your post must be as accurate as possible. Moreover, facts should be presented in such a manner that they can be easily looked up and verified by the reader.
However, if your post is about your own thoughts, about an event that you witnessed, your personal views on a subject or recounting a memory, you do not need to research. Just be sure that you know what you are typing.


5. Throw in some colors and images

A person can read black text on white for only so long. This isn't your 3 hour college lecture. Make your post more bright by separating sections, using different colors, making titles/subtitles bold, etc.
Apart from formatting text, add in a few images as well. It really helps.

Never leave a cat alone with a toiler paper roll.

Remember, it is your job to keep your viewers entertained.


6. Invite public opinion

User interaction does not end with your blog post. Continue the discussion by asking your readers to comment on your post if they have any questions or want to add to your post. This makes your audience feel like they have the opportunity to be part of your blog. Allow them to contribute to your thoughts.
You must make sure however, that your blog application supports comments and has them enabled. They are integrated with most blog applications by default so you need not worry. Blogspot has a neat feature where it combines blog comments with your Google Plus post. If you want additional features like that, you may have to tweak through some settings.
There isn't much need to respond to every comment that your post receives. You will find that a lot of bloggers don't respond to comments at all. You should however answer any question that you think is important, or address any other issue from someone's comment to make things clear.


7. Index your posts and use a good range of words

On the long run, most of your views are going to come from search engines. These search engines like Google and Bing will search your post and show up on search results only if your post contains words or indexes that match the search string.
It is extremely beneficial to use a wide range of words in your posts to expand your chances of showing up on search results. Using synonyms and framing sentences in different ways can help you cast a larger net to attract viewers. To make your job easier, a lot of blog applications allow you to place labels, indexes, or tags on your post for that reason.
You never know when a person out there needs exactly what you've written.


8. Post regularly while exploring new content and different styles

Don't give up if your blog does not take off at first. It's all about practice and being creative. Even if you're not a very good writer, blogging regularly can increase the quality of your posts over time. It doesn't really matter how often you post, as long you are regular. Whether you post once a week or once a month is up to your personal preference.
Try different styles every time you post. That way, you can avoid your regular viewers from finding your posts monotonous. Experimenting with different styles of writing can also help you become a better writer. You can write from first person perspective in one post, then switch to a descriptive narration in the next, and maybe also try writing your posts in the form of a tutorial and so forth.
Post about various different subjects to keep your blogging habit going. Maintaining different content in your posts can teach you how to appropriately handle various contexts.
Don't forget to review your posts once in a while and edit those parts that you think you can make better.


9. Minimize the distracting atmosphere around your posts

Your blog's interface has several things in it. Apart from the post itself, you will usually have a blog header, a followers section, a view counter, a small section for sharing to social networks, your blog archive, a comments section, etc.
All these must be efficiently positioned so that your viewers do not get distracted.
Your blog's background image can be interesting, but not very flashy. Placing ads in your blog is fine if you require it, but try to not dominate your page with them. The smaller and lesser the ads, the better.
If you are familiar enough with HTML and CSS, you can even try to position your blog's elements manually by yourself. If not, you can always use your blog applications's interface editor (if available).

That is all that I have for now.

Although I've gathered these points from experience and different sources, I admit that I do not follow several of them. *feels guilty*

I am sure that there several more ways in which one can be a better blogger. So if you think that I have missed anything, feel free to leave a comment below. Questions and criticism are also appreciated.

Thanks again for reading my post!

"I've made mistakes. And thanks to those mistakes, I've learned" ~Enrique Iglesias.

Monday, March 25, 2013

Over A Thousand

This post was supposed to have been out over a month ago. But then I had my board exams again , so meh.

So yeah , my blog just reached a thousand views.
You can hopefully see the views on the counter to your right. ( Probably somewhere in 1200 by now )

Aaaaaand yup. It's a great deal for me.
It's a great deal that a stupid old blog that I put up less than a year ago with writing less than one blog post each month was viewed over a thousand different times.

And if you're reading this right now , then you've added to this number as well , and so I must say :



Thanks for making my blog an awesome place , no matter how shitty it still is.



A thousand views gives us a fair number of people to study this blog's general characteristics.
Let's take a look at some of these details.

First off , the number of views each month seems to be consistent. Never falling below thirty but never rising above two hundred. Although the blog is only ten months old , the largest number of views came during April  2012 with a count of 177. And lowest during May 2012 with just 32 views.

Then , if we shall look into each of my posts individually , it seems that Influence got the highest number of individual views - 73. Although it's hard to measure individual views because apparently a lot of viewers don't actually click at specific blog links but rather just view them directly from the homepage. This won't count as an individual view though.

Among the websites which referred to my blog , the one which attracted the maximum number of viewers is Facebook. I got over 200 views from there. Next is my own website (http://enkrypt.in) giving me another 150 views and also there's Google Plus , helping with a close 100 views. Google Search as well seems to have hit my blog up by contributing around 110 direct viewers. Twitter and other social networks seems do have done negligible work along with some other blogs and posts which referred to my blog.

Let's go to countries. The majority of my viewers were from from the United States of America. That's 458 views. Next is India - 390. More than 100 viewers were also Russian , with Ukraine, China and France giving me more than 50 each. Italy, Romania, Australia and Germany managed to contribute viewers in the double digit as well.

Google Chrome was used by 35% of my viewers. Internet Explorer by 30% and Firefox by 27%. Opera, Safari, Maxthon and browsers with weird names consisted less than 2% each of my viewers.

Windows was the Operating System of choice for 85% of my viewers. Macintosh and Linux was used by 5% each. Android, iPhone, iPad, Nokia and others being used less than 3% of the time each.



Yup that's it. I have a fairly interesting set of viewers here. It would include you of course , don't forget.
And most importantly , thank you for being awesome again.


Hopefully , you guys will take my blog a long way.
Cheers.

Thursday, January 31, 2013

Are you sure that's rape you're protesting against?

So what's the biggest buzz in India right now about?
All the protests , of course.
The protests which started after a physiotherapy intern was gang raped on a moving bus in India's very own capital just before New Years.

A physiotherapy intern?
Yes.
On a moving bus?
Yes as well.

But how?
What do you mean "but how"? More than 70 people are raped every day in India. You'd think that by now we'd have a fair range of rape locations. On streets , in public toilets , in stationary buses. And it would be no surprise if people were raped on moving buses before as well. In fact , the actual number of people raped in India on a daily basis would be above 700. The massive number of rapes in the underdeveloped parts of the country not only go unnoticed , but also unreported. We should feel incredibly lucky that this one actually made it to the news.

But how could this particular one have not gotten reported anyway? It's got everything media hungry dicks ever wanted. Crime , peculiarity , national shame and a moving bus.
But what would happen if the rapist was a single person? Or performed in a typical "rape" warehouse instead of a moving bus? Or didn't end up with a dead victim? What happens in this country if this rape was like every other 70 rapes happening this very day?




That's right. No one. 
Well..... some people do , but the number is too small to start national protests with.

Wait....you just mentioned that over 70 people get raped every day in your country. Isn't that over 20 thousand people a year?
Well exactly of course! And this is the point that I want to address my viewers with. 
Our government and society are both pretty messed up today. It has been decades since we've got used to reading that small section in the city column about someone or the other getting raped. Yet all the god damn protests are starting just now.
No , no. Don't get me wrong. It's absolutely great that people are protesting. This will finally give us the hope of improving laws and increasing security of individuals against such incidents. But...

Don't you think that the protests are just a bit too fucking late?

I believe that we Indians are neither so innocent and nor so ignorant. All of us are aware of the bazillion rapes taking place all the time but nothing has been done about it until now. Where were all the full fledged protests when other major incidents made it to the front page? Everyone just kept quite and criticized the nation and its laws. And that is precisely what makes me angry.
The protests are a great news , but I wanted to see those protests a long time ago. And for that very reason , these protests will have to bear mine and any other such people who share my views' criticism for being too damn late.

Well the protests are happening anyway. What does it matter if it's late or not? Shouldn't you be happy about the new changes that are going to come up?
Haha , well many people seem to think so. But in my opinion , they fail to see the much bigger picture.
You see , if the country had reacted appropriately before , then we could have had reforms against rape since a long time ago. And all these rapes taking place in the past few years could have been stopped , and possibly , the Delhi incident as well. It pains me that due to the country's lack of response earlier , we haven't been able to save around 10% of rape victims whom we could have otherwise saved.
Thus my criticism speaks , not only for my continued efforts against rape before the Delhi incident , but also on behalf of all those who could have been saved if only the country reacted a bit earlier.
I am indeed immensely happy that the new changes will finally be put into action , but it does matter that it is a bit late to say that there was no harm done.

What's so peculiar about this incident? What about the Delhi rape was so special that it caused all the uproar and protests that you would rather have had earlier?
Yes , this incident displayed certain peculiarity that finally made us think that we are in a sad country indeed.
First of all , how many rapes take place every year in a well developed city like Bangalore?
Quite less compared to the rural areas. The fact that a person was gang raped right in the very capital city of India startled quite a few. We can see this as one of the factors.
The next factor would be that she was not just raped... She was gang raped.
She was overpowered not by one man , but many. This shows us that we are past the stage where we can stay away from certain individuals with ill motives. We now have to stay wary of full groups of people who are in on such crimes.
Next we have the fact that she wasn't a gullible village girl who happened to walk into a trap.
She was an educated girl who came from an educated family. She was a physiological intern and held a certain social status that was reputable among her peers. The country was shocked when they witnessed such barbarianism even among the civilized classes.
Next factor would be the fact that she died later in the hospital. She was grievously injured during her rape attempt and after a few days she was declared dead. Even Google came up with a lamp on their homepage to mourn our loss. This final death of the rape victim stirred rage among a  lot of individuals.
The last factor is one that startled even the laziest of citizens in this country.
She was raped in a moving bus.
This is the immediate cause that started all the protests.
Everyone was startled at the limits that these people went to rape a person. What would happen next? People raped on public buses? People raped in schools? Colleges? The country could not possibly let this crime go unanswered. The moving bus factor initiated this all.

So , what if she was raped somewhere else instead?
Then this rape would most likely go unnoticed just like every other rape happening in the country.
I first heard of the incident while I was working in my school's computer lab. A student working in a computer nearby shouted out that it had come up on the news that a person was just raped on a moving bus. The ensuing whispers were not hard to interpret.
"On a moving bus? Seriously? Wtf?"
"Man , that's insane. What's wrong with our country?"
"Doing that on a moving bus sounds crazy."
No one seemed to care much about any other detail. Everyone seemed intrigued by the idea of something such happening on a moving bus. I am assuming that this same response was reflecting throughout the country.

What is your final conclusion on this whole matter?
I simply think that if the country was appalled only because the victim did not have the luxury of being raped while still , then we are running on poor moral standards.
The protesters cannot honestly say that it is rape that they are protesting against since this is not the first time such an incident has occurred. Unless they had been protesting before all such events occurred , I would aptly give them the title of hypocrites.

Are they sure that they are protesting against rape?
Or are they protesting against the incident in Delhi to be particular?

I have one last question. Who is asking all these questions in italics?
No one really. I simply thought of using a "questionnaire" style of blogging for this post to make it a bit more interesting. It is quite easy to make sure people click on your blog posts. But not as much as making sure that they read it through to the end.

So this is it. This is my entire take on the incident on Delhi. I am sure that many people would think that I am totally wrong in my opinions and would love to disagree. I would simply ask them to address their issue in the comments below. I welcome any form of criticism.

Wednesday, January 9, 2013

A Philosopher's Tale

This post is part of the "First Few Old Blog Posts" archive.
You could expect a certain lack of coherency/maturity from these posts.

Forgive me for being blatantly outright at the beginning but I must tell you that I believe I have endured more pain in my past than I would have thought possible. Pain that would leave scars which delude time ; memories that jump out of the blue to haunt what is left ; scrabbling to devour the last scraps of sanity left to feed the pain.
And what must one do then to go on?
Going on is a simple matter , don't mistake me. But what reply could you possibly have when you ask yourself "Why the fuck should you?"
Every action has a cause , every crime has a motive and at the end of the day , so does every life.

I wake up everyday not to the fresh morning air , but to the stark burden of reality. How many times I have found myself walking outside and realizing that it's really happening. I'm out there among everyone else. That this isn't some vivid dream or a thought turned into an image. Almost every step taken reminds me of a memory that I've long wanted to forget. But memories never do that , do they? At one point this crescendo of assaulting flashbacks traumatizes you so much that you push yourself to go sleep. Sleep ; where none of these evils can touch you. And then finally you realize that you've slept for almost the entire day. And every principle that you've built to utilize time productively has been thrown out of the window.

The key to my will propelling me forward is Philosophy. When you take away philosophy from me , is when I will find no difficulty in tying the noose again. But why philosophy? Because it is the only thing that adds a little meaning to a person's existence on earth. We buy coffee powder to make coffee. And that is the sole reason why coffee is powdered. If some power above is reserving us for a brew , I think we deserve the right to know whether it is tea or coffee.

What is the purpose of our existence?

I don't know. And that is why I cannot stop yet. I see my life as a race between this goal and death. The day someone cracks this final piece in the topology of understanding ourselves is when I will let myself guide my feet , instead of this desire. If I die before this happens then I will only find it sorry that my existence has come to an end without my knowledge consisting of why I ever existed in the first place. Why the universe bothered to instill life only to take it back without granting it this small gratification.

When you are such a philosopher , the meaning of every action changes. You don't see people walking in front of you anymore. What you see is countless unanswered questions instead. You question every event and every action until finally , you strip all meaning from the object itself and and you shrug , knowing that that cannot be correct , and so you start again , hoping to accommodate a better answer next time. And every theory thus formed gives you satisfaction as you inch one step further to reaching that last goal. The thought process of such a person is pitiful indeed. His sole motive being comprehension , he ends up questioning questions , theorizing on theories and searching to search. And even then , when he gets back up , you can clearly see the frustration on his face at having come nowhere close to the final piece.

He knows that he has been given life and whether he likes it or not , he must utilize this to the maximum by doing every act of good and standing by it. Take off your coat and give it someone in the cold. Is it so hard? Is it really so hard to oppose wrong and stand by it though it may compromise your position? He sees it as a duty , as a right when he was brought to life. But to what extent does his sense of judging what is right extend to? He knows this judgement is limited and so tries to expand it in every way possible by Philosophy. Do right , but first know what is right.

So what is Philosophy after all? What is this stupid thing that makes me live?
As Wikipedia says it , Philosophy is the study of general and fundamental problems, such as those connected with reality, existence, knowledge, values, reason, mind, and language. Problems approached by philosophy are done logically by applying reason , facts and evidence. Contrary to the stereotype that there can be infinite philosophies that can go against one and still appear rational , when two philosophies go against each other , one (or both) is usually wrong. Wordplay does not mask reason. By carefully approaching both philosophies , one (or both) can be ruled out. If not , then one (or both) is usually a fake philosophy

Fake philosophies are those which do not involve any form of logic , critical thinking , reason or some sort of relevant evidence in it's construction. I have the found the most reliable source of fake philosophies commonly as captions in Facebook profile pictures (those yolo swag fag types). You can't simply throw in some fancy words and expect your statement to be philosophically accurate. Again , a philosopher will always accept being proven wrong. He will be more interested in correcting his faulty statement rather than sadly brood over being wrong.

A problem that I face as a philosopher is that it is extremely hard to convert experiences into words. This problem is very common since most philosophies originate from certain experiences. We deliberately walk in the dark , trying to figure out why people are afraid of it. And then if we finally do strike upon some sort of meaning , we find it hard to convey this feeling of elation into words. Trying to see everything in a different light , that is our curse. You take a walk in the streets. Humans turn into storehouses of information. Buses turn into means for these piles of information to save energy and money. Money turn into  pieces of paper that has this strange power to get you what you need.

I envy those who do not need to understand more to move along in life. They say "who cares?" to every small question. It only fascinates me how they do so. I am not saying that such people are wrong , or ignorant or stupid. They are a different type of human. A type that will probably lead a more satisfied life. I call such people realists. They do not explore the intimidating limit of imagination. They don't like to guess as much as they like to prove. If only I had their mindset to console me , it would save me from this eternal frustration of trying to find answers all around.

It is indeed a trying state when you form theories about life every night before you sleep: hoping that life is an experiment in which some scientists threw you into a small virtual world with artificial robots all around pretending to be humans. Hoping that someday , a person will finally come up to you and say what enduring those days and nights finally meant.

I hope this post doesn't appear to be funny , strange or exaggerated because it wasn't written in such a mindset.

Quote : "Fuck you world , I'm alive"

EDIT : I was sorta depressed when I wrote this post. Do not judge me too harshly.
Also , thanks to Adithya for clearing out all the bazillion mistakes in my post. He's awesome.

Saturday, December 15, 2012

Tic Tac Toe - Unbeatable Algorithm

This post is part of the "First Few Old Blog Posts" archive.
You could expect a certain lack of coherency/maturity from these posts.

For my Computer Project at school , I had to make a simple Java Program. The rules although simple, were very restricting since my class hadn't learnt as much in programming, The program had to be console based (i.e. no Graphics), I could not use any Library Classes apart from the ones that came along with java.lang and Console Input classes. Also, my class hadn't learnt about inheritance and other OOP stuff so I had to stay clear from those too.

The trouble now was to make a good enough project that fit the criteria.
My classmates had settled on making games such as hangman, crossword, calculators etc, but I had already made most of them before while I was getting into programming, and they didn't have much appeal to me.

In the end , I concluded that the project would have to be small anyway, so I decided to make Tic Tac Toe Singleplayer. I'd already made Tic Tac Toe mutliplayer last year as part of a larger package , so I thought that it would be a nice addition to have this as well.

The 3x3 grid was constructed using a 2 dimensional array.
You had to play against the computer in 3 modes - Easy , Medium and Hard respectively.

Easy mode was simple. I used Math.random() to decide the X and Y co-ordinates of the resulting move.

Medium randomly chose between playing easy or hard for that move.

And hard used an algorithm that was impossible to beat. Of course , tic tac toe isn't such a full blown game , and any person smart enough could play any number of matches and always make a tie. But anyway, here is the code for all 3 modes.

Note: This is a function that simply calculates the position that the computer plays in, in a given circumstance. It takes an integer value (int c) that contains the difficulty value (1,2 or 3 for easy,medium or hard). It also takes a 2 dimensional character array of length 3 and 3 (char[][] u) which contains 'X' (player value) , 'O' (computer value) or '-' (empty value). The function returns an integer array of size 2 which contains the x and y co-ordinates of the computed value.

To see the whole program , click here.

     
    public static int[] compute(int c,char[][] u){
        int ar[]=new int[2];
        if (c==1){
            int x=(int)(Math.random()*3);
            int y=(int)(Math.random()*3);
            if (u[x][y]=='-'){
                ar[0]=x;
                ar[1]=y;
                return ar;
            }
            else{
                return compute(1,u);
            }
        }
        if (c==2){
            return compute(((int)(Math.random()*3)+1),u);
        }
        if (c==3){
            boolean mark=false;
            int x=0,y=0;
            int count=0;
            for (int i=0;i<3;i++){
                for (int j=0;j<3;j++){
                    if (u[i][j]=='-'){
                        count++;
                        u[i][j]='X';
                        if (check(u)==2){
                            mark=true;
                            x=i;
                            y=j;
                        }
                        u[i][j]='-';
                    }
                }
            }
            for (int i=0;i<3;i++){
                for (int j=0;j<3;j++){
                    if (u[i][j]=='-'){
                        u[i][j]='O';
                        if (check(u)==1){
                            mark=true;
                            x=i;
                            y=j;
                        }
                        u[i][j]='-';
                    }
                }
            }
            if ((!mark)&&(predict(u,0,0)>1||predict(u,0,2)>1||predict(u,1,1)>1||predict(u,2,0)>1||predict(u,2,2)>1)){
                for (int i=0;i<3;i++){
                    for (int j=0;j<3;j++){
                        if (u[i][j]=='-'&&((i==0&&j==1)||(i==1&&j==0)||(i==1&&j==2)||(i==2&&j==1))){
                            u[i][j]='O';
                            for (int k=0;k<3;k++){
                                for (int l=0;l<3;l++){
                                    if (u[k][l]=='-'){
                                        u[k][l]='O';
                                        if (check(u)==1){
                                            mark=true;
                                            x=k;
                                            y=l;
                                        }
                                        u[k][l]='-';
                                    }
                                }
                            }
                            u[i][j]='-';
                        }
                    }
                }
            }
            if (!mark){
                if (count==9){
                    int ran=(int)(Math.random()*5);
                    switch(ran){
                        case 0 : x=0;
                                 y=0;
                                 break;
                        case 1 : x=1;
                                 y=1;
                                 break;
                        case 2 : x=2;
                                 y=2;
                                 break;
                        case 3 : x=0;
                                 y=2;
                                 break;
                        case 4 : x=2;
                                 y=0;
                                 break;
                    }
                }
                else if (count==8){
                    if (u[1][1]=='-'){
                        x=1;
                        y=1;
                    }
                    else{
                        int ran=(int)(Math.random()*4);
                        switch(ran){
                            case 0 : x=0;
                                     y=0;
                                     break;
                            case 1 : x=2;
                                     y=0;
                                     break;
                            case 2 : x=2;
                                     y=2;
                                     break;
                            case 3 : x=0;
                                     y=2;
                                     break;
                        }
                    }
                }
                else{
                    if (u[0][0]=='-'&&u[2][2]=='O'){
                        x=0;
                        y=0;
                    }
                    else if (u[2][2]=='-'&&u[0][0]=='O'){
                        x=2;
                        y=2;
                    }
                    else if (u[0][2]=='-'&&u[2][0]=='O'){
                        x=0;
                        y=2;
                    }
                    else if (u[2][0]=='-'&&u[0][2]=='O'){
                        x=2;
                        y=0;
                    }
                    else{
                        if (u[0][0]=='-'){
                            x=0;
                            y=0;
                        }
                        else if (u[2][2]=='-'){
                            x=2;
                            y=2;
                        }
                        else if (u[0][2]=='-'){
                            x=0;
                            y=2;
                        }
                        else if (u[2][0]=='-'){
                            x=2;
                            y=0;
                        }
                        else{
                            for (int i=0;i<3;i++){
                                for (int j=0;j<3;j++){
                                    if (u[i][j]=='-'){
                                        x=i;
                                        y=j;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (u[x][y]=='-'){
                ar[0]=x;
                ar[1]=y;
                return ar;
            }
            else{
                return compute(3,u);
            }
        }
        return ar;
    }


Well, I admit that this algorithm isn't the most efficient one out there, but I had functionality in mind, instead of efficiency, so I rolled with a makeshift solution.
But what's more fun is to tell everyone that you couldn't beat my program the next day at the computer lab. They enthusiastically take up the challenge at once, and their faces were worth being looked at when most of them lost to the computer at the second game.

It was great fun.