2019 Holiday Learning Update

As I do every summer, this last few weeks I’ve been deep diving into a new subject: AI & Machine Learning.  

Almost every day I pack my laptop, Aurélien Géron’s book -he has done a phenomenal job-, and walk to a coffee shop close by to study. 

IMG 4106

Yes, that’s an HP laptop right there! It’s great for ML on the go. 

It’s been so much fun, not only because of how refreshing this change is: Python instead of Swift, Jupyter Notebooks instead of Xcode, cafeteria instead of home office… But also because of how interesting Machine Learning has turned out to be. 

Not only deep diving into Machine Learning gives you many ideas on topics you could work on, but it also allows you to understand its pitfalls (hello YouTube video recommendations or Amazon suggestions). So far I’ve been focusing on everything but neural networks but that will change starting tomorrow. Can’t wait. 

On other news, I likely won’t be able to post the following two weeks as I’ll be in Australia for holidays. I’ll pack my faithful HP Spectre and Aurélien’s book to keep at it during flights and during idle times though, so I’ll have plenty to report once back. 

Hope you’re having a productive summer. 

 

Marc

—-

 

Twitter -> @MarcMasVi    

2019 Holiday Learning

One of the things I deeply enjoyed from my middle & high school summer holidays was how I would, overnight, switch my school routine for almost 2 months of passion projects. 

As I grew older and my interests changed I deep dived into different areas: I vividly remember one summer sitting for hours at a time devouring ‘The Three Investigators’ books or on another one discovering how to bring ideas to live with wood. There was no plan about it, just learning areas I was passionate about. 

Nowadays I don’t have 2 months of holidays anymore but I like to apply the same concept for my “on the side” projects; for around 2 months I deep dive on a new area I am passionate about. This area must be different from what I work on the rest of the year thus helping me expand my knowledge to areas outside of my existing competencies and enabling me to recharge batteries.  

This year I’m spending the time getting up to speed on the latest improvements to AI & Neural Networks and how they can be leveraged for everyday applications. I’ll likely post something more in the future as I work on it more. 

Coincidently one of the YouTube channels I follow just posted an excellent high level overview of what AI & ML is. You don’t need to be an engineer nor to code to follow along, totally recommended

Have you considered summer holiday for your ‘on the side’ projects? If not, I totally recommend it. 

 

Marc

—-

 

Twitter -> @MarcMasVi     |     Micro.blog -> @MarcMV

NewsWave 2019.7

And just like that, NewsWave 2019.7 is now available on the App Store. 

 

OPML Import / Export

This was one of the most requested features from day one (and it retrospect a feature NewsWave should have shipped with):

-OPML Import: From any app that can export feeds (or using an OPML file) you’ll find an option called “Copy to NewsWave”. This will start the import process, feeds that no longer exist or that return an error will be skipped. Once the import finishes you’ll see the total number of feeds that were successfully added.

-OPML Export: When you trigger it you’ll get a prompt asking you what to do with the file: send via email, save in files, copy to another app… The choice is yours! 

 

Bug fixes & improvements

Many! Thanks to all of the users who shared feedback, here are some of the key fixes / improvements:

-Fixed an issue that could show the “Today” button under incorrect circumstances.

-Added a validation step to know if the user can send email before triggering the “Send Feedback” action.

-Improved the way cleanup is handled if the app has not been opened for a long time. 

-Improved the process of syncing deleted feeds between devices. 

-Improved link handling of Daring Fireball articles. 

-Fixed an issue preventing some of the “Delete Read Articles After” options from being displayed. 

-Added an option to manually refresh feed list. 

-Fixed an issue that could result in inconsistent scrolling in the feeds view. 

-Addressed an issue that could result in views not showing the latest information. 

-New subscriptions based on a url search will now grab the latest articles from that feed instead of only future ones.

-Many other tweaks and minor improvements. 

 

What it does not include

It does not include a “Default mix of feeds for new users”. And the reason is that I’m still not sure on the best way to implement it. Should it suggest only 1 recommended mix of feeds, should I recommend a couple? Should I ask new users if they want to subscribe to them or should I just subscribe them by default?

