|
||
|
||
By Sharad Acharya 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 You dont 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, heres one from me; claim your piece of thread from this Weird Wild Web you are a part of it too. If youve 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, heres 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 youd 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 dont 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 Ill 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 users 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 shouldnt be an impedance at all. And the good thing is that once you start learning it, youll realize how right I was. So dont 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 wont suffice if youre thinking of coming up with a flashy, eye-catching, browser-shaking, jaw-dropping site. Youll need more than just the knowledge of HTML for that, because all youll come up with HTML are humble, static, though not necessarily boring, pages. Im not intending to undermine the capabilities of HTML, but that is the way it is. But again, you cant 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 *.exes. 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. Theres more to JavaScript than just the event-handlers, however, like putting cookies in a visitors 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 pages 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, wont 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 thats 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 dont let
that fact scare you the tool is really worth it. 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 programmers 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 JASCs Paint Shop Pro, Corel Graphics etc are also equally good. But better dont try a visitors 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 Macromedias 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 youll 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. Dont just sit there and surf the waves, make one yourself. Promote IT to help NEPAL ! 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. 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
Help IT to promote Nepal ! Promote IT to help Nepal ! JobsNepal.com Nepal's first job seek engine 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. |
|
| 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. |