|
hahaha
i stole it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
If (your_pitchfork == missing) honey_the_codewitch_stole_it;
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
honey the codewitch wrote: the pages are essentially ASP ... porting them over to a WebForms project
So you've got something written in ancient Sumerian, and you're going to bring it up-to-date by translating it into Latin?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That sounds about right.
I speak Ancient Geek
Adding, the only reason i'm porting it is to get it to run on code other than my little C# based webserver. heh
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
something some code i'm working on made me realize that blew my hair back a little:
HTTP keep-alive connections are sometimes served on the same server thread request to request because of the way sockets work
that means on the server, if you keep something around thread-static, you can (unreliably) keep state on that connection!
this is very useful for caching - where the state doesn't have to be there but it's useful for speeding things along if it's around. Lock free cache woo.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Mark the day on the calendar. Today a sinister hack was born.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
It's not so sinister if it's used only as an optimization. Just be very careful with it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: Just be very careful with it. ...said the mother to the young son wielding scissors for the first time.
Message Signature
(Click to edit ->)
|
|
|
|
|
lopatir wrote: ...said the mother to the young son wielding scissors for the first time.
Or fork[^] (don't follow link if you're sensitive, but yes, he's ok)
|
|
|
|
|
Quote: Or fork[^] There was apparently a case in England where a length of rebar went through a construction worker's head but went precisely between the two halves of his brain and did no lasting damage.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Yeah, I remember that one.
But "don't run with rebars" doesn't have the same oomph to it.
And that picture is a bit to far off from being kid sister safe, even if the guy was ok afterwards.
|
|
|
|
|
A hack is and stays a hack. It will paitiently wait for years, until you have forgotten it completely. And then, one day, it will fail spectacularly and someone will have really great days with panicking bosses, crying customers and don't you dare come with something that does not have your little optimization. The sinister hacker usually is long gone by then, but the poor guys who will have to get this cow off the ice will curse you.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Honestly because i'm just using it for holding a cache the worst case is either it hits all the time or it misses all the time depending on the situation.
the rough bit of it is understanding how it works if you haven't had a (brief) tutorial on its behavior.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
And sure as hell this will go wrong the worst way possible when it does. What you did my be fairly harmless. Those who come after you may not be as careful or may not even see any problem. Fast forward a few years and let's say a new OS version comes along, the behavior you have been exploiting changes and the fun begins.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Nothing I'm using is undocumented. Worst case, one day connections will no longer keep to the same thread.
In such a scenario that cache will still be used due to thread pooling, just maybe across connections, which is fine unless you're relying on that. Which is possible, but stupid to do and hard to do.
So anyway, as hacks go, this isn't really much of one. Edited (again) to add, this isn't even so much a hack as an observation about keep-alive.
It simply is faster when the connection uses the same thread. If it doesn't, you get a cache miss.
Here's the thing: I'm not using any undocumented API calls. I'm not using anything where the behavior *relies* on this thread sharing property of connections.
There's nothing to break except for breaking changes in .NET - at which point ALL of our .NET code is in trouble.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Would you be surprised if that actually happened? Have the Mickeysofties ever washed their hands in innocence? They did not explicitly guarantee anything, after all. They don't even guarantee that their stuff is fit for any particular use. Forget this and you already are on your way to the Dark Side. Have them add 'Sith Lord' to the titles on your business cards.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Like I said, if they make breaking changes to something in .NET we're all in trouble
They'd have to change the behavior of the ThreadLocal<t> class provided in .NET 4
Now they *could*. Of course they could. They could also make a breaking change to System.String, or System.Threading.Thread.
Nobody is safe. Hide your children.
The truth is, whenever you use someone else's library, you run that risk if you rely on it.
That's the nature of software development and this is as true of the less used types like ThreadLocal as is is to more intrinsic and common types like System.String
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
And you'll write this up as a short article, right?
cheers
Chris Maunder
|
|
|
|
|
I think that might do more harm than good!
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Microsoft's T4 template engine uses entire different context switch tags (<# #>) than its asp/asp.net context switch tags (<% %>) for no other reason I can discern other than to make porting them back and forth more painful.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Because, you know, never waste the occasion to piss-off your customers
while (!(success = Try()));
|
|
|
|
|
That seems to be the highest goal of each and every company these days. Mickeysoft has lost its monopoly on that.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Because they could. That's called design by committee. The guys who sit there can talk all day without deciding anything. That is further complicated by everyone having his own agenda, which often has nothing to do with any technical concerns. In some cases not even remotely with reality.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
modified 6-Sep-19 10:46am.
|
|
|
|
|
Probably designed by a different team? And could be useful to tell them apart?
|
|
|
|
|
i'm not sure anyone would have a hard time figuring out which was which. I'm sure it was a different design team but they used all other aspects of ASP syntax lie <*= and <*@ - they simply changed the percents to hashes.
i don't know. I can do a couple of dodgy search and replaces to fix it but i wouldn't want to have to rely on that. thankfully i'm not in this situation much.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|