Thursday, October 27, 2016

The Most Horrific Travel Story

As much as I love to travel, it always comes with some sort of horror stories for me. I wrote some of them in my Yet Another Travel Horror series before. However, each time I face some trouble somehow at the very last minute I get out of it, which happened this time as well. But none of the other horror stories is equivalent of what happened this time. So, here goes the most horrific travel story in my life.

It's been a while that I actually traveled somewhere. Moved to Raleigh around the end of June, and didn't have the chance to go anywhere. So, when I had the chance to go to a conference in Montreal, I was definitely more than excited to have a break from my routine work life and see some new places. I've a photographer friend in Ottawa who I've known for few years. We always talked about meeting up but never had the chance since it's hassle for me to go through visa application procedure and all. Since Ottawa is pretty close to Montreal, I told my friend he should visit me, but he said I should go to Ottawa instead as it's the capital of Canada. After seeing some pretty places there he'll drive me to Montreal the next day. So, I changed my plan and decided to go to Ottawa first for a day. But now I really wish I hadn't done that..

I reached Ottawa on Saturday afternoon and got super excited to see pretty fall colors, even though it was cold and raining. Since I had to leave pretty early for my flight, I was super hungry and we decided to go for lunch somewhere in China town. I get on the car and put all my bags on the back seat (mistake 1). We parked the car on a street, it was a quite busy area. When leaving I told my friend if I should take my bag pack with me (which I always do but I was tired of carrying), and my friend said that it's a safe area and it should be fine. So, I took out my wallet and left everything else there (mistake 2). Little did I know that I'll have to prepare myself for one of the biggest shocks of my life! We come back from lunch around 30 minutes later, and one of the car glasses was broken and both of my bags were gone. I always tell people I carry my whole life in my bag pack cause it's always heavy. Literally my whole life was gone with my bag, including my MacBook Pro and passport with USA and Canada visa. The only other time I freaked out in my life was when I got the news of my dad passing away, then there was this one. I didn't want to think of the consequences since they can be so big. If I were simply a tourist then it'd probably be easier, I would directly go back to my home country. But in my case, I've a US student visa though I started my job under OPT. My home country isn't my home now, I've a home in Raleigh where I live and work and have to come back. In order to do so I've to show my passport, visa, valid original I-20, work authorization permit and proof of employment at the border. And I lost them all other than one card, which meant I had to contact all those related people in the right order to get those IDs reissued. That doesn't only involve time, money and extra effort, but unnecessary human interaction with the type of people you usually don't want to interact with without any reason.

Next four days were complete nightmare and I possibly would never want live that ever again in my life. First important thing I learnt is, my country's embassy doesn't have any emergency protocol for such situation. This third world country stopped issuing hand written passport last year November and to issue machine readable passport it can take up to two months, which is not guaranteed. So, what do I do in such situation? Stay in Canada like a homeless person without any status? Does BD government have no liabilities to ensure the protection of their citizens in foreign countries? My campus HR wasn't of the greatest help either when I asked them to send me my I-20 copy. Also, my roommate was out of town too, which made things worse as I had some copies of my documents in my room. My house keys were in my bag, so they were lost too.

It was a completely uncertain situation, totally out of my control. The only thing I was trying to do is stay calm and act rationally step by step. My stress level reached higher than the highest it could get, and I started to have my old chest pain that happened after dad passed away. But I decided to go to the conference since that was the sole purpose of my trip and figure out the rest gradually. Then on Tuesday afternoon I get to know that my passports were found! Apparently the thief of someone dropped them in the Canada mailbox and they took them to my embassy. My employee ID card was there too. Luckily I had decided to attend the conference, otherwise if a new passport was issued in the mean time it would make no difference to get back my old one. So, all the puzzle pieces fit together right on time and I could make it back home. It felt like a complete miracle but somehow I was rescued at the last minute again. There are more details of the story but I'll leave it to that.

I'm still trying to recover from the shock and stress, and dealing with lots of different emotions. I always trust people instantly and never believe someone would cause harm to another innocent person, but that's definitely shaken. I'm having hard time believing in my future self who would make decisions for me. I've made so many mistakes while making decisions and failed myself as a proper intellectual adult. I need to think how to better myself and avoid unnecessary hassles and stress. I've always been fine traveling by myself but now I feel paranoid. It'll take some time to get rid of this anxiety but at least hope this huge life lesson taught me something! 

Moral of the story - be careful wherever you go, not because you don't trust others, but for your own sake, because one simple mistake can change your life forever.

Sunday, October 16, 2016

Fun with Data - Basics of R - Part 2

