Search This Blog

Tuesday, October 09, 2007

Cluster Computing and MapReduce

Lecture 1: Introducing Mapreduce and Cluster Computing
Distributed systems overview, review of synchronization and networking.



Lecture 2: The MapReduce programming model.
Overview of the MapReduce programming model.



Lecture 3: Distributed File Systems
Overview of distributed file systems with attention to the Google File System.




Lecture 4: Clustering Algorithms
Types of clustering algorithms, MapReduce implementations of K-Means and Canopy Clustering




Lecture 5: Graph Algorithms
Graph representations, distributed Pagerank, distributed Dijkstra.





Just as people are social animals, computers are social machines—the more, the merrier. Twenty or thirty years ago, large, centralized mainframes sat alone in sheltered bunkers in computer science departments and government offices alike, choking for hours on mere megabytes of data. Even with recent advances in server technology, large, centralized machines are still struggling to cope with today’s modern computational challenges, which now involve terabytes of data and processing requirements well beyond a single CPU (or two, or four, or eight). One computer just won’t hack it; these days, to support a new paradigm of massively parallel systems architecture, we need to break the machine out of its bunker and give it some friends.

In this age of “Internet-scale” computing, the new, evolving problems faced by computer science students and researchers require a new, evolving set of skills. It’s no longer enough to program one machine well; to tackle tomorrow’s challenges, students need to be able to program thousands of machines to manage massive amounts of data in the blink of an eye. This is how I, along with my good friend and mentor Ed Lazowska of the University of Washington’s CSE department, started to think about CS curricula and the obstacles to teaching a practical and authentic approach to massively parallel computing.

It's no easy feat. Teaching these methods effectively requires access to huge clusters and innovative new approaches to curricula. That's why we are pleased to announce the successful implementation of our Academic Cluster Computing Initiative pilot program at a handful of schools, including the University of Washington, Carnegie-Mellon University, Massachusetts Institute of Technology, Stanford University, the University of California at Berkeley and the University of Maryland. This pilot extends our expertise in large scale systems to strong undergraduate programs at the pilot schools, allowing individual students to take advantage of the hundreds of processors being made available. As the pilot progresses, we'll work with our technology partner IBM to shake the bugs out of the system so that we can expand the program to include more educators and academic researchers.

The future of computing is already taking shape on campuses today, and Google and IBM are thrilled to help inspire a new generation of computer scientists to think big. All of the course material developed by UW as well as other tools and resources to facilitate teaching this cutting- edge technology is available at http://code.google.com/edu. If you're a student wondering just what this sort of thing means for you, check out the five-part video lecture series (originally offered to Google Engineering interns) that introduces some of the fundamental concepts of large-scale cluster computing.

Earlier this year, the University of Washington partnered with Google to develop and implement a course to teach large-scale distributed computing based on MapReduce and the Google File System (GFS). The goal of developing the course was to expose students to the methods needed to address the problems associated with hundreds (or thousands) of computers processing huge datasets ranging into terabytes. I was excited to take the first version of the class, and stoked to serve as a TA in the second round.

But you can't program air, so Google provided a cluster computing environment to get us started. And since computers can't program themselves (yet?), UW provided the most essential component: students with sweet ideas for a huge cluster. After learning the ropes with these new tools, students finished the course by producing an impressive array of final projects, including an n-body simulator, a bot to perform Bayesian analysis on Wikipedia edits to search for spam, and an RSS aggregator that clustered news articles by geographic location and displayed them using the Google Maps API. Check out Geozette.

We are looking at ways to encourage other universities to get similar classes going, so we've also published the course material that was used at the University of Washington on Google Code for Educators. You're more than welcome to check out the Google Summer Intern video lectures on MapReduce, GFS, and parallelizing algorithms for large scale data processing. This summer I've been working on exposing these educational resources and other tools so that anyone can work on and think about cool distributed computing problems without the overhead of installing his or her own cluster. In that vein, we've released a virtual machine containing a pre-configured single node instance of Hadoop that has the same interface as a full cluster without any of the overhead. Feel free to give it a whirl.

We're happy to be able to expose students and researchers to the tools Googlers use everyday to tackle enormous computing challenges, and we hope that this work will encourage others to take advantage of the incredible potential of modern, highly parallel computing. Virtually all of this material is Creative Commons licensed, and we encourage educators to remix it, build upon it, and discuss it in the Google Code for Educators Forum.

Lastly, a quick shout out to the other interns who helped out on our team this summer: Aaron Kimball, Christophe Taton, Kuang Chen, and Kat Townsend. I'll miss you guys!

Resources:
http://google-code-updates.blogspot.com/2007/09/uw-and-google-teaching-in-parallel.html
http://code.google.com/edu/
http://code.google.com/edu/content/submissions/mapreduce-minilecture/listing.html
http://googleblog.blogspot.com/2007/10/let-thousand-servers-bloom.html

Friday, September 28, 2007

YouTube Scalability

This talk will discuss some of the scalability challenges that have arisen during YouTube's short but extraordinary history. YouTube has grown incredibly rapidly despite having had only a handful of people responsible for scaling the site. Topics of discussion will include hardware scalability, software scalability, and database scalability.

