Friday, July 17, 2020

Writing Articles for SEO

Writing Articles for SEO Writing for publication on the Internet requires a slightly different approach than writing for print media. As Internet marketing and e-commerce continue to grow, businesses are discovering the opportunity to compete in a global market; all that is needed are the right designers and writers to make that happen. Such demand has created a new category in freelance writing, in which writers specialize in writing for publication on the Internet. In addition to understanding Internet trends and e-commerce marketing tactics, writers who publish online must be aware of one of the most common buzzwords in Web development and website administration: SEO, or Search Engine Optimization.The success of a website heavily depends on its visibility to the Internets major search engines, and oftentimes, the sites content is the primary factor that makes such visibility possible. Consequently, site developers incorporate content in the form of articles that are created using specific keywords. When a n Internet user enters a keyword, or keyword phrase, into a search engine, that search engine uses crawlers to find relevant websites containing those words. The mission, then, of an SEO writer is to create content that can be easily found by a search engines crawlers. It is technical writing at its best, and has proven to be one of the more effective methods of increasing traffic, and therefore more revenue, to a website.Article writers, whose primary purpose is for creating SEO content, find themselves in a unique position of balancing the craft of writing with a formulaic approach. Writing effective SEO articles entails an ability to determine the fine line between keeping the reader engaged and distributing keywords both frequently and subtly. Take for example the following passage:If you are seeking for online college degree program options, there are a variety of choices available to meet your specific goals. Many students are happy to discover that earning an online degree ca uses little to no interruption in their already hectic lives, and tend to benefit greatly from the career advancement a college degree offers. Earning your degree online has never been easier! Call us today to set up an appointment with one of our degree program counselors.The above paragraph is considered keyword heavy, with variations of a commonly used keyword phrase: online college degree program. The author incorporates some part of the phrase in each sentence without being too obvious about it, keeping the voice of the article as conversational and natural as possible. An average reader searching online for information about online college degree programs would find the article helpful, without necessarily realizing that it was written with the primary purpose of drawing Internet traffic to a particular website. That website might be one that serves as a portal for online schools offering degrees to nontraditional students, and this segment from an article listed on their site would help to attract a lot of business.In addition to frequently including the primary keyword, or keyword phrase, writing an effective SEO articles includes brainstorming similar keywords to match the original one(s). To do this, it is important to consider the possible Internet search queries of your intended audience. Continuing the above example, if a potential student is searching for schools in which he or she could earn an online college degree, other possible searches might include online degree programs, online universities, online colleges, and degrees from home. The SEO article writer would then incorporate these keyword phrases into the article to maximize the potential for more site traffic. Webmasters use such content-specific writing to attract particular audiences to their site; by doing so, they assure effective leads from Internet users who are looking for precisely what their site or business has to offer.After an author assures that keyword variation and freque ncy is abundant, the next consideration that an SEO article writer must have is concerning the length of the article. As a standard of practice, SEO articles are between 300 and 500 words in length. This number factors in the typical attention span of most Internet users, while allowing for enough keyword distribution to attract the attention of the search engine crawlers.Another consideration, although not the most important one, would be regarding format. SEO articles should contain short paragraphsâ€"preferably two to four sentences in length. Most people tend to skim over material when they are surfing the Internet, and shortened paragraphs make it easier on the eye to do this. Extended-length paragraphs are not as easily read, and therefore are often avoided by the average Internet user. Although research provides multiple possibilities for this fact, some of the more commonly accepted explanations include the stress on the eye involved with reading a computer screen and the en tertainment element associated with surfing the Internet.The final factor in creating SEO articles is to assure that each article is impeccably edited. In Internet commerce, as with any business, presentation and first impressions are key in attracting and maintaining clients. If an SEO article is poorly written, or contains multiple grammar and spelling errors, the website containing that article could be easily passed over as being unprofessional and amateurâ€"two descriptors most Web designers would like to avoid. Many websites offer excellent pay and a steady flow of commissioned assignments to SEO article writers who can deliver quality content, while helping to build a companys online image and brand. With a knowledgeable and conscientious writer, the resulting SEO article can work to draw traffic and leads to a website for many years to come.

Wednesday, May 6, 2020

Hamlet, By William Shakespeare - 852 Words

