oleg_log
1.77K subscribers
1.86K photos
129 videos
9 files
2.77K links
Shelter for antisocial programmers "Oleg"

halp: @olegkovalov
web: https://olegk.dev
fov: @oleg_fov
chat: @oleg_log_blabla
podcast: @generictalks
Download Telegram
Только-что напоролся на красивый баг, мною же и написанный. Проверяется хедер, если нет - кидаем эксепшон. Все просто.
Добавляем тест, на пустой хедер (под капотом хелпер делает headers.add('Api-Key', null) ± норм смотрится).
Естественно все зеленое и красивое.
Смотрим coverage - проверка не была вызвана, надо было:
if (apiKey != null) headers.add('Api-Key', apiKey)
Поэтому юзайте дети кавередж.
(кстати некоторые тесты до меня были зафакаплены из-за этого же, хех)
Cloudflare:
Previously: 2x 12 core Intel Xeon Silver 4116 2.1Ghz 85W
Now: 2x 24 core Intel custom off-roadmap 1.9Ghz 150W

The performance of our infrastructure is heavily directed by how much compute we can squeeze in a given physical space and power. In essence, requests per second (RPS) per Watt is a critical metric that Qualcomm’s ARM64 46 core Falkor chip had a big advantage over Intel’s Skylake 4116.

Intel proposed to co-innovate with us an off-roadmap 24-core Xeon Gold CPU specifically made for our workload offering considerable value in Performance per Watt. For this generation, we continue using Intel as system solutions are widely available while we’re working on realizing ARM64’s benefits to production. We expect this CPU to perform with better RPS per Watt right off the bat; increasing the RPS by 200% from doubling the amount of cores, and increasing the power consumption by 174% from increasing the CPUs TDP from 85W to 150W each.

https://blog.cloudflare.com/a-tour-inside-cloudflares-g9-servers/
да, в итоге на 3к строк в файле, только 30 код, остальное коменты которые при этом тесты. Лучше не придумать. Не понимаю этого прикола, когда все в одном файле, это такая хитрая оптимизация дерева файловой системы? У элексира кстати тот же подход :(
Хах, опять цпу кеш + латенси рама удивляют.
На самом деле отличный наглядный пример, что такое ПОИНТЕР.
https://blogs.msdn.microsoft.com/oldnewthing/20181205-00/?p=100405
oleg_log
да, в итоге на 3к строк в файле, только 30 код, остальное коменты которые при этом тесты. Лучше не придумать. Не понимаю этого прикола, когда все в одном файле, это такая хитрая оптимизация дерева файловой системы? У элексира кстати тот же подход :(
С уважаемым @corpix (его жж @documentsjournal) перетерли эту тему и у меня появилось несколько коментов:
0. никто не говорит, что писать тесты и доку это плохо, конечно же они нужны, и вообще без них лучше ничего не делать.
1. когда код и тесты сливаются в одно, становится не так легко грепать код и тесты отдельно, приходится иметь АСТ либо какой-то контекст.
2. становится не так просто бегать по нему, код буквально растворяется в комментариях и тестах.
3. хранить все в одном файле, так же как и разносить каждый класс по новому файлу - оверкилл. обе крайности и не совсем адекватные. все должно быть по Таносу.
4. создавать больше одного файла, как и открывать 2 файла в || окнах давно не проблема, поэтому скидывать яйца в одну кучу - сомнительно.
Короч, код и тесты в разных файлах - ништяк.
Как и примеры использования кода.
внутренности net/http в гошечке 😢
ОМГ, оказывается гитхаб подтягивает все коммиты, которые может найти. Пояснение там в коментах
https://github.com/torvalds/linux/commit/b4061a10fc29010a610ff2b5b20160d7335e69bf
It's true, there's no individual competitive advantage for Microsoft to continue developing their own Edge browser. Moving to chrome is just good business, as they say. But as we've seen with SQLite, ubitquity is it's own risk. SQLite is everywhere because it's easy to use and does the job. Thank network effects for the rest. The problem is when SQLite has serious vulnerabilities—remote code execution—then the entire ecosystem is immediately at risk. Monocultures aren't robust, yet the winner take all nature of tech over time tends to produce monocultures. While Microsoft benefits from their decision, herd immunity would benefit from more diversity. Innoculate now. There are no bulkheads for ubiquity.
(c)
Крутой доклад у людей, которые угорели по кодогенерации. Чуток дисциплины на старте, и каждый микросервис становится таким же, как и другие. Прям гениально.
https://www.youtube.com/watch?v=j6ow-UemzBc
И так шоб каждый
о, 100 подписоты, ОКР 2018 закрыт. всем спасибо.
а еще десктопная телега научилась делать опросы из меню.
дабл вин
Йоу всем, кто знаком с настройкой сервера (в контексте сесурити, хотя не только), пинганите в лс, чтобы вы посоветовали сделать и не сделать. Все средства хороши.
(для особо ленивых -> @olegkovalov)
ОЛДЫ ТУТ?
ПРОСРАЛИ ВСЕ ПОЛИМЕРЫ
More and more iPhone owners blindly upgrade to iOS 12.1.2 reports are now flooding in from around the world that it cuts off mobile data services.
https://www.forbes.com/sites/gordonkelly/2018/12/22/apple-ios-12-1-2-problem-iphone-xs-max-xr-mobile-data-cellular-4g-cannot-load-internet/#35760b301985
Many (open source) hackers are proud if they achieve large amounts of code, because they believe the more lines of code they’ve written, the more progress they have made. The more progress they have made, the more skilled they are. This is simply a delusion.
Most hackers actually don’t care much about code quality. Thus, if they get something working which seems to solve a problem, they stick with it. If this kind of software development is applied to the same source code throughout its entire life-cycle, we’re left with large amounts of code, a totally screwed code structure, and a flawed system design. This is because of a lack of conceptual clarity and integrity in the development process.
Code complexity is the mother of bloated, hard to use, and totally inconsistent software. With complex code, problems are solved in suboptimal ways, valuable resources are endlessly tied up, performance slows to a halt, and vulnerabilities become a commonplace. The only solution is to scrap the entire project and rewrite it from scratch.
The bad news: quality rewrites rarely happen, because hackers are proud of large amounts of code. They think they understand the complexity in the code, thus there’s no need to rewrite it. They think of themselves as masterminds, understanding what others can never hope to grasp. To these types, complex software is the ideal.
Ingenious ideas are simple. Ingenious software is simple. Simplicity is the heart of the Unix philosophy. The more code lines you have removed, the more progress you have made. As the number of lines of code in your software shrinks, the more skilled you have become and the less your software sucks.
Оказывается в баш есть аналог defer. И это черт возьми круто.
#!/bin/bash
function finish {
# Your cleanup code here
}
trap finish EXIT