Kanji Dictionary Tool – Release (11/17/2018)

Updated (11/18/2018 Yet Again: I planned to stop, but then I wanted something. So here we are again. I added -onyomi-to-hiragana and -kunyomi-to-katakana.
Updated (11/18/2018) Again: I added -rename argument. I added single operation !tag match.
Updated (11/18/2018) Again: I added -strip-rmgroup argument. I added “!” not operator for attributes.
Updated (11/18/2018): I added -strip-meaningless argument.

This is some pretty awfully specific, incredibly, more-than-usual, niche software. This program is for stripping and cutting out information from the kanjidic2.xml file as well as various other operations with the data.

Download Version D (11/18/2018)

This is a command line tool, these are the arguments…
Input File (kanjidic2.xml)
-i inputFilePath
Output File (if you don’t specify a file, kanjidic2.modified.xml is created in input folder)
-o outputFilePath
Strip out kanji that doesn’t have a defined meaning (11/18/2018 update)
-strip-meaningless
Strip out non-ranked kanji (overrides -strip-meaningless)
-ranked-only
Order by ranking (none = unranked)
-rank-order <low-high-none, high-low-none, none-low-high, none-high-low>
Rank Limit (2500 being the maximum limit)
-rank-limit <1-2500>
English only, strips out Spanish, Portuguese, Hangul, Vietnamese, and anything not English/Japanese
-english-only
Strip out nanori
-strip-nanori
Strips out dic_number group, or specific parts of it
-strip-dic-number [tagAndAttrs*]
Strip out codepoint info
-strip-codepoint [tagAndAttrs*]
Strip out radical info
-strip-radical [tagAndAttrs*]
Strip out query code info
-strip-query-code [tagAndAttrs*]
Strip out misc info
-strip-misc [tagAndAttrs*]
Strip reading meaning info (11/18/2018 Version B)
-strip-rmgroup [tagAndAttrs*]
Rename tags (11/18/2018 Version C)
-rename [renameSpecifications*]
Convert OnYomi to Hiragana (11/18/2018 Version D)
-onyomi-to-hiragana
Convert KunYomi to Katakana (11/18/2018 Version D)
-kunyomi-to-katakana

Continue reading “Kanji Dictionary Tool – Release (11/17/2018)”

Equation shortcut

I was doing some math recently when I realized something was odd about a particular equation.

ax^2 + bx = 0
a times x squared plus b times x equals zero. This equation would normally be solved by completing the square and yada-yada-yada. However, I couldn’t help but notice the strange answer I got from this.

x^2 + 36x = 0
x = 0 or x = -36

This got me thinking, and after playing around on my calculator for a bit, I came to the conclusion of this handy shortcut.

Given ax^2 + bx = 0, x = 0 or x = -b/a

Try it out for yourself, no squaring and other crap needed.

5x^2 – 35x = 0

From this we know, x = 0 or x = 7

If we had to do it by completing the square…

1. 5(x^2 – 7 + 49/4) = 254/4
2. (x – 7/2)^2 = + or – sqrt(49/4)
3. x – 7/2 = 7/2 or x – 7/2 = -7/2
4. x = 7 or x = 0

Or the quadratic formula

1. 35 + or – sqrt((-35)^2 – 4(5)(0)) / 2(5)
2. 35 + or – sqrt(1225) / 10
3. 35 + or – 35 / 10
4. 7 + or – 7 / 2
5. x = (7 + 7)/2 = 7 or x = (7 – 7)/2 = 0

This shortcut answer does seem to have a relationship with the quadratic formula and vertex formula of a parabola, but I assume that since we’re accounting for 2 values of change and not 3, that that’s why you only have to divide by a and not by 2a. Not sure really though. I looked up and down for this shortcut on the internet and couldn’t find anything, so I decided to write about it.

Kanji Study Buddy – I’m thinking about it…

Over the last weekend I wrote two new software for studying Japanese. 1) JP Study Buddy, and 2) Kanji Study Buddy – These complement my other program KanjiKana (2015). One provides a way to study words like flashcards with audio that you either collect or get off Google Translate in Firefox with my software FF Media Cache Grabber. The latter provides a way of inserting kanji into blank spaces to fill in the kanji of the word.

