TW: нудный гик-стафф про бытовую технику.
Кофемашина в какой-то момент не включила индикатор переполненности контейнера для жмыха. Это странно, поэтому я стал разбираться. Вообще, техника редко глючит непонятным образом и ведет себя хаотично. Всегда есть какая-то причина. При отладке программы это тоже надо всегда помнить.
Как машина узнаёт, что контейнер полон? Никак. У контейнера есть герконовый датчик, показывающий факт его установки в корпус. Когда ты его вытаскиваешь, машина думает, что ты его очистил. А дальше программа просто знает, что одинарный кофе наполняет контейнер на X, двойной на 2X, а вместимость nX.
Что произошло: я открыл контейнер посмотреть, заполнен ли он целиком. А потом закрыл обратно, не очистив. В оценке уровня жмыха появилась аддитивная погрешность.
Если позволить человеку ввести систему в неправильное состояние, он рано или поздно это сделает. Кстати, по той же причине мне нравится DDD как архитектура для энтерпрайз разработки: если всё правильно спроектировать, то программист слоя приложения, который является "пользователем" домена, не сможет сломать состояние сущностей и агрегатов.
В общем, в машине не хватило защиты от дурака. Как бы я решал эту задачу? Сходу приходит в голову какой-нибудь оптический датчик в верхней части контейнера. В худшем случае он запачкается и сработает ложно-положительно, что вызовет необходимость для пользователя лишний раз почистить контейнер.
Но ТРИЗ намекает нам на другой подход. Можно попробовать полностью исключить появление жмыха. Так устроены, например, капсульные машины. У нас такая была, но перешли на зерновую, потому что вкусный качественный кофе в зёрнах на порядки дешевле, чем в капсулах, а пьем мы его много. Особенно кофе с молоком, для которого в капсулах просто концентрат, а не настоящее молоко.
Если исключить жмых нельзя, то нужно сделать его удаление неотъемлемой частью процесса обслуживания машины. Думаю, я бы попробовал объединить конструктивно контейнер для зёрен и для жмыха, и рассчитать объёмы так, чтобы второго хватило на один цикл траты первого. Тогда даже датчики не нужны: кончились зёрна, и ты неизбежно достаешь контейнер и очищаешь.
Сфоткал для вас чашечку ароматного капучино.
#life
#rule
Juniorlar - Sizni, yangi ishga kirgan kompaniyangizga, foydangizdan ko'ra zararingiz ko'p bo'lishi mumkin, shuning uchun, "meni eshshakdek ishlatib arzimagan summa beryapti", "ketaman bu ishxonadan" deb siqilavermang.
Sizni yozgan kodlaringizni baribir kimdir, soatini narxi qimmat bo'lgan tajribali birortasi vaqtini ketqazib, tekshirib chiqadi.
Mobodo tekshirmasdan nimadir xato narsa loyihaga o'tib ketsa, zararingiz 10x, 100x, 1000x bo'lishi mumkin. 1-2 ta tanish, o'rtoq juniorlar salgina yaxshiroq oylikli ishga kirdi degani, sizam shunaqasiga kirishingiz kerak, boshqasiga dam degani emas. Yana o'ziz bilasiz, Hojiboy aytadiyu: "Qorbobo" deb
Ha aytgancha, hoy middle, seniorlar, siz junior paytingiz, ishxonangizni qanchaga "kirgizib" yuborgansiz? ))
⌨️⌨️⌨️⌨️⌨️
The appointment of Mojtaba Khamenei was welcomed by Yemen’s Houthi rebels, who are backed by the Iranian regime.
“We congratulate the Islamic Republic of Iran, its leadership and people, on the selection of Sayyid Mojtaba Khamenei as Supreme Leader of the Islamic Revolution at this important and pivotal juncture,” the group said in a statement on Telegram.
Mojtaba Khamenei’s elevation marks the first time since the 1979 Islamic revolution that Iran’s supreme leadership has passed from father to son.
It is a development likely to ignite debate inside Iran about the emergence of a dynastic system in a state founded explicitly to overthrow hereditary rule after the shah.
Ayatollah Ali Khamenei, who ruled for 37 years, was killed in a US-Israeli strike on Tehran on 28 February, on the first day of the war with Iran.
Across Iran’s political and security establishment, officials moved swiftly to welcome the appointment of Mojtaba Khamenei as the country’s new supreme leader.
The Revolutionary Guards declared they stood ready to follow him, signalling broad backing from the country’s core institutions.
Earlier in the day, in a post on X in Farsi, the Israeli military said it would continue pursuing every successor of Ali Khamenei and would pursue every person who sought to appoint a successor for him.
For many analysts, Khamenei’s appointment is a symbolic move designed to make the regime still appear strong and determined not to bow to western pressure.
The 56-year-old cleric has never held elected office nor formally occupied a senior position within Iran’s government. He has spent much of his life at the centre of power in Iran while remaining largely out of public view.
To his supporters, Khamenei represents continuity with the ideological line established by Ayatollah Ruhollah Khomeini and maintained by his father. To critics, his rise raises uncomfortable questions about the concentration of power – and the possibility of hereditary leadership in a state founded in revolt against monarchy.
Oil prices surged more than 25% on Monday to their highest levels since mid-2022, as major Middle Eastern oil producers cut supply because they cannot safely send shipments through the strait of Hormuz to refiners worldwide.
Traffic through the strait was largely closed after Iran attacked at least five ships, with a limited number of tankers transiting, choking off a key artery accounting for about 20% of global oil and LNG supply.
#khamenei#mojtaba#son#iran#leader#rule
📱American Оbserver - Stay up to date on all important events
🇺🇸
Ali Khamenei’s Second Son Took His Place
Who is He?
⌨️⌨️⌨️⌨️⌨️
Mojtaba Khamenei, the second son of the late Iranian supreme leader Ayatollah Ali Khamenei, has been chosen as his successor, as the war enters its 10th day and fresh missile and drone strikes reverberate across the Middle East.
After members of the clerical body responsible for selecting Iran’s highest authority announced the decision on Sunday, Iranian institutions and politicians, from the foreign ministry to lawmakers, issued statements expressing their allegiance.
“We will obey the commander-in-chief until the last drop of our blood,” a statement from the defence council said.
The move could lead to a further escalation of the war, given Donald Trump had already acknowledged that Mojtaba Khamenei was the most likely successor and made clear he considered him an “unacceptable” choice.
The US president said earlier on Sunday that Iran’s next supreme leader was “not going to last long” if Tehran did not get his approval first.
When asked about the appointment during an interview with the Times of Israel published late on Sunday, Trump was reported as saying: “We’ll see what happens.”
In the same interview, Trump said a decision on when to end the war would be a “mutual” one, together with Netanyahu.
Trump also asserted that Iran would have destroyed Israel if he and Netanyahu had not been around. “Iran was going to destroy Israel and everything else around it (…) We’ve worked together. We’ve destroyed a country that wanted to destroy Israel,” he was quoted as saying.
The Israeli military said it had launched a wave of strikes on Monday targeting “regime infrastructure” in central Iran, the first such announcement since the appointment of the new supreme leader.
The military also announced strikes on the Iran-backed militant group Hezbollah in Lebanon.
Iran and its proxies appeared to have launched attacks, too, with rocket and drone strikes targeting a US diplomatic facility near Baghdad’s international airport that were intercepted by the C-RAM defence system, said police sources.
A drone strike targeted a US military base near Erbil airport in Iraqi Kurdistan, security sources said, while Saudi authorities reported intercepting a drone east of its northern al-Jawf region.
In Bahrain, the health ministry reported 32 people were wounded overnight by an Iranian drone attack on the island of Sitra.
They include a 17-year-old girl who suffered severe head and eye injuries, and a two-month-old baby, according to the ministry.
Iranian state media also showed a projectile said to have been launched at Israel bearing the slogan: “At your command, Sayyid Mojtaba,” using an Islamic honorific.
#khamenei#mojtaba#son#iran#leader#rule
📱American Оbserver - Stay up to date on all important events
🇺🇸