I took a month-long sabbatical last Fall to learn a new skill (machine learning). I had a project goal to keep me focused on making progress and staying practical: making an ios app that will use ML to "recognize" the letters on a Boggle game grid and "solve" it, printing out all the words on that grid. I made large strides during the month but the project wasn't quite working at the end. After the sabbatical it was back to work at my dayjob and I had a lot of motivation but little time, so I kept telling myself, "No time to work on it today, but I'll try tomorrow."
After a few weeks thinking this and not doing any work, I despaired that my project would end up as vaporware, blowing away in the smoke of my good intentions. So I started a new habit: Committing to work on it, every day, for just 15 minutes.
I use a pomodoro timer (Vitamin-R) and note-taking app (EverNote) to do my daily 15 minutes. Each time I start, I write down my goal for that session, and keep a running list of things I think of to do but don't get to in that particular session. Every day I successfully put in 15 minutes I mark off that day on a 365-day hanging wall calendar that is on the back of my apartment door.
Results:
* I have worked on the app for 90% of the days this year.
* I absolutely got it to a "working" state (I am now facing a diminishing returns problem where I'm putting in too much time fiddling with UX and UI polish, but that's a problem I'm happy to have).
* On over 50% of the days I end up working more than 15 minutes.
* On days when I feel like going longer, and have the time, I'll still occasionally hard-stop at 15 minutes. This gives me something I'm eager to come back to tomorrow, and also (I think) helps to engrain the habit. I want my subconscious to always think: yes, the cost of starting my session today really is only 15 minutes, I will do this even if I don't feel like I have a lot of willpower today.
Not exactly brain fog but I often find myself in extreme left-brained mode after a challenging day of coding. If I meet friends after work I am a horrible conversationalist for up to an hour while my brain slowly (and reluctantly) stops actively churning on coding problems.
Related to the right-to-left thinking mode changes, sometimes the words that I am using at become eerily meaningless or unfamiliar. I've spent a few moments asking myself "is that really the way 'else' is spelled?". I recently learned this phenomenon is called semantic satiation [1].
I worked at a company that hired a developer who was slightly consumed by his regret at being an early employee and then getting out of Groupon pre-IPO. We'd be at a bar and the conversation would die down and he'd look sort of glum and say, "I should be on a yacht right now...". I felt bad for him.
The past year or so has really seen a resurgence of browser-based text editors. Off the top of my head I can think of 4 editors/editor-frameworks launched in the past year (Mobiledoc-Kit, ProseMirror, Trix, and now Draft.js). Browsers are creeping toward exposing all the events that are necessary for interpreting the meaning of a user as they input text. (Some notable exceptions remain, such as an event that would be fired when a spelling correction is accepted, but mutation observers provide a fallback for cases where it's not otherwise possible to catch the input on the way in.)
A major focus of Mobiledoc-Kit, which seems to have some overlap with Draft.js, is on exposing an API that allows programmers to programmatically interact with the internal (structured) document. Our goal is to allow developers to be able to construct editors that fit snugly fit their use case, whether that's building their own UI for a toolbar, or more complex procedural rules for document (e.g., add a constraint that there can only be one "H1" section in a document and disallow adding a second one).
Since Mobiledoc-Kit was built for a publisher originally (Bustle), the ability to intersperse text with richer content was a goal from the start. So it has a "card" concept that allows adding any rich content (embedded tweets, videos, slidehows, etc.). In fact, the Mobiledoc-Kit demo page [1] has a demo where a Codemirror editor is embedded inside the Mobiledoc editor.
It's great to see so much new energy in the browser editor world. I am hopeful that as browser features and new editors and editor features converge, we'll see some exciting new developments that broaden the perspective on what sort of content is possible to author from within a web page.
I read Daniel Stenberg's (he is a maintainer of curl, I think?) "http2 explained" pdf the other day, and it's by far the best comprehensive explanation of http2 that I have seen. Well worth a read if you're curious what's coming with http2. http://daniel.haxx.se/http2/
The thing that made this click for me was realizing the "1" in the regex was not special. The regex is just looping through integers (starting with 2) and checking if the target number is divisible by any of them. It can use any digit if the target string uses the same digit. Ruby example using 5 instead of 1:
def is_prime(n); str = "5"*n; str !~ /^5?$|^(55+?)\1+$/; end
The regex essentially says, for integer n, "does 2 ones fit evenly into n ones", then "does 3 ones fit into n ones", etc., which is the same as "does 2 fit into n", "does 3 fit into n", etc.