Pages

Wednesday, June 3, 2020

බල්ලොත් එක්ක නිදා ගන්න

මෙය අවාසනාවට නුගේගොඩ ප්‍රසිද්ධ පොත් සාප්පුවකදී සිදුවූ සත්‍ය සිද්ධියකි.

එය 2009 හෝ 2010 වසරයි. ජනප්‍රිය කලාකරු විජය නන්දසිරි මහතා රඟපෑ බල්ලොත් එක්ක බෑ නාට්‍යයේ show එකක් මරදානේ එල්ෆින්ස්ටන් රඟහලේ ඇති බව රැකියා ස්ථානයේ මිතුරු කැළට ආරංචි වූ වාහාම එය නැරඹීමට සියල්ලෝම ඒකමතිකව කැමති වූහ. ටිකට් කල්තබාම වෙන්කරවා ගැනීම් ඇඟට හොඳ බැවින් ඒ භාරදුර රාජකාරිය නුගේගොඩ හරහා දිනපතා යන එන මටත්, මාගේ යහළුවකුටත් භාර විය. බස් රියෙන් යාම් ඊම් කල මට, බොහෝ දිනවල සවසට දෙහිවල දක්වා ගමන් කල යහළුවා ගෙන් lift එකක් ලැබුණි. එබැවින් ගෙදර යන ගමන් පොත් සාප්පුවට ගොඩවී යාම එතරම් අපහසු වැඩක් නොවේ.

ජනාකීර්ණ නුගේගොඩ නගරයේ රථය ගාල් කිරීමට තැනක් සොයා ගත් අපි, පොත් සාප්පුවට ගොඩ වීමු. යහළුවා මට ඉස්සර විය. Cashier වෙත ළඟා වූ ඔහු ඇඟට පතට නොදැනී ඇසුවේ ඉහ මොළ රත් වෙන ප්‍රශ්නයකි.

අක්කේ, බල්ලොත් එක්ක නිදා ගන්න ticket තියෙනවද ?

සුපුරුදු ලෙස ඔහුට පොඩි අවුලක් සිදුවූ බව දැනුනද, හොඳම යහළුවෙකු ලෙස මට කල හැකිව තිබුණේ ඔහු හදුනන්නේ නැති ලෙස වෙන අතක් බලා සිටීම පමණි. 

Wednesday, May 6, 2020

පැහිච්ච ආදරය

හිරිමල් ආදරය පවසාවි, මම ඔබට ආදරෙයි කියා
මට ඔබ නැතුව බැරි නිසා
ඉඩොර, වස්සානයන් මැදින් වසන්තය සොයා ඉදිරියට ඇදේවි
කටුකොහොල් බිඳ නොනැසී  තියේවි
ඔබ නැතිව බැරි තුරාවට
එනමුත් හේතුව බිඳී ගිය කල ඵලය ද බිඳී යාවි
සම්බුදු වදන පසක් කරමින්

පැසුණු ආදරය පවසාවි ඔබ නැතුව බැහැ කියා
ඔබට ආදරේ නිසා
ආදරේ ඇයිද යන පැනය හමුවේ නිරුත්තර වේවි 
ඉඩොර, වස්සානයන් මැදින් වසන්තය සොයා ඉදිරියට ඇදේවි
කටුකොහොල් බිඳ නොනැසී තියේවි
මරණය වෙන් කරන තුරාවට
හේතුන්ගෙන් තොර ඵලය කෙසේ බිඳෙන්න ද

ළමැදේ වත සඟවා, විටෙක හිනැහෙමින්, විටෙක ඉකිබිඳිමින් 
ජීවිත සටනට උරදෙමින්
කෙළිදෙලෙන් ඔබ ආ මග
ආදරවන්තයින්ගේ සත්වන සැතපුම අසළ හිඳ ආපසු හැරී බලන විට
නිසැකයි දයාබරියේ
ඔබේ හිරිමල් සිත තුල පැහිච්ච ආදරයක් ඇති බව

Tuesday, May 5, 2020

පහනේ වහලා

