Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Tei
Feb 19, 2011
Probation
Can't post for 5 days!

Seems that I was wrong. Sorry.

In my defense, when apt is truly hosed-up it spits python error messages. I guess OS's makers or distro put python wraps around a binary?

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012

All I know is I'm glad Ubuntu 20 is out because that finally switched all the system stuff over from python 2 to python 3 so I could finally get rid of any python2 remnants on my machine.

Uninstalling python2 on any older version of ubuntu had a good chance of all but bricking your system.

Athas
Aug 6, 2007

fuck that joker
So what exactly is "systems programming" supposed to mean? I've seen it applied to everything from writing the kernel to hacking up the man page formatter.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Application programming focuses on something that a typical end user interacts with. Systems programming focuses on the stuff beneath that.

Carbon dioxide
Oct 9, 2012

The funny graphs thread is having a big discussion about the worst data formats imaginable.

Starts around this post. https://forums.somethingawful.com/showthread.php?threadid=3745614&userid=0&perpage=40&pagenumber=295#post505177852

Athas
Aug 6, 2007

fuck that joker

ultrafilter posted:

Application programming focuses on something that a typical end user interacts with. Systems programming focuses on the stuff beneath that.

That's also what I would use as my definition, except that I probably wouldn't use the term "systems programming" at all when it's not universally agreed what it means. Go was originally presented as a systems programming language, and a whole bunch of people got their knickers in a twist because it's not a good choice for writing an operating systems kernel (due to the GC). It's still fine for "systems programming" in the sense of writing infrastructure that normal people don't interact with directly.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

ultrafilter posted:

Application programming focuses on something that a typical end user interacts with. Systems programming focuses on the stuff beneath that.

How do libraries fit in to that definition?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
A more descriptivist definition of systems programming would be to say that there are a number of areas commonly recognized as being in the "systems" domain — e.g. operating systems, networks, databases, and compilers — and that projects in these domain generally share a few characteristics, and that any project with these characteristics has a strong case for being considered "systems":

  • The project presents a relatively high-level abstraction and implements it directly in terms of a much lower-level abstraction, often the lowest readily available.
  • Implementing the project often requires directly dealing with "bits and bytes" rather than more convenient high-level programming facilities.
  • There are underlying basic resources, and making the best use of them is a major focus of implementation work on the project.
  • The project is understood to be ultimately responsible for how these resources are used. If it is implemented on top of a lower-level system, it is expected that it will "look through" that system, using it with a clear eye for how its uses will be translated. There is no finger-pointing allowed unless the lower-level system fails to meet its own stated responsibilities.

Tei
Feb 19, 2011
Probation
Can't post for 5 days!

Athas posted:

So what exactly is "systems programming" supposed to mean? I've seen it applied to everything from writing the kernel to hacking up the man page formatter.

My answer:

Programming systems. .
These systems can be OS, or OS parts, a scheduler inside a sim city video game, a compiler, the parts of Youtube that users will never see or imagine that exists, and so on.

The oposite of system programming is bussines programming. Business programmers create CRUD forms, reports, lists of bussines data, dashboards of bussines data. There can be some system programming in business programming, has complex systems may be necessary to create bussines applications.

---

I like rjmccall answer too.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I really like Tei's position of contrasting it with business programming. Business programming has vague and ill-defined (and frequently moving) goals, is focused on things used by humans, is specialized to what you specifically are building, and so forth, while systems programming is where you have a concrete problem domain and well-defined goals, are probably only going to be interacted with by other code, and have the freedom to focus entirely on the technical aspects.

A networking library used by your application is an example of systems programming. Sometimes it'll be written in a systems-programming language, with a small wrapper to enable it to be used from your business-programming language. Other times it'll be written natively in the business-programming language, even though that may not be your first choice for a "systems language" in the general case - if it happens to be the right technical decision for this particular use case.

