Feb 13, 2015

Virgin Media focusing on infrastructure over content with £3bn investment

Chief executive Tom Mockridge says first infrastructure expansion in 15 years is overdue as company reveals it has passed the 5 million cable customer mark

Tom Mockridge

Virgin Media’s planned £3bn investment to extend its cable network to an extra 4m homes shows the company’s focus is on infrastructure rather than content, according to its chief executive, Tom Mockridge.

The cable company’s first big infrastructure expansion for 15 years was overdue, said Mockridge, and could not have happened before it was acquired by John Malone’s Liberty Global in 2013.

Liberty reported record revenues of more than $18bn (£11.7bn) on Thursday in the US and Virgin subsequently unveiled its results on Friday morning, which showed it passed the landmark of 5 million cable customers and revealed its huge network expansion programme – Project Lightning.

Mockridge declined to comment on speculation about Liberty Global being interested in bidding for ITV, almost a decade on from the doomed bid by NTL (the cable company that later merged with Telewest to form Virgin Media) for the broadcaster.

Related: Virgin Media challenges BT with cable network extension plan

However, he pointed out that “the message from [Friday’s Project Lightning] announcement” was that the focus for Virgin is on putting its money into infrastructure and its “core business”.

Virgin Media’s figures showed its revenue increased 3% to £4.2bn in the year to 31 December 2014, with operating profit up 41%, mostly due to revenue growth and economies of scale following its purchase by Liberty.

Cable subscription revenue grew 3% in 2014 and the quad-play company’s mobile revenue was also up, by 9%, while churn rate – the number of customers not renewing their subscriptions – reached a record low of 14.6%.

Mockridge put the fall in customers leaving down to better customer service and a more effective network, which people value more as they watch more video via broadband: “The fundamental reason is people use their broadband services so much more. The use in our network is running up 60% on last year.”

Average monthly revenue per user also rose, to £49.36 in the fourth quarter of 2014. While some could be attributed to price rises, the company also sold more products across its quad-play offering of telephony, broadband, mobile and television services.

Following its intervention into the Premier League auction rights process – asking Ofcom to investigate if the Premier League auction process which resulted last week in Sky and BT paying a record £5.1bn for rights to live top-flight football is fair for consumers – Mockridge said it was now “up to the referee” to decide.

The former News International chief executive said Virgin awaits the outcome but he said it was “helpful” that Sky – which provides its sports channels to the cable operator on a wholesale basis – had recently indicated it was going to absorb some of the rise in rights costs.

Related: Virgin Media urges Ofcom to pause auction of Premier League live TV rights

Over a year ago, Mockridge said Virgin Media was holding talks with Amazon about putting its video-on-demand service, Prime Video, on its network, but he told the Guardian that there is still no outcome.

The Project Lightning strategy – also called the UK Network Extension – has received support from the government, with David Cameron saying: “This additional private investment will create more opportunities for people and businesses, further boosting our digital economy.”

But Mockridge said that while all the investment in Project Lightning comes from the private sector, “where the government has been supportive”, it has been in terms of infrastructure policy as Virgin still has to “dig a hole in the ground” to extend its cable network.

However, terms and conditions do apply. Virgin’s results have a caveat about the £3bn investment which says: “Depending on a variety of factors, including the financial and operational results of the earlier phases of the programme, the UK Network Extension may be modified or cancelled at our discretion.”

The Virgin Media chief said that trials in Teesside and Glasgow showed that up to 23% of homes took up the service, but “we’ve got to be better than that”. While Liberty’s approval for the investment in the five-year expansion programme showed its belief in Virgin’s strategy, Mockridge said it was right there were terms and conditions, “the boss is saying we’ve got to deliver”.

The company is asking householders who want to take advantage of its services to register their interest at virginmedia.com/cablemystreet in order to see where it is best placed to invest in first.

To contact the MediaGuardian news desk email editor@mediaguardian.co.uk or phone 020 3353 3857. For all other inquiries please call the main Guardian switchboard on 020 3353 2000. If you are writing a comment for publication, please mark clearly “for publication”.

To get the latest media news to your desktop or mobile, follow MediaGuardian onTwitter and Facebook.

post from sitemap

Feb 12, 2015

Apple enables two-step authentication for iMessages and FaceTime

Additional login step brings extra layer of protection against hackers for Apple’s messaging and video chat, but more can be can be done say experts

iphone 6

Apple is finally enabling two-step authentication to help protect users of its iMessages and FaceTime on iPhone, iPad and Mac computers.

Related: How Google, Facebook and Hotmail aim to stop holiday hacking

The security feature adds an extra layer of protection against hackers trying to access users’ accounts. After logging in with their usual name and password, two-factor asks account holders to use a second security code to verify their messaging and video chat accounts.

The login protection was added to Apple’s iTunes and iCloud accounts in March 2013, meaning Apple users who have perviously logged into a Mac, iPhone or iPad with their Apple ID were already protected by the extra security.

Related: Twitter introduces 'two-factor authentication' to stop password hacking

Now the same service has been activated for two more of Apple’s services, meaning that if users log out of their FaceTime or iMessage accounts and attempt to log in again, or log in on another machine, they will require a security code to confirm their username and password.

“It’s really great to see Apple extending its two-step authentication to cover more services, particularly person-to-person communication services such as these, which have been so widely abused in the past (Facebook, Skype etc),” said Rik Ferguson, vice president of security research at Trend Micro.

Two-step authentication means that even if an attacker has the username and password for the account they cannot access it without the extra code. While the extra security is welcome Ferguson said more can be done to secure user accounts.

“Two-step authentication, such as a message to a mobile device, is still not the same as fully-fledged two-factor authentication. Multi-factor authentication typically relies on something that you know (a password) in addition to either something you have (eg. a swipe card), or something that you are (a fingerprint),” said Ferguson.

Banks have been using card readers or numeric key fobs with security codes for years. But for internet sites and services, including Facebook, Twitter and Google, the second step is either a code-generating smartphone app or a text message with a code send to the phone number registered to the account.

“Two-step authentication is simply two sets of something that you know,” said Ferguson. “The ability to enter to enter the SMS-based password doesn’t depend on your ownership of the smartphone, only your access to the text message. If attackers can divert the calls or messages of that device, for example by calling the mobile service provider, this two-step authentication can and has already been subverted.”

Related: What to do if your email gets hacked - and how to prevent it

Apple’s two-step implementation uses codes sent via text message to a registered phone or the company’s Find My iPhone app. More than one phone number can also be associated to the account just in case one of them is lost or stolen.

A recovery key that is intended to be kept safe for emergencies can also be used to log into the account in place of a security code.

post from sitemap

Feb 11, 2015

Windows 10 With The Latest Technical Preview Build



If you have been keeping an eye on the Microsoft Windows 10 Technical Preview, then you should really focus on here for a second. Microsoft has steadily improved its windows 10 Overview of new constructions loaded with new features. These constructions have come fairly regularly with the first rookie in October 1. The next version, which was known as Build 9860, left about three weeks ago, and Microsoft has just released the latest version Build 9879. But why these new buildings so important?

Windows 8 will not be able to attract customers that Windows 7 has, of course, Microsoft is under great pressure to ensure that Windows 10 locations great pomp as possible. In this sense, Microsoft opened a preview of Windows program started, the goal is to encourage people to download and install Windows 10 and share your opinion with Microsoft for the company to see if you made the right decisions. Keeping up with the latest versions ensures that your comments relevant and updated.

