How to colorize multiple columns in VIM in different colors
I want to set up VIM for working with Cobol files. So, I want to separate the working file with colorized columns. I would like to have column groups with different colors. For example how can I have columns from 1-6 in red color, column 7 in blue, columns from 8 to 11 in green and columns from 73 to 80 in orange? Is it possible to have these column groups colorized with different colors?
do you know?
how many words do you know
See also questions close to this topic
How to open new tabs instead of splits by default in VIM?
I have installed rust.vim and it has the
:Cruncommand, which opens a split when called. Is it possible to open a new tab instead of a split? If it is possible, how to do it? (I know that it is possible to call
C-w Tto switch to tab mode, but I'd like to have this automated)
How to disable whitespace deletion when moving cursor from autocompled indent in VIM?
When I move the cursor from a line that VIM has automatically indented, the indentation disappears. How can I get rid of this behavior without exiting Insert mode?
+ any movement (for example,
<TAB>A <- where is my tab? :( <TAB>|
Why i get error when i wont to source my vimrc file?
I try to add some plugins to vim but when i source my vimrc i have error.
[vim-plug] ‘git executable not found. Most commands will not be available. To support this message, prepend ‘silent!’ to ‘call plug#begin(...)’.
How do I remove the space at the end of my "grade letter" outputs and the first series of blank "test scores" in my code?
I have written a program that runs fine and generates the output I want with Python IDE, but when submitted to Mimir, I run into problems. Here is my code:
def calc_average(score_1, score_2, score_3, score_4, score_5): average = (score_1 + score_2 + score_3 + score_4 + score_5) / 5; return average def determine_grade_letter(entered_score): if(entered_score < 60): return "F" elif(entered_score < 70): return "D" elif(entered_score < 80): return "C" elif(entered_score < 90): return "B" elif(entered_score < 101): return "A" def enter_scores(): score_1 = float(input("test score #1: ")); score_2 = float(input("test score #2: ")); score_3 = float(input("test score #3: ")); score_4 = float(input("test score #4: ")); score_5 = float(input("test score #5: ")); return score_1, score_2, score_3, score_4, score_5 def results(score_1, score_2, score_3, score_4, score_5): print("test score #1: " + "\n" + "grade letter: " + determine_grade_letter(score_1), \ "\n" + "test score #2: " + "\n" + "grade letter: " + determine_grade_letter(score_2), \ "\n" + "test score #3: " + "\n" + "grade letter: " + determine_grade_letter(score_3), \ "\n" + "test score #4: " + "\n" + "grade letter: " + determine_grade_letter(score_4), \ "\n" + "test score #5: " + "\n" + "grade letter: " + determine_grade_letter(score_5), \ "\n" + "average score: " + format(calc_average(score_1, score_2, score_3, score_4, score_5), '.2f') + "\n" \ + "grade letter: " + determine_grade_letter(calc_average(score_1, score_2, score_3, score_4, score_5))) def main(): score_1, score_2, score_3, score_4, score_5 = enter_scores() results(score_1, score_2, score_3, score_4, score_5) main()
And here is the yield within Python IDLE when I enter "100" for all 5 test score user prompts:
test score #1: 100 test score #2: 100 test score #3: 100 test score #4: 100 test score #5: 100 test score #1: grade letter: A test score #2: grade letter: A test score #3: grade letter: A test score #4: grade letter: A test score #5: grade letter: A average score: 100.00 grade letter: A
In Mimir, where I submitted this code, two undesirable results came from this code that has me repeatedly fail the assignment, all because my outputs do not match what is expected from Mimir.
Here is the output expected by Mimir:
test score #1: grade letter: A test score #2: grade letter: A test score #3: grade letter: A test score #4: grade letter: A test score #5: grade letter: A average score: 100.00 grade letter: A
And here is my code's output:
test score #1: test score #2: test score #3: test score #4: test score #5: test score #1: grade letter: A test score #2: grade letter: A test score #3: grade letter: A test score #4: grade letter: A test score #5: grade letter: A average score: 100.00 grade letter: A
On top of the glaringly obvious problem with there being a line of "test score #(x)" without grade letters before the intended part of my code, Mimir notices there is an unnecessary space after my grade letter inputs.
Noting this, how do I get rid of the sections highlighted in red through revisions of my code? I have tried altering the "def results" section numerous times, but have found nothing I do changes the spacing, including removing trailing whitespace. As a novice to Python, is there an obvious solution I am overlooking?
Why can't RStudio display arguments for python scripts?
When I open up a python script in R, it will auto complete the function or library. For example, if I start typing pd.read_excel(), R will offer to complete it. But as soon as my cursor is inside the function, hitting tab or ctrl+space will not offer me any arguments. I would like the coding to work exactly the same as for R: RStudio offers to autocomplete the function, I hit tab, then I hit tab to check out the arguments (or it pops up by default). What am I missing?
Also, when I hit tab or ctrl+space once my cursor is inside the function, it inserts a "=", mysteriously...
R version 4.1.0 (2021-05-18) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363) Matrix products: default attached base packages:  stats graphics grDevices utils datasets methods base other attached packages:  forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4  readr_1.4.0 tidyr_1.1.3 tibble_3.1.2 ggplot2_3.3.5  tidyverse_1.3.1 reticulate_1.22 loaded via a namespace (and not attached):  tidyselect_1.1.1 xfun_0.24 haven_2.4.1 lattice_0.20-44  colorspace_2.0-2 vctrs_0.3.8 generics_0.1.0 htmltools_0.5.1.1  yaml_2.2.1 utf8_1.2.1 rlang_0.4.11 pillar_1.6.1  withr_2.4.2 glue_1.4.2 DBI_1.1.1 rappdirs_0.3.3  dbplyr_2.1.1 modelr_0.1.8 readxl_1.3.1 lifecycle_1.0.0  munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 rvest_1.0.0  evaluate_0.14 knitr_1.33 fansi_0.5.0 broom_0.7.8  Rcpp_1.0.7 backports_1.2.1 scales_1.1.1 jsonlite_1.7.2  fs_1.5.0 hms_1.1.0 png_0.1-7 digest_0.6.27  stringi_1.6.2 grid_4.1.0 rprojroot_2.0.2 cli_3.0.1  here_1.0.1 tools_4.1.0 magrittr_2.0.1 crayon_1.4.1  pkgconfig_2.0.3 ellipsis_0.3.2 Matrix_1.3-3 xml2_1.3.2  reprex_2.0.0 lubridate_1.7.10 rstudioapi_0.13 assertthat_0.2.1  rmarkdown_2.11 httr_1.4.2 R6_2.5.0 compiler_4.1.0
How to change java.system.class.loader property?
I am not able to launch intellij-idea due to this error on Ubuntu 20.04.
<pre><font color="#4E9A06"><b>vaibhav@vaibhav-Inspiron-3543</b></font>:<font color="#3465A4"><b>~</b></font>$ intellij-idea-community Java HotSpot(TM) 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "com.intellij.util.lang.PathClassLoader"). To use archived non-system classes, this property must not be set IDE has not been initialized yet </pre>
How to move sign separate trailing to normal decimal field in COBOL
I have a field like 03 ws-var1 Pic s9(11)v9(2) sign trailing separate.
In the op file the value gets displayed as 00000002999200+
But I want it to be displayed as 29992.00. What definition has to be made in COBOL to so tht I get this desired result.
How can I return true in COBOL
So I am making a program that checks if a number is divisible by another number or not. If it is its supposed to return true, otherwise false. Here's what I have so far.
P.S : I'm using
IBM (GnuCOBOL v2.2 -std=ibm-strict -O2)to run this.
IDENTIFICATION DIVISION. PROGRAM-ID. CHECKER. DATA DIVISION. WORKING-STORAGE SECTION. 01 BASE PIC 9(5). 01 FACTOR PIC 9(2). 01 RESULT PIC 9(5). 88 TRU VALUE 0 . 88 FAL VALUE 1 THRU 99 . PROCEDURE DIVISION. CHECK-FOR-FACTOR SECTION. IF FUNCTION MOD(BASE, FACTOR) = 0 THEN SET TRU TO TRUE ELSE SET FAL TO TRUE END-IF. END PROGRAM CHECKER.
It gives me error saying invalid use of
level 88. I'm sure I'm making a mistake, and I've searched for couple of days and I can't seem to find anything that can help me with it. Any ideas if it is possible in COBOL or does COBOL handle all the boolean stuff some other way ?
(Kindly do not reply with look up level 88 or some other stuff like that, I have already looked them up and they haven't been helping)
Cobol Binary File to pandas dataframe issues
I received a binary cobol file that represents a table. So, knowing that behind this binary data there is a structured table I want to convert it to a pandas dataframe (or whatever multidimensional structure in python, pyspark, parquet, etc...). But I can't.
Here is an example:
I've already know that in my binary file I've received a table with one row and one column representing a month:
Within the binary file I see this:
Here are the different codes I've run to convert this to a data structure in Python with no success:
1.) First try:
import pandas as pd import numpy as np file= 'PMAR7004_01.TXT' dt = np.dtype([('MONTH','i')]) data = np.fromfile(file, dtype=dt) df = pd.DataFrame(data) df
MONTH -235736846 63984 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
dt = np.dtype([('MONTH','O')]) data = np.fromfile(file, dtype=dt) df = pd.DataFrame(data) df
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-10-3e5630708ccb> in <module> 2 import numpy as np 3 dt = np.dtype([('MONTH','O')]) ----> 4 data = np.fromfile(file, dtype=dt) 5 df = pd.DataFrame(data) 6 df ValueError: Cannot read into object array
with open(file, 'rb') as f: data = f.read().decode('cp500') data
with open(file, 'rb') as f: data = f.read().decode('cp500') print(data)
As you can see only with the last try I've got something but I guess it's not worth it because imagine that I have more columns.. that only works for one column and one row.
I would like to use something as I've used in the first or second try with numpy and pandas but I dont know why I got errors or bad conversions.
Thanks for reading!!