Archives

Anki cards without Furigana

Hi everyone! I’ve been getting a few e-mails recently asking how to remove the Furigana from the Anki cards that Akebi exports. The good news is that it’s already possible! The bad news is that it’s… kinda tricky. While I work on a better way to do it, here’s how you can do it in the mean time!

First, open up AnkiDroid and click on ‘Manage Note Types’:

Then hit the + sign at the top and select ‘Clone: AkebiDefaultWordNoteType’ and press OK:

Then change the name to AkebiDefaultWordNoteTypeWithoutFurigana (you can really pick whatever you want here, it doesn’t really matter). Then hit OK:

Next, hit the + sign again, and type ‘Kanji’ in the box and hit OK:

Return back to the main menu in AnkiDroid from that page and now open Akebi. Find any word you want, and hit the ‘Other deck…’ option:

Pick the new NoteType we added by hitting this dropdown:

And then choose the new one:

Now we tell Akebi what it needs to put in each of the fields of this new note type. So just fill it out as shown and hit ‘Add To Deck’.

Now we go back to AnkiDroid and click to study our deck with the new note in it. Unfortunately it still has the Furigana, so let’s change that. Hit ‘Edit note’ in the drop down:

Then, hit the ‘Cards’ list at the bottom:

Now we need to change this text I’ve highlighted:

To {{Kanji}} , like this:

Once you’ve done that, just press the ‘tick’ at the top. Now your note looks like this:

And just to confirm it still works, I went back to Akebi and added another word:

And that’s it! Hope that works for you! You can make all kinds of different cards this way. Try it out!

The Donation Debacle

Hey everyone! So quite recently, Google deleted my little Japanese dictionary app from the play store! Apparently, I’m not allowed to have a donation button inside the app, and so I had to remove it before they’d let Akebi back on! If you’re really keen to donate, checkout https://donate.craxic.com/. But before you do, please consider instead donating to some of the data sources that Akebi uses. A donation there will help out every Japanese dictionary app, not just Akebi!

  • The Electronic Dictionary Research and Development Group is responsible for all of the dictionary and Kanji entries in Akebi (and in many other apps as well). You can donate to them via PayPal: http://www.edrdg.org/donations.html
  • The Tatoeba Project is responsible for providing all of Akebi’s example sentences. As of writing, you can donate via IBAN bank transfer or Paypal: https://tatoeba.org/eng/donate

Shadertoy stuff

It’s been forever since I’ve made an actual post here, and I’m tired of staring at the “Transistor Sound Ripper”. So here’s some cool pics of some GLSL shaders I wrote a while back! Click them for the source and to see them move!

Raymarching Attempt 2raymarching-attempt-2Confetti Attempt 1confetti-attempt-1Silly Blob Shadersilly-blob-shader

Transistor Sound Ripper

Hi again everyone!

This time I’ve made a Transistor Sound Ripper. It’s quite a bit more difficult to set up but it does work. It’s very similar to something made by someone else, but wasn’t actually based off of it. I think this also has few more features.

Source here (C++)

Steps to set up:

  1. Get and install the FMOD Studio Programmer’s API and Low Level Programmer API
  2. Install it. On linux copy the files in the zip you get above from /api/*/lib/x86_64/* to /usr/local/lib, run sudo ldconfig then export LD_LIBRARY_PATH=/usr/local/lib
  3. Get the source from above link. Adjust two things: First, change ERRCHECK(lowLevelSystem->setPluginPath("/home/matthew/Documents/FMOD/test")); on line 246 so that the dll/so/dylib named “FModPlugins” (which is found in the transistor install directory under lib64) can be found at the path written. I.E, for me I copied out the file “libFModPlugins.so” into “/home/matthew/Documents/FMOD/test”, so that’s why it works for me. Second, adjust SOUND_DIR at the top of the file to where the file MasterBank.bank can be found on your hard drive (It’s in the transistor installation directory, just modify mine so it fits yours).
  4. Compile source from pastebin with the following command: g++ test.cpp -m64 -o test -I/PATHTOFMODZIP/api/studio/inc -I/PATHTOFMODZIP/api/lowlevel/inc -lfmodstudio -lfmod -lpthread (assuming you named the saved the source as “test.cpp”). You should also be able to do this in visual studio fairly easily. Just make sure you add the libraries to the project properties.
  5. Run the resultant exe!

At this stage, you can see every single audio clip in the game, and you can play them by typing in their ID number. There’s a lot of interesting stuff here. There’s actually 3 lines that Red says:

  • “Why would I want to stay out there, while you’re still in here”
  • “Oh shut up already”
  • “Why would I want to be out there, while you’re in here”

I don’t recall hearing them in the game, only the last one where she says “Hey”.

If you wish to record the output to a file, uncomment line 275 and recompile.

Transistor Texture Ripper

From my Reddit post here:

I finished transistor and I loved it so much I wanted to see all of the files that made up the game. Usually developers leave stuff in there by accident and you can find cool stuff! Most of the time I can’t do this because its too difficult or it takes too long.

Luckily, Transistor is written using the .NET framework, and like all .NET apps, you can decompile them really easily. Luckily, Supergiant didn’t obfuscate the code, so I was able to read it really easily and extract every single texture from the game’s files.

Obviously, I can’t post the actual files anywhere: there’d be copyright issues all over that. I’ll post a small portion of some of the more interesting ones scaled down (like what wikipedia does). Imgur album.

Instructions follow. Continue reading

New Site Design

That’s right folks! I redesigned my website, I hope you like it! Please let me know if you don’t.

It’s looking a bit bare at the moment, but hopefully I’ll come up with some things to fill it up in the future! Not much of interest has been lost in the upgrade aside a Portal 2 Mapping tutorial nobody read. Oh well, I had fun writing it. Maybe it’ll make an appearance again some day.

How to print UTF16 in C++

And this, is why I hate working with C++

Why does this have to be so damn hard? It took hours to narrow down this information, and even then it’s pretty platform specific. Iconv is open source, but who’s going to want to download an entire library just to convert UTF16 to UTF8 on windows? No one, thats who.

#include <iconv.h>
char dst[100];
memset(dst, 0, sizeof(dst));

size_t dstlen = sizeof(dst);
size_t srclen = N_BYTES_IN_UTF16_POINTER;

char * pIn = (char*)(YOUR_UTF16_POINTER);
char * pOut = dst;

iconv_t conv = iconv_open("UTF-8", "UTF-16");
size_t retn = iconv(conv, &pIn, &srclen, &pOut, &dstlen);
iconv_close(conv);

std::cout << "CONVERTED " << dst << endl;

And the documentation can be easily located with a quick google search (/sarcasm/) and found here: http://www.gnu.org/software/libiconv/documentation/libiconv-1.13/

TexImage2D Exception

Annoyed and confused?

Is OpenTK throwing a System.AccessViolationException in GL.TexImage2D?

  1. Check that the input has the correct size = width * height * bpp.
    BPP is bytes per pixel and depends on PixelFormat and PixelType. For PixelFormat.Bgra PixelType.UnsignedByte, there are 4 channels of 1 byte input, so bpp = 4. This BPP doesn’t have any relation to PixelInternalFormat, that’s what OpenGL converts your input to and stores it as.
  2. Make sure you tell OpenGL that you’ve packed the pixels as tight as they go (no skipping some at the end of each row)

...
GL.ActiveTexture(unit);
GL.BindTexture(target, texture_location);
...
GL.PixelStore(PixelStoreParameter.UnpackAlignment, 1);
GL.PixelStore(PixelStoreParameter.UnpackRowLength, width);
...
GL.TexImage2D(...);
...