Within Shakespeare’s tragedy, Hamlet, the churning tides of and hate are very prominent, but, as the character’s personalities collide and develop, revenge is the key that unlocks their unprecedented doom. There are different styles of writing in this piece that represents revenge. From the start of the play (the epilogue) there were signs of different styles of writing. Looking more closely to the text, Hamlet would address the royalty in the poetic form while addressing to people under him in old English. Revenge is indubitably Hamlet’s forte, but it also made the reader’s understand the morality of the issue. Mortality was mentioned in almost every line in Hamlet. According to North Drop Frye, Hamlet seems to be the first play of Shakespeare in which he is deliberately competing with a well known earlier play on the same subject. The other play s title is not known, but allusions to it tells thrift had a ghost cryingHamlet, Revenge!. One of the most popular tragedies of the time was the Spanish tragedy, by Thomas Kyd, and some resemblance between it and Hamlet suggest that the earlier Hamlet was also kyd s . Shakespeare s longest play was Hamlet partly because everyone, with exception of the two women, talks too much.†Ã¢â‚¬  Brief let me be,†Ã¢â‚¬  says Ghost, and goes on for another fifty lines.† I will be brief, that s Bologna, after the clean pools him up and tell him to get on with it but he isn t even the player clean, Gertrude says protest tooShow MoreRelatedHamlet, By William Shakespeare880 Words   |  4 PagesWilliam Shakespeare is praised as the pioneering English poet and playwright whose collection of theatrical works is regarded as the greatest artistic value throughout the history of English literature. Shakespeare delved into the spiritual and mental component of humanity and the consequences that arise from this human spirit when it is disputed. The most famous revenge tragedy play, Hamlet, is an excellent illustration of Shakespeare’s philosophical study of human nature. In Hamlet, the arguableRead MoreHamlet, By William Shakespeare899 Words   |  4 PagesWilliam Shakespeare, author of Hamlet, was a well-known author in the 1500s and is still popular today. He was born on April 24, 1564 in London, England. Although there were no birth records at tha t time, it shows he was baptized one year prior to that, which leads us to believe his birthday was in 1564 because children were normally baptized a year after their birth. Shakespeare’s writing style was very different than others at that time. He used many metaphors and rhetorical phrases, and most ofRead MoreHamlet, By William Shakespeare996 Words   |  4 PagesHamlet, written by William Shakespeare, with out a doubt holds the most famous soliloquy in English history spoken by Hamlet in Act III, scene i, lines 57-90. This soliloquy holds much importance to the play as a whole because it ties together the reoccurring themes of suicide and Hamlet’s inaction portrayed by Shakespeare. Hamlet poses a problem, which is the driving force of the play: â€Å"To be or not to be?†(III.i.57). Shakespeare uses this logical question asked by Hamlet to drive out his underlyingRead MoreHamlet, By William Shakespeare1178 Words   |  5 Pages In William Shakespeare’s play Hamlet, the protagonist suffers from struggles with major characters, especially with the women in his life. While reading the play Hamlet, Hamlet appears to be a disillusioned man. Throughout the play, Shakespeare has only casted two females: Gertrude and Ophelia. Gertrude is defined to be incestuous, naà ¯ve and cold-hearted. On the other side, Ophelia is characterized to be ignorant, innocent and fearful. After the quick marriage of his mother and evil uncle, Hamlet’sRead MoreHamlet, By William Shakespeare1308 Words   |  6 PagesHamlet is arguably one of the greatest tragedies in all of literature and when most people think of tragic plays, they think of none other than the one who wrote it, William Shakespeare. This classic story of revenge excites it’s readers with its main character, Prince Hamlet, who goes through the unique human-like process of revenge that is often overlooked. Many other stories rely heavily on the logi c of good people doing good things and bad people doing bad things just for the sake of their natureRead MoreHamlet, By William Shakespeare Essay1453 Words   |  6 PagesHamlet by William Shakespeare explores many aspects of mankind--death, betrayal, love, and mourning. Out of these, the most prominent theme in this play is death in the form of suicide. The main character, Hamlet, finds himself questioning the quality of life and the uncertainty of the afterlife once he discovers news of his father s death and the corruption in the kingdom that follows. Ophelia, Hamlet’s lover, is found dead later in the plot and is presumed to have committed suicide. In Hamlet’sRead MoreHamlet, By William Shakespeare1146 Words   |  5 PagesA character so complex, enticing and fascinating, his name is Hamlet. We are all Hamlet, and that, is the argument. Hamlet is an enigmatic character with many flaws. These flaws are the ones that prove similarities between us and him. A play so popular and significant is due to its huge relevance to us as a society. In the play Hamlet, William Shakespeare uses Hamlet’s character and metaphor to demonstrate that when one is left alone to their thoughts, these thoughts overtake reason. ConsequentlyRead MoreHamlet by William Shakespeare1456 Words   |  6 PagesThe play Hamlet, by William Shakespeare, takes place in a time where the impossible was a part of the lives of everyday people. Occurrences that people in the modern time would believe unbelievable. Yet, with just a quill and parchment Shakespeare’s is able to connect the past and present by weaving a plot with skill that is still unparalleled to this day. The play Hamlet this exceeds this expectation by revealing depth of Hamlets, the protagonists, character personality through the useRead MoreHamlet, By William Shakespeare1920 Words   |  8 PagesIn the play Hamlet by William Shakespeare, the character Hamlet must deal with both external and internal conflict. Hamlet encounters many struggles and has trouble finding a way to deal with them. With so many corrupt people in his life, Hamlet feels as if there is no one that he can trust and begins to isolate himself from others. A result from this isolation leads Hamlet to become melancholy. Hamlet struggles with suicidal thoughts, wants to kill King Claudius, and is distraught over his mother’sRead MoreHamlet, By William Shakespeare846 Words   |  4 Pagesalways been a contemplative topic. In Hamlet, the main character Hamlet thinks to himself about suicide. Hamlet was written by William Shakespeare. Shakespeare wrote Hamlet between 1599 and 1602. William Shakespeare is one of the greatest playwrights in history. Hamlet is about Prince Hamlet of Denmark who is trying to find out about the death of his father after his father s ‘ghost’ comes to him telling him it was his uncle who had killed him. While Hamlet contemplates suicide he gives his famous

