Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 09-08-2018, 10:05 AM   #35101
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,555
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by maxtower View Post
Whenever a company does a round of investment, a valuation is created. Usually your hire-in options will be based on that valuation. So if you start the day after an investment round, your options will be worth about $0. You need the company to continue growing (and eventually have an exit event) to cash in.
In contrast, RSUs typically have some value the day they are granted but you have to wait some time to cash-in.


Iím not as familiar with RSUs, but this isnít true for options (at least in jurisdictions Iím familiar with).

Shortly after an investment round there are two important numbers. Thereís the price paid by investors per share. This is going to be higher than the per-share value of your options because theyíre getting preferred shares with a bunch of extra advantages (like protection of their capital or return, different forms of control, etc.).

Thereís also the 409a valuation (or equivalent) that is the value as assigned for tax purposes and itís almost always very pessimistic and generally doesnít take into account potential, market conditions, etc. This is usually the exercise price of your options. But this is almost always less than the expected per-share value of your shares.

Basically if a company exited shortly after an investment and shortly after you were granted shares (ignoring vesting) you would generally make money even if the company didnít grow.

Edit: And obviously this assumes fairly standard conditions on the preferred shares. If it was a tough raise the new investors might have things like ratchets that cause them to get a bunch of money and common shares to get nothing.

Thereís lots of complexities here but itís kind of amazing how little people generally understand about this when it can make up a large percentage of their real or perceived compensation.
jjshabado is offline   Reply With Quote
Old 09-08-2018, 10:44 AM   #35102
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 61,341
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Grue View Post
Imo if you don't push every commit eventually you will lose work. It might take a long time but it will happen. Since we squash and merge to master I don't care about feature branch history anyway.
with git reflog you can get every commit on your local. no matter if you hard reset (ie undo) it.
Victor is online now   Reply With Quote
Old 09-08-2018, 11:09 AM   #35103
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,555
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Grueís point though is that you could lose your local disk and any work you just have locally.

I guess heís probably right but it doesnít seem like a fight worth having given how incredibly rare this would be.
jjshabado is offline   Reply With Quote
Old 09-08-2018, 01:26 PM   #35104
KatoKrazy
Pooh-Bah
 
KatoKrazy's Avatar
 
Join Date: Jan 2009
Location: Orange County, CA
Posts: 4,053
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I used to work for an HDD company. I backup to remote daily if that tells you anything
KatoKrazy is offline   Reply With Quote
Old 09-08-2018, 04:10 PM   #35105
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

suzzer99 is offline   Reply With Quote
Old 09-08-2018, 04:28 PM   #35106
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,713
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Yes, look into immutabe js.

This is kinda like typescript in that it seems kinda annoying at first but its worth doing and avoids tons of bull****.

It is a pattern I originally learned from Redux and then went down several rabbit holes and now if I ever see "object.foo = x" I immediately cringe, or the even more cringeworthy "delete object.foo".
Larry Legend is offline   Reply With Quote
Old 09-08-2018, 04:40 PM   #35107
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I feel like a case where you get an object back from the DB and want to delete a couple of sensitive properties before sending on to the browser should be an exception.
suzzer99 is offline   Reply With Quote
Old 09-08-2018, 05:40 PM   #35108
heehaww
Pooh-Bah
 
heehaww's Avatar
 
