|
What's this article doing in the forum?
Wout
|
|
|
|
|
wout de zeeuw wrote: What's this article doing in the forum?
I know... This definitely needs more details to be an article, but this subject has really captured my attention so much that I am planning an article on it.
|
|
|
|
|
I hope you write the article !
cheers, Bill
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
Funny seeing enable developer mode in an application intended for developers.
|
|
|
|
|
Yeah, it is interesting.
It's really because it is an OS setting similar to what they do in Android OS.
In Android OS to enable dev mode you had to tap on the Android About... item 7 times.
It was odd.
|
|
|
|
|
I ran across a Stack Overflow post that stated that C# 7.3 supports a new feature in which I am keenly interested. The obvious next question is whether I have C# 7.3, and how do I find out?
The answer given elsewhere on SO works great on the dedicated C# compiler, but falls short on the new Roslyn compiler. The new command, along with an example of its output from my installation, follows.
C:\Users\DAG 2018/08/13 20:21:18.28>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe" /langversion:?
Supported language versions:
default
1
2
3
4
5
6
7.0 (default)
7.1
7.2
7.3 (latest)
latest
C:\Users\DAG 2018/08/13 20:21:31.33>
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
That output looks like the command works as expected. What were you expecting to see?
Your compiler supports C# 7.3, but defaults to 7.0. To turn on 7.3, you need to change the advanced build settings. Open the properties of your project, select the "Build" tab, click the "Advanced" button, and select the language version you want.
NB: For some bizarre reason, you need to change the version separately for each build configuration.
4 ways to enable the latest C# features - Meziantou's blog[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
My point is that the instructions in the SO post, which version of C# am I using - Stack Overflow, which I forgot to cite, imply that it's in the general help message displayed when you pass the compiler "/?" to display the general help message. While that command yields lots of useful tidbits, you must amplify it a bit to get the list of supported C# language versions.
Nevertheless, your reply called to my attention something which I hadn't noticed, which is that the default version in my installation is 7.0, not 7.3, as at first appeared to be the case. Thanks for the additional tidbits about how to override that.
Of the four ways mentioned, the one that calls to me is the properties file, since that supports overriding all sorts of default values for every project. Though I haven't dug into the global property sheets for C#, I've made extensive changes to my C++ settings.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
I never got that too, why not default to the latest stable release?
|
|
|
|
|
Nish Nishant wrote: why not default to the latest stable release? If it was that easy... everyone could do it
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
That's exactly what I expected it to do. However, I can understand some motivation for setting it to the last whole version.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
I think the idea is to avoid breaking previously-compiling code unless you ask it to.
(I haven't seen any C# 7.0 code that would be broken by the 7.3 compiler; but it's always best to CYA.)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yeah, but Visual Studio 2017 defaults to 7.0 for new projects too.
|
|
|
|
|
I agree, it's annoying.
You can apparently override it by putting a magic file in a directory somewhere above your project:
Customize your build - Visual Studio | Microsoft Docs[^]
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
But I don't like that solution. As soon as you share your project with someone who doesn't have the magic file, they'll start getting compiler errors for all the new features.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I created a datetime variable like so
LET vTEST = '2018-09-05 13:27:14.5';
Then, I tried various methods to strip the time component from the date. Here are the various techniques for doing this, along with their generated results:
DATE(MAKEDATE(YEAR($(vTEST)), MONTH($(vTEST)), DAY($(vTEST))), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(FLOOR($vTEST)), 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05 00:27:00.000"
DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF') = "2018-09-05" <======== THIS is what I wanted
A Qlikview datetime is represented by a floating point number with the date on the integer side of the decimal point, and the time on the fractional side. I honestly thought the FLOOR function would do what I want, but it left the minutes untouched, which resulted in the variable still having a time component. The only way I could get the time completely stripped is illustrated in the last example.
Have I mentioned how much I hate working in Qlikview?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Perl scripts?
Is regex possible with this Qlikview crap?
modified 7-Aug-18 10:42am.
|
|
|
|
|
John Simmons / outlaw programmer wrote: YYYY-MM-DD HH:MM:SS.FFF
Seriously? The format strings don't differentiate between "month" and "minute"? 💩
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Perhaps it's context sensitive.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I like positive thinking.
|
|
|
|
|
Perhaps the feature "common sense" was integrated. If it sees HH, then the next format will treat minutes regardless of the casing
|
|
|
|
|
John Simmons / outlaw programmer wrote: DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
In my geeky teens I would have thought, "oh wow, this is so cool, 4 levels of parens!" and shown it to all my friends (erm, wait, what friends???) who would have gone "wow, that IS cool!" (if I had any friends.)
Now in my geeky 50's I'm with you -- I look at that and think, wow, what BS is this?
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Marc Clifton wrote: "oh wow, this is so cool, 4 levels of parens!"
And your geeky friends would have mocked you because there are 5 levels...
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If he were counting parens, 4 would be the average between the left and right side.
edit: sorry, didn't see the post below which mentions this.
"Go forth into the source" - Neal Morse
|
|
|
|
|
qlik example DATE(NUM(DATE(FLOOR($(vTEST)) 'YYYY-MM-DD HH:MM:SS.FFF')
This is the necessary stage of declarative programming* that occurs right before AI takes over and writes all the code for us.
Yes, it's like SQL and yes I hate SQL also*.
<bumpersticker>Real Devs Hate SQL</bumpersticker>
|
|
|
|