2016-03-14

Three problems, if you are the first to solve any of them, then you win the grand pizza prize.

Calling all math experts and Pizza Hut fans alike! National Pi Day is here and this is your chance to win free “pie,” that’s 3.14 years of Pizza Hut pizza (awarded in Pizza Hut® gift cards)! Take a look at the math problems below and provide your answer to Option A, B, or C in the comments section. Please be sure to note which you are trying to solve. Answers will be time stamped to determine the potential winner and participants can only win once.
Best of luck!
– Pizza Hut & John H. Conway

The three problems:

OPTION A: SOLVED – WINNERS WILL BE NOTIFIED WITHIN 24 HOURS
I’m thinking of a ten-digit integer whose digits are all distinct. It happens that the number formed by the first n of them is divisible by n for each n from 1 to 10. What is my number?

OPTION B: SOLVED – WINNERS WILL BE NOTIFIED WITHIN 24 HOURS
Our school’s puzzle-club meets in one of the schoolrooms every Friday after school.
Last Friday, one of the members said, “I’ve hidden a list of numbers in this envelope that add up to the number of this room.” A girl said, “That’s obviously not enough information to determine the number of the room. If you told us the number of numbers in the envelope and their product, would that be enough to work them all out?”
He (after scribbling for some time): “No.” She (after scribbling for some more time): “well, at least I’ve worked out their product.”
What is the number of the school room we meet in?”

OPTION C: YET TO BE SOLVED, No one has gotten this one exactly right yet! Hint: It helps to show your work!
My key-rings are metal circles of diameter about two inches. They are all linked together in a strange jumble, so that try as I might, I can’t tell any pair from any other pair.
However, I can tell some triple from other triples, even though I’ve never been able to distinguish left from right. What are the possible numbers of key-rings in this jumble?

Since the first two are solved already in the comments. I chose to focus and solve 'Option C'.

WARNING SPOILERS BELOW!!!

The solution to Option C I arrived at is 7 + n, where n is any positive integer. Here's the picture I drew to convince myself:

The numbers represent how many rings each circle represents and 'n' represents any number of set of rings or chain of rings (like a chain of 1 rings). It got a bit messy when I tried to draw each of them individually. ;)

The two at the bottom don't need to be interlinking, especially when n=2. There are other combination of rings, but this seems to provide the simplest answer and largest possible answer space.

The "pairs" are indistinguishable. The triplet is distinguishable from any other triplet. This meets all the requirements of the puzzle.

2016-03-02

It's due to the fact that app developers usually install their app many times. And, it's possible to watch for those app installs in Android.

Implementing an app that takes advantage of this requires ZERO permissions.

So, I've created two working proof-of-concept apps: One to programmatically identify developer devices, and one to identify those kinds of apps and stop them. Both are open source and can be found on GitHub, and the later one can be found on Google Play.

I'll explain shortly how this is done.

Imagine, if you are an app developer, then your device(s) can be programmatically identified and have special code ran for them and nobody else will experience the same issue or app changes.

2015-11-17

As I've gotten free time, I've researched different popular static site generators and decided to use Jekyll because of their great documentation, support, community, and themes. Also, Jekyll has been really simple to implement and working on my server.

The current host for the site is at danialgoodwin.com/blog. The backend and piping is all complete. All that's left is to update the UI to how I like (it will maintain some minimalist aspects to it).

All my new dev and random posts have been going to the new site. The entire posting process is quite simple as everything is written in Markdown, so I could easily change which technology I'm using. Once I do a 'git commit', I just need a 'git push' and allow the server webhook to automatically compile the raw content data and publish the static site.

Finally, I now have quick loading site with all the internals open to me.

Blogger unfortunately is quite bloated, but it is a good trade-off for simplicity in many cases, just not mine.

2015-10-11

Basically, I really like this domain and I'm going to start adding more stuff to it. Unfortunately, Blogger doesn't support the kind of layout and setup that I would like, I will soon start to be using new tools and write about those specifics later.

