Install ntfs-3g on Centos 6 and mount NTFS disk in Easy Steps

By default, Centos 6 doesn't have support for NTFS disk, that's why you get unknown filesystem type error when you try to mount -t ntfs /dev/sdb1 /mnt/datadisk. To make NTFS filesystem available on Centos, you need to install ntfs-3g. Here is how to do it.

When to use doall and dorun in Clojure

The lazy sequence in Clojure is a confusing part for many beginners, especially when it used together with side effects. The catch is, depends on the actual way by which the lazy sequence is consumed, the items in the sequence can be fully, partially or completely not consumed. If there is no side effect operation in the items, nothing .

Clojure return rest of string after a sub string

You have a sub string used as delimiter in another string, how to get the rest string after the delimiter? You can calculate the end position of the sub string and then cut the string from the position or split the string by the sub string, the following code shows how to do it.

 
(subs "hello world" (+ (.indexOf "hello world" "hello") (.length "hello")))
 
(nth (clojure.string/split  "hello world" #"hello") 1)
 

How to Define Emacs Custom Faces for text highlighting

more fine-grained control to highlighting, you need to define custom faces. [Define Custom Faces ... Major Mode] Let's drive a major mode from fundamental-mode and apply our custom faces to text ... Emacs already provided a set of faces, you can find them in font-lock.el. Most faces ... ] The following code defines three custom faces. (defvar highlight 'highlight "Face name to use

Install MySQL 8 on Windows 7

[Step 1. Download MySQL 8 zip package] Open https://dev.mysql.com/downloads/mysql/ in your ... Redistributable. [Step 3. Initialize and install mysql service] Open a cmd window and change ... --initialize --console mysqld -install mysql mysql -u root -p-)wq3ixr)EKr alter user 'root ... favorite browser. For most people, Windows (x86, 64-bit), ZIP Archive is the best choice

How to override global keybinding for a specific file in Emacs

it for a particular file but wouldn't affect other buffers with the same major mode. To target a specific file ... we should use the find-file-hook, we will match the file name in the hook function. To override ... When editing a large text file, harmless things in regular file can be disastrous ... if the text file is big enough. There is no reason to launch the dangerous command in any situation

Haskell unsafeInterleaveIO and Lazy list constructed from IO actions

Haskell is a lazy language, which means you can easily define an infinite list with recursion ... -> IO ByteString hGetContentsNLazy k h = lazyRead where lazyRead = unsafeInterleaveIO $ do ... cs) :} To make it lazy, simply add the unsafeInterleaveIO in front of the recursion body. Here ... and the chunk list is constructed on demand.

Extract text and images from doc or docx file with Python

] An alternative way to save text and images separately is to simply save your doc or docx as HTML files, what ... . Suppose you are tasked with the job that given a doc or docx file, you need to post the content ... as file. This is a cumbersome and repetitive process. It will be good if we can extract the text ... , set the ProgID as word.application. With the COM object we can open a doc file and Save it as docx

Maybe monad: where is the join and nested Nothing

is the definition of Maybe monad: instance Monad Maybe where return = Just Nothing >>= _ = Nothing ... arrow. The definiton of Maybe functor and fmap: instance Functor Maybe where -- fmap :: (a -> b ... ) -> Maybe a -> Maybe b fmap _ Nothing = Nothing fmap f (Just x) = Just (f x) You can blend the f ... , fmap and join together, the result is the same as bind, the process will be like this Nothing

Haskell map mapM mapM_ example

The Control.Monad module contains a series of functions like mapM, mapM_, how and when to use ... unsafePerformIO $ foo !! 1 Now change the map to mapM. Evaluate it in repl will trigger the IO action one ... by one the type of the mapM version is IO [()]. You can read it as IO of list of actions, the map ... of mapM_ is mapM_ f list = sequence_ (map f list).
1 2 ... 71 Next Page