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
Space Gopher
Jul 31, 2006

BLITHERING IDIOT AND HARDCORE DURIAN APOLOGIST. LET ME TELL YOU WHY THIS SHIT DON'T STINK EVEN THOUGH WE ALL KNOW IT DOES BECAUSE I'M SUPER CULTURED.

SupSuper posted:

If your users are gonna end up putting your data in Excel, why not export in an Excel format instead of CSV?

When we all die and go to hell, there will be plenty of OpenXML serialization and deserialization work for everybody. No need to rush the process.

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

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

Xarn posted:

Webdev needs the equivalent of Werror.

I've started making our newbies do a project or two in Elm when they're starting out, especially if they're geeks who have experience hacking together a quick web app with node and whatever.js. They hate every minute of it and it's great.

Xik
Mar 10, 2011

Dinosaur Gum

SupSuper posted:

If your users are gonna end up putting your data in Excel, why not export in an Excel format instead of CSV?

If I could pick one post to sum up the entire idea of this thread it's this one.

Tei
Feb 19, 2011

The fresher idea would be to create a custom format for this. Lets call it,... Half-Life 3.

But this idea is DOOMed because if users for whatever reason need the data in Excel, they will still put the data in excel.

A compromise would be to create a plugin or extension on Excel that change how Excel behave, but this idea is HEXED again, by users unable to install software modifiing software or old versions or similar.

Changing the names is the easier and most effective solution.

1337JiveTurkey
Feb 17, 2005

Space Gopher posted:

When we all die and go to hell, there will be plenty of OpenXML serialization and deserialization work for everybody. No need to rush the process.

Doubly so if you are integrating VBA macros into the loving thing.

redleader
Aug 18, 2005

Engage according to operational parameters

SupSuper posted:

If your users are gonna end up putting your data in Excel, why not export in an Excel format instead of CSV?

oh, to live in a world as beautiful as yours...

we get data as excel documents from people we have no control over

Coffee Jones
Jul 4, 2004

16 bit? Back when we was kids we only got a single bit on Christmas, as a treat
And we had to share it!
https://twitter.com/jamesiry/status/656180312544837632?s=20 :smuggo:

Ola
Jul 19, 2004


The C Programming Language, revision B

1. Don't trip with scissors
2. Don't run with scissors around corners

This book is dedicated to the memory of James around the corner.

Xarn
Jun 26, 2015
If we are making GBS threads on C, a friend wrote short post about his experience with C standardization. It honestly explains a lot, and made me appreciate C++ standardization :v:

https://thephd.github.io/your-c-compiler-and-standard-library-will-not-help-you

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
My sense has always been that the C committee went through a period in the 90s of caring about the language and trying to make it better, and they came away from the experience feeling incredibly burned because the C community hated a lot of what they did, and now everyone is burned out and they can’t get consensus for anything significant.

Beef
Jul 26, 2004
C programmers hate everything, including themselves.

*drinks himself into a stupor*

Tei
Feb 19, 2011


I know is a joke, but anyway.... C is not trying to protect the computer from the programmer. Why would he?, they are not enemies.

There has to be a misunderstanding somewhere. C is not running with scissors, is running with dual katanas.

Absurd Alhazred
Mar 27, 2010

by Athanatos

Tei posted:

I know is a joke, but anyway.... C is not trying to protect the computer from the programmer. Why would he?, they are not enemies.

There has to be a misunderstanding somewhere. C is not running with scissors, is running with dual katanas.

Kamehameselfharm

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



MrMoo posted:

All you have to do is look at the console on Chrome home page to see what a cluster gently caress things are. That page always has warnings or errors of some variety.



SameSite support is rolling out slowly because server-side framework updates are something a lot of teams/orgs do not handle well.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

DaTroof posted:

the lesson i'm learning here is the same lesson i've learned to achieve success in every other aspect of the computer industry:

never excel

