What is the complete list of keys in ClipboardActionTransformations.xml to configure Remote Desktop - keyboard

There is very little documentation on ClipboardActionTransformations.xml which can be edited to map keys in Remote Desktop.
For example, if I want to map the (host Mac) command key to be the (client Windows) ctrl, I would use the following:
<?xml version="1.0" encoding="utf-8" ?>
<!-- transformation for clipboard actions (cut copy paste) -->
<!-- layout specific -->
<layouts>
<layout name="default">
<transformations>
<transform>
<from command="1" key="A" />
<to control="1" key="A" />
</transform>
</transformations>
</layout>
</layouts>
repeating transform for each key.
This file should be copied into the Remote Desktop app after it is updated.
sudo cp ~/ClipboardActionTransformations.xml /Applications/Microsoft\ Remote\ Desktop.app/Contents/Resources/Keyboard
What are all the other keys?

Viewing the contents of /Applications/Microsoft\ Remote\ Desktop.app/Contents/MacOS/Microsoft\ Remote\ Desktop I have found:
Num1, Num2, etc.
F1, F2, etc.
LeftBrace, RightBrace (or Bracket?)
Return, Tab, Delete, Escape
Comma, SemiColon, Period
Slash, BackSlash
Space
Equal, Minus
LeftCommand, RightCommand
LeftShift, RightShift
LeftControl, RightControl
LeftOption, RightOption
CapsLock
Apps
ForwardDelete, Delete, Insert,
PageUp, PageDown, Home, End
UpArrow, RightArrow, DownArrow, LeftArrow
and
Keypad1, Keypad2, etc.
KeypadDecimal
KeypadMultiple, KeypadDivide, KeypadPlus, KeypadMinus
KeypadEnd
KeypadEnter
KeypadCl???
Modifiers are:
control
command
option
shift
Note:
most of the symbols are truncated, so I'm guessing at them (I couldn't guess one keypad symbol)
I could not find the symbol for ' or `
I haven't tested them all, so some may be incorrect
I haven't had much luck mapping the Windows key, in particular, when I press command, but don't press another key, the Start menu pops up which is annoying
I haven't managed to get the Windows clipboard to show when pressing controlV, but it does show when pressing commandshiftV which is good enough

Related

In MSBuild, how to split a string on endlines?