Windows Rentals Nationwide

To keep you have to run the latest version, but how do you do it? If you are not running Windows 10 Technical Preview can be downloaded to your PC, it is not recommended unless you want to do it in a free and independent team. It can be downloaded as an ISO file and copy this file to a DVD or USB drive to install it on another pc on a separate partition or a virtual machine on your existing equipment.

Ok, so if you have any facts or already have Windows 10 running, it's time to get the latest version. And here's how:
* If you use Windows 10, click the Start button and then click the PC configuration option.
* In the PC Setup screen, click the update configuration and recovery.
* In the update screen and Recovery, click the option integrated preview.
* In the screen above is based, click the Check button now.

Once you do this, Windows will tell you if a new version is available and shows a Download Now button. If there is a new construction and a message will warn you that there are no new localized display modes. If new construction is then:
* Click the Download Now button. Windows start downloading and installing the new construction.
* Once installed Windows building will prompt you to restart the PC.
* Restart your computer, log back on and the new building will be ready and waiting.



Then you can confirm that you have the latest version, looking at the bottom right of the desktop. There you will see the Windows label Technical Preview copy evaluation, followed by the build number. Currently, the final build number is 9879. The next time you perform this process, you should see a number of top construction process.

Now you are able to deal with the new building to see what you like, what works and what does not. Microsoft OneDrive, for example, you are not working in the current version. As Microsoft releases new buildings, new features and new bugs will be noticed. To post comments, click the Start button and then click the Windows Feedback block. On the wall of Windows, you can select a specific category and see user comments or their own.

Microsoft already has some plans for Windows 10 and how it will fit and shape things the final version, although the company is certainly count on the return that is receivable from the Technical Preview builds. If you were less happy with Windows 8, then this is your chance to make Windows 10, the operating system that you have always wanted.



Microsoft Borrows A Few Tricks From Apple For Windows 10 Operating System

The latest Microsoft Windows operating system (OS) really a great competitor and is OS X. OS X Apple Granted usually found only on Apple computers while Windows is, well, almost every other team on the planet; yet both are competing, however. Windows 8 can not make the impact on consumers that Microsoft wanted the company turned its gaze to Windows 10, the next version of the operating system. With Windows 10 in direct competition with Apple's OS X 10.10 Yosemite, it is interesting to see how well the two operating systems are made for each other.




Desktop-Dedicated OS

Microsoft has released a preview version of Windows 10 and many are critical. Interestingly, many reviews that say, such as Windows 10 OS X seems to Yosemite! One of the main changes and possibly major flaws Microsoft did with Windows 8, which attempts to match the position of your operating system and the mobile OS system. Apple has always done a good job of iOS, the maintenance of its mobile operating system, OS X and independently. Windows 10 seeks to change this and return to being a desktop operating system really dedicated.


View job

Windows 10 and OS X 10:10 Yosemite are very similar, but it is not necessarily a bad thing. One feature that both operating systems seem to share original Apple OS X Mission Control (bottom). Mission Control allows you to see all Windows programs running on an organizational heads-up. It also allows you to view multiple desktops and add additional jobs with a click of a button. Windows 10 has a nearly identical feature known as the task view (Top).



By clicking or pressing the Display group in the Start menu button takes each mode of heads-up application window in a grid. From here you can see other virtual desktops or create your own virtual desktops meaning are back. What's even more interesting is the gesture shortcut up view task is identical to the Windows 10 Mac OS X. Simply slide three fingers on the trackpad and the mode is set. Of course it is a rip-off of OS X, Apple, but also a very smart move by Microsoft.

Start menu Return & more

One of the most important things that users do not like Windows 8 was that the Start menu is essentially gone, replaced by direct Tiles Planet. The good news is that the Start menu is back and not at the expense of the tiles, essentially making everyone happy. The tiles are now able to join the Start menu and can also display updates in real time. This is also similar to the OS do with your notification center X Yosemite. OS X Yosemite offers customizable widgets on the Today screen as in iOS 8.


OneDrive

However, Microsoft can take credit for the similarities between OS X and Windows 10 in terms of Yosemite OneDrive and iCloud unit. In both operating systems, the login user accounts can be linked their discs. When this happens, iCloud, and a hard drive fit perfectly with the desktop experience, making it easy to access files and folders from the cloud or to save the files that are synchronized with the cloud. Apple users were after a more or Dropbox OneDrive approach to cloud services and now they are getting their wish.

Programmers Take on Rock Star Status

(Newser) – A growing number of computer programmers aren’t content to be anonymous code monkeys: Today’s most talented tech nerds are paid exorbitantly well to turn out brilliant code, and can even earn a small amount of fame doing it, ComputerWorld reports. “Some developers base their careers around eventually becoming rock stars,” while others “practically worship” at their “virtual altar,” said one writer who rates programmers.

Coding contests give the would-be software gods a way to make a name for themselves – one frequent winner, known as Tomek, is treated like a celebrity in Poland, even appearing on a billboard and inspiring a rap song. At the same time, deep-pocketed tech companies are desperate to find the most brilliant developers, and will pay to get them.

TopCoder Inc offers $50,000 to first place winners at its annual TopCoder Open in Las Vegas.
TopCoder Inc offers $50,000 to first place winners at its annual TopCoder Open in Las Vegas.   (topcoder.com)
The Top 5 competitors pose for a photo at the 2007 TopCoder Open.
The Top 5 competitors pose for a photo at the 2007 TopCoder Open.   ( (c) Luís Guilherme)
If you're a rockstar of the coding world, the TopCoder competition in Las Vegas is prepared to offer you fame and fortune.
If you're a rockstar of the coding world, the TopCoder competition in Las Vegas is prepared to offer you fame and fortune.   (Shutterstock.com)
Competitors break for Guitar Hero at the 2007 Topcoder Open.
Competitors break for "Guitar Hero" at the 2007 Topcoder Open.   ( (c) mecruns24)
TopCoder Webcast   ( FouQuoi (YouTube))
post from sitemap

Computer Visionary Dennis Ritchie Dead at 70

(Newser) – Dennis Ritchie, who invented the C programming language and helped create the UNIX operating system, died last weekend at age 70. His death after a long illness was first reported by Google engineer Rob Pike. Obituaries popping up on tech sites hail his work, vision, and legacy:

  • “Ritchie's contribution to computer science cannot be overstated. … His vision, innovation, and hard work shaped much of what has come in the following four decades,” writes Lawrence Latif on the Inquirer. “To this day C is arguably the fastest, most efficient, most widely deployed high level programming language."

  • The birth of C is perhaps not as well known as other legendary moments in the history of computing, but it “has as much claim, if not more, to be the true seminal moment of IT as we know it,” writes Rupert Goodwins in an extensive post on ZDNet. Ritchie was focused on “making software that satisfied the intellect while freeing programmers to create their dreams."
  • “C remains the second most popular programming language in the world … and ushered in C++ and Java; while … UNIX led to, among other things, Linus Torvalds’ Linux,” writes Rip Empson on TechCrunch. “The work has without a doubt made Ritchie one of the most important, if not under-recognized, engineers of the modern era."

Dr. Dennis Ritchie, Bell Labs Fellow, poses after receiving the 2011 Japan Prize at Bell Labs headquarters in Murray Hill, New Jersey, on Tuesday, May 19, 2011.
Dr. Dennis Ritchie, Bell Labs Fellow, poses after receiving the 2011 Japan Prize at Bell Labs headquarters in Murray Hill, New Jersey, on Tuesday, May 19, 2011.   (Victoria Will/AP Images for Japan Prize Foundation)
post from sitemap

