Keyboard shortcuts for Zeppelin Notebook - keyboard-shortcuts

There was an old jira for keyboard shortcuts. But there did not appear to be an associated document
https://issues.apache.org/jira/browse/ZEPPELIN-391
Is there a comprehensive cheat-sheet for the shortcuts? Especially to compare to the excellent jupyter keyboard shortcuts; e.g. dd to delete a cell.

Here is a table for the shortcuts.
| shortcut | meaning |
|-------------------|-----------------------------------|
| Ctrl + up | move focus to previous paragraph |
| Ctrl + down | move focus to next paragraph |
| Shift + Enter | run the current paragraph |
| Ctrl + Alt + c | cancel paragraph |
| Ctrl + Alt + d | remove paragraph |
| Ctrl + Alt + k | move up |
| Ctrl + Alt + j | move down |
| Ctrl + Alt + a | insert new above |
| Ctrl + Alt + b | insert new below |
| Ctrl + Alt + o | toggle output |
| Ctrl + Alt + r | toggle enable/disable |
| Ctrl + Alt + e | toggle editor |
| Ctrl + Alt + m | toggle showing line numbers |
| Ctrl + Shift + - | width - 1 |
| Ctrl + Shift + = | width + 1 |
| Ctrl + Alt + t | toggle title |
Note: Some shortcut might not work depend on OS and browser.

There is a keyboard icon that lists them:
It is is missing some e.g.
ctrl + / comment whole line
ctrl + shift + / in-line comment

Related

How to index a specific column to perform field comparison calculations?

Given the following table:
| A | B | holdingtemp1 | holdingTemp2 | holdingtemp3 | holdingTemp4 | idx |
| Grits| 7:06:24 AM | 180.199 | - | - | - | 0 |
| | 8:35:56 AM | - | 174.30 | - | - | 1 |
| | 9:25:18 AM | - | - | 182 | - | 2 |
| | 10:02:0 AM | - | - | - | 180 | 3 |
How to properly index column B to perform field comparisons in order to implement conditional logic where each temperature recording must be taken within a two hour interval relative to the previous recording, such that:
if(B[0] + 2 > B[1], green(), red()) // 9:06 > 8:35, turns cell green
if(B[1] + 2 > B[2], green(), red()) // 10:35 > 9:25, turns cell green
Edit:
Found the right function to use for this implementation, but peak() is returning 4:43:21 AM for all records with
Peek('B', 0) as peekB, // 4:43:21 AM
and 5:11:03 AM with
Peek('B', 1) as peekB, // 5:11:03 AM
If so, does peek() fetch the field value of the preloaded or postloaded data?

Problem with string concatenation in Microsoft Access SQL query