Speaker: Cuong Do Cuong is currently an engineering manager at YouTube/Google. He was part of the engineering team that scaled the YouTube software and hardware infrastructure from its infancy to its current scale. Prior to YouTube/Google, he held various software development and management positions at PayPal and Inktomi.




Google Tech Talks June 23, 2007

Friday, August 31, 2007

Optimize your Web site performance to survive heavy traffic

1. Avoid accessing databases to often
On a database driven content sites, the slowest task is accessing the database to retrieve the content to display. If a site is not fast enough to serve its pages, many simultaneous user accesses force the Web server to create more processes to handle all the requests.
This is bad because it demands more server memory. Once the server RAM is exhausted, the machine starts using the virtual memory, making the server even slower, until it halts completely.

2. Cache Web pages
If the site needs to access the database to retrieve the content to display, what can we do to minimize the database accesses?
First, we need to focus on what kind of information the site retrieves from databases. The most common type of data is information used to build the HTML pages.
The fact is that the information in database does not change so frequently. As a matter of fact, usually different users see the exact same HTML content when they access the same page.
It is not unusual to execute many SQL queries to retrieve all the data that is necessary to build a single HTML page. So, it is evident that it would be much more efficient if the sites could cache the HTML of each page after it is accessed for the first time.
So, what if the database content changes? Just call a code that invalidates all the page caches that depend on content of the changed database table rows. This way, it forces the caches to be rebuilt on the next access to the site pages, and so the pages are always upto date.

3. Avoid needless personalization
What about pages that appear differently to each user that accesses them? Use separate cache files depending on the user accessing the pages.
However, it would useless if the site would use a separate cache file to store the HTML that each user sees. The benefit of reusing cached information would be lost.
To maximize the efficiency of this approach you should minimize the number of user profiles that may be used for each page context. Therefore, it is very important to avoid personalization as much as you can.

4. Queue tasks that may take too long
Caching is great to avoid repeated accesses to the same content stored in a database.
However, caching only applies to accesses that retrieve data from databases. Operations that update the database content may not benefit from caching. However, when done to frequently, database write accesses may cause server overload.
One of the solution is not to update that table in real time. Instead, create a similar table that act as a queue. The queue table has no indexes. Periodically, start a background task from cron, and move the queue table data to the main table.

5. YSlow 13 optimization rules
There are many aspects to be concerned regarding what to do to make browsers interact with the Web servers in an optimized way that it takes less time and less server resources.
The issues are often not trivial to understand for people looking for quick and easy solutions to optimize their Web sites. Fortunately, there are tools that help you to audit your sites and suggest what needs to be done to boost the performance of the sites to the limit.

YSlow is one of those Web site performance auditing tools. This is a tool that the fine folks of the team of Jeremy Zawodny at Yahoo! released a few weeks ago.
http://developer.yahoo.com/yslow/

This is a wonderful tool that in a few seconds gives you an overview of how a page of your site is being served. It also suggests what can be done to optimize aspects that affect page loading speed and the consumption of Web server resources.
This tool is an extension for the Firefox browser. It works together with another very good extension named Firebug. So, to use YSlow, first you need to install Firebug.
http://www.getfirebug.com/

Once you have installed Firebug and YSlow, it is very easy to audit the performance of any Web page. Just load a Web page that you want to test and wait until it finishes loading. Then open the Firebug pane, click on the YSlow tab, and use the Performance button.

Immediately YSlow starts collecting details about the current page. When it is done it shows a list of 13 rules about aspects of the page loading performance.
On the left side of the listing you see grades from A to F. Those grades express how your page performs on each of the 13 rules, A being the best and F being the worst. On the top of the listing you see your overall "Performance Grade" also from A to F, and a score between 0 and 100.
If you got the score 100, congratulations, your page is perfect. Otherwise there is performance tuning work to be done.

Thirteen Simple Rules for Speeding Up Your Web Site are
  1. Make Fewer HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires Header
  4. Gzip Components
  5. Put Stylesheets at the Top
  6. Put Scripts at the Bottom
  7. Avoid CSS Expressions
  8. Make JavaScript and CSS External
  9. Reduce DNS Lookups
  10. Minify JavaScript
  11. Avoid Redirects
  12. Remove Duplicate Scripts
  13. Configure ETags


6. Too much AJAX and external Javascript may kill your page performance
Using AJAX and cool Javascript libraries is definitely the latest fashion in Web application development. These are common aspects that you may notice in the so-called Web 2.0 sites.
The problem is that when you use a Javascript library that has may interdependent components, sometimes to use a simple component you end up loading a pile of separate Javascript files.

This makes the browser send a lot of requests to the Web server once it enters a page that needs many of those Javascript files. Not only it may cause excessive load to the server, but it also slows down the rendering of a page, even when the page HTML has already been fully loaded. It is a similar effect of pages that use Flash movies that take a while to load.

Browsers cache Javascript files, but when the user is making the first access to a page that needs many Javascript files, it may take too long. It may give the impression that your site is much slower than it actually is.

More detailed information regarding rules to optimize your Web site performance and for defensive programming practices to survive Web site traffic peaks can be found in www.phpclasses.org

Wednesday, August 29, 2007

