left join,right join,inner join,full join,cross join

June 11th, 2009 Tony hu No comments

left join   :左连接,返回左表中所有的记录以及右表中连接字段相等的记录(右表中不存在的显示NULL)。
right join :右连接,返回右表中所有的记录以及左表中连接字段相等的记录(左表中不存在的显示NULL)。
inner join: 内连接,又叫等值连接,只返回两个表中连接字段相等的行。
full join:外连接,返回两个表中的行:left join + right join (两个表中都可能出现NULL)
cross join:结果是笛卡尔积,就是第一个表的行数乘以第二个表的行数。
补充说明:如果表一中的某行对应表二中的两行记录,那么结果集中会有两条记录对应,right join也同样道理。
——————————————————————-
例子

declare @a table(a int,b int)
declare @b table(a int,b int)

insert @a values(1,1)
insert @a values(1,1)
insert @a values(2,2)
insert @b values(1,1)
insert @b values(3,3)
select * from @a
select * from @b
--左:
select * from @a Aa left join @b Bb on Aa.a=Bb.a
--右:
select * from @a Aa right join @b Bb on Aa.a=Bb.a
--内
select * from @a Aa inner join @b Bb on Aa.a=Bb.a
--外:
select * from @a Aa full join @b Bb on Aa.a=Bb.a
--交叉连接
select * from @a cross join @b

Categories: Database, Sql Server Tags: ,

在使用电脑时保护好眼睛

June 10th, 2009 Tony hu No comments

眼科医生建议PC屏幕不要用白色,因为白色对眼睛的刺激是最大的,眼科医生推荐的颜色是淡绿色!只要稍微设置一下,就能让电脑的窗口从白花花的颜色变成淡淡的绿色。设置方法:

打开控制面板中的(或右击桌面空白处>属性>)
显示 – 外观 – 高级(D),然后在 项目(I) 那栏选窗口,再点颜色-其它,然后把色调设为85,饱和度设为90,亮度设为205,点击确定。

Categories: Health, Mylife Tags:

Hello world! full-house.cn 网站开通了…

June 9th, 2009 Tony hu No comments

通过几天的的试运行,选择了N种theme,复制了N-1个帖子之后,我终于可以向世界宣布 hello world.

hello world 是一般是每一个程序开发语言学习的第一个demo, 我这里借用一下啦。

从今天以后,我将尽量发布原创的文章,我对技术的积累和总结可能不是太多,因为我觉得自己不是一个善于总结的人,所以得改。

我可能在这个网站多发一些健康方面的文章和我自己的感想的文章。因为我觉得身体健康是一个人最重要的事,能完美地表达自己思想也是一件让人幸福的事。

本来想通过新浪或百度这样的大网站来建立自己的博客的,觉得这样的博客不灵活,所以建议有经济实力(150元/年)的人还是自己买域名自己买空间自己搭建一个blog吧,像我这样的blog最重要的是可以绑定域名 full-house.cn 这个域名还行的吧?虽然通过门户网站建的网站也可以通过URL转发的形式来实现绑定域名,但是效果不理想。

OK,今天就写到这里吧。Goodbye world! 最后贴上自己在南京江中的岛上拍的照。

南京_江心洲

Categories: Mylife Tags:

24 Daily Habits

June 9th, 2009 Tony hu No comments

We first make our habits, and then our habits make us – John Dryden

I have previously written about how the habit of Exercising Every Day has helped me tremendously. Doing something every day is such a powerful way to form a habit that I thought I would make a list of 24 habits that are worth doing on a daily basis. Note: I have divided these into morning, day and night although some could obviously be under different headings.
The Morning
1. Wake Early: I am a big fan of waking at 5am and spending time working on myself before going to work. I have written more about this habit here.

2. Exercise: when I had the goal of exercising 4 times a week I found it was very easy to tell myself I will exercise tomorrow instead. Setting the expectation of daily exercise removed this as a potential excuse and I have since reaped the benefits of this daily habit.

3. Review or (even better) Rewrite Your Goals: each day I try to get closer to achieving my short, medium and long term goals. Starting the day by reviewing or rewriting my goals means that I have better awareness of them throughout the day. As Robin Sharma says:

With better awareness you can make better choices and when you make better choices, you will see better results.

4. Read and/ or Listen to Motivational Material: in the morning a whole day of endless possibilities lies ahead. I motivate myself to play my best game by reading and listening to inspirational books/ audiobooks.

5. Visualise the Day Ahead: I like to take a few minutes to shut my eyes and visualise what I want happen in the coming day. It’s amazing how often my desires become reality when I do this.

