Pull to refresh
75
0
Zaur Nasibov @BasicWolf

Software Engineer

Send message
UFO landed and left these words here
UFO landed and left these words here

А если еще посчитать и макось... Да, это не совсем линукс, точней совсем не линукс, но какие-то "стандартные компоненты" там точно используются. Например bash.
Также можно посчитать и iOS. Его же запускают на планшетах. А многие планшеты мака имеют диагональ экрана больше чем у ноутбуков, приличную производительность "пристегиваемые" мыши, тачпады и клавиатуры. Тогда сразу станет видно - винда на десктопах уже умирает и надо подождать еще лет 30-50 чтобы умерла окончательно.

"Но ведь это работает только если у всех абсолютно одинаковые ценности и цели в жизни. "
Для решения этого кажущегося противоречия есть категорический императив Канта в двух формулировках:
1. «поступай так, чтобы максима твоей воли могла бы быть всеобщим законом»
2. «поступай так, чтобы ты всегда относился к человечеству и в своём лице, и в лице всякого другого как к цели, и никогда — только как к средству»

Заказ можно создать независимо от того, анемичная у вас модель или нет. Создание заказа это бизнес-действие.
Бумажный документ сам себя не заполняет и не проверяет правильность своего заполнения.

Интересное замечание. Но ведь "создание заказа" - это совершенно разные операции в зависимости от контекста. Рассмотрим модель, в которой "созданый заказ" означает, что клиент заказал товар, но пока его не оплатил. Если клиент захочет изменить заказ - добавить товар, неужто вы напишите что-то вроде

client.add_item_to_order(order, item)

Или, всё-таки

order.add_item(item)

А почему вы считаете, что "поведение" это именно методы внутри сущности?

Потому что за поведением гораздо проще наблюдать и управлять, когда оно описано рядом с данными, от которых и которые от него зависят. Если же оно раскидано по коду, то будет гораздо сложнее понять поведение модели в целом, да и от инкапсуляции данных не останется и следа:

class Client:
    def add_item_to_order(self, order, item):
        order.items.append(item)  # ой, а с чего это вдруг Client знает о внутренностях Order?

Вы говорите о типизации - я согласен! Но ведь типизация может быть утиной. Она может быть описана в интерфейсе. Мой же комментарий, в первую очередь - об избыточности Гексагональной архитектуры и DDD в приложении типа "Что получил в POST , то и записал в базу данных, что лежит в базе данных, то и вернул в GET".

У нас есть бизнес-требование "После создания заказа отправить письмо на электронную почту пользователя". Как вы будете отправлять его из сущности, как будете пробрасывать зависимости, которые это делают?

События домена. Что-то вроде:

order, domain_events = shopping_cart.create_order()
event_dispatcher.dispatch(domain_events)

Здесь, domain_events будет содержать одно (или более!) событий:

[OrderCreatedEvent(id, client_id, items), ...]

ухудшает обзор, естественно

В эпоху, когда вполне приличная видет камера имеет размер крышечки от зубной пасты и стоит пять копеек пучок, про "ухудшение обзора" можно уже не задумываться.

А какя разница? У крупных компний обязательно будет юридическое лицо -представитель в вашей стране. Желательно подавать в той юрисдикции где находитесь вы, но при этом и ответчик должен обязательно иметь юрлицо у вас. В случае с гуглом нет проблем, у них есть юрлица почти во всех странах. В частности нет проблем что бы подать на гугл в суд в России. У них тут есть юрлицо, оно принимает платежи за рекламу. Если они "не почешутся" то кончится тем что приставы снимут в вашу пользу куча бабла с их счетов- это вполне реальное развитие событий.

У вас соль в том, что парсер и токенайзер жестко связаны друг с другом. EOF должен возвращаться токенайзером. Парсер же читает и обрабатывает поток токенов. Но даже если их по какой-либо причине нельзя разоединить, тут есть над чем поработать, например:

def parse(iterator):
    data = (
        combine(*matches)
        for matches in read_triplets(iterator)
    )
    yield from process(data)

def read_triplets(iterator):
    while all((        
        (match_1 := grok1.match(next(iterator, EOF))) != EOF,
        (match_2 := grok2.match(next(iterator, EOF))) != EOF,
        (match_3 := grok3.match(next(iterator, EOF))) != EOF,
    )):
        yield (match_1, match_2, match_3)

Gerard Nolst Trenité — The Chaos (1922)


