Open Side Menu Go to the Top

04-12-2015 , 11:06 PM
Quote:
Originally Posted by candybar
You have to pick a proper abstraction at the proper level. Where you went is fine. Where he was, wasn't.
How is what I have different than what gaming_mouse said?

It's Clojure, not Scheme, lol.
** 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 **
04-12-2015 , 11:18 PM
Quote:
Originally Posted by daveT
How is what I have different than what gaming_mouse said?
He's talking about the problem, you're talking about the code. Don't try to generalize the code - try to generalize the problems you have to solve.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-12-2015 , 11:19 PM
Quote:
Originally Posted by daveT
How is what I have different than what gaming_mouse said?

It's Clojure, not Scheme, lol.
you say tomato....

Spoiler:
and next you thing you know look like:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-12-2015 , 11:27 PM
Quote:
Originally Posted by candybar
He's talking about the problem, you're talking about the code. Don't try to generalize the code - try to generalize the problems you have to solve.
I use the same idea as gaming_mouse said with the dispatch method...

I was asking about dispacthing other information to a single function to get rid of the other functions. I'm not sure if I follow the reader syntax idea though (If it doesn't exist in Lisp, we can use macros and now we have it). I'm currently sorting by values and returning a list of keys in the let-bindings.

Quote:
Originally Posted by gaming_mouse
you say tomato....
That was a gross picture, thx.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-12-2015 , 11:41 PM
Quote:
Originally Posted by daveT
I use the same idea as gaming_mouse said with the dispatch method...
This is the difference:

Quote:
Originally Posted by gaming_mouse
with your approach, it seems like the natural generalization is a "signature" of ranks. pair = (2,1,1,1,1,1), trips = (3,1,1,1,1), quads = (4,1,1,1), two pair = (2,2,1,1,1), full house = (3,2,1,1)
Quote:
Originally Posted by daveT
While these *are* different, trips and pair are nearly identical, with the only difference being the numerical arguments:

So, considering some foresight and discovering this general pattern early, is there a point where we can just say "generate" or make this even more abstract, so that the functions are returned, but aren't visible in the code?
He's talking about how the problem generalizes and you're talking about the pattern in your code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 12:07 AM
To clear up my confusion...

Code:
;; quads
(defmethod disperse-hand '(4 1 1 1) [m]
  (quads (:h m)))

(defmethod disperse-hand '(4 2 1) [m]
  (quads (:h m)))

(defmethod disperse-hand '(4 3) [m]
  (quads (:h m)))
This does exactly what gaming_mouse is suggesting, where (:h m) is the hand-map passed to the quads function. The '(x y z) is the dispatch value and is never passed as an argument to the function.

If your assertion is that this is good enough and the functions are generally fine as-is, then I totally get it. I'm still a bit confused about the pattern matching though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 12:19 AM
Quote:
Originally Posted by daveT
To clear up my confusion...

Code:
;; quads
(defmethod disperse-hand '(4 1 1 1) [m]
  (quads (:h m)))

(defmethod disperse-hand '(4 2 1) [m]
  (quads (:h m)))

(defmethod disperse-hand '(4 3) [m]
  (quads (:h m)))
This does exactly what gaming_mouse is suggesting, where (:h m) is the hand-map passed to the quads function. The '(x y z) is the dispatch value and is never passed as an argument to the function.

If your assertion is that this is good enough and the functions are generally fine as-is, then I totally get it. I'm still a bit confused about the pattern matching though.
I think he's just saying that you seem to be focused on the code rather than concepts.

Related to that, and to your code, you should take some time to name things more naturally. "disperse-hand" and "dispatch value" -- those words pain my simple brain.

What are the natural concepts here? Card ranks and matching, I think. Let your names -- and thoughts -- reflect those.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 12:33 AM
@suzzer what would you recommend using as an authentication system with nodejs.

Passport or Drywall or ?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 12:45 AM
Quote:
Originally Posted by gaming_mouse
I think he's just saying that you seem to be focused on the code rather than concepts.

Related to that, and to your code, you should take some time to name things more naturally. "disperse-hand" and "dispatch value" -- those words pain my simple brain.

What are the natural concepts here? Card ranks and matching, I think. Let your names -- and thoughts -- reflect those.
Yeah, I was thinking the same thing too... I'm pretty sloppy when I'm the middle of it all. I just want to put stuff down when it is in my mind. Semantics be damned until it is all pretty much complete.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 04:37 AM
@DaveT:
Funny example, I wrote a 7-card evaluator a while back that is based on a very similar rank-signature. I used a single long / int64 to store that though. Basically the lowest 4 bits are the count of deuces, next 4 bits are the count of 3's, etc. That signature can be calculated in just a few operations if the hand representation is favorable.

