Kirill Titov Blog https://kirilltitov.com/en Personal blog of Kirill Titov. en Copyright 1989-2k17 Kirill Titov 2021-04-22T12:13:02+00:00 kirill@kirilltitov.com 60 Slow Safari tabs on MacBooks with Touch Bar https://kirilltitov.com/en/blog/2020/macbook-touch-bar-safari-slow-tabs <p>I have a work laptop by Apple Computer, a 2017-ish MBP with a loathsome Touch Bar. Since day one I noticed very slow new and closed Safari tabs. And it got only worse with time ten to fifteen seconds of non-responding browser. Funny enough, it was only if I had and active input on a page. Otherwise everything is fine (not).</p> <p>Earlier this year I <strike>overclocked</strike> upgraded my personal macbook to 16 inches 32 gigabytes Core i9. Expectedly enough I expected that Safari will be fast again with this ridiculous config, but in reality it was opposite of nice.</p> <p>Only recently I compared facts (old macbook didn't have this kind of problem, and generally non-touchbar macbook don't have it), and finally found the root of the problem: you have to remove tabs previews from Touch Bar. When there are too many of them, any change of this list becomes too heavy for the Touch Bar, and it slows down the whole browser. In the end, I didn't really need those previews, I always have 30+ tabs and they become small lines. No use.</p> <blockquote><b>Solution</b>: go to menu item "View" — "Customise Touch Bar", and remove the default set of widgets (backwards-forwards arrows, which are simply not needed when you have awesome touchpad, and actually tabs list). The moment you remove it, all tabs will be sanic.exe fast.</blockquote> <p>You can thank me for this advice by buying my album on <a href="https://kirilltitov.bandcamp.com">Bandcamp</a>.</p> 2020-07-31T10:26:02+00:00 https://kirilltitov.com/en/blog/2020/macbook-touch-bar-safari-slow-tabs How I Learned to Stop Worrying and Love the EventLoopFuture https://kirilltitov.com/en/blog/2019/futures <p>Low-level framework SwiftNIO developed by Apple corporation is a foundation for all major server-side Swift frameworks — Vapor, Kitura, Smoke.</p> <p>However, none of these instruments comprehensively clarify main concepts and principles of usage of the most important part of NIO&nbsp;— <code>EventLoopPromise</code> and <code>EventLoopFuture</code>, which leads to fundamental misunderstanding and confusion, and therefore questions like “How to get value from Future?” are asked in all kinds of forums and chats.</p> <p>This is what we're gonna talk about today in this small tutorial.</p> 2020-01-16T18:29:10+00:00 https://kirilltitov.com/en/blog/2019/futures Textures and patterns of Altos de Chavón https://kirilltitov.com/en/blog/2019/textures-and-patterns-of-altos-de-chavon <p>On our way to Saona island we also visited pseudo-old city of Altos de Chavón. Point is this city was built from 1976 to 1992, but looks as if Columbus personally laid the city. Mixed impression, honestly. The city doesn't have a general idea. However, this lack of uniformity opens an unexpected advantage: a huge ton of beautiful textures and patterns underfoot and around.</p> <a class='img' href='//static2-do-ams3-04.kirilltitov.com/img/blog/2019/dominicana/orig/ET8A1233.jpg'><img src='//static8-do-ams3-04.kirilltitov.com/img/blog/2019/dominicana/1280/ET8A1233.jpg' /></a> https://kirilltitov.com/en/blog/2019/textures-and-patterns-of-altos-de-chavon Short stories from Dominican Republic https://kirilltitov.com/en/blog/2019/short-stories-republica-dominicana <p>I haven't had a proper vacation since 2015 (if not counting those I spent on university exams and St. Petersburg ethnographic trips), that last time was in Bulgaria, in Sunny Beach which lies between Burgas and Varna. That city was a slightly more european than Yevpatoria and Gursuf that I'd been many times before. That's why that city didn't enrich my cultural and ethnographic baggage.</p> <p>All subsequent vacations, as I mentioned before, I spent in St. Petersburg, and quite naturally it resulted in my relocation to this city.</p> <p>Nevertheless, one should have a proper rest, because burnout isn't a myth and always sneaks up unnoticed. Thus strategic decision was made: next vacation should be at sea. My cherished dream was Dominican Republic — don't know why, pretty photographs maybe like in that old Bounty ad.</p> <a class='img' href='//static2-do-ams3-04.kirilltitov.com/img/blog/2019/dominicana/orig/ET8A1158.jpg'><img src='//static8-do-ams3-04.kirilltitov.com/img/blog/2019/dominicana/1280/ET8A1158.jpg' /></a> <p>And this is exactly what happened. I found a good adults only-hotel (didn't mean really, but cool) with nice and not very crowded beach. It turned out to be Punta Cana city (Bavaro area). During this vacation I found a new passion — papaya and basically spent the entire vacation quite hedonistically and just a little bit snobbish.</p> 2019-08-02T10:18:58+00:00 https://kirilltitov.com/en/blog/2019/short-stories-republica-dominicana Hospitality in St. Petersburg https://kirilltitov.com/en/blog/2019/hospitality <p>Hospitality crew finally came back to Saint Petersburg after a long break. Whiney, London Elektricity, MC Dynamite and other folks set the heat on <i>four</i> stages.</p> <a class='img' href='//static2-do-ams3-04.kirilltitov.com/img/blog/2019/hospitality_spb/orig/ET8A1051.jpg'><img src='//static8-do-ams3-04.kirilltitov.com/img/blog/2019/hospitality_spb/1280/ET8A1051.jpg' /></a> <a class='img' href='//static7-do-ams3-04.kirilltitov.com/img/blog/2019/hospitality_spb/orig/ET8A1039.jpg'><img src='//static8-do-ams3-04.kirilltitov.com/img/blog/2019/hospitality_spb/1280/ET8A1039.jpg' /></a> <sub>+61 photographs without commentaries. Tools 70-200 mm, 35 mm.</sub> 2019-07-17T15:08:17+00:00 https://kirilltitov.com/en/blog/2019/hospitality Red Snapper @ Erarta Museum https://kirilltitov.com/en/blog/2018/red-snapper-erarta <p>Red perches showed everything to everyone once again.</p> <a class="img" href="https://static6-do-ams3-04.kirilltitov.com/img/flickr/41634865895_2a46dc7ce6_o.jpg" data-orig-img="farm2.staticflickr.com/1757/41634865895_2a46dc7ce6_o.jpg"><img src="https://static6-do-ams3-04.kirilltitov.com/img/flickr/41634865895_921c075d71_h.jpg" data-orig-img="farm2.staticflickr.com/1757/41634865895_921c075d71_h.jpg" /></a> <p><sub>+88 photographs without commentaries.</sub></p> 2018-06-03T19:33:05+00:00 https://kirilltitov.com/en/blog/2018/red-snapper-erarta Red Snapper @ Erarta in Saint-Petersburg announce https://kirilltitov.com/en/blog/2018/red-snapper-erarta-saint-petersburg-announce <p>So apparently I'm gonna be officially shooting photographs of Red Snapper concert this Saturday at Erarta Museum. Concert report will be up on Sunday.</p> <p>As they say — please stand by.</p> <p>Upd: <a href="https://kirilltitov.com/en/blog/2018/red-snapper-erarta">done</a>.</p> 2018-06-03T19:50:34+00:00 https://kirilltitov.com/en/blog/2018/red-snapper-erarta-saint-petersburg-announce Hospitality Ukraine 2017 https://kirilltitov.com/en/blog/2018/hospitality <p>Makoto, Spectrasoul, London Elektricity, Metrik and Dynamite MC including our own stars like Tapolsky, Sunchase and Vera Sue. It's illegal to miss that.</p> <a class="img" href="https://static1-do-ams3-04.kirilltitov.com/img/flickr/24181950818_b6faf480d9_o.jpg" data-orig-img="farm5.staticflickr.com/4483/24181950818_b6faf480d9_o.jpg"><img src="https://static7-do-ams3-04.kirilltitov.com/img/flickr/24181950818_cb41b39ae6_h.jpg" data-orig-img="farm5.staticflickr.com/4483/24181950818_cb41b39ae6_h.jpg" /></a> <p><sub>+160 photographs without comments.</sub></p> 2018-05-29T16:49:18+00:00 https://kirilltitov.com/en/blog/2018/hospitality House https://kirilltitov.com/en/blog/2017/building <a class="img" href="https://static5-do-ams3-04.kirilltitov.com/img/flickr/23696215688_58d55cc77f_o.jpg" data-orig-img="farm5.staticflickr.com/4459/23696215688_58d55cc77f_o.jpg"><img src="https://static7-do-ams3-04.kirilltitov.com/img/flickr/23696215688_f89a936b34_h.jpg" data-orig-img="farm5.staticflickr.com/4459/23696215688_f89a936b34_h.jpg" /></a> https://kirilltitov.com/en/blog/2017/building Why DispatchSource.makeTimerSource not working? https://kirilltitov.com/en/blog/2017/why-dispatchsourcetimer-not-working <p>Say you did the following</p> <p><iframe src="https://pastebin.com/embed_iframe/Cd2be2Fb/noheader" style="border:none;width:100%"></iframe></p> <p>and proceeded to your business, but the timer fired once or even not a single time. Why? It's because your <code>timer</code> object has been eaten by garbage collector, and when <code>DispatchSourceTimer</code> is deinited, it (obviously) stops itself. It's worth reminding that GC is triggered when scope closes, in our case — after <code>async</code> block fired. Therefore, if you want to regularly run certain task, you should store reference to timer object in a global storage, which would live as long as you want, but not the GC. It's also recommended to wrap access to this storage with synchronous serial queue to avoid shameful race conditions.</p> <p>By the way, there might be an opposite situation: timer wouldn't destroy when you destroy all references to it. The reason is timer handler might have a strong reference to some object or <code>self</code>. In order to ensure it wouldn't happen, explicitly specify <code>[weak self]</code> in timer handler header.</p> 2021-04-22T12:13:02+00:00 https://kirilltitov.com/en/blog/2017/why-dispatchsourcetimer-not-working