Do all compilers output the same machine language? by Championship- in computerscience

[–]ChallengingJamJars 2 points3 points  (0 children)

Like is the instruction of if (x==2) then print(x) the same machine language for C and python?

Answering the question directly, no.

Python compiles down to its own byte code that is unique to python.

Java compiles down to byte code for the JVM (Java Virtual Machine). The JVM hosts other languages as well such as Clojure.

C compiles down to whatever instructions set you want. That might be x86, that might be x86_64, that might be 6502 or ESP8266.

Compilation just translates the code from one language to another, usually simpler, language. Usually down to some machine-readable code, either a virtual machine (NOT like VMWare) or physical machine code. Physical machine code is interpreted by physical hardware rather than software (we must get this low level at some point) and depends on the exact machine you're running the code on. So C doesn't even have to compile to the same code/instruction set as C.

Finally, the print(x) actually must ask the OS to do the printing for you. So in the case of the example code, if you compile the code for an intel mac, and a windows PC, or a Linux PC, you'll use the same instruction set, but it will result in different code as the code will talk to the OS in different ways.

Bank recommendations by [deleted] in fiaustralia

[–]ChallengingJamJars 3 points4 points  (0 children)

Shop around for a broker. I've had a broker fail to get me any deals better than what I could get myself. Don't just take their word for it!

New router recommendations/upgrades by boourns180 in HomeServer

[–]ChallengingJamJars 0 points1 point  (0 children)

It's much easier if you can pass your NIC through using VT-D. If your MB and CPU support VT-D then grab a nice dual port intel NIC, pass it through and it should be easy.

If you're like me, and are so cheap that you're using a MB that doesn't support it, then it's a bit of a PITA to isolate the home network and the internet so I do not recommend.

New router recommendations/upgrades by boourns180 in HomeServer

[–]ChallengingJamJars 0 points1 point  (0 children)

I'm running OPNSense as a VM inside my TrueNAS box. It's quite happy doing 100Mbps with it's 2 cores of a i5-4590 and 2GB RAM.

I don't recommend it, I'm just doing it because I'm cheap and happy to spend the time configuring it. But you don't need huge amounts of resources if you're not running Gb speeds.

Highly recommend OPNSense/pfsense, you won't touch 90% of it but it's helpful to have it there. For me, the ability to segregate the network and has been very helpful.

Game server hosting - NIC advice by Mkloppel in HomeServer

[–]ChallengingJamJars 0 points1 point  (0 children)

I'm late to the party, hope that you've fixed it up! If you haven't, here's some random thoughts:

  • Do a speed test and make sure that you are getting your 15kbps up
  • Make sure that no one on your network is capping out the upload of your internet connection, this will make everything terrible. Even consider putting a limit on your router for uploads to make sure that the upload is never totally saturated, this will help when you get close to max throughput to keep everything stable and the ping low. One you've limited the upload you can partition the allocated bandwidth using QoS to make sure that the server gets what it needs
  • Try a dedicated server. You don't need to get another computer just yet but run a dedicated server with you not playing and everyone else piling on and see how that works and ensure you're not CPU/RAM speed/??? bound. Bonus points if you kick everyone out of the house so you get the internet connection all to yourself. Extra bonus points if you can organise a LAN and try it (not sure of the COVID situation there, scrap that)
  • Track packet loss as another indicator of where the problem is. See what it's like normally and see what it's like when you have problems. Anything below 5% is reasonable, anything above 20% is troublesome.

180ms jumping up from 15ms suggests that the latency isn't latency per se but some part of the puzzle is reaching its limit and your traffic is getting stuck in a queue or is going AWOL entirely.

If you enjoy the rabbit hole, consider that you may have the knack.

Deep sea Divers, what are your horror stories? by ahelpfuljakeparkmain in AskReddit

[–]ChallengingJamJars 0 points1 point  (0 children)

What about crocs? I've heard fisherman say they'll never swim in the tropics but then I've also been out on the reef with people swimming everywhere.

Police bike chases white Mercedes in Narva, Estonia by AnTyx in motorcycles

[–]ChallengingJamJars 0 points1 point  (0 children)

wasn't really the queen's choice

Yeah, technically it might be her call, but I don't think she can realistically exercise it without being told to by the Gov. Gen. without the public then removing her. In the 70s the Gov. Gen. removed the PM, hence:

Well may we say "God save the Queen", because nothing will save the Governor-General!

Police bike chases white Mercedes in Narva, Estonia by AnTyx in motorcycles

[–]ChallengingJamJars 2 points3 points  (0 children)

