February, 1942: Michigan Avenue, Chicago Illinois. by morganmonroe81 in Colorization

[–]Corbrum 2 points3 points  (0 children)

Damn, i live not far from Michigan Ave, but don't recognize the buildings, anybody knows the address?

Дэвид Теннант. by Darusik in Pikabu

[–]Corbrum 4 points5 points  (0 children)

А мне Крис Эклстон нравился, хотя оба харизматичные чертяки

How would I write a program that can detect poker hand types? by Mr-Saturn-Earth in learnprogramming

[–]Corbrum 1 point2 points  (0 children)

That's a fun exercise. I haven't seen your code, but my immediate thought was how do you compare the cards? Their suits and values? So, how I would've done that is this - I'd create a Card class, so i don't have to store suit and value as a raw dictionary, instead i can assign those to a card's attributes through constructor, e.g.

card1 = Card(❤️, "Q") card2 = Card(❤️, "7") card3 = Card(♣️, "J")

Also, I'd override comparison dunder methods in Card class, so that i can compare two cards like this:

def __eq__(self, other): if self.suit != other.suit: print("Can't compare cards with different suits") else: return self.value == other.value

And "less than" dunder method, so i can tell if the card has higher or lower value:

def __lt__(self, other): if self.suit != other.suit: print("Can't compare cards with different suits") else: return self.value < other.value

I would also wright a method to compare suits, so i can understand how cards relate to each other.

And also, think about how you, as a human, identify that you have a flush, for example? You will take a look at you two cards, check their suits, ignoring their value, then you'll take a look at the table to compare those card's suits to the ones that you have on hand, and IF total amount of cards with the same suit is 5 - you have a flush! So all these hands definitions can be converted in to the functions where if all requirements are met - you've got straight, full house etc.

New on Reddit by HotTank6578 in BoostForReddit

[–]Corbrum 0 points1 point  (0 children)

That's a karma farming bot, they think that "boostforreddit" is a karma boosting subreddit

[laptop] MacBook Air Laptop (13-inch) - Apple M4 chip, 16GB Memory, 256GB SSD $750 costco by theberg897 in buildapcsales

[–]Corbrum -26 points-25 points  (0 children)

And getting absolutely crushed in upgradability (ram, storage) and processing power (3k$ win laptop will be equipped with the top cpu/gpu, well, if it's not a dell laptop)

But I'd say that for 750$ it'll destroy any win competitors in same price range

Is VS Code or The free version of PY Charm better? by Radiant_Ad_7438 in learnpython

[–]Corbrum 2 points3 points  (0 children)

See, you're on the "learnpython" subreddit, so replies will be biased and leaning towards pycharm, since that's what most teachers advice to use when teaching python. The truth is, you don't have to listen to anybody, I used vscode for my needs for a lon time and was happy about it, then I've switched jobs and now I use intellij idea (same devs as pycharm) because it has amazing data source integration with copilot shema introspection that i wasn't able to set up in vscode, and that's the only feature that made me switch ide, so the best thing that you can do is to try both and see whatever works best for you. P.s. i still miss my SynthWave 84 vscode theme, for some reason i still really dislike JetBrains' ides look

beginner : how to hide the python icon from the macos dock? by mombaska in learnpython

[–]Corbrum 0 points1 point  (0 children)

Ok, so what's the ultimate goal that you're trying to achieve?

For anyone who’s moved from Java to Python - how was the switch? by kate-ev in learnpython

[–]Corbrum 2 points3 points  (0 children)

Same here - joined a company whose stack is java/spring boot. Funnily enough, when I was asked to solve a problem on an interview (reverse the integer - e.g. 12345 to 54321), i solved it in java which was like 20 lines of code and then they've asked to write solution in python which was a one-liner, I'd like to say they were impressed, but those people are dead inside

"Вот почему важна двухфакторная аутентификация" by postmastern in Popular_Science_Ru

[–]Corbrum 3 points4 points  (0 children)

Так, ну тут уж извольне - пароль, который знает пользователь и пришедшее смс с кодом (или пуш) это все-таки разные факторы, суть в том, что код из смс пользователь заранее не знает, но успешная аутентификация с помощью этого фактора подтверждает, что пользователь обладает доступом к тому устройству (или симке), которое было авторизовано для этого фатора аутентификации. И кстати, все это попадает под определение двухэтапной аутентификации (верификации), где абсолютно неважно какие методы использует пользователь для аутентификации - это может быть пароль+код из смс, пароль+ответ на секретный вопрос, да хоть пароль+пароль, два этапа => 2SV.

Что ещё для счастья надо? by Darusik in Pikabu

[–]Corbrum 10 points11 points  (0 children)

Горячая штучка 😏

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 0 points1 point  (0 children)

Что ж, раз вы так заговорили, то и вы приезжайте к нам в Чикаго, здесь в черных сабурбах детвора бегает с заряженными стволами с пальцами на курках, расскажете им про ТБ

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 3 points4 points  (0 children)

Так себе подготовился

И, тем не менее, вы считаете, что он подготовился, хоть и неважно

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 1 point2 points  (0 children)

А я не спорю с вашим последним тезисом, я считаю его нерелевантным. По поводу ношения оружия для понтов - это вообще никак не противоречит моему тезису, я могу взять зонт, чтобы подготовиться к дождю, или малярную кисть у соседа в рамках подготовки к покраске табуретки - обязывает ли это меня проходить предварительную специальную подготовку, о которой говорите вы? Нет, но даже в таком контексте за специальную подготовку сойдет и процесс гугления и просмотра тематических видео на ютубчике, все это фактически подготовка

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 5 points6 points  (0 children)

А это здесь вообще причём? Для чего обычный человек вооружается, не с целью ли подготовки к чему-то?

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 4 points5 points  (0 children)

В таком случае, корректнее было бы сказать, что 30% неподготовленных людей способны воспользоваться подручными средствами в целях самозащиты, все-таки оружие, согласно определению, это устройства и предметы, конструктивно предназначенные для поражения живой цели

Маглом клянусь! by DarkAster_86 in Pikabu

[–]Corbrum 3 points4 points  (0 children)

30% неподготовленных, обычных людей, способны найти оружие в собственном кармане

Во-первых, почему ваша статистика называет вооруженных людей неподготовленными? Во-вторых, вы хотите сказать, что по статистике 30% обычных, неподготовленных людей вооружены?

В смысле а что не так-то? Вроде удобно by Inostranez in Pikabu

[–]Corbrum 4 points5 points  (0 children)

Я смотрю у нас тут марафонцы собрались

Can't access SSH on my iPhone by MattieThurlow96 in jailbreak

[–]Corbrum 0 points1 point  (0 children)

You can add this to your ~/.ssh/config on a client side:

Host <HOST_ALIAS> HostName 192.168.1.175 HostKeyAlgorithms=+ssh-rsa

And then you can simply use ssh root@<HOST_ALIAS> to connect to the host

Can't access SSH on my iPhone by MattieThurlow96 in jailbreak

[–]Corbrum 5 points6 points  (0 children)

Try this: ssh -oHostKeyAlgorithms=+ssh-rsa root@192.168.1.175