Wrong encoding in R presentation - encoding

I've struggling a lot with this problem since last week: I am using R presentation (.Rpres file) for the first time and it started alright, meaning that I could build a slide and visualize the result in the Presentation tab in RStudio. However, for reasons I don't understand, after a few hours of working on my presentations the Presentation tab began to show weird symbols for all the french characters in my presentation. The only way so far I could get the presentation back to showing the right characters was by playing with the "Save with encoding..." and "Reopen with encoding..." options in Rstudio.
The problem is that although this has made the french characters in the presentation look good, it is now the text in the source file (.RPres) that looks all weird (e.g. "température" instead of "température").
Here is some more details on my setup, if this can help:
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=French_Canada.1252 LC_CTYPE=French_Canada.1252 LC_MONETARY=French_Canada.1252
[4] LC_NUMERIC=C LC_TIME=French_Canada.1252
attached base packages:
[1] graphics grDevices datasets stats utils methods base
other attached packages:
[1] readxl_0.1.1 sp_1.2-2 foreign_0.8-66 data.table_1.9.6 dplyr_0.4.3 bit64_0.9-5
[7] bit_1.1-12 RPostgres_0.1 DBI_0.3.1.9008 Rcpp_0.12.3.2
loaded via a namespace (and not attached):
[1] lattice_0.20-33 assertthat_0.1 chron_2.3-47 grid_3.2.3 R6_2.1.2 magrittr_1.5
[7] tools_3.2.3 parallel_3.2.3
I really hope someone will find a solution to this as I like this tool and would like to keep using i in the future. I was thinking of trying the revealjs package as an alternative to fix my problem but I haven't (not sure I won't have the same problem).
Thanks for your help.

This problem might be related to the locale specified for your computer, as explained here: https://superuser.com/questions/655273/r-locale-setting-problems-on-mac-os-x
If the result of system("locale") contains a lot of values "C", then you should try the command
system("defaults write org.R-project.R force.LANG en_US.UTF-8")
After this, you should restart R and use system("locale") to check that the locale has been updated, and hopefully you should now be able to get the correct characters the next time you compile your document.
Note: I know that this strategy has solved a similar problem for users on Linux and OS X, but I don't know if it also works if your OS is Windows.

Related

Executing g-code from file within a ST-program in the software Automation Studio from B&R

I have a 3-axis system, which resembles the CNC-axis, and a PowerPanel from B&R. Now I plan to execute the g-code, which I read from a file, which is fe located in the Downloads folder. This will be done with fbs from B&R Automation Studio.
I got confused with the help, since it says in drive engineering/mapp Motion/technologie/function block/mpcnc3axis/description the part of moveProgram, where it redirects you to MC_BR_MoveProgram \ description. There stands that you can start the program with [Program name prefix] [File device name:] [Path] Program name syntax. Now I am not sure how to include this with my MpCnc3Axis code or if I can use the syntax also in MpCnc3AxisParType ProgramName part to start the program from fe Downloads Folder, since it didn't work with McPrgAdvParType InitProgramName.
Any links to related material would be appreciated.
I would also accept a solution with C, if it is easier.
Depending on if you are willing to buy software licences from B&R, running a CNC system is more or less easy.
The state of the art implementation is with mappMotion. It requires software licenses and gives you ready to go FUBs to execute nc files, jogging, direct movements, etc. This works the same way for different robot types and CNC kinematics. I recently uploaded a small implementation of a robot on GitLab: https://gitlab.com/kirni/bur_robotic_sample
The alternative is the old ARNC0 approach. No more new features are implemented, but it is free - as long as you do not need any functions that require a Dual Use agreement (i.e. 5 Axis CNC, etc.). The implementation is rather complex and is definitely to extensive to be answered completely at stackoverflow.
However Automation Studio ships with a sample for a two axis CNC. In the logical view you can add a new object Library Samples which opens a dialog where you can select Samples/Motion/CNC system (2 axis)/LibARNC0_Basic_ST.zip. This would be the best starting point, which is also documented in the help in MotionControl/ACP10 ARNC0/Examples/CNC or guid: 4620bb1c-8694-4f27-87d0-805686d7c0c8 as of AS 4.4.4.64.
I hope this helps!

