Thursday, January 14, 2010

Dominion Kingdom Deck Preview

My second iPhone app, Dominion Kingdom Deck, is a setup utility for the board/card game Dominion by Donald X. Vaccarino.


A preview is up on its product page. It is currently in review and hopefully will be available within a week.

DKD is meant primarily for fans of Dominion who own one or more of the expansions to Dominion.

There are two main problems players start to face as the as the number of setup cards starts to grow:
  1. Properly shuffling a stack of 75+ cards becomes more and more tedious.
  2. Having a "poor" distribution of card costs becomes more frequent.
For the first, a quick tap and DKD pulls up a list of 10 cards. Optionally sort this list by cost and/or expansion. Don't like a card? Swipe its row to replace it.

For the second, DKD offers an toggle-able option to guarantee that there is at least 1 card of cost 2, 3, 4 and 5 in the draw with the remaining 6 cards random as usual.

Other features of Dominion Kingdom Deck include:
  • All currently published cards included.
  • Fully configurable to select which expansions to use.
  • Custom card and card set editor.
  • Save interesting or favorite lists for quick reference.

Dominion Kingdom Deck will be donation-ware. It will be free to download and use with no restrictions. In a future update, an in-app store will be enabled to allow users who find the app useful to donate an amount of their choice to show their appreciation.

Wednesday, July 8, 2009

Future Fair Share features

A big thank you to everyone that's bought Fair Share and taken the time to leave reviews and ratings.

Here are a few things that I've decided to add to the next release of Fair Share:

  • Optional rounding for group totals instead of individuals in groups.
  • Optional Post-tax tip calculation.
  • Optional tip presets for level of service (think 1-3 star system).
  • Negative exceptions - When everyone except one person orders something, then mark this one person with a negative exception so as to say "he pays this much less than everyone else."
  • Optional key clicks.
On the future roadmap:
  • Contact list integration.
These enhancements will of course be free to anyone that's already purchased the app. I'm looking to get these new features done in about a month or so.

Thursday, June 25, 2009

Fair Share is available!

Fair Share is now available in the iTunes App Store. It isn't showing up in searches yet but you can get to the page directly via this link.

Fair Share allows you to quickly figure out your tip and split your bill when dining out.

While providing a simple interface to allow for fast calculation of simple tips, Fair Share also can help you easily divide the bill and account for the different items your party has ordered.

Fair Share provides two entry modes to suit your personal preference.

In Subtractive mode, exception items (such as drinks or desserts) can be assigned to members of your party and the remainder of the bill is automatically split evenly.

In Summation mode, you input and assign all of the items in your bill and the subtotal is calculated for you.

The summary screen reports each person's appropriate share including tax and tip. Group your diners, and a total for each group is also provided.

Standard rounding functions are also available to round each person's share for ease of payment at the table.

Please check out the demo on YouTube to see its features!

Monday, June 15, 2009

Fair Share

Fair Share is my first iPhone app. It is currently undergoing review by Apple.
Fair Share is yet another tip calculator. In fact, the working name was yaTipCalc. But Fair Share also does bill splitting which not very many of the tip calculators out there bother to do.

Hopefully it will be approved in the next few days. In the meantime, here's a demonstration of how Fair Share works.




I already have a number of improvements in mind including Address Book integration. If you have any comments, feel free to contact me at yarbars@gmail.com.

Friday, September 5, 2008

More applescripts for Delicious Library 2

Some more applescripts for Delicious Library 2. Applescripts go into ~/Library/Scripts/Applications/Delicious Library 2/.

You can download an archive of these scripts here

1) A short hotkey script to allow you to toggle the played/read checkbox. The settings are to put it into the Edit menu. You can reassign the hotkey/menu choice to your liking.