While many applications involved both business and systems programming, it's usually a good idea to draw a bright line between them - rather than constantly changing your systems code in response to moving business needs, or manually walking your database b-tree structures inside your business logic.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Half circular reasoning, half "all according to keikaku*. Translator's note: keikaku means plan." I like it.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
Impressive, after reading that I felt like I knew less about GROUP BY than before. I had to read the definition from the people who actually make an RDBMS to unconfuse myself.

quote:

The GROUP BY Clause is used to group together those rows in a table that have the same values in all the columns listed. The order in which the columns are listed does not matter. The effect is to combine each set of rows having common values into one group row that represents all rows in the group. This is done to eliminate redundancy in the output and/or compute aggregates that apply to these groups.

That's some stark contrast…

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Antigravitas posted:

Impressive, after reading that I felt like I knew less about GROUP BY than before. I had to read the definition from the people who actually make an RDBMS to unconfuse myself.


That's some stark contrast…

Well I mean the big thing that's wrong with the definition is that when you cross out all the bullshit and semantic games, he's defining a group as "a row returned by the SQL group by function." Which is accurate and completely unhelpful at the same time.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
RDMS’s have a real formal mathematical basis, but, uh, that’s a really bad explanation of it with a completely spurious invocation of the group concept from algebra.

Volte
Oct 4, 2004

woosh woosh
That's not even a definition "for the most part" of an algebraic group. The group axioms are kind of important.

Reminds me of when I heard a self-proclaimed tech expert say that some game, I want to say Minecraft, was created using Bootstrap (the CSS toolkit) and upon questioning what the gently caress they were talking about, I found out it's because at some point during the loading process, the word "bootstrapping" appeared on the screen.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I just think it's telling that the people who are actually making an RDBMS, who really do know the theory behind it, don't write in this "I am very smart" way.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


It also fails to acknowledge the existence of aggregation functions other than COUNT.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

ultrafilter posted:

It also fails to acknowledge the existence of aggregation functions other than COUNT.

To be fair, that actually doesn't matter. Let me cut through the first layer of bullshit to expose the bullshit core.

quote:

Definition of an SQL Group
In mathematics, a group is defined, for the most part, as (G, •, e), where G is a set, • is a binary operation in G, and e is a member of G. We will use this definition as the foundation for what a SQL group is. A SQL group will be defined as (G, e), where G is a result set of a single or self-contained query that uses GROUP BY, e is a member of G, and the following axioms are satisfied:
• For each e in G, e is distinct and represents one or more instances of e.
• For each e in G, the aggregate function COUNT returns a value > O.
The result set is included in the definition of a SQL group to reinforce the fact that we are defining what groups are when working with queries only. Thus, it would be accurate to replace "e" in each axiom with the word "row" because the rows in the result set are technically the groups.

Puffery removal filter:

quote:

Definition of an SQL Group
A SQL group will be defined as (G, e), where G is a result set of a query that uses GROUP BY, e is a row in G, and for each row "e" in G, and e is distinct and represents one or more instances of e.
The mention of the aggregation function is actually supposed to be work as an existence check in the previous function, but the check is actually unnecessary because e... is a row in the result set already. So unnecessary.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

Volte posted:

That's not even a definition "for the most part" of an algebraic group. The group axioms are kind of important.

Also, of the 3 things listed there, the most important one is the operation, and that just gets discarded. You don't need the identity to describe a group, it should be apparent from the operation.

So, what you get out of this is "A group is a set"

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Dr. Stab posted:

Also, of the 3 things listed there, the most important one is the operation, and that just gets discarded. You don't need the identity to describe a group, it should be apparent from the operation.

There are two equivalent definitions of a group, neither of which is shown here. One is a set together with an operation that satisfies certain axioms. The other is to give it as a set with a binary operation (multiplication), a unary operation (inversion) and a nullary operation (identity) that relate to each other in certain ways. The second one is the preferred modern definition, but would probably be more confusing on a first introduction.

Monokeros deAstris
Nov 7, 2006
which means Magical Space Unicorn

