mode

Most efficient way to order an array of Strings by frequency

孤街浪徒 提交于 2019-12-21 13:03:33
问题 I have an array of Strings: String[] stringArray = {"x", "y", "z", "x", "x", "y", "a"}; What is the quickest/most efficient way to order this into a smaller Collection in order of how frequent each String is with its frequency? I though about using the String as a key in a HashMap<String,Integer> but this wouldnt be sorted in terms of frequency My other method i considered is using a TreeMap<Integer, String[]> with a list of Strings with that integer, but there seems a lot of checking

How to enable flyspell-mode in emacs for all files and all major modes?

我只是一个虾纸丫 提交于 2019-12-21 07:10:06
问题 How do you enable flyspell-mode to be automatically used for every file and every major mode as soon as Emacs is started? Also, is there an XML dictionary that does not mark XML tags as misspelled words? 回答1: The answer from this question worked for me: How to enable automatic spell check by default? Furthermore, it appears to be more general, unlike the current voted answer. Add the following lines to your .emacs or init.el . (add-hook 'text-mode-hook 'flyspell-mode) (add-hook 'prog-mode

Emacs mode that highlight Lisp forms

久未见 提交于 2019-12-21 02:56:18
问题 What is the Emacs mode or package that highlights Lisp forms changing the color of the backgrounds so that the form you are in has one color, the outer form another, the outer outer form another and so on? 回答1: You may want to try mwe-color-box (screenshot below) or read Five approaches to s-expression highlighting by Lemondor. (source: foldr.org) 回答2: Take a look at screenshots here http://lemonodor.com/archives/001207.html, may be that is what you want. 回答3: I don't use it, but this might

Error Package KlaR kmodes : Error: Column index must be at most 5 if positive, not 6

筅森魡賤 提交于 2019-12-20 03:52:12
问题 Applying the klaR kmodes algorith to the below dataset > summary(raw) CREDIT_LIMIT CP gender IE_CHILD_NB IE_TOT_DEP_NB TOTAL_INCOME IE_HOUSE_CHARGE maritial >2000 : 612 11500 : 145 MM: 5435 0:7432 0:1446 >2000 :3524 >2000 : 2 D : 1195 0-500 :10458 11100 : 90 MR:12983 1:4119 1:3748 0-500 :1503 0-500 :17146 M :10507 1000-1500: 2912 08830 : 71 2:5787 2:3386 1000-1500:6649 1000-1500: 44 MISS: 1446 1500-2000: 2254 11406 : 68 3: 947 3:3740 1500-2000:4116 1500-2000: 5 Ot : 1043 500-1000 : 2182 35018

How to detect Render Mode of browser for current page?

亡梦爱人 提交于 2019-12-18 10:56:06
问题 I know that modern browsers generally have two render mode: standard mode and quirk mode. The browser detects the heading DocType. The question is how to detect render mode of current page at runtime. Is there any Firebug tool to do that? 回答1: Before IE8: alert('Page was rendered in ' + ((document.compatMode == 'CSS1Compat') ? 'Standards' : 'Quirks') + ' Mode.'); For IE8: var vMode = document.documentMode; var rMode = 'IE5 Quirks Mode'; if(vMode == 8){ rMode = 'IE8 Standards Mode'; } else if

Is there a possibility to execute a Python script while being in interactive mode

二次信任 提交于 2019-12-18 10:20:37
问题 Normally you can execute a Python script for example: python myscript.py , but if you are in the interactive mode, how is it possible to execute a Python script on the filesystem? >>> exec(File) ??? It should be possible to execute the script more than one time. 回答1: Use execfile('script.py') but it only work on python 2.x, if you are using 3.0 try this 回答2: import file without the .py extension will do it, however __name__ will not be "__main__" so if the script does any checks to see if it

How to enable a non-global minor mode by default, on emacs startup?

怎甘沉沦 提交于 2019-12-17 23:48:10
问题 I want to enable rainbow-mode everytime I start emacs, rather than having to use M-x rainbow-mode . I guess there is some command I put in my .emacs file. I tried all of the following, but none of them worked: (require 'rainbow-mode) (rainbow-mode initialize) (global-rainbow-mode) More generally, how do I load any mode/package automatically on startup? 回答1: rainbow-mode isn't a global minor mode, so it needs to be enabled on a per-buffer basis. I only use it for CSS, so I have: (add-hook 'css

How to find the mode of an array in PHP

99封情书 提交于 2019-12-17 17:04:10
问题 I have an array that has been sorted from low to high which has over 260k values in. I have found out the mean(average) and median of the array just need to find out the mode? I cannot use any mathematical functions that PHP has, it has to be all done manually. I would like it so there could be just one value that is the mode but then there can be multiple values that can be the mode. I also need to be able to record the number of times that the value is stored. For example the number 51

How does git handle folder permission?

浪尽此生 提交于 2019-12-17 07:25:33
问题 I'm using git version 1.5.6.3, and it seems git doesn't notice a folder's mode changes #create a test repository with a folder with 777 mode :~$ mkdir -p test/folder :~$ touch test/folder/dummy.txt :~$ cd test :~/test$ chmod 777 folder/ #init git repository :~/test$ git init Initialized empty Git repository in ~/test/.git/ :~/test$ git add . :~/test$ git commit -m 'commit a directory' Created initial commit 9b6b21a: commit a directory 0 files changed, 0 insertions(+), 0 deletions(-) create

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot

故事扮演 提交于 2019-12-13 18:01:27
问题 I am trying to get a windows service to work but I keep getting the following error... Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. The windows service is pretty simple. It looks at some data, does some organization and sends some information of to a database. If the data meets certain conditions, the service connects to K2 Workflow, find the correct item, then claims and completes