The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
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).
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
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:
<inputtype="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).
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)
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:
<divv-for="myItem in myItems"><inputv-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.
<divv-for="(myItem, index) in myItems"><inputasp-for-vue="MyItems.Name"class="form-control"/></div>
The generated HTML will be:
<divv-for="(myItem, index) in myItems"><inputtype="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:
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?
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.