# [Haskell] Hide modules names in ghci

### Problem

When importing several modules into ghci, the command line can get very long.

### Solution

Just type the following command:

:set prompt ">"

# [Haskell] Import/unimport a module into ghci

### Problem

Import/Unimport a module on ghci.

### Solution

To import:

:module +<name of the module>

To unimport:

:module -<name of the module>

Shortcut for :module is :m

Examples:

Import Data.Int module:

:module +Data.Int

or

:module +Data.Int

Unimport Data.Int module:

:module -Data.Int

# [Linux] xclip command

### Copying

The following command

echo "foo" | xclip -selection clipboard

will copy “foo” to you clipboard. Try pasting it elsewhere. The clipboard selection is the one used by Ctrl-C Ctrl-V commands. The default selection of xclip is the one used when you select text in linux (XA_PRIMARY).

A shorter version would be:

echo "foo" | xclip -sel c

### Pasting

You can also send the contents of the current clipboard to the terminal (useful for piping).

xclip -sel c -out

Or

xclip -sel c -o

eclipse

# [Eclipse] Find all occurrences where a variable is written

### Problem

Search all occurrences where a given variable is written (but not read) in a workspace, using Eclipse.

### Solution

Search for current references (Shortcut: Ctrl + Shift + G) and filter out occurrences by type using the menu illustrated in the image below. In this case, it’d probably suffice to check the ‘Read’ entry.

eclipse

# [Eclipse] Finding the opening bracket at a closing one

### Problem

The method/loop you’re reading is very long and you after a while you see a lot of closing brakets and it’s difficult to tell to which opening bracket it matches to.

### Solution

Place the cursor at the right of the closing bracket and use the following shortcut:

Ctrl + Shift + P

Or (for Mac)

Cmd + Shift + P

PS. In Eclipse 3.8 a new feature is expected to help in this task.

applet

# [Java] Passing parameters to Java applets

### Problem

How to pass parameters to a Java applet?

### Solution

You can specify the parameters in the calling HTML this way:

<applet code="my.Applet.class" width="600" height="400" >
<param name="param1" value="value1" />
<param name="param2" value="value2" />
</applet>


Then, the Applet class (from which your applet class extends) has a method getParameter(). In this case, getParameter("param1") would return the String "value1".

applet

# [Java] Specifying the path of the applet classes

### Problem

Class not found exception is being thrown because your html using the applet classes is not in the right path.

### Solution

You can set the path in the within the applet tag:

<applet code="MyApplet.class" codebase="path/to/applet">

eclipse

### Solution

I had to solve two issues. First, since I was behind a proxy server, I had to set up the authentication as described here.

After that I was still not able to download plugins and the reason was that my connection was very slow and the downloading was timing out. The solution to this is to follow the first answer of this question.

latex

# [Latex] Display subscripts in two or more rows under the symbol

### Problem

When the subscript is too long, it may be a good idea to split it in two or more rows. How to do it?

### Solution

http://blog.32leaves.net/?p=262

latex

# [Latex] Display subscript under the symbols

### Problem

When writing inline equations in LaTeX, symbols such as summations may get ugly with subscripts, for example:

$\sum_{i=1} x_i$

### Solution

Add \displaystyle right before the equation (e. g. $\displaystyle \sum_{i=1} x_i$) to display the subscript under the symbol. Our example becomes

$\displaystyle \sum_{i=1} x_i$