-- Menu Title: [3] "Toggle Experienced Flag"
-- Menu Keyboard Shortcut: command-`
-- Menu Path: [3]

-- Copy and paste everything into Script Editor (use spotlight to find it).
-- Then save to home/Library/Scripts/Applications/Delicious Library 2
-- You can edit the menu keyboard shortcut to be whatever you want.

tell first document of application "Delicious Library 2"
set selectedItems to selected media
set itemsRef to a reference to selectedItems
repeat with mediaItem in itemsRef
set playedStatus to experienced of mediaItem
set experienced of mediaItem to not playedStatus
end repeat
end tell



2) Translate retrieved Amazon title to a Series. More comments at the bottom.


-- Menu Title: [0], "Translate Amazon Name to Series"
-- Menu Keyboard Shortcut: command-option-1
-- Menu Path: [3], "Series Scripts"
-- Maintain a sqlite3 db to track Amazon returned titles and the series they are translated to. Then for future additions, guess the desired series based on previous entries.

-- Attempt to put the database in the scripts directory. do shell script seems to start in user's home.
set databasedir to "'Library/Scripts/Applications/Delicious Library 2/'"
set database to "seriestranslate.db"
set sqlcmd to "cd " & databasedir & "; sqlite3 " & database & " "

-- Create tables if they don't exist
do shell script sqlcmd & "'create table if not exists translate( dl2id text primary key, series text, amazonname text); create index if not exists amazonname_index on translate(amazonname desc);'"


tell first document of application "Delicious Library 2"
set selectedItems to selected media
set selectedItemsRef to a reference to selectedItems
repeat with mediaItem in selectedItemsRef
set itemId to id of mediaItem
set itemSeries to series of mediaItem
set itemAmazonName to name of mediaItem
if itemSeries is missing value or itemSeries is "" then
-- itemSeries doesn't exist so find a new one
set query to "select series from translate where amazonname < \"" & my sql_escape(itemAmazonName) & "\" order by amazonname desc limit 1;"
set seriesName to do shell script sqlcmd & quoted form of query
set query to "replace into translate (dl2id, series, amazonname) values (\"" & my sql_escape(itemId) & "\",\"" & my sql_escape(seriesName) & "\",\"" & my sql_escape(itemAmazonName) & "\");"
do shell script sqlcmd & quoted form of query
set series of mediaItem to seriesName
else
-- series name already exists so update existing record
-- we don't update name because it may have changed since we retrieved it from Amazon.
set query to "update translate set series = \"" & my sql_escape(itemSeries) & "\" where dl2id == \"" & my sql_escape(itemId) & "\";"
do shell script sqlcmd & quoted form of query
end if
end repeat
end tell

on sql_escape(sqltext)
set AppleScript's text item delimiters to "\""
set the item_list to every text item of sqltext
set AppleScript's text item delimiters to the "\"\""
set sqltext to the item_list as string
set AppleScript's text item delimiters to ""
return sqltext
end sql_escape




Amazon does not populate (usually) the Series field in the information it sends back and it's not really DL2's place to guess from the other information what is appropriate to put there. On the other hand, Amazon's titles for volumes in a series and its formatting does not always agree with my preferences. They've gotten somewhat more consistent recently, but there's no guarantee that whatever Amazon sends back is what I would want to use as my title.

Thus the scripts in my earlier post which let me reset the title based on the Series and NumberInSeries fields.

This script fills in the last part which is to automatically set the Series field based on the title that Amazon returns.

The algorithm is as follows:
1) Maintain a sorted list sorted on the title/name that Amazon returns. In the second column of the list, associate what series the user has decided goes with this title.

2) When you get a new item, search to see where in the list it goes and then get the series information from the entry before it and copy it for this entry.

Example: Your list starts off like:
Eyeshield 21, Volume 1 | Eyeshield 21
Naruto, Volume 1 | Naruto

You then introduce Naruto, Volume 2. This inserts after Naruto, Volume 1 and we copy its series value, "Naruto," which happens to be correct in this case.

The first assumption is that Amazon is reasonably consistent. Volumes in a series will at minimum all have the series name at the front. For example, everything Naruto is "Naruto, xxxxxx". This is true for the majority of the manga I collect.

The second assumption is that I collect manga from earlier volumes to later volumes. So I'm going to get volume 1 before I get volume 10. Given how this algorithm works, it's not that critical that this is strictly followed, but it would be a worst case scenario if for some reason, you collected a series backwards.

This algorithm has an advantage that you don't have to make any assumption as to the precise formatting of the Amazon title. As long as Amazon is reasonably consistent across the volumes, it will work.

The other advantage is that you can arbitrarily rename a series based on your preference. For example, Monster by Naoki Urasawa is officially "Naoki Urasawa's Monster" in the US for whatever licensing reasons. I say screw that, I want the series to be called "Monster" in my library. And this algorithm has no problem with that. Or if you would prefer "Neon Genesis Evangelion" to be filed as "Evangelion." Again, no problem.




So now that the why is done, here's how to use the script.

First off, the script will create a sqlite3 database file in your Delicious Library 2 scripts directory. If you want to put this elsewhere, you can modify the appropriate variables at the top.

When you have new items, select them and run the script. If the series have never been seen before, they will either leave the series values blank or fill in incorrect information due to how the algorithm just uses blind sorting.

Correct the entries that are incorrect, select them again and rerun the script.

At this point, any new items in the series should automatically set with your preferred series name (subject to the assumptions listed above).

If you're satisfied with the series values, you can then run the other two scripts to set the series number and then rename the title.

Tuesday, June 3, 2008

Applescripts for Delicious Library 2

Here are a few applescripts I threw together for Delicious Library 2. Applescripts go into ~/Library/Scripts/Applications/Delicious Library 2/.

1) Mass import from a list of ISBNs.


-- Menu Path: [2], "Import", "Import Scripts"
-- Get a file name
tell application "Finder"
set isbnList to paragraphs of (read (choose file with prompt "Pick text file containing ISBNs to import"))
end tell

-- Statistic variables
set numIsbn to 0
set existingIsbn to 0
set lookedup to 0

tell first document of application "Delicious Library 2"
set isbnListRef to a reference to isbnList
repeat with isbnItem in isbnListRef
set numIsbn to numIsbn + 1
-- Check to see if book with this ISBN is already in the library
if (every book whose isbn is isbnItem) is {} then
set lookedup to lookedup + 1
-- DL2 call to look up ISBN on Amazon
look up isbnItem
-- Delay is to prevent flooding DL2s look up mechanism
delay 0.01
else
set existingIsbn to existingIsbn + 1
end if
end repeat
end tell

-- Report stats
display dialog "Done: " & numIsbn & " ISBN in list. " & lookedup & " ISBN looked up. " & existingIsbn & " ISBN already in DB."


I set this up to let me import my OpenDb list. In this case, the script will be located under the File|Import menu.
Use the "Export my Items" action in OpenDb. You will need to specify Books specifically to be able to export ISBNs.

2) Renaming titles based on series and number in series fields.


tell first document of application "Delicious Library 2"
set selectedItems to selected media
if selectedItems is {} then
display dialog "No entry is selected. Run on all entries in the library? (This may take a while.)"
set bookNames to every book whose series is not missing value and number in series > 0
else
set bookNames to selectedItems
end if
set bookNamesRef to a reference to bookNames
repeat with bookItem in bookNamesRef
set bookName to name of bookItem
set bookSeries to series of bookItem
set bookNumber to number in series of bookItem
if bookSeries is not missing value and bookNumber > 0 then
set name of bookItem to bookSeries & ": v. " & bookNumber
end if
end repeat
end tell


I collect lots of manga which tend to run multiple volumes. Unfortunately, sorting by title runs into problems when jumping from single digit volumes to multiple digit volumes (v.10 coming before v.2, for instance). Also, importing the information from Amazon can be wildly inconsistent with formatting.

This script will make use of the "series" and "number in series" fields to rewrite the "name" field.

An improvement would be if DL2 added an "on update" script that could automatically run this script when changes are made.

3) Pulling the volume number from a title.


tell first document of application "Delicious Library 2"
set selectedItems to selected media
if selectedItems is {} then
display dialog "No entry is selected. Run on all entries in the library? (This may take a while.)"
set bookNames to every book whose series is not missing value and number in series is 0
else
set bookNames to selectedItems
end if
set bookNamesRef to a reference to bookNames
repeat with bookItem in bookNamesRef
set bookName to name of bookItem
set bookSeries to series of bookItem
set bookNumber to number in series of bookItem
if bookSeries is not missing value and bookNumber = 0 then
set testlist to (a reference to characters of bookName)
set validChars to "0123456789"
set numberFound to false
set foundNums to ""
repeat with i from length of testlist to 1 by -1
if validChars contains item i of testlist then
set numberFound to true
set foundNums to item i of testlist & foundNums
else
if numberFound then
exit repeat
end if
end if
end repeat
if numberFound then
set foundNums to foundNums as number
set number in series of bookItem to foundNums
end if
end if
end repeat
end tell


Of course, filling the "series" and "number in series" fields is a bit of a pain itself. This script will assume that the last number in a title is the volume number and assign that to the "number in series" field.

It will only process items that have a "series" field set. It is fairly easy to batch set a group of items to the same series and then run this script to pull the volume numbers out. Afterwards, I run script 2 to format all of the titles.


These scripts are set to deal specifically with book items but they should work well enough for DVDs with a minor modification.

The last step for me is to figure out a way to reliably and automatically set the "series" field from the "name" field. This is much more difficult due to the inconsistency with how Amazon lists manga though it seems to be more consistent with recent titles.

Monday, November 12, 2007

Phase Review

Introduction
I'd like to think I'm well-versed in rhythm games having played my fair share of Guitar Hero, Karaoke Revolution, Ouendan, Band Brothers, Donkey Konga and DDR. I've even gone in with my share of Samba de Amigo, Taiko Drum Master, Parappa, Gitaroo-man and Amplitude. Shakka de Tambourine has eluded me sadly. Harmonix, the maker of Karaoke Revolution and Guitar Hero, has recently released an iPod rhythm game called Phase.

Phase is only available for the new iPod Nanos, Classic and 5th gen iPods (no iPod Touch or iPhone). Once it's installed (in iTunes 7.5), you'll have a Phase Playlist that you can drag your favorite tracks to. iTunes will spend a few seconds per track calculating game data from the music.

Gameplay
The game itself has a receding 3-d track reminiscent of Guitar Hero. Notes scroll towards you on 3 tracks corresponding to previous, select and next buttons (left, center, right). There is also a slider effect where you sweep your finger along the touch wheel to catch notes.

Each song starts with Easy, Middle, and Hard modes. Apparently more can be unlocked as you clear marathon mode - a series of 5 songs. I have yet to clear marathon mode so I'm just going off one of the random loading screen tips here. High scores are stored for each individual song.

The game is a decent rhythmer that makes good use of the platform. I don't find the side graphics (random 2d bitmaps) or sound effects (cheers and hit confirmations) particularly interesting and I've turned the sound effects off. As is with the case with most rhythm games, you'll probably be too busy concentrating on the notes to see the side graphics anyways.

On my own 5th gen iPod, the game eats the battery about as badly as video playback. My battery life was never good to begin with and I managed about an hour on a charge. The newer iPods should hopefully manage better. I also had an intermittent problem where loading my entire playlist of 150 songs caused the iPod to reboot. I wasn't able to reproduce this later so I'm unsure what the exact cause was.

Takeaways
Phase (or iTunes) does a good job of calculating the game data from the song. And this data generation makes Phase more compelling than it probably would be otherwise. A common weakness for most rhythm games is the song selection. Regardless of the game controllers or graphics quality, the "quality" of the song list tends to be a large factor as to whether or not people like a particular rhythm game. No matter how cool the controller, if a person (me) isn't that big a fan of rock music, he's probably not getting Guitar Hero (I played my sister's copy instead of getting my own).

Phase allows me to tap away to my favorite J-Pop or anime themes which are hard to come by in US rhythm game releases. The guaranteed ability to play to your favorite songs is a definite point (I would say strongest) in Phase's favor.

The creation of game data lends itself to some tantalizing home-brew possibilities. I haven't investigated how the game data is stored, but it could in principle lend itself to game clients on PC and Mac platforms. Given the availability of various game controllers for home computers, one could potentially unlock all of one's song collection for a larger and more immersing interface.