Friday, 30 September 2011

CSC301 Assignment

Goal: Develop an application that returns at most 3 results for the shortest path between 2 MRT stations in Prolog, Scheme and C# languages.

C# and Prolog version is around 80 - 90% done. Just need to touch up on UI / data entry segments. The worry here is Scheme. Hopes to get it done by next week if possible. Leave us buffer time.

Remember Murphy's Law - Anything that can go wrong, will go wrong.

Saturday, 24 September 2011

Google+ vs Facebook

Firstly, Google+ is finally open for all.

I thought that it was pretty cool but nobody else does so. Of the people whom I've invited, only 1 accepted. I guess they are fairly resistant to change. I remember the time when I created my Facebook account. It was fairly new then and the in-thing was Friendster. Everyone had a Friendster account and not everyone had a Facebook account. But Facebook was the new fun thing that was quickly catching on because (I think) of the games. It was basically Friendster with games then. And see where Friendster is today.

Hence, I presume that this is the situation now with Google+. However, I am not so certain now. When Facebook did a rather significant change with their UI 2 days back, I was like meh, a weak shot by an ailing (in the future, not now of course) giant (like Friendster).

However, today I learned that Facebook intends to debut their new feature - Timeline which somehow make it seem to me like Google+ is that new kid hoping to make it big and Facebook just keeps pushing forward with no intention of slowing down and giving Google+ a chance. It's like that hare and tortoise story except that the hare doesn't get complacent and wins.

I think it's a huge blow but not a KO puch and Timeline is only going live on the 30th of this month so Google+ might have a trick or two under their sleeve. They seem to be doing something from the liitle updates I see now and then.

Round 1, Fight!

Saturday, 17 September 2011

Updates

Have not been writing here in a long time. Will try to do a more regular update from now on.

Yay! Have been accepted to do a DSO-URECA project on video compression. Hope I'll learn new stuff. Wanted to do one that was basically data mining but the Prof. had too many students.. Popular guy. Must be the Korean craze thing. But this seems fun too and I'll be working on an embedded system.

Have not been touching much on my other labs work and just got to touching CSC204 lab. I managed to get the door open and close toggle thing working now! Had a door that basically opens and when clicked on again opens again.. from open position. But finally got it working right today!

How I did it:

I created 2 timeSensor nodes in 3D studio max. 1 to handle the open and the other to handle the close portion of the object. Next, using the autokey, I made the opening and closing animations. Frame 0 to frame 49 is my opening animation and frame 50 to 100 is my closing animation. I next created a touchSensor node. I pointed the touchSensor to the opening and closing timeSensors. I then export to a VRML file.

Next, in Notepad++, I opened the VRML file and added a script which I got off an internet source. I then reroute the nodes - i.e. touchSensor routed to the script and the script routed to the timeSensors open and close. Basically, I'm intercepting the call from touchSensor to the timeSensors.

Here's my code for the 2 doors and 2 windows:

#Script for bifold door
DEF ToggleBiFoldDoor Script {
  field  SFBool  state FALSE
  eventIn  SFTime toggle
  eventOut SFTime startClose
  eventOut SFTime startOpen
  url "vrmlscript:
 function toggle(curtime) {
  state = !state;
  if (state) {
    startOpen = curtime;
    startClose = -1;
  }
  else
  {
    startOpen = -1;
    startClose = curtime;
  }
 }
 "
}
#Script for casement window
DEF ToggleCasWin Script {
  field  SFBool  state FALSE
  eventIn  SFTime toggle
  eventOut SFTime startClose
  eventOut SFTime startOpen
  url "vrmlscript:
 function toggle(curtime) {
  state = !state;
  if (state) {
    startOpen = curtime;
    startClose = -1;
  }
  else
  {
    startOpen = -1;
    startClose = curtime;
  }
 }
 "
}
#Script for pivot door
DEF TogglePivotDoor Script {
  field  SFBool  state FALSE
  eventIn  SFTime toggle
  eventOut SFTime startClose
  eventOut SFTime startOpen
  url "vrmlscript:
 function toggle(curtime) {
  state = !state;
  if (state) {
    startOpen = curtime;
    startClose = -1;
  }
  else
  {
    startOpen = -1;
    startClose = curtime;
  }
 }
 "
}
#Script for awn window
DEF ToggleAwnWin Script {
  field  SFBool  state FALSE
  eventIn  SFTime toggle
  eventOut SFTime startClose
  eventOut SFTime startOpen
  url "vrmlscript:
 function toggle(curtime) {
  state = !state;
  if (state) {
    startOpen = curtime;
    startClose = -1;
  }
  else
  {
    startOpen = -1;
    startClose = curtime;
  }
 }
 "
}
#Bifold Door open and close
ROUTE BiFold_Door_touch-SENSOR.touchTime TO ToggleBiFoldDoor.toggle
ROUTE ToggleBiFoldDoor.startClose TO Bifold_DoorTime_Close-TIMER.startTime
ROUTE ToggleBiFoldDoor.startOpen  TO Bifold_DoorTime_Open-TIMER.startTime
#Cas window open and close
ROUTE Cas_win_touch-SENSOR.touchTime TO ToggleCasWin.toggle
ROUTE ToggleCasWin.startClose TO Casc_Win_Time_Close-TIMER.startTime
ROUTE ToggleCasWin.startOpen  TO Cas_Win_Time_Open-TIMER.startTime
#pivot Door open and close
ROUTE Pivot_Door_Touch-SENSOR.touchTime TO TogglePivotDoor.toggle
ROUTE TogglePivotDoor.startClose TO Pivot_Door_Time_Close-TIMER.startTime
ROUTE TogglePivotDoor.startOpen  TO Pivot_Door_Time_Open-TIMER.startTime
#Awn window open and close
ROUTE Awn_Win_Touch-SENSOR.touchTime TO ToggleAwnWin.toggle
ROUTE ToggleAwnWin.startClose TO Awn_Win_Time_Close-TIMER.startTime
ROUTE ToggleAwnWin.startOpen  TO Awn_Win_Time_Open-TIMER.startTime

Credits to: Open & Close - Reversing animations and davidjsushil.com

Have to go and touch on CSC301 assignment too. My team mates have a heavy load and I'm trying to keep this additional workload as light as possible for them. I had CSC207 last semester and boy is it tiring.

The new blogger editor seems really sleek and cool. Hope to be using it more often. If it seems like this post is incoherent, that's because I'm typing whatever that's in my mind without any editing and I can't be bothered haha.