How to switch on/off the "spark.sql.legacy.timeParserPolicy","LEGACY"? - time

Hi I was asked to program a function which can switch between time legacy and back.
"spark.sql.legacy.timeParserPolicy","LEGACY"
It should be possible to set the time legacy on and do datetime conversions.
It should als be possible to reset the option.
How can this be done?
So far I could find only information about how to set the option
spark.conf.set("spark.sql.legacy.timeParserPolicy","LEGACY")

You can use spark.conf.set("spark.sql.legacy.timeParserPolicy","CORRECTED") to reset the option.
Here is the link for your reference - https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/parameters/legacy_time_parser_policy

Related

How best to suppress javascript:S3827 when my code uses Microsoft Asp.Net Ajax code?

Problem: we are wanting to use SonarJS but much of our old Javascript code uses functions from the Microsoft ASP.Net framework (and the MS AjaxToolkit). As such we have a couple of hundred occurrences of the error "XXX" does not exist. Change its name or declare it so that its usage doesn't result in a "ReferenceError". (where XXX is Sys, Type, $get etc.).
I appreciate that I could suppress these by specifying them all in the sonar.javascript.globals property (as per the Elena Vilchik's answer to this question ) but it feels like what I really want to do is to add my own bespoke entries in sonar.javascript.environments (called msajax and msajaxtoolkit say). Then I could be more precise about when to include / exclude these globals.
So I guess I would like to know whether defining my own environment is supported or if there is a more elegant solutions overall.
Thanks in advance.
You are more than welcome to open pull request for https://github.com/SonarSource/sonar-javascript. Edit "javascript-frontend/src/main/resources/org/sonar/javascript/tree/symbols/globals.json" by adding new group/groups of names.

How to disable dates before today in DatePicker tool in Windows Phone? [duplicate]

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

Limit date range in a DatePicker

First of, is there any real documentation of the toolkit ? What I would like is to specify a range of selectable dates. For example I don't want to display dates before today. If the user select a start date of Jan. 27th 2012, I want to allow only dates after these for the return date
Documentation is a little bit sparse for the toolkit - your best bet is to look in the source of the sample app but they don't cover all the scenarios.
The default control doesn't seem to support a minimum or maximum value for the selected date, but if you download the source you should be able to modify it according to your needs. The layout of the source is pretty straightforward and you should be able to find an acceptable place to add the code, the only thing you need to decide is how you handle it from a UI perspective. In my opinion, you are better off handling the range check once the control returns - if it is an invalid date, pop up a message and re-show the control.
I've found that in the absence of documentation, the WindowsPhoneGeek blog (in this specific case see link here) usually does a good job of explaining the Silverlight Toolkit components in their various articles.
These articles can be a great help when following ZombieSheep's advice of taking a look at the toolkit sample code.

Flex 4 Combo - using IME

I am trying to use ime (for hiragana input) in a flex 4 spark combo.
On creation complete I am setting the following.
cbx_text.textInput.imeMode = IMEConversionMode.JAPANESE_HIRAGANA;
And to check, tracing the following:
trace(cbx_text.textInput.enableIME); returns true;
trace(cbx_text.textInput.imeMode); returns JAPANESE_HIRAGANA;
However, when I select the text input and start to type some text I am unable to switch to hiragana.
I can set it to work on a textinput component with no problems.
<s:TextInput imeMode="JAPANESE_HIRAGANA"></s:TextInput>
Has anyone had any experience with this?
Any insights much appreciated.
Although I haven't had any experience with IME, I took a quick look at the documentation : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/IME.html
Can it be that it's not enabled application wise? That, maybe what returns true is only valid for the component you are tracing from?
Obvious questions first:
Are you certain the TextInput is a member of cbx_text? I know this seems silly, but it's best to eliminate the obvious first.
Do you have an IME enabled on your computer? For example, do you regularly type in hiragana on your computer and have the appropriate language pack enabled?
Are you sending the IME the string appropriately? IME.setCompositionString() for windows computers?
Does your OS support the use of IMEs? Linux only supports the following methods:
Capabilities.hasIME
IME.enabled <= Can set or return value.
Try tracing hasIME and see if it's installed. Again, we're shotgunning here – trying to track down any possibility of a problem.
When all else fails, go to the source:
http://livedocs.adobe.com/flex/3/html/help.html?content=18_Client_System_Environment_6.html

capturing what keys were used to launch vbscript

I have an application that has 'macro' capabilities. When I map some keys on the keyboard to perform the 'macro', I can also have it launch vbscript instead.
What i'd like to try and do is within my vbscript figure out what keys were used in order to launch the script. Is it posible to do this? Could there be a way in vbscript to figure out what keys were last touched on the keyboard and then I could apply my logic.
The purpose of doing this is to keep the code in a single .vb file instead of several seperate .vb script files(one for each keyboard mapping, possible 3-4). Obviously we are looking to just maintain 1 file instead of multiple files with essentially the same code in each one.
I am leaning towards the idea that this is not possible, but i figured this would be a worthy question for the masses of StackOverflow. Thanks for the help everyone!
What you are asking for is not possible.
Can you change your VBScript to accept parameters and then call it with a different parameter based on which hotkey was selected?
I agree with aphoria, the only way to make something like this possible is if your keyboard mapping software allows you to assign a script/command with parameters/arguments. For example if you used
c:\Temp\something.vbs
then you would change this to
%WINDIR%\system32\wscript.exe c:\temp\something.vbs "Ctrl-Alt-R"
Then in your vbscript code you could collect the argument using the wscript.Arguments object collection to do actions based on what argument/parameter was passed. See the following two links for more info:
http://msdn.microsoft.com/en-us/library/z2b05k8s(VS.85).aspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0915.mspx
The one possible approach you may use is to install keylogger and read its log in your VBScript.
For example save script start time in the very beginning of the script
StartTime = Timer()
and then read one log record of your keylogger before this time.

Resources