PHP code calculate the number of days in a month

I want to calculate the number of days for each month in a website application, there is no an existent function in PHP for getting this number, belowI write a simple function  to get the number of days for a month:

function get_day_number($year, $month){
  if($month == 1 || $month == 3 || $month == 5 || $month == 7 || $month == 8 || $month == 10 || $month == 12)
   return 31;
  if($month == 4 || $month == 6 || $month == 9 || $month == 11)
   return 30;

  return (($year %4==0 && $year %100!=0) || ($year %400==0)) ? 29:28;
}

Posted in Code Snippet | Leave a comment

Hiwtc classroom–How a Wireless Mouse Works

Hiwtc classroom–How a Wireless Mouse Works

The mouse is an extremely popular technology to interact with your computer. While the majority of mice are connected directly to the computers peripheral input via a cord and are powered by the computers main power, wireless mice are becoming extremely popular to give computer users cordless accessibility to their mice and to interact with their computer.

Wireless Mouse Technology
Wireless mice usually work via radio frequencies commonly referred to as RF. RF wireless mice require two components to work properly a radio transmitter and a radio receiver.

RF Transmitter
A radio frequency (RF) transmitter is usually integrated inside the mouse. The mouse records its movements and buttons that are clicked and then sends this information via radio signals to the receiver.

RF Receiver
The radio frequency (RF) receiver usually connects to the computer’s peripheral mouse input. It receives these RF signals, decodes them and then sends these signals directly to the computer as normal. RF receivers usually come in a few styles. The majority come as built in components that connect to the mouse input, others can be a separate card that is installed in one of the many expansion slots of computers and the third type of receiver is a separate unit that is then connected to a cable going directly to the computer’s peripheral input. Since the technology has been mastered, most wireless mice have integrated receivers that plug into a computer’s peripheral input and are very small in size.
RF Frequencies
802.11b and 802.11g
Wireless mice mainly use Radio frequencies to transmit data from the mouse to the computer. The most common type of RF used is the 802.11b or 802.11g. These frequencies operate at 2.4 gigahertz and at these frequencies a mouse can transfer data at pretty quick speeds, usually either 11 Mbps or 56 Mbps. 2.4 gigahertz frequencies are very stable and usually have little or no interference in a work or home environment. They also have a decent range of about 100 to 150 feet which is more than enough for mouse operation.

Bluetooth RF
Another technology that is emerging and now beginning to be used in large numbers for wireless mice is Bluetooth RF technology. Bluetooth is commonly known to connect computers to peripherals such as keyboards, printers, PDA’s, and headsets. Bluetooth is similar to 802.11b and 802.11g in that it uses 2.4 gigahertz frequencies, however, it also uses software called adaptive frequency hopping to choose frequencies that have no or little interference. Sometimes 802.11b and g can receive interfere from home appliances such as microwave ovens and cordless telephones. Bluetooth also has decent range, usually about 33 feet.

Advantages of Wireless Mice
RF wireless mice are a great technology because of their overall reliability and stability. Other forms of communication such as Infrared technology need to be in “line of sight” in order to work properly which makes using them with a mouse impractical.

Some of the reasons that RF technology is great for wireless mice includes the fact that the RF transmitter housed in the mouse requires low power. Usually, RF wireless mice are powered by small, light weight batteries that are either disposable or usually rechargeable with an included recharging dock.

RF wireless mice are also inexpensive. You can usually purchase a wireless mice for less than $50 and even as low as $25. RF wireless mice are lightweight, so it means you can move them comfortable and easily.

As with most mice on the market today, wireless mice use optical sensor technology rather than the earlier track-ball system. Optical technology iproves accuracy and lets you use the wireless mouse on almost any surface — an important feature when you’re not tied to your computer by a cord.

Three Types of Wireless Mice
Today, there are three different mice technologies, mechanical, optical and laser. Mechanical mice use a small rubber ball to calculate distance and position. However these mice are very rarely manufactured anymore due to the fact that they get dirty easily and are slow to process information.

Optical mice are the de facto standard for mice today; they use optical light to calculate distance and position. They are extremely inexpensive, extremely reliable and process information quickly.

