Wednesday, April 19, 2006

Running my 'OTC code' application

sure, anyone read the title wondered what is the 'OTC code' (maybe its sth related to programming 8-)??!) , Actually No... It's an application I made for my sister & her collegeus in college, They wanted to make a program that can be used in any pharmacy to check on the Drugs interactions.. (As some drugs may interact & cause toxic doses & many commplications w 7agat kedah...) & that is sth VERY common here in Egypt..
Anyway, they collected the Data & it was my task to make the program.. Actually it was not complicated at all, but it really made me feel Happy... cause its my first time to make sth -u know- USEFUL...

Anyway,back to my main point (the reason that made me write that post)... After I finished the application, I gave it to them to show it to their DR.. but.. ops.. I forgot.. We all know that any program made on .net won't run unless there is .net installed on that device...
mmmmm... I thought.. what should I do then.. I really worked hard on it.. so, I got an idea...mm... just make the CD containing the program an autorun that asks the user to install just the FrameWork of the .net... & after installation, everything will work just fine...
I tried that method & e7l.. my application worked :) .. & ISA they will deliver it next saturday...

so, for anyone making any application on .net... Always remmember that the user is not a programmer like u & doesn't have .net framework to run that application (cause I almost forgot that)...
maybe many who will read that post know that b4, but maybe some doesn't...
Just an experience I wanted to share...
In case anyone has a better solution, Comments are welcomed :)

(BTW, I became a popular character there in the faculty of pharmacy :D)

Saturday, April 15, 2006

Multi-Teaming..

I don't know if there is sth called "multi-teaming" or not.. but I made up that expression from my mind...
Maybe this post is NOT very related to what I usually post here -maybe I'll delete this post later- ,but I just wanted to talk about that issue so much as its related to my programming life...

Let me begin explaining my title first...
Programming field has a very important concept called "Team Work"... I don't have personal experience in real job or work (cause I didn't work till now :) ), but I think college is enough to teach us that concept (through projects, acm ... etc)

All my life, I always like to work in teams (maybe being in a team since 9 increased that inside me...) , When I joined college, I searched for a team mate -althought I have many friends- ,but I found NONE...
later on, I began to find persons having common interests like me.. I joined in with them & made what is called "Teams"...

What is "Multi-teaming" then !!
I'll tell u... When you have the same members with u in a certain task or goal, then u can call yourself a "Team", The idea is that I have many Teams, & Can u imagine that noone is repeated in more that a team!!... mmm.. let me make things more clear...
My ACM team, Hend & Asmaa... My C++ Team, Sally & Shimaa... My Open GL Team, Heba 3essam, Abdel r7man M., Abdel r7man E..... My projects Team, Aya Nabil, Yasmine...etc....

As you can see.. Many Teams & all are different members...
This is what I call "Multi-Teaming"...

Talking About Multi-Teaming... I think it has Advantages & Disadvantages...

About the Advantages:
-"Multi-teaming" widen your thiking (I believe so) cause you think & create new things with different minds & different ways of thinking...
-"Multi-teaming" make you exchange information with different people & that -surely- always teach u sth new...
-"Multi-teaming" make you always enthusiastic about each team's task, I mean when u have new persons in each team.. they always think in one direction towards that team's goal & that always help u keep up in the same performance in each team...
-"Multi-teaming" strengthen you relation with people around u in ur community & helps in the interaction between people..

About the Disadvantages:
-"Multi-teaming" doesn't make you enjoy the taste of "Team work"... Imagine that u have many things to work on today... You go with X & Y to do sth, then after hours.. you go with A & B to do sth else... kind of unsettlement...
-"Multi-teaming" LOADS one so much... If people u work with are with u in everything, you will have the same palns, same tasks (not exactly the same, but I mean ... nearly the same ) ,but in "Multi-teaming", you always have to do many things & in the same quality as your team members (who in most of the time, do nth except that task..)

Till now, I don't prefer "Multi-teaming" so much, maybe "Di-Teaming" or "Tri-Teaming" would be enough :) ,but the problem is that I can't find someone to share me all my interests...

Till now, I'm still so confused about Multi-Teaming... sometimes I adore its advantages & other times, I just hate its disadvantages...

anyway, just wanted to share a personal experience, here in my blog...

Friday, April 07, 2006

Rotating Earth.... Horray...

Now, its one of the happiest moments in my programming life (till now :)) e7l...
I finally could make it.. I made a rotating earth with Open GL...

About MY earth... :)
You can change to Night & Day vision (light/darkness) also you can (zoom in/zoom out)...
with cabability of controlling the rotation in x, y & z directions...

Here is a shot for the earth, zoomed out
& in Day vision..
(rotating for sure,but that isn't clear :D)



While here, the Earth is magnified
in Night Mood...


Hope you enjoyed the screen shots ;)..

There is still a loooooooooot to learn, but I will never forget this moment..

(BTW, now its 2:00 am.. It really worth mixing my timetable)

Wednesday, April 05, 2006

Playing with Open GL..

I was playing with Open Gl... (BTW... I Like it veryyyyy much) .. I made that rotating twinkling star... I know this is an easy task... but I think everyone starts from Zero.. right ;)

The Star rotates in x, y & z axis.. & also changes its colour from red to yellow & vice-versa...

I'm working now on a rotating, translating, keyboard controlled sphere.. so Hope I will make it.. ( I will send it here sure after I finish it ISA... ;) )

Saturday, April 01, 2006

Some solution paradigms for acm problems...

Here is some things that you need to consider when designing your solution :)

Generating vs Filtering
Programs that generate lots of possible answers and then choose the ones that are correct (imagine an 8-queen solver) are filters. Those that hone in exactly on the correct answer without any false starts are generators. Generally, filters are easier (faster) to code and run slower. Do the math to see if a filter is good enough or if you need to try and create a generator.

Pre-Computation / Pre-Calculation
Sometimes it is helpful to generate tables or other data structures that enable the fastest possible lookup of a result. This is called Pre-Computation (in which one trades space for time). One might either compile Pre-Computed data into a program, calculate it when the program starts, or just remember results as you compute them. A program that must translate letters from upper to lower case when they are in upper case can do a very fast table lookup that requires no conditionals, for example. Contest problems often use prime numbers - many times it is practical to generate a long list of primes for use elsewhere in a program.

Decomposition (The hardest thing at programming contests)
While there are fewer than 20 basic algorithms used in contest problems, the challenge of combination problems that require a combination of two algorithms for solution is daunting. Try to separate the cues from different parts of the problem so that you can combine one algorithm with a loop or with another algorithm to solve different parts of the problem independently. Note that sometimes you can use the same algorithm twice on different (independent!) parts of your data to significantly improve your running time.

Symmetries
Many problems have symmetries (e.g., distance between a pair of points is often the same either way you traverse the points). Symmetries can be 2-way, 4-way, 8-way, and more. Try to exploit symmetries to reduce execution time.
For instance, with 4-way symmetry, you solve only one fourth of the problem and then write down the four solutions that share symmetry with the single answer (look out for self-symmetric solutions which should only be output once or twice, of course).

Solving forward vs backward
Surprisingly, many contest problems work far better when solved backwards than when using a frontal attack. Be on the lookout for processing data in reverse order or building an attack that looks at the data in some order or fashion other than the obvious.

Simplification or in technical terms: Problem Reduction
Some problems can be rephrased into a somewhat different problem such that if you solve the new problem, you either already have or can easily find the solution to the original one; of course, you should solve the easier of the two only. Alternatively, like induction, for some problems one can make a small change to the solution of a slightly smaller problem to find the full answer.

References:-. USACO training gateway