mainlogo2.jpg (11011 bytes)

logo1.jpg (7522 bytes)

cpostlogo1.JPG (3434 bytes)
     Kathmandu , Wednesday October 25th, 2000.

COMPUTER

Java Threads

By Sharad Acharya
<sacharya@mum.edu>

Almost every modern programs are capable of multitasking so should be the programming languages. This means that they should be capable of doing more than one thing at a time. As an example we can perform a large processing task in the background such as sorting a huge database while doing other normal tasks. In the windowed environment multitasking is even more common phenomenon. When we think about multitasking on a single processor or machine then thread is the goody that comes into play.

A thread is a path of execution of a program. Like most other modern programming languages Java also supports threads. That means that using Java we can write highly threaded applications. A Java application can have several paths of execution that the executing program can choose to execute depending upon the priority of the individual task. As for example, on Java, the garbage collection is the lowest priority task. Virtual Machine assigns garbage collection the lowest priority thread signifying this to execute when there are no other tasks of higher priority to perform that is to say no higher priority threads to execute.

Java makes it easy to define and work with multiple threaded applications. The fundamental class in Java API to write threaded application is java.lang.Thread. There are two ways to define threads. First is to create a subclass of Thread class and override run() method of the super class and then instantiate that subclass. Second is to define a class that implements Runnable interface and pass the instance of this runnable object to the thread constructor.  This results in a thread object. When run() method is called on this thread object the interpreter creates a new object to execute the run() method. The new thread object continues to execute until run() method exits after which the thread ceases to exist.

After a thread is created it needs to be started. We can start the thread to execute by calling start() method of the thread object and it remains running until the run() method returns. The state of thread can be checked by calling the thread object's isAlive()method which returns true if the thread is alive and false if not. The current thread object can be checked by currentThread(). The sleep()method takes a 'long' type parameter and makes the thread to stop for the milliseconds returned by the expression passed to it.

In the case of several threads running concurrently there might be conflict on which thread to run first. Thanks to setPriority() method which takes an argument whose value can be between MIN_PRIORITY and MAX_PRIORITY.  The yield() method makes the current thread to give up control to any other thread of equal priority that are waiting to run.   

The checkAccess() checks whether the running thread has permissions to modify the thread object and throws a securityException if it does not. Interrupt() wakes up a waiting or sleeping thread. Calling wait() causes the current thread to block until the objects notify()  method is called by the another thread.

The optional function setName() sets name of the thread. setDaemon()sets Boolean flag specifying whether the thread is daemon or not.  The significance of the daemon thread is that the Virtual Machine keeps running until there is at least one non-daemon thread running. The previous versions of Java contained suspend(), resume() and stop() for suspension, resumption and stopping of a thread all of which has been deprecated because they are unsafe and cerate deadlock. If the thread must stop then it is necessary to check the flag periodically and exit when it is set.


VIRTUAL EXISTENCE

By Prashant Pradhan
<prashant@snakebite.com>

You don’t really need be the vocalist of the hottest band around or own a multinational company to put up a website of your own. In fact, you could do it for the mere reason of having fun, to share your photographs with friends and families or if you are having a hard time coming up with a reason good enough to please yourself, here’s one from me; claim your piece of thread from this Weird Wild Web  you are a part of it too.

If you’ve made up your mind, the next problem is to figure out how it is done. I read in a magazine the other day that any idiot can put up a website these days. A “website”  maaaaybe. But it certainly takes more than just a nitwit, if not an einstein, to come up with a “good” website. It demands a little imagination, creativity, energy, patience, a will to learn and a determination to make it. Was that good enough to scare you? If not, here’s one more  you need tools. HTML, JavaScript, CGI scripting, JAVA, Flash, blah…blah. These are the tools. And the bitter truth continues  you need to learn them all WELL   well enough to be noticed!!

Believe me, if you are just a beginner thinking of making a site to show to your friends, half of what I just said was crap. If you want to work for some web-designing company as a professional designer, then well, the list of tools waiting to crush you under their thumbs is a lot longer. But, as a novice you’d better know your way around first.

The best way to start off with are the WYSIWYG tools. It stands for What You See Is What You Get. Its like using the word-processing software from Microsoft that we all know by the name of “MS Word”. Insert images, change colors, change fonts, resize objects (like images, animations etc) and move stuff around. You can even add background sounds. Fool around for a while and, Presto! Your first web page is there in front of you. It is actually as simple as it sounds and it works too. Frustrations and that urge to jump out of the window when things don’t go the way you want them to are out of question. The best of these tools probably is the Macromedia Dreamweaver. But you can also use the ones that come for free with your browsers  FrontPage Express (MSIE) or Netscape Composer (Netscape Communicator). They serve the purpose just as well.

