My last post explained how to create a lexicon from the new NASPA word list (NWL2018) for the Android app. At that time you had to create a new database with the PC version of the program and transfer that to the Android device. Since then I've developed an import lexicon tool in the app. You will still create the lexicon on the PC, but instead of transferring the database you transfer the exported lexicon.
Follow the steps in the first two parts of the instructions through phase 2 to create the lexicon.
Instead of configuring it for Android, select Export Lexicon to save the lexicon to file and then transfer that file to emulated storage on the Android device.
Open Hoot and go to Tools. Select Import Lexicon. Note that it says it is a beta feature. While it repeatedly works successfully for me when done correctly, there may be some errors that it doesn't catch. If you're importing into a custom database, make a backup first. In one test, Hoot did quit with an error but after restarting Hoot the new lexicon was successfully created. It's a feature you won't need often, but with new lexicons for TWL and Collins this year, I figure some of you might need it.
The Import Lexicon screen will be displayed for the lexicon details. Select the file, give a name for the lexicon, and enter the details you would like to store for it, but don't include a copyright symbol in the notice. That would make it impossible to Export.
Pay attention to language and Tile Set. The language links the words to the stored definitions. The Tile Set is used to calculate and store the scores. Then press the button to Import Lexicon.
Wait! Importing the lexicon and calculating the scores will take some time depending on the power of your device. On my S7, the lexicon for CSW19 was imported in less than five minutes. After the lexicon is created you will have to go to Settings to select the lexicon.
The Hoot download page has a collection of preconfigured lexicons you can use. However, it doesn't include the most commonly used lexicons (TWL and Collins) since distribution is limited. TWL (aka NWL2018) can be downloaded by members from the NASPA website.
]]>
Update: The NASPA lexicons are now identified as NWL2018 or NWL18 (NWL2020 for new lexicon effective in 2021). It is also included in the Hoot Android app, so you don't need to create it unless you really want to. I'm leaving this post to show how you could create other lexicons.
I've neglected this blog a bit since I started working on the Hoot Android app. Now that the new North American Scrabble word list it out, I feel I should preset a succinct demonstration on how to create a lexicon for OTCWL2018 (OWL4). The first caveat is that it is up to you to get the new word list. It is available to members to download from the NASPA website. It is also worth mentioning that it is copyrighted and may not be legally shared with others.
You can get the list by going to http://scrabbleplayers.org. Then login (or join if you haven't) and go to Members and then Member Services
Scroll to Downloads and select OTCWL2018 (Windows text)
Remember where you save it...
Next you will need to have the PC program Hoot installed. If you don't, you can go to http://www.tylerhosting.com/hoot/downloads.html to get the latest version. Download the latest Version 3 Installer, Install and run it.
To create the lexicon, follow these steps
To show hooks, probability, playability, anagrams, etc, you will need to configure the lexicon. Follow these steps
I use to say wait 30-45 minutes, depending on computer speed. Mine actually took 19 minutes.
Note that if the program doesn't stay in the foreground, the status box may stop being updated, but it is still working. Just wait.
In order to prepare it for Android use, there is another step. If you forget, the app will do this but it will take longer. Follow these steps.
Optionally, you can take additional steps to reduce the size of the database before you put it on your phone. See below
The Hoot app has improved considerably since this post, so it's much easier to add new lexicons.
Once you have created the lexicon on the desktop, instead of moving the database to the device, you can just export the lexicon to a file. Then in the Android app, go to the dot menue > Tools > Import Lexicon. Select that file, fill in the blanks, and Begin Import. When it's done, you're done. You just have to select the new lexicon in Settings.
Note: You can't export a copyrighted lexicon such as the NWL20 that is included in the Hoot distribution.
To use the database in the Android app you will have to copy it to internal storage, or the emulated SD Card. Hoot can't read from an actual SD Card. This may be the most difficult for some. There are several ways to get it there, including using a file manager app, sending via Bluetooth, or Emailing it. If you use email on your phone, emailing it may be the easiest way.
Send database: You can find the location of the database on your computer by looking at Settings > Databases. Once you find it, right click and Send To: mail recipient and send it to the email on your phone.
Prepare a location: You will need to decide where to put the database. My suggestion is to find or create the folder Documents and store it there. In a Samsung Galaxy S7 for example, you can run the Files app. It opens first to Downloads. Select the sandwich menu (three lines) and select the emulated SD Card (internal storage). From the three dots menu, select New folder and create the folder Documents.
Save database: Then open the email on your phone to save the database and select this folder.
Select database: Open the Hoot app and from the three dots select Settings, then Database, and find the file you just saved.
Select lexicon: You can then select the lexicon.
In order to reduce the size of the database you can take steps in the PC program to delete unused lexicons, and then recover the space they used. If you are using a new database, this may not be necessary.
Go to Settings > Configure Lexicons. For each lexicon you don't want in the database, select and Delete Lexicon
Go to Settings > Databases. Compact Database
]]>
New! Two Android apps of Hoot are now under development. Each app includes a database with the installed lexicon, and the ability to use external databases. Update: The first release of the Hoot app is now available on Google Play. The search screen is a modification of the Combination search in the PC version and has sort options. Click on the link to get the them on Google Play. Please provide feedback with problems, suggestions.
North American lexicon
|
Collins lexicon
|
After two years working on Hoot, the desktop version, I started working on an app for Android. While I've wanted to build one much sooner, the computer limitations prevented me from getting much done. My computer was more than a decade old, and had no upgrade options available. After going from a system with 1.5 GB to one with 32 GB, and other improvements, I decided I could begin work. In the meantime, Android Studio and the emulators have improved so much that getting work done on it was a pleasure and I was able to get the beta ready in just over a month. I have a long list of things I want to do with it so app development will probably continue for another year.
Writing an Android app is a lot like creating a dynamic web page. With the web you need to learn formatting with HTML/CSS, and write code in PHP or Javascript. With Android development you need to learn an Android version of XML, and write code in Java. While XML is a simple concept, the language is new and complex, with many caveats. Once I learn it more, I'll begin to appreciate it more. While there is an abundance or resources available for learning Android development, much of it is old and uses out-dated concepts, and deprecated methods. Improving my skill involves both learning what to do and how to do it, as well as learning what not to do and how not to do it, now.
]]>The guide says you should attach the image where you want it, but it doesn't include the file in the page markup and instead includes a tag that identifies the image. The logic presented in the on-line forums is that you can adjust the stylesheet and php to apply uniformly to all images. You can put the image in different sections (teaser, cover, in-line) of the post and it supposedly is more efficient that way.
Although you have multiple options for placement (vertically) in a post, if it's an in-line image you can't see it in the editor. Instead you see . Additionally you can't modify the formatting of the image. That's where the problems resides. If b2evolution included the code in-line (like it used to) I could modify the HTML/CSS to format the image.
Emulating a print publication, I like to wrap text around some images, and like adjusting the size to make it look more balanced. Well, there is a way to include the markup, but it's not intuitive.
I've discovered after inserting all my images that there is a viable workaround to get the code into the post, something that used to be an option in the editor in past versions.
1. Go to the b2e Back-office and select Files > Browse and upload the images for the post. I prefer to put them in the root collection folder, not the quick-uploads.
2. From the post, attach any image to the post (ideally an inline). The easiest way is to select Attach existing files and select one. You won't be including that in the post, but you will be using that image to get to other files you would like to insert. If an image tag is inserted into the post you can delete it if you want.
3. Position your cursor at the point in your post where you want to include one of your uploaded images.
4. Go to the attached image in the Images and Attachments section and click on the Locate file icon (bull's eye).
5. When the Attach files dialog box is displayed find the file you really want. You may have to change folders to find it. Again, I prefer to use images in the root collection folder.
6. Check the box for the file to select it. Don't press Attach.
7. Finally, at the bottom, with selected files: change the option to Insert IMG/link into post and press Go.
The main reason I want the code in the post is so I can customize the image. In order to do that switch to Markup view and find the image's code. It'll begin with something like
<div class="image_block"><a href="..">
Two of the modifications that I generally make are to position the image and resize the image to look good in the post. By positioning, I generally float it left or right.
In markup, find the image markup as noted above and change the div to add
style="float:right"
so it looks like this
<div class="image_block" style="float:right"><a href="..">
If you are floating, it might also be necessary to adjust the margins by changing it to
style="float:right; margin-left:20px"
The image should show the actual size in the img tag and would look something like this.
width="431" height="56" />
If the size is not appropriate for the post, I simply change the width to a percentage and drop the height so it would look something like this
width="35" />
I have used b2evolution for many years, and find it useful for multiple blogs, but I guess these kinds of challenges are one reason it is not so popular as a blogging platform.
]]>There are three basic facts you should remember about home sales. The first thing should remember is that you only have to pay tax on the profit from a sale. The profit is based on the difference between the basis and the selling price. Generally, the basis is what the house was purchased for plus amounts paid for improvements. So, if you purchased the house at $75,000 and sold at $100,000, the profit would be only $25,000. It's only natural that you would make a profit on a home sale since inflation and appreciation increases the value of your home.
Secondly, current tax law allows owners to exclude $250,000 ($500,000 if married) of gain on a home sale. To qualify, the home must have been owned for two of the last five years, and used as a main home for two years out of the prior five years. So that taxable $25,000 becomes zero. Incidentally, that hasn't always been the case. See Income Averaging and Transitions in Tax Law for an interesting comparison with 1964 tax law.
Third, property inherited receives a basis equal to the fair market value of the home at the time of the decedent's death (with some exceptions). In this case, the heir would not qualify for the exclusion mentioned above since he didn't live there. However, even though he may not have paid anything for the house he inherited, his basis for calculating profit is the value at death, which should be close to the actual selling price. By definition, it's not likely that someone will purchase the house at very much over the "fair market value", so it should be rare to owe any tax on the sale. It's much more likely that you would be selling below fair market value just to get it sold.
Most people probably understand that you only pay tax on the profit, but many will not know about the exclusion or the treatment of inherited property. Of course, there may be other aspects of the sale to consider, but remembering these three facts may come in handy for you or someone you know.
There are many tax traps where you are liable for taxes you didn't know about, but there's probably more "traps" that involve taxes you paid that you didn't have to or credits you didn't claim.
For many years people, including many tax preparers were not aware of the benefits of education credits. You may think that's just for low-income taxpayers, but if you make less than $80,000 ($160,000 joint), you could qualify for up to $2500 in AOTC, often even if you received financial aid, and even if you didn't pay anything out of pocket. Plus, there are several other tax credits.
Education Tax Credits were so overlooked that I wrote a book on the subject two years ago. See Education Tax Credits. A few things have changed (technically) since then, but the credit is essentially the same. For example, you now have to have a 1098T, but the institutions will now have to provide one to you. If they don't you can still claim as if they did. You can see a summary article at Education Credits: Beyond the Basics.
One of the basic concepts of inheritance of property is that it gets a step-up in basis which usually means no taxes. Although inherited property gets a step-up in basis, if you receive an IRA as an inheritance, it is taxable and there is a significant penalty for cashing it in. There are other rules related to IRA management, and the institution may not warn you about them. Read more about Common IRA Traps.
Yet another thing that many people are not aware of is that taxpayers can normally amend (change) their tax returns for up to three years to get benefits they didn't claim when they first filed. Of course, there are some things you can't easily change with an amended return, such as uncashing in an IRA distribution.
In many tax cases you can consult a tax professional, but in some cases it may not be enough to consult one or two professionals. If it involves a large amount or tax, research it yourself and ask a lot of questions. Start with googling if you want, but refer to taxpayer publications or the tax code to verify what others are saying. Don't blindly rely on a website or even a tax preparer. Many times the tax forms and instructions will guide you through the calculations, while tax preparers way speedily just fill in the blanks.
]]>Other Checks
You don't have to take special steps and use Flash Player to get a good check mark in Word. Symbol is not the only symbol font in Word. After you "Insert Symbol, More Symbols...", you can select a different font to use. One symbol font on my system that has decent check marks is OpenSymbol. The check mark can be found near the bottom of the list, along with an X, and a version with both symbols in a box.. oh, and an empty box. And some alternate checks.
In my 2007 version of Word there are several other symbol fonts, and they are easy to find since they are at the bottom of the font list. There is Wingdings, Wingdings 2, and Wingdings 3, all from Microsoft. Wingdings has the same set of check characters as OpenSymbol.
In order to get a list of symbol fonts on your own system, using Windows Explorer and open C:\Windows\Fonts. The list of fonts is normally displayed with several columns showing various characteristics of the fonts. Two characteristics are Category and Designed for. Click on the header to sort by Category, and then scroll down to the list of Symbol/Pictograph. Not all designers set these characteristics, so there may be others (like Symbola) you can use.
If you don't have many, you could also search the web for Symbol fonts and find some that would be useful to you. Of course, that sounds easy, but most sites only display some of the alphabetic characters which may or may not include symbols so you may not be able to see what symbols are available until you download and install.
Word Remembers
But wait!! There's more. Once you use a symbol, Word puts it in the list of recently used symbols so you probably won't have to search for it again. Some of them are shown in the main Word screen when you click Symbol. Others are shown at the bottom of the More Symbols... dialog box under Recently used symbols. How many? I'm not sure. At first I only saw about a dozen but as you widen the window you can see others. I counted 36 that I've used.
Embedding
One other issue that you may want to consider, whether or not you use symbols, is how your font will be viewed by a recipient of your document. If they don't have the font on their system they may see garbage. In order to embed (or include the font) in your document, select Word Options and Embed fonts under Save.
The more you know about how Microsoft Word works the less you will have to take drastic measures to get something to work.
]]>Another significant difference is the use of inherited forms. While users should not care, it does mean the code is smaller and (theoretically) faster. For me, it means changes can be made to the interface easier.
Finally, the new Hoot includes a ribbon, like you might have seen in Microsoft Office applications beginning in 2007. While this ribbon is not from Microsoft, it is a very good look-alike. All of this may sound boring, but for a developer it is a little fascinating, figuring out how things work, as well as how to work around limitations.
With the MDI I could avoid creating new form for each call and instead open them as child windows. Other than setting the appropriate flags on the parent form, the only thing I had to do different is open the forms appropriately for the MDI. One standard way to open such forms is with code like what I've used. This also cascades the new form over the last active child.
private void OpenChild(Form child)
{
child.MdiParent = this;
Form last = new Form();
if (this.MdiChildren.Count() > 0)
foreach (Form f in this.MdiChildren)
if (f == this.ActiveMdiChild)
{
last = f;
child.Location = new Point(last.Location.X + 25, last.Location.Y + 25);
break;
}
child.Show();
}
If I want to insure only one copy of that form is used I simply check for the form name among the children.
private void OpenOneChild(Form child)
{
if (!(FindChild(child.Name) == null))
{
child.Activate();
return;
}
OpenChild(child);
}private Form FindChild(string name)
{
foreach (Form f in this.MdiChildren)
{
if ((string)f.Text == name)
return (f);
}
return null;
}
Of course, if I wanted to open a form from a child window, I would use a different method.
private void OpenSibling(Form child)
{
child.MdiParent = this.ParentForm;
Form last = new Form();
if (this.ParentForm.MdiChildren.Count() > 0)
foreach (Form f in this.ParentForm.MdiChildren)
if (f == this.ParentForm.ActiveMdiChild)
{
last = f;
child.Location = new Point(last.Location.X + 25, last.Location.Y + 25);
break;
}
child.Show();
}
When I mentioned Inherited forms on one discussion board one of the responses started with "ouch, ouch, ouch". Well, it's not so bad. With inheritance in C# you can't normally pass parameters to an inherited form, so I found a workaround. While inherited forms apparently can't take parameters in their constructors, at least not directly, you can access the controls of the inherited form and force a parameter.
1. Add a label named lblTrigger (public or protected)
2. Add an event to the label for the TextChanged event
private void lblTrigger_TextChanged(object sender, EventArgs e)
{
switch (lblTrigger.Text)
{
case "Hooks": ShowHooks(); break;
case "Words": HideHooks(); break;
case "Slides": btnSlideShow_Click(sender, e); break;
case "ChangeLanguage": PopulateResources(); break;
}
lblTrigger.Text = "Trigger";
}
3. Change that label from the ribbon or another form
public static void SetTrigger(string text, System.Windows.Forms.Form frm) {
if (frm == null)
return;
foreach (System.Windows.Forms.Control ctl in frm.Controls)
{
if (ctl.Name.Equals("lblTrigger"))
ctl.Text = text;
}
}
You're not limited to one label, either. You can add parameters to use with a different label. That's what I've done using lblParameters included in one of the code segments below. Set the parameters, then "pull" the trigger.
In one case "SavedSearch" is the text I set for the trigger.
case "SavedSearch": OpenFromRecent(); break;
That then calls this method which simulates a button click on the form.
private void OpenFromRecent()
{
specs = Utilities.LoadSearch(lblParameters.Text);
if (specs == null)
return;
cboSearchType.SelectedIndex = Array.IndexOf(english, specs.searchtype);
if (!(cboSearchType.SelectedIndex == -1))
{
txtSearch.Text = specs.letters;
cboMin.SelectedIndex = specs.minLen - 1;
cboMax.SelectedIndex = specs.maxLen - 1;
cboBegin.Text = specs.prefix;
cboEnd.Text = specs.suffix;
txtFilter.Text = specs.filter;
}
btnSearch_Click(this, EventArgs.Empty);
}
The ribbon I am using in this project is the one mentioned in the Code Project article at https://www.codeproject.com/articles/364272/easily-add-a-ribbon-into-a-winforms-application-cs. It's a third-party ribbon for C#, not WPF or other Microsoft. While it looks and performs well, there is a limited documentation for it. The intellisense and integration with Windows is good, and many items are similar. One of my biggest challenges was determining how to use the Recent Items list.
One thing that was not so easy to understand was the use of the Recent Items list in the Orb menu. Determining how to create recent items dynamically, however, was one of the biggest accomplishments recently. My last blog entry touched on recent items and using the C# .Designer file to figure out how to create them. Actual implementation was a little more difficult. With my implementation I created a new class with properties of the recent item that I would use.
public RecentItem(string tag, string text)
{
ItemID = 0;
ItemTag = tag;
ItemText = text;
UserID = Properties.Settings.Default.User;
}
The text is the filename. The tag indicates the type of item since the items are not identified by file extension. ItemID will be updated when saved to the database. The database fields are similar to the class fields.
..
List<RecentItem> load = new List<RecentItem>();
load = DBManager.LoadRecentItems();
AddRecentItems(load); // see below
ribbonMain.OrbDropDown.RecentItems.Reverse();
..
Reverse is used to put latest items at the top. The ID is set by the database using autonumber so the oldest items have the lowest ID and are loaded first.
private void AddRecentItems(List<RecentItem> recentItems) {
foreach (RecentItem item in recentItems)
DBManager.OrbAddRecentItem(item); // see below
}
public static void OrbAddRecentItem(RecentItem recent)
{
frmHootGold top = (frmHootGold)System.Windows.Forms.Application.OpenForms["frmHootGold"];
RibbonOrbRecentItem adder = new RibbonOrbRecentItem();
adder.Tag = recent.ItemTag;
adder.Text = recent.ItemText;
adder.Value = recent.ItemID.ToString();
top.ribbonMain.OrbDropDown.RecentItems.Add(adder);
adder.Click += new System.EventHandler(top.OrbRecent_Click); // see below
}
When the items are added to the list, either as new items or when loaded from the database, the click event is set.
A separate method is used when actually adding a new item that has one difference to add the new item to the list that has already been sorted in descending order.
public static void OrbInsertRecentItem(RecentItem recent)
..
top.ribbonMain.OrbDropDown.RecentItems.Insert(0, adder);
That's done from one of the child windows with code segment something like this
RecentItem adder = new RecentItem("SavedSearch", searchFile);
DBManager.AddRecentItem(adder);
DBManager.OrbInsertRecentItem(adder);
When a user clicks an item on the Recent list, the following method uses the trigger and parameters mentioned earlier to pass that information to a new child form.
public void OrbRecent_Click(object sender, EventArgs e)
{
RibbonOrbRecentItem item = (RibbonOrbRecentItem)sender;
Form form = new Form();
switch (item.Tag.ToString())
{
case "SavedSearch": form = new frmCombo(); break;
case "Textfile": form = new frmTextfiles(); break;
}
OpenChild(form);
MDIUtils.SetParms(item.Text, form);
MDIUtils.SetTrigger((string)item.Tag, form);
}
One of the things I learned about Recent Items is that there is no obvious way to enable user-deletion of items. I notice Word doesn't have that either, nor does Windows, so I decided not to worry about it.
If you use this in a program you may notice that the items are added to Windows list of Recent Items, but it's not because of this method. It's simply because they were files that "you" opened. Anyway, this is my contribution to the C# Ribbon knowledge base.
]]>