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.
A few threads down, I reported finding a strange entry in my Startup folder after a clean install of Windows 10. The startup folder had an entry named simply "Program" with no icon and no publisher. Weird - right? A Google search turned up numerous cases of people with the same problem, but no one seemed to have the answer.
Well, after some sweat and tears, I got to the bottom of it: During the clean install I added one of my favorite apps. The installer for this app added an executable that is supposed to load and run at every start. I try to limit unnecessary startups that do nothing for me, so I deleted the executable. The app works fine without it. Therein lies the problem: The app installer adds a registry entry to run the executable at every startup. Since the target executable was gone, Windows added a do-nothing, empty entry called "Program" in the startup folder every time the machine started up.
The solution: I ran Piriform's CCleaner and let it do a registry scan. It listed all the registry entries that were problematical, including those entries that were missing their targets. Instructed Ccleaner to fix the registry and it deleted the entry that was causing the ghostly "Program" entry in my startup folder. QED!
So: If you ever come across an entry named "Program" in your startup folder, you may simply have a registry entry for which the target is gone. If you don't want the missing target anyway, you can use Ccleaner to fix the registry for you.
As always: Don't mess with the registry unless you know what you're doing and know how to recover from disasters.
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?