The horror is that the header uses “an SQL group” and the text uses “a SQL group”

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I didn't even notice that.

That's the kind of thing I'd write if I wanted to start a flame war though. Are we sure it's not a troll?

Ola
Jul 19, 2004

Reading that triggered a kind of confused rage which is actually nostalgia of my student days.

QuarkJets
Sep 8, 2008

Bruegels Fuckbooks posted:

Half circular reasoning, half "all according to keikaku*. Translator's note: keikaku means plan." I like it.

Why does that keikaku thing always make me laugh? You'd think it'd get old

I'm not even being sarcastic, I immediately think of some fat otaku ardently trying to rationalize this choice on the internet and it's hilarious

Tei
Feb 19, 2011
Probation
Can't post for 5 days!

rjmccall posted:

RDMS’s have a real formal mathematical basis, but, uh, that’s a really bad explanation of it with a completely spurious invocation of the group concept from algebra.

yea and is very important for things like optimizations because can apply algebra transformations and this way turn a complex query in other that would run faster.

Balsa
May 10, 2020

Turbo Nerd
I wrote the most gently caress ugly PHP code in my life... and now the project is going to die. I'm posting it here for all to see. This code was to manage Greenbone Vulnerability scanner to scan people over a VPN *barf*


This is only a small part of it.
php:
<?

        case "scan-start":
        $ping = `ssh -p '5555' 'admin@127.0.0.1' -i xxx -- ping xxx --count=1 --timeout=2 | grep time=`;
        if(empty($ping)){
                logs("Ping timeout!");
                logs("Time Left: " . ($meta["timeout"] - time() + 600));
                //tunnel code of 4 means that the tunnel is broken somehow, this is a softfail and will have another script to fix it
                if(($meta["timeout"] - time() + 600) < 1){logs("Client timed out!, Resetting state!"); $database->update("###boxes", ["tunnel" => 4], ["license" => hex2bin($meta["box"]["license"])]); state($database, "scan-error", $meta); break;}
                break;
        }else{
                logs("Ping good! $ping");
                $meta["timeout"] = time();
                $licshort = strtoupper(substr($meta["box"]["license"], -7, 7));
                //start creating scans in openvas
                //add target
                try {
                if(!empty($meta["box"]["excludes"])){
                        $excludexml = "<exclude_hosts>".$meta["box"]["excludes"]."</exclude_hosts>";
                }else{
                        $excludexml = "";
                }
                $targetxml = escapeshellarg('<create_target><name>'.$licshort.'</name><hosts>'.preg_replace('/\s+/', ', ', $meta["box"]["targets"]).'</hosts><alive_tests>ICMP, TCP-ACK Service &amp; ARP Ping</alive_tests>'.$excludexml.'</create_target>');
                logs($targetxml);
                logs("1 - Add Targets " . $meta["box"]["targets"]);
                $targetreturn = new SimpleXMLElement(trim(`sudo -i -u ### /home/###/.local/bin/gvm-cli --gmp-username admin --gmp-password 'xx' ssh --hostname 127.0.0.1 --port 5555 -X {$targetxml}`));
                $target_uuid = (string) $targetreturn["id"];
                logs("Target UUID: " . $target_uuid);
                logs("2 - Add Scan");
                $scanxml = escapeshellarg('<create_task><name>'.$licshort.'</name><comment>'.htmlentities($meta["box"]["location"],ENT_XML1 | ENT_QUOTES) .'</comment><config id="daba56c8-73ec-11df-a475-002264764cea"/><target id="'.$target_uuid.'"/><preferences><preference><scanner_name>in_assets</scanner_name><value>no</value></preference></preferences></create_task>');
                logs($scanxml);
                $scanreturn = new SimpleXMLElement(trim(`sudo -i -u ### /home/###/.local/bin/gvm-cli --gmp-username admin --gmp-password 'xxx' ssh --hostname 127.0.0.1 --port 5555 -X {$scanxml}`));
                $scan_uuid = (string) $scanreturn["id"];
                logs("Scan UUID: " . $scan_uuid);
                logs("3 - Start Scan");
                $startxml = escapeshellarg('<start_task task_id="'.$scan_uuid.'" />');
                logs($startxml);
                $startreturn = new SimpleXMLElement(trim(`sudo -i -u ### /home/###/.local/bin/gvm-cli --gmp-username admin --gmp-password 'xxx' ssh --hostname 127.0.0.1 --port 5555 -X {$startxml}`));
                $start_start = (string) $startreturn["status"];
                $start_text = (string) $startreturn["status_text"];
                $report_uuid = (string) $startreturn->report_id;
                logs("Task Status: " . $start_start . " Report UUID: " . $report_uuid);
                if($start_start > 300 OR $start_start < 200){
                        $database->update("###boxes", ["tunnel" => 5], ["license" => hex2bin($meta["box"]["license"])]);
                        state($database, "scan-error", $meta);
                        break;
                }else{
                        $meta["scan_uuid"] = $scan_uuid;
                        $meta["target_uuid"] = $target_uuid;
                        $meta["report_uuid"] = $report_uuid;
                        state($database, "scan-progress", $meta);
                }
        } catch (\Exception $e) {
                $database->update("###boxes", ["tunnel" => 5], ["license" => hex2bin($meta["box"]["license"])]);
                state($database, "scan-error", $meta);
                break;
        }
        }
        break;