MSU Application Essay Free Essays

High school times were tough years I have surpassed as I am about to enter a new level of my education, College. I always dream to be in a high standard University where I know, can polish much my knowledge, not only give me knowledge in my chosen field but also to inculcate in my being the attitudes and ideals every person needs to succeed in every endeavor they undertake. I am from Indonesia; I want to study in Michigan State University for I know it can meet my educational needs and help me to achieve more in my life. We will write a custom essay sample on MSU Application Essay or any similar topic only for you Order Now Not all of the students are given such great opportunity to be part of this University. Being a student of MSU is just like one step away from the green pastures, a place where success are easily within my reach if I will just strive hard to achieve it. As an international applicant as I am from Indonesia, I believe I could greatly contribute much to the cultural life of Michigan State University, in the manner that I can share to other students the values, beliefs, traditions of my country. Even if I am already in a foreign land, I could still preserve my culture and not just totally forget about it. I will be very proud to share, to cultivate more the values my home land has implanted in my being. I will show to them how an Indonesian respects other people, the elders, the beliefs and traditions of other denominations, religious groups and how to treat those who other people thought does not deserve any respect at all. As an Indonesian, I was brought up to be an educated individual. Way back in Indonesia, I always see to it that I never hurt or break our families’ rules, even our schools’ rules and policies. For me, breaking a law that you know is bound to any punishment is negligence and is not showing any responsible attitude reflected by the upbringing of one’s family. I also have been to many trials as a student but this does not stopped me from dreaming more. I dream to be a successful individual, and a better person whom people sees as an epitome of diligence, courage, love, justice and integrity. Diligence in what I am doing, I see to it that I give my all and not just mediocrity, letting the people know that even I am from a foreign country I can still manage to excel; Courage, having the courage and strength to persevere amidst all trials and difficulties that an ordinary and weak spirit will almost surrender; love, having the passion in doing things related to my chosen endeavor, like in my studies and other school projects and not thinking of the hindrances; Justice and Integrity are those essential ingredients of becoming a great student, not just an ordinary student applicant from Indonesia, but an Outstanding and Exemplary student from Indonesia, who dreams and is working in that dream to become into reality. Not minding the boundaries, thousands of kilometers, miles, several oceans to cross; but the dream of having a great and successful future in Michigan State University. I know that I can be of great influence to other students, to individuals in the community that sometimes thought that one can never do great big things. I will show to them that I may not be perfect in terms of physical attributes, intellectually but I know that I am real and I will strive hard, be willing and be always determined to persevere. Just fight, fight, fight. For I know I am going to reap my reward if I will just stay strong and not frail and not lose hope. I firmly believed that on my way to my success in the future are my family, friends and colleagues support towards me. Their undying love, support and faith in me keeps me going on. How to cite MSU Application Essay, Essay examples