A new technology that is out is Laser Mice. Instead of optical light, they use laser light to precisely calculate movement and position. They are extremely precise, reliable and process information extremely quick. Most gamers use Laser Mice because of their high performance. However they are much more expensive than optical mice.

Security and Mouse Set Up
Pairing
Pairing is the process of coordinating your mouse’s transmitter with your mouse’s receiver. It requires both parts to operate on the same frequencies, usually by using the same identification code. Pairing takes place to try to eliminate interference. Some devices automatically pair both devices at start up; others need to be manually paired.

Security
Security is always an issue when you are sending information over the air. Most mice effectively secure your information by encrypting data. Other methods can include frequency hopping to prevent hacking or eavesdropping.

Posted in Uncategorized | Leave a comment

A raised floor for your new data center–really?

When it comes to designing efficient data centers you rely on experts, but behind the scenes those experts don’t always agree. Certain religious wars continue to be debated. One is the age-old AC versus DC for power distribution.

Another has to do with the use of raised floors.

Data center managers may think about raised floor designs as part and parcel of hot-aisle/cold-aisle designs but it doesn’t have to be that way, says KC Mares, president and chief energy officer at Megawatt Consulting, which has consulted on the design of some very large data centers (Mares also commented on I/O Data Center’s use of ice balls to cool its Phoenix data center).

“We use concrete slab,” says Mares. “We can serve overhead more efficiently at a lower construction cost and it’s more adaptable over time.” Concrete slab designs cost less to own and operate, he says. “That’s why the majority of big enterprises are going to no raised floor.”

Posted in Uncategorized | Leave a comment

Do you know–When settings meet reality, reality always wins

Do you know–When settings meet reality, reality always wins

It’s late at night and the office is empty, but this business analyst pilot fish is still at work creating a report that a customer needs by the next morning.

“The customer gave us a list of items to show on the report,” fish says. “In order to make them all fit, I had to change the report orientation to landscape. Still all of the fields wouldn’t quite fit, so I changed the paper size to legal.

“Once I had the information correct and had it looking good on the monitor, I then went to print it out. I walked over to the large printer, which is located by the secretary and is used by many users.”

This printer has a big 2,000-sheet tray that usually holds letter-size paper, along with two 500-sheet trays, one for letter and for one legal. And the trays have moving slides inside to adjust for paper size, so the printer knows to pull paper from the correct trays when it gets letter- or legal-size print requests.

Fish is sure he specified legal. But when he gets to the printer, his page has been printed on letter-size paper, and the right side has been cut off.

He walks back to his desk and checks the printer settings. Everything says legal. He prints the page again, and walks back to the printer.

But it’s the same result: Letter paper and a lost right-hand side of the report.

Fish starts working his way through the printer’s menu. It confirms that tray 2 is legal-size paper.

Back at his desk, fish sets up the print job to override the printer’s autodetect setting and pull paper from tray 2. He prints again and heads for the printer.

Same result: Letter paper with the right side of his report cut off.

“Finally I open tray 2,” says fish. “I find that the tray is indeed set for legal paper. But someone put letter-size paper in and didn’t resize the tray!”

Posted in Uncategorized | Leave a comment

HomeHardware–Sellwell Branded External CD/DVD Drive

 

The Sellwell NC10 is not fitted with a built in CD/DVD drive and this can make installing applications, games and playing movies more than a bit awkward. Fortunately it’s possible to purchase an external CD/DVD drive that connects to your NC10 using it’s USB ports. Some of these drives are also capable of burning DVDs & CDs. They often require two USB ports to give them the power needed, in a similar fashion to external hard drives. Make sure you’ve installed the drivers that come with your drive before youve connected it. It pays to follow the instructions on these as drivers can make things very awkward if they go wrong.

Below I’ve compiled a list of suitable external CD/DVD drives available from amazon.com and amazon.co.uk. The drives are categorised as some only support the creation of CDs. I’ve only listed slimline external drives as they are most practical for netbook users.

Posted in Uncategorized | Leave a comment

Tips of Computer Housekeeping

Computer Housekeeping

Clean Up, Speed Up My Computer