But there are things to learn beyond WYSIWYG too. So now I’ll tell you a little about each of the tools that I mentioned earlier   what they are for, their importance in web-designing, their limitations and capabilities and whether it is possible to learn them on your own or not. Hope it will help you out on your quest to make a website actually ON YOUR OWN.

HTML: The basic, yet the most important part of web-designing you need to learn is HTML  short for Hyper Text Transfer Protocol. When you make your website and add pictures and text to it, you give a certain format or a design to it. Such a formatted piece of text and the information on position of images on a website cannot be sent to a user’s browser from the server where the site is being hosted, without the use of HTML tags. The HTML tags tell the browser the information on where to put images, how big they should be, what text in which fonts are to be displayed in the page etc, all of which of course is determined by you when you write your page. HTML, being an integral part of web-development, has to be a piece of cake to a web designer. Its pretty much an easy task learning the tags and using them, so HTML shouldn’t be an impedance at all. And the good thing is that once you start learning it, you’ll realize how right I was. So don’t get scared with that mess you see when you do View>Source in your browser  it is really no tougher than weeding your garden once you get the hang of it  its only tedious. It however has its limitations so the knowledge of HTML alone won’t suffice if you’re thinking of coming up with a flashy, eye-catching, browser-shaking, jaw-dropping site. You’ll need more than just the knowledge of HTML for that, because all you’ll come up with HTML are humble, static, though not necessarily boring, pages. I’m not intending to undermine the capabilities of HTML, but that is the way it is. But again, you can’t go any further without it either. So do yourself a favor and LEARN YOUR HTML WELL!!   

JavaScript: No, it is not related to the much-heard programming language JAVA and Sun Microsystems was not its developer. Its just their apparently related names that always create confusion to a passerby. JavaScript is a lightweight interpreted programming language originally developed by Netscape and initially known as LiveScript. The scripts you write with JavaScript do not work on their own and neither are they compiled into “*.exe”s. The scripts have to be embedded in the HTML source of your web page. The browser provides the interpreter needed for scripts written on this language and the required task is performed when browser “reads” the scripts. All this, in English means   JavaScript is a relatively simple to learn programming language as compared to the hardcore programming languages like C and JAVA. It works with web pages and it is very useful when it comes to spicing up your page with a little bit of interactivity. You can do a pretty nifty job with event-handlers, and pop-up windows that annoy you so much can also be added to your web pages with JavaScript. There’s more to JavaScript than just the event-handlers, however, like putting cookies in a visitor’s computer, detecting browser version (to ensure browser compatibility), making buttons that close windows when clicked, creating links that take visitors back to the page they came from and those that change the color of your page’s background when rolled over. All this and more   if you spend a little time learning JavaScript. The time and effort you spend in learning this wondrous language in no case will go in vain, for it will provide you with what is now considered to be the “core skill for web-development”. The only problem with it is that it is not as flexible and forgiving as HTML so great care has to be taken when the script is written, else it could result in what Microsoft is so famous for “selling”  bugs. Now, won’t that be shameful?

CSS: Cascading Style Sheets, a feature that lets designers have a lot more control over the layout and design of their sites. CSS basically extends the limitations of HTML by letting you do stuff like turning off underlines under links, positioning objects in the page exactly where you want them to be (HTML gives you a very limited choice on where to place objects) and it even lets you indent text with remarkable accuracy. Ever wondered how the links change colors when you roll your cursor over them? CSS  that’s how they do it. MSIE version 3 and above supports it so, no problem when it comes to browser compatibility for you can hardly find people still using version 3 when IE 5.5 is out already. You can learn it on your own with a good tutorial, if you are familiar with HTML. CSS, like JavaScript is embedded in the HTML source and its pretty easy to learn, though a bit hard to master. But don’t let that fact scare you  the tool is really worth it. 

DHTML: This is what happens to HTML when you add “dynamic” to it. SO DHTML means Dynamic-HTML. It combines the capabilities of HTML, CSS and JavaScript to add interactivity to your site. One very impressive result is the “pull down menu”, which is pretty much popular in websites these days. A very interesting feature that DHTML has is its layering capability. It lets you add objects over and below each other, creating “layers” of elements. It sort of adds one more dimension to your web page. It also lets you position objects accurately  down to the last pixel. You can make images and animations fly around and make text scroll vertically through the page. The only problem that can arise is browser incongruity. Older browsers don’t support these features and different browsers use the language differently. But MSIE being the most popular browser these days, DHTML is not a bad deal at all.