Saturday, April 25, 2020

Software Patents and Piracy in China

Introduction Background Information Technology (IT) is one of the most important elements in the development of the world economy. The software industry forms one of the most essential components of IT. The size of the global software market has undergone a significant growth over the past few years. According to a report by Gartner Incorporation (para. 1), the software market averaged $245 billion in May 2011. However, one of the major challenges facing the software industry is piracy which entails infringing the copyright laws associated with products such as music, movies or software.Advertising We will write a custom research paper sample on Software Patents and Piracy in China specifically for you for only $16.05 $11/page Learn More In an effort to curb software piracy, different governments have instituted various Intellectual Property Rights (IPRs). One of the commonly used IPRs in the software industry entails the patent laws. Patent laws give in ventors a monopoly over their inventions by prohibiting illegal publication and distribution of software programs either through counterfeiting, rentals, soft lifting and hard disk loading (MacQueen, Waelde Laurie 4). Considering the fact that development in IT is increasingly being considered as one of the most effective ways through which a country can gain a high competitive advantage, some countries are considering software piracy as an effective way through which they can attain their desired competitive advantage at minimal cost (Jones 24). The rate of software piracy is highest amongst the emerging economies. This arises from a number of factors such as affordability, poor enforcement of IPRs, technical barriers and the comparative value associated with pirated software (Deloitte 2). Most of the developing economies have a relatively low per capita income. As a result, the consumers have other spending priorities rather than purchasing legitimate software. Additionally, indi vidual consumers attach the same value of legitimate software to pirated software. The Peoples Republic of China (PRC) is categorized amongst the countries with the highest rate of software piracy. In 1998, the rate of software piracy in China was 96 %( Jones 24). However, China has continuously implemented measures aimed at curbing software piracy due to pressure from other countries to comply with International IPRs. As a sign of its commitment towards IPRs, China has joined a number of international IPR conventions. This has enabled it to understand the importance of IPRs in dealing with software piracy. As a result, China has experienced a decline in the rate of software piracy over the past few years. By 2008 the rate of software piracy was 80% (Deloitte 24). This shows that the rate of software piracy in China is still high despite the measures implemented. China is ranked as the 2nd largest market for personal computers and the 10th with regard to software. This shows that th ere is a high market potential for software. The gap with regard to software market can be associated with the high rate of software piracy.Advertising Looking for research paper on intellectual property? Let's see if we can help you! Get your first paper with 15% OFF Learn More One of the factors that have contributed to the high rate of software piracy relates to existence of an imbalance between demand for software products such as movies and other entertainment products and their supply. The Chinese government has implemented a quota system that is aimed at regulating importation and distribution of entertainment products for example television shows. This has led into a shortage for entertainment digital entertainment products such as movies. As a result, most individuals have resulted into the black market for software products. Software piracy negatively affects the growth of the world economy. This arises from the fact that a significant proportion of tax reven ue and wages are lost annually. Additionally, software piracy acts as a barrier towards creativity and innovation. This is due to the fact that motivation for creativity and innovation is significantly reduced. Personal experience In 2007, I had an opportunity to travel to China to my relative who relocated there. One of the issues that I noticed is the ease with which one can purchase pirated products. This made me to ascertain that China is one of the countries with the highest rate of piracy. Some of the most pirated product categories which I noticed included software, fashion clothing, electronics and jewelry. With regard movies, it was relatively easy to purchase them from street vendors. One the factors that made me to identify that the movies were pirated is the cost at which they were sold. For example, one could purchase movies which were still in the theatres for only $1. Some of the movies were of the same quality with the original ones while others were of poor quality. The poor quality of the pirated DVDs and CDs was as a result of failure by the counterfeiters to access the original copy. As a result, they would video tape movies in the theater screens from which they would make copies. However, pirated computer software and video games were not easily accessible from the street vendors. One would be required to purchase them from a particular central area where they were abundant. The discs which contained the video games and the computer software had no labels which made one to easily identify them as counterfeits. Additionally, the distribution of the discs was made in simple sleeves. In these stores, one would be able to select a variety of software which would be burned into one CD as per the customer’s request. In order to gain firsthand experience on the extent of computer software piracy, I enquired the cost of a number of computer software which included FrameMaker, Photoshop and Adobe Acrobat. The cost of the software was only $ 20 while the genuine ones cost more than $700. My relative informed me that software piracy is considered to be a part of the Chinese culture. This arises from the fact that copying in china is not associated with any form of stigma. Most individuals have developed a perception that they ought not to pay more for software whereas they can access a fake one which works just like the original one at a low cost.Advertising We will write a custom research paper sample on Software Patents and Piracy in China specifically for you for only $16.05 $11/page Learn More Software patent laws in China Over the past two decades, China has increasingly been committed towards ensuring adherence to IPR laws. For example, from 1980 to 1995, China has implemented a number of trademark laws, copyright, patents and computer software regulations in an effort to counter software piracy. Despite this, software piracy is so prevalent that one can consider that there are no soft ware patent or copyright laws in China. Since its ascent to the World Trade Organization (WTO), China has increased its crackdown on organizations manufacturing pirated software. Additionally, the Chinese government has invested a significant amount of money towards development its legal systems and regulatory codes in an effort to enforce software privacy. For example, the Chinese government is committed towards ensuring that all state-owned enterprises and other government agencies use legal software in their operation. This has played a critical role in the decline in the rate of software piracy (Business Software Alliance para. 6). However, China has continued to experience an increase in loss of its revenue due to software piracy arising from infringement of IPRs (Hille para. 1). This indicates that the software patent and copyright laws implemented by the government are not sufficient. The inefficiency of these laws arises from a number of factors such as overreliance on admin istrative measures. For example; the administrative measures incorporated by China are evidenced by the fact that it has seized about 10 million boxes of illegal video products. Additionally, more than 4,000 video selling shops have been closed (Zhang Xie 2). In an effort to enhance the IPR laws, the Chinese government has established State Copyright Bureaus in all the provinces and municipalities. Despite these efforts, the Chinese government effort in fighting software piracy has been hindered by the fact that it over relies on administrative measures rather than criminal measures (Zhang Xie 3). Additionally, the government’s effort has also been hindered by increased levels of corruption and protection of the perpetrators at the provincial level. The government’s effort has also hindered by lack of resources necessary to enforce the laws implemented. The prevalence of software piracy is also increased by lack of sufficient knowledge amongst the citizens regarding the effect of software piracy on the country’s economy and social stability. Ethical perspective Most Chinese do not perceive software piracy as being morally or ethically wrong. Additionally, the ethical perspective regarding fighting software piracy in China revolves around two main issues. These relate to protecting the investments by companies, protecting their employees and the poor citizens. Therefore, implementing stringent IPR laws by the government to curb software piracy would result in social instability.Advertising Looking for research paper on intellectual property? Let's see if we can help you! Get your first paper with 15% OFF Learn More This arises from the fact that numerous individuals would be arrested and shops and companies closed culminating into an increment in the level of social instability. However, another dilemma arises from the fact that allowing software piracy to thrive would negatively affect the rate of innovation by hi-tech companies. This arises from the fact that they would cease to produce new software culminating into a decline in the rate of development in the global economy. Conclusion and recommendations From the above analysis, it is evident that there is a high market potential in the Chinese software industry. However, for this to be achieved all the stakeholders have to deal with the challenge of software piracy. Some of these stakeholders include the government, parents and learning institutions. Additionally, it is critical for the Chinese government to implement deterrent measures, educational campaign and other measures in order to enforce the laws. It is also important for the gove rnment and the software producing companies to implement preventative measures. Some of these measures include incorporating hardware and software schemes which will curb reproduction of software. For example, companies such as Microsoft Incorporation have implemented a key that requires to be sent through their database before particular software can operate. Another measure that can be implemented to counter software piracy entails implementing regional price adjustments. The price point set should be legal and affordable to individuals within a particular region. This strategy will encourage individuals to purchase legitimate software. Works Cited Business Software Alliance. China. 5 March 2011. Web. Deloitte. Monetizing consumer software in high-piracy market including China and  India. New York: Deloitte Development, 2010. Print. Gartner Incorporation. Gartner says worldwide enterprise software market grew  8.5% in 2010 to reach $ 245 billion. 5 May 2011. Web. Hille, Kathri n. China not doing enough on software piracy. 24 Oct. 2011. Web. Jones, Brian. Software piracy and the global economy. 23 Nov. 1998. Web. MacQueen, Hector, Waelde, Charlotte and Laurie, Gen. Contemporary intellectual  property: Law and policy. Oxford: Oxford University Press, 2007. Print. Zhang, Fan and Xie, Dennis. Chinese copyright protection has storied history,  strong future. 6 June 2008. Web. This research paper on Software Patents and Piracy in China was written and submitted by user Sloane T. to help you with your own studies. You are free to use it for research and reference purposes in order to write your own paper; however, you must cite it accordingly. You can donate your paper here.