I have a table in an Access 2016 database which contains information for several locations. Each location is stored in one of three formats:
(type 1) standard US address with house number
(type 2) street intersection
(type 4) GPS coordinates only
(type 3 is not used in this database).
I'm trying to concatenate the individual field values into a single string with a query, so that I can display that string in a text box on a report. The format for type 1 is
[HouseNumber],[HouseNumberSuffix],[PrefixDirectional],[StreetName],[StreetType],[Qualifier],[City]
which would look like "100 E UNION ST, SOMERSET" for row 2 in the example below.
The format for type 2 is
[PrefixDirectional],[StreetName],[StreetType],'/',[XPrefixDirectional],[XStreetName],[XStreetType]
which should look like "N CENTER AVE/E MAIN ST" for row 3 in the example below.
The format for type 3 is
[LatitudeY],"|",[LongitudeX]
which should look like "39.957384|-78.824255" for row 6 in the example below.
Types 1 and 2 are geocoded by the application producing this data, so they also include Lat and Long values (when available), but I don't need to consider those fields when concatenating those rows. In this implementation, many of the fields contain null values. Since Microsoft Access doesn't support the CONCAT_WS() SQL function, I've been wracking my brain trying to find a workaround to concatenate the strings while eliminating extra spaces for the null fields.
Here is a sample of my table:
Table: Dim_Address
|AddressID|LocationType|HouseNumber|HouseNumberSuffix|PrefixDirectional|StreetName |StreetType|XPrefixDirectional|XStreetName|XStreetType|Qualifier|City |LatitudeY |LongitudeX |
|---------|------------|-----------|-----------------|-----------------|----------------|----------|------------------|-----------|-----------|---------|----------|------------|-------------|
|1 |1 | | | |<UNKNOWN> | | | | | | | | |
|12 |1 |100 | |E |UNION |ST | | | | |SOMERSET |40.0092574 |-79.078380702|
|37 |2 | | |N |CENTER |AVE |E |MAIN |ST | |SOMERSET |40.008420389|-79.078610673|
|6363 |4 | | | | | | | | | |SOMERSET |39.996243 |-79.034395 |
|9302 |2 | | | |MARKLETON SCHOOL|RD | |ROCKDALE |RD | |ROCKWOOD |39.908031106|-79.160141687|
|9725 |4 | | | | | | | | | |BERLIN |39.957384 |-78.824255 |
|8282 |1 |222 | | |MAIN |ST | | | |APT 13 |MEYERSDALE|39.814387822|-79.026677269|
|55233 |1 |2110 |1/2 | |GRAHAM |AVE | | | | |WINDBER |40.230844268|-78.82551539 |
[AddressID], [LocationType], and [HouseNumber] are integers; [LatitudeY] and [LongitudeX] are doubles; the remaining fields are all strings.
And here is the code I'm attempting to use in my query:
SELECT
Switch(
[LocationType]=1,((CStr([HouseNumber])+' ') & ([HouseNumberSuffix]+' ') & ([PrefixDirectional]+' ') & ([StreetName]+' ') & [StreetType] & (', '+[Qualifier]) & (', '+[VenueName])),
[LocationType]=2,(([PrefixDirectional]+' ') & ([StreetName]+' ') & ([StreetType]+' ') & ('/') & ([XPrefixDirectional]+' ') & ([XStreetName]+' ') & ([XStreetType]+' ')),
[LocationType]=4,(CStr([LatitudeY]) & ' | ' & CStr([LongitudeX]))
) AS LocationConcatenation
FROM Dim_Address;
Here are the results I get when I run the query on the table above:
|LocationConcatenation |
|-------------------------------|
|#Error |
|100 E UNION ST, SOMERSET |
|#Error |
|#Error |
|#Error |
|#Error |
|222 MAIN ST, APT 13, MEYERSDALE|
|2110 1/2 GRAHAM AVE, WINDBER |
It works exactly as expected for type 1, except for row 1. On another post in this forum (CONCAT equivalent in MS Access), someone suggested that using + for concatenation would create empty strings if used to concatenate a string with another null, so I tried that, but Row 1 is still giving me grief. For types 2 or 4, the query doesn't work at all. Could anyone shed some light on where I'm making the mistake? I'm fairly familiar with SQL but am frustrated with the limited way that Access supports it. (BTW, <UNKNOWN> is used by the program that created this data as a placeholder for an address by default if an actual address is not entered by the user, so it appears in many records in a related table).
You can implement the equivalent of concat_ws() in MS Access using nz(), ltrim() and conditional logic:
select Switch(LocationType = 1,
ltrim(nz(" " + CStr(HouseNumber), "") +
nz(" " + HouseNumberSuffix, "") +
nz(" " + PrefixDirectional, "") +
nz(" " + StreetName, "") +
nz(" " + StreetType, "") + ", " &
nz(" " + Qualifier, "") + ", "
nz(" " + VenueName, "")
),
. . .
)

How to reformat columns in feature file in intelliJ for MAC

I have a feature file in IntelliJ but don't know how to reformat the columns. Tried a couple of options but none of them are working
I have tried Ctrl + Alt + L, Ctrl + shft+ Alt + L
Then the "abc" box should show the following options
| Value | i18n | status | Number |
| abc | [儲abcД] | true | |
| xyz | [儲굻ßxyzДß] | true | 3 |
| pqr | [儲굻ßДpqrДß굻] | true | 1 |
| def | [儲굻ßdefДß굻] | true | 1 |
Expected: These columns should be aligned.
You probably should enable/install Gherkin plugin, Settings -> Plugins. This plugin should enable syntax highlighting and formatting.

Cell Split Excel VBA using Multi-dimensional Array

