Aug 18 2008

Living the FOB (Fresh on Board) Student life….

Published by under General

This saturday i took 3 kids shopping to walmart, kids????? by kids i mean new students who have come to USC for their Masters (MS) from India. It reminded me of my MS days as well and the lifestyle back then. This article mainly refers to lifestyle of a typical Indian student who has moved here for his MS.

 

NOTE: Please don’t take this article personally i am not pointing fingers at anyone, it is just a personal opinion and my observations/experiences.

 

I would classify three kinds of lifestyles of a typical desi MS student,

  • Super Stingy (SS)
  • Well Balanced (WB)
  • No Worries (NW)

Above categories would easily describe the way of life of a desi, it can be the way of life not only while being in school but also after graduation. I just want to focus my experiences with student lifestyles while still being in school, mainly during MS. Sometimes its just not possible to change your student lifestyle but a lot of people don’t want to change their thinking/lifestyle even though the circumstances make it possible. Lets take a look at each of the above categories,

 

Super Stingy (SS):

Everything in life is about money, every decision they make in life is about saving money 99% of the times. Saving money is their motto in life. I can understand that USC is an expensive school etc but not everything in life is about money. They would know which place has the cheapest toilet paper or what place serves free food during which time. Being the first in line for free food makes them feel proud and they feel even better if atleast 10 other people take advantage of it because of them.

 

My Personal Experiences:

USC had or still does have an active yahoogroup where free food events are posted so that people canshow up for free food only and don’t care about the event. So this one dude goes for such event which happens to be for LGBT members (Lesbian, Gay, Bi-sexual and Trans Gender), unfortunately for him there is press coverage as well and his picture ends up on the front page of Daily Trojan (USC Campus paper), fun times.

 

Being Indian saving money is a mentality which is in our genes (of course there are exceptions) but this one incident confirmed the hereditary nature of this trait. We (me and my roomies) used to cook almost daily at home, we enjoyed it and cooking turns was fun, so while having a conversation with one of the parents we happened to mention that yes we cook a lot at home and the reply we got back was “So you must be saving a lot of money” grrrrrrrr, come on give us a break. It does help to save money to cook at home but that isn’t the sole reason to do so. Also the manner in which the statement was made was very offending and gave us an idea of the mentality of that person.

 

There have been a quite a few instances where is have seen SS at work but i shall not go further into it, I am sure you get the idea.

 

Well Balanced:

Save money and spend it wisely. People in this category like to visit places, would rent a car and go out have a good time while not making a huge dent in savings and things like that. A better paying on campus job certainly helps to maintain a WB lifestyle. Quality of groceries takes priority over cheaper ones and little things like these matter over money.

 

My Personal Experience:

Our lifestyle, 4 of us bought a car together to roam around and visit few places, the car was an idea which came to us after 9 months since everyone had a good on campus job it was affordable. It wasn’t an expensive car but it did take us around. Groceries would be done from Ralphs and not from Superior or any other place. 

 

No Worries:

Money is not an issue and spending it is even easier, if you run out of it just ask your folks from India to send some more. Very few people fall in this category but there some chosen ones. Eating food outside all the time, not worrying about trying to find on campus jobs and things like that define them.

 

My Personal Experience:

I have seen a people like that who tend not to work on campus or for that matter work less so that they can “concentrate on studies”. Eating outside was a routine for few since they didn’t want to deal with hassle of cleaning the dishes afterwards and things like that.

 

I am sure you can find contradictions to everything i have mentioned above and argue with me on it. There are always circumstances beyond one’s control which forces you to do things as well. I am also not criticizing anyone or maybe just a little for SS but ultimately it is upto that individual to live their life and its their decision not mine.

 

At Walmart I saw someone with a notebook noting down the prices of items he was interested it, I think it was for comparing the prices at different stores and picking up whatever is cheapest from whichever store. I didn’t know how to react, but it was understandable since being a new student you are still converting $ into INR but if after a year in MS or getting a full time job if that person does the same thing then i would certainly feel sorry for that person.

 

3 responses so far

Aug 15 2008

Turning into a NRI (Na Raha Indian)??????

Published by under General

Today is India’s 61st Independence day and i was reminded about it by a friend. It has also been over 5 years now since i moved to USA and i have been to india only once during those 5 years. 

 

