

9:00 PM
@ThomasWard LMFAO
Hi, @david
@ThomasWard You don't have to delete it IMO. We've seen worse.
Okay then :)
That site is fairly optimistic about SQLite, guess I picked the right DB with the right use-case.
@Mast at least I'm sane and consider everyone else before blindly posting posts that might never be purged :)
Ooh, there's a definitive guide.
Let's add a PDF about how to build my library to store in my library of PDFs.
9:03 PM
lol how meta
I can probably make that sentence worse...
E: StackOverflowException: Too much recursion
SQLite is cool in how portable it is
I heard you like PDFs with your databases. Have a PDF about databases to store in your library with PDFs about databases so you can search your database for a PDF about databases.
I dunno.
@ThomasWard Why is the right guy talking via a phone when he's talking to the person next to him?
9:05 PM
SQLite not a very "good" database in terms of its SQL capabilities though, but given the normal use case for SQLite that's perfectly fine
@Mast Here I am using a JSON file as read-only database :P
@skiwi I know, right?
Spotify is happy with it for the client application
posted on December 31, 2016 by CommitStrip

@skiwi I thought about putting a JSON together first to feed to my database, but I skipped that step.
9:06 PM
I believe I'm cheating with using Lazy variables to avoid leaking this from the constructor... but I don't think it can go wrong either, as long as it goes right.
@CommitStrip lol the rover
And I'm the only person that could break it, client-side cannot break it per definition
I used something closely resembling JSON for my previous database though.
Q: Custom deserialization into a Map using Gson

davidI am trying to parse my JSON into a Map which is Map<String, Holder>. I cannot have Holder class as Pojo since fields can change anytime so that is why I have custom deserializer as shown below and that's how I want to be. private class HolderDeserializer implements JsonDeserializer<Holder> { ...

