Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then
Filed under:
Bits and Bytes by
Hari
Posted on Wed, Oct 26, 2011 at 10:58 IST (last updated: Thu, Nov 3, 2011 @ 14:57 IST)
Haskell is quite an interesting and absorbing programming language. For those coming from an "imperative" programming background (mainly languages like C, C++, Java, Python etc.) Haskell can be quite a shock in the system.
However, learning the functional paradigm has always been on my wishlist for a long time and I eventually took the dive.
Here's a simple Haskell program I managed to write on my own after a few hours of reading tutorials and understanding concepts. This is a
Caesar cipher program which accepts a string as input from the user and shifts each character by one in the alphabet. (that is 'a' is replaced by 'b', 'b' by 'c' and so on. 'z' becomes 'a').
import Data.Char
caesarenc :: Char -> Char
caesarenc 'z' = 'a'
caesarenc 'Z' = 'A'
caesarenc ch = if isAlpha ch then succ ch else ch
main :: IO ()
main = do
putStrLn "Enter a string to encrypt (return to quit): "
st <- getLine
if st /= []
then do
putStrLn $ "The encrypted string is: " ++ map caesarenc st
main
else
return ()
I highly recommend this
tutorial. It's very readable and understandable for those from coming a procedural/OOP programming background.
And yes, the
#haskell
freenode IRC channel is also populated by kind folk who make you feel comfortable even if you are an absolute beginner.
Filed under:
Tutorials and HOWTOs by
Hari
Posted on Sun, Oct 23, 2011 at 18:45 IST (last updated: Mon, Oct 24, 2011 @ 16:03 IST)
So, I was bored and wanted to re-visit a programming language I haven't touched in years, C++. I am a bit rusty with my C++, but eventually I managed to implement a simple, command-line
Tic Tac Toe (or Noughts and Crosses for us Commonwealth folk).
I deliberately avoided cooking up yet another Minimax TicTacToe (and I must admit I'm not very strong in recursion techniques). I just implemented some common-sense rules and came up with this code:
Read more...
Filed under:
Life and Leisure by
Hari
Posted on Thu, Oct 20, 2011 at 14:46 IST (last updated: Thu, Oct 20, 2011 @ 14:46 IST)
Been playing around with
blender recently and I suddenly realized why 3D software is so hard to learn or master. While 3D related concepts are a little hard to grasp or master, what really serves as a stumbling block is the graphical interface of these programs. And it goes beyond mere UI concepts. Fundamentally, navigating around a virtual 3D space on a 2 dimensional monitor screen is what makes the process incredibly tedious. No matter how feature rich a 3D software might be, it suffers from the same basic drawback.
Of course, some amateur and most professional 3D artists use a variety of tricks to get around these limitations and even become productive, while top-end studios probably use 3D scanners for modelling real world objects. But for the average computer user, the whole thing remains inacessible for the two reasons I stated - hard to grasp theoritically and hard to implement in practice as well.
Having said that, using a free, open source software like Blender is an incredibly fun and learning experience.
Filed under:
My software by
Hari
Posted on Fri, Sep 30, 2011 at 11:20 IST (last updated: Fri, Sep 30, 2011 @ 11:20 IST)
So, in my spare time I am currently developing a graphical, tile-based RPG game in Python and pygame.
So far I've implemented level displaying, character movement within levels, moving from one level to another (off the edges of the screen if possible), and our character picking up objects to add to the inventory.
Here are some of the screenshots (slightly scaled for convenience) from the game (in very early development) so far:
See the red potion? That's the stereotypical health potion.
As you can see, I've implemented adding items to the character's inventory.
Inventory shows the items the character is currently carrying.
I would like to emphasize that
*ALL* the graphics used in this game of are my own creation - they are not too flash, as you can see, but I'm proud of them. Even the font used is the one I created for use in my comics. I will probably continue updating the progress of this project here and probably share the git repository once I have implemented most of the basic features.
An RPG game is fun to create in a programming language like Python, which allows so much flexibility with data structures. I am using pygame for graphics, which just lets me do the job and get out of the way, allowing me to focus on the game logic and so on.
Filed under:
Artwork/Portraits/Caricatures by
Hari
Posted on Mon, Sep 26, 2011 at 20:39 IST (last updated: Mon, Sep 26, 2011 @ 20:39 IST)
Flexing my (rather rusty for what it's worth) artistic skills after a long time.
Haven't been drawing too much of late, so trying to get some practice.
Filed under:
Software and Technology by
Hari
Posted on Sat, Sep 17, 2011 at 17:44 IST (last updated: Sat, Sep 17, 2011 @ 17:52 IST)
Here are my thoughts on Android arranged in no particular order. Make what you will of it. I am not entirely negative about it though I have only highlighted the negative points in this post.
- The 2.x series is definitely an underwhelming experience for tablets. (3.x is supposed to be more suitable for tablets but it's not yet commonly available)
- Too many paid applications in comparison to free ones. Call me cheap, but most free apps seem to be ad-supported or otherwise feature-restricted which is faintly reminiscent of the Windows 98/2000/XP era of shareware. Considering the price paid for a decent tablet or smartphone, you feel that the platform could offer a lot more freebies thrown into the bargain.
- The system is a bit resource-hungry which has the tendency to drain the device battery even on idle or standby (again 3.x is supposed to fix this issue)
- Official Google Android market is not available on many devices unless you fix it manually (custom ROM, rooting or other manual mechanism)
- A bit too tied-in to Google user account for comfort (you can of course use Android without the google part, but that limits many of the applications)
After my experience with Android on the ViewSonic GTablet, I am not sure whether I would prefer to buy an Android phone or not. I guess I am not keen on too many features for a phone and would prefer decent battery life and focus on the essentials over support for a wide range of applications. Tablets are a different story, though I am still sceptical about their utility, particularly as most branded tablets are priced much higher than netbooks and decent low-to-mid range and laptops.
On a related note, I think the touch technology (whether capacitive or resistive) is highly over-rated. Touchscreens are the fad right now, but nothing beats a proper keypad or keyboard for fast, accurate text entry.
On the plus side, Android is still a relatively new OS and it has a lot of potential, particularly with its open-source roots. In future, I expect the platform the be a lot more stable and market apps to be of a consistently higher quality than at present.
Pages:
1
...
39
40
41
42
43
44
45
46
47
...
140