Excuse me I'll have you know that my work has been described as "Exceptional" and I'm very proud of that.

fritz
Jul 26, 2003

Volmarias posted:

Excuse me I'll have you know that my work has been described as "Exceptional" and I'm very proud of that.

Excelptional.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
phonepostin, but imagine an enum:
code:
enum IncludeInReport { None, Both, Foo, Bar, Yes, No }
... where foo and bar are the names of reports.

Volguus
Mar 3, 2009

dougdrums posted:

phonepostin, but imagine an enum:
code:
enum IncludeInReport { None, Both, Foo, Bar, Yes, No }
... where foo and bar are the names of reports.

Oh, the famous True,False,FileNotFound in a different color.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
What gets me is ... well several things that make it even worse.

If you had None, Foo, Bar, you can just Foo | Bar for both. I guess Both might be there maybe because they wanted the database to be comprehensible without the code and decided to make it a string, but that's assuming set type isn't supported, or just putting it in another table didn't cross their mind. Or just use two boolean columns at the worst.

Then there's Yes and No which were obviously added later for completely mysterious reasons. No presumably means the same as None, but what the gently caress does Yes refer to? Both? Some other report? What on earth compelled them to add those values?

They're all evenly distributed between each other in the db except for None and No, which are uncommon but split 50/50 between the two.

There's also a bunch of "if (...) if (...) if (...) return true; return false;" but that enum is the thing that really fucks me up.

xtal
Jan 9, 2011

by Fluffdaddy
Those probably directly correspond to radio buttons in a form that the marketing team asked for

Foxfire_
Nov 8, 2010

None, Report1, Report2, Both is fine since there's an argument for having an enum value always be one of the enumerated items instead of being a bitfield. Yes/No don't make any sense though.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Foxfire_ posted:

None, Report1, Report2, Both is fine since there's an argument for having an enum value always be one of the enumerated items instead of being a bitfield. Yes/No don't make any sense though.
Yeah I guess I'd be content with that and the string column type but the Yes No thing is just offensive :psyduck:

And I know it was added later because the rows have dates that roughly correspond with when they were entered.

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.

dougdrums posted:

phonepostin, but imagine an enum:
code:
enum IncludeInReport { None, Both, Foo, Bar, Yes, No }
... where foo and bar are the names of reports.

when you have three days left to get something done in a sprint and the "db" person is out.

Happy Thread
Jul 10, 2005

by Fluffdaddy
Plaster Town Cop
https://twitter.com/substitute/status/1293622127006871552

Absurd Alhazred
Mar 27, 2010

by Athanatos
https://twitter.com/lunasorcery/status/1295847638840020992

Impotence
Nov 8, 2010
Lipstick Apathy

are cloud build farms and ci/cd pipeline runners not basically just this

xtal
Jan 9, 2011

by Fluffdaddy

Biowarfare posted:

are cloud build farms and ci/cd pipeline runners not basically just this

Be quiet, that's my startup

MrMoo
Sep 14, 2000

Looks more like standard Sun Workshop Pro licensing mechanism. Although more efficient as you can upgrade the license without listening to hours of sales pitch beforehand.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


so what, you just have to sit through their Time-sharing Presentation?

more falafel please
Feb 26, 2005

forums poster

Doc Hawkins posted:

so what, you just have to sit through their Time-sharing Presentation?

:golfclap:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
code:
        private static readonly int[] daysInMonth =
        {
            0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
        };
:gonk:

Soricidus
Oct 21, 2010
freedom-hating statist shill
Should have used floats so February could be 28.25

xtal
Jan 9, 2011

by Fluffdaddy
Should have used 'bool count_knuckles(int m)'

Adhemar
Jan 21, 2004

Kellner, da ist ein scheussliches Biest in meiner Suppe.
I’m the undocumented zero day month at the start of the year.

Tweak
Jul 28, 2003

or dont whatever








