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
Zombywuf
Mar 29, 2008

Cybernetic Vermin posted:

the funny part about Haskell is that normal people quickly get the gut feel that the monad poo poo is a stupid spergy invention, but are then shown that category theory is a real mathematical field and are persuaded that there is something to it

the problem is that they don't realize that mathematicians doing category theory are spergy idiots wasting their own and everyone elses time

Your mistake is assuming Haskell has anything more to do with category theory than any other language. Haskell programmers just feel smug that they noticed that one of their constructs can be described with category theory. Everything can be described with category theory.

Adbot
ADBOT LOVES YOU

Cybernetic Vermin
Apr 18, 2005

Zombywuf posted:

Your mistake is assuming Haskell has anything more to do with category theory than any other language. Haskell programmers just feel smug that they noticed that one of their constructs can be described with category theory. Everything can be described with category theory.

you are just restating what I was saying, category theory is stupid, among other things because it is overly general to the point where it doesn't allow anything of interest to be gainfully expressed

haskell suffers from a similar problem of similar origins, with complex language features to enable things to be expressed in a weird way for no appreciable gain

Zombywuf
Mar 29, 2008

Cybernetic Vermin posted:

you are just restating what I was saying, category theory is stupid, among other things because it is overly general to the point where it doesn't allow anything of interest to be gainfully expressed

Natural transformations. Not interesting. Got it.

Cybernetic Vermin
Apr 18, 2005

Zombywuf posted:

Natural transformations. Not interesting. Got it.

right, happy you have learned something.

Nomnom Cookie
Aug 30, 2009



my dilz + your mouth = suck it

got your natural transformation right here bitch

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nomnom Cookie posted:

my dilz + your mouth = suck it

got your natural transformation right here bitch

You're gonna transform into an anime fox and run right out of this thread.

Progressive JPEG
Feb 19, 2003

amine aminal

Opinion Haver
Apr 9, 2007

Cybernetic Vermin posted:

you are just restating what I was saying, category theory is stupid, among other things because it is overly general to the point where it doesn't allow anything of interest to be gainfully expressed

lol

Catalyst-proof
May 11, 2011

better waste some time with you

Cybernetic Vermin posted:

you are just restating what I was saying, category theory is stupid, among other things because it is overly general to the point where it doesn't allow anything of interest to be gainfully expressed


man i hate how this mathematical framework is so generic and abstract

Opinion Haver
Apr 9, 2007

graph theory??? when the hell am i going to need this stuff, it's just things connected to things

double sulk
Jul 2, 2010

crossposting

Hacker News was down all last night. The problem was not due to the new server. In fact the cause was embarrassingly stupid.

On a comment thread, a new user had posted some replies as siblings instead of children. I posted a comment explaining how HN worked. But then I decided to just fix it for him by doing some surgery in the repl. Unfortunately I used the wrong id for one of the comments and created a loop in the comment tree; I caused an item to be its own grandchild. After which, when anyone tried to view the thread, the server would try to generate an infinitely long page. The story in question was on the frontpage, so this happened a lot.

For some reason I didn't check the comments after the surgery to see if they were in the right place. I must have been distracted by something. So I didn't notice anything was wrong till a bit later when the server seemed to be swamped.

When I tailed the logs to see what was going on, the pattern looked a lot like what happens when HN runs short of memory and starts GCing too much. Whether it was that or something else, such problems can usually be fixed by restarting HN. So that's what I did. But first, since I had been writing code that day, I pushed the latest version to the server. As long as I was going to have to restart HN, I might as well get a fresh version.

After I restarted HN, the problem was still there. So I guessed the problem must be due to something in the code I'd written that day, and tried reverting to the previous version, and restarting the server again. But the problem was still there. Then we (because by this point I'd managed to get hold of Nick Sivo, YC's hacker in residence) tried reverting to the version of HN that was on the old server, and that didn't work either. We knew that code had worked fine, so we figured the problem must be with the new server. So we tried to switch back to the old server. I don't know if Nick succeeded, because in the middle of this I gave up and went to bed.