Since i moved out here i have realized that the festivals like Diwali, Holi, Navratri etc don’t really mean the same to me as they did when i was back home. Am i being unemotional or its just that living this country doesn’t evoke the same excitement in me about these things anymore. It is really hard to explain but most of the festival days are like any other day to me there is nothing special.

 

Not that i would do something special but in India when i would wake up on independence day, atleast i would realize that is independence day and stuff you know, but here its like any other weekday. Of course you would expect that since its not US independence day but then at the same time if there are any celebrations out there, i just don’t attend them. Maybe there aren’t any parades out here in LA as they happen in NY or New Jersey which makes it different. 

 

Also whenever people celebrate festivals its usually on weekends because no one has time during the weekdays to get everything organized and people won’t simply attend those functions on a weekday. It is a matter of convenience over significance , ofcourse celebrating things on a different day doesn’t lower the significance or maybe it does, I will let you decide that.

 

Personally for me no matter what the enthusiasm or the excitement just isn’t there, call it being unemotional, cold or maybe i am just turning into an NRI…..It is a sad thing but for some reason i just can’t help it.

3 responses so far

Aug 11 2008

Diving Catalina..

Published by under Diving

I decided to head out this sunday on Sundiver diving Catalina. It was supposed to be a clear sunny day and it definitely turned out to be one. The previous night i had met up with paras, miril and diti for dinner and then had ice cream at Mashti Malone. I was really stuffed that night and it was a good thing.

 

Woke up at 4.30 am and because of previous night heavy dinner i didn’t feel like having anything for breakfast. I left at about 5.45 am and the usual ramp on sunset for 101 was closed so had to take a detour but managed to reach the boat at about 6.40 am. The boat was going to be full.

 

After completing the usual paperwork etc, i found myself a bunk and tried to take a nap since i had like 3-4 hours of sleep the previous night, but i wasn’t able to sleep. Got up, had something to eat and drink and then it was almost time to get ready. I saw that we were getting closer to island and going in direction of two harbors. At first, we were planning to dive a place where the bat rays were supposed to be in plenty but then we moved to a different spot for some unknown reason. The water was crystal clear with vis upto 70 ft.

 

Dive teams were being created so to say since there were some who were diving for the first time in cold calif water and i was supposed to tag along with Andrew and a group of 5 more people. The heat was intense and i was starting to sweat in my wetsuit so i decided to get into water as soon as possible. Some people decided to take off their hoods since the water was 70F on the surface which was surprising. I got into the water and it surely felt good, i wasn’t hot anymore but wasn’t cold at all, just comfortable. It took a long 10-15 mins to get the entire group together and for some reason i thought my dive light fell off. Andrew asked to me dive down and look for it so i went in by myself while keeping an eye on the gang.

 

I started looking for my light but after a while i realized that it was attached to my BC, bummer and i also lost Andrew and rest of the gang. i decided to go Solo and explore the reefs by myself. The kelp was thick and there was no way that i would have found those guys but back in my head i was thinking what if they are looking for me or something but i was wrong about that. Andrew figured i would be fine on my own so he didn’t bother to look. I found lots of bugs and the usual critters and while i was looking for something i came across a Scorpion fish by chance. I always wanted to find those things since they are really well camouflaged and today was my lucky day, i found couple of them on this dive and all of them by accident.

Scorpion

yes that is a fish.

revealing its true colors

It blends really well.

School of Fish

Since i wasn’t sure whether or not those guys were looking for me, I decided to end my dive early though i had like more than 900 psi left in my tank and could have gone for another 10 mins. I saw a group of 6 and thought it must be andrew n gang but it was others. I finally found andrew and ferris during their safety stop and i also stopped along with them.

 

Dive 1 Details:

Total time: 44 mins 

Max Depth: 44 ft

Buddies: None

 

