Sangwal’s Weblog

Just another WordPress.com weblog

How do you pronunciation ‘infinite’?

leave a comment »

For a learner of English (or any foreign language for that matter), the mastry of pronunciation is always an issue. Just happened to know today that I always pronounced the word infinite wrongly.  What do you think is the correct pronunciation of infinite given that finite is pronounced as /ˈfī-ˌnīt/?

  1.  /ˈin-ˈfī-ˌnīt/
  2. in-fə-nət/

Anyway the latter is the correct choice according to Merriam Webster dictionary (and others as well).

Written by sangwal

February 15, 2009 at 8:54 pm

Posted in Uncategorized

Tagged with ,

twit

with one comment

a stupid person

You stupid twit!

Written by sangwal

October 8, 2008 at 2:30 pm

Posted in Uncategorized

Tagged with

rambunctious

leave a comment »

rambunctious
adjective:  noisy and lacking in restraint or discipline
A social gathering that became rambunctious and out of hand

Written by sangwal

October 8, 2008 at 5:42 am

Posted in Uncategorized

RIA, what is this CTC and ORM?

leave a comment »

The following terms that I came across in the past few days are:

  • RIA
  • CTC
  • ORM, O/R mapping

A search on the internet revealed that RIA stands for Rich Internet Applications, CTC is Cost to [the] Company (i.e., how much an employee costs to the company) while ORM is Object-relational Mapping.

Written by sangwal

September 25, 2008 at 3:44 pm

Posted in Uncategorized

where is PEAR package installed?

leave a comment »

Being a new user of (Ubuntu) Linux, there are times when I simply run out of tools I know about to do a particular task. The use of search engines in such a situation can be helpful. However, the query given to the search engine might not yield any good result due to a malformed query.

I today stuck at the problem of finding the location of PEAR package in Linux. I knew it was installed but could not find which directory it was installed in. After searching a lot in vain, pear command itself came to my rescue.

pear config-show

This command lists many configuration options of PEAR and the path (directory) information. The output from the above command on my computer contained line:

PEAR directory php_dir /usr/share/php

The directory where PEAR was installed was /usr/share/php as shown.

Written by sangwal

May 21, 2008 at 2:19 am

Posted in Uncategorized

mod_rewrite loaded but not working

with 4 comments

