Saturday, July 02, 2011

Social Media - Week 7 Reading

The Digital Handshake, pages 137-148 (Lights! Camera!) Read: The Digital Handshake, pages 137-148 (Lights! Camera!)

Chapter 11:
Online video and online television is the technology to watch, especially with expansion of broadband.  


11.1  The small camera revolution
In past you needed big money to make a video for business.  No for under $200 you can get an HD camcorder and use free software to make videos (though not as professional).  


11.1.1 Bizzuka's Recession Marketing Story
Case study.  
11.1.2 Mojitos as a Social Object
Another case study 

11.1.3 Blendtec's "Will it Blend" Success Story 
Another case study 
11.1.4 Wine Library TV
Another case study 

11.2 Benefits to using online video
  • Online video improves search results - You Tube though not a search engine, is the 2nd largest search engine on the Internet (passed Yahoo in 2008).
  • Online video appeals to the way people learn (audio and visual)
  • Online video presents a 360 degree view of your company 
11.3 Goals for business use of online  video 
11.3.1 Use video to drive additional traffic
Search engines now pick up videos on their first page. 
11.3.2 Use videos to create a more engaging experience
Video involves more senses than the written word
11.3.3 Use video to increase rate of conversions
Implicit conversion - soft sell, contents and what surrounds it on page
Explicit conversion - video watermarks, logos on opening and closing screen
In either case, keep video short, after 90 seconds people will drop off. Online video is not migrated TV. 


11.4 Six ways business can use online video
11.4.1 Video Blogging/Podcasting
Video Blogs are a form of blogging the uses video as the medium.  They use RSS to syndicate the content so people (and web sites) can subscribe to it.  
11.4.2 Product demonstrations
Using video this way can make material more believable, viewers see it in action. 
11.4.3 How to videos
Product training by video allows for customers to train at their own pace and even back up as needed.  
11.4.4 Streaming video 
Best use for streaming video is livecast events and conferences. 
11.4.5 Online video ads
Online video ads are becoming a strong foothold and several companies can make them for you for under $1000
11.4.6 Viral videos
Blendtec is best example with its 'will it blend' videos.  It is hard to create viral videos but it is worth a try. 


11.5 Equipment needed to create video content
To start with, a video camera.  You can get them for around $200 that has all that you need.  Connect it to the computer and copy the videos taken so that they can be edited.  It is also possible to use cell phones to record video as well.  Of course if you have the money buy the good equipment. 
Editing software like Camtasia Studio ($299) allows for easy editing.  Jing is good for screen casts of computers. 


11.6 Youtube and other video sites
Where do you put it after you have made it.  Youtube is the best known, but a draw back is that it is entertainment oriented. Another is Viddler. Some people use Vimeo but it is not supposed to be used for commercial purposes.  


11.7 Conclusion


Read: Social Media Marketing, pages 77-88 (Media Sharing)

5.1 Introduction
Media-sharing sites allow for users to create and upload multimedia content (user generated content - UGC). Created content for use in your blog and then upload it to a video sharing site for others to see as well.

5.2 History 
IFILM.net was an online collect of short videos put up by users started in 1997 during dial up days, and the error of many different video players. In 2002, Flash MX was created and took away need for multiple players.
1999 was when photo-sharing sites started.  This allowed for uploading pictures to share with others. With the rise of MySpace in 2003, sires like Photbucket allowed images to be stored so they could be displayed elsewhere.  In 2004 Flickr started allowing for tagging of images and the revolution was on.

