Open Side Menu Go to the Top

07-27-2013 , 03:54 PM
Quote:
Originally Posted by gaming_mouse
off HN front page, this guys has to be greatest mspainter in the world:
http://www.thisiscolossal.com/2013/0...om-windows-95/
That is incredible. I also like how he was a Calligrapher as well.

Can't believe he takes 2 years to create a piece.

Quote:
Originally Posted by Nchabazam
Got a link to this keyboard? I could use something sexy, I do a lot of typing.
http://www.daskeyboard.com/model-s-ultimate-silent/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
07-27-2013 , 03:55 PM
Quote:
Originally Posted by clowntable
Found this in a HN comment, fun stuff
Can you explain it?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 05:44 PM
I'm generally fascinated with cellular automatons (and fractals and chaos theory). This one self simulates game of life.
http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

The fact that a simple rule 110 CA is turing complete still kind of blows my mind.
http://en.wikipedia.org/wiki/Rule_110
http://en.wikipedia.org/wiki/Element...ular_automaton
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 05:46 PM
Quote:
Originally Posted by daveT
Can you explain it?
I'll give it a shot...
Yo Dawg, I heard you liked the game of life so I put games of life in your game of life...
How am I doing so far?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:25 PM
Quote:
Originally Posted by anfernee
I'll give it a shot...
Yo Dawg, I heard you liked the game of life so I put games of life in your game of life...
How am I doing so far?
Perfect.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:28 PM
Quote:
Originally Posted by clowntable
The fact that a simple rule 110 CA is turing complete still kind of blows my mind.
http://en.wikipedia.org/wiki/Rule_110
http://en.wikipedia.org/wiki/Element...ular_automaton
i find this fascinating too but don't fully understand the foundational turing machine stuff. anyone if know if there is a good online course on the subject?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:31 PM
Quote:
Originally Posted by anfernee
I'll give it a shot...
Yo Dawg, I heard you liked the game of life so I put games of life in your game of life...
How am I doing so far?
so an "on" square is itself a game of life that is known to be in a repeating state consiting of mostly "on" squares and thus giving the appearance of being "on" when viewed from afar?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:34 PM
Quote:
Originally Posted by clowntable
I'm generally fascinated with cellular automatons (and fractals and chaos theory). This one self simulates game of life.
http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

The fact that a simple rule 110 CA is turing complete still kind of blows my mind.
http://en.wikipedia.org/wiki/Rule_110
http://en.wikipedia.org/wiki/Element...ular_automaton
I'm familiar with Conway's but I've never bothered to code it out.

There was some interesting variation on it that I saw a while back that attempts to explain why cities are segregated. The conclusion is counter-intuitive: hyper-segregated cities aren't hyper-racist. Basically, the idea was to use a checkers board and move the pieces according to certain rules. For example, if two blacks move next to red, then red moves; if two reds move next to black, then black moves. The point is that with such a low tolerance number, there can be no stability. High numbers have little to no movement, but a sweet-spot creates hyper-segregation.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:41 PM
dave, i watched that video as part of an online course. fascinating result and great example of how math can debunk our intuition.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 06:58 PM
Quote:
Originally Posted by daveT
I'm familiar with Conway's but I've never bothered to code it out.

There was some interesting variation on it that I saw a while back that attempts to explain why cities are segregated. The conclusion is counter-intuitive: hyper-segregated cities aren't hyper-racist. Basically, the idea was to use a checkers board and move the pieces according to certain rules. For example, if two blacks move next to red, then red moves; if two reds move next to black, then black moves. The point is that with such a low tolerance number, there can be no stability. High numbers have little to no movement, but a sweet-spot creates hyper-segregation.
It's called Schelling's segregation model. There's a course on one of the free sites called "Model Thinking" which has a section on it. Highly recommended course, nice toolbox to have. Basically a bunch of different models in a shortish cliffnotes version.
The lecturer is pretty cool, too.

[I do have some issues with some of the models, Schelling specifically]

Edit: Found it on youtube, first video
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 07:17 PM
Yeah, I watched the lectures in that class when it first came out and that is where I got it from. Lots of food for thought. What I like is how conclusions can be drawn from simple math and logic. Maybe I should download those lectures and rewatch them while I'm on the train this week.

I wonder how much a group of super-racists would affect the layout of a grid full of non-racists. Say for every 2 out of 100 people. The 98 would only move when there are, say 5/7 neighbors, but that 2 will move when 1 neighbor is a different color. I think this would add a bit more reality to the situation.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 08:28 PM
reality or not, it's not relevant since it wouldn't affect the central conclusion, which is that global patterns of segregation do not imply individual preferences for segregation. in fact, since such individuals could only create more pronounced segregation behavior, it only strengthens the conclusion.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 08:47 PM
The conclusion from that video is not too far off from reality. I never lived in a "white" neighborhood despite being white, but I can honestly say, even growing up in the straight-up ghetto, race was not really a huge problem (well, its complicated and it was a problem at times). The real segregation, IMO, is income.