100 Web Apps for Everything You Will Possibly Need

Running a business for yourself means you have to be inventive and always on the lookout for a new and better way to get things done. Innovation junkies, take note: the Internet has a lot to offer. From invoicing to marketing, these are tools that freelancers need to know about.

Organization

If you’re busy with lots of client work, it’s easy for things to get out of hand. Don’t let your work get away from you; organize information and projects with these tools.

  1. Backpack: Get your projects organized by using Backpack. Create to-do lists, notes, files, images and a calendar with reminders that can be sent via email or to your mobile device.
  2. Central Desktop: Collaborate, communicate and share files with clients and coworkers using Central Desktop.
  3. iOrganize: With iOrganize, freelancers can organize work by keeping notes, ideas and bookmarks in one place.
  4. Viapoint: Viapoint makes it easy for freelancers to store emails and files by client or project.
  5. Stikkit: Use Stikkit’s “little yellow notes that think” to keep in touch, plan and collaborate with clients and coworkers.
  6. Webnote: Webnote users can take notes using a web browser, then save and return to the notes on any computer. This is especially helpful if you’re working on-site with a client and have to use a computer other than your own.
  7. Netvibes: Spend less time searching and more time working by customizing your browser’s start page with email, feeds, messaging, job boards and much, much more.

Calendars & To-Do Lists

Client meetings, important events and a never-ending list of things to do can wear you down if you can’t make them manageable. Use these handy calendars and to-do lists to keep your schedule from taking over your business.

  1. Remember The Milk: Remember The Milk reminds you to take care of important tasks, so you’ll never forget when a project is due.
  2. CalendarHub: Use CalendarHub’s web-based calendar to keep track of deadlines and set goals for your business.
  3. Google Calendar: Google Calendar is a web based tool that allows users to organize their schedule, so you’ll always know exactly what you need to be working on.
  4. Planzo: Planzo’s online calendar keeps freelancers connected to events and things to do. It lets you share your events just about anywhere, get a daily digest and receive text message reminders.
  5. Spongecell: Spongecell is an online calendar made for freelancers with lots of meetings and engagements. Plan events, spread the word and allow guests to add content to your calendar.
  6. Neptune: Neptune’s web based to do list tool helps you keep track of the things you need to take care of every day. It lets you email yourself new tasks, get an email report every morning and upload files to store with your projects.
  7. Ta-da List: When you’re busy with lots of projects, it can be hard to keep track of what you’ve accomplished. Make web-based ta-da lists for yourself or other people, then share them and check items off as you go.

Your Money

Money is what keeps your freelance business going, but managing it can be tedious and time consuming. Sure, it’s fun to see money come in, but does anyone really like sending out invoices? Use these tools to make the process of managing your income easier and more enjoyable.

  1. Wesabe: Use Wesabe to keep tabs on where the money in your business goes, helping you to make better financial decisions.
  2. InstaCalc: InstaCalc is a web based calculator with lots of bells and whistles including spreadsheet capabilities, unit conversions and programming commands. It’s great for freelancers because you can send clients links to any of your calculations, put a calculator on your website or create charts and graphs from your calculations.
  3. XE: If you’re working with an overseas client, you may need to handle foreign currencies. Use XE’s currency converter for accurate calculations with up-to-the-minute currency rates.
  4. Dimewise: Use Dimewise’s web-based convenience to manage your business transactions wherever you are.
  5. FreshBooks: FreshBooks offers a program for “painless billing,” so you’ll never have to spend hours sending client invoices out. Designed with service-based businesses in mind, this software provides a method to manage and send invoices, handle work orders and generate reports with ease.

Storage

Do you have too many client files clogging up your hard drive? Use these services to take a load off.

  1. openonmy: openonmy’s website offers storage for files up to 1GB. These files are made to be accessible from any computer, so you can open them up even when on-site with a client.
  2. Xdrive: Xdrive offers 5GB of online storage. Use their service to share files with your clients and coworkers.
  3. YouSendIt: Have you ever had to clean out your inbox just so you’d have room to send out an email? YouSendIt puts and end to that trouble by sending files up to 2GB to your clients.
  4. Flickr: Save space on your hard drive by uploading your photos to Flickr. It’s a great way to store, share and organize photos for your business.
  5. Box: Create an online file-sharing location for you and your clients on Box.
  6. MediaTemple: Keep your important client files safe on MediaTemple’s servers. They offer innovative hosting solutions for all kinds of websites.
  7. DivShare: Use DivShare’s file hosting service to email files to clients or store them in a folder for shared access later.

Project Management & Productivity

Do you wonder where all of your time goes? Do your clients want frequent status updates? Keep tabs on your time and projects with these tools.

  1. Harvest: Harvest offers web-based time tracking software with simplicity. Track your progress and inform your clients using Harvest’s reports.
  2. Side Job Track: Side Job Track, designed with freelancers in mind, provides software that lets you track and manage project information. Features include job tracking, invoicing and reporting.
  3. Basecamp: Basecamp offers a way to improve project communication. Use it to keep your teammates and clients informed about what’s going on with your projects.
  4. ConceptShare: ConceptShare provides online design collaboration. Invite clients and coworkers to view your design and make comments on your work.
  5. ProjectStat.us: Instead of fielding constant calls about the status of a project, let your customers view the status of their project online with ProjectStat.us.