There are lot many tutorials on the Net about mod_rewrite module of Apache web server. You follow those tutorials and get nowhere (OK, at least I couldn’t for the most of time until I found http://ubuntuforums.org/showthread.php?t=645282).

This post particularly deals with Apache 2.0 series. I am afraid if this material is applicable to Apache1.3 series of server, however, you can try yourself if it works for you.

Make sure that mod_rewrite is loaded. This can be done by checking PHP settings. Put <?php phpinfo(); ?> this code into a PHP file and browse this using a browser. It will display PHP info along with loaded modules in Apache. Search this page for string “mod_rewrite”. If you can find this, it means that the module is loaded and you can skip the rest of this paragraph. Still here, most likely you have not mod_rewrite loaded, yes? Under Ubuntu Linux (in other distros also, I think) you can load this module using sudo a2enmod rewrite command in the terminal window.

For Linux

The httpd.conf file is not used in Apache2; the new configuration file is apache2.conf. On my installation, the httpd.conf was just empty (zero byte file size). All installation wide configuration of Apache2 can be done through apache2.conf file making httpd.conf redundant.
Many of the tutorials I came across point out that we have to change “AllowOverride None” to “AllowOverride All”, but unfortunately failed to pin point where exactly this setting is to be changed. Of course, the problem I had was with this setting only. (I am next to sure that you also have problem with this setting only.) Locate the file: /etc/apache2/sites-enabled/000-default. Search for the section

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>

Now change “AllowOverride None” to “AllowOverride All”. Force restart the server using sudo /etc/init.d/apache2 force-restart and you are done.

For Windows

The Apache2 configuration file under windows is httpd.conf. Look for the line

#LoadModule rewrite_module modules/mod_rewrite.so

in the httpd.conf file. Remove the leading # comment sign to enable the server to load the module. Next, search for

<Directory "${path}/www">
:
AllowOverride None
:
</Directory>

section. Here you will find AllowOverride None line. Change it to AllowOverride All so that the setting in .htaccess file can be used by the server (otherwise, the server doesn’t process whatever is there in .htaccess file).

Of course you’ll need to restart the server for the things to work. I hope this will be helpful.

Written by sangwal

March 29, 2008 at 2:12 am

Splitting a unicode string into individual characters in PHP

leave a comment »

I had a hard time finding something that can easily split a unicode string into individual unicode characters. Finally, I find something here http://bugs.php.net/bug.php?id=27103 that gave a straightforward method to do the splitting. Here is the code:

$s = "यहां पर एक युनिकोड लड़ी (string) डालें";

print "<pre>";
print_r( preg_split("//u", $s, -1, PREG_SPLIT_NO_EMPTY));
print "</pre>";

The above code will output the individual letters in the string $s. Feel free to adapt to it your needs. Cheers!

Written by sangwal

March 19, 2008 at 5:23 pm

Posted in Uncategorized

Tagged with , , ,

Scripts on WordPress

leave a comment »

Today I tried to put my javascript code into a post on WordPress. To my dismay, it simply did not work on it. Moreover, to my surprise it is found that WordPress strips all the <script> tags and leaves almost nothing behind. Whatever was left was of no avail. Anyway, if you need to translate Polish words into English, you can search the ‘Pol-Ang Słownik’ (Polish to English dictionary, http://slownik.freehostia.com) or alternatively you may place the search box on your web pages (and even allow visitors to your pages to search Polish words). To put the search box into your pages, simply copy and paste the following code into your page:

<!– begin code: Pol-Ang dictionary(http://slownik.freehostia.com) search box –>
<script type=”text/javascript” src=”http://slownik.freehostia.com/ajax-searchbox.js”>
</script>
<script type=”text/javascript”>
var color_entry = ‘green’;
var color_def = ‘black’;
var color_owner = ‘gray’;
var color_ex = ‘gray’;
var size_owner = ‘80%’;
var size_ex = ‘80%’;
</script>
<title></title>
</head>
<body>
<div style=
“width:200pt;border:solid;border-width:1;border-color:blue;”>
<div id=”ajax_error”></div>
<div style=
“background:lightblue;border-bottom:solid;border-width:1;text-align:center”>
<h1 style=’display:inline;font-size:90%;font-family:sans-serif;’>
Pol-Ang Slownik (Polish-English)
</h1>
<form name=”jax_search_form” id=”jax_search_form”>
<input type=”text” name=”ajax_search_word” onkeypress=
“return checkEnter(event);”> <input type=”button” name=
“search_button” value=”Search” onclick=
“ajaxFunction()”><br>
<h1 style=
‘display:inline; font-weight:normal;font-size:70%’>
<a href=”http://slownik.freehostia.com” mce_href=”http://slownik.freehostia.com” >
</h1>
</form>
</div>
<div id=”ajax_contents”></div>
</div>
<!– end of code: Pol-Ang dictionary
(http://slownik.freehostia.com) search box –>

Free free to experiment with the code to change the layout of the text box. Cheers!

PS: I see quotes (” and ‘) have been altered by WordPress, or atleast it displays them all altered, but internally keeps the original. If it the case, change them to normal quotes.

To see how the search box looks like, please see here.

Written by sangwal

March 1, 2008 at 12:16 am

Redirect web browser to other page

leave a comment »

Wondering about how to redirect visitors to some other page? It is really simple with this piece of code.

Put the following line in your HTML file’s head section.

<META HTTP-EQUIV="refresh" CONTENT="5; URL=url-to-redirect-to.html">

Please mind that this line is to be placed between <head> and </head> tags for it to work. The number 5 in the above line is the time in seconds the browser waits before loading the redirected page. You can set it to 0 (zero) if you want browser to load the contents of next page immediately.

If you are working with PHP and looking for a way to redirect your browser, you can do this by placing a simple header() function call as follows:

header("Location: redirection-address.htm");

This wouldn’t work if you have already outputted some text using print() or echo calls. This is the because of restriction of HTTP protocol and not of PHP. So place it early enough in a page where no previous output was generated using print and/or echo function calls.

Hope it will help.

Written by sangwal

February 17, 2008 at 9:27 pm

Posted in Computer, Web

Tagged with , , , , , ,

Did you mean this, this or that?

with one comment

The Pol-Ang (http://slownik.freehostia.com) Polish English Dictionary is getting better. There is now added support for ‘Did you mean?’ feature. As per site, there is no need to worry about the correct spellings. Just type the word and it will display words closely matching the search word. Best wishes!

Written by sangwal

February 17, 2008 at 12:08 am