For external computer care, a can of air to blow out the keyboard and an alcohol pad to clean the keyboard and mouse are standard in my desk drawer. And NEVER use Windex or alcohol on your monitor. You will streak the optical coating and you’ll regret it forever. Only use water and a soft cloth. The Internal computer care is a little more intense and takes more time and knowledge.

1. Uninstall any 3rd-party “toolbars” and “extensions” like the Yahoo and Google search bars. These keep their own internet histories.

- Click Start > Control Panel > Add/Remove Programs
- Find the program and highlight it (i.e. AOL Toolbar)
- Click “Change/Remove” or “Remove” (whichever option appears)

2. Run the Disk Cleanup utility to get rid of unnecessary files that clutter your hard drive. (I’ve never had a file deleted that I actually needed.)

- Click Start > All Programs > Accessories > System Tools > Disk Cleanup
- It will run a calculation and show you the results
- Click OK to let it delete the files.

3. Keep your My Documents file system managed just like (hopefully) your paper file system.

- Open “My Computer”
- Create files and name them by subject (Right Click > choose “New Folder”)
- Click and drag the files into the new folders
- There are programs that offer “free file management”, but just keeping yourself organized is the best way.

4. Download and run a Spyware Removal program. My favorite is AdAware from LavaSoft. Make sure to find the Free version download.

5. Download and run a Virus protection program. I use the Free version of AVG. It does a great job and doesn’t weigh down my computer system, unlike Norton and McAfee.

6. Possibly the most important “deep cleaning” tool is a Registry Cleaner. Registries are like great big libraries and when books get out of place, error messages flash on your screen. If you ever see a.dll error, it is a registry error. Registry cleaners organize it all back into order. Finding a free one is difficult but one I have found is CCleaner. A free cleaner will never be as thorough as a purchased cleaner. They usually run around $30.

Here are a couple ‘for purchase’ cleaners that get good reviews:

UniBlue Registry Booster
RegistryEasy.com

7. There are also programs that will offer to “delete internet history free”, but why download yet another program to do something easily yourself? Because of the many different browsers available, I won’t list them all here, but a few of the most used browsers are:

Firefox – The best way to keep your hard drive clean is to install Firefox and leave Internet Explorer behind.

1. Open the FireFox web browser.
2. On the main menu, select Tools > Options > Privacy

Click “Clear All”

Internet Explore will allow you to manually remove some of your browsing history information, but there will still be traces of browsing history which professionals could quickly locate.

1. Click Tools > Internet Options > General
2. Click “Delete Files,” then “OK”, Click “Delete Cookies,” then “OK”,

Click “Clear History” then “Yes.”

America Online browser is based on Microsoft Internet Explorer. In addition to the information above, here are specific steps to clear your AOL browsing history:

1. Click “settings” from the set of buttons at the top of the AOL window.
2. Click “preferences.”
3. Click “toolbar and sounds.”
4. Click “clear history trail now.”

Other Browsers offer similar functions; investigate their menus thoroughly.

How to Backup Computer Files

It seems like your computer is the all important tool, until you lose your files and you realize the computer is just the box that held the important stuff. You MUST backup computer files on a regular basis. And there are many methods to accomplish this. I’ll list them here, you choose 1, 2, or more, and then make it a priority to put your choice into action!

1a) Manually back up your files to an external USB flash drive. These are inexpensive, they come in lots of gig sizes, and by far the best one is the SanDisk because it has an “onboard back up program” as a service to you.

At NewEgg.com, in the search box, type SanDisk USB flash drive. Find one with the approximate Gigabytes you will need, and buy it.

1b) When you put the SanDisk into your computer, notice a program that will try to open called “CruzerSync”. Click it, enter a username and password, and now choose which files you want it to back up regularly.

2) Purchase an external hard drive which usually come with TONS of gigs of space. (Also at NewEgg or a local store.) This is the method I use. I paid about $150 for it 3 years ago, and it works like a charm. I plug it into my computer. The “My Computer” section sees it, and I simply click and drag “My Documents, My Pictures, My Music” to the “external hard drive”. It’s fast, easy, and simple. And I still have lots of room to continue adding more files.

3) Purchase an online data backup tool that will automatically securely backup your computer files every day. These usually cost approximately $50 per year. You won’t even know the backup is happening and you can tell if a file is selected for backup by a handy little checkmark icon that appears beside the filename.