Wednesday, March 18, 2020

The eNotes Blog Top Ten Summer ReadingSuggestions

Top Ten Summer ReadingSuggestions Since I was a very small child, the absolute best thing about summer was the extra time to read. My mother, fed up with me being in the house, would throw me outside to get some sunshine. So I took my book outside, sat on the porch, and waited to be let in. Like a cat. Summer is still the best time to get some reading done and the time that a lot of my professorial/literary snot friends (stop protesting you  know  its true) unbutton that top button and go for some non-standard fare. But the choices can be overwhelming: Here are suggestions for some good pleasure reading for fun and even knowledge to help you get the most out of those precious extra hours: 1.   Mr. g  by Alan Lightman   How about a little blasphemy to go with that  daiquiri? One friend heartily suggests this novel. Publishers Weekly calls  Mr. G  a touching, imaginative rendition of God’s creation of the universe†¦the immortal characters are changed by their brush with the enterprising, however doomed, mortals, bringing this elucidating treatment of quantum physics to an affecting, hopeful conclusion.† 2.   The Prague Cemetery  by Umberto Eco   Several friends asked for this novel by the Italian mystery/detective master (who penned  The Name of the Rose  and  Foucaults Pendulum)  to be included. I find this book fascinating, perhaps the best Eco has written in years. Eco takes on conspiracy theories in the feverish political activism of nineteenth-century Europefreemasonry, the Italian Risorgimento, the Paris Commune, and above all the forgery of the slanderous The Protocols of the Elders of Zion. What if there were a single mastermind behind all these conspiracies? Its already a bestseller in Italy, and I cant get enough of it! ~  Huffington Post 3.   Lets Pretend This Never Happened  by Jenny Lawson Those of us who have been LONGTIME fans of The Bloggess are beside ourselves with glee at the arrival of Lawsons first traditional book. Just take a look at these chapter titles, will ya? â€Å"Stanley the Magical, Talking Squirrel†; â€Å"A Series of Angry Post-It Notes to My Husband†; â€Å"My Vagina Is Fine. Thanks for Asking†; â€Å"And Then I Snuck a Dead Cuban Alligator on an Airplane.† She is hysterical and you should buy this book. Now. 4.   Sacre Bleu: A Comedy DArt  by Christopher Moore   This selection was heralded by several people. Heres the scoop: In July 1890, Vincent van Gogh went into a cornfield and shot himself.  Or did he?  Why would an artist at the height of his creative powers attempt to take his own life . . . and then walk a mile to a doctors house for help? Who was the crooked little color man Vincent had claimed was stalking him across France? And why had the painter recently become deathly afraid of a certain shade of blue? These are just a few of the questions confronting Vincents friends- baker-turned-painter Lucien Lessard and bon vivant Henri Toulouse-Lautrec- who vow to discover the truth about van Goghs untimely death. Their quest will lead them on a surreal odyssey and brothel-crawl deep into the art world of late nineteenth-century Paris. 5.   Kitty Cornered  by Bob Tarte   Tarte has a remarkable ability to depict animal behavior and see the humor (and toils) of   pets without anthropomorphizing his beloved menagerie. Fans of his previous work (Enslaved by Ducks, Fowl Weather)  will once again delight in the various antics of all his animals, but will appreciate the focus on his six quirky felines. I dare you not to fall in love with Frannie and all the others. 6.   11/22/63  by Stephen King   King, of course, has been a popular favorite for over thirty years but he has not always enjoyed critical acclaim; this novel, however, has garnered both. Most people will instantly recognize 11/22/63 as the infamous date when President John F. Kennedy was assassinated. King imagines what would happen if a time traveler was able to go back to that fateful day and change the course of history. 7.   Little Bee  by Chris Cleave Also being tucked into beach bags this summer is Chris Cleaves  Little Bee.   If you enjoy riveting, character-based novels, this might be a good choice for you too.   Here is what the  Washington Post  had to say: Little Bee  will blow you away. In restrained, diamond-hard prose, Cleave alternates between these two characters points of view as he pulls the threads of their dark but often funny story tight. What unfolds between them is both surprising and inevitable, thoroughly satisfying if also heart-rending. 8.   Sandman (Series)  by Neil Gaiman Sometimes summer demands becoming totally obsessed with a series.   You couldnt ask for a better way to spend dozens of hours than to be immersed in Gaimans series of graphic novels. The  Sandman  novels are a rich blend of modern myth and dark fantasy in which contemporary fiction, historical drama and legend. The works are   widely considered one of the most original and artistically ambitious series of the modern age. 9.   Incognito: The Secret Lives of the Brain  by David Eagleman   Looking for a good non-fiction read that also serves as a dandy excuse that no one will bother you about playing volleyball or frisbee or anything remotely athletic? This is the book for you. You get to learn all sorts of cool stuff here, like why you keep dreaming that dream about the elephant in your mothers underpantsor is that just me?   Seriously, though, Eaglemans study is a fascinating look into what goes on inside the brain, both consciously and unconsciously. Listen to a great interview with Eagleman on NPRs  Fresh Air  here. 10.   Undead and Undermined  by Mary Janice Davidson Vampire Queen Betsy Taylor thought she couldnt die. So whats she doing in the morgue? It could have something to do with a time- traveling trip she made, and a foe with a wicked agenda that could finally be the real death of Betsy-if shes not careful. Cmon. You  know  you  want to.   Ã‚  Tuck it into your snooty copy of Tolstoy if you must (be prepared to explain the funny parts though) or flaunt it and ask the person next to you if they would also enjoy some box wine and some Cheetos. Cmoooooon. its  summer.