It needs more work and I did not want to delay all the other improvements. I’ll most likely be posting about this soon, it will be one of the main focus areas of 2019.8. 

You may have spotted that I just shipped 2019.7 but in previous posts I was referring to 2019.6. You would be right, I released a quick fix for the Import OPML feature. 

Until next week,

 

Marc

—-

 

 

 

Twitter -> @MarcMasVi  

 

 

 

Using DispatchSemaphore to control async execution

I’ve been debugging the upcoming OPML Import functionality of NewsWave and this bug was driving me nuts:  in some cases and for no apparent reason URLSessions would fail without a callback. 

At first the bug seemed random, but after a bit of testing I realized the more feeds I tried to import, the more likely the bug would materialize. 

After looking at error codes from Xcode, the issue seemed to be related to having too many URLSessions opened in parallel. What can I do to fix this? Well, DispatchSemaphore of course! 

Transit

DispatchSemaphore works by allowing certain execution cycles to go through and holding the rest until you signal its time to continue. Here’s an example of how it works, in this case I’m allowing up to 20 simultaneous queries:

 

 

let semaphoreOfImportQueries = DispatchSemaphore(value: 20) //Starting
with 20 credits.

for iteratorOfFeeds in feedImportQueries{

       //Wait reduces semaphoreOfImportQueries by
1, if it reaches 0 the execution will wait here

semaphoreOfImportQueries.wait() 

 

       self.functionThatCallsAnAPIAndExecutesAsync(completionHandler: { _ in

           //Signal allows the next process to start by adding 1 to semaphoreOfImportQueries

semaphoreOfImportQueries.signal() 

 
           

        })

}

This is a great tool to have in your toolbox when dealing with URL Sessions. Important though, this should always be executed on a background thread else you’ll block the main queue.

 

Marc

—-

 

 

 

Twitter -> @MarcMasVi     |     Micro.blog -> @MarcMV

NewsWave 2019.6 Progress – 4th of July Holiday

With July 4th landing on a Thursday my wife and I decided to take Friday off and go on a motorcycle trip to Santa Barbara. It’s a 4 hour drive from Palo Alto, 7 it you take the scenic route, and it’s totally worth it. The city is charming, the food is great and the beach is perfect for long walks. 

The key to shipping apps on the side is to always put in the hours, so I worked extra hard the previous weekend, during the week and when returning from the trip today (Sunday). Overall I’m quite happy with how the planning turned out. 

Enough rambling, where am I on the NewsWave 2019.6 key features? 

OPML Export works like a charm, it’s ready to ship. When you trigger it you’ll get a UIDocumentInteractionController asking what you’d like to do with the file: mail, save to file, open in another app… 

OPML Import functionality is there but there’s a couple of things that need fine tuning.

  • Progress indicator: in its current form you see a message saying it’s importing feeds but not how many have already been processed vs. total (specially relevant if you’re importing hundreds of feeds).
  • Incorrect states: in some rare cases one of the URLSessions fails without a callback, this leads to the UIAlertController “Importing Feeds…” never disappearing as the app believes a feed is still being processed.
  • Result logs: I’m conflicted about showing it or not, most apps don’t seem to do it. I’m erring on the side of showing how many have been imported successfully which is what most apps do.

On the “Performance Improvements & Bug Fixes” front, I’ve done several changes that result in reduced peak CPU consumption and tweaked the way saving happens to avoid multithreading racing conditions, now all saving is done in a specific synchronized queue. This will hopefully address a rare bug that could lead to old content mysteriously disappearing from a user device. 

The final key feature of 2019.6 is creating a “Default mix of feeds for new users”: I’m not sure if I should automatically subscribe new users to the default mix of feeds -ala NetNewsWire– or give users the option during the on-boarding process. If I show them the option during the on-boarding process a follow up question is, should I give them one “NewsWave” default mix, or a couple of mixes to choose from? Questions, questions… 

Until next week,

 

Marc

—-

 

 

Twitter -> @MarcMasVi     |     Micro.blog -> @MarcMV

NewsWave 2019.6 Plans

After a couple of releases focused on bug fixes and usability improvements I’m pumped to be working on the first feature update.

