Showing posts with label school. Show all posts
Showing posts with label school. Show all posts

Friday, July 17, 2015

changes: some big, some small

Recently, I did the unthinkable: I switched text editors. I've been a longtime user of vim, but I'm  pretty curious and its hard to ignore the power emacs has, even out of the box, so I decided to give emacs a shot. Stock emacs comes with a lot of power. Namely, a built in web browser, IRC client, email client, and a package manager to install countless plugins. Plugins were always kind of patchy with vim, and it's refreshing to use a built-in package manager

However, I am well aware of the RSI risks associated with using emacs, and I'm already well-versed in vim commands, so evil mode was one of the first plugins I installed. I have to say, vim is nice, but you can get everything that vim offers inside emacs, plus so much more.

Also, you'll notice that the URL for my blog has changed. I recently created a personal site, so I thought I might as well make use of the custom domain name. My website contains a selection of some of my personal projects, a photography sample, as well as contact information and links to various social media sites. I haven't decided if I'm going to merge my blog and my website stylistically, but for now, I'm keeping the two separate.

Lastly, I'm facing a more important change in my life right now. I am an independent student, which means I don't receive any financial support from my parents for college and I don't submit their financial information when filling out my FAFSA. I depend on a lot of merit as well as need-based scholarships to be able to go to school. Last summer, I interned at RelateIQ, a Salesforce Company. This was one of the most educational and rewarding experiences of my life, but it had some unintended consequences that I was not initially aware of. This year, my FAFSA took into account the money I was paid over last summer and I went from getting nearly a full-ride, to nearly nothing at all. I would have to pay for my senior year of college completely out of pocket. I'm nowhere near prepared to do that, so I've decided to take some time off to work full time while paying off my current student loans and saving up enough cash to finish my degree at another time.

Fortunately, I am not at all disheartened at the prospect of dropping out. I look at this as an opportunity and a chance to grow. Plus, after going to college, I got to experience first-hand how much of a racket it really is. Because American society has the absurdly unsustainable belief that everyone needs a bachelor's degree to survive, universities have been bursting at the seams, and University of Illinois in particular has been buckling under the burden. I've had a horrible educational experience at UIUC, and I'm not ashamed to admit it. I feel no pride in having gone there, and I would not recommend it to anyone in its current state.

For example, in Computer Science and other engineering majors, it's nearly impossible to sign up for required core curricula. All of the core CS classes have absurdly long waitlists, and U of I has only recently hired another academic advisor for CS, bringing the grand total number of CS advisors to a paltry and inadequate two. Apart from UIUC's issues with scaling, the quality of courses has been outright pathetic in my experience. In class, I've had international TA's speaking to Chinese students in Mandarin, exclusively, leaving those of us who can't speak Mandarin wondering what we're missing out on learning. I've even had professors who refuse to give lectures, telling students, "I'm tenured, which means I can do whatever I want." UIUC truly is a pathetic excuse for an educational institution.

I won't say my time at U of I was completely worthless, just that after my own cost-benefit analysis, and given the university's current state, it's not worth it for me to attend anymore. I've made some awesome friends, as well as professional contacts. That's the true value of a college education: the people you meet. Without meeting the right people, there's no way to put your skills to good use.

However, I will say that I learned more outside of class, particularly in internships, then I could have ever learned while sitting in a lecture hall. I intend to finish my degree someday, but for now, I'm going to use this time to grow professionally as well as personally, while I sit back and wait for this whole student loan bubble to blow over. Maybe when I return, society will have matured and realized that it's not the degree that matters; it's the skills behind it.

Tuesday, April 1, 2014

use AppleScript and Automator to retrieve homework assignments

When I receive my Linear Algebra homework assignments, it's on a simple HTML web page that looks like this:

For the longest time, I have written the assignments down in my planner by hand, but I recently figured out a much better way to do this. Using a combination of Automator and some AppleScript, I was able to create an application to pull data from this web page, format it with appropriate due dates, and create reminders on Apple's stock 'Reminders' app. When the scripts run, I end up with a nice, segmented list of Reminders for my homework that ends up looking like this: 


To make things a bit more generalizable, I have it set up so that you pull up the assignment page in Safari and then run the service. It is dependent on having the assignment page in the current tab in Safari. If it is not currently open, it won't work at all.

To start, open Automator and create a new service. Call it whatever you want. I called mine "Get Homework"

First thing you want to do once you have created the service is create a new Text variable as a placeholder for the due date of the assignment. Go to 'Variables' > 'Text & Data' > 'Text'. I called mine 'dueDate'. It doesn't matter what you call it or what the value is. 

Then you'll want to set up Automator so that it pulls the text from the webpage and filters the text to look for dates. This is accomplished by using the actions: "Get Current Webpage from Safari," "Get Text from Webpage," and "Extract dates from Text".  

Note: You'll also want to use the action "Copy Text to Clipboard" right after you use "Get Text from Webpage" and before you use "Extract dates from Text" You'll see why later...

So in the end, your workflow should look like this:


Now here's where AppleScript comes in. I need to clean up the string that was generated by the "Extract dates from Text" action. Right after "Extract dates from Text", create a "Run AppleScript" action that accepts the input from the previous action. This script will take the input from "Extract dates from Text", which in my case is always something like "on Thursday, 03/20/14". Now, Applescript can't typecast that string into a date object without removing the "on Thursday, " characters. Fortunately, in my scenario, my professor stays consisting in displaying the due dates. It's always the standard "XX/XX/XX" after a comma and a space. I use the following script to format the date appropriately so that it can be stored in my 'dueDate' placeholder. 


From there, the generated string should be stored in 'dueDate' via the "Set Value of Variable" action.
Now, this is where the clipboard comes in. After the "Set Value of Variable" action, create a "Get Contents of Clipboard" action that ignores the previous action's input. After that, Create a "Filter Paragraphs" action. For me, I filter paragraphs that begin with "Section". That will give me a list of three text items with values like "Section 5.2: 8, 10, 12, 16, 22". 

Now I also want to pass through the 'dueDate' to my next AppleScript. An interesting thing about Automator is that if you generate a value right after generating a different value, the second item gets tacked onto the end of the list. With this in mind, I place a "Get Value of Variable" action right after the "Filter Paragraphs" action. This will give me a list with all the items in the list above, plus my properly formatted due date.


From there, create another "Run AppleScript" action that accepts input from the "Get Value of Variable" action. In that action, I use the following code to typecast 'dueDate' from a string object to a date object. Then I loop through the remaining list items, creating a reminder for each one with a the due date. After that, I create the general Homework reminder with the same due date which reminds me to rewrite my homework to make it look pretty for grading.



Now save the service. You should be able to open the assignment page and select 'Safari' > 'Services' > 'Get Homework' and your reminders should be generated. 

This concept should be generalizable enough so that you can adapt it for your own purposes. Obviously the implementation will change slightly based on how your professor structures his or her assignment page.