肖恩D++
Not Equal C && !=C && 不等于西-
终于三字头了
Posted on November 2nd, 2011 Add comments到了,这一天终于到了。终于告别了二字头,迎来了三字头。无忧无虑的打酱油时代终于要结束了,据说随之而来的就是要变成让别人打酱油的了。实在不知是做何感想,扪心自问……
顺便发现了个有趣的现象,今天的日期写起来正好是对称的:“20111102” (2011-11-02),并且用欧美格式书写,恰好也是对称的:“11022011” (11/02/2011)
198 views
-
Create XML Comments for Custom Function in VIsual Studio 2010
Posted on September 25th, 2011 Add commentsIf you need to add your custom comments for your function, including function summary, parameter description, return value etc., just add “///” right before your function, then VS will generate XML layout for you.
123456789/// <summary>////// </summary>/// <param name="para"></param>/// <returns></returns>public bool YourFunction(int para){//Code here}After finish comments, enable “XML Documentation” option for your project:
- Open project property
- Go to “Build” tab
- Check “Xml documentation file”
- Build project, then check the XML comments in other project
418 views
-
Install Linksys Wireless PCI Adapter(WMP54G) Driver for Windows 7 64Bit
Posted on August 21st, 2011 Add commentsSeems like linksys doesn’t provide wireless PCI adapter driver for new Windows OS. The only way to install driver for Windows 7 is force to install the driver from the chip company.
- Download the driver from Here
- Unzip to somewhere. Let’s say “C:\”
- Go to “Control Panel” -> “Device Manager”, look for this adapter. Normally it will be shown like “Unknown Network Controller” or something like that
- Click this device, select “Update Driver Software”
- Select “Browse My Computer for driver software”
- Select “Let me pick from a list of device drivers on my computer”
- Scroll down to “Network Adapters” and double click. Then click “Have Disk”
- In the box that pops up, navigate to “C:\driver_folder”, and select the driver file
- Scroll down to “Ralink Technology Corp” in the box on the left side. On the right side, select “802.11b/g Wireless Adapter.” (Here I have tried select “Linksys” on the left, and “Linksys Wireless Adapter” on the right. It also works! Just choose whatever you want)
- Click YES on the warning window (if you see it)
- Done! (Sometimes the device still might not be working, try to right click the device and uninstall the driver, but DO NOT check “Delete the driver software for this device”, and restart the computer. Then Windows will help you install the driver again)
1,023 views
-
One Script to Backup All SQL Databases
Posted on August 15th, 2011 Add commentsIt’s a nightmare for backup your DB if you have 100+ DB’s in SQL server. Just simply run a script while you taking a coffee:
12345678910111213141516171819202122232425262728DECLARE @name VARCHAR(50) -- database nameDECLARE @path VARCHAR(256) -- path for backup filesDECLARE @fileName VARCHAR(256) -- filename for backupDECLARE @fileDate VARCHAR(20) -- used for file nameSET @path = "C:\Backup"SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)DECLARE db_cursor CURSOR FORSELECT nameFROM master.dbo.sysdatabasesWHERE name NOT IN ('master','model','msdb','tempdb')--skip system database (optional)OPEN db_cursorFETCH NEXT FROM db_cursor INTO @nameWHILE @@FETCH_STATUS = 0BEGINSET @fileName = @path + @name + '_' + @fileDate + '.BAK'BACKUP DATABASE @name TO DISK = @fileNameFETCH NEXT FROM db_cursor INTO @nameENDCLOSE db_cursorDEALLOCATE db_cursor
263 views
-
20 Habits That Make You Fat (for the record)
Posted on August 9th, 2011 Add comments- Eating “low-fat”
Typically, they save you only a few calories and, in doing so, they replace harmless fats with low-performing carbohydrates that digest quickly—causing a sugar rush and, immediately afterward, rebound hunger. - Not seeking nutrition advice
When Canadian researchers sent diet and exercise advice to more than 1,000 people, they found that the recipients began eating smarter and working more physical activity into their daily routines. - Sleeping too little or too much
According to Wake Forest researchers, dieters who sleep five hours or less put on 2½ times more belly fat, while those who sleep more than eight hours pack on only slightly less than that. Shoot for an average of six to seven hours of sleep per night—the optimal amount for weight control. - Eating free restaurant foods
Every time you eat one of Olive Garden’s free breadsticks or Red Lobster’s Cheddar Bay Biscuits, you’re adding an additional 150 calories to your meal. Eat three over the course of dinner and that’s 450 calories. That’s also roughly the number of calories you can expect for every basket of tortilla chips you get at your local Mexican restaurant. - Drinking soda—even diet
Because a 2005 study found that drinking one to two sodas per day increases your chances of being overweight or obese by nearly 33 percent. And diet soda is no better. - Skipping meals
The problem is, skipping meals actually increases your odds of obesity, especially when it comes to breakfast. Skipping meals slows your metabolism and boosts your hunger. That puts your body in prime fat-storage mode and increases your odds of overeating at the next meal. - Eating too quickly
A study in the Journal of the American Dietetic Association found that slow eaters took in 66 fewer calories per meal, but compared to their fast-eating peers, they felt like they had eaten more. - Watching too much TV
A University of Vermont study found that overweight participants who reduced their TV time by just 50 percent burned an additional 119 calories a day on average. That’s an automatic 12-pound annual loss! - Ordering the combo meal
Because when you order items bundled together, you’re likely to buy more food than you want. You’re better off ordering your food piecemeal. That way you won’t be influenced by pricing schemes designed to hustle a few more cents out of your pocket. - Facing the buffet
Cornell researchers found that when eating at a buffet-style restaurant, obese diners were 15 percent more likely to choose seats with a clear view of the food. - Eating off larger plates
One study found that when given an option, a whopping 98.6 percent of obese individuals opt for larger plates. Translation: More food, more calories, and more body fat. - Putting serving dishes on the table
A study in the journal Obesity found that when food is served from the dinner table, people consume 35 percent more over the course of the meal. When an additional helping requires leaving the table, people hesitate to go back for more. - Choosing white bread
A study from the American Journal of Clinical Nutrition found that when obese subjects incorporated whole grains into their diets, they lost more abdominal fat over the course of 12 weeks. - Taking big bites
The American Journal of Clinical Nutrition found that people who took large bites of food consumed 52 percent more calories in one sitting than those who took small bites and chewed longer. By cutting food into smaller pieces, you can increase satiety and enjoy your food more thoroughly. - Not drinking enough water
In one University of Utah study, dieting participants who were instructed to drink two cups of water before each meal lost 30 percent more weight than their thirsty peers. And you can magnify the effect by adding ice. German researchers found that six cups of cold water a day could prompt a metabolic boost that incinerates 50 daily calories. - Having overweight friends
Research from the New England Journal of Medicine indicates that when a friend becomes obese, it ups your chance of obesity by 57 percent. - Eating too late
A new study in the journal Obesity looked at the sleeping and eating habits of 52 people over seven days, and it found that those who ate after 8 p.m. took in the most daily calories and had the highest BMIs. - Not using a scale
When University of Minnesota researchers observed dieters who weighed themselves daily, they discovered that the routine of stepping on a scale helped those people lose twice as much weight as those who weighed themselves less frequently. - Drinking fruity beverages
As a general rule, the more garnishes a drink has hanging from its rim, the worse it is for your waistline. - Eating when emotional
A study from the University of Alabama found that emotional eaters—those who admitted eating in response to emotional stress—were 13 times more likely to be overweight or obese.
335 views - Eating “low-fat”
Recent Comments