Image of prototype shown here.

The first one was prototyped in roughly an hour and a half and the 2nd program was prototyped in roughly 3 hours. This means I haven’t refined them much at all. It was basically just throw the code together as quickly as possible to make it work.

That said, I’m considering releasing Kanji Study Buddy. I’d like to refine it more first, but it definitely offers a different way of studying than what I’ve seen when I look around. Sometimes thinking differently does make a difference in remembering. Chime in if this program sounds like something you’d want.

*Note: Data files for Kanji Study Buddy look like this (using version 1 parser, since version 0 parser sucks)
@version 1
味方 みかた
厳しい きびしい
昼ご飯 ひるごはん

The recent Newegg code injection

Newegg was recently involved in customer credit card data theft between August 14th and September 18th. (read more here and here.) This was done by “Magecart” a previously identified javascript code injection. After seeing what happened, I couldn’t help but think to myself that this all could have been prevented quite easily. I’ll explain.

Websites primarily consist of 2 main things, web files (php, asp, html) and databases (MySQL, PostgreSQL, Oracle). This kind of attack involved the first of the 2. It was a code injection into a site file.

Every file can be “hashed”, this means that through mathematical calculations it can turn any bytes of data in a file into a kind of unique identifier for that file. Which means that if anyone so much as added the letter “t” to a page, it would change the hash completely. It wouldn’t be hard to generate hashes for all of your clean off-site files, then upload those to the server and run a periodic hourly check on all files to make sure the hash hasn’t changed for any files. If the hash did change, then you’d know the website was compromised.

Just a thought about the next time you develop a web application with payment systems. Security should always come first.

– Captain Hindsight Away

CABuddy – Release 9/11/2018

This release brings fully supported Spanish and Japanese translation of everything. If you want to only use one language, you can delete the country codes that don’t represent what you read.

en-US = English (USA)
ja-JP = Japanese
es-GT = Spanish (Guatemala)

The Spanish translation is courtesy of a friend.

Download: CABuddy (x64).zip
Requirement: .NET Framework 4.6.1

Note: Don’t mind the date on the imgae, I forgot to change the date from 9/10/2018 to 9/11/2018, no big thing.

CABuddy – Release 9/9/2018

Edit: Newer version available here.
Edit: More crash bugs were found, but are only achieved by using the tool incorrectly. I may or may not fix those bugs.

This release fixes a crash bug that could happen when editing CAB files and doing a very specific pattern of events. This release also brings with it an extractor, if you want that. Personally, I’ll just keep using Bandizip to unzip CAB files.

Download: CABuddy (x64).zip or CABuddy (x64).cab
Requirement: .NET Framework 4.6.1

CABuddy – Unicode CAB Compressor – Release 9/7/2018

Edit: Newer version available here.

I looked for 2 hours for Unicode CAB compressors and found nothing. What I did find was someone who wrote a Unicode-supported library for CAB files on CodeProject. I got my hands on it and fixed some minor bugs and compilation issues. Made a GUI, and walla, a modern x64 CAB compressor.

Credits: Elmue for the CAB lib and IcoJam for the Blueberry icons

Download: CABuddy (x64).zip or CABuddy (x64).cab

This is just the initial release. I have bigger plans for it (notice that I left status bar in by accident), but for now I wanted to put something out there.

boldr – New parser built from the ground up

boldr, the multi-paradigm scripting language along with a new scanner, now has a new advanced parser, and soon will have a new virtual machine.

It’s extremely likely that it won’t have a stack overflow like the old one, MCNE, had a high potential for doing if you had too much code. This is because statements are cascaded now instead of being binary branched to the maximum stack depth. Most non-expression nodes have their own special node types making them more efficient than a regular AST, like MCNE was, and allows me to do more advanced functionality with the code than ever before.

When I’m done with the C# version, it will be ported to Cerberus X and likely C++ as well. If you want to support this project more, use the Patreon button above to support me.