Ian Lewis
Ian Lewis is a web developer living in Tokyo Japan. His current interests are in Django, python, alternative databases and rapid web application development. About Me...
  • python-openvcdiff and Cython

    I started a project today to implement an interface for the open-vcdiff using Cython. I'm not a C++ master and the Python C libraries are pretty new to me but I managed to expose and implement a few methods of the VCDiffEncoder class. The hardest part so far has been trying to figure out how to use the C++ standard library types like std::string. I'm also not sure how I can interface with python in such a way as to allow fast processing of potentially large binary data. Normally I would use a file-like object in Python to create a kind of string but open-vcdiff being C++ has a slightly different interface for dealing with binary blobs.

    The code is over at bitbucket in my python-openvcdiff repository.

    Send feedback   このエントリーを含むはてなブックマーク はてなブックマーク - python-openvcdiff and Cython
  • Unreadable

    What is it about some C programmers that makes them write code that looks like this:

    if(len<16) {
      for(k=start;k<start+len;k+=j) {
        j=1;x=V[I[k]+h];
        for(i=1;k+i<start+len;i++) {
          if(V[I[k+i]+h]<x) {
            x=V[I[k+i]+h];
            j=0;
          };
          if(V[I[k+i]+h]==x) {
            tmp=I[k+j];I[k+j]=I[k+i];I[k+i]=tmp;
            j++;
          };
        };
        for(i=0;i<j;i++) V[I[k+i]]=k+j-1;
        if(j==1) I[k]=-1;
      };
      return;
    };
    Send feedback   このエントリーを含むはてなブックマーク はてなブックマーク - Unreadable
  • Wanted: Dictionary program for Windows/Linux

    I have wanted a good dictionary application that supports a number of dictionaries/dictionary formats for studying Japanese but I've been sort of frustrated that there is no single application that does what I would like. I have looked mostly at stardict and epwing because they are closest to the type of dictionary I want. Specifically I have the following requirements:

    1. It must work in Linux (epwing and stardict)
    2. It must work in Windows (epwing and stardict)
    3. It must support epwing format (epwing)
    4. It should ideally support an open dictionary format like stardict. (stardict)
    5. It must support lookup via a popup (epwing and stardict)
    6. It must support installing dictionaries as a non-root user (epwing)
    7. It should support minimization to the system tray (stardict)

    1 and 2 and 5 are supported by both stardict and epwing but epwing's popup support is less than ideal and epwing supports nothing but epwing and doesn't minimize to the system tray. The way epwing looks up words from multiple dictionaries is also less than ideal,

    Stardict on the other hand supports most of the things I want but doesn't support epwing or any way of converting the dictionaries from epwing to stardict format. There are a number of tools to read epwing dictionaries so I think this could be done, but I don't think stardict dictionaries currently support images or media like epwing dictionaries support so converting epwing dictionaries would lose that data. Stardict also has a  number of strange plugins and a net dictionary protocol which seems strange. I'm not sure if the server side code is open either.

    I've been looking ot the code for each of the dictionaries and it seems like while epwing's code is simpler and easier to read, stardict supports most of the features I want already so it would be better to explore how to add the features I want to add. Development on both projects is pretty much halted so I should be able to add features at my own pace without stepping on current development.

    I'm not looking forward to spending a lot of time on it but my frustration with dictionaries has reached a bit of a boiling point.

    Send feedback   このエントリーを含むはてなブックマーク はてなブックマーク - Wanted: Dictionary program for Windows/Linux