#ot1-perplexing-regexing
1 messages · Page 414 of 1
lark is fun
The parser's alive!
λ> (+ 5 (* 5 5) 5)
35
lark seems overkill for lisp
Actually yeah now that I think about it
Though it's two birds with one stone so I might as well
Wait, so the prepended operation can handle an arbitrary number of arguments?
most lisp functions are variadic
Why did I think it could only handle 2 at a time...
#|kawa:1|# (> 1 2 3 6)
#f
#|kawa:2|# (> 6 5 4 2 1)
#t
``` even things like `>`
Is that like an any?
On first fail it short circuits?
And is it comparing like....
1 > 2, 2 > 3, 3 > 6?
Or does it compare it all to the first
definitely does not short circuit
as for the internal impl, I would assume it works like that
for short circuiting, it would have to be a macro, which it is not
#|kawa:1|# >
#<procedure >>
#|kawa:2|# let
#<macro let>
i have a ridiculous one i've shared a few times
ooh
i've been trying to think of interesting ones but i've been coming up a little short
!e
class Stringy:
def __init__(self, name):
self.name = name
def __getattr__(self, attr):
self.ext = attr; return self
def __matmul__(self, other):
print(f'Emailing {self}@{other}')
def __str__(self):
return '.'.join(attr for attr in self.__dict__.values())
def __call__(self, msg):
self.msg = f'.. {msg}'; return self
class StringyDefaultDict(dict):
def __missing__(self, key):
if key.startswith('__'): raise KeyError(key)
self[key] = Stringy(key); return self[key]
class EmailMeta(type):
def __prepare__(*args):
return StringyDefaultDict()
class Server(metaclass=EmailMeta): ...
class Email(Server):
lemon@discord.py('Hi lemon!')
ves@zappa.edu('Hi ves!')
joe@mama.com('Hi joe!')
@shadow jetty :white_check_mark: Your eval job has completed with return code 0.
001 | Emailing lemon@discord.py... Hi lemon!
002 | Emailing ves@zappa.edu... Hi ves!
003 | Emailing joe@mama.com... Hi joe!
it's __matmul__
i was actually thinking of doing 'haha @ is also email' but it wouldn't have been as good as that
oh nice
i didn't realise that [x] could have x as a tuple
or
well
[x,y,z] gets passed as (x,y,z)
you use [...] on classes with __class_getitem__
or define __getitem__ in a metaclass
i use it as a constructor for a class
oh god i have an idea
In [40]: from real_ranges import *
In [41]: Range[1:4], Range[10:], Range[:3.14159]
Out[41]: ([1, 4), [10, ∞), (-∞, 3.14159))
have you seen the ranges library?
oh, i made a neat helper class for ranges that you might like
In [43]: x = Var('x')
In [44]: RangeSet(x < 3, 4 < x < 6, 7 < x < 8, 9 < x)
Out[44]: {(-∞, 3), (4, 6), (7, 8), (9, ∞)}
inspired by sympy
reduces typing
more cool shit from spice gg
so GitHub is doing another design change in Feature Previews
i do not like it at all tbh
I like their repository refresh. It's quite different and experimental, could use some work, but overall interest.
But this new site redesign with all the circles, rounded squares and stuff. no thanks
It just looks bad. Probably the only Feature Preview that I've immediately disabled.
@oak tangle random q., but if you don't mind me asking, did you happen to go to Leiden uni?
exposed
@rough sapphire Ha, what makes you think that?
you happen to have a leidenuniv.nl email
I'm just interested because my gf goes there
Ah, yeah, I went there and worked there
fair enough
Now I wonder where that email address is listed
what do you all think of OneLoneCoder?
Not really familiar with them
(4 pics)
hah
@rough sapphire True, I could see that. Stealing just for entertainment is a bit shallow, but education is a different matter. I still don't condone it, but I'm less bothered by it, I guess
Fair enough, sleep well
Huh, okay now THAT'S interesting
Messing with Reason some more, just got to functions.
let add = (x, y, z) => x + y + z;
```Compiles to this in JS:
```js
function add(x, y, z) {
return (x + y | 0) + z | 0;
}
I guess I shouldn't be overly surprised, but I just wasn't expecting it to do the | 0 bits
wasn't the | 0 to force integers or something
since javascript only has floats
> (1.9999 |0) + (1.9999 |0)
2```
no, it is because functions in JS can receive too few arguments
It's essentially defaulting y and z to 0
function add(x, y) {
return x + y
}
console.log(add(1)) // 1 + undefined = NaN
gotta say I am impressed, expected '1undefined'
> (1 + 2.999 |0)
3```
wh
Hold on, I'll see what it does with floats
@graceful basin it's bitwise yes.
that's how you force things into integers in javascript
and number | 0 is the number itself
but here it is used for this I would think
> undefined | 0
0
Okay so:
let float_add = (x: float, y: float, z: float): float => {
x +. y +. z
};
```Turns into:
```js
function float_add(x, y, z) {
return x + y + z;
}
Which, huh
And yes, you do have to do +. when adding floats
It's friggin' weird
kinda like it
oh, it was for integer setting then.
Seems that way
I guess the haskell solution of a Num typeclass is a bit iffy
If there's a possibility that it could be undefined, I think you can just wrap it in an option or something like that
Still a little fuzz on the JS interop stuff
yesterday's venture of trying to use R from python ended up poorly.
didn't work.
gonna have to try again with some new energy. try to set up some docker container that they provided.
the problem are the versions and intricacies of calling the correct things from one to another.
Ah, found it, one sec
especially on windows it seemed to be painful since cygwin was involved and there were version number problems with that.
is there a dunder for chained comparison?
chained?
no, it just compares multiple times (if this is what you mean)
In [53]: dis.dis("a < b < c")
1 0 LOAD_NAME 0 (a)
2 LOAD_NAME 1 (b)
4 DUP_TOP
6 ROT_THREE
8 COMPARE_OP 0 (<)
10 JUMP_IF_FALSE_OR_POP 18
12 LOAD_NAME 2 (c)
14 COMPARE_OP 0 (<)
16 RETURN_VALUE
>> 18 ROT_TWO
20 POP_TOP
22 RETURN_VALUE
The forbidden language. Yava.
because presumably it does a < b AND b < c
so i lose what i'm returning from the __lt__ dunder
let add = (~x: int, ~y: option(int)=?, ()): int => switch (y) {
| None => x
| Some(y) => y + x
};
```To JS:
```js
function add(x, y, param) {
if (y !== undefined) {
return y + x | 0;
} else {
return x;
}
}
Which yeah, probably should have seen that coming
Also don't hate, still trying to get the hang of the Reason styling
Oh interseting
Since Reason can infer the types, I can change ~y: option(int)=? to just ~y=?
May someone please help me find my passion without trying different things? If it is so, that how I think of passion is wrong. Sorry for bringing the subject up again. I wished I had the money to try out new things. I just feel more insecure knowing that it is subjective. But then again maybe I'm wrong. Is it? How can I feel what I think someone else is feeling?
@high verge removing link purely because someone will click it lol
lol
idk why but this layout looks wrong
like it shouldnt exist
the console was below the code, but i figured since python shouldnt be more than 120 chars wide anyway, why not just put the console to the side, and make more screen space
is that pycharm?
everything looks so colorful
i wanna edit the colors but im too lazy to go search for it so wtv
doesnt pycharm come with its default css styling?
eh ill try it out
woah everything looks... cleaner
aaaaaaaaaaaaaaaaaaaaaaaaaaaaand i regret running the bot in cmd prompt cuz now it types twice REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
@modern ibex Replying here since #python-discussion isn't the place. Yes I'm a uni student, just about to finish my final semester
...yes angry sugar
What's the bare minimum it needs?
So basically the actual board is just a 2d array, like so
Uhuh
The way it works is via backtracing, which is really cool because it means it can be given 0 numbers and still generate an answer
Basically it goes through every number 1-9, and if the current iteration would be valid, keep it, and move to the next. Once there's no longer a possible input, delete the previous number, and start iterating again but numbers num-9 so you don't just keep getting the same values
And yea basically. I could also make a randomiser and stuff which would be easy enough but haven't bothered tbh
How long did it take you to code this?
If you're curious this is the solving for an empty board to start
Thats cool
And honestly the hardest part was making the output pretty
Took me about an hour or two just to do that lmao
The actual code for backtracing etc. was about 40-60mins
def print_board(board: list) -> None:
"""
Prints out the sudoku board contained within the board list.
NB: 'boarders' = lines separating the 3x3 grids from each other.
"""
print(f"╔{'═══╤═══╤═══╦'*2}{'═══╤'*2}═══╗") # top horizontal boarder
for index, val in enumerate(board):
print("║ ", end="") # left column that doesn't interact with other rows/columns
for nindex, nval in enumerate(val):
print(nval if nval else ' ', end="")
if (nindex + 1) % 3 == 0:
print(" ║ ", end="") # vertical boarders
else:
print(" | ", end="") # vertical columns
if val == board[-1]: # allows us to manually print final row
break
if (index + 1) % 3 == 0:
print(f"\n╠{'═══╪═══╪═══╬'*2}{'═══╪'*2}═══╣") # horizontal boarders
else:
print(f"\n╟{'---┼---┼---╫'*2}{'---┼'*2}---╢") # horizontal rows
print(f"\n╚{'═══╧═══╧═══╩'*2}{'═══╧'*2}═══╝") # bottom horizontal boarder```is the printing code
Getting the logic right for all that was horrible lmao
And tbh this is a pretty basic sudoku solver, basically a brute-forcer
Does have a few optimisation things but not many
@rough sapphire
how big is too big of a YAML file

