On avoiding plagiarism

I’ve been a student panelist at the Virginia Tech Graduate Honor System (GHS) for a few years now, and by far the most frequent infractions students are accused of involve some form of plagiarism. In some cases, alas, the students seem perfectly aware of what they’re upto, but very often, it seems that they just didn’t realize that what they were doing was anything wrong, or indeed, anything out of the ordinary.

Unfortunately, whether you knew and understood or not, if you did it, well, you did it. On that note, here are some pointers on avoiding plagiarism.

Let me focus on writing in particular, even though this applies equally well to any other creative task. If I had to summarize the concept in one sentence, I’d put it this way: when you’re writing something, there should be no ambiguity in the reader’s mind as to who actually composed the words in different portions of your document. If the document header contains your name, the assumption is that you wrote it, unless you specify otherwise. You’re perfectly fine using material from other sources and authors—as long you make it explicitly clear as to the authorship of that material.

Let’s say you’re referring to Wikipedia to understand a particular terminology or concept to include in a paper. You have one of two options:

  • Cite Wikipedia as a source, and use the words from Wikipedia within quotation marks.
  • Or, read and understand the material (but don’t memorize it word-for-word), and then close the webpage. Now try writing about the concept that you just read about. Or better yet, come back in an hour and write about it. Chances are the words you write are your own words and your own understanding, even though you read about it on Wikipedia. You should still cite Wikipedia as the source of your information, of course.

    If, while writing, you find yourself having to refer to the Wikipedia article to “refresh” your memory of the language used, you’d better cite the article and include the relevant portions verbatim, and within quotation marks.

The quotation marks are important in addition to including citations. This is because, as I mentioned above, citations are a must as sources of information, even if the words and compositions are your very own. If you don’t use quotation marks, it appears, of course, that the words are your own. If they aren’t, guess what you’re guilty of!

Also, remember to be sparing in using material verbatim from sources. A couple of sentences at most, and in rare occasions, perhaps a paragraph or two. If you’re using a paragraph, enclose the entire paragraph in quotation marks, and/or consider italicizing or indenting the paragraph to distinguish from your other paragraphs. Remember, your article is your own, and should almost entirely comprise your sentences. (This seems like a no-brainer, but I’ve seen instances where almost the entirety of a write-up has been “compiled” from various sources.)

There are some excellent resource on the internet about avoiding plagiarism. Here’s one: http://www.plagiarism.org/plagiarism-101/what-is-plagiarism.

To repeat once again, there should be no ambiguity as to the authorship of any portion of your work. Make it clear and cite the source, and you’ll be fine. Please, don’t get caught in embarrassing situations only because you didn’t know better. :)



Using MathJax with Octopress

I’ve been meaning to try and implement MathJax on this website for a while now. For including math equations on a website, MathJax is probably one of the more elegant ways to do it. I can write equations in TeX format, and MathJax renders the equations properly for you!

Finally, in the last couple of days I’ve been forced to get around to it, thanks to a new post that I’m writing that includes a little bit of math. So anyway, I just wanted to jot down that process.

The thing with MathJax is that it’s meant to, and does, work with HTML. But since I’m working with Octopress and Markdown, I have to ensure that the conversion from Markdown to HTML produces no unwanted syntactical errors for MathJax. To get around this problem, Zac Harmany (I hope I got the name right) suggests tweaking the Markdown rendering engine to Pandoc, so that the conversion works as desired. I’m sure that works great, but I had no intention of tweaking my Markdown conversion engine. Instead, I discovered a nifty ruby bundle (here) that serves a great purpose.

Next, the typical MathJax “installation” involves adding a line in the <head> section of your Octopress theme (Add it to %octopress_root%/source/_includes/custom/head.html), so that when every page loads, the necessary Javascript files are also loaded, ready to render your equations. I did not want the Javascript to execute to load along with all my pages, given that I don’t expect to have equations in all my posts. Instead, I’ve included the call to the script in the <body> of the post, i.e. in the meat of the post itself. Remember that the declaration needs to be before your first equation.

I also contemplated downloading the MathJax distribution and hosting it locally on my own server, but that did not work at all. There are way too many files to be uploaded (each file is small; the total package is ~50MB; there are too many files, though) and it just took forever to upload to my server until I just gave up. I’ll revisit that option if I think using MathJax’s own servers is not working well—which I doubt will happen.

With those details, here’s how I set things up:

  • Install the verbatim.rb plugin from this Github repository. To do this, simply download the file (‘Gist’ in Github parlance) and place it in %octopress_root%/plugins. When inserting equations, there’s a syntax to using this plugin; I’ll demo it below.

  • Create a MathJaxLocal.js file at %octopress_root%/source/javascripts/ to add local configurations for MathJax. Note that the last line of the code must point to the full path of the local file, in my case http://arnabocean/javascripts/MathJaxLocal.js

    Here’s what my MathJaxLocal.js looks like (I started with Zac Harmany’s file and modified to suit my needs.):

    MathJax.Hub.Config({
        jax: ["input/TeX","output/HTML-CSS"],
        extensions: ["tex2jax.js","MathMenu.js","MathZoom.js"],
        tex2jax: 
            {
                inlineMath: [ ['$','$'], ['\\(','\\)'] ],
                displayMath: [ ['$$','$$'], ['\\[','\\]'] ],
                skipTags: ["script","noscript","style","textarea","pre","code"],
                processEscapes: true
            },
        TeX:
            { 
                equationNumbers: { autoNumber: "AMS" },
                TagSide: "left",
    
            },
        "HTML-CSS": { availableFonts: ["TeX"] }
        });
        MathJax.Ajax.loadComplete("http://arnabocean.com/javascripts/MathJaxLocal.js");
    
  • Declare the location of the MathJax files. The easiest thing to do is to use MathJax’s own servers. However, in addition to just their servers, you’ll have to link to your own local config file as well, so we’ll add both of these at the same time. In the main body of your markdown post (preferably after the “Read More” fold), add the following:

    <script type="text/javascript"
    src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML,http://arnabocean.com/javascripts/MathJaxLocal.js">
    </script>
    