නෙස්ප්‍රේ කිරිපිටි සමඟ නොමිලේ ලබාදුන් ළමා කතා, මා කුඩා කල ඉතා අසාවෙන් කියවූ පොත් පෙලකි. අලි බාබා සහ හොරු හතලිහ, නිදි කුමාරි, රතු හැට්ටකාරී, ඇලඩින් ගේ පුදුම පහන වැනි මතක හිටින කතා ඒ අතර විය. ඉන් වඩාත්ම කුහුල අවදිකලේ ඇලඩින් ගේ පුදුම පහන වටා ගෙතුණු කතාවයි. එහි විස්මය ජනක මායා ජාලයන් අතරේ ලොකුම පටලැවිල්ල වූයේ ඇලඩීන් සහ භූතයා අතර පළමු කතාබහයි. ඇලඩින් පළමු වරට  භූතයා දුටු විට භූතයා තමාව  හදුන්වා දුන්නේ "මම පහනේ වහලා" යනුවෙනි.

Image Source: URL

වහලා යන වචනය නාම පදයක් ලෙස එකල මා දැන සිටියේ නැත. දැන සිටියේ ක්‍රියා පදයක් ලෙස පමණි. නමුත් පොතේ තිබුණ චිත්‍රය මා දැනසිටි අරුතට ගැලපුනේ නැත. පහනේ වහලා යන්නෙන් මගේ සිතේ මැවුනේ කුරුල්ලක් අතු අග වසා සිටිනවා මෙන් පහන මත වසා සිටින භුතයෙකි. පසුකලෙක පාසලෙදි වහල් මෙහය පිළිබඳව දැන ගන්නා තුරු පහනේ වහලා නොවිසඳුණු අබිරහසක්ව පැවතිනි.

Friday, April 24, 2020

පන්සලේදී වන්දනා කරන ගාථා බුදු සාදුට ඇසෙන්නේ කොහොමද ?



කුඩා අවධියේදී  පන්සල් යෑම එම මොහොතේදීම පින් පල දෙන දුලබ අවස්ථාවකි.  අම්මලා, අච්චිලා වන්දනා කර අවසන්වනතුරු හිතේ හැටියට වැලිමලුවෙ සහ පඩිපෙල් මත දුව පැන නැටීමට ලැබීම එම පින්කමේ අනිසන්සයයි. අනිසන්සයට සමගාමිව ගාලගොට්ටියද ක්‍රමයෙන් වැඩිවේ. වැඩිහිටියෙකු පැමිණ තරවටු කිරීමෙන් පසුව තත්වය මදකට සමනය වුවද එය චිත්තක්ෂණ කිහිපයට  පමණි. මෙය ඒ අතර ඇතිවූ පුංචි ප්‍රශ්නයකි.

ඉඳහිට සදෙව්ලොවටම ඇසෙන සේ ශබ්දනගා ගාථා කියන උපාසක උපාසිකාවන් පන්සලේ දැක ඇති මුත් බොහෝ දෙනා වන්දනා ගාථා ඉතා සෙමින් මුමුණති. වැඩිහිටියන් අපගේ  ගාලගෝට්ටියට තරවටු කරන්නේ එයින් ගාථා හඬ යටපත්වී බුදු සාදුට නෑසේවි යන බියෙන්ද? අප නොසිටියද ආච්චිඅම්මා මුමුණන ගාථා ළඟ සිටින අම්මාට වත් නෑසෙන  ගානයි. ඉතින් බුදු සාදුට කොහොම ඇහෙන්නද?

මේ සිතිවිල්ලේ ඈතට ගසාගෙන ගොස් සිටියදී නොදැනුවත්ම අනිමිස ලෝචන පුජාවක් සිදුවිය. වෙනිදා එකක් ලෙස දකින ශ්‍රී  බුද්ධ ශීර්ෂයේ අවයව වෙන වෙනම පෙනිණි. ආලෝකෝ  උදපාදී, විද්‍යා උදපාදී, ප්‍රඥා උදපාදී, පිළිතුර උදපාදී. බුදුසාදු ගේ කන් සාමාන්‍ය මිනිසකුගේ කන් වලට වඩා වෙනස්ය. උරහිස් දක්වා පහලට වැටෙයි. එකත් එකටම මුමුණන ගාථා බුදු සාදුට ඇහෙන්නේ කන් දෙක දිග නිසා විය යුතුය. එපමණින් අනිමිස ලෝචන පුජාව අවසන් විය. ගාලගොට්ටියට තවත් හඬක් එක්විය.