People were getting warm with their hoods and 7 mm suits so some of them were diving without wetsuits. I contemplated taking off my hood but decided against it. We were going to be anchored at the same point since the conditions were so great and this time for the dive it was just me, andrew and ferris. The rest of the gang were comfortable and diving on their own. Jumped into the water and we decided to head in a different direction this time, with Andrew leading and me being the last person. I was going to be slow since i would get caught up taking pictures. Few mins into the dive as we were exploring the reefs, Ferris had stopped and was pointing me to something. It was a horn shark resting and it was quite big as well about 3-4 feet i suppose. Took a few pictures and then continued on, saw lots of lobsters again, quite a few rock fish and a big cod resting. The algae forest closer to the shore at about 12-15 feet was very colorful with some lavender growth. It was really pretty. We did little more exploring and i was trying hard to find some nudibranches but they weren’t to be seen anywhere. It was a good dive nonetheless. For some weird reason my mask was really bothering my during this entire dive, i had to clear it every couple of mins.

The plant life

Forest

The underwater forest

The Horn Shark

This it the lavender plant.

Dive 2 Details:

Total Time: 44 mins

Max Depth: 36 ft

Buddies: Andrew and Ferris

 

It was time for lunch and there were no veggie sandwiches for me but there were some spinach pizzas which were good enough for me. For the last dive we moved across two harbors and came to place called Africa rock or something like that. This was the place where the boat captain Kyaa had her students see some crazy Bat ray behavior so i was hopeful of seeing them this time. Hilary needed a buddy so i decided to go along with her, I was going to lead and she wanted me to go really slow so that she could explore things and have more time to look around. I was fine with it since i wanted to find some nudibranches myself and take few cool pics. Also she wasn’t sure about her navigation and I am not that bad myself so that was another reason for me to lead the way. The vis out here wasn’t as great as the earlier spot but it wasn’t too bad either. It was in 25 – 30 ft range.

 

We decided on a general direction and then dropped down, Hilary had some problems clearing her ears initially but managed to clear them and so we continued our dive. I was looking out for anything colorful and bright but couldn’t find anything at all. No nudis during the entire dive. The reefs were abundant in life with the usual critters, lots of bugs aka lobsters. Also managed to find a scorpion fish on this dive, at 40 feet I was getting bit chilly and 20-25 mins into the dive Hilary told me that she was also feeling cold. On the way back i wanted to go along the edge of the reef since that was the place where the rays would hang out but since both of us were little cold i decided to go to a shallow depth and explore the reefs again. No luck with the rays or the nudis. Hilary had about 990 psi left and myself about 800 so i decided to continue a bit longer with the dive but after a while hilary signaled that she was down to 800 and wanted to end the dive. We took our safety stop and then swam back to the boat, we didn’t wander that far and it was a short surface swim to the boat.

Love this picture, was from the previous dive.

Sea Fan, Juvenile Garibaldi and Star Fish

Dive 3 Details:

Total Time: 48 mins

Max Depth: 43 ft

Buddies: Hilary

 

I packed up my things, took a shower and was ready to crash as soon as possible but not before i had that awesome yummy chocolate cake. I slept the entire way back, it was almost 7 pm by the time we docked. Almost forgot to take the camera out of the camera bucket, if it wasn’t for Ferris reminding me about it. She gave me her email address so that i could send her the pics. Reached home at about 8ish and then the usual cleaning up of my gear etc.

 

It was a satisfying day of diving even though i didn’t see bat ray or nudibranches but there were plenty of lobsters and saw a few scorpion fish.

3 responses so far

Aug 08 2008

Understanding Scale 9 grid for Flex

Published by under Flex

This article is for my reference as well because i always confused what co-ordinates i should use to specify the scale 9 grid i.e, upSkin: Embed(source=”../assets/graphics/combobox/ComboBox_upSkin.png”, scaleGridTop=”7″, scaleGridBottom=”10″, scaleGridLeft=”7″, scaleGridRight=”106″);

I use the above skinning method a lot and hence need to completely understand how to specify the co-ordinates to scale the graphic to any extent.

 

If this all doesn’t make sense then i would ask you to read this article, it is awesome article but i was totally confused on how to find the correct co-ordinates for scaling. 

 

Finally after lot of trials and errors i managed to get it right and understand it. I am going to show exactly how i calculate it. Take a look at the following picture,

 

I am selecting the same fancy_border.png from the Adobe site and i am trying to find a rectangular region in the center which if scaled is not going to affect my image. This region begins at 53,54 and is 215×82.

 

So now i need to assign my scaleGridTop, scaleGridBottom, scaleGridLeft and scaleGridRight from the above information,

 

