Trials and Tribulations of MongoDB: Part 1

I decided to learn MongoDB after someone recommended me to use it for some data that I am working with at my internship. I also thought it would be a good idea because in theory, it sounds a lot better than dealing with the csv files I am working with for my dissertation research. Many people have a lot to say about their experience at a hospital or clinic on Google reviews or Facebook, and such data can be pain to deal with in a csv file.  Plus, I heard that MongoDB does pretty well with geospatial data.

Day 1 involved trying to install MongoDB on my computer. That took like an hour. I followed the instructions on the MongoDB website and it was smooth sailing until step 3 under “Configure a Windows Service for MongoDB Community Edition” in which I needed to “create a configuration file.” HUH? Thanks to most people’s friend, Google, I realized I needed to create a text file with some specified parameters(listed under step 3) and save it with the .cfg file extension. I tried doing that in MongoDB, but then I got a nasty message about not having administrative privileges in creating a text file. So then Google helped me out again, and I learned how to make a text file within one of the three command prompts that was open(I used the command prompt with administrator privileges). That probably took almost an hour, and I was done for the night.

On to Day 2, which was trying to figure out how to do the “Import a dataset” part of the MongoDB tutorial.  Well that took 47 minutes. I ended up not using the command that was listed in the tutorial, and I realized I made a mistake regarding the file extension in which to save the data. I thought I wrote the .json file extension when I saved the file and I did, but it ended up saving as .json.txt. My bad. Anyway, that took too much energy and yet again, I’m ending my night, right after I finish this blog post.

I’m sure MongoDB will be useful for me for me to know in the long-term, but I’m not going to lie. I am currently riding the struggle bus when it comes to learning it. That being said, I’m taking notes on my Github to help me out during this hilly journey to being competent in MongoDB.

Advertisements

A Space for Belonging within Geography

I have been studying Iyengar yoga for a couple of years and I am interested in becoming a Certified Iyengar Yoga Teacher(CIYT) so I can share the mental and physical health benefits of Iyengar yoga to others. Thanks to a scholarship I received through my regional Iyengar yoga association(IYASE) I was able to attend an Iyengar yoga teacher training this past weekend for the Introductory and Intermediate Junior certifications. I really enjoyed what I learned, my fellow classmates, and the teacher who conducted the training. The path to becoming a CIYT is long and will probably be as intense as pursing my PhD(the Iyengar yoga teacher assessment has their own version of  written and oral comps!) but I am ready to embark on the journey. Even though I was probably the youngest one there(Iyengar yoga tends to attract an older demographic), I did not feel out of place and I was able to actively engage with everyone during the training. How was this the case? I felt that this active engagement in talking about the subject matter in an intelligent way allowed us to rise above the preconceptions of various things not only in how we engage in our practice and teaching, but how we engage with each other. While I am no yoga philosophy buff, I feel that this touches on the concept of transcending avidya (ignorance) which tends to cloud our judgement and prevent us from seeing our true selves and others.

Since the training, I have been reflecting on my experience during the training, yoga philosophy, and being a person of color in my discipline.

It is interesting how a sense of belonging can vary through the spaces and places we occupy, even if they are both homogeneous. I am currently  pursuing a PhD in geography, which is rather homogeneous in terms of race.  However a big area of interest within the discipline is to research issues around race. While one would think that such an emphasis on studying race would lead to a more inclusive environment, this is not necessarily the case. The fact that the discipline is homogeneous can lead to a large amount of avidya regarding race(what some geographers such as Laura Pulido(2002) refers to as “lack of critical mass” or what Minelle  Mahtani(2014) refers to as “toxic geographies”) and to be honest, some of the comments I hear or read about people of color are extremely unsettling at times.

I feel that attachments to such kleshas(afflictions, colorings, or obstacles depending on the interpretation) can lead to such unintelligent conversations regarding race. Especially given the political climate, these uncomfortable conversations and actions (from both well-meaning and not so well-meaning people) have increased. At times, it can be overwhelming and I am grateful to have a yoga and martial arts practice which is able to keep me somewhat grounded. In Light on Yoga, Mr. Iyengar mentioned the various levels of students(I do not have the book on hand to give the specific levels), and I would have to say I’m right there in the middle(always room for improvement).  Whenever doing Iyengar yoga or Brazilian Jiu Jitsu(BJJ), full concentration has to be on the movements you do. It’s a way for me to engage in pratyhara(withdrawal of the senses) which allows some peace of mind(even when put in a submission in BJJ).

Next month, at the American Association of Geographers(AAG) annual meeting, I will be on a panel in which I will be able to discuss issues that women geographers in STEM fields face in the discipline and I am wondering how I will give a presentation and engage in a conversation on a topic which might make some people uneasy. I still have some time, so I will be engaging in a lot of svadhyaya(self-reflection, self-study) so I can present and speak on this topic in an intelligent manner in order to create a space in which panel participants and audience can actively engage on these issues.  Being able to do this will not only foster creating  a space of belonging within the conference room, but hopefully in the long-term, within the discipline as well.

References(being a good grad student here).
-Mahtani, M. (2014). Toxic geographies: absences in critical race thought and practice in  social and cultural geography. Social & Cultural Geography, 15(4), 359.
– Pulido, L. (2002). Reflections on a White Discipline. Professional Geographer, 54(1), 42.
– Yoga Sutras of Patanjali (n.a). Retrieved from http://www.swamij.com/. (note: At the moment, I I prefer the Bryant translation and commentary of the Yoga Sutras but this website is a pretty good resource as well).