Computer Program Catches Chess Cheaters

(Newser) – Cheaters beware: A chess wiz has developed a program to catch you. Potential cheating has become a noted problem in chess, the New York Times reports. Alleged text messaging prompted a five-year ban on a trio of players in 2010; in 2006, a player was accused of using a computer in the bathroom in an incident dubbed Toiletgate. The controversy inspired an international chess master and University of Buffalo professor to develop a computer program to investigate cheating.

Kenneth Regan reviewed some 200,000 chess matches dating back to the 19th century, building a database of the moves played. His work compares human players' moves to the ones a computer would make. When a player's honesty is in doubt, Regan's program analyzes the player with reference to his or her skill ranking. At this point, the program is only robust enough to function as supporting evidence following a cheating allegation. But his work matters to more than chess, says a computer science professor: He's "trying to model how people make decisions."

A chess expert has developed a computer program to catch cheaters.
A chess expert has developed a computer program to catch cheaters.   (Shutterstock)
post from sitemap

Want to Vote, O'Connor? Think Again

(Newser) – The Information Age has been bad news for O'Connors, D'Angelos, Al-Husseins, and Van Kemps everywhere. Apostrophes in Irish, French, Italian, and African last names; hyphens in Arab names; and spaces in Dutch ones cause their owners endless headaches when computer systems reject or mis-record them, reports the AP, blocking them from voting, booking flights, and taking college exams.

Thousands of votes weren’t counted in the 2004 Michigan caucus because of computer problems with voters’ names. Such glitches happen either because the system filters out strange-looking names or because punctuation is mistaken for computer code once the name is stored. Some people are giving in and changing their surnames’ traditional spelling—at least when dealing with technology.

A young voter hands over his identification as he registers to vote at the Chicago Board of Elections Thursday, Jan. 17, 2008. In the 2004 Michigan caucus, thousands of votes weren't counted because they were cast by people with apostrophes or hyphens in their last names. (AP Photo/M. Spencer Green)
A young voter hands over his identification as he registers to vote at the Chicago Board of Elections Thursday, Jan. 17, 2008. In the 2004 Michigan caucus, thousands of votes weren't counted because they...   (Associated Press)
Iraqi refugees in Syria register their names on Wednesday, Feb. 13, 2008 in a center for the United Nations Higher Commissioner for Refugees to receive food assistance in Damascus. Many might find their last names distorted or rejected by computer systems that can't handle hyphenated names.(AP PHOTO)
Iraqi refugees in Syria register their names on Wednesday, Feb. 13, 2008 in a center for the United Nations Higher Commissioner for Refugees to receive food assistance in Damascus. Many might find their...   (Associated Press)
Clerk Shawntae McCain feeds envelopes containing absentee ballots into a scanner that verifies signatures on those envelopes with registration records, in preparation for counting in the California Super Tuesday Primary election at the office of the Los Angeles County Registrar-Recorder in Norwalk, Calif., Tuesday afternoon, Feb. 5, 2008.  Thousands of...
Clerk Shawntae McCain feeds envelopes containing absentee ballots into a scanner that verifies signatures on those envelopes with registration records, in preparation for counting in the California Super...   (Associated Press)
post from sitemap

Single App Nets $600K in Month

(Newser) – With more than 20,000 iPhone apps available, it seems inevitable that most would make peanuts. But Ethan Nicholas’ tank artillery game, iShoot, raked in $600,000 in one month——$37,000 on its best day—proving the gold rush is on in the App Store, Wired reports. The store provides a platform for selling and distributing software, allowing individual coders to match software giants in their reach, provided their products are good.

When Nicholas launched iShoot in October, business was slow. So he coded a demo version, iShoot Lite, that users could download for free. Nicholas advertised the full $3 version inside it, and within months 320,000 of the 2.4 million demo users had purchased the game, pushing it to the App Store’s No. 1 spot—where it stayed for 26 days. The game is still at No. 6.

Apple customer uses an Apple iPhone at an Apple store in Palo Alto, Calif., Thursday, Oct. 16, 2008. Apple Inc.'s fiscal fourth-quarter report, expected after the market close Tuesday, Oct. 21, 2008.
Apple customer uses an Apple iPhone at an Apple store in Palo Alto, Calif., Thursday, Oct. 16, 2008. Apple Inc.'s fiscal fourth-quarter report, expected after the market close Tuesday, Oct. 21, 2008.   (AP Photo/Paul Sakuma)
In this Oct. 19, 2007 file photo, a customer holds an Apple iPhone at the Apple store in Palo Alto, Calif., Friday, Oct. 19, 2007. Following the success of Apple Inc.'s iPhone, mobile phone manufacturers are racing to produce touch screen models of their own.
In this Oct. 19, 2007 file photo, a customer holds an Apple iPhone at the Apple store in Palo Alto, Calif., Friday, Oct. 19, 2007. Following the success of Apple Inc.'s iPhone, mobile phone manufacturers...   (AP Photo/Paul Sakuma, file)

I'm not going to be a millionaire in the next month, but I'd be shocked if it didn't happen at the end of the year.
- Ethan Nicholas, creator of iShoot, an application for Apple handheld devices

post from sitemap

Intel, Microsoft Fund Multicore Research

(Newser) – Intel and Microsoft will fund researchers at two universities working on new programming techniques for multicore chips, sources told the Wall Street Journal. The companies will reportedly provide $2 million annually for five years, to speed the development of chips that can contain dozens—or even hundreds—of microprocessors of multiple types. One of the grants is expected to go to UC Berkeley.

"Everybody is madly racing toward multicore technology, and they don't have a clue about how to program it," said one Stanford professor. Possible applications include media-rich programs like 3-D imaging, pattern recognition, and financial analysis, all of which require hardware/software combinations that can process large, complicated quantities of data.

Intel Corp. Vice President and Chief Technology Officer Justin Rattner briefs the media in Bangalore, India, Wednesday, Jan. 16, 2008.
Intel Corp. Vice President and Chief Technology Officer Justin Rattner briefs the media in Bangalore, India, Wednesday, Jan. 16, 2008.   (AP Photo/Aijaz Rahi)
Steve Ballmer, CEO of Microsoft, addresses the media during a news conference at the CeBIT in Hanover, northern Germany, on Monday, March 3, 2008.
Steve Ballmer, CEO of Microsoft, addresses the media during a news conference at the CeBIT in Hanover, northern Germany, on Monday, March 3, 2008.   (AP Photo/Joerg Sarbach)
The Intel exhibit at the Consumer Electronics Show at the Las Vegas Convention Center, Wednesday, Jan. 9, 2008.
The Intel exhibit at the Consumer Electronics Show at the Las Vegas Convention Center, Wednesday, Jan. 9, 2008.   (AP Photo/Paul Sakuma)
post from sitemap

Treat Your Marriage Like Software Code