scaleGridTop is the y position of this rectangle i.e. scaleGridTop=54

scaleGridBottom is the y position of this rectangle plus its height i.e scaleGridBottom=54+82

scaleGridLeft is the x position of this rectangle i.e scaleGridLeft=53 and finally

scaleGridRight is the x position of this rectangle plus its width i.e scaleGridRight=53+215

 

so for the above image embed tag would like,

  [Embed(source=”../assets/fancy_border.png”,
scaleGridTop=”54″, scaleGridBottom=”136″,
scaleGridLeft=”53″, scaleGridRight=”268″
)]

 

Flex scales this rectangular region when it scales the image, so your rectangle should be selected such that any distortion to this region won’t affect your original image. Also this rectangle will determine how much smaller your image can get without distortion, if you select a small rectangular region then you won’t be able to downsize your image.

 

Hope this article makes the scale nine implementation in Flex more clear. Here is a swf file for you all to play with it applies two different scale nine grids to the same image and you will see the difference how it affects the downsizing of the image. 

EDIT: 01/15/09

Using 0 in the scaleGridTop doesn’t work, you have to use 1. I don’t know but it seems to be the case.
 

Click here for the source.

 

 

10 responses so far

Aug 06 2008

Price of Reaching the Summit

Published by under General,Mountaineering

I read about the recent tragedy to strike the mountaineering world on K2, 11 climbers lost their lives and few suffered from injuries. It was a very unfortunate incident and something we can all learn from

 

The climbers had a very excellent window of opportunity to scale K2 and it would be very difficult for any individual to resist the urge to get to the summit no matter what, specially when they had waited a long time for that window to open. When they found out that the fixed ropes were in wrong places and they had to move them. It took them a long time to do so and also some of the climbers returned since they didn’t trust the ropes anymore. The entire climbing party could have returned but they wanted to make full use of that small window of excellent weather. They reached the summit but it was about nightfall, its really hard to believe why would someone want to reach the summit of a mountain regarded as killer peak so late.
 
you can read complete account of the tragedy in this article,

Article which gives account of survivor

http://thelede.blogs.nytimes.com/2008/08/05/tales-of-chaos-and-survival-on-k2/index.html?partner=rssnyt&emc=rss

http://www.belfasttelegraph.co.uk/news/local-national/fears-k2-team-were-consumed-by-summit-fever-13930275.html

 
Many accidents happen because people always try to push themselves without realizing their limits, i am tempted to use the word most instead of many here, this is not limited to mountaineering but to every day life in general. you won’t drive an old badly maintained car at speed of 100 mph on a freeway would you????? Heck, i wouldn’t even go past 75 mph now in my 98 Sentra, give me a 08 BMW and its a different story :D. Its the same concept that can be applied to any adventure sport. Divers shouldn’t dive to depths beyond their limits or Rock climbers shouldn’t lead climbs rated way beyond they normally lead and so on.

 

http://tvnz.co.nz/view/page/536641/1977025, Reinhold Messner mentions how one of his client wanted to go higher on the peak even he wasn’t in any shape to do so. The same problem caused the Everest disaster which Jon krakauer mentions in his book Into This Air. When someone pays 50-60K for an expedition I am sure they want their money’s worth out of it but at what cost?. Losing your feet or fingers to frost bite isn’t worth any amount of money nor is your money going to be of any use to urself when you die. 

 

The mountain is here to stay, another attempt to get to the summit can be made, its definitely not worth something to die for. I have abandoned my summit attempt of Mt Stok Kangri 6155m because i was not in any position to reach the top, if i had continued i would have been at summit at around noon or maybe later, something i wasn’t ready to do. I wanted to reach summit before a certain time and i didn’t so it was time to turn back.  I hope i keep following the same principle on all of my future attempts on any peak.

One response so far

Aug 03 2008

Opening popups from text links

Published by under General

I already have a post which shows how to open popups using getURL or navigatetoURL (this is the link) but what if you want to use html text to open a popup in Flash. Firefox blocks those popups and you cannot do anything about it, but there is a solution using javascript.

 

The trick is using javascript in href tag instead of normal http link, for eg, lets say you want to open http://www.nayansavla.com/blog, the normal code for html enabled text box would be,

 