Writing & Design Tools

Being creative can get expensive. Purchasing icons, stock photos, book publishing and the like can add up fast and eat into your profit margin. Check out these free and inexpensive tools designed to make the lives of freelance writers and designers cheaper and easier.

  1. Writeboard: Have you ever had a client or coworker revise a document and end up wiping out your work? Use Writeboard to share and collaborate while saving separate versions each step of the way.
  2. Lulu: Lulu gives fledgling writers an easy way to get published. Each product is printed as it’s ordered, so you don’t have to build an expensive inventory.
  3. MailBuild: Built for web designers, MailBuild allows users to set up a template for client email campaigns.
  4. MyFonts: Do you want to see how fonts will look on your design before committing to a purchase? MyFonts provides a source for trying out and buying new fonts.
  5. IconBuffet: Find and trade stock icons for your web designs on IconBuffet.
  6. stock.xchng: Add photos to your writing or web design at low or no cost. stock.xchng provides tons of stock photos, many of them royalty-free.
  7. Google Docs & Spreadsheets: Don’t bother spending hard-earned money for the latest version of MS Word. Create, upload, share and edit word and spreadsheet documents online using Google Docs & Spreadsheets.
  8. MorgueFile: MorgueFile’s high resolution photos are has-beens in the stock photography world, but that doesn’t mean they won’t do a great job spicing up your work.

Security & Privacy

Don’t let your work get stolen or compromised. Can you imagine how your business would suffer if you lost files due to a virus? Or worse, if the financial information of your clients got exposed to spyware? These services help you stay safe and secure.

  1. SpamSieve: Fighting spam takes time away from your business and opens your system up to intruders. Use SpamSieve to keep spam out of your Mac email client.
  2. Escrow: Don’t get burned by clients that make fraudulent payments. Use Escrow to protect yourself and your clients from payment fraud.
  3. Cloudmark Desktop: Cloudmark protects your Outlook inbox from spam, phishing and viruses, so you’ll never have to worry about compromising business files when reading your email.
  4. PayPal: Give your clients a way to pay without sharing their financial information by using PayPal.
  5. Moneybookers: Open your business to the worldwide market safely. Use Moneybookers for secure worldwide payment and acceptance.
  6. Spamato: Keep your business email secure by using Spamato with Outlook, Thunderbird or Mozilla Mail.
  7. Spybot Search & Destroy: Make sure your confidential client information is safe from prying eyes by scanning for spyware with Spybot Search & Destroy.
  8. AVG Anti-Virus Free Edition: Protect your business files with a good antivirus program. AVG Anti-Virus offers a free solution for protecting your computer from viruses.

Mobility & Contact

When running a business, it’s essential that you’re able to keep in contact with clients, vendors, coworkers and other important acquaintances. Use these tools to communicate with ease.

  1. Campfire: Campfire is a web-based chat tool that’s ideal for online meetings with clients or coworkers.
  2. Meebo: Don’t miss out on a client just because you don’t use the same instant messaging tool. Get access to every major messaging service on Meebo’s website without having to download anything.
  3. FaxZERO: Online communication is popular, but sometimes you just have to send a fax. But who wants to invest in a fax machine and phone line for something that happens only on a rare occasion? Instead, use FaxZERO to send a fax anywhere in the US or Canada for free.
  4. eBuddy: Don’t miss out on important messages while you’re away from your base of operations. Log on to eBuddy to sign on to online messengers using your mobile device.
  5. K7: FaxZERO lets you send out a fax for free online, but what if a client wants to fax something to you? Enlist the help of K7, a service that assigns users a phone number that accepts fax and voicemail messages, which are then sent to your email.
  6. GoToMeeting: Use GoToMeeting to keep in touch with clients and coworkers via online meetings.
  7. LogMeIn: Don’t let your business suffer because you can’t take your computer on the road. Use LogMeIn to get access to your computer’s desktop anywhere.

Marketing & Networking

You provide a great service and offer awesome rates, so why isn’t the world knocking down your door with business? Perhaps it’s because they have no idea you exist. Get your name out there and find new clients with these tools.

  1. LinkedIn: LinkedIn offers online networking at its best. Find opportunities and contacts based on your work and the people you already know.
  2. askCHARITY: Take advantage of askCHARITY’s database of key media contacts to get the word out about your business.
  3. Craigslist: Craigslist is an invaluable tool for any freelancer. Find clients, sell your work, buy supplies, network and more using Craigslist.
  4. Coroflot: Use Coroflot to post an online portfolio and find design jobs.
  5. ProfessionalOnTheWeb: ProfessionalOnTheWeb hosts a directory of portfolios. Make sure yours is there when clients search for help.
  6. Elance: Use Elance to get connected with clients that need your services on a project.
  7. 37signals Gig Board: Use the 37signals Gig Board to find freelance jobs in programming, design and more.
  8. WebProJobs: Find full-time and freelance web professional jobs on WebProJobs.
  9. Job Pile: Job Pile aggregates popular freelance job boards, so you can spend time working instead of searching.
  10. YouTube: Use YouTube’s viral video to get the word out about your creativity.
  11. CafePress: CafePress offers on-demand printing for promotional items as well as a place to sell your design.
  12. Spot Runner: Use Spot Runner to build a TV advertising campaign.

