Skip to main content

Posts

An Introduction to CTest

I've seen a lot of people (I'm looking at you Daniel Lemire) praise newer languages like Go, which makes me sad as a C++ programmer. Well, that's until I realise that most of the features touted could be easily incorporated in C++ with just a bit of elbow grease. In this post, I'll show how to add an automated testing system using CTest.
Recent posts

An introduction to Vim macros

Vim is my favourite text editor, because it is minimalist while also being insanely configurable. While I may describe my ideal Vim setup sometime in the future, I do want to share some tips and tricks that make Vim so damn efficient for certain tasks. Today, I shall focus on macros.Here’s the key idea to keep in mind when discussing about Vim. Vim is not just an editor, it is a text manipulation program. Inserting text is just one of the many tasks that Vim can accomplish. A macro is a small Vim program that the user can record in order to make text editing more efficient.Consider a simple use case. Let’s say that I have a CSV file that looks like thisNew York,NY,USA Seattle,WA,USA Mumbai,MH,India Let’s say that I want to add another column at the beginning of each line that is sequentially numbered, like so1,New York,NY,USA 2,Seattle,WA,USA 3,Mumbai,MH,India I could go down each line and manually add each column, but there’s a better way. The solution is to program a Vim macro that …

Reading List, May 2017

Sam Machkovech, Facebook helped advertisers target teens who feel ‘worthless’, in Ars Technica, 30 April 2017. [Online]: https://arstechnica.com/business/2017/05/facebook-helped-advertisers-target-teens-who-feel-worthless/No surprises here, a quick discriminative filter could show who was depressed vs not, perhaps using something as simple as Naïve Bayes would probably work.Then I read that Facebook sells this data to advertisers instead of getting depressed teens some help. Eff you Facebook!Just last month, I wrote ‘STOP USING FACEBOOK SERVICES’. That advice still holds.Matt Inman, You’re not going to believe what I’m about to tell you, in The Oatmeal, 2 May 2017. [Online]: http://theoatmeal.com/comics/believeAn interesting read about the backfire effect.Mike Masnick, Don’t get fooled: The plan is to kill net neutrality while pretending that it’s being saved, in Techdirt, 3 May 2017. [Online]: https://www.techdirt.com/blog/netneutrality/articles/20170502/17212137292/dont-get-fooled-p…

Reading List, April 2017

Adam Carroll, When money isn’t real: The $10,000 experiment, in TEDxLondonBusinessSchool, 9 July 2015. [Online]: https://youtu.be/_VB39Jo8mAQAdam Carroll presents an interesting point – we have abstracted away money through the use of a number of instruments, such as credit and debit cards, NFC payment systems on our phones, and in-app purchases, when we don’t realise how much we are actually spending. Carroll spends some time showing how his kids, aged 7–11 played monopoly differently when they were playing with real money. He goes on to lay his premise, that financial literacy must be taught to children at a young age, when they should be allowed to fail and learn from their failures at a small scale, not at the hundreds of thousands of dollars when they are in student loan debt and just out of college.Carroll’s talk hit a lot of notes with my own experiences with money, and I’m sure that it would resonate with your experiences as well.Brett Scott, If plastic replaces cash, much tha…

Reading List, March 2017

Richard Baguley, Origin of wireless security: The Marconi radio hack of 1903, in HackADay, 2 March 2017. [Online]: https://hackaday.com/2017/03/02/great-hacks-of-history-the-marconi-radio-hack-1903/This is an interesting read that shows how the first “secure” radio transmission was hacked by a prankster. A fascinating story, but a relatively simple hack by today’s standard – a small transmitter very close to the receiver can hide the legitimate signal from a transmitter further away. The article does not touch upon how this is still an open challenge today, as most radio systems we use do not use any form of security. For instance, GPS signals can be spoofed using a pocket transmitter to perhaps move an aircraft off trajectory. ADS-B transmissions from aircraft are not encrypted, so one could easily use a transmitter to spoof actual air traffic control. Also see this DefCon20 talk for an interesting video on hacking ADS-B.Bruce Schneier, Uber uses ubiquitous surveillance to identify a…

Cornell Graduate Students United: At What Cost?

On Monday and Tuesday, we graduate students at Cornell will be voting on whether or not we want to unionise. Actually, scratch that, only graduate students who hold a TA, RA, or GRA appointment can unionise.This is a shitty arrangement, and I will be voting against it.For those of you who are not aware of how graduate school works at Cornell, you could be on one of many appointments.FellowshipA graduate student on a fellowship gets a stipend and tuition paid without associated teaching or research opportunities. Graduate students on a fellowship typically work towards their own theses, but will be excluded from the unionGraduate research assistantshipsA GRA gives a graduate student stipend and tuition without teaching responsibilities. However, this money comes out of a specific project grant, and the students typically work on their own theses. Students on GRAs magically qualify to join the union, whereas there is virtually no difference between a GRA and a fellowship for the most pa…

Reading List, February 2017

Robert B. K. Dewar and Edmond Schonberg, Computer science education: Where are the software engineers of tomorrow, in CrossTalk, The Journal of Defense Software Engineering, Vol. 21, No. 1 (January 2008), pp. 28–30. [Online]: http://static1.1.sqspcdn.com/static/f/702523/9242013/1288741087497/200801-Dewar.pdf?token=wupN4Gjh8%2F%2BKtRk%2FoDFv4ToxHDA%3DFor pitfalls of Java as a programming language.Also, talks about how students today don’t know how to program, but rather put together pieces in order to get them to work. Can be linked to StackOverflow programming, or node.js programming.It [Texas A&M] did [teach Java as the first language]. Then I started teaching C++ to the electrical engineers and when the EE students started to out-program the CS students, the CS department switched to C++.Eric S. Raymond, Why python? [Online]: https://www.linuxjournal.com/article/3882For these quotes:One course I did not consider was going back to C as a default language. The days when it made se…