Other questions (MSBUILD Splitting text file into lines) mention implementation-specific alternatives, but none seem to directly address how to split a simple string property into an item group based on endlines.
How can you do this? Attempts that didn't work:
<ItemGroup>
<SplitLines Include="$(SourceString.Split('\r\n'))" />
</ItemGroup>: (splits on 'r' or 'n')
<ItemGroup>
<SplitLines Include="$(SourceString.Split('%0A%0D'))" />
</ItemGroup>: (doesn't split at all)
In case you're curious: SourceString is the output of an Exec command that needs splitting, so ReadLinesFromFile isn't an option. It can't output to an intermediary file because file systems are slow and this needs to be used by build processes that care about file operations.
Using property functions is the way to go and you can search for sulutions using e.g. 'C# split string lines' in your search engine of choice, then translate the answer. This comes up with this SO question and the Regex.Split method is the easiest to implement:
<ItemGroup>
<SplitLines Include="$([System.Text.RegularExpressions.Regex]::Split(`$(SourceString)`, `\r\n|\r|\n`))" />
</ItemGroup>

How to use cTAKES from the command line?

I wonder how to use Apache cTAKES from the command line.
E.g. :
I have a file note.txt that contains some text like "Patient had
elevated blood sugar but tests confirm no diabetes. Patient's father had
adult onset diabetes."
I want to use the provided analysis engine
\apache-ctakes-3.2.2-bin\apache-ctakes-3.2.2\desc\ctakes-clinical-pipeline\desc\analysis_engine\AggregatePlaintextUMLSProcessor.xml
How can I get the analyse engine's output (viz. the annotations) using the
command line (i.e. without using graphical user interfaces such as UIMA CAS
Visual Debugger or the Collection Processing Engine)? I'd prefer to
use the provided JAR files rather than having to compile the code.
The question is fairly simple but I couldn't find the information in
cTAKES's README or
on Confluence.
Please try the following steps to use cTAKES CPE from the command line (the key class is "org.apache.uima.examples.cpe.SimpleRunCPE"):
Change directory to $CTAKES_HOME/desc/ctakes-clinical-pipeline/desc/collection_processing_engine/
Copy test_plaintext.xml to another file (e.g., "test_plaintext_test.xml").
Edit "test_plaintext_test.xml" to set input directory; find "nameValuePair" with name = "InputDirectory", and set the value string to the input directory. The following example set the input directory as "$CTAKES_HOME/note_input":
<nameValuePair>
<name>InputDirectory</name>
<value>
<string>note_input</string>
</value>
</nameValuePair>
Similarly, edit "test_plaintext_test.xml" to set the output directory ("$CTAKES_HOME/result_output" in the following example):
<nameValuePair>
<name>OutputDirectory</name>
<value>
<string>result_output</string>
</value>
</nameValuePair>
Save "test_plaintext_test.xml" and change directory to $CTAKES_HOME/bin.
Copy runctakesCPE.sh to another file (e.g., "runctakesCPE_CLI.sh").
Edit "runctakesCPE_CLI.sh"; replace the last line ("java ...") to the following line ("USER" and "PW" should be replaced by your UMLS Username and Password, and the memory setting Xms and Xms may be adjusted based on the size of memory on your machine):
java -Dctakes.umlsuser=USER -Dctakes.umlspw=PW -cp $CTAKES_HOME/lib/*:$CTAKES_HOME/desc/:$CTAKES_HOME/resources/ -Dlog4j.configuration=file:$CTAKES_HOME/config/log4j.xml -Xms2g -Xmx3g org.apache.uima.examples.cpe.SimpleRunCPE $CTAKES_HOME/desc/ctakes-clinical-pipeline/desc/collection_processing_engine/test_plaintext_test.xml
Save "runctakesCPE_CLI.sh", and then create the input directory ("$CTAKES_HOME/note_input") and the output directory ("$CTAKES_HOME/result_output").
Put your note.txt to the input directory (e.g., "$CTAKES_HOME/note_input/note.txt"), and then run "runctakesCPE_CLI.sh".
cTAKES CPE will start running under command line mode, and the resulting file will be generated in the output directory (e.g., "$CTAKES_HOME/result_output/note.txt.xml").
I actually used your note.txt to run the steps above and here are the first several lines of the generated note.txt.xml:
<?xml version="1.0" encoding="UTF-8"?><CAS version="2">
<uima.cas.Sofa _indexed="0" _id="3" sofaNum="1" sofaID="_InitialView" mimeType="text" sofaString="Patient had elevated blood sugar but tests confirm no diabetes. Patient's father had adult onset diabetes.
"/>
<org.apache.ctakes.typesystem.type.structured.DocumentID _indexed="1" _id="1" documentID="note.txt"/>
<uima.tcas.DocumentAnnotation _indexed="1" _id="10" _ref_sofa="3" begin="0" end="107" language="x-unspecified"/>
<org.apache.ctakes.typesystem.type.textspan.Segment _indexed="1" _id="15" _ref_sofa="3" begin="0" end="107" id="SIMPLE_SEGMENT"/>
<org.apache.ctakes.typesystem.type.textspan.Sentence _indexed="1" _id="21" _ref_sofa="3" begin="0" end="63" sentenceNumber="0"/>
Hope this helps :-)
java -Dctakes.umlsuser=USER -Dctakes.umlspw=PW -cp $CTAKES_HOME/lib/*;$CTAKES_HOME/desc/;$CTAKES_HOME/resources‌​/ -
Dlog4j.configuration=file:$CTAKES_HOME/config/log4j.xml -Xms2g -Xmx3g to_replace $CTAKES_HOME/desc/ctakes-clinical-pipeline/desc/collection_p‌​rocessing_engine/tes‌​t_plaintext_test.xml
replace "to_replace" with either
org.apache.ctakes.ytex.tools.RunCPE or
org.apache.ctakes.core.cpe.CmdLineCpeRunner

Visualization of 3-dimensional grid from X_Y_Z(seperate datasets) on Paraview without using xdmf

Reading netcdf files with Paraview using xdmf
I used to parse netcdf files with an xdmf script in order to create 3DSMesh on paraview. On top of it, I was adding scalar or vector fields. (So 3DSMesh provides physical coordinates).
I never though if it is best way to do that actually. It works, so I was OK. Please let me know if there is more convenient way.
I am able to create a 3-dimensional grid with the following script.
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf xmlns:xi="http://www.w3.org/2001/XInclude" Version="2.0">
<Domain>
<Grid Name="gridxyz">
<Topology TopologyType="3DSMesh" NumberOfElements="0032 0032 0063">
</Topology>
<!-- Read Coordinates -->
<Geometry GeometryType="X_Y_Z">
<DataItem Name="X" Format="HDF" NumberType="Float" Precision="8" Dimensions="0032 0032 0063">
grid_x.nc:/gridx
</DataItem>
<DataItem Name="Y" Format="HDF" NumberType="Float" Precision="8" Dimensions="0032 0032 0063">
grid_y.nc:/gridy
</DataItem>
<DataItem Name="Z" Format="HDF" NumberType="Float" Precision="8" Dimensions="0032 0032 0063">
grid_z.nc:/gridz
</DataItem>
</Geometry>
<!-- Read Scalar -->
<!-- Here I have bunch of scalars stored in different netcdf files -->
</Grid>
</Domain>
</Xdmf>
Pros
xdmf scripts are great when someone needs repetitive tasks.
Cons
this script(s) needs to be generated somehow, or typed by hand. And required to be updated, when the dimensions or variable names are changed
if I want to read another scalar, I need to add a line
grid can be uniform in 2 directions and not uniform on the third one, no need to create 3D grid files, but geometry type dx_dy_dz is not enough to achieve that.
What I am looking for
Recently I realize, I can open netcdf files with paraview just by clicking open(Paraview4.3). So, I do not need these xdmf scripts anymore (few years ago I was not able to open netcdf files on Paraview).
How can I create 3DSMesh via Paraview GUI. Is that possible? Or is there any other simple/faster way (instead of writing a python script) ?
Is there any way read 1D coordinates and create 3D geometry using them ?
That's how I manage to do that. Certainly it's not the fastest way, but it works for me.
When you open a NetCDF file, paraview asks you to choose a reader, I always use NetCDF files generic and CF conventions .
After that, before hitting "Apply" button you have to select the appropriate "Dimensions" in the dropdown menu.
Your data now must be displayed as a UniformGrid, with your data(X,Y,Z) as scalars fields so you must transform to a grid to be more specific a StructuredGrid. In order to do that, apply the "ImageDataToPointSet" filter.
After that, apply a "Calculator" filter check "Coordinate Results" field and do the following:
If your data appears as X, Y , Z colummns put in the calculator field the expression
(X * iHat) + (Y * jHat) + (Z * kHat)
if your data appears with other names, substitute x, y, z with those names
The expression means that x is in the direction of the î vector, y is in the direction of the j vector and so on
Hope it helped!

Unicode characters (Arabic letters) show up as question marks in IDE console

I am using JSF 2.0 and I have text field as
<h:form>
<h:inputText value="#{myBean.myValue}" />
<h:commandButton value="Submit" action="#{myBean.printMe()}" />
</h:form>
public void printMe() {
System.out.println("first line==" + myValue + "==");
System.out.println("second line==يشسيبشسيبشسيبشيس==");
}
When I run this project and enter يشسيبشسيبشسيبشيس in textbox, in IDE console I see as below.
INFO: first line==????????????????==
INFO: second line==????????????????==
Any idea why this is happening?
This is caused by using the wrong console encoding.
The line
System.out.println("My Data is " + fullName);
prints to the standard output (stdout). You need to configure it to use UTF-8 as well. Assuming that you're using Eclipse, then you need to change the stdout encoding to UTF-8 by Window > Preferences > General > Workspace > Text File Encoding.
If you're using Netbeans, which I can't answer from top of head, head to this answer: hebrew appears as question marks in netbeans which contains a link to this Netbeans Wiki which mentions the following:
To change the language encoding for a project:
Right-click a project node in the Projects windows and choose Properties.
Under Sources, select an encoding value from the Encoding drop-down field.
See also:
Unicode - How to get the characters right?
Unrelated to the concrete problem, those lines in the filter are unnecessary
res.setCharacterEncoding("UTF-8");
res.setContentType("text/html;charset=utf-8");
They defaults in case of JSF2/Facelets to proper values already. Remove those lines.
If the data comes from a DB, please check the field datatype is nvarchar.

How can I syntax highlight a custom self closing script tag in vim?

I know that normal script tags can't self close, and I know less of vimscript than I might. I have been working with a custom XML templating language quite similar to HTML, and have been using the HTML mode along with the file ~/.vim/after/syntax/html.vim:
syn region javaScript start=+<is:PageComponents:Script[^>]*>+ keepend end=+</is:PageComponents:Script>+me=s-1 contains=#htmlJavaScript,htmlCssStyleComment,htmlScriptTag,#htmlPreproc
syn region htmlScriptTag contained start=+<is:PageComponents:Script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
The problem that I am experiencing is "spillover" of the highlighting region until the end of the file or the next closing script tag.
I have attempted changing start to: +<is:PageComponents:Script[^>]*\(\\\)\#<!>+, and +<is:PageComponents:Script[^>]*[^\\]>+, neither of which make a difference. As far as I understand regexes, the negative lookbehind should have been an ideal solution, and the one character match should have forced the greedy star to back off one character, resulting in failure. Replacing the * with \{-} for ungreedy behavior has the same result. What am I missing?
In case it's relevant, I'm running vim in Cygwin's mintty (type is xterm-256color), shell is bash, color scheme is solarized.
Edit: Adding sample of our markup language
<is:PageComponents:Template title="Page Title" controller="controller">
<is:PageComponents:Script src="/path/jsfile.js" />
<is:PageComponents:Style src="cssfile.css" />
<is:Containers:Box label="Box Label">
<is:DataGridComponents:DataGrid id="data_grid_id" data_provider="data_provider" keep_state="true">
<is:DataGridComponents:DataGridHeader />
<is:DataGridComponents:Columns strip_placeholders="false" id="%%id%%_row">
<is:DataGridComponents:Column header_title="Links Header">
<span class="popup-link popup-link-type1" id="type1_%%id%%">Type 1</span> |
<span class="popup-link popup-link-type2" id="type2_%%id%%">Type 2</span>
</is:DataGridComponents:Column>
<is:DataGridComponents:Column header_title="Data1">%%data1%%</is:DataGridComponents:Column>
<is:DataGridComponents:Column header_title="Data2">%%data2%%</is:DataGridComponents:Column>
</is:DataGridComponents:Columns>
<is:DataGridComponents:DataGridFooter>
<is:DataGridComponents:Pager id="pager_id" data_provider="pager_data_provider" for_component="data_grid_id" />
<is:Containers:Box id="footer_box_id" data_provider="footer_box_data_provider">Text: %%data%%</is:containers:box>
</is:DataGridComponents:DataGridFooter>
</is:DataGridComponents:DataGrid>
</is:Containers:Box>
<is:PageComponents:Script location="onready">
{literal}
// Insert literal JavaScript code here for the page
{/literal}
</is:PageComponents:Script>
{include file="path/file1.tpl"}
{include file="path/file2.tpl"}
</is:PageComponents:Template>
Both of my patterns worked correctly when I switched to using / instead of \ in my match.
The corrected patterns are:
+<is:PageComponents:Script[^>]*\(/\)\#<!>+ and
+<is:PageComponents:Script[^>]*[^/]>+.

Resources