In our first post on R programming language I covered how to download R and R Studio, understanding the structure of R Studio, and loading datasets into R. I meant to continue the series (as I always do), but couldn't get back to it any sooner. Recently I've started working on a workshop where I'll be teaching R to the beginners. So, I thought this would be the best time to add more content to this series as well. 

In this Part 2 I'll write about the following - Understanding prompts of R Studio, doing basic calculations in R, all about variables, functions, the concept of vector in R, and data frame. Some of these I should have covered in Part 1, but better late than never!

Prompts in R Studio
  • In console a new line starts with >, means it is waiting for us to communicate
  • If we give it an incomplete command then it returns +. Press esc button to return to a new line.
  • To quit R type q()
Doing Basic Calculations in R
  • The order of arithmetic operations is  (left [done first] to right [done last]) : ^ / * - +
  • ^ is used for raised to the power of, followed by division, multiplication, subtraction and addition.
  • At the prompt, we enter the expression that we want evaluated and when we hit enter, it will compute the result for us. For example: > 10 + 22 will return [1] 32
All About Variables 
  • Variables are the symbols that store assigned values. We can store a computation under a new variable or change the existing value of an old variable.
  • Variable names in R are case sensitive (upper or lower case).
  • It is a good practice to assign meaningful variable names that helps to refer to easily for complex calculations.
To assign a value: variable_name <- value
Example: x <- 100

ALERT! Reserved Symbols!
In all programming languages certain symbols are reserved for specific purposes. The reserved symbols in R are - c q t C D F I T (So, don't use them for your personal variables ^-^)

Functions
A function is a sub-program that performs a specific task. For example, to find a square root of a given value. It helps to avoid repetition and easy execution in future. 
Try this code to understand how functions work -
firstFunction <- function(n){n*n}
This function named firstFunction is supposed to return square of any integer. Test it out by assigning different values to the function. Think of what other functions you can possibly write.

Vector
Vector has different meanings in different contexts. In math and physics, a vector is an element with both value and direction. But in R, vector is a sequence of data elements of the same basic type. It can be defined by concatenating the members in a set c(). Example: x <- c(1, 2, 4, 5).

Once we have a vector of numbers we can apply certain built-in functions to them to get useful summaries. For example:
> sum(x)        ## sums the values in the vector
> length(x)    ## produces the number of values in the vector, ie its length
> mean(x)     ## the average (mean)

Data Frame
A data frame can be created by defining different variables for each column as vectors and then joining them together.
Example: Let us assume we have a list of different fruits with their names, colors and size.
> name      <- c("apple", "banana", "peach", "watermelon", "grape")
> color      <- c("red", "yellow", "peach", "green", "red")
> size_cm <- c(10, 15, 8, 40, 2)

Then we add these three columns together to create the data frame names fruits.data.
> fruits.data <- data.frame(name, color, size_cm)

To see the values of the data frame -
> fruits.data
        name      color       size_cm
1      apple        red            10
2     banana      yellow      15
3      peach       peach         8
4 watermelon  green         40
5      grape       red             2

--------------------------------------------------------------------------------------------------------------------------
I think we've covered a lot of basics concepts already, so I'll stop here today. In the next post of this series, I'll write about setting work directory, manipulating datasets, and playing around with some plots/visualizations, and hope I can make it sometime soon! 

Sunday, October 2, 2016

My First Race

I've been running for about 4 years now, but I mostly run for fun, it helps me with stress. When I was in Japan I used to run only when it was warm outside, didn't really go to the gym. Since I moved to Illinois running became more frequent, and I loved our campus gym. So, snowy winters didn't stop me from running indoor on track. However, when it came to signing up for races, I kept going back and forth, but finally I did it! :D

Today I ran my first race - Historic Hillsborough Half Marathon and Fleet Feet Five K. I ran 5K many times before, so I thought it won't be a big deal. But since moving to Raleigh I couldn't run outside as much for the terrible heat, and wasn't active as much for last couple of weeks for flu. Also, it was very flat in Illinois, but this race area was very hilly (of course it makes sense because it's Hillsborough!), for which I wasn't well prepared, and felt terrible when I had to stop to breathe. Anyway, I thought I was pretty slow and one of the last to finish, but was glad that I almost made it among the first half finishers :)



Overall it was a good experience and a good start. Now I know how it feels to run with hundreds of people, often for a cause, and can train myself for longer runs. Weirdly enough, North Carolina doesn't have many 10K races. Most of them have two options 5K or half marathon, which is a pretty big jump. I really wish I could do a 10K in between, but I think I'll start to train myself for a half marathon soon. 

The race t-shirt and the medal were pretty rad! Did they know that I love mustard color?! I think I'll be wearing this t-shirt a lot! :D
Race Goodies