sampleText.htmlText = “<a href=’http://www.nayansavla.com/blog’> My Cool Blog</a>”;

 

The above link might not work in all browsers, the solution to make this link work would be using javascript and External Interface. First we modify the link as shown below,

 

sampleText.htmlText = “<a href=’javascript:openwindow(” + “\”http://www.nayansavla.com/blog\”” +”)’>My Cool Blog</a>”;

 

Also we add few lines of extra code in our Flash file,

import flash.external.ExternalInterface;

ExternalInterface.addCallback("callGetURL",this,callGetURL);

function callGetURL(url:String){

getURL(url,"_blank");
}

 

The basic idea is we will first try to open a window with javascript but then if that fails we will call this function callGetURL using ExternalInterface. The javascript function openwindow looks as shown,

 

function openwindow(pageUrl) {
var winName = Math.round(9999*Math.random()) + new Date().getTime();
var winNew = window.open(pageUrl,winName,"toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=700,left=200,top=100");
if(!winNew) {
if(navigator.appName.indexOf("Microsoft") != -1) {
//href is the id of the flash element
window.href.callGetURL(pageUrl);
}else {
//href is the id of the flash element
window.document.href.callGetURL(pageUrl);
}
}
}

So now if your javascript doesn’t open a popup, flash geturl will :D. hope this helps. This doesn’t work with Firefox 3, will have to look more into it. Also on further looking into this, it displays inconsistent behavior in Firefox. :(
 

 

No responses yet

Jul 30 2008

Using Flex Builder 3 to compile Flex 4 applications

Published by under Flex

Flex 4 SDK is available for download now, even though it will be a lot buggy i suppose, nevertheless i decided to play with it and try it out. Flex 4 applications work with Flash Player 10 only and I didn’t want to install it since it can’t co-exist with other FP versions. Also i love FB eclipse plugin and wanted to write Flex 4 code using that. Here is how i achieved my goal, 

 

PS: I am assuming that you are fairly familiar with Flex Builder or the Eclipse FB Plugin

 

Downloading the Flex SDK:

They have started releasing nightly builds of Flex SDK and i downloaded the latest one. Get it.

It doesn’t matter where you save the file. Once you download the file, go to your Eclipse Preferences and then in Flex Settings, select add this SDK. I keep Flex 3 as my default SDK and then we will choose this SDK specifically for Flex 4 projects.

 

Setting up a Project:

Create a standard Flex project as you would normally do in FB. Lets not worry about the main application file for now, first we need to change some settings for our project.

 

Right Click the Project and then select its properties. Go to Flex Compiler option and Select use a specific SDK. 

Choose Flex 4. Also I select the wrapper to have required player version to 10.0.0 even though i will be running swf directly. For my browsers the FP version is still 9.0.115.

I use the following sample code, it is taken from Adobe site,

 

 

<?xml version=”1.0″ encoding=”utf-8″?>

<Application xmlns=”http://ns.adobe.com/mxml/2009

             xmlns:mx=”library:adobe/flex/halo

             layout=”flex.layout.VerticalLayout” backgroundColor=”white

             width=”800” height=”600” xmlns:ns=”library:adobe/flex/gumbo” xmlns:skin=”flex.skin.*>

    <Ellipse width=”10” height=”10” y=”3>

        <fill>

            <mx:RadialGradient>

                <mx:GradientEntry color=”0xAAAAAA/>

                <mx:GradientEntry color=”0x336699/>

            </mx:RadialGradient>

        </fill>

    </Ellipse>

    <mx:Button label=”halo button/>

    <Button label=”gumbo button/>

</Application>

 

 

Note: This is all you have to do if you already have FP 10 installed. 

 

Since i don’t have FP 10, I just have to do a minor modification. FP 10 also comes bundled with your Flex SDK, if you look into flex_sdk_4/runtimes/player/mac, there should be a zip file. I have associated all the swf files with this app. So whenever i click on swf, it opens up with this version of Flash Player. 

 

We can do that change in our project by selecting the Run/Debug Settings for the project and then clicking the edit button.

if everything goes well the next time when you run this project, it will run in FP 10 application and you are all set for writing Flex 4 applications.

No responses yet

Jul 28 2008

Diving San Clemente

Published by under Diving

After a long hiatus in my diving, I finally decided to dive on Sunday 27th July. Sundiver was headed off to San Clemente (SC henceforth) and Kim from ValleyScuba was going to get her AOW (Advanced Open Water), so i decided to join that boat.

 

SC is a 5-6 hour boat ride on Sundiver so we were supposed to get on the boat saturday night. Packed my stuff and got ready to leave my place at about 8.30ish pm and finally after one u-turn i reached Alamitos Bay landing where the Sundiver is located. Completed the paperwork, met Kim and checked out the bunk assignments, we were supposed to share bunks and i was assigned the lower one which was closest to the bow. I checked out the bunk and it was pretty comfortable, more than what i expected. I managed to sleep well and didn’t have any problems as such.

 

Woke up early at about 6.30 am and we were already there, for me the breakfast was a bagel and banana. The first dive was going to be a deep dive and i was looking forward to hitting 100ft and beyond but alas that wasn’t the case to be. We all got geared up and since i didn’t have any buddies i wasn’t sure with whom i was going to dive. I assumed that i will dive with the folks taking advanced class so it will be easier for me, but i decided to be the nice guy and buddied up with Derrek who was from Missouri.

 

Derrek had an interesting experience when he came aboard Sundiver, he was expecting to rent all his gear on the boat and then dive. He didn’t realize that he had to go to the shop i.e Ocean Adventures and get his gear. I guess the folks on the boat managed to find him spare gear to dive in but he was wearing a 3mm wetsuit. He would normally freeze in Cold Calif water but today it was 67 F on the surface so he supposed he could handle the cold. Also he wasn’t AOW but he told me that he had been in 100 ft of water, i decided to stick a depth of 60 or less even though ended up going to 68. Before getting into water, this another girl comes up to me and asks if it would be cool for her and her buddy to follow us since it was their first time diving in Calif and she was afraid of getting lost in the Kelp. It was fine with me and told her that i might get lost too :D.

 

So after doing the routine checks, I got into water first and then the rest of gang followed me. We decided to just explore the reefs which were in about 30-40 ft of water, I descended, Derrek followed immediately but out of the two girls only one of them descended the other was nowhere to be seen. After spending couple of minutes in about 20 ft of water, we decided to surface to find the remaining of our party, this girl had some problems since it was her first dive in cold calif waters. She was mainly scared and not confident enough to dive, so we took our time at the surface and with about 2000 psi remaining (in my tank) we decided to give it another try. This time the only people at 25 ft was me and Derrek, I decided not to surface again and we continued our dive.

 

For a change my dive light was functioning properly and I was able to use it, found quite a few lobsters lurking in the cracks. A group of fishes feasting on a dead sea urchin didn’t mind us. Nothing too exciting just saw the usual california marine life, i need to refresh my Fish ID knowledge to put in a few more names out here :). About 25 minutes into the dive Derrek was feeling cold so we decided to end the dive and after the safety stop we were out of the water.

Lobster Family

Family of Lobsters, chilling in the crevices.

 

The usual

Sea Fan????????

 

Feasting on Urchin

Urchin feast, seemed yummy for them.

Dive 1: (this is all i get from my computer without downloading dive log)

Max Depth: 65 feet

Total Time: 30 mins.

After the first dive, I hydrated myself ate some just the usual. It seemed that the class doing advanced dove to about 81 ft only because that was the deepest they could go, so even if i hadn’t buddied up with Derrek i wouldn’t have gone beyond 81 ft. We moved to a different spot which had underwater caves and i was excited by it. Derrek spotted a sea lion and told me that he wanted to go after it, his whole intention of diving in Calif was to swim with Sea lions, bad choice buddy SC is not famous for Sea Lions, SB or Anacapa is. This time around the two ladies were going to dive on their own and not going to follow us or something. 

 

We decided to head in the direction of the caves and they were amazing. We were able to go underneath them and take a closer view and stuff like that. The structures wouldn’t be even classified as caverns in terms of diving, just some overhead reefs and passages through which we could swim. It was really cool. The marine life was usual and i think Derrek wanted to find that sea lion so he headed off towards the sands. He saw a ray pass by and i just caught a brief glimpse of it. We then explored the reefs little bit more and saw the usual critters. We ended the dive soon. I had some problems with my ear during this dive and i wasn’t sure if i could make it the next dive. My main concern was equalizing my ears.

Unknown

Unknown Entity

 

Dive 2:

Max Depth: 68 Feet

Dive Time: 25 mins

We now moved to a different side of the island and as we were moving i could see the water changing colors, it was getting more blue and clear as well. When we reached the calm waters near the Fish eye rock, the conditions were simply amazing. We were able to see the bottom from the boat i.e the visibility was 60 feet easily and the sun also had come out, it was simply amazing. I really hoped i would be able to equlize my ears during this dive, i just didn’t want to miss it. Derrek spotted a couple of sea lions chilling on the rock and he wanted to swim out there, I wasn’t too excited about the idea. I would explore the kelp rather than chasing sea lions. 

 

I reluctantly agreed to his idea of going after the lions on the rock, he got into water and i soon followed. Instead of swimming over the kelp i decided to head for the rock from underneath so i dove to about 20 ft, Derrek was on surface and i followed him. It was a totally different growth closer to the rocks, no kelp but lots of grass and stuff which was really cool. When we got to the rock, i surfaced and we saw that the lions had vanished and they went over to the other side. There was no way that i was going to follow them out there, so i convinced Derrek to continue the dive and explore the kelp rather than to chase the sea lions. So we headed back and were exploring the kelp all the time. Came across a couple of lobsters, there was so much junk at this location. Various steel boxes, exhaust pipes etc were littered on the ocean floor. We came across a tiny little nudibranch which was cool, i tried photographing those juvenile Garibaldis but they would run away from me the moment i got closer. We were 43 minutes into the dive and i still had about 800 psi left in my tank, at this moment Derrek signalled he was at 500 psi so we decided to end the dive.

 

It was so amazing out there that i decided to snorkel, it was relaxing just to lay out there and watch the ocean floor from the top. I must have snorkeled for about 10 – 15 mins and then called it a day with one of the best dives i have done. The last dive made the whole trip totally worth it.

The Greens

The Greens, you can see sun rays.

 

Kelp Forests

The Kelp Forest.

 

Nudi

Nudibranch

Dive 3:

Max Depth: 53 Feet

Dive Time: 44 mins

There wasn’t anything special as such for me to have for lunch but i managed to survive on mashed potatoes, salad and the chocolate cake which was awesome. Had a brief nap on the way back and when i woke up we had reached Catalina and there were another 2-3 hours left before we reached land. Just did timepass on the boat in general and when i turned on the cell phone there was a message from Cory (my supervisor at work). 

 

I had to get in the office and figure out an issue we were having. We took sometime to dock because there was another small boat docked in our place, the harbor patrol came and towed the boat away. So finally at about 8.15 pm we docked and i reached my place at about 9pm. Dumped everything in the tub and then headed off to work to fix that small problem. It wasn’t big of deal to get it fixed and then after having pizza for dinner , I finally dozed off at about 12. It was end to a very long and satisfying day of diving.

9 responses so far

Jul 23 2008

Reducing Main Application file size in Flex

Published by under AS 3.0,Flex

I know you might have come across the usual posts for reductions of file size of a Flex swf. Some of them are listed below incase if you don’t already know about it.

  • Use the optimize parameter for the compiler.
  • Don’t embed images, load them during runtime.
  • Use only classes which are required, import only single class instead of the complete package.
  • try using modules instead of developing one single application.
There is one more thing which is really useful if you are looking to  and i haven’t it being discussed that much.
 
Convert your CSS files into SWF files and then load during runtime.
 
When you use stylesheets to customize your Flex application, we usually import it in the mxml using the <style> tag. I would recommend using StyleManager class to load the styles swf file during pre initialization of your application.
 

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” width=”1024″ height=”768″ preinitialize=”applyCSS()”>
 

applyCSS would look something like this,

private function applyCSS():void{
StyleManager.loadStyleDeclarations("styles/mystyles.swf")
}

 

To convert your CSS into SWF in Flex Builder simply right click on it and then select convert to swf file. 

Overall ofcourse your will be still loading in that styles swf file, so the bandwidth usage will remain the same but the initial load time will be less. 

 

You might argue that it will be the same wait time for user to interact with the application but atleast the initial preloader will be on screen for less amount of time. 

 

Also depending on your application you can break it into multiple stylesheet documents and then load the required styles when a particular module loads thereby getting a lot of leverage from this technique. Hope this helps :)