CGI: As usual here’s the full form  Common Gateway Interface. Sounds scary right? It kind of is, to a beginner. It basically is a program or a piece of code residing in a web-server, that interacts with a web-browser and together they handle information. Doesn’t make much sense, does it? To put it simple, here’s an example: You visit a site and there’s a form for you to fill. You type in what you are asked to and click a button that probably says-“I’M DONE”. Now that is when CGI comes to play. As determined by the webmaster, the information will either be mailed somewhere or sent to a server or displayed in another page or whatever. The CGI scripts do this information handling. Guests-books and forms don’t work without CGI. Scripts can be written to be either compiled and run on a server or interpreted by an interpreter on the server. CGI scripts written in C and C++ can be compiled, while those written in Perl (a very popular scripting language) have to be interpreted. The scripts are usually stored in cgi-bin directory of the server and are executed from there. CGI is very powerful compared to the earlier tools but that is what triggers an irony. A cleverly written script can help a hacker make his way into a server which is why the free web-hosting services like Geocities do not allow CGI placements.  

JAVA: JAVA is a platform independent, object-oriented, compiled programming language developed by Sun Microsystems, originally named OAK after an oak tree that was visible from the programmer’s window. It was later renamed JAVA, for the coffee “Java” being the most popular drink among computer programmers after carbonated drinks. JAVA has capabilities incomparable to the earlier ones and it has other uses beyond web-development.

Graphics: Good quality graphics used cleverly in a web page give your site a professional look. JPEG and GIF are two widely used picture formats on the net. They load faster and suit the purpose well. Adobe is a popular image editing and manipulation tool, which is highly recommended for making web-graphics. Other programs like JASC’s Paint Shop Pro, Corel Graphics etc are also equally good. But better don’t try a visitor’s patience with images that may look good, but take ages to download. And with a mere 28 kbps connection of Nepal, the chances are, your visitors will go get a can of soda while the thing loads, or maybe even take a little nap….

Flash: Developed by Macromedia, Flash is quickly gaining popularity among web-designers because of its ability to make astonishingly high quality animations while equally astonishingly keeping the file size well below the value expected from such complex animations. The fact that Flash uses vector graphics (graphics made with “points and lines” rather than with “pixels”) is what makes its animations so complex yet so amazingly small in file size. The only downside is that the browser needs to have a special plug-in to play vector animations made with Flash. But as the plug-in is available for free at Macromedia’s site, that should not be a hindrance at all. It is easy to learn too and with a bit of imagination and creativity, you can create sites that apparently are impossible to be used on the net if it had not been for vector graphic  thanks to Flash, it made it happen.

So, those were the most popular tools in use right now. Better and more powerful ones like XML and VRML (a 3D navigation specification that allows creation of 3D sites) are coming up too. But for now, start off with HTML, fire up your Notepad and see what you can come up with. Learn one tool after another and you’ll soon come up with a humble little home on the information superhighway. And that is what “Virtual Existence” is all about  getting a place of your own   existing in the virtual world. Don’t just sit there and “surf” the waves, make one yourself.   


Promote IT to help NEPAL !

By Abhaya Koirala
<abkoirala@hotmail.com>

The author is an OCP - Certified Oracle Database Administrator.

Countries with different economical backgrounds have different relationship to the Information Technology (IT). Developed countries want to continue to have strong hold over the world and make heavy investments (Trillions of US dollars) on IT. And the developing countries, on the other hand, see IT as an opportunity to eradicate the illiteracy, unemployment and the poverty as a whole.

In fact developing countries earn billions of dollars from IT and so can do our country as well. Nepal can't just be the spectators to all what others do, and always remain the poorest country of the world. If Nepal too can utilize the opportunity and improve the living standard of its people then why loose it? Let all of us, from the government level to the individuals bear the responsibility over the nation, set a task for each and every body, and make all efforts to promote the IT sector in Nepal.

The Government should first maintain stability in the country, provide security of people, bring IT-friendly laws and regulations, create an environment to attract Nepalese and foreign investors to invest into the Information Technology.

Political Leaders should just forget the confrontation between the parties and get united when it concerns the fate of Nepal and the whole Nepalese people.

Business organizations should realize the potential of the IT-market, which is endless and take active participation to place Nepal in the global IT map.

The Press and the media (The newspapers, magazines, TV, radio) have an important role to keep the Nepalese people informed about the current situation in the IT-world. They should give preference to the IT-related information and the articles and cover them frequent enough.

Unemployed people and the people willing to improve their economical condition should just leave their current job and get engaged with IT related fields, no matter what is your educational background. There is a big shortage of IT experts worldwide.