When I woke up this morning, Rtm had HN running on the new server. The bad thread was still there, but it had been pushed off the frontpage by newer stuff. So HN as a whole wasn't dying, but there were still signs something was amiss, e.g. that /threads?id=pg didn't work, because of the comment I made on the thread with the loop in it.

Eventually Rtm noticed that the problem seemed to be related to a certain item id. When I looked at the item on disk I realized what must have happened.

So I did some more surgery in the repl, this time more carefully, and everything seems fine now.

Sorry about that.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

quote:

Sorry about that.

web 2.0.

Opinion Haver
Apr 9, 2007

gucci void main posted:

crossposting

Hacker News was down all last night. The problem was not due to the new server. In fact the cause was embarrassingly stupid.

On a comment thread, a new user had posted some replies as siblings instead of children. I posted a comment explaining how HN worked. But then I decided to just fix it for him by doing some surgery in the repl. Unfortunately I used the wrong id for one of the comments and created a loop in the comment tree; I caused an item to be its own grandchild. After which, when anyone tried to view the thread, the server would try to generate an infinitely long page. The story in question was on the frontpage, so this happened a lot.

For some reason I didn't check the comments after the surgery to see if they were in the right place. I must have been distracted by something. So I didn't notice anything was wrong till a bit later when the server seemed to be swamped.

When I tailed the logs to see what was going on, the pattern looked a lot like what happens when HN runs short of memory and starts GCing too much. Whether it was that or something else, such problems can usually be fixed by restarting HN. So that's what I did. But first, since I had been writing code that day, I pushed the latest version to the server. As long as I was going to have to restart HN, I might as well get a fresh version.

After I restarted HN, the problem was still there. So I guessed the problem must be due to something in the code I'd written that day, and tried reverting to the previous version, and restarting the server again. But the problem was still there. Then we (because by this point I'd managed to get hold of Nick Sivo, YC's hacker in residence) tried reverting to the version of HN that was on the old server, and that didn't work either. We knew that code had worked fine, so we figured the problem must be with the new server. So we tried to switch back to the old server. I don't know if Nick succeeded, because in the middle of this I gave up and went to bed.

When I woke up this morning, Rtm had HN running on the new server. The bad thread was still there, but it had been pushed off the frontpage by newer stuff. So HN as a whole wasn't dying, but there were still signs something was amiss, e.g. that /threads?id=pg didn't work, because of the comment I made on the thread with the loop in it.

Eventually Rtm noticed that the problem seemed to be related to a certain item id. When I looked at the item on disk I realized what must have happened.

So I did some more surgery in the repl, this time more carefully, and everything seems fine now.

Sorry about that.

gahahaha

Zombywuf
Mar 29, 2008

gucci void main posted:

On a comment thread, a new user had posted some replies as siblings instead of children. I posted a comment explaining how HN worked. But then I decided to just fix it for him by doing some surgery in the repl. Unfortunately I used the wrong id for one of the comments and created a loop in the comment tree; I caused an item to be its own grandchild. After which, when anyone tried to view the thread, the server would try to generate an infinitely long page. The story in question was on the frontpage, so this happened a lot.

As a perfect programmer who has never done something like this to prod I hereby mock hacker news for this.

double sulk
Jul 2, 2010

quote:

I use assertions to protect against things like this.

I liberally sprinkle my code with assertions (CS theory calls them pre-conditions and post-conditions, iirc) to crash early if the system is an invalid state.

One my pet peeves is that few programmers seem to love assertions like I do. Would love to see to comments on this.

quote:

Happens to a lot of us. Great reason to always write tested cleanup scripts for this stuff instead of editing directly on the server. The only time I brought down my product last year was from a similar screwup, I was removing users by hand and somehow managed to end up with a 0 in my list of user ids, thus deleting the anonymous user, and causing havoc to my server, which took a long time to track down.

quote:

I'm not sure whether it's terrifying or relieving to realize that if all I dream of comes to pass and I achieve something akin to the legendary status of pg in the hacker community that I will still be susceptible to the inevitable facepalm moments that come with direct database access.

In any case I am thankful for the detailed explanation.

Progressive JPEG
Feb 19, 2003

Zombywuf posted:

As a perfect programmer who has never done something like this to prod I hereby mock hacker news for this.
a p interesting problem tbh

