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.
 
  • Locked thread
Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

MALE SHOEGAZE posted:

i'm not a linux guy i'm polyamourOS

>"I'M NOT A LINUX GUY"
>works at red hatte

Adbot
ADBOT LOVES YOU

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
Because JSON is not broken enough let's use YAML instead because that is clear and umabigious and...

Docker Compose documentation posted:

Note: When mapping ports in the HOST:CONTAINER format, you may experience erroneous results when using a container port lower than 60, because YAML will parse numbers in the format xx:yy as sexagesimal (base 60)

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
yaml is the worst part of ansible imo

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
how the gently caress did yaml get so ubiquitous

it's ruby's fault, isn't it

jesus WEP
Oct 17, 2004


do yaml or json have standard ways of validating their schema like xsd or w/e?

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

St Evan Echoes posted:

do yaml or json have standard ways of validating their schema like xsd or w/e?

http://json-schema.org/

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
json schema is horrible and broken and on its way to abandonment

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
if your garbage is complex enough that you want to validate against it just be an adult and use xml

Ragg
Apr 27, 2003

<The Honorable Badgers>

Lutha Mahtin posted:

there are a lot of cool things in swift but i would honestly trust microsoft more to run a free programming language project in which "community" stakeholders are ever even listened to. not that apple is evil, they just seem to have a very lazy and self serving approach to a lot of the open source projects that power their poo poo, only putting in the bare minimum of effort to ensure needed features and an advantageous development plan

Apple is evil though.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Jeffrey of YOSPOS posted:

If you're not gonna use a functional language, at least use C so you are categorically prevented from working with those OO idiots. Namaste.

oh nice you've never used c for large projects

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Phobeste posted:

oh nice you've never used c for large projects

C is a mess but I hope you're not implying that OOP tackles down complexity in a significant way

I'll fight you

FlapYoJacks
Feb 12, 2009

Jeffrey of YOSPOS posted:

If you're not gonna use a functional language, at least use C so you are categorically prevented from working with those OO idiots. Namaste.

Lol if you don't use OO C.

Phobeste posted:

oh nice you've never used c for large projects

I have, and if you can't use C for large projects you are bad at C or can't figure out how to use structs as objects.

FlapYoJacks fucked around with this message at 14:13 on Jan 22, 2016

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Bloody posted:

its gettin there

btw check your pms

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
tbh the only reason we use yaml anywhere is because you can use comments

triple sulk
Sep 17, 2014




i haven't really used it at all but f# seems like a more usable version of haskell that gives c# more good features

tef
May 30, 2004

-> some l-system crap ->

FamDav posted:

yo tef where is that list what a library says vs what it means and is "high-performance" on it.

http://programmingisterrible.com/post/65781074112/devils-dictionary-of-programming

simple — It solves my use case.

opinionated — I don’t believe that your use case exists.

elegant — The only use case is making me feel smart.

lightweight — I don’t understand the use-cases the alternatives solve.

configurable — It’s your job to make it usable.

minimal — You’re going to have to write more code than I did to make it useful.

util — A collection of wrappers around the standard library, battle worn, and copy-pasted from last weeks project into next weeks.

dsl — A domain specific language, where code is written in one language and errors are given in another.

framework — A product with the business logic removed, but all of the assumptions left in.

documented —There are podcasts, screencasts and answers on stack overflow.

startup — A business without a business plan.

hackday — A competition where the entry fee is sleep deprivation and the prize is vendor lock in.

entrepreneur — One who sets out to provide a return on investment.

serial entrepreneur — One who has yet to provide a return on investment.

disrupt — To overcome any legal, social, or moral barrier to profit.

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

Linux guy: "hey, today I used mailing lists and got excited about writing more shell commands. This is definitely the best way to do things!"

tef
May 30, 2004

-> some l-system crap ->

FamDav posted:

yo tef where is that list what a library says vs what it means and is "high-performance" on it.

no, but i guess it would be something like "high performance: as fast as fortran! as easy to use as fortran! also, in fortran"

Bloody
Mar 3, 2013

*with many third-party wrappers for your language that havent been updated in three major releases

JewKiller 3000
Nov 28, 2006

by Lowtax

triple sulk posted:

i haven't really used it at all but f# seems like a more usable version of haskell that gives c# more good features