And the last but not the least, why not celebrate the coming 2001 as an IT year, something like " IT NEPAL 2001''. It will help to boost IT sector in Nepal in a very short period, which is quite important for a country like ours. We'll set some targets to be achieved by the end of IT NEPAL 2001, like

 

  • Develop the infrastructure to produce the required number of qualified IT experts.

  • Make all efforts to bring the first Multi-Million project in IT from abroad, which will create a job vacancy for thousands of Nepalese. And it will motivate the people and organizations to get involved in IT.

  • Set up an infrastructure to promote software export, which is very important for a land-locked country like ours. And It may also help to solve the problem of brain-drain to some extent.

  • Establish hardware factories, where people with semi-skill or no skill can be employed, which is crucial for a country with low literacy rate.

  • Make Computer and Internet affordable to the people, and reduce the charges for telephone line used for Internet connection from all over the country. Provide all school, colleges, and universities Internet access free of charge.

  • And lots more.


Once the IT infrastructure is properly set, and as the work progress, unemployment rate will gradually fall, the literacy rate will increase and the living standard of our countrymen will improve. And the Nepalese will no more have to enter the jungle for the search of a job. They will leave the guns and rifles, and hold the mouse and keyboards instead. Finally Nepal and the Nepalese people will be able to step forward to the new millennium with the new hope and optimism.

Let us wish grand success to the "IT NEPAL 2001".

Help IT to promote Nepal ! Promote IT to help Nepal !


JobsNepal.com Nepal's first job seek engine

By Sheri Thapa
<sheri@websoftintl.com>

“The first job seek engine in the kingdom truly has great potential”, says the Support Chief of JobsNepal.com, Sanam Shrestha. Is Nepal ready for JobsNepal.com? More now then ever before is the general consensus. With the number of internet users growing steadily, it won’t be long before this medium gains equal footing with the print media.

JobsNepal.com, Nepal’s first Internet jobs site, is the largest locally focused employment Web site in the nation that specializes in empowering candidates, corporations and recruiters to manage the job search process through its web site. It is a sophisticated database driven application designed and implemented to International standards, and hosted on a fast USA-based server.

In a time when every country has its own job site, it was only natural that Nepal had one too. The kingdom bogged down by many a problem has its own cloud with a silver lining, the growing IT savvy community. Keeping this in mind, says Mr. Shrestha, WebSoft International decided to create a niche for itself by creating the kingdom’s first job site. He is also of the opinion that, although the monetary aspect is totally non-profit as of now, service of this caliber will surely account for something in the
future.

For employers and recruiters seeking the right candidate, JobsNepal.com can become a mighty resourceful site. It is dedicated to helping employers get the most from their time and money investment in Internet recruiting. Besides the general advertising of jobs, reviewing resumes and managing their performances is facilitated. Since the site is targeted at virtually any sized business, employer services have been customized to deliver lucrative expediency.

When we speak of Nepal in internet terms, we mean the Kathmandu valley, Pokhara and perhaps Biratnagar, Birjung, Butwal, Bhairawaha, Narayangadh, Jhapa and Dharan. This means that within this range employment possibilities have multiplied immensely. Not only is it the most efficient and detailed way of finding the ideal employee, but precious time is saved from the sending out of a job advertisement to the actual hiring.

When asked about the quality of their service, the Support Chief had this to say, “Our customer service is, probably, the best in the kingdom. We answer all queries from our clients and regularly update the site to ensure user-friendliness”.   

So far, the site featuring over 243 companies and 450 resumes, a decent start considering its launch period was mid-August. In a few months time, the developers at JobsNepal.com plan to steadily add features to the basic version. Lastly, Mr. Shrestha added, “Regarding the longevity of the site, it is most definitely our desire to grow with each passing year.”

With its mission to lead the Internet employment industry in Nepal by providing innovative information, superior resume management software and a comprehensive selection of services, it sure has long time goals.


 

Past Issues

2000 © Mercantile Communications Pvt. Ltd. P.O. Box 876, Durbar Marg, Kathmandu, NEPAL. Tel : 977 1 220 773, 243566. Fax: 977 1 225 407. Reproduction in any form is prohibited without prior permission. No part of the articles which appear in the internet version on CYBER POST may be reproduced without the permission of Mercantile Communications Pvt. Ltd. For reprinting rights, please write to US. Send us your feedback: CONTACT US ABOUT US HOME CYBER POST is a fortnightly information technology feature page of The Kathmandu Post published on second and last Wednesday of every month. Send feed back to the coordinator cyberpost_tkp@yahoo.com.

BACK TO THE TOP