Easy Sumif in R Using The Aggregate Function

This is a really simple (i.e. probably even the most basic possible) example of using the built in aggregate() function in R, basically a sumif in R. Given a set of data where column a is the values and column b contains the data by which you wish to group (in this example categorical data with values of a or b): > data a b 1 0 a 2 0 a 3 1 b 4 2 a 5 2 b 6 2 a 7 3 b 8 4 b 9 7 b The aggregate function as I have used it below takes the following arguments -- data$a is the Read more [...]

Top 10 HTML Beginner Resources

Beginning with HTML Over the past few weeks I've noticed a few people have been asking me if I had any tips for the best HTML beginner resources. This is something that comes up for myself once in while when needing some bit of HTML reference that I have forgotten through under-use. In order to kill two (three?) birds with one stone I thought I would make a list for myself--in the form of a post--that I could share with those people. There are lots of sites with tutorials and tips on HTML Read more [...]

3 Apps To Improve Samsung Galaxy S4 Battery Life

Improving the Samsung Galaxy S4 Battery Life What follows is a short intro to 3 apps that in my experience have improved my SGS4 battery life -- your mileage may vary and I can't be to blame for any damage caused! That said, I don't think any of these should render your phone unusable :) CPU Tuner This is the daddy of all battery saving apps, and works best when your phone is rooted. There are plenty like this on the Google Play Store, but this in my opinion is the best. Instead of filling your Read more [...]

Pretty print JSON in Python (snippet)

The below depends on the json Python module to 'pretty print' JSON output in Python. I found this useful when trying to write my script to remove unused Todoist labels. import json # This function saves time printing JSON nicely def pj(str): print(json.dumps(json.loads(str.content), indent=4)) return pj(thing_containing_raw_json_here) Note that in my case this was contingent on having used the requests module in the following fashion to already make sure the format is a bit jsonified, Read more [...]

Todoist: Remove unused labels

Want to remove your unused labels/tags from Todoist in bulk? The various GUIs will have you do this one at a time but I have written a small, not very efficient Python script that will do this for you. Here's how it works: You need to provide your API token (Which you can find in Todoist settings) in a file called token.txt Then download or copy the script from my Todoist Remove Unused Tags GitHub repository Just run this using Python and it should work fine Please bear in mind I've Read more [...]