6. Write a “To Do” list: I like to write out a list in my diary of the important tasks I need to do that day. As they are completed I put a line through them. So simple, yet so effective.

7. Check the News Headlines: I think it’s important to have an idea of what is happening in our community and the world. Also if don’t at least check the main stories, I find it is easy to feel left out of conversations throughout the day.

8. Take a Multivitamin: I try to eat a well balanced diet, but taking a multivitamin daily reassures me that I obtaining the proper amount of vitamins and minerals that I need (**Update: see comments).

9. Tidy Up: a cluttered house can lead to a cluttered mind and fuzzy thinking. I find it’s best to stay on top of things by tidying up each day.

10. Take Time to Look Good: it’s a reality of life that people judge us by our appearance. I take a few minutes each morning to ensure I go out into the world looking the best I can.

The Day

11. Put First Things First: Many people have their day controlled by tasks that are urgent , but not necessarily important. Examples include interruptions, some email and some phone calls. The habit of putting first things first is about organising and executing your life around your deepest priorities.

12. Connect with Nature: I find spending time outdoors in nature is great for my sense of wellbeing. I have written about this here.

13. Blog: blogging makes me think and write – two things that I can’t get enough of each day. I have written more about the benefits of blogging here.

14. Snack Well: I substitute the chips, candy and chocolate with fruit, vegetables (carrots and celery are great to chomp on) and nuts.

15. Be Proactive: being proactive means showing initiative and taking the responsibility to make things happen. Whenever I want something to happen, I ask myself: what can I do to make this happen?

16. Ping a Friend: I try to send a quick email or text to a friend each day. It’s a great way to stay in touch with friends when I am extremely busy.

17. Save: I save at least 10% of each paycheck. A great way to find the money to save is to break it down to a daily amount, for example $10-15. By taking account of the Latte Factor I find it easy to save this much.

The Evening

18. Have Family Time: on a typical workday I won’t see much of my partner and son, so I believe it’s important to, at the very least, be there most evenings. Family time is about quantity and quality.

19. Floss: This is essential to reduce tooth decay and gum disease. Why wouldn’t you want to have the best smile possible?

20. Wind Down: I try to switch off the computer and the TV about 30 to 60 minutes before bedtime and let my brain have some down time after a long day. I sleep far more peacefully when I do this.

21. Review My Day: I find this is a great way to hold myself to account for taking action throughout the day. Did I get closer to achieving my goals? Did I complete my to do list? Did my day go as planned? If not, why not?