Business & Legal

Paperwork isn’t always fun, but it is necessary. Forms and agreements can provide legal protection and help you avoid disputes down the road. Check out these tools that help you protect yourself and spend less time on the boring stuff.

  1. MyNewCompany: Get legal and tax protection for your freelance business by making things official. Use MyNewCompany to incorporate or form an LLC online.
  2. Help Me Work: Get the stability of corporate life while still working as an independent consultant. Help Me Work takes care of taxes, client billing, paychecks, benefits, retirement plans and more.
  3. Designers Toolbox: Get set up with all the legal forms your design business may need with Designers Toolbox.
  4. Creative Commons: Use Creative Commons to specify how much or how little legal restrictions you want your work to carry.
  5. AIGA: Protect your business with AIGA’s standard form of agreement for design services.
  6. Nolo: If you’ve got a legal question about your business, head to Nolo. Experts there offer legal advice for independent contractors and consultants.
  7. Creative Public: Head to Creative Public for forms, contracts, pricing guides and more for your design business.

Client Contact & Feedback

Your clients are what keep you in business, so it’s important to check in with them and make sure they’re satisfied. Use these programs to keep in touch with your clients and find out what they have to say about your work.

  1. Breeze: Send out email campaigns to your clients with Breeze’s easy tool.
  2. Wufoo: Use Woofoo to make forms, surveys and invitations for your customers with ease.
  3. Relenta CRM: Keep track of customer relationships using email, contact, document and activity management with Relenta.
  4. Highrise: Don’t lose track of your customers: keep in touch with Highrise’s online contact management system.
  5. ScratchnScribble: Use ScratchnScribble’s service to have handwritten or printed greeting cards sent to your clients.

Website Tools

Clients are looking for your business online. Will you be there? Check out these applications to make sure your business has an excellent online presence.

  1. Big Cartel: Set up an online store to sell your products using Big Cartel’s service.
  2. WordPress: Blog about your business and industry with WordPress.
  3. Inblogit: If you’re a design professional, your blog should be attractive. Use Inblogit for blog functionality with more flexbility in design.
  4. Icebrrg: Create web forms with Icebrrg so that your website can generate customer inquiry and feedback.
  5. XHTMLized: If you’re too busy to build a website yourself, use XHTMLized. They take your design and turn it into a web page that is browser and search engine friendly.
  6. XHTMLiT: XHTMLit offers freelancers another time-saving solution for converting design into HTML.
  7. Userplane: Make your website interactive for your clients by bundling chat, messaging, video, search and live presence with Userplane.
  8. Ning: Let your clients network with each other by creating your own Ning social network.
  9. ExpressionEngine: Impress your customers by having a website with lots of features. Use ExpressionEngine to publish just about anything on your website.
  10. FlashDen: Build a great-looking website that your clients will want to visit. Buy Flash, audio, video and fonts to make your website look good at FlashDen.

Printing & Packaging

When your products look good, your business does too. Presentation makes a difference, so be sure to make a good impression by using these innovative printing and packaging tools.

  1. Jewelboxing: Impress your customers with Jewelboxing’s customized, professional-grade DVD and CD packages.
  2. Qoop: Qoop prints everything freelancers might need: business cards, apparel, promotional items, posters and more.
  3. Moo: Moo prints note cards and mini cards from your photos and design. These can be used for promotional materials or business cards.

Tools to Give & Take

These tools pack a double-whammy of functionality. Use them to get the resources you need or as an alternative revenue stream.

  1. Google AdWords: Use Google AdWords to advertise your business or make money by putting AdWords on your website.
  2. Prosper: Using Prosper’s people-to-people lending website, you can borrow money for business expenses from real people. If you have extra cash, use Prosper to earn interest by lending to others.
  3. Text Link Ads: Generate interest in your website and attract clients with Text Link Ads or earn money by selling space for others on your site.
  4. PayPerPost: Use PayPerPost to have a blogger write about your product or service. Alternately, you can earn money by writing about someone else’s business.
  5. Guruza: Find answers to your business questions or earn money by giving expert advice on Guruza.

Miscellaneous

From office suites to creative stimulation, these tools have a lot to offer for freelancers. Check out these applications that cover anything and everything else you might need for your business.

  1. Zoho: Zoho’s Office Suite includes a variety of software solutions for freelancers: a word processor, spreadsheet, presentation tool, wiki writer, notebook, project management, CRM solution, database creator, calendar, web conferencing, email and chat.
  2. Veetro: Veetro offers another all-in-one solution that specializes in the tools freelancers need the most. This program combines money, document, task and customer management with email marketing, reporting and blog publishing.
  3. Work: Are you clueless about what it takes to run a business in your industry? Work offers guides that show you how.
  4. Pandora: Get your creative juices flowing with Pandora’s fully customizable internet radio.

Visit our StumbleUpon Blog for more technology and productivity tips

You could read the original article by clicking here

Wednesday, August 22, 2007