Join Date: Aug 2011
Location: Tacooos!!!!
Posts: 4,614
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Any opinions on this? - Tuple Spaces (or, Good Ideas Don't Always Win)

Quote:
It's as if the metric system had failed, and we had to do physics with foot-acres and what-not.
Fair assessment?
heehaww is offline   Reply With Quote
Old 09-08-2018, 06:18 PM   #35109
goofyballer
Carpal \'Tunnel
 
goofyballer's Avatar
 
Join Date: Jun 2005
Posts: 66,896
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
gaming_mouse (don't think he's been around much lately?) used to espose things like this too, I think.

I'd be curious to see a large codebase full of immutable objects in action, anyone know of any on Github?
goofyballer is offline   Reply With Quote
Old 09-08-2018, 06:20 PM   #35110
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Well react is basically built on that concept right?
suzzer99 is offline   Reply With Quote
Old 09-08-2018, 08:46 PM   #35111
Craggoo
culled
 
Craggoo's Avatar
 
Join Date: Sep 2006
Location: R.I.P. ItzPenzoo 12-09-11
Posts: 12,533
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Well react is basically built on that concept right?
I can say that Elixir is based on that idea. You never modify an existing object. You create a new one.
Craggoo is offline   Reply With Quote
Old 09-09-2018, 12:53 AM   #35112
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 61,341
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
I feel like a case where you get an object back from the DB and want to delete a couple of sensitive properties before sending on to the browser should be an exception.
create a new object?
Victor is online now   Reply With Quote
Old 09-09-2018, 01:05 AM   #35113
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Why? You're not gonna use the object for anything else, it dies as soon as the response is passed anyway.
suzzer99 is offline   Reply With Quote
Old 09-09-2018, 11:05 AM   #35114
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,713
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

In a robust system with sufficient logging it lives on somewhere.
Larry Legend is offline   Reply With Quote
Old 09-09-2018, 12:44 PM   #35115
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 61,341
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
Why? You're not gonna use the object for anything else, it dies as soon as the response is passed anyway.
bc those are the rules. in other words, bc thats how it passes code review.
Victor is online now   Reply With Quote
Old 09-09-2018, 03:00 PM   #35116
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Larry Legend View Post
In a robust system with sufficient logging it lives on somewhere.
You also don't want sensitive data going into logs.
suzzer99 is offline   Reply With Quote
Old 09-09-2018, 03:17 PM   #35117
blackize5
old hand
 
Join Date: Sep 2012
Posts: 1,334
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Well you could just ask only for the data you need. Or take your model object and use a serializer or decorator to map to a new object without the sensitive fields.

You can see how starting to add special cases where mutation is ok begins adding additional cognitive load. Much easier for the language to just not support it or to disallow with a linter or whatever.
blackize5 is offline   Reply With Quote
Old 09-09-2018, 03:21 PM   #35118
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

These objects come from back end services we don't control. How is a model object or decorator less cognitive load than deleting a couple properties before sending JSON to the browser?
suzzer99 is offline   Reply With Quote
Old 09-09-2018, 04:47 PM   #35119
blackize5
old hand
 
Join Date: Sep 2012
Posts: 1,334
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Well it doesn't make a huge difference for that exact use case. But in the general it's very easy to go from just deleting a sensitive key to just deleting a sensitive key, just translating a value, just adding a default value...

So in my mind holding to the rule even in the simplest case is helping to prevent death by a thousand cuts.

I don't really have a strong opinion about this in languages that support and encourage mutation, but I do appreciate elixir for eschewing it.
blackize5 is offline   Reply With Quote
Old 09-09-2018, 09:39 PM   #35120
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 42,713
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
You also don't want sensitive data going into logs.
Yea true logging wasnt the best example for that.

But in practice I've always just copied the object by picking the keys that you want in the new object.
Larry Legend is offline   Reply With Quote
Old 09-09-2018, 10:19 PM   #35121
candybar
old hand
 
Join Date: Aug 2011
Posts: 1,975
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
These objects come from back end services we don't control. How is a model object or decorator less cognitive load than deleting a couple properties before sending JSON to the browser?
I don't necessarily care about enforcing immutability per se but I think in this case constructing a new object with just the fields you need is the right thing to do anyway since you want to control exactly what fields are sent to the client. Otherwise backend services can add fields to the payload and you will end up automatically including them.
candybar is offline   Reply With Quote
Old 09-10-2018, 12:22 AM   #35122
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Well the counter is that maybe you want to include them. So now instead of changing code in two places (api, client) to add new fields you have to change it in 3 places (api, client, middleware). I think for some cases a field blacklist instead of whitelist is fine - but it's obviously highly situation dependent.

That's the only time I can ever think of using delete.
suzzer99 is offline   Reply With Quote
Old 09-10-2018, 07:12 AM   #35123
maxtower
Carpal \'Tunnel
 
maxtower's Avatar
 
Join Date: Sep 2005
Posts: 7,907
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I think you're making this too complicated. Instead of thinking every time you want to change an object, you just make a copy of that object with the properties changed. Some languages make this easier than others.
For example, in kotlin (java makes this more verbose) you can just say:
Code:
data class DataState(
  val user: User,
  val goldStars: Int,
  val isOnline: Boolean
) { 
fun setUser(user: User) = copy(user = user)
}
Then to make a new object of the DataState:
Code:
val newDataState = oldDataState.setUser(newUser)
in the above example, oldDataState is immutable and doesn't change. Anything referencing it always points to the same values. Immutability matters a lot more in multi-threaded applications (but thats most of them) because side effects won't occur as a result of the data changing
maxtower is offline   Reply With Quote
Old 09-10-2018, 12:17 PM   #35124
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Yeah you can do that for sure. But delete is still less code, and I just don't see an advantage to making an object immutable for immutability's sake in a node/express app - where literally the whole framework is based on muting objects (adding to res.locals to pass along through the express middleware chain).
suzzer99 is offline   Reply With Quote
Old 09-10-2018, 07:53 PM   #35125
suzzer99
Save the Cheerleader, Save the World
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 92,137
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Btw I made a greasemonkey (now called tampermonkey) script to scroll pages back to the correct first unread post - after the tweets load inline and screw up the scroll position.

Code:
// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://forumserver.twoplustwo.com/*index*.html
// @grant        none
// ==/UserScript==

(function() {

    setTimeout(() => {
        $('html, body').animate({
            scrollTop: $(window.location.hash).offset().top + 'px'
        }, 100, 'swing');
    }, 3000);

})();
On Chrome tampermonkey is an extension, not sure about the other browsers. I set the timeout to 3 seconds which is a total guess. Seems to work ok so far.

It also should be easy to wire up to a hotkey to scroll back to the correct position instead of 3 second timeout if that's preferred.

Ideal would be to capture the event when all the tweets are done loading. But aint nobody got time for that.
suzzer99 is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 04:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online