5.3 Protocol
5.3.1 Tags
Tags are a word(s) assigned to content to help describe what it is. Usually multiple tags are allowed. Tags are used by search engines because the content cannot be easily searched.
Tags are either space separated (words separated by a space (or if multiple words needed as one tag, in " "), or comma separated (word or words separated by commas).
Error on the side of too many tags. Include the major content as well as things in the background.
5.3.2 Digital asset optimization
This is the act of taking digital content you have and getting it online so it can help draw traffic to you. This is not an alternative to making new content, just getting information about your company you already have out there. 
5.3.3 Organic content
Organic content is when others make content about your company.  It can be content they have made from scratch or content they have made by taking your content and remixing it with other content.

5.4 YouTube
It is currently the largest video-sharing site on the web and 3rd most visited site on the web.
5.4.1 Your profile
User accounts are called channels and when you create an account be aware that you cannot change them afterwards.  This is important because it becomes attached to youtube URL so it should identify you. Pick something you will be happy with in five years. The title is customisable as well as the description field. Include contact information and tags that help describe your business and content. Customise colors as well but make sure they are legible.
5.4.2 Your videos
Make videos short, media demands full attention. People are sensative to product pitches so be as non-commercial as you can (unless it is entertaining).  You are given the option of letting people embed your video.  This should be done so people will spread the word for you.  If you can get your video in the Youtube honors section this is good, do everything you can to get people to watch your video.  Choose the thumbnail for your video carefully, it is what user sees first.

5.5 Flickr
Flickr is the king of photo sharing sites. It is a good place to upload charts and graphs as well as photos of your work. Read the community guidelines as they have teeth when it comes to corporate content. Tell your companies story not direct advertise. It is not a good place to put head shots of your people. You might have a few company people put up personal accounts and add images of the company and tag them with company name.  This is more personal.
5.5.1 Your profile
Unlike Youtube you can change your name but you cannot change the URL so think about what you want for it. Also decide about free or paid account. 
5.5.2 Your Photos
When you upload you have a chance to put information about it.  Description field allows for HTML so it can be a link to your site.  If phots are similar in nature put them in a set.
5.5.3 Creative Commons
Decide on what licence you want your photos to be:
  • Attribution - credit the original author if used
  • NoDerivs - cannot be used to remix with other things
  • NonCommercial - may not be used for commercial purposes
  • ShareAlike - Other uses of the content must have comparable sharing
Make sure to use one of these to control your content.
5.5.4 Other Features
Join groups related to your company, but do not spam them. If your users make media for you and upload ot to Flickr ask them to use a special tag to help you find it. Make slide shows out of your content.

5.6 SlideShare
Slideshare allows you to upload and share presentations that become Flash like widgets that can be used in web sites.
5.6.1 Your profile
You get to choose between a company site (includes information about your company), professional speaker (allows you to add links to your talks) and the default for people who do not fit either.
5.6.2 Your presentations
Keep slide shows short because of attention span. They are small in size so make sure content is legible.
5.6.3 Other Features
Featured presentations are one that get a lot of viewing. Do what you can to promote your presentations. You tube videos can be embedded now as well. 
5.7 Takeaway tips.


Social Media - Week 6 Reading

This is a place holder for the readings till I can come back to it. 

Thursday, June 23, 2011

Social Media–Week 5 readings

The Digital Handshake, pages 97-114  (Niche Online Communities)

Online communities are not like social networks, they are niche-specific.  A major difference is the way that profiles are displayed.  In a niche community, profiles are peripheral to what goes on, in social networks, they are the important thing. 

Why do online communities?

  • improve customer relations
  • search engines can index them
  • useful for feedback
  • users can give positive feed back through it
  • gives stakeholders a sense of ownership

Sites can break down into 3 categories:

  1. Customer support - customers come to it to get support for a manufacturer's product
  2. Customer engagement - customers come here for education and interaction with manufacturer.
    When created there are things to think about:
    Research and understand the targets interest
    Form a coalition with related/non-competing products
    Create non-branded content and tools 
    Use experts to give credibility to site
    Use social engineering tools to encourage sharing 
    Passively put coalition product information up, also banner ads for more direct.
    Syndicate out the content for use on other sites
  3. Employee communities and/or Vendor/partner communities - encourage people who have a stake in the company to share insights among themselves.

Common community mistakes:

  1. Lack of adequate planning and research - follow the '5 Ws and H'. While it takes minutes to make a site it takes a while to plan.  
  2. Putting an undue focus on technology - the people make up the community, not the technology
  3. Not putting resources where they are best utilized - put someone in charge who knows how to run a community, not just some part time staff. 
  4. Making the company fit the company not the other way around - the user defines the community not the company
  5. Measuring the wrong things - you can not use traditional metrics to measure ROI

Online communities need a personal (pastoral) touch

There needs to be some glue to hold the membership together - a vision maybe.  Remind people every month or so what that vision is. A 'shepherd' is needed to guide the community, this requires a person who can apply a lot of TLC.  There must be a regular flow of content so that people will come to the sire.  Active participation by users should be encourages.  They will need to be paid with time, attention and rewards.
Society of Word of Mouth
Case study -
  • Ensure that there is already a community that is undeserved and itching to meet
  • Have an annual meeting
  • Keeping the online community juices flowing requires large amounts of content
  • Think education -- webinars draw people
  • Kick out the polluters quickly  - you do not need a place for criminal actions to take place (spammers, etc.)
Twittermoms
Case study
  • Starting a social network you set the tone
  • Find people who have common interest and connect with them
  • Have guidelines in place for spammers
  • Make sure you offer high quality content
Tools for creating your own community
Ning:
This a website for people to create communities for any subject they choose. Tools are available (blogs, podcasts, calendars, etc. ) to customize the community to your liking. It is free with Google ads running through it. 

KickApps:

Like Ning it is hosted but you can put widgets from it into your own pages. 

CollectiveX Groupsites:

Hosted site that lends itself to professional network groups.

Open Source Options:

Drupal and Joomla are two platforms for building community.  These do take some time and effort.

WordFrame:

For larger firms it is more suited for B2B and is Blog-centric.

Mzinga:

Also for larger businesses, it is focused on learning, marketing and customer support.

Awareness Network:

Large industry branded communities are the focus here. 

Jive:

For enterprise business, focus is collaboration.

Lithium:

Larger company hosted support site.




Monday, June 13, 2011

Social Media - Week 3 Reading


Digital Handshake pages 77-96 (Social Networks)
Chapter 8 Social Networks Strengthen Your Social Graph
While social networks have existed since man existed, but the Internet has allowed us to make our networks larger faster.  People now take participating in these networks as a matter of fact. 

  • You never know where leads may come from, keeping a presence on many social network sites makes sense.
  • The more profiles you have the more it seems like you are everywhere and have a feel for what is going on.
  • Search engines now give results from social network sites so they can help people find you when they search for your company.
  • Your profile (business or personal) should be created with the intent of your audience finding you and on places that they would find you on. (Make sure you complete your profile before contacting others on the network however).
Best Practices
  • Your profile and your photo are you
  • Just as you work the room in real life networking, do so in on line networks.  Post comments and write posts, but do not pitch
  • Friending some one is the equivalent of asking for a business card.
  • Figure out who you can connect with (not everyone) and figure out how you can be helpful to them.
The more individual connections that you have to a person the stronger the relationship will be.  The big three for these will be:
  1. LinkedIn
  2. Facebook
  3. Twitter
As you connect with a person on one of these, the others will come along.  You should connect as you see the need to.

LinkedIn is Your Business Suit

LinkedIn is designed to be a place where you can find, be introduced to, and collaborate with qualified professionals to help you accomplish your goals.  The first thing you should do is create a detailed profile that summarises your professional expertise and accomplishments and then begin to build relationships.
Try not to pimp yourself or your company. Be yourself and be sincere, you will attract people who are similar to you. See how you can help others, and they will want to reciprocate to you.

Facebook is Business Casual

Face book is a social utility to connect you to other people.  It combines both business and personal sides.  By using a 'public profile' a business can set up an identity similar to a personal profile. Fans can express themselves on your wall.  The public profile is open to search engines indexing as well.  Events can be used to promote something your business is doing.  Groups can tie you in to other people that share a common bond. 

Facebook dose have ads, but the  click through rate for them is very low.   Applications (Apps) can be created that can give your business some name recognition.  

Facebook Lexicon looks through all the wall posts and returns aggregate data of what is trending. The share button can be put on your site so that people can share a page of yours and drive traffic to you. Facebook Connect allows people to log into a web site using Facebook credentials.  

It is essential to have a personal presence on as well.  Not all your networking will be business like and people will want to connect to you, not the business.  

Twitter is the Social Networking Cocktail Party 

This is the place to casually interact with others. 

Other Business-Oriented Social Networks

Plaxo - cross between LinkedIn and Facebook that has a business feel to it. 
Ecademy - similar to LinkedIn, strong in Europe, not so much the states, face to face networking
Biznik - business networking for people who are not job seekers
MySpace - entertainment focused social network. 

Ten Commandments of Social Networking
  1. Pull, don't Push - do not heavily push your product
  2. Win the right to be heard - you are judged by what you contribute to the community
  3. Content is still king (conversation is queen and conversion is the prince) 
  4. Authenticity and Transparency are social networking cornerstones
  5. You do not have to be on every social network - be where customers are
  6. Give and you will receive - help other and you will help yourself
  7. Do not throw the marketing baby out with the bath water
  8. Social media is a mindset, not a toolset
  9. Be yourself
  10. Social media is not a religion
Social Media Marketing, pages 53-76 (Social Networking)
Social network is a website where people connect. It had its start in the computer bulletin board systems of the 1980's. Later content providers like AOL allowed for more than just the local content of the bbs.  As the Internet increased in popularity web sites started to create the community feel.  In 2002, Friendster started as a non dating dating site, 2003 brought about MySpace and Facebook. 

Protocol - common elements across all social networking sites
  • Profiles
    Profiles are for people and contain information about them as well as pictures, etc. 
  •  Connecting
    Social networks were created to make connections to real people.  
  • Private Messaging
  • Public Messaging
    Don't share anything you would not want to send to your boss or your mother. 
  • Groups 
    Collection of People who share a common interest
  • Photos
    Marketers can use this to create campaigns about their product by having people send pictures of themselves using the product the company makes.
  • Applications
    Sites create and 'application programming interface' that allows third parties to add things to the site.  These can be used to market business but make sure they have value to the user. 
  • Status Updates
    Tells people what other people are doing
  • Privacy
    Be aware of the age of the group that you are dealing with.  Older people tend to be more concerned,  younger not so much, and children should not be encouraged to give up information at all.  
 Facebook
Facebook is currently the dominate social network site. 
  • Pages - Public face of your business on Facebook, it is the centrepiece where all other parts come from. Blog and Twitter feeds should also be added here by use of apps that will let you do so. 
LinkedIn
Social network site for business professionals.
  • Introductions - ways to meet people who know people who know people.
  • Recommendations - short endorsements of people they know that become referrals.
  • Answers - people ask questions that you can answer and they can be answered by you to show where you specialise in things.
MySpace
Frist of the social networks to allow customisation. Appeals mostly to teens and musicians.
  • MySpace has Blogs that allow for people to easily post information about self or businesses. 
  • Bulletins are announcements that go to all your 'friends'
  • MySpace for Musicians - MySpace has extensive tools that allow musicians to connect with their fans. 











Friday, June 10, 2011

Social Media Week 2 - Readings

The Digital Handshake, pages 55-76 (Business Blogging)
 
Blogs have been around the longest are a good base for other social media attempts. A blog is defined as an easy to use content management system. They should be written in an informal tone and be authentic. When done right they will stimulate conversation. 
 

Things to consider before you blog
  1. Have your purpose for blogging figured out.
  2. What tone will the blog have? What topics are covered?
  3. Who will write the blog? Marketing people are not best qualified.
  4. Control or converse? Best is somewhere in-between.
  5. Establish a blogging policy with guidelines.
  6. Monitor what is being said about your company.
  7. Decide on a blog platform. Decide if it should be on your server (news updates), or externally (personal type).
  8. How will you market your blog?
  9. Figure a way to track statistics. Traditional methods are not always the best.
  10. Know your keywords.  
 Blogs have morphed into lightweight Content Management Systems. They can be set up for a client who you can turn it over to so that the content can be developed by them. By adding social widgets to them they become a community.  


No matter what, the mantra from the beginning of the web is still true, 'Content is key!' If there is not something to bring people back they will not come back.  This means if you have a partially filled or not at all filled niche, you can use a blog to become the expert people will turn to on the web.  


Blogs and search engines work hand in hand.  They have the things that search engines look for:
  • Titles - each post should have one and search engines look for that title tag
  • Keywords - make sure post uses the words that will draw people to your site
  • Recent content - keep content up to date, update regularly
  • Lots of content - search engines can not read flash, they can read text
  • Links - search engines look for outgoing and incoming links
  • Relevance - does your site match the keywords in the post, then it is relevant to the site
Creating a successful Business Blog:
  1. Know your audience and write with them in mind.  Define who you are trying to reach just like normal marketing except here we are defining community.  Picture those people in your mind when you write. 
  2. Write with Google (and other search engines) in mind. Put keywords in title and in the body (as close to top as possible).  Post at least 3 to 5 times a week and stay on topic. 
  3. Find, follow, and communicate with influential Bloggers in your niche. Read their post, write comments and track back to them. They may return the favour and send traffic your way. 
  4. Find out the people you need to influence. You do not need to be a rock star blogger to be successful.
  5. On occasion write 'top ten' posts.
  6. Write 'link bait' posts - ones that people will want to link back to.
  7. Establish a Presence in the Social Mediasphere - use the other social networking tools to link back to your blog.  Also, make interesting comments on other blogs as well as respond to comments on your blog. 
Social Media Marketing, pages 9-30 (Blogging)

 A blog is a form of a Content Management System that is easy for every one to send articles (post) to. It is a hub for your other social media marketing efforts and should be conversational in nature. 

While people have been keeping journals for years it was not till mid 1990s that they did it on line, the hard way, by editing the HTML.  In 1999 LiveJournal and Blogger came on the scene. 

Features

Some common features to all Blogs are:
  • Posts - Most important is to have consistent posts on topic. Long post structured so that they include scannable items like lists and subheadings. Short posts should be structured around a news events. Both styles are good and can be mixed together. 
  • Permalinks - Since your article can be found many ways and places, you should make sure the title provides a permanent link back to it. Preferably it should be clean and have some keywords in it.
  • Comments - To provide some feel of community, comments should be opened and maintained.  Do not delete negative comments, respond to them. If it is someone being disruptive or offensive, delete them.
    Spend some time looking at other Blogs and thoughtfully responding to them. Remember to maintain your comments as some spammers are seeing this as a good place to make quick links. Take time to put in a way to prevent this (CAPTCHA). 
  • Themes - Customise the look of blog on your own or with may paid or free themes. Your look says a lot about you. 
  • Archive and category pages - Make sure that it is easy to find previous posts as they will fall off the main page.  This can be done with dates or by tags put on posts that can be looked at in a topic list. 
  • Blogrolls - Links to other sites are usually in the side bar of a blog. These would be sites you read regularly.  Try to link to popular sites in your niche.
    Links - The currency of blogging.  When you link to other sites it shows up when the owner of that site looks at the logs and they may start to look at you. 
  • Trackbacks and Pingsbacks - A communication back to the blog you linked from. Have too much spam now so it is not used as much. 
  • TweetMeme Button - Allows people to see how many people have tweeted about this post and give them a way to do so.  Can easily drive traffic to your site.
  • Subscriptions - Allows readers to be able to get your posts in an RSS or ATOM format for use in a feed reader.  Another idea is to provide email subscritions.
Platforms
Hosted vs. Self-hosted? 
Hosted means that the code to run the blog will be on a server out of your control, often with the name of the host in the domain name (blogger, livejournal).

Self-hosted means that you will control where the software is, and you will maintain it. This may require a specialist if you are not tech savy. Try to barter for these services if you can.  
  • WordPress
    Most widely used software to blog, free and open source. Easy to use but may require tech help to set up. 
  • Moveable Type
    Most high traffic sites use this. It can be self-host or a domain like TypePad.
  • Blogger
    Blogger is hosted software. It lacks many features in other software.
  • HubSpot - Includes tools and blogging package. Paid hosted service lets your name appear in the domain.  
Content Strategies
  • News - breaking news is the most popular of content but hard to come by, though it can be done. Publish it quick however, it does no good to be number 2 in the news. 
  • Lists - Readers like bite sized information. Lists (like top 10) are ways to do this. Add pictures or video and do in reverse order if possible. 
  • How-To's - Know how to do something, post it in your blog. 
  • Controversy - It is easy to stir the pot but make sure that you have a good argument and this can work.  However, to do not make personal attacks, and do not make a habit of this type of post. 
Building an Audience
When no one comes to your blog, go to them.  What social network tools do they hang out at.  Also focus on links and commenting.  




    Tuesday, May 31, 2011

    Social Media Week 1, Readings

    The Digital Handshake pages 1 –35 (Consumer Trends)

    Chapter 1 Consumer Skepticism Is at an All-Time High

    Consumers are skeptical now due to the nature of the world we live in. Often they pay more attention to word of mouth advertising. While we read reviews on line, we more often we will trust those we know. Companies are now learning that they have to stop market to the elite and work for the trickle down, and go more to the peer to peer among the actual consumers.
    We now live in the age of Jason Bourne now James Bond.  Bond never got a scratch and always got it right.  Jason Bourne gets beat up, looses the girl and has to struggle to survive. In other words, we do not live in the fantasy but the gritty cold world of reality.  Reality TV reigns supreme now because we can identify with the people on these shows.
    We do not trust advertising as a whole because:
    1. it is interruptive.
    2. it is often deceptive
    3. the companies do not seem to connect to us on our level.

    Chapter 2 The Media Is Fragmented and So Is the Audience

    In the 1960’s a single ad run on all three networks would reach 80% of its intended market.  $5 million and a few years advertising could bring it to 85%,  That was then.  Now we have hundreds of channels as well as radio stations to listen to.  DVRs and MP3s allow consumers to get content they want when they want it.  Since we have so much information at our fingertips and the same amount of time, something, advertising it is believed, is what will consume less of our attention.

    Chapter 3 Who Is In Control of the Marketing Message? (Guess What. It’s Not You!)

    Classis advertising is what is called the ‘command and control’ marketing.  Advertisers tell us what to do and we do it.  If we do not do as ask, a different method is tried.  Social media changes this so that the people have a voice that they did not have before.  Many businesses are locked in the old way of doing things, losing the chance to interact with the customers and losing customers as well as they empower themselves. ‘Engage and encourage’ may be the way to do things now. As these consumers form communities and voice their concerns marketers need to join these communities and directly help the customers. 

    Chapter 4 Business Improve Your Aim

    Most companies today need to figure out the niche that they need to market to and how to tell if they are getting a return on investment (ROI).  Traditional marketing will always have a place. ROI does not just mean the money received though.  The Internet allows for us to target groups and then through metrics see if that group is being reached. But time must be spent both in learning where these groups are and how to communicate to them. Then you must take time to listen to them.  Success comes when you can find a niche that you can fill.  You do not have to take on everyone at once, just the ones directly in competition with you. 
    Chapter 5 Customers Are Mad as Hell, and They’re Not Going to Take It Anymore
    Case studies on three companies that show how social media can be used for or against you.
    • Kryptonite Locks – showing that bad media can follow you forever, especially if you do nothing about it.
    • Motrin – making a mistake about nursing moms, Motrin had to back peddle, but still has not established dialogue with consumers, which could mean the same mistakes again.
    • Dell – used the tools of social networking to turn a fiasco into a harvest.

    The Digital Handshake pages 37 –52 (Start a conversation)

    Chapter 6 What’s a Marketer to DO?  Start a Conversation

    What does social media mean?  Media can be defined as tools, blogs, social network sites, wikis, microblogs, video share sites, etc.  Social has to do with interaction between people.  Because the barrier is so low, social media is less about tools and more about the people and what they can do with them.  It is sociology not technology.  We no longer have one way conversations as traditionally marketing had, it is not multi-stream. Social media is more about relationships then anything else.
    Consumers are turning more to the internet. When was the last time you picked up the yellow pages to find something?  More and more the younger generations are the connected generation.  But the older generations are as well.  Less money is being spent on traditional advertising (newspapers, radio and TV) and thought they do not know how to use it yet, more is spent on social interactions.  It is possible for the small business to use the same tools the big companies do to sell themselves and make a connection with the users. 
    The 90-9-1 principal states:
    • 90% of users are lurkers
    • 9% contribute from time to time
    • 1% participate so much it seems they do not have a life off line
    Being part of the 1% club means you influence the other 99%.  While most all people can participate, the majority do not.  Being part of the 1% however means:
    • Servant leadership needs to be practiced
    • Valuable content needs to be added
    • Think of what will benefit the community
    • Do not take things personally
    • Research must be done
    New marketing tools mean new  rules.  Old school tools of auto replies, scheduled posts and direct market ‘pitching’ will not work.  Think member first, marketer second. 

    You Tube video

    Basic telling of statistics for the new age of marketing and how to reach the people you want to.



    Monday, January 24, 2011

    C Programming class week 2

    C by Discovery 4th edition by Foster and Foster

    C By Discovery (4th Edition)

    Chapter 2 – Gaining Control

    1. Expressions and Statements
      Expressions are sequences of tokens that can be evaluated to a numeric quantity.  A statement is a sequence of tokens that end with a semicolon and can be recognized by the compiler. Statements may not have values.
      Expressions in C are lvalues, an expression that has a location in memory, or rvalues, which can be evaluated by not changed.  X would be a lvalue, X + 3 would be an lvalue. 
    2. Blocks and Compound Statements
      A compound statement is a sequence of statements.  A block can contain compound statements as well as declarations. It must have opening and closing braces ( { } ).  It does not necessarily have to be a function but can reside in a function. If a variable is declared in the block, when the block is exited it does not exist.  This makes it a local variable.  The block can access any variables that are in the block that it exist in. 
      1. A word about style
        Not good programming style to
        A) use variables with the same name close together.
        B) All variables inside and outside blocks should be given different names
        C) A program is generally more readable if all declarations for a function appear together in one place.
    3. The if and if-else statements
      A conditional statement allows for a program to test a condition and then go in a certain direction depending on if it is true or false.  The if statement is one of these:

      if (expression)
      statement

      Expression will be a test to determine true or false, statement can be one line or a block.  Style says that after the test for the if, the line(s) that you would execute should be on the next line and indented slightly to show they are part of the if.  Along with the if statement the if else is used. 

      if (expression)
          statement
      else
           statement
      1. Compound if-else statement
        The if can be used as a series of tests as well.

        if (expression)
           statement
        else if (expression)
             statement2
        else if (expression)
             statement3
        ……….
        else
             last_statement

        When this is coded properly only one statement will be run. 
        It is possible to nest an if..else statement inside another one.  This should be done with braces to identify the statements that go with each other.  You are basically checking for the truth of one statement and the truth of another.
    4. Relational operators and expressions
      It is possible to test for relationships between variables.  They will either return a true or a false.  The relationship expressions in C are:
      Expression what it compares
      <= less than or equal to
      >= greater than or equal to
      == is equal to
      != is not equal to
      > greater than
      < less than

      x == 3 would return a true id x was equal to 3.
      4.1 A word of warning
      It is easy to make the mistake of assigning a variable in place of testing it. For example
         1: invar =3;



         2: if (intvar = 4)



         3:     printf("the number is 4\n);



      will print the “number is 4” because you are assigning the number not comparing it.


      4.2 Operator precedence

        Each side of the relationship will be calculated before it will be compared using the normal mathematical relationships tested before.




    5. The while loop

    Sometimes we may want to do a certain step several times (called  iterations). To do this we will use a while loop. 





       1: while (expression)



       2:     statement(s);




    The first time it runs, the expression is evaluated.  If it is true the statements will run.  There will be some change of the value as part of the statements and then it will be tested again and process repeated.  Eventually it will test false and then drop out of the loop. 




    5.1 using getchar() and putchar() in a loop.



    getchar() and putchar() are special inputs for single characters.  This can be used in the while loop by using and EOF or end of file character. This will vary by operating systems but the popular ones are cntrl-d for Linux/Unix and ctrl-z for windows.  You can compare the input received to the EOF and terminate if it receives it.  The variable is of type int even though we are getting a character.




    6. Logical operators and expressions




    Another set if ways to test are:






























    ! logical not true if statement is false, false if statement is true
    && logical and true if both are true
    || logical or true if one side or both are true




    They are evaluated in the order shown and in a left to right progression.




    7. The for loop





       1: for (initialize_variable; test_to_perform; how_change_initial_value)



       2:     statements




     



    8. Making C readable – programming style




    8.1 Choice of identifiers

    X, y and z may be legal choices, but having the variable describe what it does helps to make the code make sense later. Also a good idea to make constants all upper case.



    8.2 Indentation

    Indenting lines of codes in if/then and for loops make the code easier to understand.



    8.3 Placement of braces

    Two styles here. One is to place the open brace right after the test and the close brace as first character on line after it ends. The other is to put the open and close as the first characters on the first and last line of the block. 



    8.4 Block structuring

    Short blocks of code that do a single task are easier to read than larger ones.  It also makes larger programs easier when the get large and complex.



    8.5 Use of parentheses

    While the code may be right for the compiler, adding parentheses to math equations may not help the compiler but it may help the person trying to read it later (and that may be you). 



    8.6 Comments

    Use of comments is necessary to explain to a future person maintaining it what is going on. 



    8.7 Paragraphing

    It helps in reading the program if you break the parts of it that are similar in nature into manageable chunks. For example, the code that initializes variables might have a few blank lines after it and before the while loop to get input.



    8.8 Whitespace

    Whitespace, blank characters that add nothing to the code, can make it much easier to read.














    Introduction to C


    Tuesday, January 18, 2011

    C Language Class week 1

    Book: C by Discovery 4th Edition by Foster and Foster

    Chapter 1: Getting Started

    1. What to Expect from C
      1. Language Level
        Programming languages are low, intermediate or high. C is intermediate to high, closer to what humans think. Assembler is how computer thinks (1s and 0s) and is considered a low level language.
      2. Programming environment
        A programing language can either assembly, interpret or compile. C is traditionally compiled and takes several steps. After that is done it is translated to the assembler language for that computer.
      3. Portability and Efficiency of C Code
        If a C program is written properly it is portable, meaning it can be run on other computer processors with no modifications. This comes at the expense of non-portable code like assembler being smaller and faster.
      4. Ease of maintenance
        Because C is a structure language and can use functions, these functions can be written in several files before the compile. Now if there is a major change that will affect one item of the program, the file that contains all references to it can be changed, and not the whole program. This makes maintaining the program much easier.
    2. Fundamentals - Reserved Words, Identifiers, the Character Set
      1. Reserved words
        Words that C uses that cannot be used for other purposes are reserved words.
      2. Identifiers or Names in C
        Identifiers are words that we choose to represent variables, subprograms and other elements. They are made up of letters, digits and underscores though they cannot start with a number. They are also case sensitive. Depending on the compiler there may be limitations as to how long they are. Lastly they cannot be identical to any keyword in C.
      3. The Character Set
        Because computers use different character sets, it is possible that extensive use of one set will make a program that is not portable.
      4. Format of C Programs
        C is a free from language that basically ignores white space put into a program
    3. Subprograms or Functions in C
      In C a subprogram is called a function. It consist of the following:

      type function_name(formal parameter declarations)
      {
      variable declarations;
      code;
      }

      Type is what type of value it will return. The rest is fairly self-explanatory.
      1. Calling a function
        If you write a separate routine to be called upon later, this is a function. In order to use it you must type its name in the calling routine and pass whatever parameters it might need.
    4. An Introduction to Output in C
      In C language, input and output are not part of the language but are external functions that come with the C compiler. To use the input and output in C, the line #include <stdio.h> must be included at the top of the program. For printing, the command printf("text to print\n"); will be used in the program. The \n represents a line feed to be done. There are other escape lines like that. \t is for tab, \b is for backspace, \" for double quotes in a string and \' for single quotes. \\ allows for a backslash to be done and lastly \0 is the null character. Also, any character that is supported in the computers character set can be done with the number of it. In \'0141' would be the letter a for example.
    5. Input and Output with Variables
      Variables are used to hold data while a program runs. In C these must be declared as to what type they are. Both of these are legal ways of declaring them in C

      int counter;
      int counter = 1;

      It is also legal to use the first one and then declare its value later on in the program. Several variable can be put on the same line if desired.
      1. Input with scanf()
        scanf() is used to input a variable from the input device. It uses two parameters. %d is the input, in this case decimal digits, and the variable name with a & in front of it, which tells the computer what memory location to put it in to correspond with the variable. It can return strange values if the input is not what it is expecting (characters in place of numbers).

        scanf("%d", &intcar);
    6. Arithmetic Operations

    Symbol

    Action

    +

    Addition

    -

    Subtraction

    *

    Multiplication

    /

    Division

    %

    remainder

    =

    Assignment


     

    1.6.1 Precedence of Arithmetic Operations
    Unary, multiply/divide, add, subtract, assign. It is possible to make a compound assignment, meaning while assigning a variable you do one action on it. A += 1 would be the same as A = A + 1.


     

    1. Introduction to Functions and Structured Programming in C
      1. Designing a program
        1. Specify what the program is to do
        2. Analyze the program
        3. Design the software solution
        4. Translate design into code
        5. Test and debug the code
        6. Maintain an modify code as need arises.
      2. Preprocessor constants
        In defining variables in a program, constants can be used for values that will not change. These should be placed in such a way that it would take changing a value in one place to resolve any future need of changing the value.
      3. Function Parameters
        A function may have values passed to it. By definition, those values will take on the type of variable it is upon return. Any return statement stops execution of the program and returns to the calling routine.
      4. Function Calls
        A call of a function is done by its name and in ( ) next to it, any parameters it needs to pass.