Infinite Monkey theorem ( http://en.wikipedia.org/wiki/Infinite_monkey_theoremv) states that a group of monkeys collaboratively by random jumps on typewriters can write a book. More monkeys there are the probability goes up.
Now , a days most software engineers are asked to produce a visual effect , animation or graphics similar to an existing program. The existing programs might have come to produce the effect after a series of trial and error. The software engineer in question has to come up with something in a deterministic time frame something which "experts" took years of trial and error to achieve.
It is like competing with Infinite monkeys who wrote the book. One monkey ( or a small group ) achieved something , now all the monkeys have got urge to follow suit.
Vinasha kale , Vipareeda Budhi.
Monday, November 29, 2010
Sunday, November 28, 2010
Watching Youtube videos - the forgotten art
When I was working with a company , I used to watch lot of esoteric videos out there on the Youtube. Today, I called VSNL and got my internet connection back. After a long time , I did watch NTR songs , Kannada Songs , Pakistani Videos and even one video on Computation !.
Labels:
Ways of Life
| Reactions: |
Skewed Sex Ratio - Will India move to Polyandry ?
Haryana and Punjab are two states where male to female ratio is skewed towards men. One reason being the craving to have a baby boy and lot of foetus killing do happen over there. Now , Brides are even smuggled from Bangaladesh as legitimate "Bahuranis".
If the trend continues like this , India has to go to a Polyandric marriage system.
If the trend continues like this , India has to go to a Polyandric marriage system.
Labels:
Ways of Life
| Reactions: |
Saturday, November 27, 2010
How to retrieve unparsed command line arguments in C#
The following C# program is very useful to get the raw command line arguments for a console application.
using System;
public class Envs
{
public static void Main( String [] args ) {
String[] arguments = Environment.GetCommandLineArgs();
Console.WriteLine("GetCommandLineArgs: {0}", String.Join(", ", arguments));
}
}
Labels:
Software(.NET)
| Reactions: |
Nicolas Bourbaki - A mathematician who never was
Currently , I am reading Amir Aczel's "The Artist and the Mathematician". The book chronichles the activities of Nicholas Bourbaki ( a pseudonym to tear mathematics down to it's foundations ).
Read about Bourbaki and his activities @ the following wiki page.
Read about Bourbaki and his activities @ the following wiki page.
Labels:
Mathematics
| Reactions: |
Specialized Dictionaries - Probable use cases
Of late , I have been purchasing dictionaries which gives meaning of words , phrases specific to a particular domain. I am having such dictionaries for Statistics , Mathematics , Finance , Philosophy and Biology.
They are a tremendous source of entertainment as well as information. Rather than searching for a solution to a problem faced by us , we can see some solutions to come up with a list of probable problems which we might come across. A kind of reverse learning !
Some times , this helps to understand the problems faced by us.
They are a tremendous source of entertainment as well as information. Rather than searching for a solution to a problem faced by us , we can see some solutions to come up with a list of probable problems which we might come across. A kind of reverse learning !
Some times , this helps to understand the problems faced by us.
Labels:
Psychology,
Ways of Life
| Reactions: |
Friday, November 26, 2010
Some non-trivial Python extensions using Visual C/C++
The following program ( demonstrated at Pycon 2010 , india ) shows you how to manipulate python arrays,lists and tuples in Visual C++
///////////////////////////////
//
// ArrayExt.cpp
//
// A Simple Python Extension under Visual C/C++
//
// Written by Praseed Pai K.T.
// http://praseedp.blogspot.com
//
//
// At the Visual studio Command prompt
//
// The Python path for my machine is H:\Python31
//
// cl /c -IH:\Python31\include -IH:\Python31 ArrayExt.cpp
//
// link /DLL /out:ArrayExt.pyd ArrayExt.obj H:\Python31\libs\Python31.lib
//
//
//
//
#include <Python.h>
#include <stdlib.h>
/////////////////////////////////
//
// This is the actual routine which returns the string "Hello World.."
//
//
//
static PyObject * SQuare( PyObject *self , PyObject *args )
{
double cnt=0;
PyArg_ParseTuple(args,"d",&cnt);
PyObject *return_value = 0;
return_value = Py_BuildValue("d",cnt*cnt);
return return_value;
}
///////////////////////////////////////////
//
//
//
//
static PyObject * IsSolutionForQuad( PyObject *self , PyObject *args )
{
double a , b , c ;
a=b=c=0;
PyArg_ParseTuple(args,"ddd",&a,&b,&c);
double disc = b*b - 4*a*c;
if ( disc < 0.0 ) {
return Py_BuildValue("i",0);
}
double x1 = ( -b + sqrt(disc) ) / (2*a);
double x2 = ( -b - sqrt(disc) ) / (2*a);
PyObject *return_value = 0;
return_value = Py_BuildValue("dd",x1,x2);
return return_value;
}
/////////////////////////////////
//
//
//
//
//
static PyObject *SumList( PyObject *self , PyObject *args )
{
PyObject* myTuple;
if(!PyArg_ParseTuple(args,"O",&myTuple))
return NULL;
if ( !PyList_Check(myTuple) ) {
fprintf(stdout,"Tuple not found s....");
return NULL;
}
int length = (int)PyList_Size(myTuple);
double sum = 0;
double dbl = 0;
for(int i=0; i < length; ++i )
{
PyObject *next = PyList_GetItem(myTuple,i);
if ( PyFloat_Check(next) ) {
dbl = PyFloat_AsDouble(next);
}
sum += dbl;
}
return Py_BuildValue("d",sum);
}
/////////////////////////////////
//
//
//
//
//
static PyObject *SumTuple( PyObject *self , PyObject *args )
{
PyObject* myTuple;
if(!PyArg_ParseTuple(args,"O",&myTuple))
return NULL;
if ( !PyTuple_Check(myTuple) ) {
return NULL;
}
int length = (int)PyTuple_Size(myTuple);
double sum = 0;
double dbl = 0;
for(int i=0; i < length; ++i )
{
PyObject *next = PyTuple_GetItem(myTuple,i);
if ( PyFloat_Check(next) ) {
dbl = PyFloat_AsDouble(next);
}
sum += dbl;
}
return Py_BuildValue("d",sum);
}
////////////////////////////////////////
//
// Initialize the PyMethodDef table
//
//
static struct PyMethodDef pyext_methods[] = {
{"SQuare",SQuare,METH_VARARGS,0},
{"IsSolutionForQuad",IsSolutionForQuad,METH_VARARGS,0},
{"SumList",SumList,METH_VARARGS,0},
{"SumTuple",SumTuple,METH_VARARGS,0},
{ 0 , 0 }
};
///////////////////////////////////
//
// Initialize the table
//
//
static struct PyModuleDef PyExtModule = {
PyModuleDef_HEAD_INIT,
"ArrayExt", /* name of module */
0, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
pyext_methods
};
//////////////////////////////////////
//
// Python Interpreter initializes the module by
// calling the routine given below
//
//
PyMODINIT_FUNC PyInit_ArrayExt(void) {
return PyModule_Create(&PyExtModule);
}
| Reactions: |
A Simple Python Extension using Visual C++
The following program ( demonstrated at pycon india 2010 ) shows you how to create a "phalthoo" Hello World Extension
///////////////////////////////
//
// PyExt.cpp
//
// A Simple Python Extension under Visual C/C++
//
// Written by Praseed Pai K.T.
// http://praseedp.blogspot.com
//
//
// At the Visual studio Command prompt
//
// The Python path for my machine is H:\Python31
//
// cl /c -IH:\Python31\include -IH:\Python31 PyExt.cpp
//
// link /DLL /out:PyExt.pyd PyExt.obj H:\Python31\libs\Python31.lib
//
//
//
//
#include <Python.h>
#include <stdlib.h>
/////////////////////////////////
//
// This is the actual routine which returns the string "Hello World.."
//
//
//
static PyObject * SayHello( PyObject *self , PyObject *args )
{
PyObject *return_value = 0;
return_value = Py_BuildValue("s","Hello World....");
return return_value;
}
////////////////////////////////////////
//
// Initialize the PyMethodDef table
//
//
static struct PyMethodDef pyext_methods[] = {
{"SayHello",SayHello,METH_NOARGS,0},
{ 0 , 0 }
};
///////////////////////////////////
//
// Initialize the table
//
//
static struct PyModuleDef PyExtModule = {
PyModuleDef_HEAD_INIT,
"PyExt", /* name of module */
0, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
pyext_methods
};
//////////////////////////////////////
//
// Python Interpreter initializes the module by
// calling the routine given below
//
//
PyMODINIT_FUNC PyInit_PyExt(void) {
return PyModule_Create(&PyExtModule);
}
| Reactions: |
Embedding Python Interpeter in a Visual C++ Program
At Pycon 2o1o, I took a session on Extending and Embedding Python under Windows. This Program uses Python 3.x
////////////////////////////////////////////////
//
// Embed.cpp
//
// A Simple program to demonstrate the embedding of
// Python interpreter inside a C/C++ Program.
//
//
// Written by Praseed Pai K.T.
// http://praseedp.blogspot.com
//
//
//
// cl -IH:\Python31\include Embed.cpp H:\Python31\libs\Python31.lib
//
//
#include <Python.h>
///////////////////////////////////////
//
// The user entry point for a C/C++ program
//
//
//
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print('Today is', ctime(time()))\n");
Py_Finalize();
return 0;
}
| Reactions: |
Thursday, November 25, 2010
Can we eliminate our desire for something ?
Guathama Budha , told us that "Desire is the root cause of all Evil". I have got a mixed feeling towards this statement. While , Desire for something might land up in a mess , It can be a cause for coming out of Inertia as well. This will give us renewed energy and propel us to do more things in our shorter life.
What will happen , if we know that we cannot get what we desire or crave for ?
There is a phenomena in Psychology called "Defence Mechanism". This will get automatically triggered and will try to compensate for any void left in us , as
we could not get what we desired for.
The compensation we get from alternate activities will help us to minimize the "damage". It won't eliminate the desire , but, our craving for it will substantially come down.
What will happen , if we know that we cannot get what we desire or crave for ?
There is a phenomena in Psychology called "Defence Mechanism". This will get automatically triggered and will try to compensate for any void left in us , as
we could not get what we desired for.
The compensation we get from alternate activities will help us to minimize the "damage". It won't eliminate the desire , but, our craving for it will substantially come down.
Labels:
Ways of Life
| Reactions: |
Why should you have Goals ? - The Active vs Passive goals
I have read as well as heard from people that we should constantly set new goals , once we have achieved the current active goal (if any ). I have always brushed aside those suggestions.
Now a days , I feel there is some truth behind this pitch.
Due to mess which I landed up recently , I began to introspect and found out that , I have got only passive goals and there is no active goal as such. This creates lot of emptiness as in the wait for achievement of passive goals do not have a stipulated time frame. We will use that time to flirt with new ideas which might be wastage of time.
Always , have an active goal before you. This should help you to have a life without much boredom and side tracks.
Now a days , I feel there is some truth behind this pitch.
Due to mess which I landed up recently , I began to introspect and found out that , I have got only passive goals and there is no active goal as such. This creates lot of emptiness as in the wait for achievement of passive goals do not have a stipulated time frame. We will use that time to flirt with new ideas which might be wastage of time.
Always , have an active goal before you. This should help you to have a life without much boredom and side tracks.
Labels:
Ways of Life
| Reactions: |
Wednesday, November 24, 2010
How to take Negative of a Image in C# ?
This is yet another case of image point processing algorithm.
Algorithm is as follows
For each pixel {
read pixel
split pixel into R G B
subtract R,G,B from 255
ReAssemble Pixel
Put it back
}
Following C# code , will clarify the stuff for you
Algorithm is as follows
For each pixel {
read pixel
split pixel into R G B
subtract R,G,B from 255
ReAssemble Pixel
Put it back
}
Following C# code , will clarify the stuff for you
using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging ;
namespace GraphicsWindow
{
/// <summary>
/// Summary description for CGreyScaleConverter.
/// </summary>
public class CNegativeConverter
{
public CNegativeConverter()
{
}
public System.Drawing.Bitmap Render(String Filename)
{
Bitmap b = new Bitmap(Filename);
BitmapData bd = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int size = b.Width*b.Height;
System.IntPtr tarr=bd.Scan0;
unsafe
{
byte *marrayPtr = (byte *)tarr.ToPointer();
for( int index = 0; index < size; index++ )
{
byte *OldPtr = marrayPtr;
int rc = *marrayPtr++;
int gc = *marrayPtr++;
int bc = *marrayPtr++;
//int grey = (int)(rc*0.33 + gc*0.59 + bc*0.11);
//grey=grey%255;
*OldPtr++ =(byte)(255-rc); // grey;
*OldPtr++ =(byte)(255-gc); //grey;
*OldPtr++=(byte)(255-bc);
}
}
b.UnlockBits( bd);
return b;
}
}
}
| Reactions: |
Bit Fields in Visual C/C++
While defining a structure in C/C++ , we can specify the amount of bits , each element takes . This is much simpler than fiddling with Bit mask.
typedef struct {
int x:4;
int x_c:6;
int x_d:6;
}CELL;
In the above example ( taken from production code ! ) , x takes 4 bits , x_c and x_d takes 6 bits each.
The following simple program can be compiled and executed to see it
typedef struct {
int x:4;
int x_c:6;
int x_d:6;
}CELL;
In the above example ( taken from production code ! ) , x takes 4 bits , x_c and x_d takes 6 bits each.
The following simple program can be compiled and executed to see it
#include <windows.h>
#include <stdio.h>
typedef struct {
int x:4;
int x_c:6;
int x_d:6;
}CELL;
void main( ) {
CELL a;
a.x = 1;
a.x_c = -1;
a.x_d = -5;
printf("%d %d %d\n" , a.x , a.x_c , a.x_d );
}
Labels:
C/C++,
Windows C/C++ Programming
| Reactions: |
A Windows C/C++ function to determine the size of a file
Some times , we need to understand the size of a file to process it. I do compute the file size using following function
#include <windows.h>
#include <stdio.h>
///////////////////////////////////////////////////////////////////
// Computes the FileSize
//
//
//
DWORD ComputeFileSize( LPSTR pFileName )
{
DWORD tellptr;
HANDLE hf;
if((hf = CreateFile(pFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == NULL) {
return (DWORD) 0;
}
tellptr = GetFileSize( hf , NULL );
CloseHandle( hf );
return tellptr;
}
Labels:
C/C++,
Windows C/C++ Programming
| Reactions: |
Color to Grey Scale Conversion in C#
Converting a True color image to a Grey Scale image is an instance of image point processing. The algorithm is very simple to implement.
Algorithm
---------
Open File
For every pixel {
read pixel
split the pixel into R , G , B
grey = R*0.33 + G*0.59 + B*0.11
Write grey for R , G , B and reassemble pixel
Write the Pixel back
}
Following C# code clarifies the stuff
Algorithm
---------
Open File
For every pixel {
read pixel
split the pixel into R , G , B
grey = R*0.33 + G*0.59 + B*0.11
Write grey for R , G , B and reassemble pixel
Write the Pixel back
}
Following C# code clarifies the stuff
using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging ;
namespace GraphicsWindow
{
/// <summary>
/// Summary description for CGreyScaleConverter.
/// </summary>
public class CGreyScaleConverter
{
public CGreyScaleConverter()
{
}
public System.Drawing.Bitmap Render(String Filename)
{
Bitmap b = new Bitmap(Filename);
BitmapData bd = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int size = b.Width*b.Height;
System.IntPtr tarr=bd.Scan0;
unsafe
{
byte *marrayPtr = (byte *)tarr.ToPointer();
for( int index = 0; index < size; index++ )
{
byte *OldPtr = marrayPtr;
int rc = *marrayPtr++;
int gc = *marrayPtr++;
int bc = *marrayPtr++;
int grey = (int)(rc*0.33 + gc*0.59 + bc*0.11);
grey=grey%255;
*OldPtr++ =(byte)grey;
*OldPtr++ =(byte)grey;
*OldPtr++=(byte)grey;
}
}
b.UnlockBits( bd);
return b;
}
}
}
| Reactions: |
Tuesday, November 23, 2010
Parallel for and Parallel for_each in Visual C++ 2010
/////////////////////////
//
//
//
//
#include <functional>
#include <ppl.h>
#include <vector>
#include <stdio.h>
using namespace std;
using namespace std::tr1;
using namespace Concurrency;
void main()
{
parallel_for(0,10000,[=] (int n ) {
printf("%d\n",n);
});
vector<int> v;
v.push_back(30);
v.push_back(40);
v.push_back(50);
parallel_for_each(v.begin(),v.end(),[] (int &n ) {
n=-n;
});
parallel_for_each(v.begin(),v.end(),[] (int n ) {
printf("%d\n",n);
});
}
Labels:
Windows C/C++ Programming
| Reactions: |
Parallel Invoke in Visual C++ 2010
#include <windows.h>
#include <iostream>
#include <ppl.h>
using namespace std;
using namespace Concurrency;
int main()
{
parallel_invoke(
[=]{for (int i=0; i<100; ++i)
{cout << i << endl; Sleep(100);}},
[=]{for (int i=0; i<10; ++i)
{cout << " " << i << endl; Sleep(1000);}}
);
return 0;
}
Labels:
C/C++,
Windows C/C++ Programming
| Reactions: |
WinSock Client and Server - some thing which i wrote long back.
Today , while scanning through my old CDs , i happen to come across four programs which was written to educate some college students about WinSock programming. The year was 1996 .
I am pasting it as is here
First , let us look at the Server program
Now , it is turn of client
Open the Visual studio command prompt
type
cl Client.cpp ws2_32.lib
cl Server.cpp ws2_32.lib
To start the program
Start Server 3500
Client localhost 3500 your message goes here
I am pasting it as is here
First , let us look at the Server program
///////////////////////////////////////////////////////////
//
// A Simple WinSock Server ...
//
//
//
#include <windows.h>
#include <stdio.h>
/////////////////////////////////
//
// Initialise Winsock Libraries
//
//
//
BOOL StartSocket()
{
WORD Ver;
WSADATA wsd;
Ver = MAKEWORD( 2, 2 );
if (WSAStartup(Ver,&wsd) == SOCKET_ERROR)
{
WSACleanup();
return FALSE;
}
return TRUE;
}
/////////////////////////////
//
//
//
int ProtocolPort = 3500;
struct sockaddr_in LocalAddress;
struct sockaddr_in RemoteAddress;
SOCKET ListnerSocket;
SOCKET InComingSocket;
char Buffer[1024];
///////////////////////////////////////
//
//
int main(int argc, char* argv[])
{
if ( argc != 2 )
{
fprintf(stdout,"Usage: Server \n");
return 1;
}
if ( !StartSocket() )
{
fprintf(stdout,"Failed To Initialize Socket Library\n");
return 1;
}
ProtocolPort = atoi(argv[1]);
LocalAddress.sin_family = AF_INET;
LocalAddress.sin_addr.s_addr = INADDR_ANY;
LocalAddress.sin_port = htons(ProtocolPort);
if ( ( ListnerSocket = socket(AF_INET, SOCK_STREAM,0)) ==
INVALID_SOCKET )
{
fprintf(stdout,"call to socket failed with error %d\n",
WSAGetLastError());
WSACleanup();
return -1;
}
if (bind(ListnerSocket,(struct sockaddr*)&LocalAddress,
sizeof(LocalAddress) )
== SOCKET_ERROR) {
fprintf(stderr,"Socket Error %d\n",WSAGetLastError());
WSACleanup();
return -1;
}
if (listen(ListnerSocket,5) == SOCKET_ERROR)
{
fprintf(stderr,"Socket Error %d\n",WSAGetLastError());
WSACleanup();
return -1;
}
while (1)
{
memset(Buffer , 0 ,sizeof(Buffer));
int Len = sizeof( RemoteAddress );
InComingSocket = accept(ListnerSocket,
(struct sockaddr*)&RemoteAddress, &Len);
if (InComingSocket == INVALID_SOCKET)
{
fprintf(stderr,"accept error %d\n",WSAGetLastError());
WSACleanup();
return -1;
}
int RetVal = recv(InComingSocket,
Buffer,sizeof (Buffer),0 );
if (RetVal == SOCKET_ERROR) {
fprintf(stderr,
"recv() failed: error %d\n",WSAGetLastError());
closesocket(InComingSocket);
continue;
}
if (RetVal == 0) {
printf("Client closed connection\n");
closesocket(InComingSocket);
continue;
}
printf("===================================\n");
printf("String in the Buffer\n\n" );
printf("%s\n" ,Buffer);
printf("===================================\n");
closesocket(InComingSocket);
}
WSACleanup();
return 0;
}
Now , it is turn of client
///////////////////////////////////////////////
//
// Socket Client Application
//
// This was written by Praseed Pai K.T. , some fourteen years
// back and has been used to baptisize lot of people into
// network programming using WinSock
//
//
//
/////////////////////////////////////
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
/////////////////////////////
//
// Helper Function To Initialize Socket
//
//
//
BOOL StartSocket()
{
WORD Ver;
WSADATA wsd;
Ver = MAKEWORD( 2, 2 );
if (WSAStartup(Ver,&wsd) == SOCKET_ERROR)
{
WSACleanup();
return FALSE;
}
return TRUE;
}
///////////////////////////
//
//
// Server to which we want to connect
//
char ServerName[255];
///////////////////////////////
//
// Port => ServerName + Port uniquely identifies a service
//
WORD PortNumber;
struct sockaddr_in Server;
struct hostent *HostPointer;
unsigned int addr;
SOCKET ConnectSock;
char Buffer[128];
/////////////////////////////////////
//
//
//
//
int main(int argc, char* argv[])
{
if ( argc != 4 )
{
fprintf(stdout,"Usage: Server <ServerName ><portid> <message> \n");
return 1;
}
if ( !StartSocket() )
{
fprintf(stdout,"Failed To Initialize Socket Library\n");
return 1;
}
strcpy(ServerName,argv[1] );
PortNumber = atoi(argv[2]);
if (isalpha(ServerName[0])) {
HostPointer= gethostbyname(ServerName);
}
else { /* Convert nnn.nnn address to a usable one */
addr = inet_addr(ServerName);
HostPointer = gethostbyaddr((char *)&addr,4,AF_INET);
}
if (HostPointer == NULL ) {
fprintf(stderr,"Client: Cannot resolve address [%s]: Error %d\n",
ServerName,WSAGetLastError());
WSACleanup();
exit(1);
}
printf("*");
printf(" **");
memset(&Server,0,sizeof(Server));
printf(" ***");
memcpy(&(Server.sin_addr),HostPointer->h_addr,
HostPointer->h_length);
Server.sin_family = HostPointer->h_addrtype;
Server.sin_port = htons(PortNumber);
printf("***");
ConnectSock = socket(AF_INET,SOCK_STREAM,0);
if (ConnectSock <0 ) {
fprintf(stderr,"Client: Error Opening socket: Error %d\n",
WSAGetLastError());
WSACleanup();
return -1;
}
if (connect(ConnectSock,
(struct sockaddr*)&Server,
sizeof(Server))
== SOCKET_ERROR) {
fprintf(stderr,"connect() failed: %d\n",WSAGetLastError());
WSACleanup();
return -1;
}
strcpy(Buffer,argv[3] );
int RetVal = send(ConnectSock,Buffer,strlen(Buffer),0);
if (RetVal == SOCKET_ERROR) {
fprintf(stderr,"send() failed: error %d\n",WSAGetLastError());
WSACleanup();
return -1;
}
closesocket(ConnectSock);
WSACleanup();
return 0;
}
Open the Visual studio command prompt
type
cl Client.cpp ws2_32.lib
cl Server.cpp ws2_32.lib
To start the program
Start Server 3500
Client localhost 3500 your message goes here
| Reactions: |
I did not know that CAPTCHA is an acronym.
Completely Automated Public Turing test to tell Computers and Humans Apart. I read about this in a .NET Web development book.
Labels:
Computer Programming,
Software(.NET)
| Reactions: |
Monday, November 22, 2010
Sun vanished some time back , it is the turn of Novell , what about mono ?
Attachmate is planning to acquire Novell ( at one point of time , THE networking company )
http://www.networkworld.com/community/node/68779
Some of the assets are transferred to a M$ backed consortium. I hope Mono will be one of them.
http://www.networkworld.com/community/node/68779
Some of the assets are transferred to a M$ backed consortium. I hope Mono will be one of them.
Labels:
Ways of Life
| Reactions: |
Sunday, November 21, 2010
Barkha Dutt - another case of how Indian Intellectuals sell us !
I Stopped watching NDTV channel in the year 2000. Back then itself , It was pretty clear to me that there was something going on "behind the scenes". Rajdeep Sardesai , Arnab Goswami and Burkha Dutt had a slant in their reporting or at least , i felt that they have got a certain political position and will do anything to manuevre themselves to their "wishland".
Most of these journalists are convent educated and have been either the products of Jawaharlal Nehru University or Jamia Milia . If you take a step back , it is the bastion of three mono theistic faiths in India.
a) Convent Education => "Baptism to take positions favorable to church's social engineering activities"
b) JNU => "Craddle of pro-left journalism"
c) Jamia Milia Islamia => "Political Islam"
Marxism , Christianity and Islam are the three great monotheistic religions in India.
This is my take on it ,
"Average middle class Hindu boys , will get convent educated and will move to places like JNU and have some left leaning ideologies . Since , there is no identification based on religious lines among Hindus , these middle class boys feel powerless. Attraction towards one of the mono theistic faiths based on the unity plank sold ( i have not seen it , till date ) by them. This makes him question his belieft system and to appear secular he will take a left leaning , pro-monotheistic ideology. That is the real meaning of secularism in India. [Original concept of secularism was to seperate faith from governmental activities ] ".
Many of the Indian English journalists are from the above class . Their hate for faiths originated in this land is well known and they have got affinity for a neighbhouring country which borders slavery. They sell us to the outside worlds as snake eating , narrow minded , religious bigots who are against the minorities of this country. Some do believe that , the "saffron demographics" of India should be changed to have secularism here.
When an Italian took our country for a ride , these journalists were silent and all of the indians thought this as natural and even in films it is being sold as a cliche.
They scare so-called religious minorities of India , by reporting in a one sided manner to suite certain political parties. They have got contempt for a western Indian state for re-electing a leader who has got silent support among the masses of this country.
Reading news papers in India is not necessary as most of these are run by "Crypto Christians" , Left leaning bigots or are funded by new age churches. It can be seen from Srinagar ot KanyaKumari.
IMHO , people do watch these channels (despite hating them ) because , men derive happiness out of self inflicted pains.
I am writing this after reading #barkhagate on twitter and also viewed youtube videos regarding this.
Most of these journalists are convent educated and have been either the products of Jawaharlal Nehru University or Jamia Milia . If you take a step back , it is the bastion of three mono theistic faiths in India.
a) Convent Education => "Baptism to take positions favorable to church's social engineering activities"
b) JNU => "Craddle of pro-left journalism"
c) Jamia Milia Islamia => "Political Islam"
Marxism , Christianity and Islam are the three great monotheistic religions in India.
This is my take on it ,
"Average middle class Hindu boys , will get convent educated and will move to places like JNU and have some left leaning ideologies . Since , there is no identification based on religious lines among Hindus , these middle class boys feel powerless. Attraction towards one of the mono theistic faiths based on the unity plank sold ( i have not seen it , till date ) by them. This makes him question his belieft system and to appear secular he will take a left leaning , pro-monotheistic ideology. That is the real meaning of secularism in India. [Original concept of secularism was to seperate faith from governmental activities ] ".
Many of the Indian English journalists are from the above class . Their hate for faiths originated in this land is well known and they have got affinity for a neighbhouring country which borders slavery. They sell us to the outside worlds as snake eating , narrow minded , religious bigots who are against the minorities of this country. Some do believe that , the "saffron demographics" of India should be changed to have secularism here.
When an Italian took our country for a ride , these journalists were silent and all of the indians thought this as natural and even in films it is being sold as a cliche.
They scare so-called religious minorities of India , by reporting in a one sided manner to suite certain political parties. They have got contempt for a western Indian state for re-electing a leader who has got silent support among the masses of this country.
Reading news papers in India is not necessary as most of these are run by "Crypto Christians" , Left leaning bigots or are funded by new age churches. It can be seen from Srinagar ot KanyaKumari.
IMHO , people do watch these channels (despite hating them ) because , men derive happiness out of self inflicted pains.
I am writing this after reading #barkhagate on twitter and also viewed youtube videos regarding this.
Labels:
Ways of Life
| Reactions: |
Building Web sites - it is all about being procedural
Today , I was sitting with HTML,CSS and PHP 5 to create some HTML Layout. I am using the good old notepad to key in the HTML and CSS to create Basic Page Layouts. After a while , I understood the usage of a tool like DreameWeaver in developing good layouts. I did write some PHP code to create images dynamically .
I now understand that Building complelling user experience is not about Programming and design. You need to fiddle with the tools and learn by trail/error. It is a procedural activity. It is going to take some time , especially , if you are a hard core programmer.
Another probable mindblock for a programmer is inquisitiviness required for Web programming is different from writing Application/Systems code. We should see Web as a medium for communication , tool and a business opportunity to be good at that. Otherwise , you will end up becoming a framework guy with not much experience at the front facing web sites.
I now understand that Building complelling user experience is not about Programming and design. You need to fiddle with the tools and learn by trail/error. It is a procedural activity. It is going to take some time , especially , if you are a hard core programmer.
Another probable mindblock for a programmer is inquisitiviness required for Web programming is different from writing Application/Systems code. We should see Web as a medium for communication , tool and a business opportunity to be good at that. Otherwise , you will end up becoming a framework guy with not much experience at the front facing web sites.
Labels:
Software (Design)
| Reactions: |
Saturday, November 20, 2010
Version control - you need to take it serious
As part of monthly "Tech Saturday" In my company , there was a session on SVN. The presenter explained the lingo really well and backed up with good slides/hands own demo. The discussion that followed was really useful for me.
The SVN client available with XCODE do not have many of the features of Eclipse SVN pluggin or Tortoise SVN. The presenter explained some techniques to manage bug fixes , labelling and synching with the main trunk etc.
I am planning to explore the possiblity of using Tortoise SVN ( as opposed to XCODE client ) for revision control.
The SVN client available with XCODE do not have many of the features of Eclipse SVN pluggin or Tortoise SVN. The presenter explained some techniques to manage bug fixes , labelling and synching with the main trunk etc.
I am planning to explore the possiblity of using Tortoise SVN ( as opposed to XCODE client ) for revision control.
Labels:
Software (Design)
| Reactions: |
"Confessions of a Reluctant Enterprise Developer !"
I started my professional programming career with Nantucket's Clipper Summer 87 compiler. The UI is Character Oriented and platform was MSDOS/Novel Netware. The type of applications include Financial Accounting package , Inventory, Payroll , Purchase order automation etc. I was also using Turbo C/C++ and Turbo Assembler to make calls to the MSDOS INT 21H , incorporating Graphics using direct VGA programming , Interrupt driven serial communication , data compression , file transfer to name a few. Clipper had excellent support for linking to C routines ( EXTEND system ).
I had a brief stint with SCO unix for a project in those times. This made me an "addict" of C Programming languae.
Constant exposure to MSDOS system internals and "differentiation" syndrome led me to choose C/C++ ( Borland C/C++ , Visual C/C++ ) as my primary programming language. Many of my friends chose Borland Delphi , Power Builder and MS Visual Basic as their primary skill set. Some preferred Oracle Developer tools.
Working with C/C++ in those times means you struggle with algorithmic minutae , low level bit fiddling techniques , dirty tricks like DLL injection , thunking , low level computer graphics ( i had to write a software 3D renderer for a project ) , mixed language programming , interpreters/compilers etc. I became an expert of sort in integrating Visual Basic/Delphi/Powerbuilder with Windows C/C++ modules using COM/ActiveX and Win32 calls.
It was a dream run for 9 years. I had occassional forays into Perl , Python , Java and other tools. But, i reverted back to C/C++ always. The difference between nearest guy was quite huge as i had access to Dr. Dobb's journal , Windows developers journal , Microsoft System journal and there was no Google around !
Around 2002, i noted a curious pattern. Most of the projects in my part of the world are either in java , .net or LAMP stack . The only option for me was to move to Bangalore , Chennai or Hyderabad . Being demophobic in nature , I decided to stay back. I "accidently" drifted into Animation and Entertainment for a period of ten months and at one time even chose to become a media programmer. I learned to write Pluggins for 3DS max using Visual C/C++, Macro Media dirctor 3D programmng , Flash Programming . But, I realized that making a living through these tools are difficult because of a shallow market here.
Finally , in 2004 , I moved to bangalore to work for a reputed CAD company through a "bangalore" captive operation. I had a good stint there , but , my domestic compulsions made me to come back to Kerala.
From 2005 onwards , I started working with C# (with occassional Java Projects and some C++ ) as my employers chose me for projects in that language. For me , C# ( and Java ) are lesser C++ , there is more noise around it . At least that is what i thought at that point of time.
Even in C# , I was mostly working with Desktop systems like Winforms , Windows Presentation Foundation and Some PInvoke stuff. I was indifferent to Web as I thought Web developers are a bunch of assholes. I even coined "If /else / while /loop / select / update / delete programmers". I was sticking with C# , Direct3D , OpenGL , WPF 3D etc.
Unfortunately (or Fortunately , in retrospect) , one company sacked me with fifteen minutes notice. Till this day , I do not have a clue the real reason , why i was sacked. I did get some training assignments on WPF and C# shortly after that. For my long term career , I realized that there is a "career crisis" brewing. Desktop applications and skills in Computer Graphics , Algorithms , Compilers , Computational geometry do not have a place in the IT map of Kerala. Another thing , I realized that CAD/CAM companies whom used to employ me are not as "rich" as software houses which specialize in Enterprise Application developement.
Unexpectedly , I was employed as a Solutions architect in a company which was having a Custom Web Application framework. I was the leader of a team which owned and modified the framework. It was a challenge for me as most of the lingo was bit foriegn to me . I began to study about Enterprise Applications architecture in a serious manner. I realized that it is as challenging as any other software engineering projects. For the next six months , It was a great learning experience and that stint gave me real insight into Enterprise Application Architecture , Business Integration , Workflow Orchastration , Back ground Jobs engines , Presentation Layer management , Caching , Security to name a few ( in a production environment )
Due to Personal compulsions , I took a vaccation for nine months . Once again , Desktop syndrome caught up with me. I explored GNU Linux as a platform for software development using C/C++. For fun , I learned Objective under Linux as well. This culminated in getting an OpenGL ES based assignment for iPhone followed by a day Job as Mac OS X /iPhone developer. I was at my element once again.
It so happened that , a project which I am working required a .NET based server infrastructure. This helped me to revisit ASP.net , Web Services , Cryptography and security bit deeper .
Even though , I am comfortable with Web backends , my UI skills are not great. I do know what are the UX issues by virtue of having read some HCI books.
Today , (When i got some spare time ) I decided to take UI stuff bit seriously. I played with GIMP , WampServer and HTML/CSS to understand the nuances of front end programming. I tried installing Joomal. In the comming days , I plan to continue to gain expertize in that. UX skills are getting more and more important as web sites are getting mobile enabled and at the same time Native apps ( iPhone and Android ) are all about UX . Lack of familiarity in those areas can create yet another "career crisis" !.
From today , I have decided to become an Enterprise Applications developer with keen interest in UX issues. I am hoping that , it will give me a new phase in my life.
I had a brief stint with SCO unix for a project in those times. This made me an "addict" of C Programming languae.
Constant exposure to MSDOS system internals and "differentiation" syndrome led me to choose C/C++ ( Borland C/C++ , Visual C/C++ ) as my primary programming language. Many of my friends chose Borland Delphi , Power Builder and MS Visual Basic as their primary skill set. Some preferred Oracle Developer tools.
Working with C/C++ in those times means you struggle with algorithmic minutae , low level bit fiddling techniques , dirty tricks like DLL injection , thunking , low level computer graphics ( i had to write a software 3D renderer for a project ) , mixed language programming , interpreters/compilers etc. I became an expert of sort in integrating Visual Basic/Delphi/Powerbuilder with Windows C/C++ modules using COM/ActiveX and Win32 calls.
It was a dream run for 9 years. I had occassional forays into Perl , Python , Java and other tools. But, i reverted back to C/C++ always. The difference between nearest guy was quite huge as i had access to Dr. Dobb's journal , Windows developers journal , Microsoft System journal and there was no Google around !
Around 2002, i noted a curious pattern. Most of the projects in my part of the world are either in java , .net or LAMP stack . The only option for me was to move to Bangalore , Chennai or Hyderabad . Being demophobic in nature , I decided to stay back. I "accidently" drifted into Animation and Entertainment for a period of ten months and at one time even chose to become a media programmer. I learned to write Pluggins for 3DS max using Visual C/C++, Macro Media dirctor 3D programmng , Flash Programming . But, I realized that making a living through these tools are difficult because of a shallow market here.
Finally , in 2004 , I moved to bangalore to work for a reputed CAD company through a "bangalore" captive operation. I had a good stint there , but , my domestic compulsions made me to come back to Kerala.
From 2005 onwards , I started working with C# (with occassional Java Projects and some C++ ) as my employers chose me for projects in that language. For me , C# ( and Java ) are lesser C++ , there is more noise around it . At least that is what i thought at that point of time.
Even in C# , I was mostly working with Desktop systems like Winforms , Windows Presentation Foundation and Some PInvoke stuff. I was indifferent to Web as I thought Web developers are a bunch of assholes. I even coined "If /else / while /loop / select / update / delete programmers". I was sticking with C# , Direct3D , OpenGL , WPF 3D etc.
Unfortunately (or Fortunately , in retrospect) , one company sacked me with fifteen minutes notice. Till this day , I do not have a clue the real reason , why i was sacked. I did get some training assignments on WPF and C# shortly after that. For my long term career , I realized that there is a "career crisis" brewing. Desktop applications and skills in Computer Graphics , Algorithms , Compilers , Computational geometry do not have a place in the IT map of Kerala. Another thing , I realized that CAD/CAM companies whom used to employ me are not as "rich" as software houses which specialize in Enterprise Application developement.
Unexpectedly , I was employed as a Solutions architect in a company which was having a Custom Web Application framework. I was the leader of a team which owned and modified the framework. It was a challenge for me as most of the lingo was bit foriegn to me . I began to study about Enterprise Applications architecture in a serious manner. I realized that it is as challenging as any other software engineering projects. For the next six months , It was a great learning experience and that stint gave me real insight into Enterprise Application Architecture , Business Integration , Workflow Orchastration , Back ground Jobs engines , Presentation Layer management , Caching , Security to name a few ( in a production environment )
Due to Personal compulsions , I took a vaccation for nine months . Once again , Desktop syndrome caught up with me. I explored GNU Linux as a platform for software development using C/C++. For fun , I learned Objective under Linux as well. This culminated in getting an OpenGL ES based assignment for iPhone followed by a day Job as Mac OS X /iPhone developer. I was at my element once again.
It so happened that , a project which I am working required a .NET based server infrastructure. This helped me to revisit ASP.net , Web Services , Cryptography and security bit deeper .
Even though , I am comfortable with Web backends , my UI skills are not great. I do know what are the UX issues by virtue of having read some HCI books.
Today , (When i got some spare time ) I decided to take UI stuff bit seriously. I played with GIMP , WampServer and HTML/CSS to understand the nuances of front end programming. I tried installing Joomal. In the comming days , I plan to continue to gain expertize in that. UX skills are getting more and more important as web sites are getting mobile enabled and at the same time Native apps ( iPhone and Android ) are all about UX . Lack of familiarity in those areas can create yet another "career crisis" !.
From today , I have decided to become an Enterprise Applications developer with keen interest in UX issues. I am hoping that , it will give me a new phase in my life.
Labels:
Software (Design),
Ways of Life
| Reactions: |
Friday, November 19, 2010
Some one called me a "troll"
a troll is someone who posts inflammatory, extraneous, or off-topic messages in an online community, such as an online discussion forum, chat room, or blog, with the primary intent of provoking other users into a desired emotional response[1
I found this on a page , where there was a mention of my talk on "FOSS" @ barcamp kerala 9
I found this on a page , where there was a mention of my talk on "FOSS" @ barcamp kerala 9
Labels:
Ways of Life
| Reactions: |
Creativity - a Darwinian angle
I have seen countless books in the market which teaches you to become more creative in your life. To a certain extent , we can cultivate it by some simple techniques.
Most often , creativity comes to an individual or a group who "writes a book" the way a monkey or some monkeys write a book using the infinite monkey theorom.
Most often , creativity comes to an individual or a group who "writes a book" the way a monkey or some monkeys write a book using the infinite monkey theorom.
Labels:
Ways of Life
| Reactions: |
Thursday, November 18, 2010
The meme of "Universal Acid"
I am reading Daniel Dennet's "Darwin's Dangerous idea" now a days. In the book , he states that Darwinian theory of evolution by natural selection is a "Universal Acid" . It means , it has affected every discipline in world.
Universal Acid is a hypothetical material which can melt anything. So , How we will store that ?
Universal Acid is a hypothetical material which can melt anything. So , How we will store that ?
Labels:
Ways of Life
| Reactions: |
Landmarks and association of individuals
While travelling , we will come across buildings which are cited as a landmark . Too often , we associate an individual or a group with it. When we come across those places , we try to look for the associated people. Some times , we do stumble upon them.
Labels:
Ways of Life
| Reactions: |
Tuesday, November 16, 2010
Second Order Systems , osciallations and overshoot
I got introduced to the term "Second Order Systems" from a friend of mine. I do not recall the exact person who injected this "meme" to me. ( In system dynamics and mathematics , there is second order systems and equations. My usage of "Second Order System" is to describe a particular phenomena which i have observed. Use this term with care to others. But, try to understand the message )
Imagine that you met a person who shares similar views. Obviously , there will be a drift towards each other. Then , both will meet and discuss about their common topics. Each of them , will give feedback to the other. If feedback is positive , then the utility of the system will go exponentially high and will overshoot . Since we are human beings , feedback can be correlated , symmetric , anti-symmetric and mixed to name a few. This is the cause of oscillations in the bond.
Another example for "second order system" is , your productivity will improve when you know that your productivity is measured. Stock market predictions , Pre-poll survey are other examples of second order systems.
While thinking about this , i searched the net and found an article by Jay Forrester , which is available @ http://sysdyn.clexchange.org/gsp98/papers/D-4731.pdf
Imagine that you met a person who shares similar views. Obviously , there will be a drift towards each other. Then , both will meet and discuss about their common topics. Each of them , will give feedback to the other. If feedback is positive , then the utility of the system will go exponentially high and will overshoot . Since we are human beings , feedback can be correlated , symmetric , anti-symmetric and mixed to name a few. This is the cause of oscillations in the bond.
Another example for "second order system" is , your productivity will improve when you know that your productivity is measured. Stock market predictions , Pre-poll survey are other examples of second order systems.
While thinking about this , i searched the net and found an article by Jay Forrester , which is available @ http://sysdyn.clexchange.org/gsp98/papers/D-4731.pdf
Labels:
Ways of Life
| Reactions: |
Politics of FOSS - a religious angle ?
Now a days , for some unknown reasons , people are militant about the language , tool and OS of their choice. I have noticed another curious pattern in this militancy, one that of faith. I am speaking from a anecdotal evidence point of view.
If you happen to hail from a group which practices monolithic faith and a techie , there is correlation with the strength of your advocacy . Another group , which is vehemently strong in their "belief" is leftists.
Since people from monolithic faiths + lefts are in a majority in Kerala, I speculate that , it is one of the reason , a lot of people think proprietary software should be banished. As per Indian ethos , good and bad are two sides of the same coin . So, both can co-exist. But, for some FOSS people , FOSS is the only true software development model.
I am not saying that every techie in kerala who belong to monolithic faith is a FOSS person.
What I am saying is
"IF you are militant about FOSS , you are either a believer of some monolithic faith or a leftie !"
If you happen to hail from a group which practices monolithic faith and a techie , there is correlation with the strength of your advocacy . Another group , which is vehemently strong in their "belief" is leftists.
Since people from monolithic faiths + lefts are in a majority in Kerala, I speculate that , it is one of the reason , a lot of people think proprietary software should be banished. As per Indian ethos , good and bad are two sides of the same coin . So, both can co-exist. But, for some FOSS people , FOSS is the only true software development model.
I am not saying that every techie in kerala who belong to monolithic faith is a FOSS person.
What I am saying is
"IF you are militant about FOSS , you are either a believer of some monolithic faith or a leftie !"
Labels:
Ways of Life
| Reactions: |
Monday, November 15, 2010
Speak , Talk , Watch ,Chat and Road Blocks - Learning without reading !
When we speak to some one , we find our own contradictions. When you talk , you get feedback about your speech. Watching movies and discovery channel , is a great source of learning . ( I watched DC after a long time )
When you chat , you get lot of information and you might understand your own shallow understanding of many a topics.
Chat has got one advantage over other forms , because , we are "confident" to acknowledge our lack of knowledge about something as person on the other side is remote . Or else , we acknowledge it to save our face for the future. ( Acknowledging ignorance about common knowledge , in front of a person is difficult ! )
Now , that the world has changed a lot and It is now , "How are we intelligent than How Intelligent we are ". More you speak , talk , watch and chat , better you will be.
Last , but not the least , Ponder about your activities of a day while commuting . I travel by Low floor bus in the morning ( 90 minutes of relaxed thinking ) and train by the evening ( I can wait at the railway station and do some thinking ) to do just that !
When you chat , you get lot of information and you might understand your own shallow understanding of many a topics.
Chat has got one advantage over other forms , because , we are "confident" to acknowledge our lack of knowledge about something as person on the other side is remote . Or else , we acknowledge it to save our face for the future. ( Acknowledging ignorance about common knowledge , in front of a person is difficult ! )
Now , that the world has changed a lot and It is now , "How are we intelligent than How Intelligent we are ". More you speak , talk , watch and chat , better you will be.
Last , but not the least , Ponder about your activities of a day while commuting . I travel by Low floor bus in the morning ( 90 minutes of relaxed thinking ) and train by the evening ( I can wait at the railway station and do some thinking ) to do just that !
Labels:
Ways of Life
| Reactions: |
"Neutrality" vitiates into taking a position
We as human beings , try to see ourselves as "neutral" person in most contentious debates. That itself is a position which ultimately favors one of the players in the extremes of the spectrum. Some times , our neutrality can help people in the opposing camp , where as in some other case , the mainstream stakeholders.
There are times , we might be having some information which might not hamper us ( as we have got that information ) , but it can turn the tide from one end of the spectrum to the other end. Should we react to maintain status quo ? It is a difficult question , but, I do remain nuetral and work for "win / win " situation.
A wild life photographer , should not enable escape of a animal from cheetah's clutches as it might jeopardize cheetah's survival. If you enable cheetah to hunt a deer , you are putting deer's life under risk.
Understand that , neutrality is a political position !
There are times , we might be having some information which might not hamper us ( as we have got that information ) , but it can turn the tide from one end of the spectrum to the other end. Should we react to maintain status quo ? It is a difficult question , but, I do remain nuetral and work for "win / win " situation.
A wild life photographer , should not enable escape of a animal from cheetah's clutches as it might jeopardize cheetah's survival. If you enable cheetah to hunt a deer , you are putting deer's life under risk.
Understand that , neutrality is a political position !
Labels:
Philosophy,
Ways of Life
| Reactions: |
A strategy to effectively study a discipline
Every Specialized branch of Knowledge has got a "Central Dogma" around which the methodologies , institutions , folklore and practice is co-ordinated. Since every theory starts out as a hypothesis , what happens is elaboration of Central dogma and how exceptions are to be watched for by carefully documenting those.
To make educated guess in those areas , we need to be aware about the above and try to "anchor" information recieved in that domain with the "Central Dogma" of the subject.
For Economics => It is Homo Economics ( Economic Agents are rational )
Stock Market => Market Capitalization vs Value of the Company ( Quest for equilibrium )
Modern Biology => Evolution by Natural selection
These are some of the core dogmas of the above subjects.
To make educated guess in those areas , we need to be aware about the above and try to "anchor" information recieved in that domain with the "Central Dogma" of the subject.
For Economics => It is Homo Economics ( Economic Agents are rational )
Stock Market => Market Capitalization vs Value of the Company ( Quest for equilibrium )
Modern Biology => Evolution by Natural selection
These are some of the core dogmas of the above subjects.
Labels:
Computer Programming,
Psychology
| Reactions: |
Sunday, November 14, 2010
Blender vs Maya - my thoughts
In the BarcampKerala 9 event , when a Open movie was screened shortly after a presentation on Blender (using Python ) Programming , the audience did understand that Blender is an animation tool worthy of a look. Even though I have heard about Blender a lot , my first professional Project with Blender was in the year 2006.
We (at Identity mine inc. ) were developing a demo for Nike with then nascent Windows Presentation Foundation . The tools in question were C# , Microsoft Expression and the model was created using Blender by a person who was reasonably comfortable with 3DS Max. The reason for choosing blender was the availability of a free pluggin to generate XAML files from Blender model.
At that time , the user interface was bit "quirky" . But , from a modeller perspective , it was a fully functional package. It is understandable as 3DS Max (from Autodesk ) and Maya (then from Alias , now from Autodesk ) has got two decades of evolution behind them.
Since our application was real time rendering one , we used a polygon "tweaker" to fit our polygon budget. Blender is good tool for modeling and rendering ( drop in renderer worked fine for us ) was pretty clear to me even then.
Now , the user interface is vastly improved and it has become a full fledged echo system with Compositing tools , Editing tools and it has moved to position itself as a Total Animation production system. The commerical offerings are more capable ( and more costly ) and none of them offer the set of tools in a single pack.
If you want to develop a production animation with short time frame , go for Maya and it's associated tools. Another advantage for Maya is the availability of people who know Maya and It has got a network of trained professionals with Autodesk Authorized training center.
If you want to develop an application with low budget , Blender outshines every one by a mile. Blender + GIMP can give most of the stuff you want
The way , I look at it is as follows . Blender , Maya and 3DS are basically modellers with support for texture mapping , Skins and bones for hierarchical animation etc. Hollywood movies are rendered using RenderMan API from pixar.
About the Blender gaming mode , I do not have much idea.
I am interested in Blender because It can help you understand the algorithms used to achieve the effects. It is a golden opportunity for artists to gain some technical skills regarding the internals of the tools which they are using. Software developers can learn more about Computer Graphics Programming , Ray Tracing/Ray Casting , Offline rendering , Hierarchical scene graph to name a few.
That is why , I vote for Blender ! . I would consider Maya as a Car and Blender as a boat. When I am in an island , Boat is more useful than a car.
We (at Identity mine inc. ) were developing a demo for Nike with then nascent Windows Presentation Foundation . The tools in question were C# , Microsoft Expression and the model was created using Blender by a person who was reasonably comfortable with 3DS Max. The reason for choosing blender was the availability of a free pluggin to generate XAML files from Blender model.
At that time , the user interface was bit "quirky" . But , from a modeller perspective , it was a fully functional package. It is understandable as 3DS Max (from Autodesk ) and Maya (then from Alias , now from Autodesk ) has got two decades of evolution behind them.
Since our application was real time rendering one , we used a polygon "tweaker" to fit our polygon budget. Blender is good tool for modeling and rendering ( drop in renderer worked fine for us ) was pretty clear to me even then.
Now , the user interface is vastly improved and it has become a full fledged echo system with Compositing tools , Editing tools and it has moved to position itself as a Total Animation production system. The commerical offerings are more capable ( and more costly ) and none of them offer the set of tools in a single pack.
If you want to develop a production animation with short time frame , go for Maya and it's associated tools. Another advantage for Maya is the availability of people who know Maya and It has got a network of trained professionals with Autodesk Authorized training center.
If you want to develop an application with low budget , Blender outshines every one by a mile. Blender + GIMP can give most of the stuff you want
The way , I look at it is as follows . Blender , Maya and 3DS are basically modellers with support for texture mapping , Skins and bones for hierarchical animation etc. Hollywood movies are rendered using RenderMan API from pixar.
About the Blender gaming mode , I do not have much idea.
I am interested in Blender because It can help you understand the algorithms used to achieve the effects. It is a golden opportunity for artists to gain some technical skills regarding the internals of the tools which they are using. Software developers can learn more about Computer Graphics Programming , Ray Tracing/Ray Casting , Offline rendering , Hierarchical scene graph to name a few.
That is why , I vote for Blender ! . I would consider Maya as a Car and Blender as a boat. When I am in an island , Boat is more useful than a car.
Labels:
Computer Graphics,
Computer Programming
| Reactions: |
Thursday, November 11, 2010
Desire , Reality and Challenge
Gauthama Budha said "Desire is the root cause of all evil ". Ya , he might be right. But,what is wrong in craving for something ? I assume , on the contrary , without Desires our world will be void.
Once we desire something , how we go on for the "hunt" or "farm" for the stuff is what really matters. This process serendipitously generates "evil" or "good" around. Our desires and the gap with the reality can at times cause confusion , frustration and all sorts of restlessness. It is like entering a "Chakravyooh" and do not have any clue how to come out. Once we are accustomed to the situation , we do not want to come out as well.
If you are a "lose averse" person , the game is not for you. Some times , you will be like a batsman scoring runs at a brisk pace in a match you might not ever win. Keep scoring is the mantra here.
Another option available is to chase for multiple desires at different front or gradated results in the same front and feel that ability to play itself is a boon. In such a scenario , we might end up "winning" something which we never thought possible. ( I have won things which I never craved for .once the victory is yours , we can retrofit a cause to tell tall tales ! )
Do what is needful in a situation , do not bother about favorable results , but , play like a winner. Then Desire is not bad as it seems.
Of course , remember the old adage , " For me , Journey itself is the reward. !"
Once we desire something , how we go on for the "hunt" or "farm" for the stuff is what really matters. This process serendipitously generates "evil" or "good" around. Our desires and the gap with the reality can at times cause confusion , frustration and all sorts of restlessness. It is like entering a "Chakravyooh" and do not have any clue how to come out. Once we are accustomed to the situation , we do not want to come out as well.
If you are a "lose averse" person , the game is not for you. Some times , you will be like a batsman scoring runs at a brisk pace in a match you might not ever win. Keep scoring is the mantra here.
Another option available is to chase for multiple desires at different front or gradated results in the same front and feel that ability to play itself is a boon. In such a scenario , we might end up "winning" something which we never thought possible. ( I have won things which I never craved for .once the victory is yours , we can retrofit a cause to tell tall tales ! )
Do what is needful in a situation , do not bother about favorable results , but , play like a winner. Then Desire is not bad as it seems.
Of course , remember the old adage , " For me , Journey itself is the reward. !"
Labels:
Ways of Life
| Reactions: |
Wednesday, November 10, 2010
Learn Smalltalk , for Fun and some probable profit !
Currently , I work with the Objective C for my day job and i was trying to do some reading about the intellectual lineage of the language. While chasing links , I stumbled upon
http://www.iam.unibe.ch/~ducasse/FreeBooks/ByExample/
http://www.iam.unibe.ch/~ducasse/FreeBooks/
http://www.iam.unibe.ch/~ducasse/FreeBooks/ByExample/
http://www.iam.unibe.ch/~ducasse/FreeBooks/
Labels:
MAC OS/iPhone development
| Reactions: |
A re-look at some mathematics
My brother-in-law is a Mechanical Engineer who works with Finite Element Analysis (FEA ) using Ansys. He is interested in learning the internals of the package.
He purchased a book written by one Mr. Reddy , who happens to be from Text A&M university ( The same univeresity where Bjarne stroustrup does teach ) . The book seems advanced for his (for that matter most people's ) taste.
While he was searching for the literature , I had a discussion on the subject with him. My exposure to Finite Element Modeling is through Radiosity Rendering . I have done some wrestling with Radiosity calculations in the past.
Then we discussed about Mathematical modeling , Linearity in Mathematics ( as FEA models are effective with Linear model ) , Matrix computations , Eigen Value Problems , Newton raphson's method , Quadrature , Monte carlo integration to name a few. While we were discussing the stuff , we searched for the stuff in the Wikipedia and other sources to augment our learning .
In the end , it was a productive discussion for more than two hours.
He purchased a book written by one Mr. Reddy , who happens to be from Text A&M university ( The same univeresity where Bjarne stroustrup does teach ) . The book seems advanced for his (for that matter most people's ) taste.
While he was searching for the literature , I had a discussion on the subject with him. My exposure to Finite Element Modeling is through Radiosity Rendering . I have done some wrestling with Radiosity calculations in the past.
Then we discussed about Mathematical modeling , Linearity in Mathematics ( as FEA models are effective with Linear model ) , Matrix computations , Eigen Value Problems , Newton raphson's method , Quadrature , Monte carlo integration to name a few. While we were discussing the stuff , we searched for the stuff in the Wikipedia and other sources to augment our learning .
In the end , it was a productive discussion for more than two hours.
Labels:
Mathematics,
Ways of Life
| Reactions: |
Tuesday, November 09, 2010
Product Engineering OutSourcing - a different kind of Outsourcing
Currently , I am actively involved in a software project where iPad is at the front end and .NET based tool chain is at the Backend.
The System in question is an application of a Application Service Provider (ASP ). ASPs are companies who develop their products and deliver it as service.
It is a rare opportunity and at the same time a challenge to engineer a system from "scratch" for an ASP. The ASP in question knows their requirement well.
The takeaways from this include
a ) Challenges in working with multiple tool chains ( Apple and Microsoft )
b ) Handling large file transfer using HTTP transport (Memory limit on Clients and Servers )
c ) Web Service Interoperability (you need to speak SOAP )
d ) Assymetric and Symmetric Encryption (RSA , AES )
e ) Handling Archives transferred as Zip bundle
f ) Overlay editing using Offscreen bitmap ( a good start for learning Vector/Raster graphics)
g ) Writing small footprint system using incremental pull (Throw away your desktop mentaility)
h ) The challenge of handling memory in a reference counted system.
i ) The Programming model assymetry ( Fine grained vs Coarse Grain API )
k) Mixed Language Programming ( C , C++ , Objective C/C++ , C#/Mono )
l ) Rendering images on to a PDF document for the printer output.
m) a file based database system (on the client ) vs a RDBMS ( on the server )
n) Large scale XML file manipulation using SAX based parser.
o) Bulk data Synchronization (Transparent )
p) Off line mode for an online application (Sizeable code for state maintenance)
q) Design of an extensible Pluggin mechanism
r) Writing extensions for Web servers ( ASP.net module )
s) Workflow management constrained by Business policy
t) UX challenges
u) Design of stateless application specific handlers for Object pooling
These are some of the key "take-aways" for my team. I consider myself to be fortunate to be part of this process , I hope my team members share the excitement.
This blog post is a result of an observation by a person (whom i know). "Here , People do not write code from scratch ". He has contempt for outsourcing business model ( which has been a social boon ) . Some projects are really interesting and the participants can gain a lot regardless of their age , experience and gender !
The System in question is an application of a Application Service Provider (ASP ). ASPs are companies who develop their products and deliver it as service.
It is a rare opportunity and at the same time a challenge to engineer a system from "scratch" for an ASP. The ASP in question knows their requirement well.
The takeaways from this include
a ) Challenges in working with multiple tool chains ( Apple and Microsoft )
b ) Handling large file transfer using HTTP transport (Memory limit on Clients and Servers )
c ) Web Service Interoperability (you need to speak SOAP )
d ) Assymetric and Symmetric Encryption (RSA , AES )
e ) Handling Archives transferred as Zip bundle
f ) Overlay editing using Offscreen bitmap ( a good start for learning Vector/Raster graphics)
g ) Writing small footprint system using incremental pull (Throw away your desktop mentaility)
h ) The challenge of handling memory in a reference counted system.
i ) The Programming model assymetry ( Fine grained vs Coarse Grain API )
k) Mixed Language Programming ( C , C++ , Objective C/C++ , C#/Mono )
l ) Rendering images on to a PDF document for the printer output.
m) a file based database system (on the client ) vs a RDBMS ( on the server )
n) Large scale XML file manipulation using SAX based parser.
o) Bulk data Synchronization (Transparent )
p) Off line mode for an online application (Sizeable code for state maintenance)
q) Design of an extensible Pluggin mechanism
r) Writing extensions for Web servers ( ASP.net module )
s) Workflow management constrained by Business policy
t) UX challenges
u) Design of stateless application specific handlers for Object pooling
These are some of the key "take-aways" for my team. I consider myself to be fortunate to be part of this process , I hope my team members share the excitement.
This blog post is a result of an observation by a person (whom i know). "Here , People do not write code from scratch ". He has contempt for outsourcing business model ( which has been a social boon ) . Some projects are really interesting and the participants can gain a lot regardless of their age , experience and gender !
| Reactions: |
Wordings are important - to avoid Framing Bias
The Way you frame the question is the single biggest determinant in getting the correct answer. Human beings are notorious for asking the questions so that the respondent is forced to answer the question in a bivalent ( Yes or No ) manner. Where as there is shades of gray between Black ( No ) and White (Yes ), some are constrained to answer the stuff in that manner.
Take couple of instances
1 ) George Bush => "Either your with us , or You are with the Terrorists "
The above statement created lot of trouble to people to balance between the political correctness and pragmatism.
2) "We are Developing an ERP " => SAP ?
To avoid the above , the (probable ) statement should have been , " We are developing a integrated Business solution !"
3) "It is a presentation system " => PowerPoint ?
The probable statement should have been , "We are developing a system where images are to shown as slides"
Even though the above stuff are not interrogative statements , the respondents are framed to view the stuff in a particular way.
The other day , my friend was interrogated by a lawyer to get a particular answer. His command over the English language saved the day. The "correct" answer for the context is "arrangement". The lawyer was trying to get "agreement" out of his mouth.
Next time , use the words carefully !
Take couple of instances
1 ) George Bush => "Either your with us , or You are with the Terrorists "
The above statement created lot of trouble to people to balance between the political correctness and pragmatism.
2) "We are Developing an ERP " => SAP ?
To avoid the above , the (probable ) statement should have been , " We are developing a integrated Business solution !"
3) "It is a presentation system " => PowerPoint ?
The probable statement should have been , "We are developing a system where images are to shown as slides"
Even though the above stuff are not interrogative statements , the respondents are framed to view the stuff in a particular way.
The other day , my friend was interrogated by a lawyer to get a particular answer. His command over the English language saved the day. The "correct" answer for the context is "arrangement". The lawyer was trying to get "agreement" out of his mouth.
Next time , use the words carefully !
Labels:
Ways of Life
| Reactions: |
Monday, November 08, 2010
Cherry Picking , Confirmation Bias , Hostile Media Effect - That is a human for you
Today , I happen to come across a term Cherry Picking . This is a term for a phenomena which is observed all around us and every one indulges in it.
Cherry picking is the act of pointing at individual cases or data that seem to confirm a particular position, while ignoring a significant portion of related cases or data that may contradict that position
Confirmation bias (also called confirmatory bias or myside bias) is a tendency for people to favor information that confirms their preconceptions or hypothesis regardless of whether the information is true
These are essential tools for our survival. So , Hell with the Objectivity. I think , Some kind of evolutionary pressure due to the economic constraints can bring Objectivity on the Planet.
Cherry picking is the act of pointing at individual cases or data that seem to confirm a particular position, while ignoring a significant portion of related cases or data that may contradict that position
Confirmation bias (also called confirmatory bias or myside bias) is a tendency for people to favor information that confirms their preconceptions or hypothesis regardless of whether the information is true
These are essential tools for our survival. So , Hell with the Objectivity. I think , Some kind of evolutionary pressure due to the economic constraints can bring Objectivity on the Planet.
Labels:
Ways of Life
| Reactions: |
Sunday, November 07, 2010
Constraints , Development of Feature , Periodic re-factoring ! - Secret of shipping software ?
For Software projects to succeed , the stakeholders and other leaders should make their hands dirty to set some kind of boundary around developers.
Splitting the development into static or dynamic libraries based on some functional blocks is an obvious one. Have some constraints on Object instantiation ( Factory pattern ) , some template for Class implementation and wrappers for Platform specific code etc are what I meant by constraint. In a non - garbage collected language , static methods are a boon . Static methods with computational closure , is a great tool in such scenario. Forget about , Object Oriented Purity , if Procedural programming helps , go for it. One reason Microsoft .net is a nice platform to work is because they understand the value of Procedural programming using FAT interfaces.
The Application developers will be focused on functionality and asking them to take care of this , is a balancing act. But , Implicit requirements ( aka cross cutting concerns ) can be met by some transparent means to have some kind of sanity in the application code.
This might produce a working system.
Splitting the development into static or dynamic libraries based on some functional blocks is an obvious one. Have some constraints on Object instantiation ( Factory pattern ) , some template for Class implementation and wrappers for Platform specific code etc are what I meant by constraint. In a non - garbage collected language , static methods are a boon . Static methods with computational closure , is a great tool in such scenario. Forget about , Object Oriented Purity , if Procedural programming helps , go for it. One reason Microsoft .net is a nice platform to work is because they understand the value of Procedural programming using FAT interfaces.
The Application developers will be focused on functionality and asking them to take care of this , is a balancing act. But , Implicit requirements ( aka cross cutting concerns ) can be met by some transparent means to have some kind of sanity in the application code.
This might produce a working system.
Labels:
Computer Programming,
Software (General)
| Reactions: |
A different kind of deadline !
For the last two days , I am busy re-factoring lot of Objective C code to avoid memory leaks. Currently , I am trying to fix some bugs which has crept into the code when I corrected anomalies on one side .
I need to fix them before tomorrow 9.00 am , so that the code re-factored can be used to baseline for further development. Currently , I am like Abhimanyu in a "Chakravyooh".
I need to fix them before tomorrow 9.00 am , so that the code re-factored can be used to baseline for further development. Currently , I am like Abhimanyu in a "Chakravyooh".
| Reactions: |
Saturday, November 06, 2010
Do not go to the University to study Computer Science - ??!!!
Read this fascinating blog (I do not agree with him ) entry @ http://sheddingbikes.com/posts/1275258018.html .
One paragraph caught my attention though
"Right now, you have the culture of a teenager who went to High School. This means you have about as much culture as a TV dinner. Your entire world has been this horribly inaccurate model of the real world where you were basically trained to be a good little factory worker. You were told to leave at a bell, come to school on time, eat at a certain time, sit in your desk, don't be creative, shut up, and you think there's really a permanent record."
There is some point in changing the educational structure. Any mainstream alternative available ? Will you risk something which you are familiar and go to uncharted waters ?
I think , Mass education should be routine based and discipline oriented so that maximum number of people can benifit from them. Stressing Excellence is a crime at early stage !.
One paragraph caught my attention though
"Right now, you have the culture of a teenager who went to High School. This means you have about as much culture as a TV dinner. Your entire world has been this horribly inaccurate model of the real world where you were basically trained to be a good little factory worker. You were told to leave at a bell, come to school on time, eat at a certain time, sit in your desk, don't be creative, shut up, and you think there's really a permanent record."
There is some point in changing the educational structure. Any mainstream alternative available ? Will you risk something which you are familiar and go to uncharted waters ?
I think , Mass education should be routine based and discipline oriented so that maximum number of people can benifit from them. Stressing Excellence is a crime at early stage !.
Labels:
Ways of Life
| Reactions: |
Friday, November 05, 2010
Uncle Sam's Country and Lousy Programmers
"Reliable and transparent programs are usually not in the interest of the designer"
- Niklaus Wirth
The above statement has got some correlation with a phenomena which all of you might be familiar. If you like my blog for some reason , the probability of you having come across this is unusuallly high.
Let us accept a fact
"If you have not been to America , You are not a competant programmer !"
Now , the cardinality ( count ) of your visits has become the benchmark.
"If you are working for a company in India and has gone to US more than your neighbhours , statistical probability of you being a competant programmer is rather low".
- Praseed Pai , Circa , 2010
If you are competant , you will write readable , maintainable code (relatively ). Chances of bugs will be comparitively low and most testers can find bugs in your code. If you do not know much about what is happening and why it is happening , there is potential that your code will be unreadable , unmaintainable and full of bugs. Only , a lousy programmer can fix his bugs.
Before , finishing the UAT , Clients will ask you to come there (America or Europe ) to give final touches to your code.
I have seen this happening and some of my friends have reported this.
If you do not have much clue about what is happening , you will have more material rewards. Who said Ignorance is bliss ? It is business as well.
- Niklaus Wirth
The above statement has got some correlation with a phenomena which all of you might be familiar. If you like my blog for some reason , the probability of you having come across this is unusuallly high.
Let us accept a fact
"If you have not been to America , You are not a competant programmer !"
Now , the cardinality ( count ) of your visits has become the benchmark.
"If you are working for a company in India and has gone to US more than your neighbhours , statistical probability of you being a competant programmer is rather low".
- Praseed Pai , Circa , 2010
If you are competant , you will write readable , maintainable code (relatively ). Chances of bugs will be comparitively low and most testers can find bugs in your code. If you do not know much about what is happening and why it is happening , there is potential that your code will be unreadable , unmaintainable and full of bugs. Only , a lousy programmer can fix his bugs.
Before , finishing the UAT , Clients will ask you to come there (America or Europe ) to give final touches to your code.
I have seen this happening and some of my friends have reported this.
If you do not have much clue about what is happening , you will have more material rewards. Who said Ignorance is bliss ? It is business as well.
Labels:
Computer Programming,
Ways of Life
| Reactions: |
Search for strategies to speed up malloc ( a good article !)
The C run time library function malloc need not be the fastest way to allocate memory. These general purpose allocators are slow because it is not context aware. Some times , we might have the knowledge of the chunk size of the allocation before hand. Such , things cannot be optimized etc.
The glibc has got some hooks which we can customize the behavior. Too often people write psuedo mallocs.
While researching on this , I stumbled upon a page which will give you a good idea about the issues involved.
http://www.ibm.com/developerworks/linux/library/l-memory/?ca=dgr-lnxw16InsideMe
The glibc has got some hooks which we can customize the behavior. Too often people write psuedo mallocs.
While researching on this , I stumbled upon a page which will give you a good idea about the issues involved.
http://www.ibm.com/developerworks/linux/library/l-memory/?ca=dgr-lnxw16InsideMe
Labels:
C/C++,
Computer Programming
| Reactions: |
static dynamic in C# 4.0 ( Just kidding !)
Just now , when i get bored , I typed the following stuff
This works under Mono 2.8 !. It will definitely work under MS .net !
////////////////////////
//test.cs
//
// A C# program to demonstrate "static dynamic"
//
// using Mono
//
// dmcs test.cs
// mono test.exe
//
//
using System;
using System.Dynamic;
public class Test
{
static dynamic OxyMoron( int s ) {
if ( s > 0 )
return "Vatta Poojyam";
else
return 1;
}
public static void Main() {
Console.WriteLine(OxyMoron(-1));
Console.WriteLine(OxyMoron(15));
}
}This works under Mono 2.8 !. It will definitely work under MS .net !
Labels:
Software(.NET)
| Reactions: |
If you learn to loose , victory might be yours
à´Žà´™്ങനെ à´¤ോà´²്à´•ാà´¨് പഠിà´•്à´•ാം à´Žà´¨്à´¨് പടിà´ªിà´•്à´•ുà´¨്à´¨ à´¸്à´¥ാപനം à´žാà´¨് à´°ൂപകല്പന
à´šെà´¯്à´¤ു à´•ൊà´£്à´Ÿിà´°ിà´•്à´•ുà´•à´¯ാà´£് . à´¤ാà´²്പര്à´¯ം ഉണ്à´Ÿെà´™്à´•ിà´²് ബന്à´§à´ªെà´Ÿുà´• !.
Serendipitously , I learned to write Malayalam Blog entry.
à´šെà´¯്à´¤ു à´•ൊà´£്à´Ÿിà´°ിà´•്à´•ുà´•à´¯ാà´£് . à´¤ാà´²്പര്à´¯ം ഉണ്à´Ÿെà´™്à´•ിà´²് ബന്à´§à´ªെà´Ÿുà´• !.
Serendipitously , I learned to write Malayalam Blog entry.
Labels:
Ways of Life
| Reactions: |
It's Diwali and Crackers are bursting all around me ..!
Today Is Diwali and Kids are having a good time in my locality. Ten meters away from me it is sparklers galore on the adjacent terrace . My son is heard screaming some fifty meters away .
Since , My family is into the business of selling crackers , there is no shortage of sparklers , crackers and ground chakkars.
Since GSBs ( aka Konkanis ) celebrate Diwali ( Deepavali ! ) , In our locality , It is a great festival.
Among the native mallus , this is celebrated in Kollam and Trivandrum Districts. To the north , it is Vishu which is celebrated more . Palghat and Kasargod is an exception. Palghat, because of proximity to Tamil Nadu and Kasargod , because of proximity to Karnataka.
Yet another Diwali is about to finish in my life.
Since , My family is into the business of selling crackers , there is no shortage of sparklers , crackers and ground chakkars.
Since GSBs ( aka Konkanis ) celebrate Diwali ( Deepavali ! ) , In our locality , It is a great festival.
Among the native mallus , this is celebrated in Kollam and Trivandrum Districts. To the north , it is Vishu which is celebrated more . Palghat and Kasargod is an exception. Palghat, because of proximity to Tamil Nadu and Kasargod , because of proximity to Karnataka.
Yet another Diwali is about to finish in my life.
Labels:
Ways of Life
| Reactions: |
Rules are re-written by people who follow it - a Paradox
I was discussing with a friend of mine about certain "rules" in life , which is hard to re-write. Any one who has ventured to rewrite those endup falling for that.
It dawned on to me that most rules are re-written by people who "religiously" follow the rules and fail at it !. I think , it is a Paradoxical situation.
It dawned on to me that most rules are re-written by people who "religiously" follow the rules and fail at it !. I think , it is a Paradoxical situation.
Labels:
Ways of Life
| Reactions: |
Marriage - Is it the revenge of Ladies ?!
A Lady happen to read my Wife Song . She did like the song , but had a question for me . If a man looses his spirit by complying to his wife , then what about the counterpart's spirit which is being killed in the first few days of marraige ?
She was of the opinion that every marriage the saga is same and she suspects that Women take revenge in a silent manner. The Biggest weapon for her is his (man's ) kids !.
After stepping back a bit , I suspect , there is some wisdom in her words !
She was of the opinion that every marriage the saga is same and she suspects that Women take revenge in a silent manner. The Biggest weapon for her is his (man's ) kids !.
After stepping back a bit , I suspect , there is some wisdom in her words !
Labels:
Psychology,
Ways of Life
| Reactions: |
Thursday, November 04, 2010
Bangalore is the new "Dharavi" ( aka Software "Slum" for Keralites ! )
One person whom I know made a remark about some phenomena which I am reasonably familiar with. He started with a movie analogy !
In some Malayalam movies , the Hero starts life as nothing in a rural settings. Due to pressures of survival , goes to Mumbai and tries to start from a clean state. The obvious place for him to land is Dharavi ( Asia's Largest Slum ) and our Hero has to thrash some goons there to have a foothold there. Then , the return of the Hero to his homeland is a inevitable "accident" towards the Climax.
Movies do influence us in all sorts of ways
According to him , Whenever a Software Professional struggles for existence , he tries to start from scratch in Bangalore. After some "heroics" there , the fellow returns to his homeland to "settle" somewhere.
His implication was that , nothing much happens on the ground. Since the origin of musings is from a Enterpruener , I did take note of it !
Beware , People do understand what is happening in Software Industry
In some Malayalam movies , the Hero starts life as nothing in a rural settings. Due to pressures of survival , goes to Mumbai and tries to start from a clean state. The obvious place for him to land is Dharavi ( Asia's Largest Slum ) and our Hero has to thrash some goons there to have a foothold there. Then , the return of the Hero to his homeland is a inevitable "accident" towards the Climax.
Movies do influence us in all sorts of ways
According to him , Whenever a Software Professional struggles for existence , he tries to start from scratch in Bangalore. After some "heroics" there , the fellow returns to his homeland to "settle" somewhere.
His implication was that , nothing much happens on the ground. Since the origin of musings is from a Enterpruener , I did take note of it !
Beware , People do understand what is happening in Software Industry
Labels:
Software (General),
Ways of Life
| Reactions: |
Wednesday, November 03, 2010
FOSS User Groups - a Political Movement ?
Every Political Movement is a brain child of some leaders who has seen an opportunity to form an Institution around the state of affairs and a group's perceived "promised" land.
As the time proceeds , even if the state of affairs change, the political institution will stay back by finding additional gaps !. Or else , without loosing momentum the institution have to change colors !. It slowly and steadily becomes a tool for some group which happens to be at the top and their inner coteries.
Let us take the example of Free and Open Source Software Groups in Kerala. Most of them started as Linux User Groups , when Linux made it's critical mass appearance in the PC quest CD. It was a natural tendency of it's users to club together to learn about the nascent Operating System. Once the novelty is gone , then the problem associated with any institution crops up there ( for that matter in every technology user group ). Then , the group began to balkanize.
People who learned from initial user groups gained tangible benefit by becoming System Administrators of Big Corporates and some initial set of people did get some development jobs.
Now these groups cannot survive by branding them as LUGs. Now , Linux Knowledge has spread far and wide that , these places won't attract crowds. Someone had an Idea to Widen the horizon by converting the stuff into a so called broad based movement. Then these people began to find a cause for the masses. The talks about Software Licensing with special emphasis on "freedom" was a device invented by them.
Freedom is not a word , It is a Phenomena. We cannot ever understand freedom , because your freedom is not my freedom. One hundred percent Chaos ensured !.
The closest analogy is Life , a phenomena where religious and not so religious leaders have not yet finished interpreting even after having studied it for thousands of years. Christians still study Bible , Muslims try to Under stand
Quran and Million dollar businesses are build around different belief systems to
teach what Life is all about.
Free Software with special emphasis on Licensing ( a never ending topic ! ...you can talk about it for hours , the speaker and audience has got the potential to get confused ) is really hot and it will remain the same for another thousand years !
Then Lawyers , Social activists , Professors ( who does not know to program !) , Politicians , Retired Scientists began to come to the fore to alert Keralites that
they are under risk. They were rewarded by getting speaking assignments , workshops etc .
A group in Kerala, imported a term called "Libre" and the name of the group still remains ILUG. Formerly , It was Indian Linux User Group. Now , It has become Indian Libre User Group. A change of spirit without changing the acronym. What a brilliant idea , Sirji !. The Guy is not a programmer , for sure.
I have visited forums and has gone to these user group meetings , Discussion on software development never (!) happens there.
Lot of youngsters do join these groups and they are getting "corrupted" by these Licensing talks and hate speech against Microsoft , Apple etc. Unfortunately, Tools from Microsoft and Apple are being used to develop lot of software in Kerala. To make a living these , youngsters have to re-evaluate their belief system ( which seldom happens ) to be productive in a Microsoft shop or Apple shop. The Poor stakeholders , Project Managers and other team leads !. They have got members in their team who believes that the tool which they use on a daily basis are evil .
As the time proceeds , even if the state of affairs change, the political institution will stay back by finding additional gaps !. Or else , without loosing momentum the institution have to change colors !. It slowly and steadily becomes a tool for some group which happens to be at the top and their inner coteries.
Let us take the example of Free and Open Source Software Groups in Kerala. Most of them started as Linux User Groups , when Linux made it's critical mass appearance in the PC quest CD. It was a natural tendency of it's users to club together to learn about the nascent Operating System. Once the novelty is gone , then the problem associated with any institution crops up there ( for that matter in every technology user group ). Then , the group began to balkanize.
People who learned from initial user groups gained tangible benefit by becoming System Administrators of Big Corporates and some initial set of people did get some development jobs.
Now these groups cannot survive by branding them as LUGs. Now , Linux Knowledge has spread far and wide that , these places won't attract crowds. Someone had an Idea to Widen the horizon by converting the stuff into a so called broad based movement. Then these people began to find a cause for the masses. The talks about Software Licensing with special emphasis on "freedom" was a device invented by them.
Freedom is not a word , It is a Phenomena. We cannot ever understand freedom , because your freedom is not my freedom. One hundred percent Chaos ensured !.
The closest analogy is Life , a phenomena where religious and not so religious leaders have not yet finished interpreting even after having studied it for thousands of years. Christians still study Bible , Muslims try to Under stand
Quran and Million dollar businesses are build around different belief systems to
teach what Life is all about.
Free Software with special emphasis on Licensing ( a never ending topic ! ...you can talk about it for hours , the speaker and audience has got the potential to get confused ) is really hot and it will remain the same for another thousand years !
Then Lawyers , Social activists , Professors ( who does not know to program !) , Politicians , Retired Scientists began to come to the fore to alert Keralites that
they are under risk. They were rewarded by getting speaking assignments , workshops etc .
A group in Kerala, imported a term called "Libre" and the name of the group still remains ILUG. Formerly , It was Indian Linux User Group. Now , It has become Indian Libre User Group. A change of spirit without changing the acronym. What a brilliant idea , Sirji !. The Guy is not a programmer , for sure.
I have visited forums and has gone to these user group meetings , Discussion on software development never (!) happens there.
Lot of youngsters do join these groups and they are getting "corrupted" by these Licensing talks and hate speech against Microsoft , Apple etc. Unfortunately, Tools from Microsoft and Apple are being used to develop lot of software in Kerala. To make a living these , youngsters have to re-evaluate their belief system ( which seldom happens ) to be productive in a Microsoft shop or Apple shop. The Poor stakeholders , Project Managers and other team leads !. They have got members in their team who believes that the tool which they use on a daily basis are evil .
Labels:
Computer Programming,
Kerala,
Ways of Life
| Reactions: |
An eventful journey back home !
Now a days , I get out of the office around 7.45 pm and catch a bus to Aluva. I Prefer to travel by Thiru Kochi from Thevara to Aluva. As usual , I and Sreejith ( a colleague of mine ) boarded the bus by walking some distance.
He did not close the door as he expected people to board a standing bus. The Conductor , in a resentful manner asked my colleague to close the door .
After Padma Junction , there was a minor collision with a car in which the rear mirror of the car got broken. The car driver stopped the bus at the junction where MG road meet Banerjee road. The verbal battle went on for some ten minutes between the driver of the car , passengers (including me ! ) and the driver of bus. Finally , Police man arrived on the scene and luckily all of us could board on to the next bus without a new ticket.
As I was about to disembark , the conductor denied knowledge of any bus stop in that area. I did tell him that the bus stop is around 50+ years. With hesitation , he rang the bell and I could get down at the place.
One passenger in the bus made a "sarcastic" remark that there is no bus stop there. I got pissed off and verbally abused him. I think the poor chap might have got more than what he had asked for.
He did not close the door as he expected people to board a standing bus. The Conductor , in a resentful manner asked my colleague to close the door .
After Padma Junction , there was a minor collision with a car in which the rear mirror of the car got broken. The car driver stopped the bus at the junction where MG road meet Banerjee road. The verbal battle went on for some ten minutes between the driver of the car , passengers (including me ! ) and the driver of bus. Finally , Police man arrived on the scene and luckily all of us could board on to the next bus without a new ticket.
As I was about to disembark , the conductor denied knowledge of any bus stop in that area. I did tell him that the bus stop is around 50+ years. With hesitation , he rang the bell and I could get down at the place.
One passenger in the bus made a "sarcastic" remark that there is no bus stop there. I got pissed off and verbally abused him. I think the poor chap might have got more than what he had asked for.
Labels:
Ways of Life
| Reactions: |
Platform Interoperability is hard !
When we write applications which uses Web as a transport with Client and Server being implemented on different Hardware/Software platforms/ Technology stack , we need to struggle with the API tyranny of at least one platform.
Microsoft Corporation gives big FAT interfaces for most of the stuff like Base64 , Symmetric/Assymetric Cryptography , Message Digests , Authentication etc . Where as apple gives you fine grained access where it is not necessary in the usual use case.
The Programmers on the Apple side will be on the recieving end because of the nature of API.
Microsoft Corporation gives big FAT interfaces for most of the stuff like Base64 , Symmetric/Assymetric Cryptography , Message Digests , Authentication etc . Where as apple gives you fine grained access where it is not necessary in the usual use case.
The Programmers on the Apple side will be on the recieving end because of the nature of API.
| Reactions: |
Tuesday, November 02, 2010
I Listen , Therefore I am ( Confused ! ?)
Of late , I have been listening to lot of individuals (over the phone) regarding their views about Technology , Life , Career , Entertainment, to name a new. After subtracting their probable bias and my state of mind , I try to take the essence and will have a feeling that there is some understanding about it.
But , In most of the situation , there is something more than I ever imagined. Now , a days , I understand that other than technical facts , none of the knowledge through grapevine is useful. Some times , with our hindsight bias , we weave patterns through haphazard events. This is fallacious.
Not only Analysis , Some times listening to others can lead to paralysis !.
May be Listen , Analysis and Paralysis is a cycle a system with feedback to protect itself.
I am writing this after a 40 minute conversation with my friend on various things.
But , In most of the situation , there is something more than I ever imagined. Now , a days , I understand that other than technical facts , none of the knowledge through grapevine is useful. Some times , with our hindsight bias , we weave patterns through haphazard events. This is fallacious.
Not only Analysis , Some times listening to others can lead to paralysis !.
May be Listen , Analysis and Paralysis is a cycle a system with feedback to protect itself.
I am writing this after a 40 minute conversation with my friend on various things.
Labels:
Ways of Life
| Reactions: |
Regular Expression Interpreter - Unix to C# and back !
I encountered the term "Regular Expression" from Allen Holub's "Compiler Design in C" book. He described it in a semi-formal way and in fact , he also shows how to implement a clone of unix lex ( yacc and LR(1) parser generators ) utility.
On the ground , I saw application of regular expression with Grep utility ( SCO Unix ) and I did play with Lex utility to learn how to re-implement Robe Pike's Higher Order Calculator ( from the book "Unix Programming Environment" ) . I had a name called HOC for Windows NT.
For a reporting engine , I wrote a regular expression interpreter based on the code from "Practical Algorithms for programmers" ( Andrew Binstock and Rex Black ). This along with exposure to Perl , helped me to understand how to manipulate it.
Still , One thing was bothering me. I did not understand how Regular Expressions and Finite State Machines are related to mathematical formalism of regular grammar.
I also learned about the Closure property of Regular expressions. This gave me even more enthusiasm to crack it.
In the year 2000 , I stumbled upon Prof. Craig Rich's "Generic Interpreter Project" . It was java and it contained a Regular Interpreter with ERE ( Extended Regular Expression support ). I took print out of Lexicon.java module and began to sit with for hours at a stretch.
Re-implementing that in C/C++ was my next project. I dropped the project couple of times without making much progress. C/C++ did not have automatic garbage collection.
This convinced me that Garbage Collection is not bad. ( Reading Java code is easier than C/C++ code as well )
In the mean time , I used Flex/Yacc , PCCTS (Antlr ) and other tools to write Source code converters , Compilers, Dynamic Compilers and Interpreters. These were not great examples of Industrial strength Compilers. It worked fine in my context. By this time , I knew how to manipulate regular expressions !
Still , at the back of the mind , Regular Expression Implementation based on theoretical foundation of Regular grammar was always there.
After encountering C# (1.1), In the year 2003, finally, I decided to nail it. I ported the Lexicon.Java to C# by understanding it !. ( Andrew Appel's Modern Compiler Implementation In Java helped me in this ). Based on the effort , I took a session at Cochin Microsoft user Group by the title , "Regular Expressions - usage , mathematics and Implementation". The session was well appreciated.
I lost the source code when my hard disk crashed and luckily I had sent the source code to a friend of mine via email. Today , Accidentally , I retrieved it from my mailbox . ( I was searching for a old .cs file ! ).
A classic case of Serendipity !
Tentative plans are to write a e-book on the implementation in a step by step format. I will open source the project as STRIP4.net ( Stupid Regular expression Interpreter Program !) when the e-book is finished ( I have to finish SPAM4.net before embarking on this )
On the ground , I saw application of regular expression with Grep utility ( SCO Unix ) and I did play with Lex utility to learn how to re-implement Robe Pike's Higher Order Calculator ( from the book "Unix Programming Environment" ) . I had a name called HOC for Windows NT.
For a reporting engine , I wrote a regular expression interpreter based on the code from "Practical Algorithms for programmers" ( Andrew Binstock and Rex Black ). This along with exposure to Perl , helped me to understand how to manipulate it.
Still , One thing was bothering me. I did not understand how Regular Expressions and Finite State Machines are related to mathematical formalism of regular grammar.
I also learned about the Closure property of Regular expressions. This gave me even more enthusiasm to crack it.
In the year 2000 , I stumbled upon Prof. Craig Rich's "Generic Interpreter Project" . It was java and it contained a Regular Interpreter with ERE ( Extended Regular Expression support ). I took print out of Lexicon.java module and began to sit with for hours at a stretch.
Re-implementing that in C/C++ was my next project. I dropped the project couple of times without making much progress. C/C++ did not have automatic garbage collection.
This convinced me that Garbage Collection is not bad. ( Reading Java code is easier than C/C++ code as well )
In the mean time , I used Flex/Yacc , PCCTS (Antlr ) and other tools to write Source code converters , Compilers, Dynamic Compilers and Interpreters. These were not great examples of Industrial strength Compilers. It worked fine in my context. By this time , I knew how to manipulate regular expressions !
Still , at the back of the mind , Regular Expression Implementation based on theoretical foundation of Regular grammar was always there.
After encountering C# (1.1), In the year 2003, finally, I decided to nail it. I ported the Lexicon.Java to C# by understanding it !. ( Andrew Appel's Modern Compiler Implementation In Java helped me in this ). Based on the effort , I took a session at Cochin Microsoft user Group by the title , "Regular Expressions - usage , mathematics and Implementation". The session was well appreciated.
I lost the source code when my hard disk crashed and luckily I had sent the source code to a friend of mine via email. Today , Accidentally , I retrieved it from my mailbox . ( I was searching for a old .cs file ! ).
A classic case of Serendipity !
Tentative plans are to write a e-book on the implementation in a step by step format. I will open source the project as STRIP4.net ( Stupid Regular expression Interpreter Program !) when the e-book is finished ( I have to finish SPAM4.net before embarking on this )
Labels:
Computer Programming,
Software(.NET)
| Reactions: |
Monday, November 01, 2010
Design Patterns using C#/Mono - Part 2
In this part , we will talk about Template method pattern.
This is what Wikipidea states about this ...
A template method defines the program skeleton of an algorithm. One or more of the algorithm steps are able to be overridden by subclasses to provide their own concrete implementation. This allows differing behaviors while ensuring that the overarching algorithm is still followed.
The source code given below will clarify the details for you
In the above code , DoLog is our template method. The Logging algorithm is customized by the concrete classes. This example uses Factory method pattern as well. Factory method pattern is used to instantiate the logger.
This is what Wikipidea states about this ...
A template method defines the program skeleton of an algorithm. One or more of the algorithm steps are able to be overridden by subclasses to provide their own concrete implementation. This allows differing behaviors while ensuring that the overarching algorithm is still followed.
The source code given below will clarify the details for you
//////////////////////
//
// TemplateMethod.cs
//
// Written by Praseed Pai K.t.
// http://praseedp.blogspot.com
//
//
// gmcs TemplateMethod.cs -r:System.dll
// mono TemplateMethod.exe
//
using System;
////////////////////////////////
//
// Declare a Logger class ...with one abstract method
// DoLog
//
// DoLog is our template method...
//
public abstract class Logger {
/////////////////////////////
//
// Concrete classes will override this
protected abstract bool DoLog( String logitem );
///////////////////////////////////////////
//
// public API
public bool Log( String app , String key , String cause ) {
return DoLog( app + " " + key + " " + cause );
}
}
//////////////////////////////////////
//
// DbLogger will log to the Database...!
//
// This will override the template method !
public class DbLogger : Logger
{
protected override bool DoLog( String logitem ) {
// Log into the DB
Console.WriteLine( "DB Log " + logitem );
return true;
}
}
//////////////////////////////////////////////
// FileLogger will log into the Disk File...
//
//
//
public class FileLogger : Logger
{
protected override bool DoLog( String logitem ) {
// Log into the File
Console.WriteLine( "File Log " + logitem );
return true;
}
}
/////////////////////////////
//
// NullLogger is a NOP logger....
//
public class NullLogger : Logger
{
protected override bool DoLog( String logitem ) {
// Log into the File
Console.WriteLine( "Ignoring the log...!" );
return true;
}
}
//////////////////////////////////////////
//
// Create a Factory method to instantiate the Logger....!
//
// LoggerFactory can be singleton...
//
public class LoggerFactory {
public static Logger CreateLogger( string loggertype ) {
if ( loggertype == "DB" )
return new DbLogger();
else if ( loggertype == "FILE" )
return new FileLogger();
else
return new NullLogger();
}
}
//////////////////////////////////////////////
//
// EntryPoint ...!
//
//
public class Caller
{
public static void Main( String[] s ) {
Logger l = LoggerFactory.CreateLogger("FILE");
l.Log("MyApp" , "SEVERITY" ,"NOTHIN SERIOUS");
l = LoggerFactory.CreateLogger("DB");
l.Log("MyApp" , "SEVERITY TO DB " ,"NOTHIN SERIOUS");
}
}In the above code , DoLog is our template method. The Logging algorithm is customized by the concrete classes. This example uses Factory method pattern as well. Factory method pattern is used to instantiate the logger.
Labels:
Mono,
Software(.NET)
| Reactions: |
Design Patterns using C#/Mono - Part 1
SingleTon pattern
I came across the term Singleton while studying Georg Cantor's set theory .SingleTon sets are sets with one element.
Examples are { 0 } , { 1 } , { {1,2,3} } ( outer set is a singleton ? )
The GOF (Gang of Four ) guys brought the concept of Singleton to the programming world by interpreting Global instance (only instance ) of some class as a singleton object.
Some people critisize it by saying that it is not a pattern , it is an Anti-Pattern which brings Global state to the OOP world.
In this post , i am not worried about the political consequence of using the single pattern. If you want Singleton , here is one way to achieve it
I came across the term Singleton while studying Georg Cantor's set theory .SingleTon sets are sets with one element.
Examples are { 0 } , { 1 } , { {1,2,3} } ( outer set is a singleton ? )
The GOF (Gang of Four ) guys brought the concept of Singleton to the programming world by interpreting Global instance (only instance ) of some class as a singleton object.
Some people critisize it by saying that it is not a pattern , it is an Anti-Pattern which brings Global state to the OOP world.
In this post , i am not worried about the political consequence of using the single pattern. If you want Singleton , here is one way to achieve it
///////////////////////////////////
// SingleTonExample.cs
//
// Written by Praseed Pai K.T.
// http://praseedp.blogspot.com
//
// gmcs SingleTonExample.cs -r:System.dll
// mono SingleTonExample.exe
//
//
using System;
public sealed class SingleInstanceClass
{
////////////////
// Only instance variable ...!
//
int _value;
private static SingleInstanceClass _inst = null;
/////////////////////////
//
// Hide the Constructor ....!
private SingleInstanceClass() { _value = 0; }
///////////////////////////////////
//
// Get the Instance ...!
//
public static SingleInstanceClass GetInstance() {
if ( _inst == null )
_inst = new SingleInstanceClass();
return _inst;
}
//////////////////////////////////////
//
// a Property for the instance variable...
//
public int Value {
get { return _value; }
set { _value = value; }
}
}
////////////////////////////
//
// The Caller.....!
//
//
public class Caller
{
public static void Main(String [] args ) {
SingleInstanceClass p = SingleInstanceClass.GetInstance();
p.Value = 10;
SingleInstanceClass q = SingleInstanceClass.GetInstance();
q.Value = 20;
/////////////////////////
//
// p and q should hold the same value ...!
Console.WriteLine( q.Value );
Console.WriteLine( p.Value );
}
}
Labels:
Mono,
Software(.NET)
| Reactions: |
If there is uncertainty , we like it !
Now a days , I am filled with "uncertainty" all around. For that matter it is same for every person and nothing has changed in the real for all of us !.
I am talking about uncertainty which is in our frame of mind. I call this "conscious uncertainty" ( something which we are aware ) and "unconscious uncertainty" can be removed by abstraction or our ignorance can save us.
There is yet another kind called "sub-conscious uncertainty". We know that it is there , but it does not bother us every time. The Moment you are idle , It comes and haunt you.
If that uncertainty is about some "opportunity" , we feel tensed about it . Fact of the matter is It is giving us some kind of pleasure . The pleasure of waiting for the desirable (or desirable outcome ! ) to happen.
For us to have a desirable outcome lot of variables around us has to come in sync . For that , we do not have any control. More you wait , It becomes some kind of investment and "patience" ( agony portrayed as a virtue ! ) will have more reward.
What if things do not go the way you intended ? It yet another opportunity to start it all over again. To compensate for the earlier pain of not having the apple , we look for oranges or even banana !!!!.
This uncertainity is what life is all about. Without being rigid and political , you can enjoy this.
I am talking about uncertainty which is in our frame of mind. I call this "conscious uncertainty" ( something which we are aware ) and "unconscious uncertainty" can be removed by abstraction or our ignorance can save us.
There is yet another kind called "sub-conscious uncertainty". We know that it is there , but it does not bother us every time. The Moment you are idle , It comes and haunt you.
If that uncertainty is about some "opportunity" , we feel tensed about it . Fact of the matter is It is giving us some kind of pleasure . The pleasure of waiting for the desirable (or desirable outcome ! ) to happen.
For us to have a desirable outcome lot of variables around us has to come in sync . For that , we do not have any control. More you wait , It becomes some kind of investment and "patience" ( agony portrayed as a virtue ! ) will have more reward.
What if things do not go the way you intended ? It yet another opportunity to start it all over again. To compensate for the earlier pain of not having the apple , we look for oranges or even banana !!!!.
This uncertainity is what life is all about. Without being rigid and political , you can enjoy this.
Labels:
Ways of Life
| Reactions: |
LOST and FOUND !
Yesterday , I re-establish connection with two friends whom I lost contact for some time (when they shifted the base from Kochi ) . One was from the middle east and other from down under . It was nice feeling talking to them.
It was all about sharing our experiences with partial understanding of the respective context. The theme was common , some kind of hope keeps the "spirit" moving .
It was all about sharing our experiences with partial understanding of the respective context. The theme was common , some kind of hope keeps the "spirit" moving .
Labels:
Ways of Life
| Reactions: |
A Simple C++ Program to explain STL
For new programmers and not so new programmers from other languages , STL is still a mystery . Today one of my colleague asked me to explain STL for him. After giving a verbal pitch for five minues , i fired up notepad and wrote the following program ....
//////////////////////////
//MainFile.cpp
//
// A Simple C++ Program to teach STL
//
// Written by Praseed Pai K.T.
// http://praseedp.blogspot.com
//
// cl /EHsc MainFile.cpp
//
// MainFile.exe
//
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
//////////////////
//
// A Function to print the square
//
void PrintSquare( int i )
{
printf("%d\n",i*i);
}
/////////////////////////////
//
// Entry Point....
//
//
int main( int argc , char **argv )
{
////////////////////
//
// declare a vector ....
//
vector a;
a.push_back(17);
a.push_back(10);
a.push_back(30);
//////////////////////////////
//
// Iterate through the vector ...
//
vector::iterator it = a.begin();
while ( it != a.end() )
{
printf("%d\n",*it++ );
}
/////////////////////////////
//
// for_each algorithm...
for_each(a.begin() , a.end(), PrintSquare ) ;
/////////////////////////
//
// sort the vector....
sort(a.begin(),a.end());
////////////////////////
//
// print to show that the stuff has already been sorted..
for_each(a.begin() , a.end(), PrintSquare ) ;
getchar();
}
I think , this program helped them to understand the stuff
Labels:
C/C++,
Windows C/C++ Programming
| Reactions: |
Subscribe to:
Posts (Atom)