Monday, June 22, 2015

My Journey Into New Territory: C#, Roslyn and APIs

    I've been trying to teach myself C#, mostly by playing the Code Hunt puzzles to learn its differences from C and C++, and writing basic programs. I did this in the name of speedy learning- something I previously considered my forte. As it turns out, this isn't a good way to get a solid foundation in any language, so writing more detailed code in C# for my research tasks has been rough. I've had to go back and relearn everything I've known about functions, objects, classes, overloading, and file i/o from C and C++, because besides the C in it's name, there isn't much in common with the other languages I know. The sunny side, however, is that I have now been exposed to completely new methods and system calls that implicitly perform a whole bunch of operations. I am now confident that when dealing with advanced tasks, C# has my back. I've also had to learn about file and directory manipulations, and from navigating and searching directories to creating and writing files I've gotten a lot of insight into the workings of installer packages. My conclusion is thus: C# is pretty neat. I think I'll make it my default language.
    In the past weeks I've had to learn about APIs, a new topic for me. An Application Program Interface, consists of building blocks for software. APIs determine connections and compatibility between software components, and you use them to create graphical user interfaces. An API gives you a set of routines and you make calls to the API to do what you want. They are used in just about every website you love, from Google Maps and YouTube to Twitter and Amazon. The API I will be using is the Code Hunt REST API, which essentially provides core data from the website, for example data from users such as their experience, and number of attempts for a given level. Every programmer is going to come into solid contact with APIs, so this is a very important experience. I'm going to get my hands dirty with the Code Hunt API as soon as I can figure out what calls I can make to it, and just how it can work with a compiler.
    When I first began coding I came across the .NET Compiler Platform known as Roslyn, a compiler platform for C# and Visual Basic. Because it's compilers come with APIs for code analysis, it will be a very useful tool in the weeks ahead. It is only available on Visual Studio 2015, so if you intend to use it, you have to download and install VS 2015 Community or Enterprise(Community is free but Enterprise costs $$$). I plan to use it to parse the user code obtained from the Code Hunt API. Looking at sample code that shows how the two work together is quite daunting. I can hardly get a sense of which calls are to the REST API and which code is for Roslyn. I will have to test the sample code to find out which is which. That will be my exploration for the immediate future. I'll let you know what I find.

Saturday, June 20, 2015

No Knowledge is Lost

Last summer I was still very new to the concept of coding, mostly because it was not offered at my high school. I had already taken a college course here, at the University of Illinois Urbana- Champaign, on programming with MATLAB. I received an A in the course but mostly because a friend of mine helped me through the class (Thank you, Nishad). I did not feel satisfied by the level that I was at by the end of the school year and so after talking other students and professors, it was recommended that I try learning code online. The site was highly recommended to me was Codecademy, I immediately signed up but I concede that I had my doubts that I could actually teach myself to code in a new language over the course of a summer. Codecademy offers several languages such as Javascript, Ruby and HTML. After doing some research online I decided that Python was the best language for me to begin learning. The Codecademy Python course is listed as a 13-hour long course and I had 3 months to learn the language. Slowly, but surely as I went through each lesson I felt more comfortable in the mystic realm that is coding. I began to think to myself, 'Anyone can teach themselves to code with enough interest', and I believe this to be true. Learning Python on my own helped me significantly in my sophomore year and made me love coding. Not only has it been a fun experience for me it has opened opportunities for me. Fast forward to my next summer and I am now writing code for research in the very language I knew nothing about a year ago. It is only now that I understand an adage my dad has reiterated to me: "No Knowledge is Lost".


File Extractor

More Progress

After two weeks of conducting research for developing tools for Code Hunt, I have gotten accustomed to writing code in C#. When I first exposed myself to the language, I noticed there is a ton of classes that are presets to Visual Studios; so I took the time to learn about all of the included classes that are apart of the program. After learning these new presets of classes, I was basically able to complete my first task of my project. For the tool that I am developing, so far it is a data extractor that functions on the interaction of the user. You have to specify which user and sector and level in order to extract the data. Right now I'm going to design the user interface of the program. I'm pretty excited about developing this tool, because it allows me to practice more get more programming experience. I would like to optimize the code since I am also taking a data structures course so I would like to make sure that my application does not create memory leaks. More updates on the program in the future!


Friday, June 19, 2015

Computer Science Prestige

Do students want to pursue Computer Science because it is a prestigious career field or because they truly have a passion for computer science? Are some people primed to become Computer Scientists their whole life while others have to try to adapt to fit the mold? It's true that certain people are predisposed to become computer scientists in their life. Overexposure to technology, advanced technical courses starting from middle school, tons of connections in the technology field from an early age. Their brain is being trained to think like a Computer Scientist which is why when they reach the "challenging" CS course, they're able to test out or pass with flying colors. What I'm interested in, however, is if it is possible to develop the mind of a Computer Scientist at later ages, after adolescence. Can you teach yourself to develop programs, read and understand code, or even wrap your mind around recursion after a certain age? I'm curious because I've noticed that even with the best of teachers and one hundred percent application of self, even the brightest people cannot come to terms with the jargon of developers or be able to think abstractly as one would. Now, directed at the huge and increasing number applicants to Computer Science programs per year, are you pursuing it because of the prestige or do you truly have a passion to write code day in and day out for the rest of your life? This blog is loaded with questions because these are things that I wonder daily and probably applies to a decent percentage of Computer Science applicants.

Nevertheless, Computer Science is a very promising and awarding field and congrats to those who are able to make it through. I hope to see a day where people can pursue what they love and not just do things for the money.