maybe they should just have a max comment depth

once you get to 5 layers deep or so its just some retarded flamewar at that point anyway

Zombywuf
Mar 29, 2008

Progressive JPEG posted:

a p interesting problem tbh

maybe they should just have a max comment depth

once you get to 5 layers deep or so its just some retarded flamewar at that point anyway

Or use a db tree schema that can't create loops.

Opinion Haver
Apr 9, 2007

store the depth in the comment, ensure that the parent of each comment has depth n-1, if this is ever untrue then bail

seems pretty simple to me

Cybernetic Vermin
Apr 18, 2005

yaoi prophet posted:

graph theory??? when the hell am i going to need this stuff, it's just things connected to things

this is the stupidest comparison ever on the internet

shrughes
Oct 11, 2008

(call/cc call/cc)
Just make a tree algorithm specification macro library.

Shaggar
Apr 26, 2006
comment trees are horrific.

double sulk
Jul 2, 2010

Shaggar posted:

comment trees are horrific.

shaggar was right

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

As a perfect programmer who has never done something like this to prod I hereby mock hacker news for this.

THINGS ZOMBYWUF ACTUALLY BELIEVES

tef
May 30, 2004

-> some l-system crap ->
oh we're making fun of it here?

gucci void main posted:

On a comment thread, a new user had posted some replies as siblings instead of children. I posted a comment explaining how HN worked.


Our commenting is so broken we need to mentor users to understand how to use it.

quote:

But then I decided to just fix it for him by doing some surgery in the repl. Unfortunately I used the wrong id for one of the comments and created a loop in the comment tree; I caused an item to be its own grandchild. After which, when anyone tried to view the thread, the server would try to generate an infinitely long page. The thread was on the frontpage, so this happened a lot.

To make up for our bad interface, I edited the database in production.

quote:

For some reason I didn't check the comments after the surgery to see if they were in the right place. I must have been distracted by something. So I didn't notice anything was wrong till a bit later when the server seemed to be swamped.

I didn't check to see if what I did fixed it.

quote:

When I tailed the logs to see what was going on, the pattern looked a lot like what happens when HN runs short of memory and starts GCing too much. Whether it was that or something else, such problems can usually be fixed by restarting HN. So that's what I did. But first, since I had been writing code that day, I pushed the latest version to the server. As long as I was going to have to restart HN, I might as well get a fresh version.

When HN started breaking after my edits, I decided to replace it with a new untested copy, instead of finding out what was wrong. Most of the time when it breaks I just restart it manually.

quote:

After I restarted HN, the problem was still there. So I guessed the problem must be due to something in the code I'd written that day, and tried reverting to an old version, and restarting the server again. But the problem was still there. Then we (because by this point I'd managed to get hold of Nick Sivo, YC's hacker in residence) tried reverting to the version of HN that was on the old server, and that didn't work either. We knew that code had worked fine, so we figured the problem must be with the new server. So we tried to switch back to the old server. I don't know if Nick succeeded, because in the middle of this I gave up and went to bed.

At this point, none of us looked at the page in question which was generating a lot of cpu usage. What we did do was just try and make the problem go away by trying different earlier versions. The ones that usually just eat up cpu and hang on gc, so nothing changed. I gave up and went to bed. It never occurred to us that if the comment store was corrupt, all the code we had would break.

quote:

When I woke up this morning, Rtm had HN running on the new server. The bad thread was still there, but it had been pushed off the frontpage by newer stuff. So HN as a whole wasn't dying, but there were still signs something was amiss, e.g. that /threads?id=pg didn't work, because of the comment I made on the thread with the loop in it.

Eventually, the problem went away on its own. People stopped reading the broken page, but when I finally looked at HN, I could see something was wrong.

quote:

Eventually Rtm noticed that the problem seemed to be related to a certain item id. When I looked at the item on disk I realized what must have happened.

Someone else eventually put 2+2 together, either through inspecting logging, or tracing code, or debugging, rather than throwing a bunch of versions against deployment until one of them worked, and told me what the problem was.

quote:

So I did some more surgery in the repl, this time more carefully, and everything seems fine now.