(Newser) – No software code is free of bugs, and no marriage is free of hitches. Fortunately, in both cases, those issues can be addressed—using techniques that are surprisingly similar, writes David Auerbach at Slate. He should know: He's a software engineer, and so is his wife. A few of his tips:

  • Beta-test your marriage: Make sure you've given the relationship plenty of time before you walk up the aisle. "We waited 10 years to get married, to rack up enough evidence that the code was now robust enough to keep the product running smoothly."

  • Bugs "hibernate," but they don't go away by themselves. "If you haven’t actually fixed anything, it’s a dead certainty the enigmatic bug will return." Same with that niggling issue in your marriage—the friend you can't stand, for example. Take the time to "talk it out."
  • Most code is simply support structure for the task the program is actually supposed to do. Likewise, a marriage can't just be about love; that would be "about as stable as Windows 3.0." You must work on the infrastructure, "the little piddly things around scheduling and finances and chores."
  • Bugs might hide for a very, very long time before you notice them. Programs can crash years after they're written, and "a good programmer knows that she never knows everything about a program," Auerbach notes. "Likewise, even after 18 years together, I know that my picture of my wife is still only an approximation of a very complex person, and thinking it complete and accurate will inevitably lead to error upon error."
Click for the rest of Auerbach's tips.
For a successful marriage, treat it like software code.
For a successful marriage, treat it like software code.   ( Shutterstock)
post from sitemap

New Bot Plays Perfect Poker: Researchers

(Newser) – The world's greatest poker players have a formidable new foe. Scientists have developed a computer program they say plays an effectively perfect game of Fixed-limit Heads-up Texas Hold 'em, the BBC reports. The Cepheus system "can't be beaten with statistical significance within a lifetime of human poker playing," developers say. The game won't necessarily win every hand, the Guardian reports, but it should beat humans in the long run. It developed its abilities after "playing 24 trillion hands of poker every second for two months," says a researcher. The program reportedly learns from its mistakes, experiencing what might be called electronic "regret" over moves that don't work out perfectly. If you're skeptical, you can try playing against it right here.

Its favored version of poker starts with players receiving two cards the other player can't see, and that's key to the significance of Cepheus. Computers have previously developed winning strategies for games like chess, but in those games, each player has all the information about what's happened so far—they're called "perfect information games." Prior to Cepheus, "no nontrivial imperfect-information game played competitively by humans" had been "solved," researchers write in Science. At the Guardian, poker writer Christopher Hall has some doubts:

  • "One of the bot’s limitations appears to be that it did not seem to adapt against my change of style, something that could be its undoing. The most important thing in any heads-up battle is finding out your opponent’s flaws ... and relentlessly exploiting them until they change their style to compensate," he writes. He came out slightly ahead of Cepheus after 400 hands, though that's too small a sample size to draw a clear conclusion, he notes.

A dealer shuffles a deck of cards during a round of Texas Hold 'em at the World Series of Poker, Friday, May 31, 2013, in Las Vegas.
A dealer shuffles a deck of cards during a round of Texas Hold 'em at the World Series of Poker, Friday, May 31, 2013, in Las Vegas.   (AP Photo/Julie Jacobson)
post from sitemap

Man Who Coined 'Artificial Intelligence' Dead at 84

(Newser) – John McCarthy, the computer scientist who coined the term "artificial intelligence" in 1955, died Monday, reports the New York Times. He was 84. McCarthy was teaching mathematics at Dartmouth when he organized the first Artificial Intelligence conference in 1956. Later he founded AI labs at MIT and Stanford, and created the computer language Lisp (for List Processing Language) that still underlies much AI programming. McCarthy predicted that creating an AI machine would require "1.8 Einsteins and one-tenth the resources of the Manhattan Project."

Called "prophetic" by the Times, McCarthy spoke of what is now e-commerce in the 1970s, invented the computer memory clearing technique called "garbage collection," and developed "time sharing" systems for mainframe computers. McCarthy also held several less successful beliefs over the years—in the 1970s he believed that personal computers were mostly a waste of time, and more recently was largely a climate-change skeptic.

In this March 7, 1974 photo provided by the Stanford news Service, John McCarthy, professor of computer science, works at the artificial intelligence lab in Stanford, Calif.
In this March 7, 1974 photo provided by the Stanford news Service, John McCarthy, professor of computer science, works at the artificial intelligence lab in Stanford, Calif.   (AP Photo/Stanford News Service, Chuck Painter)
post from sitemap

Meeting the Tools in the Visual Basic Toolbox

When you write a Visual Basic program, you first have to design the user interface. Essentially, a Visual Basic user interface consists of objects that you place on the screen and arrange in some semblance of organization so that the screen looks pretty.

The common elements of a Visual Basic user interface appear in Figure 1 and consist of the following:

  • Forms (also known as windows)
  • Buttons (such as command buttons and radio buttons)
  • Boxes (such as text boxes and check boxes)
  • Labels
  • Pictures (such as icons and graphics)
figure

Figure 1: The elements of a typical Visual Basic user interface.

To design your user interface, follow these steps:

1. Create a form.

2. Choose the object you want to draw from the Toolbox. (See Table 1.)

3. Draw the object on the form.

Table 1: Tools in the Visual Basic Toolbox

Icon

Tool Name

What This Tool Does

Pointer

Selects objects

Picture box

Draws a box to display graphics

Label

Draws a box to display text

Text box

Draws a box that can display text and let the user type in text

Frame

Groups two or more objects together

Command button

Draws a command button

Check box

Draws a check box

Option (or radio) button

Draws a radio button

Combo box

Draws a combo box

List box

Draws a list box

Horizontal scroll bar

Draws a horizontal scroll bar

Vertical scroll bar

Draws a vertical scroll bar

Timer

Places a timer on a form

Drive list box

Draws a drive list box that displays all the disk drives available

Directory list box

Draws a directory list box that displays a directory on a particular disk drive

File list box

Draws a file list box that displays files in a specific directory

Shape

Draws a geometric shape such as a circle or a square

Line

Draws a line

Image box

Draws a box to display graphics

Data control

Draws a control to link a program to a database file

OLE

Draws a box to insert an OLE object

post from sitemap

An Introduction to C++

The C++ programming language consists of a vocabulary of commands that humans can understand and that can be converted into machine language fairly easily and a language structure (or grammar) that allows humans to combine these C++ commands into a program that actually does something (well, maybe does something)

The vocabulary is often known as the semantics, while the grammar is the syntax.

What's a program?

A C++ program is a text file containing a sequence of C++ commands put together according to the laws of C++ grammar. This text file is known as the source file . A C++ source file carries the extension .CPP just as a Microsoft Word file ends in .DOC or an MS-DOS batch file ends in .BAT. The concept extension .CPP is just a convention, but it's used almost exclusively in the PC world.