Lousy index 0 weather >:(

redleader
Aug 18, 2005

Engage according to operational parameters
it's easy to fix for leap years too! just add this to app startup somewhere:
code:

if (DateTime.Now.Year % 4 == 0) {
    daysInMonth[2] = 29;
}


but of course, if you need to work on historical data, you'd need a function like this:

code:

public static int GetDaysInMonth (DateTime dt) {
    if (dt.Year % 4 == 0) {
        daysInMonth[2] = 29;
    } else {
        daysInMonth[2] = 28;
    }
    return daysInMonth[dt.Month];
}


ok, not bad. let's make it more flexible, cleaner, and 100% definitely production ready:

code:

public static int GetDaysInMonth(DateTime dt) => GetDaysInMonth(dt.Month);

private const int MONTH_FEBRUARY = 2;
private const int FEBRUARY_LEAP_YEAR_DAYS = 29;
private const int FEBRUARY_NORMAL_YEAR_DAYS = 28;

public static int GetDaysInMonth(int month) {
    daysInMonth[MONTH_FEBRUARY] = dt.Year % 4 == 0 ? FEBRUARY_LEAP_YEAR_DAYS : FEBRUARY_NORMAL_YEAR_DAYS;
    return daysInMonth[month];
}

what? yeah, i tested it on my machine!

Maw
Feb 18, 2013

Mere minutes after discovering the new technology, it was used to send me a crude ASCII dong.


Adhemar posted:

I’m the undocumented zero day month at the start of the year.

I'm convinced that's so they can index into it with 1 as January

Carbon dioxide
Oct 9, 2012

redleader posted:

it's easy to fix for leap years too! just add this to app startup somewhere:
code:
if (DateTime.Now.Year % 4 == 0) {
    daysInMonth[2] = 29;
}
but of course, if you need to work on historical data, you'd need a function like this:

code:
public static int GetDaysInMonth (DateTime dt) {
    if (dt.Year % 4 == 0) {
        daysInMonth[2] = 29;
    } else {
        daysInMonth[2] = 28;
    }
    return daysInMonth[dt.Month];
}
ok, not bad. let's make it more flexible, cleaner, and 100% definitely production ready:

code:
public static int GetDaysInMonth(DateTime dt) => GetDaysInMonth(dt.Month);

private const int MONTH_FEBRUARY = 2;
private const int FEBRUARY_LEAP_YEAR_DAYS = 29;
private const int FEBRUARY_NORMAL_YEAR_DAYS = 28;

public static int GetDaysInMonth(int month) {
    daysInMonth[MONTH_FEBRUARY] = dt.Year % 4 == 0 ? FEBRUARY_LEAP_YEAR_DAYS : FEBRUARY_NORMAL_YEAR_DAYS;
    return daysInMonth[month];
}
what? yeah, i tested it on my machine!

Years divisible by 100 are not leap years. Years divisible by 400 are. Except when you use the Julian calendar. Also, in every single data format that needs to be compatible with Microsoft Excel, 1900 actually is a leap year because of backwards compatibility with an ancient Excel version where that was introduced as a bug.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Carbon dioxide posted:

Also, in every single data format that needs to be compatible with Microsoft Excel, 1900 actually is a leap year because of backwards compatibility with an ancient Excel version where that was introduced as a bug.

Oh is that why the Mac excel epoch was 1904 instead of 1900?

Adbot
ADBOT LOVES YOU

senrath
Nov 4, 2009

Look Professor, a destruct switch!


Carbon dioxide posted:

Years divisible by 100 are not leap years. Years divisible by 400 are. Except when you use the Julian calendar. Also, in every single data format that needs to be compatible with Microsoft Excel, 1900 actually is a leap year because of backwards compatibility with an ancient Excel version where that was introduced as a bug.

I'm not sure you can really call it a bug in Excel, since they did it on purpose to ensure backwards compatibility with Lotus 1-2-3, where it was a bug.

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