Work Place Stress

Stress is one of those things that no one likes to admit to feeling, and definitely it's rare for anyone to admin to having trouble dealing with stress. Part of this is pride and stubbornness of course, but I think just as often it's because the person doesn't believe they are under stress. Not denial, but lack of recognition. Stress can come from many things, big and small. Traffic jams, long hours at work, sick kids, newspaper not being delivered, death of a loved one.

I think part of that lack of recognition is that many stress causing items get lumped into one of these categories; annoying, irritating, worrisome, nagging. Whether or not something goes from irritating to stressful depends on your state of mind (stress level if you will) and your natural defenses against that particular kind of stress. For example, all of the items below are types of things that will happen to most employees at some point in their career. Probably there are some that would stress you right now, rumors of layoffs for example. Maybe others used to be stressful - deadlines perhaps - but you've gotten used to them and now they no longer have a negative impact on you. Perhaps still others are never stressful. Sometimes it's the combination - you're working long hours to meet a tough but fair deadline, you're going to a lot of meetings that seem to have no purpose, a co-worker is complaining in your ear constantly, and you just got dinged in a code review for not coding defensively enough. Can you see how all those little things might add up to real stress?

Office stress points:

  • Deadlines (not just unreasonable ones)
  • Rumors of layoffs or offshoring
  • Meetings that seem to have no purpose
  • Co-worker constantly complaining (or on the phone with spouse, or ...)
  • Annual review
  • Co-worker not pulling their weight
  • New employee that seems to have skills/experience far exceeding your own, or that seems to have very poor skills
  • New manager
  • Code reviews
  • Dressing up for/entertaining clients
  • Working long hours/weekends
  • Lack of cooperation from other departments
  • Poor leadership at any level
  • Company in financial trouble

 

It's important to say that you cannot avoid all stress, and that some stress is probably even helpful at times (deadlines for example have a way of focusing you and getting you to exclude all the 'extras' from your schedule until the goal is met). What you can do is challenge yourself to think about your reaction to stress and to be mindful that things are causing you stress. Before we explore that more, let's talk about what I consider the primary types of reactions to stressful situations:

  • Individual does not feel stress from the situation, due to experience and/or outlook on life. Note that this is NOT ignoring it, it truly is not perceived as stressful
  • Individual denies the stress and it's impact on their mental state.
  • Individual acknowledges the stress and tries to manage it

How can you get to the point where something is not stressful? Let's take rumors of layoffs for example. Suppose you've only been at the company for a year, your wife is pregnant, and you basically live paycheck to paycheck, putting you in the high risk of being let go category and being at risk financially if you're out of work very long. What steps could you take to reduce your stress level? Potentially you could:

  • Realize that not all rumors work out to be true, sit down with your manager to try to find out more about the situation
  • Understand that companies usually lay off the bottom tier of employees first, the marginal performers. Make sure you're not in that category. Note that maintaining a good attitude can also keep you out of the first group to go.
  • Update your resume, check with friends about possible opportunities with other companies, even reach out to your favorite recruiter. You want to be prepared to job hunt if you have to, and you want to know the state of the job market.
  • Cut back on your spending to try to build a little more financial cushion (note that this also helps in case they do salary cuts instead of layoffs)
  • Arrange a line of credit on your house in case you need money if you wind up out of work
  • If you are laid off, be ready to try to negotiate a severance package that will help you - in this case maybe getting them to cover your insurance for a longer period of time
  • I'm not advocating jumping ship, but that is one way to remove the stress altogether. The problem is that many times the rumors are just rumors, and you start all over again at another company when you didn't have to. You also risk having your current employer finding out that you're looking in response to rumors, which may well guarantee you're on the gotta go list

If you were to do all those things, maybe your stress level drops from an 8 to a 5. Odds are you aren't going to feel stress free, but you should feel better and you've taken logical steps in case the rumor is true. How can anyone hear about layoffs and not feel stressed? Imagine that you've been with the company ten years, you've got a strong financial reserve, you're a star employee that is highly trusted and respected, you've got superb technical skills, and you've survived layoffs at this company twice before. The worst is that you have to look for a new job and that doesn't cause any fear because you have money (which equals time to find a good job) and you have marketable skills.

There are two patterns I try to use. The first is 'immediate stress'. When I feel something causing me stress, I try to take the following steps - writing down the answers:

  • In a couple sentences, what is bothering me?
  • Is my reaction to this emotional or logical?
  • Is my reaction proportional or I do feel like I'm overreacting?
  • What is my current overall stress level (none, low, medium, high, where none is the perfect vacation)?
  • Is my reaction made worse due to other factors (other stress, being tired, etc)?
  • Are there logical steps I can take to remove the stress?
  • Are there logical steps I can take to mitigate the stress?
  • Will taking a day off or a vacation help the situation?

Now imagine showing this list to someone you really trust, would they call you on any of your answers? If a co-worker had written the answers, what other advice would you offer? I'm not advocating showing anyone the list, but it's a useful exercise to help you look at your situation objectively. From there, take the logical steps you've thought of and do something after work that you enjoy, something that will take your mind off of it.