Tuesday, March 3, 2020

ගුණේ අයියගේ බජව් දාන කාමරේ

ශ්‍රී ලංකා ජන සමාජයේ සැඟවුණු පැතිකඩක තොරතුර, නැටවෙන තනුවකින් ඉදිරිපත් කරන මෙම ගීතයේ වචන බොහොමයක් මට කුඩා කල ගීය ඇසුණු විට නොවැටහිණි. එම වචන අතරින් වැඩිපුරම කුහුල අවදි කල වචනය වුයේ 'බජව්' ය. බජව් යනු කුමක්ද, එය දැමීමට කාමරයක් අවශ්‍ය ඇයි, ගුණේ  අයියාට බජව් වලින් ඇති ප්‍රයෝජනය කුමක්ද වැනි මෙකි නොකී දහසකුත් ප්‍රශ්න අතර අතරමංව සිටියදී අහම්බෙන් මෙන් ගැටළුව විසඳීමට හෝඩුවාවක් ලැබිණි. ඒ වෙනත් ටෙලි නාට්‍යයක් නරඹන අතරතුරය. එය, ගීතයේ කියවෙන වචන වලට සමාන වචන භාවිතා කරන පුද්ගලයෙකු පරවියන් ඇතිකරන දර්ශනයකි.  එක වරම සිත තුල විදුලි බුබුලක් දැල්විණි.

විනෝදයට ඇති කල හැක්කේ පරවියන් පමණද?

එකත් එකටම ගුණේ අයියා වෙනත් සුරතල් සත්ව විශේෂයක් වෙන බජව් ඇති දැඩි කරයි. උන් ගාල් කර තබන කාමරය බජව් දාන කාමරය විය යුතුය. බජව්වකු ලෙස සිතේ මැවුනේ කුඩා ඌරු පැටවු වැනි සතෙකි. එයට මුල් වුයේ විසිතුරු වර්ණ යෙදු ඌරු පැටවකු හැඩය ගත් ගෙදර තිබුණු මුදල් එකතු කළ කැටයකි.

Wednesday, October 16, 2019

Humpty Dumpty ගෙදර ගේන්


කුඩා කල ළදරු පාසලේදි poems ඉගෙන ගත්තේ ගුරුවරියට සවන් දීමෙනි. ශබ්දය ඇසෙන ලෙස කුමක් හෝ කියමින් එකිනෙකා පරයමින් ළමෝ ගී ගයති. එක් දිනක් ඉගන්වුයේ Humpty Dumpty ට සිදුවු අකරතැබ්බයි. පසු කාලිනව දැනගත් පරිදි ගුරුවරිය ගැයුවේ මෙම පදමාලාවයි.

Humpty Dumpty sat on a wall,
Humpty Dumpty had a great fall.
All the king’s horses and all the king’s men
Couldn’t put Humpty together again.

බිත්තරයක් වූ Humpty Dumpty, තාප්පයක් මත ඉඳගෙන සිටියදී ඉන් ඇද වැටි කැඩී බිඳි ගිය අයුරු මෙහි කියවේ. හානිය කෙතරම්ද යත් රාජපුරුෂයන්ට පවා Humpty Dumpty යථා තත්ත්වයට ගැනීමට බැරි වීලු.  නියම අරුත එසේ වුවද ළදරුපාසලේදි තෙරුම්ගත හැකි වූයෙ together again (එයත් ගෙදර ගේන් ලෙස) පමණි. Humpty Dumpty ට කුමක් හෝ කරදරයක් වී ඇති බවත් ආපසු ගෙදර ගෙන ඒමට බැරි වූ බවත් අනුමානයෙන් තේරුම් ගත හැකි වුයෙන් වැඩිදුර ප්‍රශ්න නොඅසා සෑහීමට පත්වීමි. 

Sunday, November 1, 2015