2019.6 will focus on adding two of the most requested features:
– OPML Import / Export.
– Default mix of feeds for new users.

In retrospect I should have absolutely shipped with OPML support from the start. At the time I believed most new subscribers would also be new to RSS… WRONG assumption!

I suspect OPML Import/Export to be a bit tricky to implement, still debating if I should develop a new server API or leverage the existing subscription one and call it multiple times… For now I’m more inclined to go with the latter approach as its less code to maintain.

As for the “default” mix of feeds for new users, I’ll be using some of the top subscribed feeds across several subjects. I expect this “default” mix to be used by newcomers to RSS so ideally the user should get around 30 posts a day, not too few, not too many.

Screen Shot 2019 06 28 at 18 08 18
Most Subscribed Feeds in NewsWave. Interesting fact, Daring Fireball has twice the number of subscribers than the second most subscribed feed btw.

In addition to the features above there will be several fine tuning changes as well, to mention a few:
-Optimized feed article management.
-Sync improvements when cascade deleting feeds.
-Improved “Today” behavior.

If all goes well I expect 2019.6* to ship at the end of July, will be sharing more on the import OPML process soon.

Until next week,

 

Marc

—-

 

Twitter -> @MarcMasVi     |     Micro.blog -> @MarcMV

*As Castro, Slopes and Overcast I’ve adopted a date-based version-numbering scheme — 2019.6 is the sixth update released in 2019.

Choosing the Right App to Develop

Over the course of my 8 years developing apps on the side I’ve shipped 5 apps.

Deciding what to work on and creating a new project in Xcode is about one of the best feelings in the development world. Everything seems possible, there’s so many ideas to test and none of the complexity is yet visible.

It becomes harder once you start to work on the complex pieces, when you start working on bug fixing, when you focus on polish… Even more when you work on it when you’re not at your best: after a 9 to 5 day of hard work, after your wife/girlfriend goes to bed, in between running errands on a weekend, etc.

IMG 6266

To me, the key to overcome the hardships that come with developing on the side is to have passion for what you are creating. Yes, you should think about the monetary angle up front, but if you’re not passionate about what you’re building, if you only think about the monetary angle, it will be very difficult to avoid saying “I’ll do it tomorrow” and go to bed, grab a drink, go for a walk…

Here’s an example of two of the apps I’ve developed for reference: the first one I ever build and the last one I recently shipped.

EXCELLING

Excelling is a reference guide for Excel Users. Yes, you read that right. How could I be motivated by a reference guide? Two reasons:
1. I worked as a Business Analyst at the time, Excel has a lot of functions but discoverability was awful. I really wanted an app like Excelling to exist.
2. It seemed a reasonably easy app to build as my first app.

IMG 1752

I will cover it in more length in another post, it is a niche app, but is still performing well today (800 downloads/month).

NEWSWAVE

NewsWave is a twitter style RSS reader. All articles appear in a chronological timeline and you can easily discover & follow feeds thanks to its growing directory.

IMG 3388

Why I’m passionate about it? The internet is a huge positive force if used correctly: vast amounts of knowledge, diversity of opinions… However, as companies monopolize content and optimize for clicks we are inadvertently reinforcing biases and creating an increasingly polarized society.

With this project I intent to:
1. Contribute to the open web by making RSS easier to use for the average user.
2. Making discoverability of great content easier (WIP).
3. Create a ML model geared toward providing other points of view for the news you read (WIP).

There’s a lot coming next which I’m extremely excited about, will be posting about it in upcoming posts.

When thinking about your next project on the side, you might want to work on something you care about. That’s what will make it easier to overcome the inevitable difficulties that appear on the path to shipping.

Marc

—-

Twitter -> @MarcMasVi     |     Micro.blog -> @MarcMV

//Brent Simmons recently re-released NetNewsWire, hands down one of the best Readers out there for the Mac. As an aside, he is also one of the inspirations behind NewsWave.

//David Smith summarized the stages of developing an app very well:
1) Curiosity
2) Excitement
3) Productivity
4) Dispair
5) Polish
6) Ship

An experiment….