One response so far

Jul 21 2008

References and how they work in Actionscript

Published by under Flash,Flex

This tutorial/article is mainly for newbies/intermediate programmers. Someone who is writing Actionscript code without coming from C or Java background will benefit from this. 

A quick test to find if this article is for you, without executing this piece of code can you predict what will be the trace statement will output,

function referenceTest():void {
var mainArray:Array = new Array("1","2","3","4");
var tempArray:Array = mainArray;

tempArray.pop();

trace(mainArray.length + " is the length ");
}

 

Be honest and if you think the answer will be 4 then you definitely need to read this article and understand it. Still confused???? now you can run this piece of code and then you will find that the answer is 3.

how is this possible? We are not modifying mainArray at all, yes we are not modifying the reference to the array but then we are creating another reference to this array and then using it to modify the array. confused still, i need to explain it in more simple terms.

Lets take a look at the picture below, forgive my drawing skills but i think it serves the purpose,

 Pointer example

var mainArray:Array = new Array(“1″,”2″,”3″,”4”);
this line of code actually creates a reference which we have called mainArray. This reference points to an array class.

 

var tempArray:Array = mainArray;
one would expect this to create a duplicate array but no, we are just creating a new reference to the
same memory block, this reference is called tempArray.

 

tempArray.pop();
now we are using this reference called tempArray to modify the block of memory its pointing at, and hence that block of memory changes and we have only 3 elements in this array now.