How to integrate Cppcheck with Microsoft Visual Studio


  1. Download the latest version of Cppcheck from here.
  2. Open Microsoft Visual Studio IDE.
  3. In Visual Studio, open menu Tools -> External Tools.... The External Tools window will appear.
  4. Click Add button.
  5. Set Title field as Cppcheck (This can be set to any value).
  6. Set Command field to the path to cppcheck.exe (The ... button pops an Open File dialog box to select the required file).
  7. Set Arguments field to the parameters passed to cppcheck.exe (--verbose --enable=all --template=vs *.cpp *.h *.c).
    --verbose: Output more detailed error information.
    --enable=all : Enable all messages including errors, warnings, performance messages, information messages, unused function checks, style messages.
    --template=vs : Show the output in Visual Studio compatible format.
    For extended list of arguments supported by Cppcheck, refer user manual available here.
  8. Set Initial directory to $(ItemDir).
  9. Check Use Output window to redirect the Cppcheck outputs to the Visual Studio Output window.
  10. Click OK. Cppcheck should appear on the Tools menu.

To use Cppcheck, select Cppcheck menu entry on Tools menu.

Friday, October 23, 2015

Identify Memory Leaks in Visual CPP Applications

A friend of mine told me about this useful tool to identify hard to find memory leaks in Visual C++ applications. Visual Leak Detector (VLD) is an easy to use memory leak detection system. The installation package can be downloaded from here.

After installation, it can be used with any C/C++ project simply by adding the following line to the code:


#include <vld.h>



When the program is executed under the Visual Studio debugger, Visual Leak Detector will output a memory leak report of the executed segment of the code, at the end of the debugging session. If memory leaks are detected, this report will point to the exact locations in the code segment, which allocated the leaked memory block.

The header file can be easily isolated from rest of the source codes by guarding it with the pre-processor directive block. It can be made further user friendly by defining a separate Visual Studio build configuration for VLD. The steps are as follows.

Monday, October 19, 2015

Debugging with GDB


As discussed here, "printf debugging" is the most straight forward way of figuring out what is happening under the hood, during run time of an C / C++ program. But this approach is a bit time consuming as the code has to be modified and recompiled according to the debugging scenario. A more flexible way is to use a separate debugger program. GDB: The GNU project debugger stands at the top of this list. 

The general practice is to use GDB with an Integrated Development Environment as eclipse, which greatly simplifies the debugging process. However, to debug a program executing within a device which does not have a graphical user interface (for instance an embedded Linux system with a serial console), GDB on a console is a pretty useful option. 

Tuesday, March 11, 2014

Preprocessor to control printf debugging

A fundamental way of debugging an application, especially developed using  C / C++ programming languages is "printf debugging". i.e. To dump a message on to console output with some variables.

However, including too many "printf debugging" statements can hinder the performance of an application. Therefore, it is important to include a mechanism to automatically remove all such debugging statements. The easiest way to achieve this is through conditional compilations.

One straight forward way is to wrap the printf statements within a preprocessor directive as follows.


#ifdef _DEBUG
    printf("Debug message\n");
#endif


This approach adds too much clutter into the source code. Therefore, I was looking for a elegant solution to this fundamental problem and came across the following code block.

Saturday, February 22, 2014

Download YouTube videos with VLC Media Player

Saving  YouTube media files on the computer for offline viewing is easier once we have made all the configurations in the VLC media player as given here.
  1. Under Tools menu, select Codec Information (Ctrl + J).
  2. Copy the URL given as Location (As highlighted below), in the Current Media Information popup window.  

Friday, February 14, 2014

Play YouTube videos with VLC Media Player

I was searching the internet for a way to play YouTube videos with special audio and video effects like color correction, hue & contrast adjustment and other special effects. It was quite a surprise to learn that the solution was within my fingertips all the time. 

Countless times, videos have been viewed using VLC media player, simply by double clicking the file on Windows Explorer. Therefore, the Media menu rarely attracted attention and the solution was silently waiting there to be explored.

Here are the simple steps.

Friday, February 7, 2014

FTP made easy with LFTP

I was looking for a decent FTP client program to perform a relatively complex series of file transfers using a Linux shell script and came across LFTP.

LFTP is a freely available file transfer program which allows FTP, HTTP and a number of other connections to a remote host.

A few of the evaluation commands I tried with LFTP are listed here as a future reference to my self as well as anyone looking for quick examples.

Monday, February 3, 2014

Virtual WiFi hotspot with Windows 7

I had a problem with connecting multiple mobile devices to the wireless router as it had reached the maximum number of nodes. I was looking for a way to convert my laptop to a virtual WiFi hot spot and connect the mobile devices to the internet by sharing the LAN internet connection with the virtual WiFi adapter. 