9:26 PM
So I found where the C code breaks, and found that the test I wrote actually works :D
C is starting to teach me about defensive coding.
9:40 PM
Unhandled exception at 0x0003115E in linked_list.exe: 0xC0000005: Access violation writing location 0x00000000.
That's an actual null pointer exception, isn't it?
SWEET fixed
waits for the next kaboom
Next stop: Assembly
void push(struct Node** headRef, int data) {
    struct Node* newNode = malloc(sizeof(struct Node));
    newNode->data = data;
    // handling for empty list, i.e. only the head pointer exists
    if (*headRef == NULL) {
        newNode->next = NULL;
        *headRef = newNode;
    else {
        newNode->next = *headRef;
        *headRef = newNode;
9:44 PM
@skiwi Count me in!
I could probably simplify that a little, but it works exactly as I need it to
@Phrancis Speaking of defensive coding, if malloc fails, newNode will be NULL, so there should be another NULL check there.
Crap, do I need to NULL-check every time I malloc?
@Phrancis Technically, yes.
9:46 PM
People often ignore this, but it means they are writing fragile code.
I suppose I could write a function for that
Most of the time one does not run out of memory, but it's worth considering what should happen if one does.
Or you could write a language for that. I'd suggest calling it C++...
There's not such thing as try in C is there?
There are setjmp and longjmp but they are rather horrible in practice.
Maybe I should move to C++ soon then.
9:48 PM
It's good to know C, but better to actually program in C++ in my humble opinion.
I can totally see that.
I do embedded stuff and sometimes all that's available is an assembler, linker and C compiler.
@Edward I wrote an answer a while ago stating that unless you got good reasons to, you shouldn't use C.
Embedded is one of the best reasons to C.
Paradoxically, embedded is one of the best reasons for C++, too, if you have a compiler.
@Phrancis Do or do not.
@Edward Yes, a shame not many companies ship a C++ compiler with their chip.
9:51 PM
Yes, but that's slowly improving. In some recent cases, the chip vendor sponsors a gcc port.
Is there a way to make C throw an error if X condition happens?
i.e. manually changing the value of errnum I guess?
No, simply make the program crash.
There's no such thing as Exceptions in C.
9:54 PM
So I could just print something to stderr then do a div/0? lol
@Mast That's what setjmp and longjmp were intended to address.
@Phrancis It depends on the OS, as well. For example, in Linux, one can set signal handlers.
So here's what I'm going to do: I'm going to finish this linked list implementation in C for learning purposes, then I'll never touch C again unless I absolutely have to.
Sound like a good plan?
@Edward Yea, but you don't want that.
9:56 PM
Like I say, it's good to know how to program in C, if only because it helps you appreciate other languages more.
It also depends on why you're learning it.
If it were "to get a job in the embedded programming industry" I'd say you're probably stuck with C for the most part.
If instead it's "Because I wanted to learn something new" then yes, it's probably just fine to finish the current project and move on.
The latter for me, a friend of mine (who is a much more experienced programmer) noticed that there were some fundamental concepts I wasn't grasping and he challenged me to learn some C to improve that
In particular, pointers
Yes, I'd say that understanding how to use pointers correctly is a fundamental skill.
Although they're less used in C++ than C, it's still essential to understand how they work.
10:33 PM
Boom Boom Boom Piew Piew BOOM Poof
@Phrancis The sound outside
It's only 4:30 PM here.
Sun hasn't even set.
23:37 here
I thought so, since the fireworks were going off.
Quick, start programming for the next half hour.
That way, you'll be programming all next year.
10:40 PM
I'm actually programming right now...
I'm afraid I'll leave my genius ideas behind in 2016
See y'all in 2017! I gotta go make dinner.
I'm voting to close this question as off-topic because it asks for general review of fully functional code rather than asking a specific programming question. This sort of question is off topic here but may be on topic for Code Review. If it is, it can be migrated over there for you, so no need to repost it there. — David Z 46 secs ago
@Edward Happy New Year!
Hello @ShuddaBeenCodin!
10:55 PM
Happy new year! Congrats to those special few
Thank you!
Q: How can I eliminate the blank (grey) space to the right of my webpage?

user11355This is a project I did recently. I can figure out why there is a blank space to the right when the viewing window is big enough. I want everything on the website to have width: 100%.

Happy New Year Europe!
All in all, it's very tense in our house right now.
I'm just glad I can disappear in plain sight when I want.
11:11 PM
Going to eat at a Spanish tapas restaurant in a couple of hours, then probably will be going to a pub or casino or something along those lines afterwards
Going to have Chili for supper and feel uncomfortably ill for a few hours afterward.
(Beans always make me sick, but they are affordable.)
Ah :\
I'll have mostly rice, though, which helps.
@Hosch250 Eating food which makes you sick doesn't make much sense, regardless of affordability.
Well, it's what's available. I don't control the menu around here.
I managed to filibust chicken (which also makes me sick) off the menu, but that only worked because chicken is expensive.
11:17 PM
So the Spanish tapas is cancelled, maybe I'll just get some take-out
@Phrancis That's too bad.
It looked really good, but at the same time looked pretty expensive
Around $15-20 per plate + drinks and other stuff
Q: LeetCode: Add Two Numbers (in Kotlin)

ɐuıɥɔɐɯ(...as I still learning Kotlin) I found this "problem": You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + ...

@Phrancis 15 bucks a plate for tapas? That racks up very fast.
11:21 PM
That's for entrees, the individual tapas are $7-10 looks like
Not a big fan of fish/seafood though and looks like every other tapas is that
Try Italian.
Home-cooked-style Italian.
With a salad with onion rings and those crunchy bread chunks.
And bread sticks.
Although, in our area, that tends to be $100 for 8-10 people.
So, might be a bit expensive, depending on what you can afford.
Italian is good, I especially like parmigiana meats
I like the margherita pizzas.
11:26 PM
Yum, yes indeed
There's also the pastas.
Real Italian pizza is far better than American-style pizza
Ravioli is great.
Depends what you mean by that. Home-cooked pizza is usually good, no matter how you make it.
True. It's a lot of work though.
We do a lot of our own cooking because my parents are into organic and all (and you can really taste the difference, too).
11:28 PM
Italian pizza usually has a thin crust, and different seasonings, not so much meat and cheese
You can get Italian with deep dish crusts too.
I love my pizzas with really thick crusts.
What they call American pizza here can have all kind of seasonings as well.
The only difference between American and Italian here is the size of the dough.
We're barbarians when it comes to pizza.
11:30 PM
I've never even heard of "American" pizza before.
Of-course not, you're in the USA yourself.
You hear about Dutch stroopwafels.
Nope, I haven't.
@Mast Ever heard of Chicago style pizza?
Where we call them just stroopwafels, since of-course they're Dutch, what else would they be.
I've heard of Chicago hotdogs. They sound disgusting.
11:31 PM
@Phrancis Yes, but I don't recall what it was.
Q: Scala: Calculating Pi to a tolerance

brian_oI'm taking my first steps in the Scala world, though I'm not wholly unfamiliar with functional style. Apparently one way of calculating Pi is to sum the terms of the infinite series 4 * (1/1 - 1/3 + 1/5 - 1/7 + 1/9 ...) So I wrote this simple implementation in a Scala worksheet: def calculateP...

GTG, be back later.
@Hosch250 You know what a Detroit style pizza is, right? Pizza baked in motor oil.
@Mast It's a really thick, deep dish pizza
@Phrancis Looks more like lasagna...
11:33 PM
20 minutes from New Year in StackLand :)
Q: Custom Resistance System for Role Playing Games

KrythicFor the game that I am creating I came across the need for an Elemental-based Resistance system. By that I mean, a system which would allow the player to mitigate damage or take more damage based upon their Resistance rating towards an element of a given type. With a good Fire Resistance they wou...

public enum ElementType
        /// <summary>
        /// Represents a Typeless-based Element.
        /// </summary>
        Normal = 0,
        /// <summary>
        /// Represents a Fire-based Element.
        /// </summary>
        Fire = 1,
        /// <summary>
        /// Represents a Frost-based Element.
        /// </summary>
        Frost = 2,
        /// <summary>
        /// Represents an Energy-based Element.
        /// </summary>
        Energy = 3,
        /// <summary>
        /// Represents a Sound-based Element.
That's not how you're supposed to comment.
That's a lot of documentation
/// <summary>
/// Sets all Resistances to the given value(s).
/// if this is the first pass during initialization,
/// the internal Dictionary will also be created by this
/// method.
/// </summary>
/// <param name="normal"></param>
/// <param name="fire"></param>
/// <param name="frost"></param>
/// <param name="energy"></param>
/// <param name="sonic"></param>
/// <param name="nature"></param>
/// <param name="arcane"></param>
/// <param name="holy"></param>
/// <param name="shadow"></param>
public void Initialize(
/// <summary>
/// </summary>
public int Fire
        return GetResistanceVersus(ElementType.Fire);
        SetResistanceVersus(ElementType.Fire, value);
11:46 PM
There must be so much repetitiveness in that code.
> "Bugs exist, and they get fixed," said Nancy Ambrosiano, a spokeswoman for the Los Alamos National Laboratory.
Uh, they're using SQL Server 6.5, that was made in 1996. I'm surprised Microsoft even still supports any of that.
The last SP for it was in 1998, and last bug fix in 2005
@Phrancis The Netherlands bought extra support for Windows XP for at least 2 years beyond the expiration date, so, probably?
As long as you pay, they'll support.
> 6.50.339: Y2K hotfix
11:55 PM
Q: Advent of Code 2016: Day 1, Part 2

Matthew PiziakThis is a continuation of Advent of Code 2016: Day 1, Part 1. This time, instead of the distance at the end of the instruction string, the answer is the distance of the first location which is visited twice. I implemented this by adding a terminate_on_revisited_location parameter to the blocks_a...

> "There was a dropped item for every 1,000 transactions" in SQL Server 6.5, said Blair, who has uploaded on his organization's Web site e-mail messages from Russian scientists detailing the problems. "With (version) 7.0, (the problem) was reduced in order of magnitude, but it was still a serious problem with dropped files."
Yea, that's not a fix, that's a patch lacking a better idea of what to do.
Governments are the worst at software.
3 minutes!
@Phrancis Nuclear facilities are semi-private property here, not sure whether to feel relieved or not.
