#development
1 messages · Page 67 of 1
@rancid nimbus yeah in java, objects are expensive
which is ironic
since it is OO
but instances are to be avoided if you can
let me rephrase
short lived objects are expensive.
What algorithm is used by computers to calculate logarithms?
I think I read about that in a Nvidia chip… I could be wrong.
You guys are all smart
That integer string len nonsense was just the first thing i thought of right away
Because its intuitive unlike log
Like the bot censors you?
Idk type it elsewhere and screenshot ig
how do u make a shell script
like the file or whatever
nvm
well, syntax error
oh
@peak acorn you put #!/bin/sh at the top, and start writing shell code
same goes for python or another language
o_O
for python convention is: #!/usr/bin/env python3
also known as a shebang
it tells a POSIX system what interpreter it should use
ill BRB i gotta DDU my computer before class
DDU it during class
start a fresh terminal
see if that fixes it
might have some trailing control characters
okay 👌 we got the drivers 🚙
im guesing the unicode doesnt work cos im in a windows wsl terminal
@peak acorn is that even the entire file?
crystal@watomat ~ touch test.sh
crystal@watomat ~ nano test.sh
crystal@watomat ~ chmod +x test.sh
crystal@watomat ~ ./test.sh
(standard_in) 1: syntax error
0
x \u25021
\u2500\u2500\u253c\u2500
1 \u25021
where
✘ crystal@watomat ~ zsh test.sh
(standard_in) 1: syntax error
0
x │1
──┼─
1 │1
crystal@watomat ~
@peak acorn running it with a different interpreter, it seems to do more
still a syntax error though, whatever that is
yeah
#!/bin/bash/ instead of #!/bin/sh
ubuntu uses dash for sh
limited subset of sh
oh
derp
behavior is the same https://i.imgur.com/BbwS7f6.png
got bored one day
randomly seeds your terminal with wat
when you do $ wat
@rancid nimbus ultimate troll on ubuntu systems is installing sl-h
its a terminal based steam locomotive
and if you mistype ls you get steamrolled
oh its got solid lines
@peak acorn do you not get solid lines??
ah
but unicode like that
should work on any terminal
any modern terminal
in this case, its just gnome-shell
it dont work on my wsl terminal
yeah because that is just windows command prompt
yea
This one is capable of those new features
well
its not really new
its just, microsoft has finally woken up
windows still shit because they dont have a single packet manager
win..get.. ?
@rancid nimbus yeah you do that as a visual prank
winget?
toilet
it renders text as ascii art
the reason toilet is so awesome
is cus on IRC you could look plug that into your client
with the --irc flag, you get proper color encodings
🤢 PS
it feels like you are writing .NET code
when you use PS
@rancid nimbus yeah but I think its kinda sad
that the most basic system interaction method, is this shit on windows
POSIX, and the unix philosophy make so much sense
like, programs use the shell to call other programs
and on windows the standard toolkit is incredibly limited
I wonder if MS didn't go POSIX because it would put some ofthem out of a job.
simple operations such as dd, can you do that from shell on windows?
logical conclusion.
this is why we have a crappy OS, that everyone uses
dd is unix
@rancid nimbus and no, it wont
because on windows, devices aren't files
Is there a way to use python for desktop app backend, and C# with windows forms for frontend?
but why
actually you can on cmd ... sorts of
it's called dir
@wary musk you can use some type of IPC
most common one is binding to 127.0.0.1 on some random port
and then running rest over it or something
the application, that you run, would spawn a child process, and designate a port it should use
that child process could be anything, a C# program or whatever, but it would use the port you pass as a parameter
and the parent then just has a client that connects to that port
can set up a TCP tunnel for bidirectional traffic
That sounds like sucha hassle
Yeah but why bother doing that whole thing
I'm giving him concrete working solutions for what he is trying to do
when u could probably just use c# to handle whatever u gotta
we're in #development bro
let me diagram it out
Even within a monolithic program you might use a similar approach between the back and front ends. The UDP/TCP connection is just an implementation detail, not actually hard to set up. Normally it's not like a full blown REST API though, you might use something lighter like protobuf or thrift
@wary musk https://i.imgur.com/OsKA7K1.png
this is one way you can do it
@autumn swan netty is quite nice for java
handles a buttonn of various TCP and UDP procotols
I'm gonna be honest, I've only seen thrift used for that purpose in Java (not that I'd strongly recommend it)
netty is proven, its industry standard for high throughput I/O
you can build your own packets with it
or implement some other protocol
make your own
Just going by that image, it does seem like a pretty complete general framework. Nice.
Its at the core of many webserver implementations in java
its also what the netcode for say, minecraft uses
@autumn swan thought you might find it interesting
those big minecraft servers, running proxies in front of the game
to cluster their server
most common one, bungee makes use of a specific subset from Netty
one of the benefits you can get on linux
allows the java process to interrupt on kernel events
whoever said native code is better than bytecode, can resign
Well, to be fair, for performance, that's because the kernel is pulling most of the weight in a lot of those cases 🙂
Which is absolutely fine. Use whatever good tools are available.
if you have a server that has many socket handles
then epoll speeds up multithreading
found this slide on google search
A previous company I worked at rolled their own little message passing thing with epoll IIRC. We thought it was unique, turned out it wasn't.
I mean, its not wrong, but the font doesn't help with the delivery
if it's all local though you might as well just use pipes
especially on linux--named pipes
@shy helm I believe thats what they did in bungee
all the proxy -> internal minecraft server traffic is handled by epoll
it relays traffic between the two pipes
and it allows things like protocol injection :D
you can hack your server even more with that
like have global messages or do other trickery to clients
comic sans lmfao
Apple / Linux question
New employer, strongly wants me to use macOS but I have the option to use Linux (and would be the only one doing so). Not against it entirely (used to be my fave OS), but I have a new concern. How's the Docker experience and such on the Apple M1 silicon?
My position is in testing, which might involve orchestrating a stack locally (M1) instead of in the cloud (x86-64). I'd rather be able to draw some similar performance conclusions and such rather than it be quirk of x86 emulation, y'know? And I'd also rather not need to go through extra steps just to get something executing natively on the Mac.
Is there anything genuine to worry about there, or not really?
why would you run a linux OS on apple silicon?
No sorry, I have a choice between running macOS on M1 silicon, or getting a ThinkPad and running Linux on that basically
@autumn swan crosscompiling is a thing
and pretty sure you can just build docker images for a target platform
I'm aware crosscompiling and such are a thing, but I'd rather not test a platform we don't run on, right? We'd be running in the cloud on x86, not m1
yeah, so it makes more sense running that on your development system too
The devs all run macOS, but the devs don't test (or rather, run unit tests and depend on a hosted stack for end-to-end testing)
Basically I know it's possible I can get it to all run on an M1 mac, I just don't know if it's wise to at the moment
And that's the part I'm wondering about
I develop on linux for linux
Most of their employees are running on Intel macs, I'd be one of the first on M1 macs. I've worked for a lot of companies that targeted Linux servers but developed on Macs, which was mostly fine with Docker. But that was the good ol' Intel days
you wouldn't really be able to fully test a docker meant for x86 on arm
seems like you'll need an x86 cloud docker test environment if you're using an m1 macbook
high level code dont really care about whats underneath
So it seems the consensus is a bit mixed. Maybe I'll YOLO onto an M1 mac and report my experience a couple months later. Worst case scenario is I learn something and the company needs to move away from Macs I guess?
You should be testing your code in the same environment as production regardless
so having a cloud test docker is a good idea either way
Yeah I'm gonna be clear I have a suspicion there's a risk with the M1 macs, but I'm happy to be proven everything will be fine. I'll miss my Linux env greatly though.
As for where I "should" be testing, yeah, I know. Ultimately the ideal will be done. I have a lot of non-ideals to sort out before we get there though.
Could you ask for an intel Mac?
Nope, the price ain't right for those anymore
minecraft, or discrete structures homework?
Homework.
Yeah I'm never fun at parties
lets see what this shit is
"estimate 13 min duration" we'll see about that
oh maybe its not os bad
Hello. This may be a rookie question...But how do you guys configure the $HOME/.bashrc in Ubuntu? 'Coz everytime I try to 'open'/run this particular software, it always ask me to set the environment variables and stuff each time I re-open a new shell ^^
What are you trying to configure in it? Normally you'd open it in an editor, and then log out/in for the changes to take effect
you may need to source your rc file
So, I'm trying to set the path for this SDK (export MESASDK_ROOT=~/mesasdk) and initialize the SDK (source $MESASDK_ROOT/bin/mesasdk_init.sh)...Right afterwards, set the path for the software directory (export MESA_DIR=~/MESAR10108) and the number of cores (export OMP_NUM_THREADS=6).
So this SDK is called MESASDK http://www.astro.wisc.edu/~townsend/static.php?ref=mesasdk and the software is called MESA http://mesa.sourceforge.net/prereqs.html...
I tried this and it didn't work lol...
I'm trying to 'configure' it so that there's no need to re-define them each time I re-open a shell lol. :c
You would basically put those same lines that you run at the bottom of the .bashrc. You can edit it with pico or vim or whatever you'd like.
Alternatively you could put them in a new file, ~/.bash_profile. This is automatically sourced if it exists. I prefer this approach, leaving .bashrc untouched.
oh ok. It works 🙂 Thanks
Anyone have experiance with Verizon with CS
Whatcha mean?
Like working at Verizon?
@shy helm job opportunity? :D
I bet working at their callcenters is engaging and exciting: have you restarted your modem?
Verizon customer service is famously terrible
@quiet gulch so is every consumer ISP
I have the luck of finally having a corporate ISP
their service team actually speaks jargon
Verizon's is bad for everyone though
Like, at least Comcast can walk my mom through logging into the router admin panel
I don't expect any ISP to be able to communicate meaningfully with me but I did at least live my life knowing my family probably wouldn't call me with a question every 3 days
Sorry, clarity of language xD
But Verizon, in her and my experience, just puts you on hold for three hours and then has a robot pick up at the end
who gave that monkey an ipad
I have verizon for the fiber, In my experience the tech was pretty good, especially with use your own router thing. Let me run a speedtest on the laptop to verify it works and that's it.
optimum isn't much better tbh
Yeah, for someone technically literate it's fine, because the fiber is superb, as you said.
I pay for 200 mbps and I get like 400 both ways, it's hilarious
I have 250/250 here
what? fios?
lucky
Mhm
we pay for 300/300 and that's what I get exactly
9 public addresses :D
I wish
I mean, either way it's not like I'm frequently exhausting that bandwidth
yeah
pacman isn't exactly heavyweight :P
who needs port forwarding, if you can have a public IP :D
👀
yep
@midnight wind lol this is the best thing though :D
Two tenants in other buildings are on these VLANs
they pay me for 50mbit/s
who needs port forwarding when you have ipv6 as well
but most of the time, line is idle xD
Tor doesn't support ipv6 though :(
@midnight wind I have my 6to4 tunnel disabled
I could enable it, but since I've yet to complete my full certification
HE only gives me ~50mbit/s
after I finish certifications, I should get the full fat pipe
yeah I have it on it's own vlan
@midnight wind here its a dual stack configurationb
NAT'ed v4, public v6
with firewall rules
urgh one day I need to troubleshoot why it's so slow
It's dual stack but on it's own vlan
no one is currently on that vlan
for some reason ipv6 is SLOW
like less than 1mbps
probably because my ISP peers with HE directly
Wow
Oh goodness I have one of these
Well rather my room's is that, and the actual building's networking server is several different 20 switch switch boxes
@cloud portal I'm a big fan of mikrotiks
after having ditched consumer routers such as tplink and asus, glad I found mikrotik
very capable, and easy to use*
goofy little router
@peak acorn its the smallest one they have
but with 300mbit/s routing on 3 ports, what more do you want ? :D
nah i mean its fine
its just funny cos its small and maybe a little ugly
subjective last part
exactly like my drawing
porcupine box
10G ftw
this is small-medium ISP level
sheesh
speed.
that's a full fledge ethernet router
with 12x 10G
@peak acorn but the cool thing with mikrotik
that smallest one I posted
runs the same OS as the big one
at that level you do dynamic routing right?
hm
@midnight wind BGP and MPLS probably
idk, I'm not an expert on that .. yet
@midnight wind it would certainly make for a nice PPPoE server
ppp
I know the theory and concept of BGP
none of the specifics
@midnight wind what model is that exactly?
you know it's serious when it's got redundant power
more than 10G right?
1U rackmount, 1x Gigabit Ethernet, 8xSFP+ cages, LCD, 72 cores x 1GHz CPU, 16GB RAM, up to 120 million packets per second, 80Gbps throughput, RouterOS L6
This one has like double the throughput of that CCR2004
though, no QSFP or SFP28
ah
@midnight wind yeah..
it makes huuge difference
CCR2004 IPsec speed: 3gbit/s
CCR1072 can do 10gbit/s
The CRS305, with its 4x 10G ports also has redundant power
ah
@midnight wind lol every picture of where I see this switch deployed, I see them putting fans on it
even though it doesnt get that hot

those SFP modules can get hot
don't copper sfp+ make it hot
@midnight wind those laser modules also get warm
but the CRS305 is passively cooled
yeah, here's another one of those :
like, waht xD
question, i bought the physical copy of this C book (https://archive.org/details/learningtoprogra00plum/mode/2up) that I found on archive.org
I was wondering that If I read through this book, would I be learning deprecated methods of C coding due to its age?
also my reasoning for buying the book was that I liked paper and that "If people still use K&R C to learn C, why not this book?"
well what standard of C?
that's C99?
if it's not even C99, you may be missing out on a lot
after looking at the publishing info, I found that it predates K&R C by 4 years
@lone hornet Dennis Ritchie's original handbook on C, has been reprinted and updated throughout the years
I believe there are C99 books too
though that book
is not really introductory
but this is the book by the guys who made the language
Idk i just can't deal with tiny routers, feels so weirddd
I like my routers big with many antenna
This is the only book on C you will ever need.
im sitting here going through the slowest e-book on c ever
This is legit an entire like sub-point in the chapter, im not reading it obviously but this is how much pointless stuff is in this thing
I do have a pdf copy of the second edition C programming language. In addition, I do also have another e-book of "modern c" that was made a couple of years ago. I guess if I want to avoid confusion then I'd would have to read through those books I've mentioned rather than reading a book that hasn't been updated in the past years
@peak acorn seems like a politically motivated book ;)
loop midi and hairless midi
i need to run these two applications on small system
my experience is limited to me thinking of right now downloading windows on a raspberry pi and running the two .exe's
who can help
use wine
if it just uses normal windows api calls then it should work via wine
what is wine
actually
an os?
this?
one sec
Open Source Software for running Windows applications on other operating systems.
I can tell you what wine is not
its from a long time ago
i have no clue i dont think i got it from github
i also need to run loopMIDI though
yeah so that can run on linux nativly
https://www.tobias-erichsen.de/software/loopmidi.html what about this?
What is your goal?
ive got my whole system working rn
so midi data goes from piano into pc
in pc it goes hairless midi to loop midi
sending an output to an arduino
i wanna get the 'pc part' (hairless midi and loopmidi) and make it smaller
This might work http://www.varal.org/ttymidi/
that looks better
So you're using a computer to receive midi from a keyboard and pass it over serial to an arduino?
yes
usb into computer, usb out into arduino
this varal thing looks interesting ill have to read int oit
If you want to use a PI you'd use linux and there definitely exists the set of programs to get it to work.
i'd use anything thats smaller than my desktop pc
is there anything else which is more appropriate than a pi?
i wanna turn this portable basically
i had a method which relied on an optoisolation circuit turning direct midi into serial but it was too complicated
why bother with all this lol
get a raspberry pi and a midi controller
nitty gritty hardware implementation, I've done this with DMX before, and its not fun
had to write assembler to get the timing right
hello
Only a sub-point of the chapter? I could write an entire chapter on that!
Intuitively readable code matters immensely when working with others
Hey! We are conducting a research study for our project on Design of Interactive Systems. It will take at most 2 minutes to complete. https://docs.google.com/forms/d/e/1FAIpQLSedesYBJyx_v_VCY95sFc05rFKb940ffNaGtO1Vp8Wr_V6Sgw/viewform?usp=sf_link Thanks for your response.
its not about readability, its like, just about whitespace, lol
idk just pointless details
skipped it anyways
Well, I mean... depending on the language, it will matter to some extent even for being syntactically valid.
bash for example is a good way to break your brain at first. FOO=1 does what you think, FOO = 1 does not.
its C
The syntax highlighting in editors has saved me so much time with bash variables lol. The good ones wont highlight stuff like variables unless the syntax is right and I always forget at first
The most idiotic thing about bash is not permitting spaces after variable assignment 😦
FOO=bah is okay
FOO = bah is OMG WTF ARE YOU DOING?!
It's not lost on me that I used 'bah' not 'bar' - even my high-level examples have bugs. Feel free to submit a pull request.
Bah
huzzah I finally got some stupid api and library set up to do ethereum stuff with java
Networking, when you have never seen networking code before, isnt very easy q_q
Oh, that shouldn't be that bad unless your writing your own tcp library.
no
just using included library stuff
but i got no clue what im doing heehee
school has not taught me well
I had written a TCP parsing algorithm.
lol
ok big boy programmer
im tryna write some little code to log everyone whos on my school servers and then aggregate it on one of the machines thru the network
I wouldn't do that if I were you. You could get in trouble for some stupid reason and be asked to explain why you were doing what your doing. The people who you would have to explain it to would be hard to convince it was innocent.
It should be easy to do if it were bash. Just do some list processes then get the usernames then write them to a database or server. I had done that for my personal machines one (I wanted to see if I left a root shell open on any of my machines.
well im kinda a moron so thats kinda what im doing lol
executing 'w' and then finding the username columns
Yea I dont want the uni gestapo showing up so i suppose I wont
That is an interesting command. I never knew it existed. That doesn't show my root shell though.
theres also who but im not rly sure what the difference is besides slightly different info
PFFT there's software for this already
well
i dont know what that software is
All i wanna see is a little chart of the spikes on friday at midnight when everyone is trying to do their homework
Cain and Abel 😛
is the classic ARP spoofing/sniffing/posioning tool
all the l33t h4x0rs use it
too complicated
im not tryna leet hacks just see goofy graphs
networking is a whole ass thing tho aint it
like u gotta do multithreading and all this jazz to do cool stuff
i dont even know how to do that lmfao
Easiest way in Java is to use executors and synchronized queues to pass messages
so you basically just create a bunch of Runnable classes which have shared queues to pass messages between them
so like Class A might be responsible for reading data from the network, each time it gets data it uses a queue to send it to some receiver Class B, which is waiting for data on the queue, which dequeues the data and processes it, etc
yheah idkkk i might look into networking later just cos its kinda cool to learn
probably useful to know about at the very minimum
god knows sckool aint teaching me shit
What happens that triggered it?
Hey guys I had a question
This question may have been answered before , but please bare me as I’m a new member
Can someone send me a course / site where I can learn flutter ??
There are lots of tutorials on YouTube and flutter.dev does also have a lot of good documentation starting from: https://flutter.dev/docs
I would properly recommend learning Dart first
Ohk thanks mate
The Flutter channel on YouTube actually has a lot of good quick videos. They're very nice for learning a bunch of components quickly
see through smart glasses time
can someone help find me a good see through screen
Do you know how to solve a recurrence relationship?
no thats exactly what we're on about rn in class lol
ah lol
so i googled it but no clue why
but
this kinda explains it
found that after a while
yeah
that's the simple explanation, there's log n depth when you divide by 2
and at each level you do n work
so you do n work log n times
therefore it's O(nlogn)
good stuf
A "lazy way" to look at runtime complexity is by taking the limit of the division of the two functions
im stupid as hell lel
havent done real math in almost a year 💀
and you know that if f(n) belongs to o(g(n)) then f(n) belongs to O(g(n))
It’s ok no one in the real world does math, just wolframalpha
lol
its kinda a weird point in my classes because we actually do this stuff later into the semester in class discrete mathematics or w/e. but we are currently talking about the complexities in data structures, before we actually are doing the math for these complexities in discrete math
In the analysis of algorithms, the master theorem for divide-and-conquer recurrences provides an asymptotic analysis (using Big O notation) for recurrence relations of types that occur in the analysis of many divide and conquer algorithms. The approach was first presented by Jon Bentley, Dorothea Haken, and James B. Saxe in 1980, where it was de...
llinear complexity
that's what big-o notation basically means
useful information on how something scales
@peak acorn that's a rough estimate, usually done by looking at internal loops in a function
if its a straight lookup, like a hashtable, its O(1)
a single loop would be O(n)
and if you for exampling drawing a 2d image
that runtime complexity would in the order of O(n^2)
in this case you have two dimensions, so you can flatten this down to O(n) again
and then logarithmic, for algorithms, which halve their work each step
like mergesort I believe
@peak acorn https://en.wikipedia.org/wiki/Time_complexity
In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by the algorithm, supposing that each elementary operation takes a fixed amount of time to perform. Thus,...
This is what you are looking for
n in this context, always means the size of your dataset
be it, a list
n-amount of items in a list
Its not about specfically using this, in calculations, but its to give some theoretical grip on the time it takes for your code to run
and can be important when designing software, and choosing the right datastructures
for example, if you have a list of items, and you want fast access to a specific element in that list
You better have an array, because a linked list would be O(n), instead of O(1)
Yes that too. I the math formula above and the my link posted had an explanation of why it it that way in the CS analysis of algorithms master theorem
Someone else linked me that 'master theorem' in a different discord haha
shits craaazy
Also, not every loop counts because to apply a Gaussian filter to a decompressed immage is only O(n) with n being the pixel count not O(n^2). It loops over a few pixles to the left and right each time. That would amount to basically a constant and that is why that gets removed. It's basically how it runs at scale. With the common n stands for the size of the input.
uhhhh wat
so
For this filter function you are saying what, You only modify a few pixels per row is that it?
idek that algorithm sooo
I was saying that n is the input size which is height *width.
yes
If you take an immage that it twice the size it would take twice the size or there about because start up time and compression.
for i in len(image): <- n height of image
for i in blah: <- c calculated, but is bound by some constant
Runtime complexity is technically O(nc), but since c is strictly bound by some constant, O(nc) <= O(n)
That's a nicer way of putting what I said I guess.
There's lots of fun analysis like this in runtime complexity
input := get_user_input() // Assume O(1)
letter_count = LinkedList(26)
for let in input:
letter_count[let] = letter_count[let] + 1
print letter_count
here's some fun pseudo code
isnt accessing arbitrary values in a linkedlist bad bad
yes, haha
never do it
But the point of the pseudo code was to display the oddities of big-O
technically it's O(len(linked list)) to do that, but here len(linked list) <= 26
So should the code be considered to be O(len(linked list) * len(input)) ?
Should this be reduced to O(26 * n)?
and further O(n)?
yessir
For every letter in input (N times)
find letter (len(linkedlist)) and add 1 (could be another slow linkedlist get but idk about that, otherwise constant)
It would be O(n)
definitely o(n) but u sounding like its a trick
heh, it's not really a trick
it's just understanding part of the definition of Big O
for example, these two code segments are the same big O:
for i in range(0, n)
for i in range(0, n)
for i in range(0, n)
for i in range(0, n)
for i in range(0, n)
Even though one is strictly 4 times faster than the other
I need to go google the precise definitions of what my teachers means in his words because he uses theta(?) instead of O describing stuff at least rn
and omega idek what they all are because later he said they are all equal so
lmfao. . . errr
that's the formal definitions of the asymptotic notations
they're all defined similarly, big O is | f(n) | <= c | g(n) |
what is with the | bars | everywhere
is that meaning abs value everywhere
just looks weird
yea
lots of math theorems have ABSs everywhere
if you're studying CS you'll see lots of them in the first two years
less math in upper years
Hello, I need some help with documenting python function, in js I would do something like this
/*
*Print out name
*@param {string} name The name of the person to print
*/
function(name){
console.log(name)
}
What is the python equivalent, can't really find anything online
Does it even exist
docstrings
thanks, thats the name
I'd specifically recommend the Google-style docstring format - they're the most concise and naturally readable.
See here for examples: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
thx
Is there no official python standard for this?
apparently not?
yeah it's nice
this is what I did in the end
def drawTriangle(tt, x, y, height, width, color):
'''Draw a Triangle
Parameters:
tt: Turtle object
x (int): X cordinate
y (int): Y cordinate
height (int): Height of the triangle to draw
width (int): Width of the triangle to draw
color (str): Color of the fill
'''
tt.penup()
tt.goto(x, y)
if(color):
tt.fillcolor(color)
tt.begin_fill()
tt.pendown()
tt.goto(x+width/2, y+height)
tt.goto(x+width, y)
tt.goto(x, y)
if(color):
tt.end_fill()
inside the method body? really
I'm having some fun in .NET rn
meanwhile
it's SO basic
public partial class CustomerPricing {
public static bool operator ==(CustomerPricing a, CustomerPricing b) {
if (a == null || b == null) return false;
return a.customerId == b.customerId && a.productionType == b.productionType &&
a.packagingType == b.packagingType && a.weightClass == b.weightClass;
}
public static bool operator !=(CustomerPricing a, CustomerPricing b) {
return !(a == b);
}
}
operator overloading xD
ah
so you can do objectA != objectB
and not have to check 4 fields
java requires you to implement equals()
tbh if java had operator overloading id probably use it quite a bit more (along with better generics) but ive kinda moved on to c# at this point
better generics?
Operator overloading has its perks
but it also makes for messy code
java does some weird stuff with generics in terms of compilation that make it more restricted afaik
I wish java had an object indexer
thats like the only thing i wish for
they already improved properties like the way .NET does it, with record
@midnight wind kek https://i.imgur.com/xfkyb6E.png
this is what java makes me do ^
generate all the boilerplate!
nice
I have a bunch more of those oneliners
did they give you a name?
they basically want you to provide http://someip/file
@midnight wind is this HE certification?
yeah
@midnight wind yeah just run a webserver on your v6 address
and put that file in the root of your webserver
ok
they just want to check, if you can run a webserver on v6
@midnight wind it gets better
next step: create a mailserver.
Thats where I gave up
PAPERTIGERS
leggo
@midnight wind lol one thing I love about the 6to4 tunnel with HE
you can just have them generate the configuration commands for mikrotik :D
does my desktop need to be ipv6 enabled or just my server @warm sleet
@midnight wind are you using a tik?
nope
oh
ER-X
well, you're supposed to use ND
ND?
Neighbor discovery protocol
oh
The Neighbor Discovery Protocol (NDP, ND) is a protocol in the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the link layer of the Internet model, and is responsible for gathering various information required for internet communication, including the configuration of local connections and the domain name s...
Its for SLAACv6
local devices, should automatically receive a public IP on your prefix
@midnight wind I'm a bit rusty when it comes to the specifics
6to4 is disabled rn, so its blank up here
it just advertises this
@midnight wind or use dhcpv6
SLAAC is easier
nice public IPs
@midnight wind lets move to #networking
before we scare the developers
why was there nested trys there lol
connecting to the database could throw an exception but if that succeeds then creating a SQL command could also throw an exception
exceptionception
im pretty sure im the only one who has the idea to use private git repos to keep my school work in order and i still dont know why
Its such an easy solution and whenever you have group projects its perfect for that
specifically for my CS classes but I do it for every class
im pretty sure im the only one
based on what
you're the only one in your group of friends?
based on the fact that my teacher mentioned git and nobody knew how to use it
Bold of you to assume I have friends
Git wasn't part of my curricula.
But I taught my friends about it, and we've used it ever since
👀 I have been trapped
Whenever I have code group projects I always beg and plead for them to use git
y'all are on windows, there is a nice easy af gui. just uuuse it
those suck
ewww
I taught my friends git commands
Some of these people didnt show how to ssh or anything like that I cant expect them to be able to know like what the or 4 main git commands
O.o

GitHub was the default for me
Course staff even had GitHub accounts we could add to our group repos for auto marking
👌🏼
Git was fine, but it my early years of uni. most source code can be confined in 1/2 source files.
So we even have someone to "compile" the code
Ooof multiple people working on the same file 🙅🏼♂️
My first half of second year I had my first real taste of a group project—we had to make a VIM clone
In my 2nd year, I already taught my teammates about git
though they don't appreciate it that much
I reckon it's because of merge conflicts
Oof, I feel like we had a tutorial on git at some point in my lower years
Just cause it’s so essential
shudder
It's essential
but when I had my internship, they are used to SVM (i think)
So I also had to help our team
they are only migrating to git, so I became the PR approver

Ohhh I had that too
We had a giant SVN repo, we were moving code to git and config to perforce
I too taught my team about PR reviews 😂
My boomer ass java teacher mentioned using svn one day lol
I remember just like it was yesterday using tortoise svn to download gmod addons.
if your teacher suggests using SVN. you should tell him that he is living in the past.
and that no developer in their right mind, would ever use SVN.
And if he questions your opinion. tell him that SVN tracks files, instead of content.
what do you recommend ?
GitHub, GitLab, etc

I just write my code in a google document automatically versions!
In my third year of my CS degree I tried to use git for a group project.
My teammates had no idea how to use git.
@vital blaze I took it upon myself with projects, to teach my coworkers on how to use git.
Once they understand that git tracks content, instead of files. Things become much easier.
I tried to explain it
using SVN because your coworkers cant figure out git, is so stupid
@vital blaze my previous employer was using svn, and I for the life of me, couldnt properly do merges and such
so I actually used git locally to do merges
- import SVN to git
- Commit a branch with the changes
- Merge
- Export back to SVN

SVN doesnt do merges.
SVN doesnt have branches.
The diffs it does, are over the entire filetree, it completely ignores any previous merges.
idek why its called a version control system
Git is smart enough to automatically do 3-way merges on existing files
Because it is a version control system, and there are ways to do similar enough things in SVN that one would do in git (not down to the details, but overall approach). I vastly prefer git, but SVN was fine and did the job.
@autumn swan if you save a file, without changing content SVN sees this as a change.
And for a version control system, that manages source code, its completely inappropriate.
TFS suffers from the same kind of idiocy.
wait, they renamed it
its now called 'Azure DevOps Server'
I have quite literally never run into this problem, nor any negative impact from it.
Again, not saying it's better than git, but "completely inappropriate" is a bit strong. It definitely is a revision control system, and is definitely better than not using anything.
Merge conflicts, when there aren't any conflicts.
@autumn swan also, if you create a "branch" (its not a branch) on SVN, its just a copy of the existing filetree.
There's no transparency and audit trail to who wrote what line.
There is. There absolutely is. Maybe your experience was different for some reason. You wouldn't want to use SVN exactly like git.
And next time your coworkerer checks in
they first have to download your entire "branch"
Linus torvalds actually had a talk at googleplex many years ago
explaining the brainrot that SVN causes
and why it, and other version control systems aren't as successful as git
SVN for opensource makes no sense. Because there's no audit trail
git commits are a blockchain
you can't mess with older commits, to try and spoof the other users
well maybe not true blockchain
In cryptography and computer science, a hash tree or Merkle tree is a tree in which every leaf node is labelled with the cryptographic hash of a data block, and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes. Hash trees allow efficient and secure verification of the contents of large data structures....
To be fair, you have to recognise Linus's bias there :)
I feel like you're trying to convince us/me SVN is worse than git. I agree, you don't need to dump on SVN to prove that point. I'm just saying it's not absolutely useless and garbage.
@autumn swan sure, linus was biased heavily here. And I acknowledge that
and I am probably preaching to the choir here
Absolutely
But yeah, there's some fundamental architectural differences between git and svn, that may be worthwhile to explain
since these are inherent in other source control systems too
be it Mercurial, Perforce, CVS and the likes
and lets not forget
Bitkeeper
the spiritual predecessor of git
@autumn swan only argument I used to make in favor of SVN, was that it was easier to track large binary files with
but that has been superseded by git-lfs
Finally got a job after over a year of looking.
2 days later, someone reaches out for a role that is far more interesting and double the pay (but is a language I don't like using for the job).
F
rip
+1 have never seen this happen, you can def diff files to see changes, SVN only showed files with line changes as being commitable
SVN blame exists
have fun "merging"
I've done it, it's fine--kinda similar to git
the workflow is just different from git (which I prefer)
to clarify, if you try to commit a file that's out of date it will reject, then you svn up to get the external changes and if it can't be merged automatically it will provide you with a whole: "Conflict discovered in file X: postpone (p), diff (df), edit (e), etc"
There are no real branches
P inserts diff tags exactly like git, e inserts tags and opens the file in your default editor to fix immediately
when you have two branches that have been merged before
and then pull those changes onto your own tree
it doesnt have the same merge conflicts again
since they had already been merged before.
3 way merging on svn is incredibly painful
because it doesn't know about the lines that were merged before
because it only merges file versions, it is not aware of what lines were part of what merge.
this is the whole debate between tracking content vs files
Again, I've never had these issues, because we used SVN with a different workflow then we use Git
avoiding 3-way merge problems
no, fundamentally
svn is way different than git
in that, svn tracks files, and looks only at metadata
whereas, git tracks the content of the files themselves.
That's why I said that I think that svn is inappropriate for sourcecode
because with source, you want to track the content
if you open a file, and press save
svn sees this as a change
git does not.
Was there some statement regarding using SVN for open source? I don't know anyone doing that. Especially because it's mostly on GitHub, which by definition, is using git.
Anyways, yes, again, you need to use SVN and git different from each other. The issues you're saying SVN has, others don't seem to have run into. Maybe your editor was modifying line endings or whitespace for example.
Recruiter: "So they're a Java shop... really lacking in JavaScript, so they're looking to hire... they also do Node and some React, but mostly JavaScript"
help
blank file commited
opened blank and saved (confirmed the modified date changed)
svn status -> no changes
added line
svn status -> file modified
Can also SVN blame the file and it shows which revision each line of the file comes from and who commited it ("C")
no one has disagreed with you that they're fundamentally different version control software (in contrast I think everyone has ackowledged that they have very different work flows), we're just pointing out some of the things you're saying about SVN are incorrect
Anyone here pretty good with SQL stuff?
@shy helm workflows arent even the interesting thing, Git's internal storage is completely different than that from svn
but I see the svn brainrot is real
There is absolutely no need to make a personal attack. Again, everyone agrees SVN is different. Being different means different workflows are better suited to each one.
by using svn, you subject more people to this ancient curse of a technology, go ahead. I'm not using it xD
thankfully git-svn is a thing.
Someone might be; if you have a question, best to just ask it so people can chime in with what they know
So what I'm needing to do is list the ssn, first name, and last name of all patients who have ever had a consultation with a certain doctor, then list them in ascending order from patients last name while avoiding duplications, I have the avoiding duplications part and the ascending part down and even listing the ssn first name and last name of the patients, but I can't figure out how to make it to where its only those patients who have seen that doctor
Right now when I run my query its just pulling 1 of each patient and assigning that certain doctor
Is this real info or homework?
Homework, wouldn't be posting this stuff with real info lol
Would 10000% violate all sorts of laws
Would hope so but it's been done 🙂
I think you're missing a join of some sort. Have you gone over those at all?
I'd love to use join but my professor won't let us
Say what now. Uhhh.
I'll be honest that SQL is not my strongest point, but this seems impossible without a join unless a Consultation entry contains all that info without needing a join (which would probably be bad DB design, but it's a course so that's possible)
Consultation contains the the physician ID and patientSSN
So probably is a bad DB design
No, that's fine. But you'd need to join those keys (I assume they're keys) with their respective tables to get the other info and match it up, right?
I believe that is where the WHERE comes in on my work so far
Oh hang on. I think I get it. But I'll have to defer to someone else because I'd just me making stuff up from here on.
Because that I believe is where the data is all being "joined" together from what I'm understanding
I mean, anything helps lol
I'ma look up some stuff on foreign keys, gimme a sec
So what I was looking up is if there's implied joining with foreign keys (which would've blown my mind), but it doesn't look like that's a thing. So I haven't got a clue.
I want to say that there is implied joining mostly because of the db design posted by my professor
Not 100% sure though obvi
I don't understand your prof's point of "using the join clause doesn't show where we establish our links at", unless what they meant was foreign keys are the way to show those links (and indeed it is a good thing/way to do so). But using foreign keys, AFAIK, does not mean that you do not use joins.
Hmm. Does your week 5 content show something like the first answer here? https://dba.stackexchange.com/questions/212200/how-do-i-do-a-join-in-ansi-sql-89-syntax
(noting the, uh, DO NOT DO THIS EVER, but hey, coursework, cool)
Guess what, it only shows stuff from the DO NOT DO THIS EVER lol
Love this professor
/s
Yeah that's pretty much how programming education goes tbh
Had a friend say something about using a subquery in the where clause
But not 100% sure how to implement that in there
hah, so I just tried to download the Coco training datasets from their website, using Chrome... which chrome blocked and wouldn't let me download claiming it was "malicious". Thanks Google, hindering machine learning 😄
Tried a subquery on the Where clause, got the exact same result as before without the subquery
as a subselect?
what database platofmr does this have to run on?
Thanks... lol
Figured it out, didn't need the . in PhysicianID
Help. . .
temp = val;
for(placeValueBase16 = 4096; placeValueBase16 >= 1; placeValueBase16 /= 16)
{
switch(temp / placeValueBase16)
{
case 0:
printf("0");
break;
case 1:
printf("1");
break;
case 2:
printf("2");
break;
case 3:
printf("3");
break;
case 4:
printf("4");
break;
case 5:
printf("5");
break;
case 6:
printf("6");
break;
case 7:
printf("7");
break;
case 8:
printf("8");
break;
case 9:
printf("9");
break;
case 10:
printf("A");
break;
case 11:
printf("B");
break;
case 12:
printf("C");
break;
case 13:
printf("D");
break;
case 14:
printf("E");
break;
case 15:
printf("F");
break;
default:
printf(" ");
break;
}
temp %= placeValueBase16;
}
printf("\n");
return 0;
How do I un-ugly it. Its in C. No extra function calls, variables, or for loops. Profs orders q_q
Look up the formatting tokens you can use for printf (like %d and such, but there's one that will be very useful for you)
But now you're smarter than you were 5 minutes earlier, and that's what it's all about :)
😎
baited
I have not really learned how to use C yet
kinda just
makin it work and submitting hehe
use a look up table
😬
Ok, if number is sub 9 you added the number to '0' else if it is less than 15 subtract 10 from the number and add it to 'A'.
Else maybe just print a space.
That's my approach. What is it supposed to do?
print out number in hex
Not that I think about it this assignment barely makes any sense
Maybe i shouldnt use prinf("%X")
because then I could just do printf("%X", val); and be done with it
which seems like not the way he intends
Yeah it’s probably not haha
Yea it's probably not
Also the easy way to do int to char is just assignment with a cast
int singleint = 0
char intchar = (char) singleint + ‘0’
Similarly for the other hex values
char overNineHexChar = (char) singleint + (‘A’ - 10)
Chars are just 1 byte ints in c 😉
In your case, I'd just ask the prof if it's alright to use %x. No point in leaving it ambiguous, and I've learned the hard way that doing the unexpected but more correct thing doesn't mean your prof will be happy.
So what I said earlier?
Ok. Maybe.
I think I written bytes to hex converter in assembly before and used that if less than 10 char '0' plus number else 'A' +(number -10). It seems like something I would have done.
Too late to ask that the prob
i need help in programming please help anyone???
bash
just use character array
@pseudo laurel we are going to need a LOT more to go on than just “help”, “programming”, and “bash”. A.K.A. Expected arguments, but received $null
people just love asking to ask
and I hate it more every time
LOL. I understand completely.
Now I'm at the point where I ignore them completely
that's not good, but ehh
I agree, that's where a form helps
Like
"whats the problem"
"what have you tried"
etc tec
so we can get past the normal
have you tried restarting
That's what I hate
it's like you have to put the effort to help them
they need to be reminded, they need you. not the other way around
But I think I’m off topic now. 😦 needed to vent at this ungodly hour I guess. Can’t sleep anyway.
It's alright, we vent on the same thing
it's frustrating but I still need to try to help them
re-installing their IDE
That's the pinnacle
I might be misunderstanding something, but I’ve found GUI editors for like, WinForms to be waaaay easier to use than trying to hand-code stuff.
Well, it's up to you really
also I don't know any for python
since I hand-code gui

I have a GUI program written in Powershell and WinForms that has a few tabs and a lot of links and text boxes and such. Hand coding their placement is a bit of a nightmare. Especially if I want to try different layouts and configurations.
WinForms
I normally use vstudio gui editor
It’s pretty nice to be able to click and drag items around using AdminScriotEditor. But it’s a depreciated program.
But it’s a depreciated program.
That's a code for