A bit of Googling reviled a number of third party apps which can create a virtual WiFi. But with further reading, I learnt that this is a built in feature of Windows 7 operating system. A few configurations in the Windows "Network and Sharing Center" or a few commands on the Command Prompt do the trick.

Friday, January 24, 2014

Play WAV files with Java


The following simple application demonstrates how to play back a WAV audio file with Java APIs.
The key step is to specify the correct parameters and create an AudioFormat object.


Wednesday, January 15, 2014

Playing with Big Integers using Java BigInteger

The BigInteger class in java.math package allows to perform arithmetic operations on large numbers which do not fit into the Java primitive data types. The BigInteger class is particularly useful in cryptography operations where large prime numbers play a pivotal role.

The following snippet, which calculates the smallest factor of an integer (not in the most efficient way) gives a simple demonstration of fundamentals of using BitInteger instances in a program.

A key point to remember is the immutable nature of BitInteger instances.

Monday, January 13, 2014

Inter Process Communication: Windows NamedPipes & Java Applications

A Named Pipe is a mechanism for communication between processes. One process has to create the Named Pipe (termed as pipe server) and one or more processes can connect to this Named Pipe (pipe clients) using the unique name given to it, when it was created. 

Saturday, January 11, 2014

HTML iframe without src attribute



The HTML <iframe> tag denotes an inline frame within the HTML document. The primary usage of the inline frame is to embed another document within the current HTML document. In order to embed the intended document within the <iframe>, the address of the target document should be specified as src attribute value.

The following simple code snippet shows how to embed this page within another HTML document.

<!DOCTYPE html> <html> <body> <iframe src="http://www.duleekag.blogspot.com" width="200" height="200"> <p>iframes are not supported.</p> </iframe> </body> </html>

The paragraph tag (<p>) is used to indicate the browsers that do not support this tag. 

The intended purpose of <iframe> is to embed another document within the current HTML document. But sometimes, we all get the urge to tryout unorthodox stuff within our code. This is one such scenario where hard coded HTML content is embedded within an <iframe>. The obvious question is "why bother to add it within an <iframe>, if the content can be hard coded". Well.. this is just out of curiosity. 


<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>iframe without src attribute</title>

<script type="text/javascript">
    function onTryItClick() {
        var content = document.getElementById("iframecontent").innerHTML;
        var iframe = document.getElementById("myiframeid");

        var frameDoc = iframe.document;
        if (iframe.contentWindow)
            frameDoc = iframe.contentWindow.document;

        frameDoc.open();
        frameDoc.writeln(content);
        frameDoc.close();
    }
</script>
</head>
<body>
    <div id="iframecontent" style="display: none;">
        <b>Hello World!</b> <br /> <i>Hello Again !</i>
    </div>

    <div style="margin: auto; width: 80%;">
        <iframe height="100" width="100%" src="about:blank" name="myiframe"
         id="myiframeid"> </iframe>
        <br />
        <button id="tryIt" onclick="onTryItClick()">Try It</button>
    </div>
</body>
</html>



Thursday, January 2, 2014

Watch Star Wars through Telnet

Stumbled upon this while trying to troubleshoot a problem with Microsoft Windows Telnet client.

Telnet is a text-based program which can be used to connect to another computer using the Internet. On Microsoft Window, the Telnet client is not enabled by default. The Telnet client can be enabled by following the step by step instructions available here.

Once the Telnet client is enabled, open up a Command Prompt,

Wednesday, January 1, 2014

See if you can figure out this Benjamin Banneker mathematical puzzle..?

I got the following mathematical challenge from a friend. A bit of Googling revealed that the original challenge was presented by Benjamin Banneker.

You must spend $100 and buy 100 animals from the following list.
You must buy at least one of each category.
Cows $5.oo each
Goats $1.00 each
Chickens .05 cents each

How many Cows, Goats and Chickens you have to buy to meet the above two conditions ?

Playing with the parameters of the puzzle showed that solutions exists for different combinations of prices of animals, total spent and total number of animals purchased. 

Feel free the try out different combinations and see which ones meet the two criteria.
Example: How many Cows ($5), Goats(1$) and Chickens ($0.05) do you have to select to purchase 99 animals using $100 ?


Cow:
Goat:
Chicken:
Total Animals:
Total Amount: