Sunday, March 21, 2010

Compile Java with Programmer's notepad

Programmer's notepad is a wonderful programmer's tool you can easily edit, inspect tags (code browser) and compile and run.

And it is free! Thanks to those people who work to make programmer's lifes easy!

You can easily configure Notepad tools to create customize commands, here to compile a *.java file create a tool under Java and set up the parameters like in the below picture.

(The C:\Program Files\Java\jdk1.6.0_18\bin should be previously added to the PATH variable)

To run a class file, change the parameters by:
command: java
folder:%d
parameter:%n
shorcut:F5

And that's it!




Wednesday, March 17, 2010

IBM T42 fan error

If you ever see the message: fan error and then your computer turns off, do not hesitate:
buy a new fan and replace it.

First download the IBM T42 guide here: http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/39t6192_01.pdf
Buy thermal paste for the processor and a good set of convenient screwdrivers.

If you follow step by step the guide you will success!


Here you can se a picture of my t42 with its new lungs (just great! lol):

Friday, March 12, 2010

Getting started with Java and Applets

Just follow these steps:



Download jdk from sun


Update the PATH variable in your computer

C:\Program Files\Java\jdk1.6.0_18\bin


Restart computer

In you code editor (it could be SCitE or other)

Build: F7

Go: F5



How to compile java code:

javac *.java


How to see an applet

1: Create an html file with an applet tag:


applet code="HelloWorld.class" width="100"

height="100"




Name it index.html


2. Launch applet viewer:

appletviewer index.html


3. That's it

Wednesday, March 10, 2010

My dot emacs file

Simple emacs configuration

;;; PHP-mode
(require 'php-mode)
(add-hook 'php-mode-user-hook 'turn-on-font-lock)
(add-hook 'php-mode-user-hook
      '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))

(autoload 'javascript-mode "javascript-mode" "JavaScript mode" t)
(setq auto-mode-alist (append '(("\\.js$" . javascript-mode))
                   auto-mode-alist))

(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(global-font-lock-mode t nil (font-lock))
 '(javascript-mode-hook nil t)
 '(make-backup-files nil)
 '(tab-always-indent t)
 '(tab-width 4))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;   MY .EMACS COLORS   ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;(set-background-color "DarkSlateGrey")
(set-background-color "Black")
(set-foreground-color "White")
(set-cursor-color "Orchid")
;; Courier New font of size 10 and font style Regular: if you want bold, change normal to bold here
(set-default-font "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-*-iso8859-1")