One of the most popular on the market is Carbonite and I highly recommend it if an online secure data backup is your method of choice.

Windows System Restore, How To

Here is a Computer Secret that I use just once in awhile – but it’s a Biggy:

System Restore – the best thing Microsoft ever did for their customers. This will save you tremendous hours of heartache by re-setting whatever FREAK thing happened to your computer. I am a power user; I know what I am doing, and still I have to do a System Restore about every two months. Unexplainable things happen, this is how to fix them:

Windows XP Users:

1.click Start
2.All Programs
3.Accessories
4.System Tools
5.System Restore
6.Click Next

Window’s Vista Users:

1. Just type Restore into the Start menu search box, and you’ll immediately see System Restore at the top of the start menu

The dates in Bold are the most recent restore points which automatically set each time you shutdown. (Another good reason to do a system shutdown nightly.)

1.Choose a date very near to the time you discovered the problem.
2.Click Next
3.Read the screen, click Next, and trust it. It should all be fine.

If the problem still persists, choose another date slightly further back. (You can go back two months but I don’t recommend that. Inch your way back a bold-date at a time until the problem is fixed.) Warning: Sometimes System Restore doesn’t fix the problem. At that point, you will have to fix it by trial and error. Of all the times I’ve used it, it has worked 98% of the time.

See this article with live links at my blog post: http://ComputerHousekeepingTips.blogspot.com. I’m Andy Lanning from Boise, Idaho and I teach people how to use computers.

Excel Certified Expert
Word Certified Expert
20+ years computer use
15 years instructing at local college and businesses

I’m strictly a laptop owner (2) and 1 amazing Mac. My vices: I’m an Excel junkie and an Email addict. There must be a support group out there for this. Want more great tips?

Posted in Uncategorized | Leave a comment

learning on the road back to Vista

Acer laptop has been misbehaving ever since I upgraded it to Windows 7 a few weeks ago. The core issue is that the machine no longer wakes up from sleep or hibernate mode. Now the clock is ticking to either resolve it or restore the machine to its original Windows Vista factory image. She needs it back by Friday. That would be … tomorrow!

After reading Tuesday’s blog in which I described my problems upgrading an Aspire from Vista to Windows 7, Ben Rudolph, a senior manager in the Windows business group, checked in with me to see how things were going. Ben has installed Windows 7 on a quite a few older machines — he has about 60 running — and he had a few interesting tricks and inside observations you’ll want to know about if you try to move forward with a Windows 7 install on a legacy computer.

Rule #1: Your hardware may be older than you think.

I bought the computer, an Acer Aspire 5516, about a year ago, but it’s more than a year old. I bought it on closeout for $299. It uses a much earlier vintage AMD Athlon processor and a graphics processor from a line that ATI no longer manufactures. Some of those parts could be as much as four years old, Rudolph says. But, he adds, “I’ve upgraded machines that are five or six years old.” Clearly, I shouldn’t give up just yet.

While the Aspire 5516 has plenty of horsepower, memory and storage to upgrade to Windows 7 (the Windows 7 compatibility checker found no issues other than a video device driver update, which I installed to no avail), some device drivers aren’t “officially” supported by Windows 7. That doesn’t mean the newer device drivers won’t work. But that does lead us to Rule #2:

Rule 2: Don’t rely on Windows update for the latest drivers.

I made this mistake, inspecting the drivers in the device manager and allowing Windows to go out and search for the latest version. The laptop, an Acer Aspire 5516, uses ATI’s Radion Express 1200 video adapter. Windows did suggest an update, but Rudolph suggested downloading a much newer one from the ATI Web site. Apparently the Windows Update service lags behind manufacturers when it comes to including updated device drivers. Some, he says, never go through the approval process. They may work just fine. You just can’t get them from Windows Update.

So I tracked down, downloaded, and installed the updates. Unfortunately, the system still wouldn’t come back from sleep or hibernate states. Which lead me to …

Rule #3: When all else fails, do a custom install and blow everything away.

I had chosen the express install, which replaced Vista but left most of the original programs and data intact. “That’s been my go-to solution for older machines,” when nothing else works, Rudoloph says.

