Rails Doesn't See My Local Gem Changes

For years I've held the belief that if I have a development problem that no amount of Googling helps me solve, and I eventually solve it, that I should post what I did in case somebody else comes along after me with the same problem. This is one of those posts. We have a Rails application here at work.  We also have a locally developed gem.  For my latest ticket I had to add some features to the gem. In general this is straightforward.  In the Gemfile of the app that points to your gem, instead of doing something like this: gem 'foo', git: '' you'd do this: gem 'foo', path: '/Users/dev/src/foo-gem' Assuming of course that you've got the gem source in ~/dev/src.  I'm skimming over the basics here, assuming if you got this far you've already tried a bunch of things. Here's where it got weird.  If you change the stuff in foo-gem , and then go back and restart you

Getting Smart Life Bulbs Working With Alexa

I started my smart home with a couple of Hue bulbs (and a hub) on the nightstand, and they've worked relatively flawlessly ever since.  I especially liked when they added the "what should we do when there's a power failure" option so they didn't come on 100% in the middle of the night! But these days they're practically giving away mini switches and bulbs and I tend to pick them up figuring I'll find somewhere to use them. Some have been Tuya and some SmartLife and I think I finally figured out that those are basically the same app.  So I've just started using SmartLife all the time. Recently I added both a simple mini switch, and a smart bulb, to my back room.  (I like the Teckin stuff.) Both wanted to use Smart Life. Both are discovered and work from the app just fine. But Alexa? Not so much. No amount of discovering new devices would show me anything.  I know I have the Smart Life skill installed on Alexa and it is working, because I have anoth

The Real Solution For The iPhone 7 No Service Cellular Error Problem