One of the first new things that I want to add are about the books I've been thinking about and planning. The goal is to make sure that they have a very high signal to noise ratio for readers. So, the books will be about 500+ pages of content condensed to less than 100 pages. And, if I spend enough time thinking about the words used, I may be able to get some down to around 50 pages or less.

The requirement for these book projects are to be very high quality content. There will be blog posts with extracts from some pages and chapters that also provide useful examples and more side notes.

Some of the first few books that I've been planning:
- How to Learn
- Level Up - Programming

And, as I go through the above process, there will be a book for 'How to write a book'. ;)

2015-07-05

1. Add a Text object to one of your layouts.
2. In the corresponding event sheet, create the event System."On start of layout", then add the action for Text object called "Set web font".
3. Use Google Web Fonts to find a font you like, then click on the icon for "Quick-use". The name/Family of the font will be at the top, and scroll down to find the URL for the stylesheet of where to load the web font from.

2015-05-20

As I was refreshing myself with Ruby on Rails, I've decided to share these notes. To follow these steps, you don't actually need to know any Ruby or Rails, but you should have them installed already. I'm using Ruby 2.1.5p273, Rails 4.2.0, Windows 8.1, but these steps are simple enough to do on any version.

I show two different ways to create a very code minimal blog. It also demonstrates the power of of Rails scaffolding.

2. To create a post or comment, make sure that the `rails server` is started. Then, in browser, navigate to `/posts/new` or `/comments`.
3. Done

Without using scaffold

1. Run `rails new very-minimal-blog`
2. Run `cd very-minimal-blog`, then `rake db:create`
3. Create the model for the posts: Run `rails generate model Post title:string body:text`
4. Run `rake db:migrate`
5. Create a controller for the posts: Run `rails generate controller Posts`
6. In that controller that was just created in `app/controllers/posts_controller.rb`, add some code so that it looks like the following:

2015-03-21

Computer programmers must be perfectionists. If not, then there's another bug and another crash.

Additionally, writing a fully correct program/app requires programmers to be psychics and able to tell the future. Without so, more code breaks down and programmers wouldn't be able to work together, which ties in with having to be able to read minds.

Furthermore, most times there are more possible logical states in a program than there are atoms in the universe. That would take up quite a lot of the brain's working memory. And, each of them have to be thought through.

I'm surprised any program gets finished. Oh, wait, they never actually are. ;)

Anyways, even with all these impossible hurdles and limitless things to do, programmers have been able to come together and get things done. And, it feels good to know a program is finally running and [most] of the obstacles have been overcome.

Sidnote: So, here's where I would introduce my revolutionary new solution, but, of course it's not finished yet. ;b

2015-02-23

Don't use or like the caps lock key? Then, you can map it to any other key or functionality.

I've chosen to use the AutoHotkey scripting language rather than another tool or editing the Windows registry. AutoHotkey is great for quickly adding and changing key mappings. Just download and install to begin using.

My goal was to map the caps lock key to the enter key. So, I created a file called `map-caps-to-enter.ahk` and put in the follow:

Capslock:: SetCapsLockState, off Send, {ENTER}return

Basically, that code says when the capslock key is pressed, run the following instructions: set caps lock off, then send the ENTER key to the computer. Then the instructions are over when "return" is written. There's no limit to the number of instructions that can be added.

Here's another example that does the same thing, except that it is mapping caps lock to escape, along with a few more tricks that may be needed in a more complicated environment (like running other AHK scripts):

2015-02-13

Every single one of my apps need something like this. It's boring to explain in more details what's traditionally needed to make sure an AlertDialog is only shown once. Now, with this OneTimeAlertDialog.java, it's much easier to create new AlertDialogs that are only shown once.

/** Prompt that is only shown once to user. */OneTimeAlertDialog.Builder(this, "my_dialog_key") .setTitle("My Title") .setMessage("My Message") .show();

For something I use so often, I was surprised to not find a similar project on GitHub. So, I've added it: Android OneTimeAlertDialog