Friday, December 14, 2012

Hiding file extension in web browser via .htaccess

I want to hide (remove) the file extension  (shtml) in my web page. The website is hosted in an apache server running a linux operating system.

I have tried various codes (found in google search: removing file extension) written in .htaccess files, but give me no luck. 

After keep on trying and modifying codes from several sources, finally I can get what I want:
domain/foo.shtml will be appeared as domain/foo
and if I type
domain/foo it opens the shtml page correctly and appeared as domain/foo
Basically the *.shtml will never appeared in the web browser address bar.

The codes written in .htaccess are the following:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.shtml -f
RewriteRule ^(.*)$ $1.shtml
RewriteCond %{THE_REQUEST} ^GET\s.+\.shtml
RewriteRule ^(.+)\.shtml$ /$1 [R=301,L]

The codes are implemented in the new Impact website. Note in IE9, some pages are greyed-out because lightbox.js does not work correctly.

Saturday, November 3, 2012

LaTeX Formula in Inkscape Windows 7

The following steps will guide you to get LaTeX formula working in Inkscape running Windows7 (64 bits). 

Step 1 - Install ghostscript
The ghostscript installer gs905w32.exe downloaded from here.

Step 2 - Install ghostview
The ghostview installer gsv50w32.exe downloaded from here.

Step 3 - Install pstoedit
The pstoedit installer pstoeditsetup_win32.exe  downloaded from here.

Step 4 - Install Inkscape
The Inkscape installer Inkscape-0.48.2-1.exe  downloaded from here.

Step 5 - Define path installation folder
  • Right click on computer -> Properties
  • Click the Advanced system settings
  • Click the Environment Variable
  • Select Path and click Edit
  • Add (DO NOT REPLACE THE EXISTING VALUE) to the end of variable value, the following paths:
             ;C:\Program Files (x86)\pstoedit;C:\Program Files (x86)\gs\gs9.05;C:\Program Files (x86)\Ghostgum\gsview
Step 6 - LaTeX Formula should be available and it works!

Sunday, June 10, 2012

Fixing mysql problem after upgrading 12.04

I have Open Conference System (OCS) installed in my laptop. I use this local OCS for trial purpose before implementing any customized settings to the real server. 

After upgrading my Ubuntu to 12.04, my OCS does not work. Every time I type localhost/ocs in the browser it says:
Database Connection Fails! 

I can make mysql back as usual after re-configuring mysql.

Step 1 - Reconfigure mysql-server
Open Ubuntu terminal: Ctrl+Alt+T
~$ sudo dpkg-reconfigure mysql-server-5.5

Step 2 - Check mysql running normally
~$ sudo service mysql status

the command shows running status: 
mysql start/running, process 6459

Saturday, February 4, 2012

Create SMath launcher in Unity Environment (Ubuntu)

SMath requires mono to run. Running SMath from the terminal by typing a typical command
mono /folderlocation/SMathStudio_Desktop.exe

The following steps create an SMath launcher on unity desktop. Running SMath can be just clicking the launcher.

Step 1 - Installation gnome-panel
Open Ubuntu terminal: Ctrl+Alt+T
~$ sudo apt-get install gnome-panel

Step 2 - Create launcher using gnome-panel
~$ gnome-desktop-item-edit ~/Desktop/ --create-new
Name:       SMath
Command: mono /home/SMath091/SMathStudio_Desktop.exe

/home/SMath091 is the path location of the executable file SMathStudio_Desktop.exe

Confirming OK will create an icon on your desktop.
 Step 3 - Change icon with SMath icon
  • Download SMath icon svg image (smath.svg) from this link and save in a folder
  • Right click the smath icon on your desktop then select properties
  • Click the icon, go to the folder where you save smath.svg
  • Now running SMath is just clicking this SMath icon.

Sunday, January 22, 2012

Using Finite Element Toolbox CALFEM in FreeMat

FreeMat is a free environment for rapid engineering and scientific prototyping and data processing. It is similar to commercial systems such as MATLAB from Mathworks.
CALFEM is a free interactive computer program for teaching the finite element method (FEM). The name CALFEM is an abbreviation of "Computer Aided Learning of the Finite Element Method".

Although CALFEM was designed as a MATLAB toolbox, CALFEM can be integrated and used in FreeMat.
Below the steps to integrate CALFEM into FreeMat.

Step 1, FreeMat installation:
 Install Freemat from Ubuntu Software Center or
 from the terminal sudo apt-get install freemat

 A windows installer can be downloaded from FreeMat download link, then install as a normal installation procedure in Windows machine.

Step 2, CALFEM installation:
CALFEM zip file ( should be downloaded from its sourceforge repository. You need to unzip it.

Put in a folder of your preference and unzip it. Just right click and select extract here.

Put in a folder of your preference and unzip it by using unzip software available in your windows machine.

Step 3, Integrating CALFEM into FreeMat:
All the program routines of CALFEM must be recognized in FreeMat. The folder where CALFEM is saved should be defined from pathtool.

(a) Open FreeMat and type pathtool and Enter
(b) Find the location where you unzip CALFEM on the left box, then select  Add With Subfolders.
(c) Confirm the selection by pressing Done, then you need to save changes. Restart FreeMat to completely define the new CALFEM pathtool.

Step 4, Test CALFEM function in FreeMat:
You should be able to use CALFEM functions in FreeMat.
Type bar1e(50) and press Enter.
If FreeMat can recognize one of functions, bar1e, it means CALFEM has been properly integrated in your FreeMat. Now you can employ other FEM functions defined by CALFEM.