"too big"
umm?
y e s
like, at what point would you say i split it
does YAML support imports
im currently at 172 lines
includes
and no ;-;
i'd have to do that in code
configuration files can be pretty huge
sometimes
o
it depends on the content I guess?
true
xD
thats part of it
config for private bot for my discord server
I don't think 172 lines is too much
okii
some linux .conf files are in the thousands of lines including comments
oh
true
hm cuz like, i also wanna make it so staff can parts it in discord
like, add a rotating status
so it could grow past the default
i think it's about things being logically in the same place
ah fair
if you start splitting things, as long as they make sense to put into the other place, it's fine
i'm already keeping it pretty organized, but yea if 2k lines is accepable, im sure 500 is
i'd rather be looking for the settings in one big file than multiple smaller files
since that's how other programs do it too
yea that makes sense
can someone explain Monolithic and Microservices architecture to me like i'm 12
Monolith is a big blob that either work or dont, Microservices are tiny blobs not working together, but its fine because you said its on purpose
Ill be at Pycon 2021, thanks for the like and suscribe
i just had a revelation
when you say the word "mandrake"
what you're really saying is man and then drake
god this song
it's great
then they just pull a generic spinnin' records chorus out of their arse at 1:16
@rough sapphire who is this Drake person?
@rough sapphire i don't know. i was thinking of drakes. some kind of flying things.
Oh
Dragons fly
magic the gathering has both drakes and mandrakes.
its the disk rake util
Drake's don't all fly
drakes don't fly
that's the distincttion
@rough sapphire depends on the mythology
how does that not fly
that's very clearly not a drake
same way ostriches dont
i guess mtg doesn't have mandrakes. weird.