Since mainArray is a reference pointing to the same block of memory as tempArray is, whenever we use mainArray reference it has changed now and its length is no longer 4.

 

if we do something like this, var tempArray:Array = new Array(“1″,”2″,”3″,”4”);
then we are actually creating a new block of code in memory and any changes to tempArray won’t affect mainArray.

hope now your doubts have cleared.

Remember, In Actionscript all complex data types are passed by reference and not by value.

 

Another test to find out if you understood how this works, try the following code, I am not including the graphical elements and i shall leave upto you to fill out the code for that.

package {

package {
    public class SampleClass {

        public var value:String;

        public function SampleClass() {

        }
    }
}

A sample test class to be used in our example, I am copying this code from Flex so will include only the actionscript code, you need to do proper initialization etc.

public var dataArray:Array;

//initialization function with an array holding the sampleclass instances
private function init():void{
    dataArray = new Array();
    for (var i:Number= 0;i&lt; 6 ;i++){
        var tempSample:SampleClass = new SampleClass();
        tempSample.value = String(i);
        dataArray.push(tempSample);
    }
}

//this function is called on button click
private function findSample(event:MouseEvent):void{
   
    //call the getSample function
    var tempClass:SampleClass = getSample();

    //if we find a match then we will change its value
    if (tempClass){
        trace(" found something lets change value");
        tempClass.value = "found yay";
    }

    for (var i:Number = 0; i &lt; dataArray.length ;i++){
        //what do you this this trace statement will output
        //will it show the modified value or will output 0 through 5
        trace(dataArray[i].value);
    }
}


//this function is called from the findSample
private function getSample():SampleClass{

    var foundSample:SampleClass;

    //get the string on which matching is to be performed
    var findSample:String = sampleText.text;

    for (var i:Number = 0; i &lt; dataArray.length ;i++){
        if (dataArray[i].value == findSample){
            foundSample = dataArray[i];
            break;
        }
    }

    return foundSample;
}

Once you get run this modify the getSample function as shown below and compare the results. It should give you a better idea.

//this function is called from the findSample
private function getSample():SampleClass{

    var foundSample:SampleClass = new SampleClass();

    //get the string on which matching is to be performed
    var findSample:String = sampleText.text;

    for (var i:Number = 0; i &lt; dataArray.length ;i++){
        if (dataArray[i].value == findSample){
            foundSample.value = dataArray[i].value;
            break;
        }
    }

    return foundSample;
}

 

hope this article was useful, as usual questions, comments always welcome :) 

 

No responses yet

« Prev - Next »