The second pattern is 'cumulative stress'. This builds up when you have multiple things going on at the same time that cause you stress, usually in addition to being tired (or sick). I'll bet you've all seen someone at the office that shows some or all of these symptoms:

  • Complaining a lot, not a lot of fun to be around
  • More time than usual spent not working (web browsing, hall chats, coming in late or leaving early) or working ineffectively (output drops)
  • Making dumb mistakes
  • Slower than usual to respond to email about work
  • Messier than usual work environment
  • Combative with co-workers and/or significant other

Cumulative stress requires a break at a minimum, at least a week and two is better. Sometimes a break is all you need, sometimes you also need to change your response to the things that cause you stress or you'll be back in the same place all too soon. If you see yourself exhibiting these symptoms, find a way to take a break and at the end of the break, evaluate whether you need to spend time on the immediate stress items before you go back.

There are a couple other things you can do to help you monitor your stress level. One is to maintain a short log where you score each work day on a scale of 1 to 5, and include in the log why that day was stressful. I suspect over time you'll see and confirm some interesting patterns. The other is to calculate an ad hoc stress index for yourself (knowing that we geeks love numbers) by keeping a running 15 or 30 day average of your stress level based on your log. If you see the average staying in the 4-5 range you'll know it's time to make changes, whether it be reassessing how you react to some stressful items, taking a break, or both.

Stress is real. Managing stress is not a zen exercise, it's a life skill that most of us aren't as good at as we need to be. I hope that reading this will encourage you to think about your response to stress, and maybe to seek out a good book or lecture from someone more qualified than me to help you improve your stress management skills.

This article was originally found in
http://www.sqlservercentral.com/columnists/awarren/2557.asp

Wednesday, July 25, 2007

Keep a check on your IDENTITY columns in SQL Server

 The IDENTITY columns, or 'auto number' columns as some people call them, are auto incrementing columns provided by SQL Server. There can only be one IDENTITY column per table. You just have to provide a base value, and an increment value, and SQL Server will take care of incrementing this column automatically. Some people like these, and some don't, but the truth is, IDENTITY columns are gaining popularity, and many production systems, including critical ones are using IDENTITY columns these days. So, it is important to keep an eye on these columns, to make sure they are not reaching the limit of their base data type. For example, if you created an IDENTITY column of smallint datatype, its values can go upto 32767. If you try to insert anymore rows, you will get the following error:

Server: Msg 8115, Level 16, State 1, Line 1
Arithmetic overflow error converting IDENTITY to data type smallint.
Arithmetic overflow occurred.

If this table happens to be a part of a critical production system, then you are in trouble. You will have to do something about it to resolve it. If the data from this table can be deleted, then delete the data using TRUNCATE TABLE command. TRUNCATE TABLE resets the IDENTITY column to its base value. The DELETE command doesn't do this. But then, if this table is referenced by a foreign key, then TRUNCATE TABLE is not allowed on this table. Your other option is to run DBCC CHECKIDENT on your table with RESEED option.

An IDENTITY column of tinyint datatype can go upto 255, smallint can go upto 32767, int can go upto 2147483647 and bigint can go upto 9223372036854775807.

You can proactively monitor these IDENTITY columns, to avoid getting into such problems. If you can see in advance, that an IDENTITY column is reaching its limit, then you could do something about it, before it reaches the limit. The other day, one of my friends was trying to automate a process that checks all the IDENTITY columns in a database and reports on how far away those columns are from the limit. He was using a cursor to go through all the tables in the database, and running a "SELECT MAX(IdentityCol) FROM TableName" on all the tables that have an IDENTITY column. It would take ages to run on a database with many big tables. It can be simplified into one simple query using IDENT_CURRENT function. That's what I did, and thought it will be useful for other DBAs as well. So, here I am writing about it.

There are three different versions of this procedure. First one is for SQL Server 2005. The second and third versions work in SQL Server 2000. You will have to create this procedure in the database of your interest. And run it as shown below:

EXEC dbo.CheckIdentities
GO

This procedure below, displays information about all IDENTITY columns in the database, and shows you the percentage of IDENTITY values already used. If you are seeing any IDENTITY columns that have used up 80% or more values, then you need to start thinking about it. You could customise this procedure to automatically email you or log an error if there are any IDENTITY columns that are nearing the limit. You could also schedule this procedure as an SQL Agent job, so that it checks these columns regularly. Any new IDENTITY columns added to the database will automatically get picked up by this query.

A quick note about 64 bit SQL Server. Even though SQL Server 64 bit editions can access a lot more memory inherently, than the 32 bit systems could - the IDENTITY columns are still limited to the limits imposed by the base datatypes. I'm writing this because, someone recently asked me if int data type can store a higher number in 64 bit server, compared to a 32 bit server.

/* The SQL Server 2005 version of the stored procedure. It uses new catalog views */


CREATE PROC dbo.CheckIdentities
AS
BEGIN
SET NOCOUNT ON

SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + '.' + QUOTENAME(t.name) AS TableName,
c.name AS ColumnName,
CASE c.system_type_id
WHEN 127 THEN 'bigint'
WHEN 56 THEN 'int'
WHEN 52 THEN 'smallint'
WHEN 48 THEN 'tinyint'
END AS 'DataType',
IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) AS CurrentIdentityValue,
CASE c.system_type_id
WHEN 127 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 9223372036854775807
WHEN 56 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 2147483647
WHEN 52 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 32767
WHEN 48 THEN (IDENT_CURRENT(SCHEMA_NAME(t.schema_id) + '.' + t.name) * 100.) / 255
END AS 'PercentageUsed'
FROM sys.columns AS c
INNER JOIN
sys.tables AS t
ON t.[object_id] = c.[object_id]
WHERE c.is_identity = 1
ORDER BY PercentageUsed DESC
END



If you try to create the above stored procedure in SQL Server 2000, you will get the following error:

Server: Msg 195, Level 15, State 10, Procedure a, Line 4 'SCHEMA_NAME' is not a recognized function name. So, here are some SQL Server 2000 compatible versions. /* The SQL Server 2000 version of the stored procedure. Uses system tables. This should work in SQL Server 7.0 too */




CREATE PROC dbo.CheckIdentities
AS
BEGIN
SET NOCOUNT ON

SELECT QUOTENAME(USER_NAME(t.uid))+ '.' + QUOTENAME(t.name) AS TableName,
c.name AS ColumnName,
CASE c.xtype
WHEN 127 THEN 'bigint'
WHEN 56 THEN 'int'
WHEN 52 THEN 'smallint'
WHEN 48 THEN 'tinyint'
END AS 'DataType',
IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) AS CurrentIdentityValue,
CASE c.xtype
WHEN 127 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 9223372036854775807
WHEN 56 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 2147483647
WHEN 52 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 32767
WHEN 48 THEN (IDENT_CURRENT(USER_NAME(t.uid) + '.' + t.name) * 100.) / 255
END AS 'PercentageUsed'
FROM syscolumns AS c
INNER JOIN
sysobjects AS t
ON t.id = c.id
WHERE COLUMNPROPERTY(t.id, c.name, 'isIdentity') = 1
AND OBJECTPROPERTY(t.id, 'isTable') = 1
ORDER BY PercentageUsed DESC
END


/* The SQL Server 2000 version of the stored procedure. Uses INFORMATION_SCHEMA views. */


CREATE PROC dbo.CheckIdentities
AS
BEGIN
SET NOCOUNT ON

SELECT QUOTENAME(t.TABLE_SCHEMA) + '.' + QUOTENAME(t.TABLE_NAME) AS TableName,
c.COLUMN_NAME AS ColumnName,
c.DATA_TYPE AS 'DataType',
IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) AS CurrentIdentityValue,
CASE c.DATA_TYPE
WHEN 'bigint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 9223372036854775807
WHEN 'int' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 2147483647
WHEN 'smallint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 32767
WHEN 'tinyint' THEN (IDENT_CURRENT(t.TABLE_SCHEMA + '.' + t.TABLE_NAME) * 100.) / 255
END AS 'PercentageUsed'
FROM INFORMATION_SCHEMA.COLUMNS AS c
INNER JOIN
INFORMATION_SCHEMA.TABLES AS t
ON c.TABLE_SCHEMA = t.TABLE_SCHEMA AND c.TABLE_NAME = t.TABLE_NAME
WHERE COLUMNPROPERTY(OBJECT_ID(t.TABLE_SCHEMA + '.' + t.TABLE_NAME), c.COLUMN_NAME, 'isIdentity') = 1
AND c.DATA_TYPE IN ('bigint', 'int', 'smallint', 'tinyint')
AND t.TABLE_TYPE = 'BASE TABLE'
ORDER BY PercentageUsed DESC
END





You could read the original article from the following link: http://vyaskn.tripod.com/sql_server_check_identity_columns.htm

Friday, June 15, 2007

Solution for "UNICODE ASP files are not supported" error in .Net

Error – ASP.Net
Active Server Pages error 'ASP 0239'
Cannot process file
/GR/submit_page.asp, line 1
UNICODE ASP files are not supported


Solution
With your project open, click on File, Advanced Save Options. Select US-ASCII.
Then click to apply to ALL DOCUMENTS. 
It will give you a warning that some characters may not play, but you can ignore that.
From that point forward, all saves should be in ASCII and your pages will play.

Provided by Ravichander Kannan, GTS, CSC India


Please visit my other blogs too: http://edwardanil.blogspot.com for information and http://netsell.blogspot.com for internet marketing. Thanks !!

Monday, February 12, 2007

SQL Stored Procedure to Log Updates, Independent of Database

Have you ever needed a quick, retroactive solution to track changes on your database?
Well, if youre a good system designer you wouldn't, but when contracting for clients you may find often that the characterization of the project is ever changing, and there is only so much you are able to foresee.

When working with multiple clients, with only a certain amount of hours dedicated to each project, you may want your patches to be applicable for multiple projects. The following is such a patch. It functions to track updates done through the website, storing information such as the user information, the page on which the action took place, the old value and the new value of the changed information and a date time stamp.

Please check out this article to get the code on how to develop the SQL Stored Procedure for creating a log on all updates.

Please visit my other blogs too: http://edwardanil.blogspot.com for information and http://netsell.blogspot.com for internet marketing. Thanks !!