After a recent conversation I’ve decided to try something new with this blog. An experiment…

For the next few weeks, every Sunday, I’ll be sharing the experiences of developing apps on the side: the challenges , the successes, the struggles…

I’ll also be sharing details on what I’m working on, why I’m doing it and how I’m doing it. You’ll see how feature updates affect app download numbers and be part of the rollercoaster of sensations that is App Development.

If you feel this may be fun for you, read on…

How to start? For this first post maybe an introduction is in order: my name is Marc, millennial born in Barcelona and since some time ago living in California. I have a regular job during the day and, evenings and weekends, I spend a significant part of my time thinking about or developing apps.

My latest one, and the one I’m focusing most of my time on, is NewsWave -a Twitter-like RSS reader-.

I always choose projects I’m passionate about and I believe RSS has a lot of unexplored potential. I’ll write more about NewsWave development and my experiences with past apps in upcoming posts.

Until next Sunday, 

Marc

NewsWave Released

During the last couple of months I’ve been working on a new take on the RSS Reader.

With so many options out there (NetNewsWire, Unread, Reeder….), why would I go and develop another one? 

The main reason is I wanted to create an RSS reader that would be extremely accessible to use for the average user. I had many ideas on how that could be approached, but in the end I settled on the following four principles:

-Easy subscription to feeds thanks to a growing searchable directory. 

-One unified chronological twitter style timeline for posts.

-Private tokens to identify users, effectively making all users anonymous. 

-A central server to allow syncing, reduce data consumption and backup all information.

 

Here’s the first conceptualization of what would become the new app, things have changed here and there but it’s incredible how many similarities the final app has with the original concept:

NewsWave first sketch

 

One of the decisions I struggled the most with was the business model, in the end -considering also the ongoing server costs- I settled with:

1. One time in app purchase that creates the user token and gives them 30 days to try the app with all features. This is not a subscription and therefore will not auto-renew. 

2. After 30 days they may decide to (ideally) subscribe for a $ 19.9 / year or use the app for free in “Basic Mode” -limiting daily fetches to 3 and disabling bookmark & position sync between devices-. 

As for the App Icon, I decided to go with an “in house” option and -depending on the app reception- hire a designer to improve it. 

140x140

 

Stacks image 59ea79d 942x942 2x

 

That’s the story of NewsWave, you can grab it from the app store and find its website here

How is the app doing? I’ll post shortly about that. 

Comments / questions? I’m at @MarcMasVi 

 

Marc

Create UIButton in code (swift)

Adding and customizing UIButtons in storyboard is extremely easy (and I would recommend doing it that way whenever possible), but what if you need to do it yourself in code?

The process takes only couple of lines of code, but it can escalate quickly if you add multiple buttons. To keep code clean I’ve created a quick function to create them quickly:

    func createNewUIButton(title: String, textSizeDelta: CGFloat?, backgroundColor: UIColor?, cornerRadius: Bool, cornerColor: UIColor?) -> UIButton{

 

        let button = UIButton(type: .system)

        button.translatesAutoresizingMaskIntoConstraints = false

        button.setTitle(”  \(title)  “, for: .normal)

        button.titleLabel!.font = UIFont.systemFont(ofSize: UIFont.systemFontSize + (textSizeDelta ?? 0))

        if backgroundColor != nil{

            button.backgroundColor = backgroundColor!

        }

        if cornerRadius == true{

            button.layer.masksToBounds = true

            button.layer.cornerRadius = 7.5

            button.layer.maskedCorners = [.layerMaxXMaxYCorner, .layerMinXMaxYCorner, .layerMaxXMinYCorner, .layerMinXMinYCorner]

            button.layer.borderWidth = 2

            button.layer.borderColor = cornerColor?.cgColor ?? UIColor.darkGray.cgColor

        }

       

        return button

 

    }

 

Once you get the button make sure you add constraints (if needed) and action and you’re good to go!

For reference, example of adding the action after you’ve instantiated the button:

button.addTarget(self, action: #selector(FUNCTION_GOES_HERE), for: .touchUpInside)

 

Questions / comments / suggestions? @MarcMasVi 

Marc