Showing posts from October, 2019

Convert multiple MOV files to multiple images

You want to convert your .MOV files likely taken with your iPhone when the motion option was on, to still images. You scouted the web and you can't find a simple command on the thousands of ffmpeg options to do that.

You are not crazy, they don't have it! Not in a human feasible way. So here it is:
for i in *.mov; do ffmpeg -i "$i" -frames:v 1 png/"${i%.*}.png"; done References

Extracting Text from Image AKA OCR

Extracting text from an image (OCR) can be very convenient for automating operations upon a user-provided content. iOS13 has a ton of improvements on the subject via the Vision library. To try it out, follow this recipe:

Create a new playgroundUnder the resources, folder add two images that contain textUpdate their names in the code (image1, image2) or rename the files accordinglyRun the playground and enjoy the console output.
As usual, the code is on GitHub.

ReferencesBuilding Custom Deep Learning Based OCR modelsBuilding an iOS camera calculator with Core ML’s Vision and Tesseract OCRIntroduction to Deep Learning2018’s Top 7 Libraries and Packages for Data Science and AI: Python & REmbracing Machine Learning as a Mobile DeveloperThe Lifecycle of Mobile Machine Learning Models

iBeacons, WatchKit and Fun

As you remember a while back we built a Watch app for a typical caveman. In this two series article we’re going to learn how to build an iPhone app that can detect iBeacons (PART I) and then communicate with the Apple Watch to render some caveman staff on the screen (PART II).

Background Knowledge What is an iBeaconBeacons are hardware devices that intermittently send out a Bluetooth signalBased on the type of hardware you get slightly different features, like longer ranges and faster frequencies of updatesBeacons identify themselves with a unique ID (UUID), and a major/minor versioning systemYou can’t connect to any beacon just because you are awesome, you need to know to know the combo at the previous bullet. Beacons are found in packs like Dinosaurs, if they all have the same identification qualities (called Region) than they belong to the pack.A beacon region can be created using just a UUID What can you do with them?You can place in every room of your house and when you app is cl…

It's all matter of angles, in life

It is a matter of angles Geometry is the heart of many things that have fueled humanity imagination and technology achievements. Galileo Galilei built plenty of work around the geometrical principle of angles. Perhaps the most fascinating and even the most intriguing since it is leveraged in a lot of pseudo-science movies is the triangle. Angles can be categorized into 5 categories: Acute < 90ºObtuse > 90ºRight = 90ºStraight = 180ºReflex > 180º You can build different shapes just leveraging different angle sizes. A friend recently applied for a corporate job where he was asked the question “if an analog clock shows 4:20 what’s the angle?”.
He couldn’t answer the question. Here is how I addressed it: The minute hand makes one revolution or 360º every hour.
At 4:00, the minute hand is at 12, its starting point=0º at 12
At 4:20, the minute hand traveled 20/60 or 1/3 of an hour which means1/3 of 360º. The calculator says it’s 120º from the starting point. The hour hand makes one revo…

Setup Blogger with Google Domains

Setting up Blogger with Google Domains should be a real piece of cake considering that both products are owned by the same company. WRONG!
As of Oct 2019 the Blogger documentation doesn’t match the UI and therefore missing options for allowing an integration that should be an out of the box experience.
Here is what you have to do in order to make your own Google Domain host to work with Blogger.


Login in Google Domains, enter the management of that domain and add the following records to your Custom resource records.

If some already exist, leave them alone.
1 & 2 are basically confirming to Blogger that you are actually the owner of the domain. A safety check. You will find that information to enter in those records in Blogger at the time you set to configure your custom domain.
3 & 4 instead guarantee that if someone types the name gets resolved.


Google Domains doesn’t support root domain which means if you leave everything as is, your d…

Build an independent watch app - PART III

In Part I, we created an app for the typical caveman with an Apple watch. In part II, we added support for hearing the sound a dino makes. Now it is time to add icons so that rather than have the lame gray circles default icon we’re going to have something more fun. If you are an artist go ahead and develop your own image. Post done. Bye! For the rest of us, here is the plan: Grab an image that you like, as big high resolution as possible but don’t go overboard for it. No one needs 4K imagery.  Download Icon Set Creator or App Icon Set Creator, set your target and provide your image.

The app will generate your assets for XCODE.

After trying several options out there I found myself happier (but not overjoying) with Resizer. So much that I purchased the in app purchase option to feed the work behind it.

If you feel cheap and don't want to feed innovation or help a fellow developer (feel the guilt?!) you can also use a Github option.

As an example, using Resizer Lite, I fed to the t…

Build an independent watch app - PART IV

In Part I, we created an app for the typical caveman with an Apple watch. In part II, we added support for hearing the sound a dino makes. In part III we added pretty icons. Now, it’s time to deploy that app on the watch so the caveman can go back and hunt for…me! To deploy on the hardware you will need the following: Lightning cablePhoneWatch Step Zero Make sure that you watch has the latest and greatest watchOS installed and that the watch app on the iPhone can see the watch and that is currently set as active. In case you have more than one watch and don’t use a dedicated phone/watch combo, this step is important. If you only have one of everything than you are good. Step OneOpen Devices and SimulatorsConnect the phone to the computerWait for XCode to tell you that your device is ready for development.

Step Two After staring at such a pretty and amazing UI for the whole 2 nanoseconds. Connect your phone to the computer where XCode is installed. Connecting to your mom’s laptop won’t…

Build an independent watch app - Part II

In PART I, I explained in super details on how to make an independent watch app. A reader posted in the comments a request on how to make the dinos do sounds. I wasn’t taking on the ask until I found that the reader is a little young girl learning how to program Apple Watch. I am a sucker for such combos so I figured let me show the way.

Originally posted by flipomatic
The project still the same we used last time. Here’s what changed: Added a button on screen twoAttached a function to the button to play the dino’s soundAdded some sounds UI changes Open the storyboard file and on the second screen at the bottom, add button. By default, the buttons are ugly and uninteresting. Use the inspector to change its appearance. Here what mine looks like.

Enable the assistant like we did in the previous post so that you can see code and UI at the same time. Holding CTRL (or dragging with right-click) draw an outlet from the button to the source code DetailsInterfaceController.swift. Pay attention …

Build an independent watch app - PART I

Let’s just say that you woke up from the last glacial era and you discovered Xcode under a rock. The next day while the skulls of dinosaurs still floating on the melting ice you decide to buy an Apple Watch from Cave Store. Now, because you are darn smart you decide I need an app in my life something that gives me some essential information about the dinosaur left on the planet. You know basic caveman situations, with an Apple Watch. You pray the Gods to receive such knowledge on how to build an app and while you hunt a Mammoth to give away; I, God of the story. Clearly! I chisel knowledge into stones that will be delivered to you upon BBQing your upcoming elephant of the past.

Originally posted by notobscurevideogames
Let’s get that done then. I will be using Xcode version 11.0 (11A420a) although this info with the proper adjustment will work with a lot of other versions. Our app will have two screens. Screen 1 list all dinos are known to man…okay the ones that I know, even Gods have…