Here is a screenshot of what's happening to my wordpresss template code time after time:
https://www.box.net/shared/zrql76wiimr790587yxj
I thought at first it was a notepad++ problem. But this occured also on phpstorm.
Any idea why that's happening?
Your code isn't messed up, this is a question about how your system handles lineendings.
Linux and OSX save lineendings differently from Windows.
Linux and OSX saves lineendings with a Line Feed (LF):
\n
While windows saves it with Carriage Return + Line Feed (CR+LF):
\r\n
So what is probably happening is that your file has been written on a system that doesn't save lineendings in the windows format. Your editor most probably supports these kind of line endings and can handle it, look into the menus of your editor.
** Below is part of an edit and not part of my answer.**
You can check EditorConfig which can be helpful when you are trying to keep settings across projects and/or editors and also, if you keep your code under git, Dealing with line endings article from Github may be also helpful.
End of edit
Read more here: Wiki article
Related
I have searched for a setting within the mvbasic extension within VSCode but I may have hit a dead end. I am new to using VSCode with the rocket mvbasic extension and still in the learning process, so please bear with me.
Our development for the most part has always been directly on the server using the editor within it to code and develop on a Unix/Aix platform with Unidata. Some of our code has array assignments with CHAR(253)/CHAR(254) characters within them. See the link to the image that shows how its done. Now I didn't do this code, the original software developer did this many many years ago and we just aren't going to go and change it all.
How code looks on actual server
The issue is when pulling the code to edit in VSCode, the extension is changing it, and I uploaded it back and didn't pay attention and it was implemented in our production incorrectly, which created a few bugs.
ALIST="H�V�P�R�M�D"
How code looks in VSCode
How code looks after uploaded back to server from VSCode
Easy to fix, no biggie, but now to my question.
Does anyone have this issue, or has a direction to point me into that maybe I need to create a setting to keep the characters in the correct ASCII format so that this doesn't happen again by mistake?
VSCode defaults to the sane choice for character encoding in 2022: utf-8, but sometimes you have to deal with legacy stuff.
https://code.visualstudio.com/docs/editor/codebasics#_file-encoding-support
If you click on the UTF-8 in the bottom right corner you can choose "Reopen with Encoding":
After that, you can select a different encoding. I chose DOS (CP437) at a guess and literal MV characters are displayed as superscript 2 (²), and for me I can save to the server and confirm those characters remain as #VM after a round trip (though for my terminal emulator they appear as } which is useful).
You can edit preferences and set "files.encoding": "cp437". One other thing that can be helpful if your programs don't have a standard extension (like .bas) as most don't is to set the default mode to basic so most of what you're editing will identify as MVbasic, and you can do a quick CTRL-K M to switch to any other modes if you're just pasting in something else like SQL.
Some useful links - the Rocket forums are helpful and the folks there are always super nice
https://community.rocketsoftware.com/forums/multivalue?CommunityKey=521bce2e-71d5-4d32-b560-dfa95e950eb5
The MV Extensions Community extension is a good group and always has been helpful when I've had issues. I've made some small contributions - they're very open. I prefer this extension, but honestly haven't done a deep comparison.
https://github.com/mvextensions
I've recently started to use the Atom editor again because it offers some good features.
However it doesn't recognize the code in my files most of the time.
I use it mainly to look through SSIS files - meaning they are in XML-format but have other file endings like ".conmgr" or ".dtsx". Yet they all start with <?xml version="1.0"?>.
Now to my question:
Can I somehow set the standard language from "Auto Detect" to "XML" or is there any package so that Atom starts to recognize those files as XML-code?
Since this is my first time using stackoverflow to ask something I hope I've done everything right.
Thank you in advance!
The two picures show two different files. Both ending on ".conmgr":
This file it does recognize
This file it doesn't
I've recently set up WP coding standards in VSCode by following https://www.edmundcwm.com/setting-up-wordpress-coding-standards-in-vs-code/.
With this setup files aren't getting saved and shows this message at the bottom right:
Saving ‘plugin.php’: Running ‘phpcbf’ Formatter (configure).
The only way to save is to press Cancel when this appears.
Any idea?
Please use which phpcs & which phpcbf to find the paths.
which phpcs
e.g. "C:\Users{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcs
which phpcbf
e.g. C:\Users{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcbf
once you find the paths to the executables, open your vscode json settings and add double check that the executable settings for phpcs & phpcbf match the paths.
Examples:
"phpcs.executablePath": "C:\Users\{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcs.bat",
"phpcbf.executablePath": "C:\Users\{Your username}\AppData\Roaming\Composer\Vendor\bin\phpcbf.bat",
I think this issue is pretty widespread despite the lack of answers in this thread. Setting the paths as above does not fix things. For me, this happens when saving a file and there is nothing for the formatter to fix.
There is an open pull request for this issue that has been open for over a year now.
A fork of the project has popped up that specifically fixes this issue. Look for phpcbf in VSCode and find the one by Simone Baldini.
Try installing that to see if it resolves the problem.
I followed this blog post and was 99% successful with accomplishing what I wanted to. Basically, create an R Notepad file (.Rmd), run it and save file. Then, run the code that is in the blog post and have my .Rmd file automatically upload to my WordPress site.
The problem is that it uploads and changes the single and double quotes to "'";, """ with semicolons at the end, "&" respectively.
Example, my code looks like this: LoggerFile = 'SOLAR_LOGGER'
When uploaded to WordPress and I look at the post via text only, it shows up like this: "LoggerFile = ' ;SOLAR_LOGGER' ;"
Only without the space between ";" and the 9.
When I publish, it still shows "LoggerFile = ' ;SOLAR_LOGGER' ;" as well.
I know at one point I messed with my WordPress files to try and implement using pretty print for code which worked. I would normally manually enter "< pre>< code>Code Here" and it would prettify my code. This still works.
A side question: I was trying to post to another WordPress site to see if it was just that particular WordPress configuration but it doesn't seem to want to change sites. I stored site and password in the .Rprofile file. I tried to even put .Rprofile in same directory with no luck. The changes don't take effect, even after restarting R.
I am very new to R so I may be missing some key pieces of the puzzle. I am also new to MacOS and using terminals. Learning quickly and getting the hang of it (loving it as well!).
I'm using WordPress Version 4.9.1
Hosting under godaddy account (sorry!)
R Studio Version 1.0.153
R version 3.4.1 (2017-06-30)
macOS Sierra Version 10.12.6 (16G1036)
Any suggestions?
So the answer ended up being a conflict between knit2wp and a Crayon add in for WordPress.
The solution is detailed in this post I found [here][1]. Essentially, the code will modify the contents to work well with the Syntax Highlighter built in.
They change knit2wp to knit2wpCrayon. I just tried it and it works perfect. This is good because I won't have to modify any of my old posts.
Anyone know how to set Notepad++ as default text editor for SAS, Stata and R?
I'm having the hardest time finding anything online (particularly for SAS). Looking for ability to run code from Notepad++ as well as setup color coding.
Thanks.
Why not just go the GUI route: right click, e.g., any foo.R file and select "Open with...", then pick Np++ and click the "always open this file type.." button. Rinse, lather, repeat.
BTW, for R, if you don't already have it, get "NppToR" , a little app which lets you execute code directly from the Npp window.
On windows you can either:
manually edit the keys for the file type to set the value of HKEY_CLASSES_ROOT\FILE_TYPE\shell\edit\command where FILE_TYPE is the appropriate one for each of the files extensions you wish to change this is quite hard work or
you can use a program that does it for you such as the free Default Programs Editor
In either case the first thing to do is to back up the registry.
I would seriously suggest looking into using one of the many, some free IDEs as they will automatically include the run from edit environment, syntax highlighting, code completion and, in many cases, debugging as well.
Notepad++ is my favorite editor and I was in the same shoes as you are now.
I am assuming that you are in Windows (Notepad ++ doesn't exist in Mac, saddest thing for me)
Please follow the steps mentioned in the below webpage and do as the author says.
http://hafniumcity.com/notepad_color.php
Now for in-line editing , it may be not be the best choice for SAS. Although I haven't tried it much so not a good person to comment on it.