Both my girls have iPhone 7s. Yes, they're a bit old, and due for upgrades, but they were perfectly working phones. Until my oldest reported that her phone was now saying, "No Service" periodically and she would not be able to make or receive calls, or SMS texts. We tried the usual variety of things, making sure the software updates were applied, backup/restore, pop the SIM card, and nothing worked. I ended up replacing her phone for her birthday. But then her sister said, "Well, mine does that too," and her birthday's not for a few months.  So we tried the same myriad of things on her phone and the same type of thing happened, sometimes it would work for a day, sometimes it would go right back to No Service. And then I finally landed on the Apple Support page for the issue. Since it took me multiple days and lots of googling to eventually land on the page (while every other page under the sun says "Reset the SIM card! Check to make sure your soft

Why Ruby MatchData Returns Empty String

This one took us a little while to discover, and I've long had a rule that if I have a problem, chances are someone else might have that problem, so if I find the solution, I should share it. We have a situation where there's a bunch of company names we want to disqualify from a certain feature.  Pruned way down, it ends up looking like this: filtered_companies = %r{ups|    fedex|    amazon|    cvs|    walgreens| }x company="staples" if company.match(filtered_companies)     ...bounce the user elsewhere... else  ... And we found that a case like this was bouncing the user. Therefore, the result of the company match was returning a truthy value. Looking closer we saw that it was returning "", the empty string. But that's not right -- a failed match is supposed to return nil.  So what the heck was going on? I'm wondering if anybody reading has already spotted it. Look at the definition of our regexp at the top.  See that trail

Back From The Dead

Hi there.  If you're suddenly seeing a burst of posts from this blog, it's only fair that you get an explanation.  I haven't posted here since 2015.  Honestly I thought I'd de-activated the thing, but I still occasionally get email telling me that someone has commented. But then it occurred to me - I actually read a lot of books.  I have a 2 hour commute to work, and with the power of audio books on fast speed I've finished over 50 books this year.  Many but not all of them are of a technical nature.  To date all I've been doing is posting my thoughts on the company slack channel.  So it occurred to me, why not share those thoughts here as well? Might as well take advantage, the work's already done.  If more people get value of out it, all the better. The only question is whether to focus entirely on the technical ones (such as the samples I just dropped) or basically post about everything I read, which ranges from science fiction to self help.  If anybo

Book Review - Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone by Satya Nadella

Nearing the end of Hit Refresh  by Satya Nadella, CEO of Microsoft.  I don’t generally like Microsoft, and didn’t expect to like this, I grabbed it mostly because I hadn’t done much business/tech reading lately.  I’m very happy to report I’m enjoying it very much.  Gone are the days of “Microsoft Over All” and crushing the competition through all means necessary.  This guy’s all about “Here’s the mistakes we made, we know that.  Here’s how we’re trying to fix things.  Past rivals are now partners because the end goal should be benefit to the consumer (somebody tell that to Google and Amazon fighting over YouTube), and companies should work to find common ground, not fight it out in the courtroom. He comes off as much more likable than you might think, readily owning up to sometimes big mistakes - like when he very publicly said that women should not ask for a raise but rather put their faith in the system.  (

Book Review - Life 3.0: Being Human in the Age of Artificial Intelligence by Max Tegmark

Finished Life 3.0  over the weekend.  Hmmm.  Let’s put it this way - I ran to this book entirely because of its connection to Elon Musk.  If I described Elon Musk as a billionaire genius who believed that for the good of the human race we need to escape the planet, he might sound like something out of a Robert Heinlein novel. But then you read his biography and you think, “Damn, everything he’s doing makes sense, that could actually work.”  So when I saw his name attached to Life 3.0 I thought that I might get a similar look at the future of machine learning - sure we’re talking about moonshots but let’s break it down to incremental, believable steps…. This book does that a little bit, at least in theory, and at least in the beginning.  He started with some very grounded examples of how machine learning is evolving, and how quickly and unexpectedly (take for example the solution to Go, which was not expected for a long long time).  But before you know it he has jumped to galaxy size

Book Review - The Master Algorithm How the Quest for the Ultimate Learning Machine Will Remake Our World by Pedro Domingos

Finished The Master Algorithm by Pedro Domingos, a book I was so excited to get to that I went with ebook->text-to-speech because I couldn’t locate an audiobook copy.  Loved it.  Highly recommended as a modern introduction to what’s up in the world of machine learning.  It’s not a history book that tries to say “Here’s how it all got started 70 years ago”, but it does dip backward in time to provide context when necessary.  The authors got no problem stating his opinions, not afraid to say “And here’s why he’s completely wrong” about men like Marvin Minsky, Doug Lenat and Ray Kurzweil. The book does get pretty heavy into the computer science at points (especially after glossing over some of the earlier schools of thought and digging deeply into Bayesian networks), so it’s hard to follow in audio and I’m not sure how quickly somebody without a math and/or CS background will get lost in the details.  Suffice to say he doesn’t hand wave over anything and say “This technique kind of

Review : Fitbit Charge HR

Even though I don't always get 10,000 steps a day I love my Fitbit One. I'm a firm believer in the psychology of "if you measure something, you will naturally be motivated to improve your score."  My biggest problem with the Fitbit One is that it goes in my pocket, and then I forget about it for the day until I take it out at night. I never stop during the day to wonder how many steps I'm at. If it gets to be 11pm and I take it out for the night and I'm at 8000 steps, I don't really have an option. What I *do* do is spend the day wondering if I've accidentally lost it.  If I've got my car keys or something in my pocket, then every time I take my keys out I'm wondering if my One came out with them and fell on the ground. That's annoying. The other problem with the One is that there's plenty of activity beyond just steps. You start to feel like you're cheating yourself when you realize you're not getting credit for stuff like

Why Does My Google Cloud Print Printer Keep Going Offline?

When we got a Chromebook for the house I had no idea what "Google cloud print" even was.  It's turned out to be more of a pain in the neck than anything else and I'd gladly go back to the old way if I could. I've never had to temporarily share a printer with my neighbor, or print something at home when I was at work, or any of the other situations it is supposed to make easier. Worst of all, the printer regularly goes "offline".  This is the most frustrating error message in the world, because your printer is on, it is connected, it prints test sheets fine, you may even  have some real computers available that do it the old fashioned way, and those can print fine. But cloud print says it's offline and offers no suggestions for how to fix it, other than to go messing with your firewall  - something that no doubt most of the folks opting for Chromebooks know exactly how to do, right?  This became such a problem that we bought a new, "cloud print

Android : File exists but canRead() returns false

I'm working my way through this developer document about capturing and saving photos  and ran into a problem. My photo was saved properly, I could call up the ADB shell and verify it. But when I tried to read it back so that I could display it on the screen, this code would fail: File imgFile = new  File(mCurrentPhotoPath); if(imgFile.exists()) {     Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());          ImageButton btn = (ImageButton)findViewById(;     btn.setImageBitmap(myBitmap); } Sound familiar? I had requested the WRITE_EXTERNAL_STORAGE permission properly (which implicitly gets the READ_EXTERNAL_STORAGE permission as well), so that wasn't the problem. It turns out that the file does indeed exist, but it was failing on canRead().  Since canRead()==false, exists() was also returning false. Ok, then, why can't I read it? The problem lies in the photoPath, and whether to use a URI or a regular file path descriptor.