How to decode a string in Visual Basic 6

I'm trying to read .DB (Paradox 5) file within my Visual Basic 6.
Everything's OK except encoding/charset. It shows as Iieiei 75a instead of cyrillic string.
This is my ODBC Connection string:
Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 4.X;DataCodePage=ANSI;BDE=2;CollatingSequence=ASCII;AutoTranslate=No;DBQ=C:\Database;DefaultDir=C:\Database
Please note that software like Borland Database Desktop shows this strings without any problems. Also everything is fine in another PC.
I set following settings via regedit, by it doesn't help:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase]
"DataCodePage"="ANSI"
"BDE"=dword:00000002
I also tried to use CharToOem/Oem2Char Win API functions, it doesn't help.
Any ideas?
Okay I have solved this by changing following registry values:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase]
"DataCodePage"="ANSI"
"BDE"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
"1252"="1251.nls"
Last setting has solved the issue.

Linux does not work with Acer UT220HQL touchscreen

The controller is identified as a TPV OpticalTouchScreen.
The Vendor and Product IDs are: 25aa:8882.
Edit - I corrected the title from "Recognize" to "work with", since I believe the driver attempted to work, the driver/hardware needs a specific tweak to prevent going into a uncommunicative state.
Benjamin showed me how to apply the same quirk flag as is applied to the TPV model 8883. And now it works as expected for single touches (I don't use and therefore have not tested multi-touch)
I believe Benjamin will apply the fix into the source code, so eventually this will work automatically. But to get up and running now, do the following:
Append "usbhid.quirks=0x25aa:0x8882:0x8" into your kernel boot string. Most people will need to do this in their boot loader (GRUB or similar). Raspbian users like myself will need to append it in /boot/cmdline.txt
I applied this fix to my Syslinux Append line, digitizer now works. Two finger scroll works in Chromium as well. Arch Linux 4.1.5-1-ARCH

error in jasperserver :Resource interpreted as Script but transferred with MIME

I know this may be duplicate question.
I have this error when I start my community jasperserver, and load a report has custom visualization component , and this error occur.
disappear. when I call:
http://localhost:8080/jasperserver/reportresource/reportresource?resource=com/jaspersoft/jasperreports/customvisualization/resources/require/cv-component.js
nothing returns, so this may be the problem right ?
but when I start the jasperserver commercial version , this error disappear. when I call:
http://localhost:8080/jasperserver-pro/reportresource/reportresource?resource=com/jaspersoft/jasperreports/customvisualization/resources/require/cv-component.js
it returns the content of this cv-component.js.
any idea ?
the trick (which wored for me after hours of triel-and-error) is to set the proper configuration in jasperreports.properties (on an windows machine):
com.jaspersoft.jasperreports.components.customvisualization.require.js=file:/C:/path/to/require.js
net.sf.jasperreports.web.resource.pattern.customvisualization.scripts=com/jaspersoft/jasperreports/customvisualization/resources/require/.*
See the "file:/...." and "...require/.* specially... (a bit different than in teh jaspersoft docs...)
Cheers, Thomas

"News System" acting different on different systems

I have 2 servers which I though were synchronized (dev and live) but the "News System" (extension key "news") makes something different.
In the dev server this line
<f:format.date format="%A">{newsItem.datetime}</f:format.date>
outputs "Freitag", as expected (Thats friday in German)
But in the Live Server, it outputs %AM. Which is even weirder is that l (alone, without %) outputs "Friday" in English.
I've checked all the configurations I've seen and I cant seem to find where the difference between the systems is.
Any idea?
TYPO3 is using DateTime::format (http://de2.php.net/manual/en/datetime.format.php) to format the date. This method is using the same syntax of date() which is not using locales, so all output is english.
The only thing I can not explain is why your dev enviroment accepts %A to render the date. Are there different PHP-Versions? Which TYPO3 Version are you using? Get a look at /typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php, you will get the answer there.
I just solved it! Turns out I had 4.7.7 in my live server, and that doesnt support stftime.
Funny, I never thought that such an important feature would be added in an 4.7.X update...