After finding out that my code didn't handle loops, I edited the database to eliminate the loops. I don't think having a hard thread depth, or checking for loops in code would be worth my effort.

quote:

Sorry about that.

I have learned nothing from this experience.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
a prime example of why you shouldn't edit things in production if you are a huge scrub

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
every couple of months i decide i'm going to learn some poo poo-rear end fancy php framework and then i become completely disgusted with it within two hours

this month it's laravel, which, like every other goddamn php framework, insists you use routing to break how urls work. instead of having a one to one correspondence between urls and scripts, you should totally use this ugly-rear end bundle of mod_rewrite rules. and you can pass in data that way too instead of that mean old query string! nobody ever needs to pass more than two or three parameters!

other laravel features include, like every other goddamn php framework, a templating language that provides no advantages over PHP other than being probably about 10x slower

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
why the gently caress does everyone want to write a templating language in a templating language

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
this framework has a terrible case of the rails. even in its comments it describes itself as "beautiful" and "wonderful" every other sentence

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION
poo poo laravel might be pretty awesome then

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
the tagline is "a framework for web artisans"

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
one of the most active threads on their "best practices" subforum is how to set a navigation element to an "active" state when you're on a certain page. is this what web frameworks are for? taking really simple poo poo like that and using 200 mb of architecture to turn it into an enormous clusterfuck?

the most recently posted solution involves a thing called a RecursiveIteratorIterator. three of them actually

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Tiny Bug Child posted:

every couple of months i decide i'm going to learn some poo poo-rear end fancy php framework and then i become completely disgusted with it within two hours

this month it's laravel, which, like every other goddamn php framework, insists you use routing to break how urls work. instead of having a one to one correspondence between urls and scripts, you should totally use this ugly-rear end bundle of mod_rewrite rules. and you can pass in data that way too instead of that mean old query string! nobody ever needs to pass more than two or three parameters!

other laravel features include, like every other goddamn php framework, a templating language that provides no advantages over PHP other than being probably about 10x slower

it's called "laravel" because eventually larval programmers will grow up and change forms into someone mature that doesn't use php

Socracheese
Oct 20, 2008

Cocoa Crispies posted:

it's called "laravel" because eventually larval programmers will grow up and change forms into someone mature that doesn't use php

:golfclap:

Catalyst-proof
May 11, 2011

better waste some time with you

Tiny Bug Child posted:

one of the most active threads on their "best practices" subforum is how to set a navigation element to an "active" state when you're on a certain page. is this what web frameworks are for? taking really simple poo poo like that and using 200 mb of architecture to turn it into an enormous clusterfuck?

the most recently posted solution involves a thing called a RecursiveIteratorIterator. three of them actually

link

Cybernetic Vermin
Apr 18, 2005

had a week-long period where I had to get up every morning to insert a replacement stored procedure into a production database by pasting a specially crafted url into an internet explorer instance before business open.

couldn't just log in and patch it properly since there was a release procedure to comply with first.

tef
May 30, 2004

-> some l-system crap ->

Tiny Bug Child posted:

why the gently caress does everyone want to write a templating language in a templating language

i ask myself this a lot

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Cybernetic Vermin posted:

had a week-long period where I had to get up every morning to insert a replacement stored procedure into a production database by pasting a specially crafted url into an internet explorer instance before business open.

couldn't just log in and patch it properly since there was a release procedure to comply with first.
how early every morning?

tef
May 30, 2004

-> some l-system crap ->

Cybernetic Vermin posted:

had a week-long period where I had to get up every morning to insert a replacement stored procedure into a production database by pasting a specially crafted url into an internet explorer instance before business open.

couldn't just log in and patch it properly since there was a release procedure to comply with first.

i.e subverting release practices happens when it's easier than following them

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

tef posted:

i.e subverting release practices happens when it's easier than following them

i love it when my "clients" view me as an obstacle at best :smith:

Adbot
ADBOT LOVES YOU

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

http://forums.laravel.io/viewtopic.php?pid=28718#p28718

I'm now tempted to find out how many levels of Iterators of Iterators you can recursively iterate, but I feel that looking any deeper at this framework will be like looking into the abyss :stare:

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