What's going on? my vim highlight some word which I dont't want to - vim-syntax-highlighting

Who can tell me why 'UI','molokai colorscheme','statusline' look like this?
which option can fix this?

Most likely this is because the way VIM performs code coloring.
I guess it is not performing full parse of the code, but partial, REGEX based keyword detection. The REGEX is probably wrong.

Related

Is it possible to obtain last evaluated value in iruby on jupyter?

I use iruby on jupyter. In ipython, one can obtain last evaluated value by local variable _. Is it possible to do somehow achieve it in iruby?
I think you have just found another IRuby bug.
Thank you for finding this.
https://github.com/SciRuby/iruby/issues/245

Writing to a file in R prints on 2 lines

I am writing a vector to a file in R. However the output comes on 2 lines. I wanted all the values to come on a single line. Can you let me know how to fix this
write(value,file=fileconn,append=TRUE,sep="\t")
The o/p comes as follows
1777.167 1825.167 1873.167 1921.167 1969.167
2017.167
Regards
Ganesh
I'm not sure write() is probably not the best choice, but if you want to use it, it might be a good idea to check the ?write help file. It does have an ncolumns= parameter which defaults to 5 for simple numeric vectors.
I would think cat() would be a better solution for just dumping numeric vectors.

Get Scilab to calculate without printing result

This sounds like a silly question, but I really can't find an answer around.
I'm using Scilab to evaluate two methods in terms of performace. However, every time I tell Scilab to calculate anything, it will print the results. Since I'm using large matrices, it spends much more time printing the results than doing the calculations, so I'm having a hard time telling how long is each method actually taking.
Can I get Scilab to compute something without printing the result?
That is, instead of
-->B = A'*A
A =
1. 2. 3.
2. 4. 6.
3. 6. 9.
-->
I'd like it to do
-->B = A'*A
-->
Also simply adding a semicolon works
-->B = A'*A;
-->
Well, I finally found the right query. When I searched for 'scilab silent', one of the results (not the first) was this:
http://help.scilab.org/docs/5.3.3/en_US/mode.html
Function mode(k) lets you choose how Scilab will behave in terms of variable display. The following call will temporarily hide results:
mode(-1)
Whereas this will get you back to the default option:
mode(2)
The documentation is confusing, though.
Please notices that mode does not used at prompt, only in an exec-file or a scilab function.
Aside from the awful English, this notice seems to be outdated. This function worked perfectly for me on the prompt.

Word boundaries standard

Some time ago I found an ISO-standard(I think) which described boundaries to use in order to determine a word in a text based on different languages.
Is this something that I have made up in my dreams? Or can you help me find it? I've tried google but I didnt find anything.
Thanks,
BJ
Found what I was looking for. Sorry, no ISO-standard but an Unicode Standard Annex:
http://www.unicode.org/reports/tr29/tr29-25.html

Find HEX patterns and number of occurrences

I'd like to find patterns and sort them by number of occurrences on an HEX file I have.
I am not looking for some specific pattern, just to make some statistics of the occurrences happening there and sort them.
DB0DDAEEDAF7DAF5DB1FDB1DDB20DB1BDAFCDAFBDB1FDB18DB23DB06DB21DB15DB25DB1DDB2EDB36DB43DB59DB32DB28DB2ADB46DB6FDB32DB44DB40DB50DB87DBB0DBA1DBABDBA0DB9ADBA6DBACDBA0DB96DB95DBB7DBCFDBCBDBD6DB9CDBB5DB9DDB9FDBA3DB88DB89DB93DBA5DB9CDBC1DBC1DBC6DBC3DBC9DBB3DBB8DBB6DBC8DBA8DBB6DBA2DB98DBA9DBB9DBDBDBD5DBD9DBC3DB9BDBA2DB84DB83DB7DDB6BDB58DB4EDB42DB16DB0DDB01DB02DAFCDAE9DAE5DAD9DAE2DAB7DA9BDAA6DA9EDAAADAC9DACADAC4DA92DA90DA84DA89DA93DAA9DA8CDA7FDA62DA53DA6EDA
That's an excerpt of the HEX file, and as an example I'd like to get:
XX occurrences of BDBDBD
XX occurrences of B93D
Is there a way to mine the file to generate that output?
Sure. Use a sliding window to create the counts (The link is for Perl, but it seems general enough to understand the algorithm). Your patterns are named N-grams. You will have to limit the maximal pattern, though.
This is a pretty classic CS problem. The code in general is non-trivial to implement as it will require at least one full parse of the sequence, and depending on your efficiency and memory/processor constraints might require several. See here.
You will need to partition your input string in some way to ensure that you get a good subsequence across it.
If there is a specific problem we might be able to help more, but the general strategy is in the Wikipedia article above.
You can use Regular Expressions to make a pattern to search for.
The regex needed would be very simple. Just use the exact phrase you're searching for. Then there should be a regular expression function in the language you're using (you didn't specify) that can count the number of matches.
Use that to create a simple counter.

Resources