fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.8K
active users

#attribute

1 post1 participant0 posts today

Разрабатываем собственный анализатор C++ программы в виде плагина для Clang

Есть много проектов, целью которых является превратить С++ более "безопасный" язык программирования. Но внесение изменений в синтаксис языка обычно нарушает обратную совместимость со старым кодом, который был написан до этого. Недавно вышла новая версия библиотеки memsafe для языка С++, которая превращает его в Rust с помощью плагина Clang добавляет в С++ безопасное управление динамической памятью и контроль инвалидации ссылочных типов данных во время компиляции приложения. Но данная статья не о библиотеке, а об особенностях разработки анализатора программы на С++ в виде плагина для Clang. Можно считать, что это подведение итогов по результатам сравнения нескольких разных способов создания плагина для компилятора С++ , а так же очередной Хабрахак для хранения результатов экспериментов и публикации итоговых выводов, которые я решил сохранить не только для себя, но и в виде статьи на Хабре, что бы результатами моего труда могли воспользоваться и другие хорошие люди :-), которым так же может потребоваться погрузиться в дебри парсинга исходного текста программ.

habr.com/ru/articles/900224/

#clang #clangquery #plugin #memsafe #c++ #attribute

ХабрРазрабатываем собственный анализатор C++ программы в виде плагина для ClangЕсть много проектов, целью которых является превратить С++ более "безопасный" язык программирования. Но внесение изменений в синтаксис языка обычно нарушает обратную совместимость со старым...

"As they say: If in doubt, hide in a cloud." Haribord whispered the ancient proverb and poured some water from his flask onto his open hand. Within seconds, the water started to bubble and fog began to fall to the floor, much more than it had any right to.

The giant cavern filled with unnaturally thick fog in minutes, diffusing the red light from the ember crystals, which grew on the rough ceiling, into a hellish glow. Alarmed voices could be heard echoing on the stone walls.

"Who the fyock says that?" Stora rumbled and risked another peek over the boulder they were hiding behind. "Can we go now?"

"The scholars #attribute the proverb to the witch Haliga and although most people think it means to know when to hide and retreat, it's not actually that."

Haribord had closed his eyes. His face twitched from concentration, which gave him a demonic visage in the red gloom.

"You see, Haliga's cloud is not just a cloud. It is grown from you and thus part of you." Sweat ran down his brow. "You feel all that it touches. It will follow you and go anywhere you want." The fog started to flow and pool in different corners of the cavern. The cries of surprise and fear quickly turned into screams, then gurgles, then silence.

#webdev #wordpress #nofollow #html #http #anchor #attribute #WCAG #webbrowser #extension

While I don't care enough to cite the extension which produces this effect, let me explain.
Oh you've already guessed. The strangely outlined-in-dash elements, shown here, are those which the aforementioned extension (and likely so many duplicate utilities) identified as "No Follow" links.

Can you remind me why that's important to know?
Well. Not really. But, because someone wants to study the data or whatever...
you know what i mean.

I just for the first time wrote a Rust #[derive()] statement without having to go look up the #attribute syntax. I am proud of myself. This is only hard because I have to remember which one is the Rust attribute syntax and which one is the C++ attribute syntax and when I need an exclamation mark. Honestly, the Go equivalent of attributes starts to seem a little appealing just because it doesn't look enough like any other language to get me confused

style.setProperty vs setStyle

На днях столкнулся с интересным вопросом. Что быстрее element.style.setProperty(свойство, значение) или element.setAttribute('style', 'свойство: значение') ? На первый взгляд ответ кажется очевидным. Логика говорит нам, что setProperty должен устанавливать значение сразу в CSSOM, тогда как setAttribute выставляет сначала атрибут style и уже потом значение атрибута будет разобрано в CSSOM. Таким образом, setProperty должен быть быстрее. Но действительно ли всё так однозначно? Давайте разбираться. Начнем с того, что немного освежим мат. часть. Мы знаем, что стили описываются с помощью языка CSS. Получив строковое описание стилей на языке CSS, браузер разбирает его и составляет объект CSSOM. Интерфейс этого объекта представлен спецификацией w3.org/TR/cssom-1 . Он следует принципам каскадности и наследования, изложенным в w3.org/TR/css-cascade-4 . Из выше указанных спецификаций мы знаем, что основной единицей CSS является "свойство". Свойству присваивается значение, характерное конкретно этому свойству. Если значение не задано явным образом, оно наследуется от выше стоящего стиля или, если нет вышестоящего, будет установлено initial value . Набор свойств для элемента собирается в правила CSSRule . Правила бывают разных типов. Наиболее популярный тип - CSSStyleRule , определяющий свойства элемента. Такое правило начинается с указания одного из валидных селекторов и последующих фигурных скобок с набором свойств и значений <selector>: { ... } Имеются и другие типы правил, например CSSFontFaceRule, описывающий параметры подключаемого шрифта @font-face { ... } , CSSMediaRule - @media { ... } и др. Полный список в спецификации w3.org/TR/cssom-1/#css-rules .

habr.com/ru/articles/859510/

www.w3.orgCSS Object Model (CSSOM)

Just found this article stating that using the #language #attribute for individual words within a text is not a good idea when you want #ScreenReader users to have a good #UX. It's just overengineered #a11y.

I'm a bit surprised as you always read otherwise (as the article also mentions).

Are some screen reader users here that can share their experiences? I'm really curious now 🤔

netz-barrierefrei.de/en/lang-a

www.netz-barrierefrei.deHow the Language Attribute is demaging Accessibility - Accessibility Consulting - Training & SupportThe language attribute seems to make sense for accessibility, but only for sighted people.
Continued thread

I’m pretty sure no browser would drop support for this given the widespread usage but, just in case, if anyone here is involved in the spec discussions and can propose to reverse this decision it would be helpful to the Small Web in the future.

Python — Дескрипторы(Descriptors)

Если обратиться к документации, то дескриптор — механизм, который позволяет объектам настраивать поиск , хранение и удаление атрибутов. Дескрипторы используются в классах, выступая в роли атрибутов класса(не экземпляра). Думаю, мало кто, хотя бы раз, сам писал дескрипторы в коммерческой разработке, но я уверен, что большинство программистов используют механизмы, которые являются дескрипторами, или используют их "под капотом":

habr.com/ru/articles/811777/

ХабрPython — Дескрипторы(Descriptors)Если обратиться к документации, то дескриптор — механизм, который позволяет объектам настраивать поиск , хранение и удаление атрибутов. Дескрипторы используются в классах, выступая в роли атрибутов...

Keeping everything public might be considered an anti-pattern. On the other hand, if we use more restrictive access modifier, we might encounter situations where something that we would like to access would not be possible. The InternalsVisibleTo attribute might come in handy in such situations.

Using this attribute, we can specify that the assembly mentioned in the attribute, will be able to access internal types specified in the one where the attribute is used. This means types that are marked with internal access modifier, internal protected, or private protected ones will be accessible. We could use this to allow access to some internal types for a test project. See the example code 👇.

Docs 📑: learn.microsoft.com/en-us/dotn

Did you know about this attribute? Did you use this one?

#dotnet #internalsvisibleto #attribute
---
If you find this useful, consider giving a like & share ♻