f# is ocaml on .net which is why it's so good

JawnV6
Jul 4, 2004

So hot ...

ratbert90 posted:

I have, and if you can't use C for large projects you are bad at C or can't figure out how to use structs as objects.

recently ive been avoiding the ADT paradigm, it's very nice to enforce that level of abstraction on big systems but on embedded it seems like it's shuffling complexity rather than simplifying it

redleader
Aug 18, 2005

Engage according to operational parameters

Sagacity posted:

Because JSON is not broken enough let's use YAML instead because that is clear and umabigious and...

allowing numbers to be specified in base 60 is one of the weirdest and most baffling design decisions i've yet encountered

quote:

Using “:” allows expressing the integer part [of a floating point number] in base 60, which is convenient for time and angle values (the fractional part is always in base 10).

Example: 190:20:30.15

that's a weakass justification for such an unexpected feature

gonadic io
Feb 16, 2011

>>=

redleader posted:

allowing numbers to be specified in base 60 is one of the weirdest and most baffling design decisions i've yet encountered


that's a weakass justification for such an unexpected feature

Same with interpretating 080 as octal. That certainly tripped up a few people when I was teaching python

qntm
Jun 17, 2009
octal is awful and needs to be killed, it has never given us anything good

qntm
Jun 17, 2009
JSON is pretty bad but at least it's small enough that all of its gotchas can be grasped in about fifteen minutes of reading

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

Shaggar posted:

apple didn't want to use java or c# cause nih.