So 0x102L would represent one Four and two Deuces, etc. Checking for quads is as simple as checking (ranks & 0x4444444444444L) !=0, etc...

Source

Regarding abstraction:
Really depends if you ever intent to use this for something performance critical, or if it is mostly design practice. In many languages you will get a minor performance hit for additional method calls. This is usually a total non-issue performance wise, but you will notice it for something like a hand-evaluator.

Also +1 on candybars post about over-abstraction for games.

Last edited by plexiq; 04-13-2015 at 04:47 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 09:37 AM
my 7-card hand evaluator calls my 5-card hand evaluator on each of the 5-card combinations

but that is probably more computationally expensive that an optimized 7-card hand evaluator
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 09:49 AM
For evaluating hands, I'd create a method that takes in 7 cards and returns a distinct ranking (0-7461). You can then create another function that takes in the distinct ranking, and returns the hand type, IE 0 - 9 = "Straight flush", 10 - 155 = "Quads" etc.

Then you have a nice simple easy to understand start of a library:

int HandToDistinctRank(int[7])
string DistinctRankToString(int)

And determining winner of a hand is as simple as who has the smallest distinct rank.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 10:02 AM
Yup, that's pretty much the standard design. Although the usual setup is that the highest rank wins.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 01:46 PM
Quote:
Originally Posted by iosys
@suzzer what would you recommend using as an authentication system with nodejs.

Passport or Drywall or ?
All our authentication (user login) happens behind the API wall, so we don't have any node-level authentication. When a user logs in - the API gives us a session cookie that we set on the browser through node and pass back through to the API for future requests.

Last edited by suzzer99; 04-13-2015 at 01:52 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-13-2015 , 11:30 PM
Thanks for the food for thought all.

The goal of this was, and still is, to have a playable entity. There is a Clojure and a ClojureScript version. I went around in circles thinking about how to approach it. Took a good year, but I think a decent compromise between speed and toughness is storing a large hand-history in a NoSQL database like Mongo, then running large-ish queries. The idea is to make it so that it queries the 'same' flop, turn, river, analyzes the final win, usual time of player betting, checking, folding, etc. Probably something that I'll never end up finishing, even though it is full of interesting topics.

So... I got contacted by recruiter #1 today, asking if I heard from recruiter #2. If I haven't heard back from #2, please call them, write an email, whatever. I'm thinking that if #2 was interested, this would be a non-issue. I responded to #1 saying as much. I have no idea what to think of all of this.

On a higher note, I also received a rejection letter for some entry-level Python developer job today. Thanks for looking at my resume, I guess. I know I've made this complaint before, but these rejection letters are so damn tacky. I honestly don't even remember sending my resume in.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 12:46 AM
I got 8 pages of SRS done. Not even sure if the professor will approve of the material, but *fingers crossed* I hope he does. I ended up writing a high level overview of MVVM and how it relates to the project and some diagrams.

Not that anyone cares, but google doc guy still useless. He's more useless than Big Head in silicon valley.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 03:09 PM
The "n" key on my work laptop is unresponsive. I can't even get in as my username includes an n. I removed the key and cleaned but still nothing. Any idea what I can do here?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 03:18 PM
Accessibility -> on-screen keyboard
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 04:24 PM
copy-paste. Assuming you can see "username" or "login" or something similar - and that you can copy something from the login screen of whatever os you use.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 04:40 PM
I ca't help you there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 04:46 PM
My rrrrr key repeats - very annoying since all our dev environment passwords are "password"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 04:52 PM
Quote:
Originally Posted by cannabusto
The "n" key on my work laptop is unresponsive. I can't even get in as my username includes an n. I removed the key and cleaned but still nothing. Any idea what I can do here?
You should be able to enter "n" by using left ALT + 1 1 0.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 08:57 PM
Thanks all. Never knew I could get the onscreen keyboard up before logging in. That solved it for now. Will have to take it in in an attempt for a long term solution. I pray it involves a new computer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-14-2015 , 08:58 PM
Quote:
Originally Posted by Grue
I ca't help you there.
Lol this was me on work instant messenger all day.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-15-2015 , 03:09 AM
Google Doc guy strikes again! Keep in mind, right after this text conversation starts, I jumped on google drive and see him writing an intro that is half a page long.

I liked how he went from saying I started working -> I wrote 10 pages. I almost lost my **** when he said that.

Spoiler:


Reason why he says "git pull" is because that's something I said in an emails once to the group. So he's just repeating that phrase as if he knows what he's talking about.

Guy just loves lying. Or he's one big troll..

Last edited by Barrin6; 04-15-2015 at 03:23 AM.
** 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