• Home
  • About
  • Browse
  • Tools
  • Accented Character Issue on Mono on Mac OS X

    Feb 24, 2015

    Developers who are new to a language or a platform are usually greeted by encoding issues. One example is beginner PHP/MySQL developers. They usually create a simple form page, post some data with it, persist that data with on the back-end, refresh the page, and realize that all unicode characters are gone and in their place, there are some weird, incomprehensible characters.

    I’ve recently encountered a similar problem in one of my projects, namely, a desktop application written in C# running on Mono. When run on OS X, my app began acting strangely, and when I looked at the logs, I realized that all umlauts/diacritics/accents on my characters were next to the base characters, rather than on top or bottom. Here’s an example:

    Read More...
  • Building echoprint/codegen on Mac OS X

    Sep 13, 2014

    While investigating how services like Shazam worked, how they identified music using audio samples, I stumbled upon Echoprint, an open-source music identification project, and when I did, I immediately jumped to experiment with it.

    The Echoprint project has many sub-projects in itself, but the simplest way to use it is to send the audio sample in a specific format to an Echoprint server. The Echoprint project already has a free-to-use (keep in mind that with “free” comes request limitations) online Echoprint server that identifies the music for you, so you only need to create an appropriate code to call the service.

    The echoprint-codegen project is used exactly for that purpose: it takes an audio input and produces a code out of it, ready to use in Echoprint service requests. There are no binary distributions for the project, so you need to manually build it after downloading (or cloning) the project on your PC.

    First, clone the project from the Github repository.

    Read More...
  • Error Launching Eclipse on Windows: "Failed to load the JNI shared library"

    May 17, 2014

    My Eclipse recently stopped working gave me this error when I tried to launch it:

    Failed to load the JNI shared library “C:\Windows\system32\..\jre\bin\client\jvm.dll"

    While it doesn’t look like it explains anything at first, looking closely, you can see that it’s looking for the JVM DLLs under the System32 path. That’s because something, somehow, placed the Java executables (java.exe, javaw.exe, javaws.exe) under the System32 path, and when Eclipse is launched it tries to use this path as the JRE/JDK path.

    Read More...
  • LDAP Search Filter Syntax

    Mar 8, 2014

    Accessing the Active Directory is a pretty common problem in software projects, especially in enterprise-related ones. Although, since it’s usually an *”implement once, reuse forever”* feature, it’s usually overlooked as well people usually join projects halfway through, when all critical features have long been implemented.

    In my case, I had to come up with our own solution to generate LDAP queries when the project I joined halfway through didn’t have the necessary components to query the AD and return results, even though an LDAP-based authentication was a core feature. I personally took over that part and implemented something similar to CodeIgniter’s active record feature, a set of simple classes to generates LDAP queries (search filters, to be exact), run them and parse the results into strongly typed, annotation-based models.

    That particular implementation will be the subject of a future article, but in the meantime I’ve decided to share what I’ve gathered through my work. Not much, perhaps, but here it is anyway.

    Read More...
  • Pure CSS Triangles: How Do They Work?

    Aug 11, 2013

    I’ve been using static images for arrows for quite some time, and as you can imagine it’s been cumbersome. You can’t modify an image triangle in any way (at least by conventional means), so as the UI gets more complex, it gets increasingly difficult to maintain them. Not to mention that they eat up a little bit of your users’ bandwidth. A very small portion, perhaps, but still.

    Let me give you an example. On a website that features 4 different colors of arrows meant to be displayed in 4 different places (top, right, bottom, left) of the elements they’re placed upon, you would need to generate 16 different triangles and add them in your sprite. Now, what if your designer decides to add 2 more colors and 4 more directions (top left, top right, bottom right, bottom left)? It’s a pain, right?

    Fortunately, there’s a maintainable, cross-browser (even in IE6!), pure CSS way of achieving this: borders. You may have already seen it being used on many websites, like The Verge, Gizmodo, Twitter, even Google, but it first caught my eye on Google. At first it blew my mind and I couldn’t understand how it worked, but then it dawned on me. If it boggles (or did, at some point) your mind as well, continue reading.

    Read More...
  • The Beatles Reference in Vampire: The Masquerade - Bloodlines

    Aug 11, 2013

    I’ve been in love with VtM: Bloodlines ever since I’ve first played it back in new year’s eve, 2008, and the attention I could pay the details in the game could only increase gradually over time. This time, after I’ve had a 1-year-long Beatle-mania, I’ve realized that the game contained a reference to The Beatles, particularly the song of theirs called Doctor Robert.

    The reference can be found pretty early in the game, in the hospital in Santa Monica, the first area in the game. In the administration PC on the first level of the hospital is the following note (regarding a “Dr. Roberts”):

    Read More...
  • How to Shuffle Elements in jQuery or Plain Javascript

    Jun 29, 2013

    Every now and then you might need to shuffle some elements on your page, like in an online banking page you might have to display a virtual keypad which could be shuffled on demand, or on a tile game you’re most likely to have to shuffle the board. This problem usually boggles the mind of many people, but it has a very simple solution.

    Let’s start with the basics. Javascript arrays have a method called sort(), which returns the sorted version of an array (note that it doesn’t actually modify the array itself), and receives a callback function as a parameter (called a predicate function), which in turn receives two parameters, referring to tuples of values from the array. The predicate is expected to compare those two values, and return a numeric value that tells the method which of the two values is supposed to rank first. Given that the two values are represented by a and b, the predicate would return a negative value when a comes before b, a positive value when b comes before a, and 0 if a and b match. Let’s look at an example.

    Given an array of integers such as [ 3, 2, 8, 1, 5, 1 ], and given that we mean to sort it by ascending order, our predicate can be as follows:

    Read More...
  • How to Automatically Add Hyperlinks to Link Texts in Excel

    Sep 19, 2010

    I was making a list of movies I own in Excel 2010, and I was also adding links to their pages in IMDB. However, while Excel does automatically convert typed links into hyperlinks, it doesn’t convert pasted ones.

    I could do that manually (copy the link text, right click on the cell, select Hyperlink, paste the link into the address bar on the dialog window and click OK) but that would be too time-consuming, considering I had over 250 entries. So I needed something automated to do that for me.

    The most basic of these is a function called HYPERLINK(). It turns the text in a different cell into a hyperlink and pastes it into the cell it’s typed in. It also lets you “hide” the link behind a text you specify, but in any case I would have to use another cell for each cell containing the link text. See the syntax:

    Read More...
  • Batman: Arkham Asylum – Where’s Dr. Young’s Office?

    Jun 12, 2010

    I started playing Batman: Arkham Asylum yesterday and I found it amazing. I played it for a couple hours until I arrived in Arkham North, but then my left eye started hurting like crazy and I had to rest for a while.
    Today I progressed a little more and came into Arkham Mansion. My mission was to reach Dr. Young’s research notes before Joker did. I had to get in her office to get the notes and even though I was able to pinpoint its location, I couldn’t get in. It took me a while to find where to go, but I did it. Here’s how to enter the office.

    Warning! This post may contain spoilers.

    Read More...
← Previous Page

Atom Feed