The point of programming is to write a sequence of C++ commands that can be converted into a machine language program that does whatever it is that you want done. Such machine executable programs carry the extension .EXE. The act of creating an executable program from a C++ program is called compiling (or building — there is a difference, but it's small).

How do I program?

To write a program, you need two things: an editor to build your .CPP source file with and a program that converts your source file into a machine executable .EXE file to carry out your commands. The tool that does the conversion is known as a compiler.

Nowadays, tool developers generally combine the compiler with an editor into a single work-environment package. After entering your program, you need only click a button to create the executable file.

The most popular of all C++ environments is Microsoft's Visual C++, but the software is expensive. Fortunately, there are public domain C++ environments — the most popular of which is GNU C++. (Pronounce GNU like this: guh NEW). You can download public domain programs from the Internet. Some of these programs are not free — you are either encouraged to or required to pay some usually small fee. You do not have to pay to use GNU C++.

GNU stands for the circular definition "GNU is Not UNIX." This joke goes way back to the early days of C++ — just accept it as is. GNU is a series of tools built by the Free Software Foundation.

GNU C++ is not some bug-ridden, limited edition C++ compiler from some fly-by-night group of developers. GNU C++ is a full-fledged C++ environment. GNU C++ supports the entire C++ language and executes all C++ programs.

GNU C++ is not a Windows development package for the Windows environment. You'll have to break open the wallet and go for a commercial package like Visual C++.

post from sitemap

Working with Code in Visual Basic 2008

Of the programs you create with Visual Studio, most of what you want the user to see are the controls and the forms. But you will be spending most of your time working with code. Fortunately, Visual Studio has a ton of tools to help you write code.

Getting to Code View

Code View, like Design View or Diagram View, is just another way to look at a file in the Solution Explorer. To get to Code View, you have several choices:

  • You can right-click a form in the Solution Explorer or in Design View and select View Code from the context-sensitive menu.
  • You can click the View Code button in the Solution Explorer.
  • You can double-click an object in a form.

When you're working in Code View, most of the tool windows becomes inactive. The Toolbox and Properties windows, for instance, have little available because their features are designed for use with the Design View rather than the Code View. This is by design, to keep the code out of your way when building business logic.

Using IntelliSense

The problem with using Code View is that you need to know what to type. Welcome to programming! To help you get started, you can use some very productive code-based tools, such as IntelliSense.

Just to see how great IntelliSense is, check this out. Get started with these steps:

1. In the default project, double-click the blank Form1 to move to Code View.

2. Start to type My. in the Form1_Load method. (Just press M on the keyboard, and you can see what I mean).

A special context-sensitive menu (the IntelliSense menu) appears when you start typing. This menu shows the code that is available to you. It guesses what you need based on what you are doing — in this case, it doesn't have much to work with so it started with the MID method.

Finish typing 'My.' and you will get all the available methods, properties, and events in the My object. It's a great way to remember the best way to get things done.

You can continue to use IntelliSense menus as long as Visual Studio thinks there are more types after the selected object. For instance, double-click Application in the context-sensitive menu and then type . (period). You see another IntelliSense menu.

Reading the documentation

In the case of Visual Studio, there is so much power in the documentation model that it deserves a little space of its own. The most straightforward use of the documentation requires little more than clicking on or in the object that you have a question about and pressing F1 to launch context-sensitive Help.

For instance, in any application, click somewhere on the form (make sure that you click the form and not an object on the form) and press F1. The Microsoft Document Explorer launches with the Form object documentation loaded.

The Document Explorer has a sophisticated set of tools, mostly represented in the Document Explorer toolbar. The tools you find there give you various ways to access the documentation, as follows:

  • The toolbar's first section has navigation buttons, a Refresh button, and font size maintenance.
  • The How Do I button has preset questions that relate to the selected topic, and may help with general queries about certain types of development; if you are stuck, give it a try.
  • Clicking the Search button allows phrase searching. The Index button and Contents button allow browsing through the index or table of contents of the documentation. You can save favorites in the Help Favorites just like you can in Internet Explorer. The double arrow is handy — it synchronizes the Contents panel with the page you are currently viewing.
  • The Ask a Question button takes you directly to the NNTP newsgroups (using a Web-based viewer) hosted by Microsoft, where you can ask questions and have them answered by Microsoft MVPs, authors, and other experts.

And don't overlook the online tools provided by Microsoft. Choose Help --> Technical Support to access a wealth of information available on the Web, right from inside Visual Studio.

post from sitemap

Looking at the C Language

Each program must have a starting point. When you run a program, DOS sends it off on its way — like launching a ship. As its last dock-master duty, DOS hurls the microprocessor headlong into the program. The microprocessor then takes the program's helm at that specific starting point.

In all C programs, the starting point is the main() function. Every C program has one, even GOODBYE.C (shown in Figure 1). The main() function is the engine that makes the program work, which displays the message on the screen.


Figure 1: GOODBYE.C and its pieces and parts.

Other C programs may carry out other tasks in their main() function. But whatever's there, it's the first instruction given to the computer when the program runs.

  • main() is the name given to the first (or primary) function in every C program. C programs can have other functions, but main() is the first one.
  • It's a common convention to follow a C language function name with parentheses, as in main(). It doesn't mean anything. Everyone does it, and it's included here so that you don't freak when you see it elsewhere.
  • In Borland C++, you may have seen the error message say "in function main." This message refers to the main function — the void main() thing that contains the C language instructions you've been writing.
  • A function is a machine — it's a set of instructions that does something. C programs can have many functions in them, though the main function is the first function in a C program. It's required.

Function. Get used to that word.

Pieces' parts

Here are some interesting pieces of the C program shown in Figure 1:

1. #include is known as a preprocessor directive, which sounds impressive, and it may not be the correct term, but you're not required to memorize it anyhow. What it does is tell the compiler to "include" another program or file along with your source code, which generally avoids a lot of little, annoying errors that would otherwise occur.

2. <stdio.h> is a filename hugged by angle brackets (which is the C language's attempt to force you to use all sorts of brackets and whatnot). The whole statement #include <stdio.h> tells the compiler to use the file STDIO.H, which contains standard I/O, or input/output, commands required by most C programs.

3. void main identifies the name of the function main. The void identifies the type of function or what the function produces. In the case of main, it doesn't produce anything, and the C term for that is "void."

4. Two empty parentheses follow the function name. Sometimes, there may be items in these parentheses.

5. The curly brackets or braces enclose the function, hugging in tight all its parts. Everything between { and } is part of the function main() in Figure 1.

6. printf is a C language instruction, part of the programming language that eventually tells the computer what to do.

7. Belonging to printf are more parentheses. In this case, the parentheses enclose text, or a "string" of text. Everything between the double quotes (") is part of printf's text string.

8. An interesting part of the text string is \n. That's the backslash character and a little n. What it represents is the character produced by pressing the Enter key. What it does is to end the text string with a "new line."

9. Finally, the printf line, or statement, ends with a semicolon. The semicolon is how the C compiler knows when one statement ends and another begins — like a period at the end of a sentence. Even though printf is the only instruction in this program, the semicolon is still required.

• Text in a program is referred to as a string. For example, "la-de-da" is a string of text. The string is enclosed by double quotes.

• The C language is composed of keywords that appear in statements. The statements end in semicolons, just as sentences in English end in periods.)

The C language itself — the keywords

The C language is really rather brief. There are only 33 keywords in C. If only French were that easy! Table 1 shows the keywords that make up the C language.

Table 1: C Language Keywords

asm

enum

signed

auto

extern

sizeof

break

float

static

case

for

struct

char

goto

switch

const

if

typedef

continue

int

union

default

long

unsigned

do

register

void

double

return

volatile

else

short

while

Not bad, eh? But these aren't all the words you find in the C language. Other words or instructions are called functions. These include jewels like printf and several dozen other common functions that assist the basic C language keywords in creating programs.

If you're using DOS, additional functions specific to DOS are piled on top of the standard C armada of functions. And if you get into Windows, you find hoards of Windows-specific functions that bring C's full vocabulary into the hundreds. And no, you don't really have to memorize any of them. This is why all C compilers come with a language reference, which you'll undoubtedly keep close to your PC's glowing bosom.

Languages are more than a collection of words. They also involve grammar, or properly sticking together the words so that understandable ideas are conveyed. This concept is completely beyond the grasp of the modern legal community.

In addition to grammar, languages require rules, exceptions, jots and tittles, and all sorts of fun and havoc. Programming languages are similar to spoken language in that they have various parts and lots of rules.

  • You will never be required to memorize the 33 keywords.
  • In fact, of the 33 keywords, you may end up using only half on a regular basis.
  • Some of the keywords are real words! Others are abbreviations or combinations of two or more words. Still others are cryptograms of the programmer's girlfriends' names.
  • Each of the keywords has its own set of problems. You don't just use the keyword else, for example; you must use it in context.
  • Functions like printf require a set of parentheses and lots of stuff inside the parentheses. (Don't fret over this right now; just nod your head and smile in agreement, "Yes, printf does require lots of stuff.")
  • By the way, the fact that printf is a C function and not a keyword is why the #include <stdio.h> thing is required at the beginning of a program. The STDIO.H file contains the instructions telling the compiler what exactly printf is and does. If you edit out the #include <stdio.h> line, the compiler produces a funky "I don't know that printf thing" type of error.
post from sitemap

Working with Functions in C++

Developers often need the ability to break programs up into smaller chunks that are easier to develop. "Real world" programs can be many of thousands (or millions!) of lines long. Without this ability to divide the program into parts, developing such large programs would quickly become impossible.

C++ allows programmers to divide their code up into chunks known as functions. A function with a simple description and a well-defined interface to the outside world can be written and debugged without worrying about the code that surrounds it.

Overloading function names

C++ allows the programmer to assign the same name to two or more functions. This multiple use of names is known as overloading functions or, simply, overloading.

In general, two functions in a single program cannot share the same name. If they did, C++ would have no way to distinguish them.

However, the name of the function includes the number and type of its arguments. (The name of the function does not include its return argument.) Thus, the following are not the same functions:

void someFunction(void)
{
// ....perform some function
}
void someFunction(int n)
{
// ...perform some different function
}
void someFunction(double d)
{
// ...perform some very different function
}
void someFunction(int n1, int n2)
{
// ....do something different yet
}

C++ still knows that the functions someFunction(void), someFunction(int), someFunction(double), and someFunction(int, int) are not the same. Like so many things that deal with computers, this has an analogy in the human world.

void as an argument type is optional. sumFunction(void) and sumFunction() are the same function. A function has a shorthand name, such as someFunction(). As long as we use the entire name, no one gets confused — no matter how many someFunctions there may be. The full name for one of the someFunctions()is someFunction(int). As long as this full name is unique, no confusion occurs.

A typical application may appear as follows:

int intVariable1, intVariable2; // equivalent to
// int Variable1;
// int Variable2;
double doubleVariable;
// functions are distinguished by the type of
// the argument passed
someFunction(); // calls someFunction(void)
someFunction(intVariable1); // calls someFunction(int)
someFunction(doubleVariable); // calls someFunction(double)
someFunction(intVariable1, intVariable2); // calls
// someFunction(int, int)
// this works for constants as well
someFunction(1); // calls someFunction(int)
someFunction(1.0); // calls someFunction(double)
someFunction(1, 2); // calls someFunction(int, int)

In each case, the type of the arguments matches the full name of the three functions.

The return type is not part of the extended name (also known as the function signature) of the function. The following two functions have the same name and, thus, cannot be part of the same program:

int someFunction(int n); // full name of the function
// is someFunction(int)
double someFunction(int n); // same name

The following is acceptable:

int someFunction(int n);
double d = someFunction(10); // promote returned value

The int returned by someFunction() is promoted into a double. Thus, the following would be confusing:

int someFunction(int n);
double someFunction(int n);
double d = someFunction(10);// promote returned int?
// or use returned double as is

C++ would know whether to use the value returned from the double version of someFunction() or promote the value returned from int version.

Defining function prototypes

The programmer may provide the remainder of a C++ source file, or module, the extended name (the name and functions) during the definition of the function.

A function may be defined anywhere in the module. (A module is another name for a C++ source file.) However, something has to tell main() the full name of the function before it can be called. Consider the following code snippet:

int main(int argc, char* pArgs[])
{
someFunc(1, 2);
}
int someFunc(double arg1, int arg2)
{
// ...do something
}

The call to someFunc() from within main() doesn't know the full name of the function. It may surmise from the arguments that the name is someFunc(int, int) and that its return type is void; however, as you can see, this is incorrect.

C++ could be less lazy and look ahead to determine the full name of someFunc()s on its own, but it doesn't. What is needed is some way to inform main() of the full name of someFunc() before it is used. What is needed is a before use function declaration. Some type of prototype is necessary.

A prototype declaration appears the same as a function with no body. In use, a prototype declaration appears as follows:

int someFunc(double, int);
int main(int argc, char* pArgs[])
{
someFunc(1, 2);
}
int someFunc(double arg1, int arg2)
{
// ...do something
}

The prototype declaration tells the world (at least that part of the world after the declaration), that the extended name for someFunc() is someFunction(double, int). The call in main() now knows to cast the 1 to a double before making the call. In addition, main() knows that the value returned by someFunc() is an int.

A function call that returns a value is an expression. As with any other provide expression, you are allowed to throw the value returned by a function.

Variable storage types

Function variables are stored in three different places. Variables declared within a function are said to be local. In the following example, the variable localVariable is local to the function fn():

int globalVariable;
void fn()
{
int localVariable;
static int staticVariable;
}

The variable localVariable doesn't exist until the function fn() is called. localVariable ceases to exist when the function returns. Upon return, whatever value that is stored in localVariable is lost. In addition, only fn() has access to localVariable — other functions cannot reach into the function to access it.

By comparison, the variable globalVariable exists as long as the program is running. All functions have access to globalVariable all of the time.

The static variable staticVariable is something of a mix between a local and a global variable. The variable staticVariable is created when execution first reaches the declaration (roughly, when the function fn() is called). In addition, staticVariable is only accessible within fn(). Unlike localVariable, however, staticVariable continues to exist even after the program returns from fn(). If fn() assigns a value to staticVariable once, it will still be there the next time that fn() is called.

In case anyone asks, there is a fourth type, auto, but today it has the same meaning as local, so just ignore them.

post from sitemap

Tackling Error Messages in Java Programming

Sometimes, error messages can strike fear into the heart of even the bravest programmer. Fortunately some helpful, calming advice is here — advice to help you solve the problem when you see one of these messages.

NoClassDefFoundError

You get this error when you're trying to run your code. So first ask yourself, did you attempt to compile the code? If so, did you see any error messages when you compiled? If you saw error messages, look for things you can fix in your .java file. Try to fix these things, and then compile the .java file again.

If you normally keep code in the JavaPrograms directory, make sure that you're still working in this JavaPrograms directory. (In Windows, make sure that the command prompt says JavaPrograms.)

Make sure you have an appropriately named .class file in your working directory. For instance, if you're trying to run a program named MyGreatProg, look for a file named MyGreatProg.class in your working directory.

Check your classpath to make sure that it contains the .class file that you need. For example, if all your Java code is in your working directory, make sure that the classpath includes a dot.

NoSuchMethodError

When you encounter this error message, check for the misspelling or inconsistent capitalization of a method name. Check the capitalization of main (not Main).

When you issue the java command (or do whatever you normally do to run a program in your environment), does the class that you're trying to run contain its own main method? If not, then find the class with the main method and run that class instead.

Cannot Resolve Symbol

If you get an error message that includes cannot resolve symbol, check the spelling and capitalization of all identifiers and keywords. Then check again.

If the unresolved symbol is a variable, make sure that this variable's declaration is in the right place. For instance, if the variable is declared in a for loop's initialization, are you trying to use that variable outside the for loop? If the variable is declared inside a block (a pair of curly braces), are you trying to use that variable outside of the block?

Finally, look for errors in the variable's declaration. If the compiler finds errors in a variable's declaration, then the compiler can't resolve that variable name in the remainder of the code.

Expected ';' (Or Expected Something Else)

When you see an error message that says ';' expected, go through your code and make sure that each statement and each declaration ends with a semicolon. If so, then maybe the compiler's guess about a missing semicolon is incorrect. Fixing another (seemingly unrelated) error and recompiling your code may get rid of a bogus ';' expected message.

For a missing parenthesis, check the conditions of if statements and loops. Make sure each condition is enclosed in parentheses. Also, make sure that a parameter list (enclosed in parentheses) follows the name of each method.

For an <identifier> expected message, check your assignment statements. Make sure that each assignment statement is inside a method. (Remember, a declaration with an initialization can be outside of a method, but each plain old assignment statement must be inside a method.)

For the 'class' or 'interface' expected message, make sure you've spelled the word class correctly. If your code has an import declaration, check the spelling and capitalization of the word import.

Missing Method Body or Declare Abstract

You get a missing method body or declare abstract message when the compiler sees a method header, but the compiler can't find the method's body. Look at the end of the method's header. If you ended the header with a semicolon, then try removing the semicolon.

If the header doesn't end with a semicolon, then check the code immediately following the header. The code immediately following the header should start with an open curly brace (the beginning of a method body). If some code comes between the header and the body's open curly brace, consider moving that code somewhere else.

An 'else' without an 'if'

Compare the number of if clauses with the number of else clauses. An if clause doesn't need to have an else clause, but each else clause must belong to an if clause.

Remember, you enclose an if condition in parentheses, but you don't put a semicolon after the condition. Did you mistakenly end an if condition with a semicolon?

Look at all the lines between an if and its else. When you find more than one statement between an if and its else, look for curly braces. If the statements between the if and its else aren't surrounded by curly braces, you may have found the culprit.

Non-static Variable Cannot Be Referenced from a Static Context

Lots of things can give you a non-static variable cannot be referenced from a static context error message. But for beginning programmers, the most common cause is having a variable that's declared outside of the main method. It's no sin to declare such a variable, but because the main method is always static, you need some special help to make the main method refer to a variable that's declared outside the main method.

The quickest solution is to put the word static in front of the variable's declaration. But first, ask yourself why this variable's declaration isn't inside the main method. If there's no good reason, then move the variable's declaration so that it's inside the main method.

FileNotFoundException (The System Cannot Find the File Specified) or EOFException

If you encounter a FileNotFoundException message, check that the file named in your code actually exists. (Look for the file using your system's explorer or using the command prompt window.) Double-check the spelling in your code against the name of the file on your hard drive.

If you've found a correctly named file on your hard drive, make sure that the file is in the correct directory. (For a program running in your working directory, a typical data file is in the working directory also.)

If you're a Windows user, make sure that the system didn't add an extra .txt extension when you created the file. (Use the command prompt window to check the file's name. Windows Explorer can hide the .txt extension, and that always leads to confusion.)

For an EOFException, you're probably trying to read more data than you have in the file. Very often, a small logic error makes your program do this. So do a careful review of all the steps in your program's execution. Look for subtle things, like improperly primed loops or the reading of array values past the array's largest index. Look for conditions that use <= when they should use <. Conditions like these can often be troublesome.

post from sitemap

Understanding PHP Data Types

Variables can store data of different types, and different types of data can do different things. For example, you can add variables whose values are numbers (1 + 2), but adding variables whose values are characters (a + b) doesn't make much sense.

You can store the following simple types of data in PHP variables:

  • Integer: A whole number (no fractions), such as –43, 0, 1, 27, or 5438. The range of integers that is allowed varies, depending on your operating system, but in general, you can usually use any number from –2 billion up to +2 billion.
  • Floating point number: A number (usually not a whole number) that includes decimal places, such as 5.24 or 123.456789. This is often called a real number or a float.
  • Character string: A series of single characters, such as hello. There is no practical limit on the length of a string.
  • Boolean: A TRUE or FALSE value.

Boolean data types represent two possible states — TRUE or FALSE. Boolean values are used mainly to compare conditions for use in conditional statements. For example, PHP evaluates an expression, such as $a > $b, and the outcome is either TRUE or FALSE.

PHP considers the following values FALSE :

  • The string FALSE (can be upper- or lowercase)
  • The integer 0
  • The float 0.0
  • An empty string
  • The one-character string 0
  • The constant NULL

Any other values in a Boolean variable are considered TRUE. If you echo a Boolean variable, the value FALSE displays as a blank string; the value TRUE echoes as a 1. Functions often return a Boolean variable that you can test to see whether the function succeeded or failed.

Assigning data types

Most other languages require that you initialize the variable before using it, specifying what type of data it can hold, but PHP is more informal. You don't need to tell PHP which data type is in a variable. PHP evaluates the data when you assign it to the variable and then stores it as the appropriate type. Generally, this is helpful. PHP guesses the data type pretty accurately.

PHP also converts data when it needs to be converted. For example, if you have the following statements, PHP converts the data types with no problem:

$firstNumber = 1; # PHP stores it as an integer
$secondNumber = 1.1; # PHP stores it as a float
$sum = $firstNumber + $secondNumber;

Technically, the third statement is not possible because the data to be added are different types. However, PHP converts the integer to a float so that the addition proceeds smoothly. This happens automatically and invisibly and is very helpful.

Type casting

On a rare occasion, PHP guesses badly when it stores the data. You might need to do something with a variable, and PHP won't let you because the data is the wrong type. In such a case, you can specify how you want PHP to store the data, rather than let PHP decide for itself. This is called type casting. To specify a particular type, use a statement like one of the following:

$newint = (int) $var1;
$newfloat = (float) $var1;
$newstring = (string) $var1;

The value in the variable on the right side of the equal sign is stored in the variable on the left side as the specified type. So the value in $var1 is stored in $newint as an integer, as specified by (int).

Be careful when doing type casts. Sometimes you can get unexpected results. For example, when you cast a float into an integer, it loses its decimal places. To do this, PHP rounds the float toward 0. For example, if $number = 1.8 and you cast it into an integer — $newnumber = (int) $number$newnumber will equal 1.

You can find out the data type of a variable by using a statement like the following:

var_dump($myvariable);

For example, the following statement checks the data type of $checkvar:

var_dump($checkvar);

The output from this statement is int(27), which tells you that $checkvar contains the integer 27.

post from sitemap

Designing Video Games

A video game is more than the sum of its pieces; a game has a synergy that, after the game is complete, makes it something unique. Creating this synergy takes a lot of technical know-how, as well as a sense of design and art. Basically, you need to be a Leonardo da Vinci and an Albert Einstein all in one.

The basic sequence of game design is as follows:

  • Come up with an idea for a game.
  • Create storyboards and rough sketches of your game world, the main characters, and the action.
  • List the details of your game and take into consideration everything about the game "universe."
  • Finally, put these concepts all together into a design document, something like a movie script that contains everything about your game.

Developing an idea

Before you write a game, you need an idea — a story, something to start with. Brainstorm and come up with an idea for a game; the idea should be loosely based on something that has at least a fleeting resemblance to a story. Then you need to come up with the goals of the game. Ask yourself questions such as "What will the player do?" and "How will the player do it?"

Maybe you're wondering, "Where do I get ideas for games?" Well, you can't tap into any magical formulas, but you can look in a few places:

  • Other games: Don't copy another game, of course, but improving and taking a new perspective within the game is fine.
  • Movies and videos: Watch as many sci-fi movies as possible and see if you can come up with a game based on some of their ideas and content. Of course, you need to get permission from the filmmaker if you use any characters or story lines from those movies.
  • Real-life games: You can take a game such as hockey and make a computer version of it, or make a futuristic version of it.
  • Dreams and nightmares: This technique is a gold mine; in your mind, you can try anything out. Go to sleep thinking about games, demons, monsters, or whatever, and hopefully, you will have a killer dream that gives you an idea for a game.

After you have your game ideas, then you need to outline the story.

Storyboarding

One of the best ways to see a game is to storyboard it — to create a sequence of drawings that show the levels of the game or the different scenes and goals. Each storyboard should include a paragraph or two to describe what is going on. Figure 1 depicts a basic storyboard for an imaginary shoot-'em-up game.


Figure 1: A typical game storyboard.

As you can see, the storyboard has six frames; each frame represents a different level of the game, and the final frame is the goal. Notice that the storyboards are sketched and messy. Storyboard sketches are used only for brainstorming and for getting down on paper the general flow of the game.

Considering the details

After you create storyboards, you write the details of the game design. This stage is where the process gets complex. You have to think of every possible detail and write something about it — because when you make your game, you are a god — well, at least a demigod. If you don't program a specific detail, it's not going to happen.

You need to figure out all the rules and the structure of the game. For example, here's a list of questions to consider:

  • What can the game character do? Can he or she fly, swim, and teleport?
  • How many different enemies will the hero fight?
  • What kind(s) of weapons are available?
  • How does the player get rejuvenated?
  • Can more than one player play at once? If so, what are the ramifications of this?
  • Will the game's perspective be a side view, top view, or first-person and full 3-D view?
  • What kind of sound track? Rock, rap, techno?
  • What is the personality of the main character?

These examples are just some of the details you need to think about. The key here is to create the characters, rules, laws, and goals of your game universe in as much detail as possible. That's necessary because you're going to generate the artificial universe they all exist in. The more detail you include, the better the game will be.

Constructing a design document

After you have all the storyboards and details of the game written down, create a design document. The goal of the document is to record all your ideas in a format that resembles a movie script. Creating the document is a housekeeping step, but it gives you another chance to change your mind, see if some rule or event is totally stupid, or add another game element.

The result of developing the design document is that your imaginary world becomes more vivid in your mind. When you start talking to yourself about the stuff that is happening in your game, when your imaginary world is so thick with texture and so alive with detail that you can see it, then writing a game around it is much easier, because you aren't making things up as you go. Having a clear picture of a game's world is one of the most important issues in game design.

The universe you create must be coherent; it must be well thought out enough to hang together about as well as the universe we live in (or better). If your game universe is coherent, the players will lose themselves in it; they will experience a suspension of disbelief and really have fun. On the other hand, if you come up with a half-baked idea and then wing it as you go, your game ends up looking thrown together, which doesn't invite belief. Without thought or planning, you won't pull the players into your world, and they won't play your game!

After you have a design document in hand, you're in a far better position to create a solid game. As you work on the game, you won't be tempted to impulsively add elements that are inappropriate or out of place in your game's world.

Don't misunderstand. Changing and adding to your design is acceptable, but make sure all the elements work well together. If players aren't distracted by inconsistencies in your game's universe, they can be fully involved with the characters and situations.

post from sitemap

Declaring Variables in C

Variables are what make your programs zoom. Programming just can't get done without them. So if you haven't been introduced to variables yet, here you go.

Valerie Variable is a numeric variable. She loves to hold numbers — any number; it doesn't matter. Whenever she sees an equal sign, she takes to a value and holds it tight. But see another equal sign, and she takes on a new value. In that way, Valerie is a little flaky. You could say that Valerie's values vary, which is why she's a variable.

Victor Variable is a string variable. He contains bits of text — everything from one character to several of them in a row. As long as it's a character, Victor doesn't mind. But which character? Victor doesn't care — because he's a variable, he can hold anything.

  • Yes, there is a point here. There are two main types of variables in C: numeric variables that hold only numbers or values, and string variables that hold text, from one to several characters long.
  • There are several different types of numeric variables, depending on the size and precision of the number.
  • Before you use a variable, it must be declared. This is — oh, just read the next section.

"Why must I declare a variable?"

You are required to announce your variables to the C compiler before you use them. You do this by providing a list of variables near the beginning of the program. That way, the compiler knows what the variables are called and what type of variables they are (what values they can contain). Officially, this process is known as declaring your variables.

For example:

int count;
char key;
char lastname[30];

Three variables are declared here: an integer variable, count; a character variable, key; and a character variable, lastname, which is a string that can be as many as 30 characters long.

Doing this at the beginning of the program tells the compiler several things. First, it says, "These things are variables!" That way, when the compiler sees lastname in a program, it knows that it's a string variable.

Second, the declarations tell the compiler which type of variable is being used. The compiler knows that integer values fit into the count variable, for example.

Third, the compiler knows how much storage space to set aside for the variables. This can't be done "on the fly" as the program runs. The space must be set aside as the compiler creates the program.

  • Declare your variables near the beginning of your program, just after the line with the initial curly bracket. Cluster them all up right there.
  • Obviously, you won't know all the variables a program requires before you write it. (Although they teach otherwise at the universities, such mental overhead isn't required from you.) So, if you need a new variable, use your editor to declare it in the program. Rogue variables generate syntax or linker errors (depending on how they're used).
  • If you don't declare a variable, your program does not compile. The proper authorities issue a suitable complaint message.
  • Most C programmers put a blank line between the variable declarations and the rest of the program.
  • There's nothing wrong with commenting a variable to describe what it contains. For example:

int count; /* busy signals from tech support. */

  • However, cleverly named variables may avoid this situation:

int busysignals;

Variable names verboten and not

What you can name your variables depends on your compiler. There are a few rules, plus some names you cannot use for variables. When you break the rules, the compiler lets you know by flinging an error at you. To avoid that, try to keep the following guidelines in the back of your head when you create new variables:

  • The shortest variable name is a letter of the alphabet.
  • Use variable names that mean something. Single-letter variables are just hunky-dory. But index is better than i, count is better than c, and name is better than n. Short, descriptive variable names are best.
  • Variables are typically in lowercase. (All of C is lowercase for the most part.) They can contain letters and numbers.
  • Uppercase letters can be used in your variables, but most compilers tend to ignore the differences between upper- and lowercase letters. (You can tell the compiler to be case-sensitive by setting one of its options; refer to your programmer's manual.)
  • You should not begin a variable name with a number. They can contain numbers, but you begin it with a letter.
  • C lords use the underline, or "underscore," character in their variable names: first_name, zip_code, and so on. This technique is fine, though it's not recommended to begin a variable name with an underline.
  • Avoid naming your variables the same as C language keywords or functions. Don't name your integer variable int, for example, or your string variable char. This may not generate an error with your compiler, but it makes your source code confusing.
  • Also avoid using the single letters l (lowercase L) and o (lowercase O) to name variables. Little L looks too much like a 1 (one), and O looks too much like a 0 (zero).
  • Don't give similar names to your variables. For example, the compiler may assume that forgiveme and forgivemenot are the same variable. If so, an ugly situation can occur.
  • Buried somewhere in one of the massive tomes that came with your compiler are the official rules for naming variables. These rules are unique to each compiler.
post from sitemap