?>
What have I done with my life :sludgepal:

Rubellavator
Aug 16, 2007

code:
private static final String EMPTY_CHAR = ' ';

Tei
Feb 19, 2011
Probation
Can't post for 5 days!

Balsa posted:

What have I done with my life :sludgepal:

Before you post something like this, you have to distribute bingo cards so we can play with it.

Macichne Leainig
Jul 26, 2012

by VG

Tei posted:

Before you post something like this, you have to distribute bingo cards so we can play with it.

It's an easy drinking game though. Drink every time you drink until everything's gone, and then forget the code exists in the first place.

Carbon dioxide
Oct 9, 2012

So, everyone in this thread has read The UNIX-HATERS handbook, right? It's a bit old but it's an absolute classic and a lot of it still rings true.

Since I just read a pdf, I never knew this, but apparently the original printed copy came with a free barf bag which is absolutely perfect.

Dross
Sep 26, 2006

Every night he puts his hot dogs in the trees so the pigeons can't get them.


What book is this?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


SQL Cookbook by Anthony Molinaro.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
unix aint great but a good majority of the unix haters handbook is just someone going "it doesn't make any sense! If they they glued a tomato to a broom handle it would be more functional! Barf!" for 16 straight chapters

zergstain
Dec 15, 2005

I watched a couple of YouTube videos on mathematical groups, and I'm completely lost as to how SQL GROUP BY has anything to do with that.

zergstain fucked around with this message at 01:08 on Jun 3, 2020

xtal
Jan 9, 2011

by Fluffdaddy
They don't, which is why it's a terrible analogy. It's sort of like how Haskell uses category theory terminology that only make sense in that context if you squint enough to consider there to be 1 category.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
It's a failed attempt to introduce a topic with "Webster's dictionary defines..." that anyone who knows anything about the topic can immediately identify as more-than-usually spurious.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
"Webster's dictionary defines 'wedding' as 'to unite (metallic parts) by heating and allowing the metals to flow together or by hammering or compressing with or without previous heating'"

Tei
Feb 19, 2011
Probation
Can't post for 5 days!
Kids these days. I remember when computer books did not exist*. I had to dessasemble a PASCAL compiler to learn pascal**.


* this is actually true
** sadly, this is true too

Tei fucked around with this message at 13:03 on Jun 3, 2020

Adbot
ADBOT LOVES YOU

Doom Mathematic
Sep 2, 2008

quote:

I don't think you are realistically going to hit this [integer overflow] bug in the scenario presented. 2^31 records is quite a lot to be having to page through.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply