Results to Grid is substituting Tab for Space characters - tsql

I have a need to take some values from columns and combine together separated by Tab characters. However in SSMS when using "Results to Grid" I have discovered a strange behavior where it is substituting the Tab/CHAR(9) with a Space/CHAR(32). Using "Results to File" or "Results to Text" the expected behavior occurs.
Can this substitution behavior in Results to Grid be controlled?
PRINT 'a'+CHAR(9)+'b'
SELECT 'a'+CHAR(9)+'b'
Result:
a b
a b
Interestingly when run using OSQL the results are as expected, the tab remains present:
1> PRINT 'a'+CHAR(9)+'b'
2> go
a b
1> SELECT 'a'+CHAR(9)+'b'
2> go
----
a b

Related

QPad64's (QInsightPad's) output window

How do I get the q script output to be displayed in QPad64's (QInsightPad's) output window. I am presently starting q and QPad 64 with the following .bat file :
set QHOME=C:\Q\q
set QINIT=C:\code\server.q
set PATH=%PATH%;%QHOME%;%QHOME%\w32
START C:\QInsightPad-2.2_FREE-x64\qpad64.exe
Result: q opens in cmd window, but all output from scipts run in Qpad show up there ( in cmd ) instead of in Qpad's output window. How do I fix this ?
Qpad isn't really designed to be used like that. You could redirect the stdout and read it in to view in qpad.
\1 qproc.log
Your scripts could then have output to the log as certain things are done like so:
1"tables_loaded"
// \n for new line
1"\nfuncs_loaded"
read0 `:qproc.log
"tables_loaded"
"funcs_loaded"

Is there an option for Oracle SQL Developer so that query results with new lines are not embedded in quotes after copy-pasting?

When I try to copy the value of a single cell of a query result that contains new lines, the text is embedded in quotes:
For example, if I execute this simple query:
select 'foo' || chr(10) || 'bar' baz from dual;
and copy paste the (only) returned value and paste it into a text document, it appears as
"foo
bar"
(with the quotes). I'd rather not have the quotes. Is there a setting or option I am missing to change this behavior?
If you copy and paste from the Single Record View, you'll just get the 'raw text'

How to write or print multiple variable outputs with headers, line by line per tick to command center in netlogo

How does one write or print multiple variable outputs with headers, line by line per tick to command center in netlogo? the idea is to print out ticking results of more than one variable (reported by procedures) so that it appears in they appear as follows in the command center output window:
length weight height area
24.2 23.1 22.0 25.1
18.7 19.2 10.4 22.0
and so on, updating per tick in columnar form.
I eventually want to be able to use the export-output command to transport the output to a csv file at the end of the simulation run. I know there are other ways of doing this but I want it this way specifically for a reason.
You need the type and print commands. Your heading would need to be printed during initialisation and the variable values would need to be printed each tick. Assuming your procedures are named cal-length etc, code would look something like this. Note that there is no spacing control or other formatting.
to setup
...
print "length weight height area"
...
end
to go
...
dump-to-screen
...
end
to dump-to-screen
type calc-length type " " type calc-weight type " "
type calc-height type " " print calc-area
end

Unable to suppress echo with ROC in RMarkdown

I am not able to suppress the echo of roc command (pROC package) despite setting echo to FALSE in the code chunk. the roc commands outputs "call" and "data" lines to the pdf. Can anyone help me figure out how to turn it off?
---
title: "ROC echo"
output: pdf_document
---
```{r,echo=F,warning=F,message=F, comment=NA, results='asis',fig.width=10}
library(pROC)
data(iris)
iris$setosa <- ifelse(iris$Species=="setosa","setosa","not setosa")
iris.roc <- roc(setosa ~ Sepal.Width,data =iris)
plot.roc(iris.roc)
```
Note that echo only effects the printing of the source code according to knitr documentation, not the output of R commands:
echo: (TRUE; logical or numeric) whether to include R source code in
the output file;
What you really want is results='hide' instead of 'asis':
results: ('markup'; character) takes these possible values
(...)
asis: output as-is, i.e., write raw results from R into the output document
(...)
hide hide results; this option only applies to normal R output (not warnings, messages or errors)

PowerShell console host displays strings inconsistently

When I run this in PowerShell ISE, both strings are displayed identically.
When I run it in the console host, string $a is missing the empty line.
Why is that, and can I work around it?
I want to format blocks of text without using `n
$a = "there should be one emtpy line
between these two lines of text"
$b = "there should be one emtpy line`n`nbetween these two lines of text"
$a
$b
If you type that into the console host, you're correct; it won't work as expected. But if you save it in a file, then it does work as expected (the blank line is preserved).
I believe that this is because of the way the console host is using blank lines to interpret your input, since it needs to detect blank lines to tell when to stop input in some cases.
I don't know enough to know if it's a bug.
Something else that may not be clear is that when you write the way you're assigning it to $a, you're actually inserting CR and LF ("`r`n") when in the ISE host, whereas with $b you're just using LF. In the console host, a LF only is used.
To see that, I like to use [RegEx]::Escape:
[RegEx]::Escape($a)
[RegEx]::Escape($b)
Using this I was able to confirm that using the console host to enter the strings, the second LF is actually not present in the $a string; it's not simply a display issue.