Dearest creature in creation
Studying English pronunciation,
I will teach you in my verse
Sounds like corpse, corps, horse and worse.


I will keep you, Susy, busy,
Make your head with heat grow dizzy;
Tear in eye, your dress you'll tear;
Queer, fair seer, hear my prayer.


Pray, console your loving poet,
Make my coat look new, dear, sew it!
Just compare heart, hear and heard,
Dies and diet, lord and word.


Sword and sward, retain and Britain
(Mind the latter how it's written).
Made has not the sound of bade,
Say-said, pay-paid, laid but plaid.


Now I surely will not plague you
With such words as vague and ague,
But be careful how you speak,
Say: gush, bush, steak, streak, break, bleak ,


Previous, precious, fuchsia, via
Recipe, pipe, studding-sail, choir;
Woven, oven, how and low,
Script, receipt, shoe, poem, toe.


Say, expecting fraud and trickery:
Daughter, laughter and Terpsichore,
Branch, ranch, measles, topsails, aisles,
Missiles, similes, reviles.


Wholly, holly, signal, signing,
Same, examining, but mining,
Scholar, vicar, and cigar,
Solar, mica, war and far.


From "desire": desirable-admirable from "admire",
Lumber, plumber, bier, but brier,
Topsham, brougham, renown, but known,
Knowledge, done, lone, gone, none, tone,


One, anemone, Balmoral,
Kitchen, lichen, laundry, laurel.
Gertrude, German, wind and wind,
Beau, kind, kindred, queue, mankind,


Tortoise, turquoise, chamois-leather,
Reading, Reading, heathen, heather.
This phonetic labyrinth
Gives moss, gross, brook, brooch, ninth, plinth.


Have you ever yet endeavoured
To pronounce revered and severed,
Demon, lemon, ghoul, foul, soul,
Peter, petrol and patrol?


Billet does not end like ballet;
Bouquet, wallet, mallet, chalet.
Blood and flood are not like food,
Nor is mould like should and would.


Banquet is not nearly parquet,
Which exactly rhymes with khaki.
Discount, viscount, load and broad,
Toward, to forward, to reward,


Ricocheted and crocheting, croquet?
Right! Your pronunciation's OK.
Rounded, wounded, grieve and sieve,
Friend and fiend, alive and live.


Is your r correct in higher?
Keats asserts it rhymes Thalia.
Hugh, but hug, and hood, but hoot,
Buoyant, minute, but minute.


Say abscission with precision,
Now: position and transition;
Would it tally with my rhyme
If I mentioned paradigm?


Twopence, threepence, tease are easy,
But cease, crease, grease and greasy?
Cornice, nice, valise, revise,
Rabies, but lullabies.


Of such puzzling words as nauseous,
Rhyming well with cautious, tortious,
You'll envelop lists, I hope,
In a linen envelope.


Would you like some more? You'll have it!
Affidavit, David, davit.
To abjure, to perjure. Sheik
Does not sound like Czech but ache.


Liberty, library, heave and heaven,
Rachel, loch, moustache, eleven.
We say hallowed, but allowed,
People, leopard, towed but vowed.


Mark the difference, moreover,
Between mover, plover, Dover.
Leeches, breeches, wise, precise,
Chalice, but police and lice,


Camel, constable, unstable,
Principle, disciple, label.
Petal, penal, and canal,
Wait, surmise, plait, promise, pal,


Suit, suite, ruin. Circuit, conduit
Rhyme with "shirk it" and "beyond it",
But it is not hard to tell
Why it's pall, mall, but Pall Mall.


Muscle, muscular, gaol, iron,
Timber, climber, bullion, lion,
Worm and storm, chaise, chaos, chair,
Senator, spectator, mayor,


Ivy, privy, famous; clamour
Has the a of drachm and hammer.
Pussy, hussy and possess,
Desert, but desert, address.


Golf, wolf, countenance, lieutenants
Hoist in lieu of flags left pennants.
Courier, courtier, tomb, bomb, comb,
Cow, but Cowper, some and home.


"Solder, soldier! Blood is thicker",
Quoth he, "than liqueur or liquor",
Making, it is sad but true,
In bravado, much ado.


Stranger does not rhyme with anger,
Neither does devour with clangour.
Pilot, pivot, gaunt, but aunt,
Font, front, wont, want, grand and grant.


Arsenic, specific, scenic,
Relic, rhetoric, hygienic.
Gooseberry, goose, and close, but close,
Paradise, rise, rose, and dose.


Say inveigh, neigh, but inveigle,
Make the latter rhyme with eagle.
Mind! Meandering but mean,
Valentine and magazine.


And I bet you, dear, a penny,
You say mani-(fold) like many,
Which is wrong. Say rapier, pier,
Tier (one who ties), but tier.


Arch, archangel; pray, does erring
Rhyme with herring or with stirring?
Prison, bison, treasure trove,
Treason, hover, cover, cove,


Perseverance, severance. Ribald
Rhymes (but piebald doesn't) with nibbled.
Phaeton, paean, gnat, ghat, gnaw,
Lien, psychic, shone, bone, pshaw.


Don't be down, my own, but rough it,
And distinguish buffet, buffet;
Brood, stood, roof, rook, school, wool, boon,
Worcester, Boleyn, to impugn.


Say in sounds correct and sterling
Hearse, hear, hearken, year and yearling.
Evil, devil, mezzotint,
Mind the z! (A gentle hint.)


Now you need not pay attention
To such sounds as I don't mention,
Sounds like pores, pause, pours and paws,
Rhyming with the pronoun yours;


Nor are proper names included,
Though I often heard, as you did,
Funny rhymes to unicorn,
Yes, you know them, Vaughan and Strachan.


No, my maiden, coy and comely,
I don't want to speak of Cholmondeley.
No. Yet Froude compared with proud
Is no better than McLeod.


But mind trivial and vial,
Tripod, menial, denial,
Troll and trolley, realm and ream,
Schedule, mischief, schism, and scheme.


Argil, gill, Argyll, gill. Surely
May be made to rhyme with Raleigh,
But you're not supposed to say
Piquet rhymes with sobriquet.


Had this invalid invalid
Worthless documents? How pallid,
How uncouth he, couchant, looked,
When for Portsmouth I had booked!


Zeus, Thebes, Thales, Aphrodite,
Paramour, enamoured, flighty,
Episodes, antipodes,
Acquiesce, and obsequies.


Please don't monkey with the geyser,
Don't peel 'taters with my razor,
Rather say in accents pure:
Nature, stature and mature.


Pious, impious, limb, climb, glumly,
Worsted, worsted, crumbly, dumbly,
Conquer, conquest, vase, phase, fan,
Wan, sedan and artisan.


The th will surely trouble you
More than r, ch or w.
Say then these phonetic gems:
Thomas, thyme, Theresa, Thames.


Thompson, Chatham, Waltham, Streatham,
There are more but I forget 'em-
Wait! I've got it: Anthony,
Lighten your anxiety.


The archaic word albeit
Does not rhyme with eight-you see it;
With and forthwith, one has voice,
One has not, you make your choice.


Shoes, goes, does *. Now first say: finger;
Then say: singer, ginger, linger.
Real, zeal, mauve, gauze and gauge,
Marriage, foliage, mirage, age,


Hero, heron, query, very,
Parry, tarry fury, bury,
Dost, lost, post, and doth, cloth, loth,
Job, Job, blossom, bosom, oath.


Faugh, oppugnant, keen oppugners,
Bowing, bowing, banjo-tuners
Holm you know, but noes, canoes,
Puisne, truism, use, to use?


Though the difference seems little,
We say actual, but victual,
Seat, sweat, chaste, caste, Leigh, eight, height,
Put, nut, granite, and unite.


Reefer does not rhyme with deafer,
Feoffer does, and zephyr, heifer.
Dull, bull, Geoffrey, George, ate, late,
Hint, pint, senate, but sedate.


Gaelic, Arabic, pacific,
Science, conscience, scientific;
Tour, but our, dour, succour, four,
Gas, alas, and Arkansas.


Say manoeuvre, yacht and vomit,
Next omit, which differs from it
Bona fide, alibi
Gyrate, dowry and awry.


Sea, idea, guinea, area,
Psalm, Maria, but malaria.
Youth, south, southern, cleanse and clean,
Doctrine, turpentine, marine.


Compare alien with Italian,
Dandelion with battalion,
Rally with ally; yea, ye,
Eye, I, ay, aye, whey, key, quay!


Say aver, but ever, fever,
Neither, leisure, skein, receiver.
Never guess-it is not safe,
We say calves, valves, half, but Ralf.


Starry, granary, canary,
Crevice, but device, and eyrie,
Face, but preface, then grimace,
Phlegm, phlegmatic, ass, glass, bass.


Bass, large, target, gin, give, verging,
Ought, oust, joust, and scour, but scourging;
Ear, but earn; and ere and tear
Do not rhyme with here but heir.


Mind the o of off and often
Which may be pronounced as orphan,
With the sound of saw and sauce;
Also soft, lost, cloth and cross.


Pudding, puddle, putting. Putting?
Yes: at golf it rhymes with shutting.
Respite, spite, consent, resent.
Liable, but Parliament.


Seven is right, but so is even,
Hyphen, roughen, nephew, Stephen,
Monkey, donkey, clerk and jerk,
Asp, grasp, wasp, demesne, cork, work.


A of valour, vapid vapour,
S of news (compare newspaper),
G of gibbet, gibbon, gist,
I of antichrist and grist,


Differ like diverse and divers,
Rivers, strivers, shivers, fivers.
Once, but nonce, toll, doll, but roll,
Polish, Polish, poll and poll.


Pronunciation-think of Psyche!-
Is a paling, stout and spiky.
Won't it make you lose your wits
Writing groats and saying "grits"?


It's a dark abyss or tunnel
Strewn with stones like rowlock, gunwale,
Islington, and Isle of Wight,
Housewife, verdict and indict.


Don't you think so, reader, rather,
Saying lather, bather, father?
Finally, which rhymes with enough,
Though, through, bough, cough, hough, sough, tough??


Hiccough has the sound of sup…
My advice is: GIVE IT UP!

We'll begin with box, and the plural is boxes;
But the plural of ox should be oxen, not oxes.

Then one fowl is goose, but two are called geese,
Yet the plural of moose should never be meese.

You may find a lone mouse or a nest full of mice,
Yet the plural of house is houses, not hice.

If the plural of man is always called men,
Why shouldn't the plural of pan be called pen?

The cow in the plural may be cows or kine,
But the plural of vow is vows, not vine.

I speak of my foot and show you my feet,
If I give you a boot, would a pair be called beet?

If one is a tooth, and a whole set are teeth,
Why shouldn't the plural of booth be called beeth?

If the singular is this and the plural is these,
Why shouldn't the plural of kiss be named kese?

Then one may be that, and three may be those,
Yet the plural of hat would never be hose;

We speak of a brother, and also of brethren,
But though we say mother, we never say methren.

The masculine pronouns are he, his and him,
But imagine the feminine she, shis, and shim!

So our English, I think, you all will agree,
Is the craziest language you ever did see.

I take it you already know
Of tough and bough and cough and dough?

Others may stumble, but not you,
On hiccough, thorough, slough, and through?

Well done! And now you wish, perhaps
To learn of less familiar traps?

Beware of heard, a dreadful word,
That looks like beard and sounds like bird.

And dead; it's said like bed, not bead;
For goodness sake, don't call it deed!

Watch out for meat and great and threat;
They rhyme with suite and straight and debt.

A moth is not a moth in mother,
Nor both in bother, broth in brother.

And here is not a match for there,
Or dear and fear for bear and pear.

And then there's dose and rose and lose,
Just look them up, and goose and choose.

And cork and work and card and ward,
And font and front and word and sword.

And do and go, then thwart and cart.
Come, come, I've hardly made a start.

A dreadful language? Why, man alive,
I'd learned to talk it when I was five,

And yet to write it, the more I tried,
I hadn't learned it at fifty-five!

Компилятор сам отлично умеет разворачивать хвостовую рекурсию в цикл (равно как и раскладывать локальные переменные по регистрам). Какой смысл все это расписывать вручную? Автор черпал вдохновение в афоризме Ларри Уолла "Real programmers can write assembly code in any language"?

Я не понял, почему вы считаете, что ваша логика «не замкнута в гексагон». Вы тут по сути только добавили ещё один круг бизнес процессов (что в книге Вон Вернона тоже есть) и больше никаких отличий от каноничного способа реализации DDD я не вижу. Действительно важная проблема — вы тут не выделяете агрегаты и позволяете себе атомарно выполнять действия над разными сущностями не только одного, но и разных доменов. Будь у вас более сложная модель данных в базе — это бы вышло боком по из-за неминуемых проблем с производительностью. Я бы всё-таки порекомендовал вам почитать книгу Вон Вернона. Она хоть и большая, но в ней даны многие практические советы по реализации DDD, чтобы вы своим велосипедом по граблям не катались.
цена складывается из себестоимости ($1) и доставки по счетчику московского такси за км в ночное время
Как угодно, лишь бы не «мой господин».

Information

Rating
Does not participate
Location
Азербайджан
Registered
Activity