I should probably start using vim-plug instead of pathogen for my
plugins
It's like MtG has no respect for mythological taxonomy!
hey guys I got confused,
look at the address was meant to be same isn't it? I saw a video by telusko and he said that same, what's happening here ?
why is the address different here
It can be the same. But doesn't have to be, cpython caches some numbers as singletons, but not all. Try it with a smaller number, less than 255
wow! I didn;t knew this technical stuff, tysm
@topaz aurora I really like vim-plug, but I see packadd everywhere I go these days 
when doing cp-like exercises, should I use the stdlib ?
on one hand, not using it is a good way to come up with my own solutions
what kind of exercises specifically
on the other hand, the stdlib just makes everything cleaner, and is probably going to be the solution that I use in prod
hackerrank stuff
you use any tools available to you unless the task says otherwise
you really want to be using stuff like deque() from collections
maybe some of the itertools stuff might be going a bit far
I have an out topic question
Shoot
So recently my hard drive crashed
And I foolishly had no backup
So if I download android Studio again, will I still have my projects there
Like are they saved there in my account?
I don't believe so. Unless you were uploading them to somewhere or using GitHub or something
If it's wiped, it's wiped
The only thing that JetBrains holds on to for you is configuration for your IDE (which that may just be a Pro version thing, not sure)
Argh, the space in my Windows user profile name is coming back to bite me
hah
never spaces, always lowercase, dashes instead of underscores.
i think @rough sapphire is with me on dashes
-
_
i don't see it, what's over there?
Might as well migrate to a new profile once I can externally backup my stuff
Ah! So sad 😭
The issue with dashes is that it is no go in programming because it is the minus sign
Dashes work in identifiers in quite a few languages
winget can't get here soon enough
I'm craving for an easy, not Microsoft Store way to update stuff
@cerulean musk If you want to write mods for bedrock you cannot do it in C++
You do not want C++
How many times
Also this is a Python server you'd need to find a C++ Discord
I've been having this PSU crackling sound since a while now and it's driving me mad. It's much exaggerated here and only barely audible when the case is closed. Does anyone know what's wrong with my PSU? :P
My first suspicion is the fan
Try blowing out any dust
If it still persists then email its manufacturer
Hmm, I cleaned the fan but the noise persists
The warranty is void since a year unfortunately
xD This has been happening since quite some time now
it's overseer btw, changed name
oh okay :D
Please help us settle this important debate. Does Eric's photoshoot make him a Foot Model? Let us know.
⭐️Check us out on Twitch at:
➡️ Alexandra Botez - https://www.twitch.tv/botezlive
➡️ Eric "Foot Model" Hansen - https://www.twitch.tv/chessbrah
❤️Social Media:
➡️Alexandr...
Chess and drinking 
what could go wrong
W h y
Made a mandelbrot drawer on my phone. https://paste.pythondiscord.com/vagopatafe.py
Cpu: I don't feel so good.
LOL
When they won't just shut up.
where do i buy dis
Do you even have kids?
Nevermind you can even use it on annoying Discord moderators...
I need that product in my life
I’ll buy your entire stock
In fact, I’ll buy the company