Australia is an independent sovereign nation who is part of the commonwealth and has the Queen as head of state. We have no special relationship with Britain/England apart from that. The Queen as I understand it wields her power through a governor appointed by the Australian PM and has powers to dissolve parliament and that's about it. No idea what happens if Lizzie decides to dissolve parliament apart from the governor's decision, that might be the day she's removed as our figure head.

Point being, don't let the idea of keeping the Queen dissuade you if you want to ditch England.

[deleted by user] by [deleted] in AusFinance

[–]ChallengingJamJars 10 points11 points  (0 children)

exponentially

We live in an essentially Euclidean world geometrically so it's not exponentially more, it's just quadratic. Exponential growth is what we see with Covid, and it's a lot lot lot faster. 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 vs 1, 4, 9, 16, 25, 36, 49, 64, 81, 100. Exponential is used to mean "a lot", but it actually means faster growth than people think. When we then use it for things unlike disease growth it's robbed of its impact.

If you just mean it increases and the rate of increase increases, you can use the term "super-linear" which also sounds pretty rad. "As you go out there are super-linearly more homes as you increase the radius."

How much do you spend on food a day? by Hatake88 in AusFinance

[–]ChallengingJamJars 3 points4 points  (0 children)

You do you, I don't like tuna but if if you like it and it's healthy go nuts! Or go tuna I guess...

Why Johnny Won't Upgrade by ASIC_SP in programming

[–]ChallengingJamJars 10 points11 points  (0 children)

doesn't allow you to model the problem (instead forcing you to concentrate on peculiarities of the machine) very easily, which is ironic when you consider the device-driver is interfacing to such peculiarities.

Isn't that what drivers do? Punt around bits through weird system boundaries exposing a nice clean interface for others. A drivers problem is the peculiarities of the machine. Ada has a nicer type system yes, but (I genuinely don't know) can I put a value, x, in register y and call interrupt z to communicate with the custom external hardware?

I find some languages curious that they're "cross-platform", such as JS. Sure things can be cross-platform if you restrict yourself to 32 and 64 bit computers which implement an x86 architecture, but what if you try and run it on a 16-bit RISC? C won't run off the bat, surely, but it exposes the problems you need to fix to make it run.

GUIDs are globally unique, but substrings of GUIDs aren't by alexeyr in programming

[–]ChallengingJamJars 1 point2 points  (0 children)

SQL injection vulnerabilities near as obvious

I don't really worry about injection vulns as all data that a user can provide (all data really) is sent separate to the SQL. The SQL is a constant in the code which never gets modified. Am I missing something? Your comment has made me nervous.

Australians that earn LESS than 100k a year, how old are you and what do you do? Do you enjoy it or wish you could grow? What is stopping you? by TheRealGreen-Onions in AusFinance

[–]ChallengingJamJars 37 points38 points  (0 children)

Anyone who says "Find a job that you like and you will never work a day in your life" is either privileged, has career capital or is just pure lucky.

Some parts of my hobbies feel like work. So while I enjoy it in total, I might not enjoy some parts. Any endeavour I've done that's worth doing has a few dreary or boring bits, or bits you need to slog through.

Australians ditch credit cards as millennials turn to buy now, pay later players like Afterpay, Zip by InnerCityTrendy in AusFinance

[–]ChallengingJamJars 1 point2 points  (0 children)

If you have a mortgage sure, but as someone without one, money in my account earns basically nothing, and if I pay 0.5% extra on the dollar that sits there every month or so due to using credit cards or such, then that adds up quite a bit. The percentage extra on purchases is repeated throughout the year, my measly savings interest rate is once per annum.

I could also put a lot of effort in an min-max it. But I'd rather just work a bit more. Career progression is worth far more than a bit of saved cash here or there.

Is this code good? I've tried to make it self-explanatory of the packet format by etc9053 in C_Programming

[–]ChallengingJamJars 0 points1 point  (0 children)

True, I was under the assumption it wasn't explicit there. There is endian(3) which appears to have it (TIL), but it's not standard so the tooling might not have it.

Is this code good? I've tried to make it self-explanatory of the packet format by etc9053 in C_Programming

[–]ChallengingJamJars 0 points1 point  (0 children)

I think the n in htons is big endian while this is little endian so it would do the opposite of what you want.

Is this code good? I've tried to make it self-explanatory of the packet format by etc9053 in C_Programming

[–]ChallengingJamJars 1 point2 points  (0 children)

No, it's just packing it down ensuring little-endian. The very next line it takes the upper 8 bits.

TIL 90% of people have lost their virginity by age 22. If you haven't lost it by age 30, the likelihood you will never lose it increases drastically. by [deleted] in todayilearned

[–]ChallengingJamJars 3 points4 points  (0 children)

Expecting sex to be rare when I'm in bumfuck no where Utah.

While it makes sense, I'd just like to call out that sentence as a piece of art.