More Syntax Highlighting for Coda

Coda ships with syntax highlighting support for a lot of great languages, but some are noticeably left out of the mix. I was recently helping a buddy set up an environment to develop C programs on an external server, and while Coda seemed a clear better alternative to using Nano (particularly since we could still compile and run the programs from Coda’s built-in terminal), the program lacked syntax highlighting for the C language.

Adding highlighting for C (and a host of other languages) turned out to be pretty easy.

To add support for other languages, download this zip file, unzip, and copy the Modes folder into Contents > Resources of the Coda package distribution. To access the contents of the package, right click on the Coda application and select “Show Package Contents”. Then navigate to Contents > Resources.

Screen-shot-2010-09-15-at-3.44.01-PM

If you are asked, overwrite existing folders and files. Note that if you only want to install certain syntax highlighting modes, just copy and paste what you need (of the .mode files in the downloaded Modes folder) into the Modes folder in the Coda package. I forgot which languages were standard to Coda so I’ve just included all of the ones I have in the download.
Continue reading…

Office 2007 MIME Types

Here’s a list of MIME Types for Office 2007 files (those pesky files extensions that end with an x). Useful for file type checking in web applications and the like.

  • .docm – application/vnd.ms-word.document.macroEnabled.12
  • .docx – application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • .dotm – application/vnd.ms-word.template.macroEnabled.12
  • .dotx – application/vnd.openxmlformats-officedocument.wordprocessingml.template
  • .potm – application/vnd.ms-powerpoint.template.macroEnabled.12
  • .potx – application/vnd.openxmlformats-officedocument.presentationml.template
  • .ppam – application/vnd.ms-powerpoint.addin.macroEnabled.12
  • .ppsm – application/vnd.ms-powerpoint.slideshow.macroEnabled.12
  • .ppsx – application/vnd.openxmlformats-officedocument.presentationml.slideshow
  • .pptm – application/vnd.ms-powerpoint.presentation.macroEnabled.12
  • .pptx – application/vnd.openxmlformats-officedocument.presentationml.presentation
  • .xlam – application/vnd.ms-excel.addin.macroEnabled.12
  • .xlsb – application/vnd.ms-excel.sheet.binary.macroEnabled.12
  • .xlsm – application/vnd.ms-excel.sheet.macroEnabled.12
  • .xlsx – application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • .xltm – application/vnd.ms-excel.template.macroEnabled.12
  • .xltx – application/vnd.openxmlformats-officedocument.spreadsheetml.template

How to Remove the Top Border from Drupal Tables

I’ve been very busy developing a couple projects over the past couple days, but here is a quick little trick to get around one of Drupal’s quirks. If you’re unfamiliar with Drupal, it’s a fantastic CMS (content management system) built on PHP and MySQL. For those blog-savvy among us, it is to general websites what WordPress is to blogs. I use Drupal to get sites up quickly and with great functionality, and I highly recommend it to anyone who is looking to build powerful, custom websites without “re-inventing the wheel.”

Anyway, Drupal has this strange quirk in its source that creates a small grey border on the top of tables inserted in a page’s content.  A quick trip to my inspector revealed how to remove the top border from Drupal tables.  Simply add the following line to your CSS.

body tbody { border-top: none; }

All there is to it. 🙂

Ruan Lingyu: An Artist’s Profile

I created a website this past spring for my final project in Chinese Literature 130: Screening Modern China. It was an interesting class that surveyed a great deal of Chinese cinematography, ranging from the first silent films up to modern day talkies. The site was created from the perspective of Ruan Lingyu, a Chinese silent film star of the 1920s and early ’30s. Check out my personal statement for a detailed description of the project.

» Personal Statement
» Live Website

Ruan Lingyu Website Screenshot

How to Display Russian and Other Languages with PHP MySQL

I recently had to code a little web application that would interface with a MySQL database and display data on a webpage via PHP MySQL queries. The application had to support many international languages – the most difficult of which to deal with was Russian. Many forums suggested changing my character encoding to CP-1251, which is a standard Russian encoding in Windows. I needed support for all international languages, though, and using multiple character encodings wasn’t a headache I wanted to get myself into. It turns out that you can display all these characters using a UTF-8 encoding, provided you get the PHP and MySQL right.  Read on to find out how to display Russian and other languages with PHP and MySQL. Continue reading…

How to Use Custom Fonts with CSS3

One of the most common challenges any web designer faces is ensuring that their work appears as intended. Print designers have the advantage of creating the physical designs themselves, but web designers depend upon user environments (read, browsers) to render their designs correctly.

In the past, browsers could only render the fonts already installed on a user’s computer, which meant that users without a good library of fonts would miss out on designs that made use of uncommon fonts. CSS 3 introduces a new fix called @font-fact that could be the future of web design typography.  Continue reading…

Xoco Gourmet Site Re-design

This was my first ever website contract.  I designed and coded a site re-design for a Central American cocoa company called Xoco Gourmet.  It was built on Drupal 6 for easy content management, and supported internationalization (was localized for English and Spanish).

See before and after screenshots below.

xoco-comparison

The Ethics of Genetic Engineering

This term paper was prepared for Ethical Reasoning 24: Bioethics, a Core Curriculum course taught at Harvard College.

Abstract

This paper seeks to examine the ethical questions surrounding the intentional manipulation of genes to achieve phenotypic modifications in humans. It is not concerned with distributive justice or the ethics of research, but rather with the debate over whether the technology of genetic engineering itself, once it is to a reasonable level proven both safe and effective, is ethical to use. The study begins by motivating the discussion and introducing some key concepts related to the technology. After establishing the scope and structure of the analysis, the paper proceeds by reviewing the most commonly presented arguments against genetic engineering and demonstrating that all fail to establish a legitimate ethical basis upon which such a criticism could stand. Finally, the paper concludes with a short discussion outlining possible areas for further study and discourse.

Read more…

Predictors of Violent Crime Rate in the United States

This regression analysis was prepared as part of a final project for Statistics 104: Introduction to Quantitative Methods for Economics.

Abstract

The following report seeks to provide explanations of the variation in violent crime rates throughout the United States by analyzing the statistical signi cance of relationships between the violent crime rate and seven potential predictor variables. A multiple linear regression showed that two of the seven potential predictor variables, teen birth rates and the percentage of the population living in metropolitan areas, proved to be strongly signi cant (p < 0:001). As each of these variables increase, the violent crime rate rises. This fi nding suggests that states with greater teenage promiscuity and larger cities exhibit higher violent crime rates. Despite demonstrating a strong statistical correlation, these results cannot be used to support a causal relationship. Still, though, the results of this report provide important insights into violent crime rates and potential ways to address them.

Read more…