This shortcut disappeared from my windows search. The executable is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
This shortcut disappeared from my windows search. The executable is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
Old school BlackJack game for Windows. Need to move this to the web/mobile next!
I keep getting this when trying to get dotnetcore running on linux:
Package libicu60 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘libicu60’ has no installation candidate
To solve this, I’ve done the following:
Install libicu60.
Much has been written over the years regarding the drawbacks of ASP.NET and how MVC/SPAs solve many of these problems, so there’s not much to rehash there. However, if you’re stuck working with older technology, there is a handy tool to make your ASP.NET WebForms site more responsive. Implementing the ICallbackEventHandler interface in your WebForms will help do the following:
To illustrate, lets create a callback that calculates a person’s age.
Here’s what the code behind looks like now:
The two important methods are GetCallbackResult and RaiseCallbackEvent. RaiseCallbackEvent is where the client’s payload enters our code. Immediately after executing this, the GetCallbackResult function returns a string, back to the client.
The *.aspx page looks like this:
I came across this gem the other day. Fortunately, I ran it locally first.
There are two tables. Person and AlienPerson. Lets create the tables and seed with some data.
Try to run a bad select statement:
Here’s the baddie. This will delete all data in the Person table:
To get this to happen, the following must be true:
1. The SELECT field in the sub-query must be named the same as the field in the outer WHERE clause.
2. The inner WHERE clause must reference a field in the outer table. Otherwise, the DELETE will not run.
Using:
Microsoft SQL Server 2012 – 11.0.5343.0 (X64)
May 4 2015 19:11:32
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.3 <X64> (Build 10586: )
If you’re about to use a Nullable<bool>, I would consider using an Enum or other data structure instead. It may help you avoid mistakes when the meaning of NULL is not known.
Recently, I mishandled a Nullable<bool>. I won’t go into the details of the mistake, but lets just say it was bad enough to require a full rollback. I began to wonder how practical it is to use in most applications. (In part in an attempt to hold on to my broken pride as a result of the stupid mistake )
In this stackoverflow post, the answer by “Lee” provides a good example of when to use a Nullable<bool> type:
Something can be true, false or undefined for many reasons. How would one answer “Is your third child a girl?” if one only has two children? Both true and false are incorrect. Null would be appropriate as saying that the comparison doesn’t apply.”
This seems to make sense, but the more time I spend with it, the answer becomes FALSE in practice instead of NULL. NULL is just too fuzzy.
Before answering this question one would have to assign a very specific meaning to NULL. Does NULL mean there was an error in the calculation? What if there is an error in the calculation before it is determined that there are only two children? (I would also argue that if there are indeed only two children, this could be handled before the question was posed to the program.)
Because we do not know what NULL means and because it is most definitely not TRUE (because, how could it be?) the BEST answer is FALSE.
Also, if this question indeed returns NULL, we’ve introduced a new definition to the domain. What is the scope of this definition?
So it would appear that TRUE or FALSE states represent a certainty regarding an outcome. NULL can be conceived of in at least three different states. For example, the statement “Thomas went to the bar last night.”
What does NULL mean here? Determining what NULL means must be performed on a case by case basis. This is why I believe it is often better to use an Enum or other structure as it more gracefully exposes the intention behind a non-binary return value.
Here is a rough example of what could be done:
Thanks for reading!!!
On a recent project, I had to provide export functionality for a web grid’s data source that contained wildly varying data structures. The XML structure contained anywhere between 1 to 10 levels of nesting and we needed to be able to export this data into an Excel or comma separate values file.
This code will show you how to turn a complex XML tree structure into a list of key-value pairs.
For example, here is a relatively simple data structure:
In order to get the structure ready for data export, this code turns the XML into a list of key value pairs.
And the console app…
Here is the output: