|
Actually, I think a thread on different ways to skin a cat might end up being censored.
|
|
|
|
|
My biggest laugh of the week so far is in the article Dereference operator - Wikipedia[^]
The See also section at the bottom has one item: Segmentation fault.
Dang! My '58 Renault Dauphine has another flat tire.
|
|
|
|
|
MrChug wrote: My biggest laugh of the week so far is in the article Dereference operator - Wikipedia[^] Well don't leave me in suspense. What's funny about it?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I have heard people scream with laughter from someone reading out from the phone book "Alphabetizing rules applied".
If you just read it out loud in the "right" way, almost any text can be funny. Even in printed form, lots of text (certainly from scientific reports and the like), when taken out of context and presened as a free-standing statement, may appear ridicolous. In my student days, we sometimes used that as party game: You read out a small excerpt that sounds gibberish in isolation, and make people guess the context (and explain how it makes sense).
|
|
|
|
|
That bit when he said "p is a pointer", absolutely priceless.
|
|
|
|
|
Do termites not get Covid-19 because they have anty bodies?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
The royal flycatcher won't catch corona because it already has a crown.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
They're already social distancing because they're living in sects.
|
|
|
|
|
I hear Antlions are immune as well; they spend loads of time in sand-itizer.
|
|
|
|
|
Sounds like an underground movement!
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
How wood I know?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I wouldn't know, but there should be mounds of evidence, one way or the other. Maybe ask the pupals still in school.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
(Actual (non-programming) question at the bottom)
There's this thing that's been bothering me for a while now.
We've got Razor Pages in .NET Core, which has some really cool features (if you're happy with good old forms rather than SPAs).
For example, having a property such as the following:
[Required]
[StringLength(64, MinimumLength = 1, ErrorMessageResourceType = typeof(Texts), ErrorMessageResourceName = nameof(Texts.StringLengthError))]
public string Name { get; set; } And some Razor syntax like this:
<input asp-for-vue="Name" class="form-control" /> Generates the following HTML:
<input type="text" data-val="true" data-val-length="The Name must be at least 1 and at max 64 characters long." data-val-length-max="64" data-val-length-min="1" data-val-required="The Name field is required." id="Name" maxlength="64" name="Name" class="form-control"> By using resource files, the error messages get translated depending on the language of the user requesting the page.
There's binding between the front-end and back-end (I think through the "name" attribute, but may be the "id" attribute as well).
Pretty sweet!
However, it does absolutely nothing in terms of front-end logic.
If you have a collection, for example, and you need to add an item, Razor Pages is not doing anything for you.
So that's where I wanted to use Vue and that's where the problems start...
Using Razor, you'd do something like this to render the initial list:
@for (int i = 0; i < MyItems.Count; i += 1)
{
<input asp-for-vue="MyItems[i].Name" class="form-control" />
} That renders the complete list in the back-end and you can't use v-for (from Vue) because that will render the whole list again in the front-end!
However, using purely Vue, you'd get something like the following:
<div v-for="myItem in myItems">
<input v-model="myItem.name" class="form-control" />
</div> Now you're missing the data-val attributes as well as the id and name attributes (and thus your binding).
Adding them manually is just a pain and kind of defeats the whole point of using Razor!
Now I've spend my weekend building something that does both.
<div asp-list-for-vue="MyItems">
<input asp-for-vue="MyItems[0].Name" class="form-control" />
</div> Or, if you like your Vue syntax:
<div v-for="(myItem, index) in myItems">
<input asp-for-vue="MyItems[0].Name" class="form-control" />
</div> The generated HTML will be:
<div v-for="(myItem, index) in myItems">
<input type="text" data-val="true" data-val-length="The Name must be at least 1 and at max 64 characters long." data-val-length-max="64" data-val-length-min="1" data-val-required="The Name field is required." :id="'MyItems_' + index + '__Name'" maxlength="64" name="'MyItems[' + index + '].Name'" v-model="myItem.name" class="form-control">
</div> Now, adding an extra item to your list, like so:
myModel.myItems.push({name: ''}); Will automatically trigger some Vue magic and add a new item with id and name set so it will be correctly submitted to the back end.
It even works with nested lists.
Am I the only one who has this problem/wish?
I'm thinking of submitting the code to GitHub (it's not a lot although currently pretty limited) so other people may use it.
Is there any interest for such a solution?
|
|
|
|
|
Sander Rossel wrote: I'm thinking of submitting the code to GitHub as an article
FTFY
|
|
|
|
|
Was thinking about that as well, but I'm polling if people need this first
Could be a nice introduction to extending ASP.NET Core tag helpers
|
|
|
|
|
Sander Rossel wrote: polling if people need this first
When did that ever have anything to do with it.
I wrote my articles mainly for the feedback.
With 14 million users there's bound to be someone that needs it!
|
|
|
|
|
I'm a busy man nowadays, I'm juggling a couple of software projects and writing a-plenty on the side (just not for CP).
I have to pick my battles carefully
Jörgen Andersson wrote: With 14 million users there's bound to be someone that needs it! I guess you're right about that though!
|
|
|
|
|
Seems like excellent material for an article, here !
sheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Pah!
you are 10 days late man!
Forget Razor, forget Vue, use Blazor Web Assembly!
|
|
|
|
|
So much truth in your words...
|
|
|
|
|
at least they tend to be more funny when there is.
With all of the "marriage sucks" jokes lately (a lot of them by one specific member) it makes me wonder why do people bother getting married? Why do people keep getting married if it's such torture?
I've never understood that. Marriage sucks jokes have been around forever yet people keep getting married.
If your marriage is like all of these jokes, I suggest you go to counseling. Marriage does not have to be and should not be torture. It should be the best relationship you ever have. I suppose for some of you, maybe it is torture AND the best relationship at the same time.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Marriage is a religious notion, not biological. Marriage does suck. It has its benefits, but there are more cons than pros, IMHO.
|
|
|
|
|
I got this advice from a friend just before getting married: Marriage solves a lot of problems that didn’t exist before. 😀
|
|
|
|
|
|
Sure, it's religious. It's also political, which is an even better reason to avoid it. But it's also biological: albatross (amongst many other species) mate for life.
|
|
|
|