I'm being blackmailed and sexually abused by a 18 year old lesbian...
Literally pedophilia right there.
That sucks
Yuh, she won't leave me alone.
It’s hard to read discord with my mask on
It's hard to read Discord while split-screening.
But if you want her to leave you alone, then just cause a sinkhole at her house
Nah let me let that bioch do her thing until she gets tired of me.
Your call
Has ended.
Have you ever tried to drink water through a mask
No
Well I just figured out it is possible
W h y
But you’ll get more water on your mask rather than in your mouth
Yes, makes sense. #DoNotWasteWater
I could pull up the mask but that will get rid of the point of my mask and straw hat
Because I needed a pfp but I didn’t want to show my face
So the idea of my pfp was born
Default avatar also works.
Epic hacker boys 69 use the default avatar and have a status of invisible.
I bet you want to join their hacker group and DDos little girls for cp don't ya?
Police sirens intensifies.
Most “hackers” are script kiddies
Yes
That's my whole point...
Join their epic "hacker" group to DDos and blackmail people, oh my god!!!
Hackers, wooo!!!
The idea of being a hacker isn’t “cool”
Hacking is illegal
I know
And you will get arrested
dir C:\Users /s
I know
Hacking has a variable definition.
What
Not all hacking involves illegality.
That is true
I hack't my mum's BIOS lololol.
Not all hacking is sitting at a keyboard going kekeke
KEK
So... Is anyone interested in teaching me how to hack or no...
There's hardware modification. It's using technologies in ways they weren't originally intended. Hardware hacking. Engineering. Not necessarily illegal.
@rough sapphire Take your local crowbar and hit a window with it
I'll get arrested for vandalism.
Boom your hacking
Fuck
Hack your window
So that one day you will become the greatest hacker
You will be able to hack any window
I will hack my sister though.
Windows, ah yes I know how to get admin on it without having access to the os itself.

Or that time I, through a genuine and honest accident, discovered a way to get free photocopies at uni.
Lol
I told the head of the place. Nothing was done to patch it.
Lol
There was provision for free copying under certain circumstances, so I just used it then.
Hm?
C'mon man, it's a sexy ass os.
I have removed all the windows from my house
Lol
All the windows from my computer
Anyone who tried to break into my house faces my true hacking
And uninstalling Windows 10...
I will use my true hacking skills at Microsoft
And break all the windows
All of them will shatter
At any rate, if you consider conputers and the internet like an organism, you want that organism to have a good immune system. Having no bad actors would be a really bad thing, because then that immune system isn't being stimulated and it would start to atrophy. Then, when something does come along, the organism gets really sick and maybe dies because, oops, no immune system.
Fax
Your starting to get too philosophical for my small brain
who is in charge of changing the Off-Topic channel names?
Bot does it.
really?
Is that what you mean?
is that what I mean? I'm not following
seems like the off-topic room names change frequently
Does my answer satisfy your question?
umm.....how does the bot know what to change it to?
No but seriously that’s perfect
@red willow It draws from a database of room names which is added to at admin whim.
IT WAS WINDOWS 10 DOWNGRADE, LET ME UPDATE THE MEME.
ok thanks
was just curious
I need to get back tot Autocad tutorials but I am just burnt out
so I am procrastinating on here
😁
I would at least swap around the image order. Most people read left to right. Top and bottom may be more universal.
<3
Anyways I gotta become a master hacker