One Way To Not Ruin Your PC

    I would be using this blog post to talk about CodeHunt, and the research I just started doing on it but my laptop is damaged and I'm in the process of getting it repaired, so instead I'm going to explain what caused it's failure in the first place. Before the arrival of the blue screen to announce the breakdown of the system like a grim reaper signalling death, the computer was as reliable as any gadget out there. The technician who I took it to for diagnosing the problem and fixing it tells me my internal hard drive is corrupted. This doesn't seem like the worst possible case- a processor or motherboard could be more expensive to replace- but it's not that easy on the pockets. It also means I have to re-install Windows 8, and Microsoft being unable to recognize my product key means I may have to buy it again. So I'll want to keep this from happening in the future.
    You might be interested to know- how does a hard drive get damaged? Well I asked the technician, and he described the workings of a hard drive to me. It involves a disk with a pin resting lightly on it as the disk spins, similarly to a CD or gramophone player. The pin is what is responsible for reading data off the disk, as you may have guessed, but apply pressure to the pin while the disk is moving, and it scratches the disk. Eventually the scratches make it unreadable. That is one way to corrupt the data and render the hard drive unusable.
    Since the drive is still being accessed in sleep mode, the disk is still spinning. This is what enables you to continue using the PC without having to reboot the operating system. He further explained that many students put their laptops in sleep mode and place them in their backpacks and walk about with them. Then the laptops get knocked around a little here and there, sometimes a lot, and the disk gets scratched and it's lifespan gets reduced, since the disk wears from the pin contact in due time anyway. Guess who's guilty of doing exactly what he described? Guess who also will not be using sleep mode anymore while packing up to go to the next lecture?
    Hibernating seems like a better alternative, but I can tell from the sounds coming from the computer that the disk doesn't immediately stop spinning. So if I'm going to keep this from happening in the future, I'm going to err on the side of caution and shut down the system whenever I need to move the laptop. You can learn from my mistake; consider yourself warned!

Thursday, June 11, 2015

Lab of Things

Lab of Things is a platform developed for experimental research by Microsoft Research. Lab of Things or LoT for short uses connected devices such as Z-wave sensors or cameras in homes, offices and workspaces. What makes LoT so useful and uncompromising is, it makes data and code sharing very easy. This is due to the high interconnectivity of the devices and the use of an operating system called HomeOS. When I first came across LoT, I was not exactly sure of the full capacity of functionality. By watching the video on the LoT home website ( titled "New Hope for People Living with Paralysis", it became apparent to me that this was a concept that could change lives. This piqued my curiosity and I was hoping to see what I could do with LoT. I rushed to the page that specified how to download LoT and was directed to the installation requirements. Unfortunately, my journey began before it ended as my Macbook Pro certainly does not have Windows 8 or 7 on it. 

Computer Science Is All About Ideas

Computer Science is all about ideas. You don't need to be the fanciest programmer in the world or even the most efficient. All you need is a good idea to get you started and there are many resources to help you along the way once you get started. I know tons of people who have plenty of ideas but are stopped short when they are unable to find someone who can help bring their idea to fruition. That's exactly the kind of person I want to be. I want to be the guy that helps other people bring their ideas to fruition, exactly how they pictured it when it first came to their mind. I don't really have any experience besides the little HTML I did in my younger days and I haven't made any programs or mobile apps, yet. But I plan on taking the necessary steps to get the knowledge to get the job done. My short term goal in the realm of computer science is to make a program, a mobile app, anything that will positively impact the campus community and become a useful tool.

P.S. - It's crazy that you it is not necessary to be a Computer Science major to become a computer scientist. The introductory courses teach you the fundamentals - how everything a computer reads is binary, how to use bitwise operators, etc. However, you don't really need to know anything about these things to make programs or apps. Especially sine the development of templates such as Ruby on Rails.

Monday, June 8, 2015

Code Evolution + Lab of Things

What Was Researched

For these past two weeks, I have been researching how Lab of Things worked and started my first research project where I need to analyze a user's current input status on levels in Code Hunt.


In terms of Lab of Things, I found the concept of LoT very interesting and how powerful and convenient the program can be when implementing the source code. When I discussed LoT to some of my fellow peers outside of my research group, the first comparison that came up was Internet of Things. It is somewhat a similar concept to LoT in terms of interconnecting devices and having them communicate with each other to fulfill an objective or conduct an experiment. I know sometime in the future I need to try to come up with something that revolves around LoT, which can be very difficult to do. However, I see the program as a high risk and high reward situation. I was thinking of using LoT to control an Xbox Kinect device in some way since I do have access to this device. 

As for the code evolution project, here are my thoughts and expectations in concerns to the project. I think something that I would like to do with this project after extracting code versions to analyze a user's approach to a problem, is to create a data extractor from a user at certain level at real-time. As for the animation part, I believe that should not be an issue if I were to use ActionScript 3.0 in order to complete the animation portion. What will be interesting though is combining both tasks together since I never had to use two different languages to get an application complete. What I might do is make a testing program that will extract any data that I enter and delete. Once I get that portion complete, I will just use that same code in order to extract entered code from a Code Hunt level. Something else I may want to add on is small little details as in statements for progression of code such as "Deleted line 4" or "Added a loop". I think that will be somewhat helpful instead of just staring at someone's progress at punching in characters and delete them until they find a solution. So maybe a data log would be a nice add on.


I'm looking forward to this progress because I think it would definitely challenge me in terms of what I learned this past semester and some of the research I have been doing on other languages, plus figure out the discrepancies between C++ and C#. Also this is a chance for me to work on UI design since I would be making a code evolution tool. Planning on doing a lot of research on this portion of the project. In a couple of weeks I plan on having the code portion done and simply just need to get the UI finished and tidied up.