22. Read: I love to read and do so continuously throughout the day. I find it is especially good to read just before to going to bed. Just makes sure it’s a relaxing book, and not one about nuclear physics (see habit #20).

23. Say I Love You to My Family Members: don’t just assume that your family members know you love them. I say these words to my partner and son at least once per day.

24. Go to Bed At A Reasonable Time: the first habit of this list (waking early) begins by going to bed at a reasonable time and getting a good nights sleep.

From http://www.thechangeblog.com/24-daily-habits/

Categories: English Corner, Health Tags:

Don’t Break Your Back! Tips to Healthy Posture

June 9th, 2009 Tony hu 11 comments

When you were a child, you may have been told to “Stand up straight!” or “Don’t slouch!” from your parents and teachers. I remember when I was younger, my mother would poke my back out of nowhere to remind me to stand up straight. I hated this as a teen and was determined to rebel for no reason other than to be stubborn and go against what I was told. My purposeful slouching eventually turned into a habit and carried with me into adulthood.

Now that I’m older, I understand why my mother was so insistent. My poor posture now makes me feel:

Pain in my back and shoulders.
I am breathing shallowly.
I appeared to lack self confidence.
Energy was not flowing efficiently throughout my body. I was often tired.
It made me look and feel weak.
I have spent much time correcting the damage, and undeveloped muscles, from my rebellious teen years. Like any habit, breaking bad posture can be a challenge, but definitely doable with some attention and practice.

Many of us may like to improve our posture, but we often don’t know how, or where to start.

Posture 101
Posture is defined as the carriage of the body. Good posture means carrying your body in a way that puts the least strain on muscles and ligaments. Poor posture can cause pain in the back and neck, and eventually causes injury. Improving your posture is a great way to improve your image while at the same time improving your health.

First, let’s go over some of the things that contribute to poor posture. Most of them are fixable, and others (like pregnancy) eventually go away on their own.

Poor habits – sitting and standing incorrectly (this is me)
Weakened muscles
Obesity – The extra weight strains the muscles
Pregnancy
Improper shoes – high heeled shoes are the worst
Reduced muscle and joint flexibility
Benefits of Good Posture
Good posture is beneficial to your health in several ways. Standing and sitting correctly prevents strain and overuse, and helps prevent back, neck, and muscle pain. Good posture also helps the muscles work more efficiently, which helps prevent fatigue. Most importantly, I have found that I can breathe deeply from my belly (my core). The energy I get from a deep breath is what keeps me going during the day.

The physical benefits are many, but there are other side benefits to good posture. When you stand properly, the body looks aligned, looks slimmer, and generally looks better. Good posture can also help you feel more confident – because you look and feel better, your confidence increases.

Most of us work at a desk or on a computer, and it’s very easy to slip into poor sitting habits. If your body posture is not aligned, eventually you will experience pain. Make sure you follow proper techniques for sitting, standing, and lifting. These seem obvious, but let’s list them to reflect.

Sitting – Sit with your shoulders back and back straight. Your legs should be at a 90 degree angle to your body. Keep your neck, back, and heels in alignment. Avoid the urge to slouch at your desk!
Standing – When standing, hold your head up straight and chin slightly tucked in. Keep your shoulder blades back, chest forward, and stomach tucked in. Keep most of your weight on the balls of the feet and not the heels or toes. Your arms should hang down naturally.
Lifting – Lifting something off the ground by bending over forces your back to do most of the lifting and puts a strain on the lower back. The proper way to lift is to bend at the knees and not the waist. This forces your leg muscles to do most of the work.
Keep Your Spine Straight: In general, try to keep your spine as straight as possible at all times. No matter what you’re doing, if you’re conscious of the alignment of your back and neck, you will notice that your posture will improve.
Simple Stretches to Loosen Your Back Muscles

Lower back cat stretch: This stretch is done on all fours, fingers facing forward. Start by dropping your head and raising your back as you push the shoulder blades upward. Repeat in the opposite direction by pushing your chest downward, arching your lower back.
Knees to chest: While lying on your back, pull both knees to the chest with your hands behind your knees. Keep your tailbone on the floor and hold this stretch for at least 15 seconds.
Shoulder blade squeeze: Have arms straight out in front of you at shoulder height. Now swing both arms horizontally towards your back, like you are trying to reconnect your fingers behind your back. Swing your arms back to the front. Do this motion slowly several times.
Shoulder blade lift: Have arms straight out in front of you at shoulder height. Now swing both arms vertically in opposite directions. Keep arms straight. Do this motion slowly several times.
The Core Twist: Hold arms out, bent at shoulder height. Feet planted on the ground, toes facing forward. Keeping your hips facing forward, twist your upper body towards the back (try to look behind you). Twist from side to side. Twist baby! Twist!
Exercises to Strengthen Your Back Muscles
Any type of exercise will benefit you by improving muscle endurance and increasing strength. Exercises that strengthen your core are the most helpful for improving and building the muscles that lead to good posture. Your core is your torso – shoulders to hips – the source of all your strength to your limbs. Here are three exercises that help improve posture:

Back extensions: Lying face down on the floor with hands behind head. Slowly lift your upper body a few inches off the ground and hold for 5 seconds. Slowly lower to the ground. Repeat 10 – 12 times.
Superman: Lying face down on the floor, lift your right arm and left leg off the floor several inches. Hold for two seconds and then lower. Repeat with left arm and right leg. Do 10-12 repetitions.
Shoulder Squeeze: Lift shoulders toward ears and squeeze together, holding the position for five seconds. Relax and repeat 3-5 times.

Tips for Good Posture

Pad Your Chair – Consider adding lumbar support pad to your office chair. I have a pretty economical cotton pad for my office chair. In fact, I use two of these. This drives other people crazy, since there isn’t much room on the chair, but it’s great for my posture.
Push Butt Towards Back of Chair – When sitting, I find it helpful to remind myself to shift my butt towards the back of the chair. This helps to prevent me from slouching, as long as I continue to lean forward.
Sit on Tip of Chair – When you are sitting on the tip of your chair, you are further from the back of the chair so you are less likely to lean against the back support and slouch.
Breaks & Use of Timer – if you are sitting down most of the day, make a point to get up for breaks often. I set a timer for 40 minutes, when it goes off, I stop working, get up and stretch. Alternatively, go for a walk.
Exercise Ball – Try replacing your chair with an exercise ball. Lean, mean and cost-effective. The exercise ball makes a nice tool for stretching out your back as well. Two birds with one stone, that’s how I roll! (haha, get it? Roll with a ball?) :)
Do you have any posture advice for us? Tips that’s worked in your life? Share with us in the comments. See you there.

From http://thinksimplenow.com/health/dont-break-your-back-tips-to-healthy-posture/

Categories: English Corner, Health Tags: