Apache Zeppelin: interpreter.json keeps getting reset - apache-zeppelin

I'm trying to change the default interpreter in an interpreter group.
Specifically, I'm changing
"defaultInterpreter": true,
to
"defaultInterpreter": false,
in
{
"name": "spark",
"class": "org.apache.zeppelin.spark.SparkInterpreter",
"defaultInterpreter": true,
"editor": {
"language": "scala",
"editOnDblClick": false,
"completionKey": "TAB",
"completionSupport": true
}
},
Then changing the next section (Spark SQL) to true.
But then as I restart Zeppelin, interpreter.json gets reverted.
Please advice

Ok after digging around I think I found the right place.
In interpreters/< interpreter >/interpreter-settings.json is the actual place to edit the settings.
conf/interpreter.json is generated.
I wish these things were easily found in docs or via search though, not by developers digging and trying different things.

Related

How do I reset revapi / maven to avoid issues given a previous version?

I am on say 0.0.21-SNAPSHOT I just started using RevAPI and when I do it mentions there have been breaking changes. I can silence it like...
<versionIncreaseAllows>
<major>breaking</major>
<minor>breaking</minor>
<patch>breaking</patch>
<!-- TODO: Even though I have leaving in commented code we should really figure out how to make it the following. -->
<!-- <minor>nonBreaking</minor>-->
<!-- <patch>equivalent</patch>-->
</versionIncreaseAllows>
But as you can see I would rather use a more semantic versioning going forward.
Can I tell RevAPI with maven to reset?
I guess the simplest solution is just to disable Revapi before you release your 0.0.21 version and enable it right afterwards. To disable it, the simplest thing is just to skip the execution using the <skip>true</true> in the revapi-maven-plugin configuration.
If you don't want to do that, you can configure Revapi to use different configuration for each version of your library - e.g. https://revapi.org/revapi-maven-plugin/0.14.3/configuring-revapi.html#_custom_root_element_of_configuration (or you could come up with some setup where the config for each version was contained in a different file for example).
There, for version 0.0.21 (i.e. the to-be-released version) you'd configure Revapi to ignore all differences, e.g.:
{
"extension": "revapi.differences",
"configuration": {
"justification": "This is a baseline version for the future versions. We ignore any API changes made here as compared with older versions.",
"ignore": true,
"differences": [
{
"regex": true,
"code": ".*"
}
]
}
}
see https://revapi.org/revapi-basic-features/differences.html for details on the revapi.differences configuration.

Visual Studio 2019 debug embedded targets. How to force VS to not treat it as a windows executable

I am trying to set up Cmake ARM uC (STM32) embedded project in the VS 2019.
Project buils OK but I struggle to start the debug session.
I have amended launch.vs.json
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "cppdbg",
"name": "GCEC-FW.elf",
"project": "out\\build\\IoT-Debug\\GCEC-FW.elf",
"projectTarget": "",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}\\BUILD\\${workspaceRootFolderName}.elf",
"MIMode": "gdb",
"externalConsole": true,
"inheritEnvironments": [
"gcc_arm"
],
"miDebuggerPath": "${env.gccpath}\\bin\\arm-none-eabi-gdb.exe",
"setupCommands": [
{
"text": "-environment-cd ${workspaceRoot}/BUILD"
},
{
"text": "-file-exec-and-symbols ${workspaceRootFolderName}.elf",
"description": "load file",
"ignoreFailures": false
},
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"visualizerFile": "${debugInfo.linuxNatvisPath}",
"showDisplayString": true,
"miDebuggerServerAddress": "localhost:3333",
"launchCompleteCommand": "None",
"debugServerPath": "C:\\Program Files (x86)\Atollic\\TrueSTUDIO for STM32 9.3.0\\Servers\\J-Link_gdbserver\\JLinkGDBServerCL.exe",
"debugServerArgs": "-port 2331 -s -CPU Cortex-M -device STM32F427II -endian little -speed 4000 -vd -swoport 2332",
"serverStarted": "GDB\\ server\\ started",
"filterStderr": true,
"filterStdout": true
}
]
}
But when I try to start the debug session I am getting error stating that my .elf file is not an win32 executable (which is actually correct - it is not).
The question is: what has to be done VS to start this session?
edit
I needed to change the name when adding appending the new microcontroller debug configuration.
"name": "GCEC-FW.elf"
Now it complains about the path to the gdb.
The new question is: can I output or see build variables in VisualStudio - Like
${workspaceRootFolderName} or ${env.gccpath}
Regarding "... can I output or see build variables in VisualStudio - Like: ${workspaceRootFolderName} or ${env.gccpath}
To display all of the currently available macros, in the Property
Pages dialog, under VC++ Directories, choose the drop-down arrow at
the end of a property row. Click on Edit and then in the edit dialog
box, choose the Macros button. The current set of properties and
macros visible to Visual Studio is listed along with the current value
for each. For more information, see the Specifying User-Defined Values
section of C++ project property page reference.
More here about that.