So I gave it a shot last night. I backed up the system data and let the Windows 7 upgrade blow everything away and perform a pristine, bottom-up install of the OS.

First the good news: I was able to recover from both hibernate and sleep mode — but I had only waited a few minutes to attempt recovery. The bad news: I left the machine on overnight and the next morning it wouldn’t recover. Subsequent attempts to revive the computer from sleep or hibernate mode also failed.

At this point I’m back to square one.

(BTW, if you do this you’d better back up the user’s guide on your Acer Laptop. The supporting documents on Acer’s Web site include only a quick start guide for the 5516. For the more in-depth user’s guide it refers the user to the PDF file on their own system — a rather silly state of affairs if you’re looking for the user guide because the laptop is not working. Or you blew it away by doing a clean install of Windows 7. Not impressed.)

Also not impressed with myself here. I broke my own rule.

Rule #4: Don’t overlook the obvious.

Readers of my previous blog post may recall that I was experiencing another issue with the integrated trackpad on the Aspire — it suddenly stopped working about two weeks after I upgraded to Windows 7. It appeared to be working properly when checked out in the Windows Control Panel Device Manager, however. As part of the troubleshooting yesterday I also updated the trackpad device driver, but as I’m sure you’ve already guessed this was a separate problem that had nothing to do with Windows 7 or device driver updates.

In reviewing the user manual I discovered that the machine has a built in hardware switch that turns off the trackpad. I don’t use the machine much so I’d never noticed the small button with a tiny finger icon imprinted upon it. Do-uh.

So where did all of this get me? I upgraded a machine that met the specs for Windows 7 but that the manufacturer would not certify as Windows 7 ready. I ran the compatibility checker, which saw nothing insurmountable. It didn’t work out. Was it a bad idea to give it a shot?

“Not necessarily,” says Rudolph. “Most Vista-era computers will upgrade to Windows 7 very easily — the vast majority will.”

But not this time. Tonight I begin the process of restoring Vista. I sure hope this is the end of it.

Posted in Uncategorized | Leave a comment

Buying a new computer versus Repairing Computer

Most of us after spending hours and hours trying to fix a broken computer will give up and buy a new one. We don’t want to spend the money to repair it because we think the cost is too high. Well, with the economy the way it is fixing your computer would be much more wise. Most computer repairs are under $100.00 and 75% are of all computer repairs are under $200.00 . Let’s see $100-$200 versus $600-1000. This is not very hard to figure out. Most computers that are 5 years our newer can can easily last 6-8 years with repairs completed and simple computer maintenance.

So don’t give up on that old machine…save some money…

Posted in Uncategorized | Leave a comment

Using Social Media to improving Search Engine Position

I have been throughly researching Facebook, Twitter, Digg and the rest of the social media as a way to promote business.

I have found so far this too be very time consuming. If you want one of the social medias to promote your website or improve search engine ranking, this is suppose to be another way to do it. But like I said above it is very time consuming. I will keep you posted as to whether this is really worth it.

I do know for a fact that YouTube in the past has pushed you up on the engines but as to Facebook and Twitter we will have to wait and see.

Charley N
E-mail:pr@hiwtc.com
Posted in Uncategorized | Leave a comment

Highest Level of Efficiency in the Computer Storage & Peripherals Industry Detected in Shares of SanDisk, Top 5 (SNDK, IMN, SYNA, NVTL, HILL)

Below are the top five most-efficient companies in the Computer Storage & Peripherals industry as ranked by Revenue Per Employee (RPE). Analysts use RPE as a measure to compare the productivity of companies in the same industry.
SanDisk (NASDAQ:SNDK) ranks first with an RPE of $1.36M; Imation (NYSE:IMN) ranks second with an RPE of $1.3M; and Synaptics (NASDAQ:SYNA) ranks third with an RPE of $0.98M.
Novatel Wireless (NASDAQ:NVTL) follows with an RPE of $0.93M and Dot Hill Systems (NASDAQ:HILL) rounds out the top five with an RPE of $0.84M.
SmarTrend is bearish on shares of HILL and our subscribers were alerted to Sell on November 03, 2009 at $1.80. The stock has fallen 41.5% since the alert was issued.

Posted in Uncategorized | Leave a comment