For the most part, people are well-intended. It really is 2% that screws everything up and it creates this massive butterfly effect. The effect creates "fronting" which is people just saying stuff to say it whether they believe it or not. I would certainly like to explore that effect further. What would happen if you added in that 2% or removed it?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 09:30 PM
itt a nerd uses conway's game of life to explain "\"fronting\"" and race relations to other nerds.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-27-2013 , 09:50 PM
I drove my truck up a creek today. How do you explain that Mr. McNerdiston!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 10:11 AM
I have a design question for a RESTful service which is part of my personal project.

The service will return starting lineups and active rosters for specific MLB games in JSON, XML, and HTML depending on the accept field of the client header. If it receives a bad request but in a correctly constructed URL, for instance the request is for a game that doesn't exist but otherwise the URL is constructed properly, I plan to send back an HTTP error of some flavor.

I'm trying to figure out how to correctly handle the situation for when the URL is correct and the game is valid but the lineups have not been posted yet for the game. Should I handle this in normal design for the response? i.e. - In my object that represents a lineup and roster for a given game, should I have a boolean flag or some other mechanism to indicate that the lineups are not yet available? That way the client can respond in some appropriate manner to the fact that the lineups are not available yet without having to figure it out from an error response.

In the examples I could find online the services were responding to requests where either the resources existed or they didn't, while my situation seems a bit different. It may be incorrect to send an error response for this situation.

While it's doubtful any clients other than my own will consume this service, I want to design it properly like it was a real world web service.

Edit: should clarify this bit. I'll have 3 different controller methods depending on the accept field of the request. For HTML requests I'll just send back HTML that basically says "lineups not yet available."

However, for the JSON and XML responses I plan to have an annotated controller method which automatically serializes the object into the appropriate format and sends it back in the response.

Last edited by Jbrochu; 07-28-2013 at 10:24 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 10:14 AM
how many queries per page load is too many? google has been bringing up answers between 30 and > a few hundred (loldrupal).

basically I came across the n+1 selects problem making a 4chan clone. I would get the 10 most recent threads and then for each one get the 5 most recent posts and the first post.

how do the pros handle this kind of thing? Is it important to keep the queries down? Is it ok to bring in a bunch more data then you need then filter through it as opposed to writing finely tuned 20 llne SQL query?

SQL gives me a headache
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 11:01 AM
-1,

at the very least, you should be able to JOIN the thread and post tables together so that you only have to do one query for each thread thread you are getting, which would include the post info.

additionally, you could UNION the results of each thread query together, and then you get all info in a single query.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 11:06 AM
Quote:
Originally Posted by e i pi
how many queries per page load is too many? google has been bringing up answers between 30 and > a few hundred (loldrupal).

basically I came across the n+1 selects problem making a 4chan clone. I would get the 10 most recent threads and then for each one get the 5 most recent posts and the first post.

how do the pros handle this kind of thing? Is it important to keep the queries down? Is it ok to bring in a bunch more data then you need then filter through it as opposed to writing finely tuned 20 llne SQL query?

SQL gives me a headache
There's no magic answer. The most important thing is response time. If your site is getting drilled and your 98% response time is 20ms while running 10 easy queries but it's 37ms when running 1 monster query then the 10x easy queries is the best route to take in this case.

Actually I sort of lied, there is a magic answer. You throw that stuff in a cache so you never talk to the DB unless it's to update your cache.

Detecting DB query problems becomes much more manageable with proper logging. You should be outputting each query that gets ran in development/debug mode. The implementation of this will depend on what platform you're using but the end result could be the same. Having a pretty snippet of code injected into each response that shows you every query and how long it took is really valuable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 07:41 PM
Just got a new MB Pro, not familiar with much of anything in terms of usability advantages, but did just realize i can scroll by dragging 2 fingers on the touch pad, can right click by double clicking, can go back and forward (inconsistently).

I'm looking for a good youtube video to teach me, if someone knows of a good one I let me know. I will report back the best ones I find.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 07:52 PM
wait till you discover the 4-finger swipes!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 08:00 PM
Two finger click == right click!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 09:20 PM
Quote:
Originally Posted by Shoe Lace
Detecting DB query problems becomes much more manageable with proper logging. You should be outputting each query that gets ran in development/debug mode. The implementation of this will depend on what platform you're using but the end result could be the same. Having a pretty snippet of code injected into each response that shows you every query and how long it took is really valuable.
yea, I'm using symfony2 with doctrine and it does this by default in development mode. It's showing 18 queries in 28ms but I'm more concerned with best practices then the performance of this toy site.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-28-2013 , 09:29 PM
Quote:
Originally Posted by gaming_mouse
at the very least, you should be able to JOIN the thread and post tables together so that you only have to do one query for each thread thread you are getting, which would include the post info.
part of the trouble I was having was with trying to do conditional logic in sql to get the right posts. If there are >6 posts in a thread I would need to get the last 5 posts and the first post. If there were <= 6 posts I would just grab them all.

I was trying to do this logic in SQL without really knowing SQL

I think I'm going to try to just get the first post and last 5 posts for each thread regardless of the total post count, then after I get the result I'll check if there are 7 posts instead of 6 and pop off the extra one. I think using the DISTINCT key word would get rid of the duplicate first post in the case there were under 6 total posts in a thread.

If you were reviewing someones code and saw that would that be a red flag of sorts? Any SQL book reccomendations?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-29-2013 , 01:27 AM
sounds like you might like SQL's LIMIT option
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m