Sunday, March 1, 2020

Dispose Objects in Visual Basic

Dispose Objects in Visual Basic In the article, Coding New Instances of Objects, I wrote about the various ways that New instances of objects can be created. The opposite problem, disposing an object, is something that you wont have to worry about in VB.NET very often. .NET includes a technology called Garbage Collector (GC) that usually takes care of everything behind the scenes silently and efficiently. But occasionally, usually when using file streams, sql objects or graphics (GDI) objects (that is, unmanaged resources), you may need to take control of disposing objects in your own code. First, Some Background Just as a constructor (the New keyword) creates a new object, a destructor is a method that is called when an object is destroyed. But theres a catch. The people who created .NET realized that it was a formula for bugs if two different pieces of code could actually destroy an object. So the .NET GC is actually in control and its usually the only code that can destroy the instance of the object. The GC destroys an object when it decides to and not before. Normally, after an object leaves scope, it is released by the common language runtime (CLR). The GC destroys objects when the CLR needs more free memory. So the bottom line is that you cant predict when GC will actually destroy the object. (Welllll ... Thats true nearly all of the time. You can call GC.Collect and force a garbage collection cycle, but authorities universally say its a bad idea and totally unnecessary.) For example, if your code has created a Customer object, it may seem that this code will destroy it again. Customer = Nothing But it doesnt. (Setting a an object to Nothing is commonly called, dereferencing the object.) Actually, it just means that the variable isnt associated with an object anymore. At some time later, the GC will notice that the object is available for destruction. By the way, for managed objects, none of this is really necessary. Although an object like a Button will offer a Dispose method, its not necessary to use it and few people do. Windows Forms components, for example, are added to a container object named components. When you close a form, its Dispose method is called automatically. Usually, you only have to worry about any of this when using unmanaged objects, and even then just to optomize your program. The recommended way to release any resources that might be held by an object is to call the Dispose method for the object (if one is available) and then dereference the object. Customer.Dispose() Customer Nothing Because GC will destroy an orphaned object, whether or not you set the object variable to Nothing, its not really necessary. Another recommended way to make sure that objects are destroyed when theyre not needed anymore is to put the code that uses an object into a Using block. A Using block guarantees the disposal of one or more such resources when your code is finished with them. In the GDI series, the Using block is put to use quite frequently to manage those pesky graphics objects. For example ... Using myBrush As LinearGradientBrush _ New LinearGradientBrush( _ Me.ClientRectangle, _ Color.Blue, Color.Red, _ LinearGradientMode.Horizontal) ... more code ... End Using myBrush is disposed of automagically when the end of the block is executed. The GC approach to managing memory is a big change from the way VB6 did it. COM objects (used by VB6) were destroyed when an internal counter of references reached zero. But it was too easy to make a mistake so the internal counter was off. (Because memory was tied up and not available to other objects when this happened, this was called a memory leak.) Instead, GC actually checks to see whether anything is referencing an object and destroys it when there are no more references. The GC approach has a good history in languages like Java and is one of the big improvements in .NET. On the next page, we look into the IDisposable interface... the interface to use when you need to Dispose unmanaged objects in your own code. If you code your own object that uses unmanaged resources, you should use the IDisposable interface for the object. Microsoft makes this easy by including a code snippet that creates the right pattern for you. Click Here to display the illustrationClick the Back button on your browser to return The code that is added looks like this (VB.NET 2008): Class ResourceClass   Ã‚  Ã‚  Implements IDisposable   Ã‚  Ã‚   To detect redundant calls   Ã‚  Ã‚  Private disposed As Boolean False   Ã‚  Ã‚   IDisposable   Ã‚  Ã‚  Protected Overridable Sub Dispose( _   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  ByVal disposing As Boolean)   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  If Not Me.disposed Then   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  If disposing Then   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Free other state (managed objects).   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  End If   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Free your own state (unmanaged objects).   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Set large fields to null.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  End If   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Me.disposed True   Ã‚  Ã‚  End Sub #Region IDisposable Support   Ã‚  Ã‚   This code added by Visual Basic to   Ã‚  Ã‚   correctly implement the disposable pattern.   Ã‚  Ã‚  Public Sub Dispose() Implements IDisposable.Dispose   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Do not change this code.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Put cleanup code in   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Dispose(ByVal disposing As Boolean) above.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Dispose(True)   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  GC.SuppressFinalize(Me)   Ã‚  Ã‚  End Sub   Ã‚  Ã‚  Protected Overrides Sub Finalize()   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Do not change this code.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Put cleanup code in   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Dispose(ByVal disposing As Boolean) above.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  Dispose(False)   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  MyBase.Finalize()   Ã‚  Ã‚  End Sub #End Region End Class Dispose is almost an enforced developer design pattern in .NET. Theres really only one correct way to do it and this is it. You might think this code does something magic. It doesnt. First note that the internal flag disposed simply short-circuits the whole thing so you can call Dispose(disposing) as often as you like. The code ... GC.SuppressFinalize(Me) ... makes your code more efficient by telling the GC that the object has already been disposed (an expensive operation in terms of execution cycles). Finalize is Protected because GC calls it automatically when an object is destroyed. You should never call Finalize. The Boolean disposing tells the code whether your code initiated the objects disposal (True) or whether the GC did it (as part of the Finalize sub. Note that the only code that uses the Boolean disposing is: If disposing Then   Ã‚  Ã‚   Free other state (managed objects). End If When you dispose of an object, all of its resources must be disposed of. When the CLR garbage collector disposes of an object only the unmanaged resources must be disposed of because the garbage collector automatically takes care of the managed resources. The idea behind this code snippet is that you add code to take care of managed and unmanaged objects in the indicated locations. When you derive a class from a base class that implements IDisposable, you dont have to override any of the base methods unless you use other resources that also need to be disposed. If that happens, the derived class should override the base classs Dispose(disposing) method to dispose of the derived classs resources. But remember to call the base classs Dispose(disposing) method. Protected Overrides Sub Dispose(ByVal disposing As Boolean)   Ã‚  Ã‚  If Not Me.disposed Then   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  If disposing Then   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Add your code to free managed resources.   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  End If   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚   Add your code to free unmanaged resources.   Ã‚  Ã‚  End If   Ã‚  Ã‚  MyBase.Dispose(disposing) End Sub The subject can be slightly overwhelming. The purpose of the explanation here is to demystify whats actually happening because most of the information you can find doesnt tell you!