In the above, the first link points to MathJax servers, the second points to my own config file.

And that’s basically it! Now you’re all set to write beautiful equations. Here’s a demo:

<!-- MathJax configuration -->
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML,http://arnabocean.com/javascripts/MathJaxLocal.js">
</script>
<!-- End MathJax Configuration -->

{% raw %}{% verbatim tag:p %}{% endraw %}
\[ 
f(x)= a_0 + a_1\sin(x) + a_2\sin(2x) + ...
\]

\[  
+b_1\cos(x) + b_2\cos(2x) + ...
\]

\[
f(x)=a_0+\sum_{k=1}^\infty\big( a_k\cos(kx)+b_k\sin(kx) \big)
\]
{% raw %}{% endverbatim %}{% endraw %}

And here’s what that would look like:

\[ f(x)= a_0 + a_1\sin(x) + a_2\sin(2x) + … \] \[ +b_1\cos(x) + b_2\cos(2x) + … \] \[ f(x)=a_0+\sum_{k=1}^\infty\big( a_k\cos(kx)+b_k\sin(kx) \big) \]

There’s still a lot of more that I need to find out, and from the looks of it, Zac’s website is a great resource. I’ll add more posts if I find anything useful that I end up using.


Creating Bandpass Bessel Filter with MATLAB

Bessel filters are incredibly useful in numerical analysis, especially for acoustic-type waveforms. This is because analog Bessel filters are characterized by almost constant group delay over any frequency band, and this means that the shape of waves does not change when passed through such a filter.

Well, MATLAB provides some of the building blocks required to create a bandpass analog filter, but does not actually combine the pieces to make a usable filter function.

I created a function for my own research (sourced from pieces I found elsewhere, but it’s been too long—I don’t remember where I found each piece, sorry!), and can be found at my MATLAB repository, specifically, here.

Here’s the documentation that I included with the function:

besselfilter. Function to implement a bandpass Bessel Filter.

[filtData, b, a] = besselfilter(order,low,high,sampling,data)

Inputs:

    - order:      Number of poles in the filter. Scalar numeric value.
                    Eg.: 4  
    - low:        Lower frequency bound (Hz). Scalar numeric value.
                    Eg.: 50000 (= 50kHz)
    - high:       Upper frequency bound (Hz). Scalar numeric value.
                    Eg.: 1000000 (= 1MHz)
    - sampling:   Sampling frequency (Hz). Scalar numeric value.
                    Eg.: 25000000 (= 25MHz)
    - data:       Input data. Numeric vector.
                    Eg.: data vector of size (n x 1)

Output:

    - filtData:   Output filtered data. Numeric vector. 
                    Eg.: data vector of size (n x 1)
    - b, a:       Transfer function values for the filter. Scalar numeric.

Apple’s Curse

Last Fall, Apple included a fingerprint sensor in its latest iPhone, and called the technology ‘TouchID’. A few days ago, Samsung did the same, including its own fingerprint sensing technology in its latest Galaxy S5 phone.

The blogosphere has been aflutter about one small difference between the two launches: when Apple launched their technology, there was a huge uproar about the implications of using fingerprints as an authentication tool. As everyone has been pointing out, even a US Senator, Al Franken, issued a public email (PDF) addressed to Apple asking for clarifications and explanations regarding the technology and its implications. In contrast, Samsung’s new technology has received no such attention.

Apple: Think Different

Apple: Think Different.

Here are my two cents on the reasons:

First, Samsung’s technology has followed Apple’s by almost half a year. In this time, users have had the chance to use the technology first hand, and have realized that the world has not, in fact, turned on its head. Thus, a similar technology from Samsung, even though its implementation is way more far reaching, has not brought any new questions or paranoia.

Second, and more importantly, Apple is a modern cultural and technological icon. There’s no way around it—anything that Apple does is subject to way more scrutiny than any of its competitors. And this is because—even if subconsciously—we have come to expect greatness, caution and prudence from this company and its products. Hence, for example, the attention to Apple’s Chinese production lines, even though every other technology company uses the same companies, and the attention to Apple’s tax schemes, even though every other company does the same—perfectly legal—thing.

This is how it should be.

Apple has shown itself to be the leader of the pack, the pioneer of modern technology; the company to follow, imitate and plagiarize from. Apple has similarly shown leadership and candor in other matters: when scrutinized about their tax practices, they actually suggested tax reforms; when a bill to solidify employee non-discrimination was on the table, Apple endorsed it, and their CEO Tim Cook personally talked about it. And, oh, even without a law being present, Apple of course already had in-house rules of similar effect, as a matter of principle; it simply would not do for it to be otherwise.

With great power, as they say, comes great responsibility, and this extra scrutiny, the extra attenion and paranoia, is the flip side to their influence and strength—their curse along with their blessing, if you will.

May Apple carry this curse with pride and with distinction, for times to come.