|
I was probably thinking of the upcoming snow...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
Now that you mention it, I can't really think of too many devs I've known whom I'd trust with a spanner.
Or a stove, for that matter; they can stay on the other side of the kitchen, with the microwave.
And there's no way I'd let any of 'em near my windows registry.
Or powerpoint. God forbid they get within a mile of that.
Or any documentation tool, since we're in that area.
Sewing needles? Get plenty of lemons in, for the bloodstains.
And if you like your home in an un-burned-down state, don't ask them to change a fuse or a lightbulb.
Basically, we're a pretty useless lot, except for messing about with code and spending hours deciding what haircut and eye colour a man-at-arms should have.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
The three most dangerous entities:
A hardware guy with a computer program
A software guy with a soldering iron
A manager with an idea
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
too true!
|
|
|
|
|
I can:
Fix a motorcycle engine.
Cook a gourmet meal.
Sew curtains, curtain liners, tablecloths, napkins, pillow cases, mostly via the sewing machine.
Change fuses and lightbulbs, wire a house, wire a motorcycle loom from scratch, fit a shelf, heck - create furniture including shelves, solder, desolder, read a circuit diagram, fix a PCB (with a circuit diagram).
Oh, and I can bang out code too.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What a wuss.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I prefer "Multi Talented Wuss", if you don't mind.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Mark_Wallace wrote: I can't really think of too many devs I've known whom I'd trust with a spanner
WARNING: WAR STORY INCOMING
When I first started my current job, my test machine was in a hardware lab. I used to pick up a screwdriver with an intent look on my face just to mess with the technician.
Software Zen: delete this;
|
|
|
|
|
Mark_Wallace wrote: Or any documentation tool, since we're in that area.
As a dev I would just like to know what this 'documentation' thing is and why I would need a tool for it?
I, for one, like Roman Numerals.
|
|
|
|
|
The pattern of noise my hard drive makes for each is distinct enough that I can tell which one is working.
Real programmers use butterflies
|
|
|
|
|
Three little letters: 'S', 'S', and 'D'.
Try it. You won't go back.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Three little letters: 'S', 'S', and 'D'. Spin, Shriek, Die?
But yeah, fully agree. SSD is the way to go.
only regret is when on someone else's still on HDD computer - regret forgetting to bring a book to read
|
|
|
|
|
OriginalGriff wrote: Try it. You won't go back. I did.
I replaced the SSD with a 2TB drive, to save having to carry external drives and/or have everything on bloody annoying memory sticks.
I don't really give a damn if a program loads a tenth of a second faster, or if windows boots in three seconds less. Once stuff is loaded, memory is faster than SSD (unless it isn't any more; I don't read all the tech press), so I just max out the memory on all my machines.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
my next machine will have a 2TB nvme system drive.
Real programmers use butterflies
|
|
|
|
|
Same here, unless I splurge out for 4tb.
I probably won't though unless prices fall a lot in the next 2 years (or QLC sweeps prosumer drives and a huge SLC cache is needed to keep performance up); since my 6 year old 1tb SSD (best $500 upgrade I've ever made) is still only ~56% full.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
you know, I want to be hard on my little pike VM lexer for taking .028 msecs to lex my sample text.
vs. .004 msecs for my DFA lexer
but then i have to consider that my lexer is powered by a virtual machine (a pikeVM written in C#), running in a virtual machine (.NET CLI) running in a virtual machine (virtualbox)
It's not half bad.
Real programmers use butterflies
|
|
|
|
|
|
This is NOT a programming question. Just something you might want to be aware of.
So I migrated my project and fixed that various things in Startup that broke. Stupid things, like apparent env.IsDevelopment() doesn't exist anymore, and IHostingEnvironment has to be changed to IWebHostEnvironment or something like that, and app.UseMvc(); is wrong now and you have to use:
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
instead, and I don't have Razor pages anyways.
And I do wish that the whole NuGet package manager / Visual Studio would figure out that when I change the target framework, yes, please go and get the appropriate packages for the new framework, and now I need to specifically install the System.Data.SqlClient framework? And we're no longer using Microsoft.AspNetCore.App but instead need Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.SqlServer?
Sigh. Fine, relatively easy fixes, and all that was an aside, relatively easy to fix, but annoying.
So, once I got it to compile, fired it up and tried a very simple API call that returns an access token.
Now, in .NET Core 2.2, the response at the client contains the key "access_token"
In .NET Core 3.1, the response at the client contains the key "token"
As in:
JSON.parse(xhr.response).access_token;
has to be changed to:
JSON.parse(xhr.response).token;
WTF?
On the C# side, the return from the API call is the same:
ActionResult<IAccessToken>(resp.token)
where IAccessToken is quite literally just:
public interface IAccessToken
{
string Token { get; set; }
}
Now here's where it gets interesting. resp is actually a tuple: (IAccessToken token, HttpStatusCode status)
and I'm returning the token part of the tuple resp.token (checking the status is not necessary because if the status isn't "OK", then the token is null so the full line is actually:
ret = resp.token.Token == null ? Unauthorized() : new ActionResult<IAccessToken>(resp.token); but that's irrelevant to this discussion.
The point being, .NET Core 2.2 serializes the container IAccessToken differently than .NET Core 3.1.
Good grief. I would not have expected that kind of a breaking change. Why the heck is 2.2 prepending "access_" to the key? And what else breaks in the serialization of objects with 3.1?
And (shame on me) why didn't I notice that weird "access_token" issue to being with? I even wrote up the example response in the documentation with that!
There's a lesson here somewhere. Don't trust .NET Core. Don't trust open source projects. And notice stupid things, because if I had, I could have at least forced it to return what I expected.
And here's another fun one. This code:
client = context.Client.SingleOrDefault(acct => acct.Token == token && (!acct.IsDeleted || allowDeletedAccounts));
Given:
[NotMapped]
public bool IsDeleted { get { return (Deleted ?? 0) != 0; } }
(yes, we have a Deleted flag as a nullable integer in our tables) - this code works fine in .NET Core 2.2.
But noooo, EF can't figure out what to do with it in .NET Core 3.1. So instead:
client = context.Client.SingleOrDefault(acct => acct.Token == token && (((acct.Deleted ?? 0) == 0) || allowDeletedAccounts));
And that breaking change isn't discovered until runtime! (Like the serialization issue when the client tries to parse out the token.)
So how many places in the code base break at runtime and you won't know until you've executed all the possible code path queries?
Now, while I had tried .NET Core 3.1 because there were posts about multi-part content being broken in .NET 2.2 and it was fixed in .NET Core 3.0, it turns out that that wasn't the reason my file uploads weren't working.
But that's a whole other story. Involving pretty much 8 hours of try this, google that, and getting so pissed off (which is rare for me) that I really wanted to just go on a rampage. Because, at the end of the day, it's quite simple, but nobody actually tells you the important things you need to make sure you do correctly. That will become an article, so that somewhere in the cloud there will be a concise example explaining why and not just glossing over the critical, key, pertinent, essential, vital niggly little things you need to do to post FormData up to a .NET Core application. Grrr.
|
|
|
|
|
Marc Clifton wrote: Don't trust .NET Core. Don't trust open source projects.
Don't trust
FTFY
Real programmers use butterflies
|
|
|
|
|
Sounds like they did it on purpose because they couldn't support the old api going from 2.x to 3.x. Force you to update your code if you update your libs.
The one I remember (between "libs") was in one case you can use a single char for a string split separator, while the other version will (still) insist on an array. You think it's neat and change your code, then find your lib is no longer compatible with your other libs. I also ran into problems thinking all libs should serialize / compress the same ... not. They may actually read and write but the file sizes will be off.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Most of the serialization issues are from them switching from Newtonsoft to System.Text.Json. Beware if you have your own custom converters or attributes to change the serialized property names!
|
|
|
|
|
I can't see how any version of Entity Framework would be able to translate a query using your computed property to a SQL query. It's quite likely that EF Core 2.x was loading the entire table into memory and evaluating the condition as a LINQ-to-objects query instead. One of the breaking changes in 3.x is that it won't do that any more.
Old behavior
Before 3.0, when EF Core couldn't convert an expression that was part of a query to either SQL or a parameter, it automatically evaluated the expression on the client. By default, client evaluation of potentially expensive expressions only triggered a warning.
New behavior
Starting with 3.0, EF Core only allows expressions in the top-level projection (the last Select() call in the query) to be evaluated on the client. When expressions in any other part of the query can't be converted to either SQL or a parameter, an exception is thrown.
There are a couple of ways around this. You could make the property a computed column[^]:
modelBuilder.Entity<Client>()
.Property(acct => acct.IsDeleted)
.HasComputedColumnSql("CAST(IsNull(Deleted, 0) As bit)"); Or use you use a value converter[^] on the property:
modelBuilder.Entity<Client>()
.Property(acct => acct.IsDeleted)
.HasColumnName("Deleted")
.HasConversion(new BoolToZeroOneConverter<int>()); in which case, you'd want to remove the Deleted property, and possibly make IsDeleted writable.
Either option should allow your original query to be evaluated in the database, instead of in memory.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Okay, so I have a set of "packed ranges" which are start and end position pairs stored as adjacent ints in an int array.
For example
var ranges=new int[] { 'A','Z','a','z','_','_' };
would indicate the ranges A-Z, a-z, and the single character _ (range _-_)
Here's the thing. I need them in order. I don't care if they overlap.
So all i do is I sort the array as a flat array of ints.
This *shouldn't* screw with any of my ranges I think?
Can anyone think of a case that will break this? remember i don't care if ranges overlap.
I just need to make sure that after i sort, the same ranges are in the array.
I broke it. LOL answered my own question
Real programmers use butterflies
|
|
|
|
|
Where do I put in a bug report?
The "Hide" and Copy code" links continue to work, even though they've been struck out.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I noticed that too. You say bug, I say feature. I wonder if it copies the code struck out?
Real programmers use butterflies
|
|
|
|
|