Zeppelin angular client-first is defined as an %angular paragraph with generated HTML output which is activated by an auto-run script:
<script>
changeValue($scope, value) {
$scope.myValue=value
}
(function() {
...
#!/usr/bin/env bash | |
string='/this is my string' | |
[[ $string =~ ^/(.*) ]] && string=${BASH_REMATCH[1]} | |
[[ $string =~ (.*)/$ ]] && string=${BASH_REMATCH[1]} | |
echo $string |
<!-- | |
~ Configures additional virtual folder in Zeppelin web server | |
~ to keep web assets for Zeppelin angular apps outside of | |
~ Zeppelin installation folder (i.e. when it is in a container) | |
~ The main purpose is to take client side angular UI code out of | |
~ zeppelin notebook and store it in normal html, js, css files | |
--> | |
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<!-- |
Zeppelin angular client-first is defined as an %angular paragraph with generated HTML output which is activated by an auto-run script:
<script>
changeValue($scope, value) {
$scope.myValue=value
}
(function() {
...
// Demonstrates usual z Angular bind/watch/change scenario (watch is working) | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
val logger: Logger = LoggerFactory.getLogger("MyZeppelinLogger"); | |
logger.debug("START"); | |
z.angularUnwatch("ax4_var") | |
z.angularUnbind("ax4_var") | |
logger.debug("Setting ax4_var=Init before watch"); |
// Shows how to persist paragraph data between spark interpreter restarts using Zeppelin GUI params storage | |
// Run it once, then restart interpreter and run again. Parameter "ax4_gui_param" shuld be restored | |
val ctx = z.getInterpreterContext | |
val param = ctx.getGui.getParams().get("ax4_gui_param") | |
if (param == null) { | |
s"Parameter is not persisted. Setting initial value" | |
ctx.getGui.getParams().put("ax4_gui_param","hello_gui_param") | |
} else { | |
s"Parameter is restored from Zeppelin GUI params collection: $param" | |
} |
// 1. Zeppelin InterpreterContext | |
// 2. How to get all angular objects registered in the note | |
z.angularBind("ax4_var","value") | |
val ctx = z.getInterpreterContext | |
ctx.getAngularObjectRegistry().getAllWithGlobal(ctx.getNoteId()) | |
z.angularUnbind("ax4_var") | |
ctx.getAngularObjectRegistry().getAllWithGlobal(ctx.getNoteId()) | |
// OUTPUT: |
// 1. Sequence of binding events on angular watch | |
// 2. nulls are accepted as both initial and new value | |
// 3. using the same value (even null) twice triggers the watch | |
// 4. Multiple watchers on the same variable | |
// 5. Bug in watch (before, after) | |
// 6. Use watch (before, after, context) - it is working as expected | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
val logger: Logger = LoggerFactory.getLogger("MyZeppelinLogger"); |
// ================================================================ | |
// Gist | |
// Zeppelin Version 0.6.2 | |
// Logging from zeppelin into a separate log file | |
// ================================================================ | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
val logger: Logger = LoggerFactory.getLogger("MyZeppelinLogger"); |
# #powershell #ps #sql #smo #status #isOnline | |
Import-Module “sqlps” -DisableNameChecking | |
function SMO-IsServerOnline { | |
[CmdletBinding()] | |
[OutputType([boolean])] | |
Param( | |
[string]$serverName | |
) | |
$srv = new-object Microsoft.SqlServer.Management.Smo.Server($serverName) |
# #powershell #ps #msdeploy #runCommand | |
function MsDeploy-RunCmd( | |
[string]$msdeployExe, | |
[string]$svr, | |
[string]$site, | |
[string]$command) { | |
$source="runcommand='$command'" | |
$dest="auto,computername=`"https://$($svr):8172/msdeploy.axd?site=$site`",authtype=`"NTLM`"" | |
$cmd = $(" `"$msdeployExe`" -verb=sync -source={0} -dest={1} -allowuntrusted" -f $source, $dest) |