Single quote in tsx file with prettier

For 2-3 weeks, while I didn't change anything in prettier file, VSC started changing single quotes to double quotes, while it was always single quotes. I tried many options but it keeps changing it. Heres my .prettierrc
{
"trailingComma": "es5",
"printWidth": 200,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"quoteProps": "as-needed"
}
EDIT: I think, that it is a matter of .tsx files, as prettier has just option for .jsx files but still didn't find a solution.
In .prettierrc, add:
{
"singleQuote": true,
"jsxSingleQuote": true
}
create a .prettierrc file on your root folder and add:
{
"singleQuote": true
}
I have the same issue for a few days. I checked all the settings and they seem to be fine.
At the moment THE ONLY thing that helps is downgrading down to the previous version of Prettier in my case it was version 2.3.0 (I didn't check all the versions between this and the latest but few of them had the same issue)
On your User Settings make sure you have the following line:
"prettier.singleQuote": true
You can access the user settings by CTRL+, on windows or CMD+, on mac.
If you're using the settings GUI just search for single quote and check/uncheck the Prettier: Jsx Single quote and Prettier: Single quote
Best place to read up on this configuration is the website.
https://prettier.io/docs/en/configuration.html
If you are using a package.json, create a new key if you dont have a "prettier" key.
"prettier":{
"singleQuote": true
}
Or you could create a .prettierrc file written in JSON and add the same key pair value.
add tsxSingleQuote: true, in prettierrc.js file

Apache Zeppelin - Set default interpreter

In Zeppelin, at each row I am having to provide the interpreter at each row. Is there a way to set the interpreter for the whole session.
%pyspark
import re
Took 0 seconds.
import pandas as pd
console :1: error: '.' expected but identifier found. import pandas as pd
%pyspark
import pandas as pd
Took 0 seconds.
How do I set the interpreter for the whole session?
The Spark Interpreter group currently has 4 interpreter as listed here...
https://zeppelin.incubator.apache.org/docs/0.5.0-incubating/interpreter/spark.html
The default interpreter is %spark and default interpreter is selected based on the order of the interpreter listed in the zeppelin.interpreters property in zeppelin-site.xml config file.
The current order of interpreter in your zeppelin-site.xml (zeppelin.interpreters property) will be this ...
org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter
Modify this to ...
org.apache.zeppelin.spark.PySparkInterpreter, org.apache.zeppelin.spark.SparkInterpreter
and restart Zeppelin (zeppelin-daemon.sh restart)
This will make %pyspark as default interpreter.
Thanks
The above answer did not work on recent Zeppelin versions.
To set the default interpreter, check /etc/zeppelin/conf/interpreter.json and look for something like:
...
{
"name": "spark",
"class": "org.apache.zeppelin.spark.SparkInterpreter",
"defaultInterpreter": true,
"editor": {
"language": "scala",
"editOnDblClick": false
}
},
...
{
"name": "pyspark",
"class": "org.apache.zeppelin.spark.PySparkInterpreter",
"defaultInterpreter": false,
"editor": {
"language": "python",
"editOnDblClick": false
}
}
Now everything seems trivial. We just need to change the defaultInterpreter of spark to false, and defaultInterpreter of pyspark to true.
And then restart the zeppelin (sudo stop zeppelin; sudo start zeppelin).
Even Fishball's answer for recent Zeppelin seems outdated. My conf/interpreter.json came with spark as default ("defaultInterpreter": true) and python/pyspark as not ("defaultInterpreter": false) and yet Zeppelin picked up python/pyspark as default. And in my case, I wanted spark over pyspark.
The solution was to just drag and drop interpreters in Zeppelin web console's interpreter binding section.
change zeppelin.interpreter.group.default in conf/zeppelin-site.xml from spark to whichever interpreter you would like to use.

Babel Snippets for ReactJS not working in sublime text

I edited my key bindings because the only trigger that would work inside the editor is when I type rcc. Was hoping that when I type cdm, it will work. This is the package I installed - https://github.com/babel/babel-sublime-snippets
{
"keys": ["ctrl+shift+,"],
"command": "insert_snippet",
"args": {
"name": "Packages/Babel Snippets/react_wrap.sublime-snippet"
}
}
to this
{
"keys": ["ctrl+shift+,"],
"command": "insert_snippet",
"args": {
"name": "Packages/Babel Snippets/react_componentDidMount_(class).sublime-snippet"
}
}
For people who will encounter this in the future. I got it working. Part of the problem that confused me was that there was no documentation on what and how to add a snippet. There was an instruction for adding a keybinding for react_wrap. Normally when we see tons of snippet files, we would do the same thing, add config for each files.
I really didn't have to add the react_componentDidMount_(class).sublime-snippet. I was told to type cdm inside the class and it worked.
Make sure the current language selected is not javascript but javascript(Babel). If you don't have it, just install it from package manager. It's available by the name of Babel
Also you can set it the default language for some extensions like .jsx.

Resources