I'm trying to split multi-line text box and paste the output on the next sheet in MS Excel using VBA, and I found a fragment of code below and it works:
Dim Str As String, a
Dim cnt As Integer
Dim w()
Str = xmlRequestTextBox.Value
a = Chr(10)
cnt = UBound(Split(Str, a))
MsgBox (Str)
MsgBox (a)
MsgBox (cnt)
ReDim w(1 To cnt + 1, 1 To 1)
For i = 0 To cnt
w(i + 1, 1) = Split(Str, Chr(10))(i)
Next i
Sheet2.range("A1").Resize(i, 1) = w
Sheet2.Cells.Replace Chr(13), " "
Now my problem is when I tried to modify it and change it to a single dimensional array, it only outputs the value of the first index of the array. Why does the array have to be multi-dimensional? Thank you in advanced.
For multi-line text you would need to use 2d-array returning by Split() function, where the first dimension typically refers to the rows (lines) and second index is referring to the individual words in these lines. Hope this may help.
an example of using split
Option Explicit
Private Sub CommandButton1_Click()
Dim Str As String
Dim cnt As Integer
Dim w As Variant
Str = Me.xmlRequestTextBox.Value
w = Split(Str, Chr(10))
cnt = UBound(w)
MsgBox (Str)
MsgBox (Chr(10))
MsgBox (cnt)
' suppose the multi-line textbox value is:
' first line : 1 2 3
' second line: 4 5 6
' third line: 7 8 9
With ThisWorkbook.Sheets("split")
.Range("A1").Resize(cnt + 1) = w(1) ' writes "4 5 6" in A1:A3 (i.e. the 2nd element of w)
.Range("B1").Resize(cnt + 1) = Split(w(0), " ")(2) ' writes "3" in B1:B3 (i.e. the third element of the 1st element of w)
.Cells.Replace Chr(13), " "
End With
End Sub
where I assumed that there's some UserForm with a multi-line textbox named "xmlRequestTextBox" and a button named "CommandButton1", whose click event starts that piece of code of yours
To answer your question, the array does not have to be multi-dimensional. However, Excel assumes a 1-dimensional array will be horizontal, that is, fill the columns in a single row. So if you're writing to a vertical range (multiple rows in a single column) in a spreadsheet, it will take the value of the first element (column) and write it to each cell in the column. For example, let's assume you have an array like this:
MyArray = Array(1, 2, 3, 4, 5)
This code will write the first element only of MyArray to the vertical range in column A:
Set MyRange = Range("A1").Resize(5, 1) ' Cells A1:A5
MyRange.Value = MyArray
Result:
A | B | C | D | E
+---+---+---+---+---+
1 | 1 | | | | |
2 | 1 | | | | |
3 | 1 | | | | |
4 | 1 | | | | |
5 | 1 | | | | |
If you write the array to a horizontal range in a single row then it will display the whole array:
Set MyRange = Range("A1").Resize(1, 5) ' Cells A1:E1
MyRange.Value = MyArray
Result:
A | B | C | D | E
+---+---+---+---+---+
1 | 1 | 2 | 3 | 4 | 5 |
2 | | | | | |
3 | | | | | |
4 | | | | | |
5 | | | | | |
However, I'm assuming you actually want to write the array to a vertical range in a single column. You can accomplish this by using the Application.WorksheetFunction.Transpose method on the array. This will write each element of the array into rows in column A:
Set MyRange = Range("A1").Resize(5, 1) ' Cells A1:A5
MyRange.Value = Application.Transpose(MyArray)
Result:
A | B | C | D | E
+---+---+---+---+---+
1 | 1 | | | | |
2 | 2 | | | | |
3 | 3 | | | | |
4 | 4 | | | | |
5 | 5 | | | | |
For more information on this, see Chip Pearson's page on VBA Arrays And Worksheet Ranges

How to add up row totals in report viewer

I'm new to reporting and the jargon that goes with so I will try to draw it insted of write it.
| | A | B | C | D | E |
-------------------------------------------------
| Apples | 1 | 3 | 6 | 2 | 12 |
-------------------------------------------------
| Oranges | 3 | 2 | 4 | 1 | 10 |
-------------------------------------------------
| Bananas | 5 | 3 | | 1 | 9 |
-------------------------------------------------
| | | | | | 31 |
I need to sum up the last column E where I indicated 31. The cells with values 12,10,9 are obtained by =Sum(Fields!A.Value + Fields!B.Value + Fields!C.Value + Fields!D.Value).
I can't change the sql query and/or the dataset that is used. Does any one have a suggestion? Thanks!
EDIT:
I've added a function to the code
Public Total_lookup_Sum As Integer = 0
Public Function Lookup_Sum(ByVal value As Integer) As Integer
Total_lookup_Sum = Total_lookup_Sum + value
Return Total_lookup_Sum
End Function
and calling like this Code.Equals(ReportItems!txtFruitTotal.Value) but I get FALSE.
With a help of a colleague the answer was reached:
Sum(Fields!A.Value) + Sum(Fields!B.Value) + Sum(Fields!C.Value) + Sum(Fields!D.Value)
In the Cell Where 31 is simply, make this Expression
=Sum(Fields!A.Value) + Sum(Fields!B.Value) + Sum(Fields!C.Value) + Sum(Fields!D.Value)
OR
=Sum(Fields!E.Value)