Fuck it, no Windows
There's a noob to expert Python course on YouTube that's like 12h or 16h long...
Physcal? okay this is beyond me.
When you hack?
When you hack.
You mean life hacks?
No, the action of cutting and hitting things with excessive force
Or opening things
I hacked my window
Mr. Hackerman
I've got a Hacker book with Kali
your book runs on kali?
let me downgrade to 8.1
Why so different colors haha
that is by far the worst vscode theme i've ever seen
no offense
everything is just so fucking GREEN
... Green?
red then?
red
Ah, you are colorblind?
@rough sapphire 🥳 happy midsummer
you too man
trying to make hamburger patties out of minced meat here 🍔
never done them by hand before. usually just by them premade
what do i need
i have ... meat
onion, egg, and minced beef
pretty sure you really want onions
it'll be fine
here's a random recipe that's probably ok https://www.bbcgoodfood.com/recipes/beef-burgers-learn-make
i'm not chopping onions. too much trouble
chopping onions is actually much easier than you think
Ah okay
i learned it in no time
the chopping of the onions part is kinda easy but i hate the part where you have to take the onions apart
like peel them
plus it makes a mess
it's a very easy to clean mess
just cut a slight circular ring around the onion and peel it off like a sock
the only foods i'll chop onions for are like guacamole and umm
tzatsiki? does that even have onions?
no
it has garlic
I can't think of any good meal that doesn't involve onions
onions are great
onions are great
they're bad for your stomach
well for mine at least
Big fan of both onions and garlic
I'm sorry for your onion loss
Sometimes I even put them in the same dish!
What about garlic bread?
That's pretty much the same thing
Well it isn't, but still
it's the cooking that seems important to me
and garlic bread is usually cooked/hot
can't just have a cheese and garlic sandwhich
I think
maybe i should try it...
i haven't had a chicken tikka sandwich - no
You can have garlic + herb dips, and I guess they wouldn't be cooked
that's true
Garlic butter is nice for making a grilled cheese
honestly - I have yet to find a thing for which garlic butter isn't nice for
cakes I guess
did someone say free
free as in freedom
free as in bald eagles
why are they considered bald
when they have feathers
this guy has his stuff together
Ex-Google Tech Lead sabotages self-sabotagers. Launch your next website with http://squarespace.com/techlead and add code “TECHLEAD" at checkout to save 10% off.
🎬🌟 NEW! Learn how I built a $1,000,000+ business on YouTube. I help with mentorship & coaching for your online bus...
I'm glad I came across his videos on my YT feed
Personally I have some gripes with ex-Google, ex-Facebook, TechLead
how come Momo
he reminds me of someone I used to know.. who's wife also left him and was a senior tech lead
Silencing a smaller YouTuber and being involved in doxxing them just cause he didn't like the criticism
ahh.. let me look that up
lot of internet history to unpack here
I never knew YT had to release names in case of copyright strikes
guy1 made some video criticizing Matt Tran and TechLead, anonymously
TechLead copyrighted him to get his names, shares it with Matt Tran.. Matt Tran doxxes him and admits it
Seems Matt Tran reached out to Tren, the university student, to remove the video first..
now I need to see what sort of criticism he shared.. doxxing is illegal afaik, wowow
seems like a non starter.. issue happened late April, didn't go anywhere and they're still going back and forth
and then nothing?
Does the recources page have anything about Collections?
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
is anyone here going to be celebrating litha this weekend?
what's litha
I mean I probably am but I don't know what "litha" is
Germanic neopagans call their summer solstice festival Litha interesting
ye that
i'm just doing regular midsummer
here a lil info sheet with food and info
just be subtle? i managed to convince my mom tarot isnt bs
is the summer solstice the same as the longest day of the year?
ye
thank god
well if i celebrate for a few days ill be right eventually
@undone berry yes
a lot of people i hang out with are celebrating it rn
@rough sapphire the guy is an imposterous prick
Thanks man @wheat lynx
help my wall is pecking my bird
Thanks man @wheat lynx
No problem, feel free to contact @polar knoll or ping mods in the future if people are being a pain.
Cool
import socket
def receive_message(conn, client_addr):
while True:
msg = conn.recv(4096)
print('[%s] %s' % (client_addr[0], msg.decode()))
def server(addr, backlog=1):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(addr)
s.listen(backlog)
print('[+] Server initialized - Waiting for connections...')
except socket.error as error:
print(error)
server(addr, backlog=1)
conn, client_addr = s.accept()
print(f"Connection to the server - Client establised: {client_addr}")
receive_message(conn, client_addr)
if __name__ == '__main__':
server(('141.255.152.173', 30005))
``` this is working on my pc but not on python repl, but was working before
how is that possible lmao
yeah
to simulate another pc
because i wanna keep this server online and connect many clients to it
they probably won't allow that cause then people would just use their service as a webhosting provider
before i was running the server on the repl and sending messages through client.py (on my pc)
and was working
very odd
it is running now, ive used socket.gethostname()
let me try to connect from my pc
Uhm, im trying to connect to that server with client but doesnt work
is there a reason why thats not working? lol
i'm sorry, what?
what if it's trying to avoid reading that file
failed task completed successfully
it successfully didn't read the file
for security purposes
make sure it wasn't run with sudo yaknow
it's a systemd unit which is supposed to run as root, though
some dev probaly just told it to log that, for this reason
just to mess with people
guardian getting a bit unsubtle with the marketing
it used to be 'we're good at being a newspaper give us a quid'
and now it's 'if you dislike boris johnson give us a quid;
eh they put it at the bottom of the article, so i'm ok with it lol
also they're not wrong
(at least the first paragraph)
yeah, as journalists you'd expect With those in power failing us.. and without political and commercial bias not to occur in the same place. 😄
You guys ever been given credit in a project you didn’t work on?
Once.
To be fair, I literally did the entire proj by myself, but someone else did a shitter version and got their own chosen instead of mine.
Didn't complain, free total.
lmao
@leaden shuttle naa
I don't believe in cancelling people who I disagree with. That's for people who can't control their emotions
Are you referring to TechLead that actually did that? Or are you saying that I am cancelling him because I said he was an imposter?
why do you say he's an imposter
I mean, it's pretty hard to clear interviews and work at one of these companies.. guy has an ego problem, but I'm only impressed by his skills.. not his life
I thought you wanted me to dismiss him completely because of his short comings, which is cancelling someone.. and that I didn't want to do
is there anyone you look up to?
like.. I see all these statues coming down and I'm wondering if these people actually mean well or just taking out their frustrations on the world
there are less skilled people at fang, that's a given.. a lot of them complain there are less skilled people around.. I've also met sr devs who don't see the point of working when they make more in stock than they do in hours
but that doesn't change the fact they're still hard to get in to.. some times luck, mostly talent
I'm looking Profile-Guided Optimization (PGO) and it's very interesting
it kinda does
well i don't know leetcode that well but the algorithm questions are not easy
fake news?
what
i've failed a couple of job interviews miserably because they've thrown algorithm questions at me.
If you can just get the basics down with a dsalg book/course, then practice for an hour a day, it doesn't take too long to get up to scratch
the last time i was thrown some pretty involved dynamic programming question
didn't even know it required dynamic programming
Yeah. That's part of what you learn with the practice
Learning to get at the algorithm behind the question
I used to be alright. Now I've just forgotten everything
but most of the time you honestly don't need to know that stuff when you're working
it really depends on the placement but
Yeah. It comes up very rarely from what I understand. Some people disagree and say it's vital
probably depends on the thing you're doing
might be something that when you don't know what you're missing, you don't see it as important
Yeah. That's very true
how to make a php login system
Understanding core data structures is obviously important. Lists and hash maps and their operations. Stacks and queues and their uses
there was a live programming session with one guy who wanted me to solve "how do you write the algorithm for detecting whether the game of battleships is over"
or whether you've sunk the ships or something
fucking nightmare
i don't even know the rules of battleships
Surely that's just iteration over a matrix?
there was some very annoying bullshit about it
like you had to make sure whether the ship you hit was even in a legal position or something
lol.
Step 1: search SO
Step 2: implement SO solution
no job for me...
and the ships were not of the "traditional" kind - they could be 2x wide
i told the guy when we started that i dislike this question because i'm bad at this kind of problem solving.
he was not impressed.
what kind of company was it for
i don't remember
the problem isn't probably hard if there is any algorithms knowledge behind you and you've done any of those things ever
but to me it just felt like "this is the worst bullshit I have ever had to face" when i literally hadn't ever done anything like that
I feel like I'm very good at spinning the right kind of bs for interviews. Last one I did required some simple data analysis and a recommendation, but I was ill so I couldn't think straight and just chatted nonsense for 20m
Just ended up nodding along with what the interviewer suggested, with him essentially answering the question. Somehow it worked though
buzzword it. "First, i'd execute a breadth-first on the legal position LUT. Then, if that passes, I'd execute an A* search for the hit position against the ship locations LUT".
just start pasting random hacker stock photos into a word document
That's why practice on leetcode stuff is worthwhile. If you can at least poke the code in the right direction without google, it looks much better
and solving dsalg problems is very different to normal programming
@rough sapphire hehe. yeah, at that point i'd probably be like "Y'all hiring in the mail room?"
lol
or, just start typing import blockchain and wait for the giggles...
there have been very successful tech interviews too. those have usually involved doing some practical stuff.
just throw in as many buzzwords as you can think of. Using the blockchain oriented GANN deployed as a distibuted system, we can scan the board to detect sunk ships...
... do you want to work for a company that falls for that?
I like money - so yes
being employed is better than not employed
but to go to switch to something like that, no thanks
in seriousness, i'd likely just be flat out honest: algorithms are a large weak point for me. i have a basic understanding of their application, and some terminology. if provided the opportunity and the necessity, i'm confident this weak point can be addressed. thank you for your time, have a pleasant day. <ends call>
that's what I've kinda been doing. telling them that I'll design you systems etc
does leetcode have different max times for different languages
I think so, yeah
hmm ok
fwiw - by Leetcode, I don't actually just mean Leetcode. There's tonnes of sites like that
CodeSignal is by far the best I think
For leetcode, that probably means your time complexity is bad
ye, your algo is bad then
there's a chance the same code would pass in C++, but it can definitely be improved in Python
you just need to practice
I think in leetcode, time complexity will kill you regardless of language
is it just 'use map' or something
ye, that is not optimal, and so will not pass afaik
yeah
i can't see how you could have a non O(n^2) solution given that you need to consider all combinations
sorting in general is O (n log n)
@high verge sorting is faster than O(n^2)
sort it. Then for each number in the list, do a binary search checking to see if the other number is in the list
that made no sense
it does in my head
import antigenicity]
sort the list. Then each number in the list has a potential partner, search the list for the potential partner
so sorting it only has to happen once
that's n log n
yeah you could sort it first, then only consider the numbers strictly less than the target
but that would still be worst case n^2
you do not need the binary search actually from what I can tell. My solution passed with just regular linear probe
but isn't 'searching the list' another * n
not if it's sorted
ohhh
then it becomes log n
and also because in mine, the inner for loop will use all elements except in the final one
oh - turning the list into a set
that's the actual way
if the target value is n
Turn the list into a set
For each number x in the set, check if x-n is in the set
hehe. i was thinking that the whole time. but, i love sets...
finna made a program that tells me the percentage of the population infected for each country by the COVID-19.
but now i want to do much more
like make a graph and send me the data everyday via email or whatssapp
cuz it changes every day
|| nums_ = Counter(nums) while nums: n = nums.pop() nums_[n] -= 1 idx = len(nums) if nums_.get(target - n, 0) > 0: return nums.index(target - n), idx|| should be in theory O(n), though not sure why I decided to go with pop() when I first wrote it
that does not seem like the cleanest way to write that code
It's O(N) though which is what matters
ah, I remember now. duplicate numbers. The set solution would possibly fail on [3,5,1] when the goal is 6, because target - 3 is in the set, and it would return 0, 0 which is incorrect
so I went destructively backwards to prevent number reuse
what there are talking about in #python-discussion
What are people taking about? Probably Python
gotta hate those websites that add them selves to the history 15 times so when you try to go back it doesn't do anything.
to exit them gotto clik faster tham sonic
waht
hold the back button
python?
fizzbuzz
print 1 to 100, for every number divisible by 5 print fizz for every number divisible by 7 print buzz, for everything divisible by both print fizzbuzz
Can a O(1) implementation be a worse choice than O(n)?
yes, when the input size is small
@deep drum if the constant is for instance "this will take longer than the whole time the universe has existed" then yes
then your n would have to be pretty darn huge for it to be worse than that
but theoretically at some point your n will be large enough so...
time complexity is only meaningful for large sizes
hashing is an example where that might be the case. Searching a tiny list is possibly faster than hashing something in a dictionary
or sorting
the operation could literally be anything when talking about time complexity though.
😽 💤 time to go to sleep now
time to make a hot chocolate
😋
happy father's day :D
Hot chocolate is grim
hot chocolate is awesome
hot chocolate i feel is only good in the winter
i cant drink it in any other season or else it feels wrong
hot chocolate is meh
it's good the first few sips but beyond that is just tastes like liquified chocolate
yea
yea, but if there are too many its really sweet and weird
too many marshmallows at least
true
Any way to get this free
Unless you want to get it illegaly, no
Or at least I don't think so
my bot
oh
@halcyon mantle https://fontawesome.com/icons?d=gallery&q=gas doesn't work for you?
oooo, I might check that out
I'm not making a website
...
@halcyon mantle What are you doing, then?
I just said lol
a robot? or something else
.....
uh oh
my bot
Discord bot?
yes
I don't see why you couldn't use FontAwesome if that's the case
They're just .svg files
they're pretty ugly
I disagree, but alright.
have you not seen https://flaticon.com
I might use them for some UI or something
my favourite author is dinolabs
@halcyon mantle oh my gosh this is an amazing site, thank you
@halcyon mantle https://www.flaticon.com/authors/dinolabs not found
thanks
that's fire
owo
Household devices and appliances https://www.flaticon.com/free-icon/cctv_1869650
people have security camera in their house
CCTV cameras?
there are some really paranoid people out there
I'm good
Ok
We have multiple cameras in our house
well, by multiple I mean two
one on the driveway
me too
and the other one is pointed at the water pressure guage
also not free without attribution
which is a bit of a major issue in a discord bot it seems
i never attribute lmao
Would be a stretch to call this paranoia I think :>
why do you need to check the water pressure?
@high verge everything of mine is open source
makes sense
we just had some work done after a pressure valve failed outside and fired water down the garden
also nice driveway
thenks
then it's not stealing
you steal it by not following the license
nobody pays attention to licenses tbh
that's not true
Yes they do... 🤨
yeah they do
People who don't pay attention to licenses are people who make poor decisions
a lot of people don't
if you violate my licenses I will violate you..r github account with a dmca notice
you won't
damn
Github receives DMCA notices all the time
yeah it's a pretty common thing
I don't know why you wouldn't follow a license
downloading code isn't a violation
tbf, that depends on the license
neither is an image
if you don't follow the license then it is
not really
@halcyon mantle it's not about you using the code, it's more HOW you use it
you can download stuff without knowledge
downloading pretty much anything is fine. Using it is another matter
I wanna address what you said because it's a common falsehood among pirates
of downloading it
my browser has probably downloaded it, so you are wrong @rough sapphire
well, there are cases where you are not allowed to see the data at all
such as movies
it's commonly used when people talk about streaming stuff, people claim that it's OK to stream things from unlicensed sources - the european courts have proven that isn't the case
@halcyon mantle
downloading code isn't a violation
neither is an image
Depending on the code it very well could be
but yeah it absolutely could be a violation
of course, it wouldn't be considered open source then, but
Image-wise, moreso even.
if the website you dl it from has it legally, you can download it generally, because well, you need to download to see it
well i've downloaded over a 1000 icons from flaticon, feel free to sue me xD
@halcyon mantle look we aren't against you, we are trying not to get you in trouble
@halcyon mantle I imagine those are free icons, or icons that require attribution?
some do some don't
if you want to go against the licensing of free assets go ahead, just understand that you will get in trouble
people do pay attention
Then what's the issue with attribution to the original creator?
all i know is there is a convenient X button
no but i cba to attribute for every fucking icon
if you intend to use these icons, make sure you have the license to do so.
if you just want them on your PC, there is not much to worry about, but do not screw around with licenses
It doesn't make much sense to expect others to follow the licenses for your own code, but disregard others.
what do you even want to do with the icons?
not much
@halcyon mantle
i never said that i have a license?
You did though. You said you have open source code. Which, by definition means it would have to be licensed as such: https://opensource.org/licenses
they are cool
Open source is not the same as source available
@rough sapphire there's no license file and i really couldn't care if anybody did use my code
you should obtain a license with everything, otherwise it defaults to ARR (depends on country)afaik
what is ARR
why would i upload my source code to github if i didn't want people to see it?
convenience, for the longest time private repos were not free
though you should really have a license in your GH repo
it is considered bad form to not have one
ye, for those it is fine
meh... i don't see myself getting sued for using the icons in my bot embed.. i'll be fine
and in my eyes.. code is more valuable than an image
@rough sapphire That makes sense, but legally speaking if someone comes in and uses code from one of your public repos and you haven't licensed it, and it becomes a big project, that causes issues.
@halcyon mantle 
Mind you, I'm not a lawyer. If you have questions about this kind of stuff, ask someone who is a laywer, and who's well versed in it.
as someone who can write code and not make images, images are much more valuable to me
Yeah because you can't make them
But how much help, and tools do you get given to you when making an image
Apply your logic about images to user interfaces
Does it change?
What about CPUs, or architecture?
That's pretty much their argument, yeah. They don't believe in attribution to the original creator(s).
Anyway, I've got a few things to do. So I'm going to go AFK
Hi folks, I am looking for quality French socks5 as an alternative of vip72 which can be used via firefox directly if possible, someone would have a tip please ?
why french?
need to be located here