Add Some Spice in your Life for Your Life?

spicygiphy

I love spicy food. If spicy food makes me tear up, it makes me happy. I used to not be a lover of spicy food, but I gained a great appreciation for it when I lived in South Korea for two years. Geography can indeed have an influence on your taste buds! Last month, a friend of mine posted a New York Times article about the health benefits of spicy food, which was titled “Eating Spicy Food Linked to a Longer Life. According to the article, in a study that was published in The BMJ, researchers concluded that having chili peppers either once a week or once or twice a week reduced mortality risk by 10 percent and consuming spicy food six to seven times a week reduced mortality risk by 14 percent (Bakalar, 2015).  So does this mean that gives a spicy food lover free license to gouge their food with hot sauce? Not so fast.

Taking a more in-depth look at the study, there seems to be more to the story. When looking at the absolute mortality rates, the difference between the group that ate the spicy foods less than once a week (6.1) and the group that ate spicy foods six or seven days (5.8) a week is quite small compared to the groups that ate spicy foods once or twice a week (4.4) and three to five times a week (4.3) (Jun et al., 2015).  The article merely mentions that the mortality rates for cancer, ischemic heart disease, and respiratory diseases were lower among the group that ate spicy foods six to seven days a week.  Looking at the actual range in which the risk for mortality can lie shows that this is not as black and white. The group who ate spicy food six or seven days a week actually had a zero to 15 percent chance of having a reduced mortality risk due to cancer, a zero to thirty percent chance of having a reduced mortality risk due to Ischemic heart disease, and a three to 33 percent chance of having a reduced mortality risk of respiratory disease (Jun et al., 2015). These ranges have a 95% confidence interval which means that there is a 95% chance that the actual range falls within these values.

The article says that the researchers did not draw any conclusions about cause and effect and said there needs to be more evidence.  So while the title says one thing, in the end, the authors do not want us to jump to conclusions. In the actual study, they even mentioned that eating spicy foods might be correlated to other dietary and lifestyle behaviors (Jun, et al., 2015). In addition, geography could play a role as well. Those who ate more amounts of spicy foods lived in rural areas(which could mean cleaner air quality) and more fruit and vegetables. While there needs to be more research regarding the relationship between spicy food consumption and mortality risk, it certainly doesn’t hurt to add a little bit of spice to your life. Health practitioners can find this information to be useful when working with patients who are suffering from the diseases mentioned in the study. In making suggestions for changing one diet, practitioners could mention the possible benefit of chili peppers in terms of reducing mortality risk. Patients can encounter difficulty knowing where to start with making major dietary changes and this information could  be helpful to them.

SOURCES
Bakalar, N. (2015). Eating Spicy Food Linked to a Longer Life. New York Times. Retrieved from

Jun, L., Qi, L., Yu, C., Yang, L., Guo, Y., Chen, Y., Bian, Z.,…Li, L.(2015). Consumption of spicy foods and total and cause specific mortality: population based cohort study. BMJ 351, 1-10.

My Rough Outline on How to Continuously Collect Tweets

Using big data for one’s research is considered to be the “it” thing nowadays, especially in geography. However, understanding the process can be rather difficult for people who are somewhat tech savvy, but have little to no programming background. There’s so much information out there, but it can be difficult to follow for the newbie. Many of the articles written will say “for the beginner” but it can still go beyond one’s existing knowledge base.

By the beginning of the year, I would like to conduct an automated twitter collection of tweets about the Veterans Health Administration. I’ve been trying to figure this out for a couple of months now and I finally was able to figure it out. I’ll give a rough outline of the process I went through and explain in detail what I did in subsequent posts. I’ll also post a list of important keywords on a separate page for those who are like me and are just getting started with all of this.

  1. Choose the program you want to use. For me it was R vs Python. R won due having to use it for a class I took this last semester so I am more familiar with it.
  2. Deciding whether want a constant collection of tweets or not. You will have to use something called an Application Program Interface(generally referred to as an API) in order to do this. I think of an API as the middleman between me and Twitter. I have a request and the API will access Twitter to process my request. Twitter has pretty detailed information on how their API works and I highly recommend you read it. I would focus on the OAuth, REST APIs and Streaming API sections.
  3. Write the script for the program. You will have to download and install packages that allow you to have access to the Twitter API in whatever programming language you choose.  Look over the documentation regarding the package so you have an idea on how the package works. If you don’t completely understand, it’s okay! Having even a slight idea on how the package works is better than having no idea on how it works.
  4. Do a few test runs so you can get an idea of how your code works. Try to collect tweets for five minutes, ten minutes, an hour and three hours. Notice the quality and quantity of  the information you get based on how long you keep your program running.
  5. Find out how to automate your code. This really varies on the programming language and operating system. I am concerned with automating R script on a Mac. If you are using a Mac, you will need to use something called launchd in order to do this. I would recommend purchasing a program called LaunchControl which makes things a lot easier. You will need to create a job using this software to run your program for a certain time interval.
  6. Do a test run of the program using launchd or LaunchControl for a certain time period. I ran the program for a day just to see the average number of tweets.
  7. Purchase an external hard drive to store your tweets so you don’t eat up all the memory on your computer.

I will warn that you will get frustrated with the process. Don’t give up! I definitely did and started to backtrack here and there or tried to add more elements to the process than I needed to. If you get overly frustrated, just walk away from your computer for a while and come back to it once you’re in a better state of mind.