When OSX came out in 1999, Java was still poo poo from a butt and Microsoft was still trying to ritualisticaly murder Apple (and C# didn't even publically exist yet), and Apple wanted to use NeXTSTEP which they'd acquired along with reacquiring Steve Jobs.

I know fellating big business doesn't leave you with time for stuff like "the bare minimum of checking facts" but come on son.

FAKE EDIT: "arguing with shaggar lol"

fritz
Jul 26, 2003

qntm posted:

octal is awful and needs to be killed, it has never given us anything good

Bloody
Mar 3, 2013

Zemyla posted:

When OSX came out in 1999, Java was still poo poo from a butt and Microsoft was still trying to ritualisticaly murder Apple (and C# didn't even publically exist yet), and Apple wanted to use NeXTSTEP which they'd acquired along with reacquiring Steve Jobs.

I know fellating big business doesn't leave you with time for stuff like "the bare minimum of checking facts" but come on son.

FAKE EDIT: "arguing with shaggar lol"

when they decided to release swift, java and c# were both very good and very mainstream

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

Bloody posted:

when they decided to release swift, java and c# were both very good and very mainstream

Yes, but Shaggar was talking about Objective C.

Besides, Java is the blandest, most boilerplatey language ever and C# is only better because of the features they stole from Haskell.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

Zemyla posted:

Besides, Java is the blandest, most boilerplatey language ever and C# is only better because of the features they stole from Haskell.

i mean, i guess at least they're learning from a real language, that's nice.

jesus WEP
Oct 17, 2004


gonna put my shaggar hat on and not click the link and declare that it looks gross anyway

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





qntm posted:

JSON is pretty bad but at least it's small enough that all of its gotchas can be grasped in about fifteen minutes of reading

WRONG

tef
May 30, 2004

-> some l-system crap ->

less than that:

- anything other than ascii is asking for trouble
- nothing will handle duplicated keys properly or consistently
- although it says it handles ints and floats, many implementations only handle floats, or ints.
- unicode linebreaks are ok in javascript but not in json
- astral plane unicode is even worse, most things are 16 bit wide characters, but the rfc suggests using surrogate pairs
- people will claim things with trailing commas, or even comments are valid json
- oh some floats aren't valid floats in json, like inf and nan

probably one or two i missed

qntm
Jun 17, 2009
now do yaml

FamDav
Mar 29, 2008
i had to help out on a json-schema "implementation" (nobody actually implements json-schema because then they'd be passing around hashmaps) and the worst thing in the world is the definition of arrays.

quote:

5.3. Validation keywords for arrays



5.3.1. additionalItems and items



5.3.1.1. Valid values

The value of "additionalItems" MUST be either a boolean or an object. If it is an object, this object MUST be a valid JSON Schema.

The value of "items" MUST be either an object or an array. If it is an object, this object MUST be a valid JSON Schema. If it is an array, items of this array MUST be objects, and each of these objects MUST be a valid JSON Schema.



5.3.1.2. Conditions for successful validation

Successful validation of an array instance with regards to these two keywords is determined as follows:

if "items" is not present, or its value is an object, validation of the instance always succeeds, regardless of the value of "additionalItems";

if the value of "additionalItems" is boolean value true or an object, validation of the instance always succeeds;

if the value of "additionalItems" is boolean value false and the value of "items" is an array, the instance is valid if its size is less than, or equal to, the size of "items".



5.3.1.3. Example

The following example covers the case where "additionalItems" has boolean value false and "items" is an array, since this is the only situation under which an instance may fail to validate successfully.

This is an example schema:


{
"items": [ {}, {}, {} ],
"additionalItems": false
}

With this schema, the following instances are valid:

[] (an empty array),

[ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ] ],

[ 1, 2, 3 ];

the following instances are invalid:

[ 1, 2, 3, 4 ],

[ null, { "a": "b" }, true, 31.000002020013 ]



5.3.1.4. Default values

If either keyword is absent, it may be considered present with an empty schema.



5.3.2. maxItems



5.3.2.1. Valid values

The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.



5.3.2.2. Conditions for successful validation

An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.



5.3.3. minItems



5.3.3.1. Valid values

The value of this keyword MUST be an integer. This integer MUST be greater than, or equal to, 0.



5.3.3.2. Conditions for successful validation

An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.



5.3.3.3. Default value

If this keyword is not present, it may be considered present with a value of 0.



5.3.4. uniqueItems



5.3.4.1. Valid values

The value of this keyword MUST be a boolean.



5.3.4.2. Conditions for successful validation

If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.



5.3.4.3. Default value

If not present, this keyword may be considered present with boolean value false.

and

quote:

8.2. Array elements



8.2.1. Defining characteristic

The defining characteristic of the child instance is its index within the array. Recall: array indices start at 0.



8.2.2. Implied keywords and default values.

The two implied keywords in this calculation are "items" and "additionalItems".

If either keyword is absent, it is considered present with an empty schema as a value. In addition, boolean value true for "additionalItems" is considered equivalent to an empty schema.



8.2.3. Calculation



8.2.3.1. If "items" is a schema

If items is a schema, then the child instance must be valid against this schema, regardless of its index, and regardless of the value of "additionalItems".



8.2.3.2. If "items" is an array

In this situation, the schema depends on the index:

if the index is less than, or equal to, the size of "items", the child instance must be valid against the corresponding schema in the "items" array;

otherwise, it must be valid against the schema defined by "additionalItems".

Baxate
Feb 1, 2011

when I learned yaml doesn't allow hard tabs I never used it again :shrug:

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

ratbert90 posted:

Lol if you don't use OO C.


I have, and if you can't use C for large projects you are bad at C or can't figure out how to use structs as objects.

quote:

Any sufficiently large C program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of C++.

FlapYoJacks
Feb 12, 2009

Yes, structs were a ripoff of classes :rolleyes:

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

apple didn't want to use java or c# cause nih.

apple actually did want to use java.

apple used to ship their own JDK, because they wanted the best-possible java experience for osx users. they gave up on this for reasons that will become clear shortly

apple WebObjects was originally objC, but it all got ported to java because fuckin lol at dealing with buffer overruns and poo poo on a website. still runs apple.com today. although i can't name any other users. (i don't think you can even buy webobjects anymore)

cocoa/openstep, the ui toolkit on osx, used to have what they called the "java bridge," so you could write native osx programs in java. that has been deprecated. again, because nobody used it.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Zemyla posted:

When OSX came out in 1999, Java was still poo poo from a butt and Microsoft was still trying to ritualisticaly murder Apple (and C# didn't even publically exist yet), and Apple wanted to use NeXTSTEP which they'd acquired along with reacquiring Steve Jobs.

I know fellating big business doesn't leave you with time for stuff like "the bare minimum of checking facts" but come on son.

FAKE EDIT: "arguing with shaggar lol"

I meant use java or c# to replace swift. they used objc cause steve made them cause it was nextstep

  • Locked thread