text:
You just cannot imagine gaming on an Xbox without a good set of headphones. Competitive gamers especially know about this fact, as they are always keeping an eye on online stores and blogs to try and find the most reliable headset currently available on the market. A headset with a clear and crisp sound makes all the difference in both quality and winning or losing an online match. Here you'll find ten of the best headsets out there, as well as the best Xbox One headset available for purchase at the moment. We did the research, excluding headsets that are not compatible with Xbox One, as well as those models that are just too expensive for an average competitive gamer. The models you'll see here are all very affordable, as well as stylish. Before we begin, note that this list is made up of headsets based on their price (links will be attached), quality, as well as some of their top features.
Polk Audio Striker Pro Zx
The Polk Audio Striker Pro Zx is a special headset which is very flexible. They come a detachable microphone on them, so if it's not necessary to your gaming needs, you can easily just get rid of it. It's ideal for gaming on an Xbox One, and the box comes with three additional connection cables, making almost every single device compatible with these wonderful headphones. Customers say that these headphones are also outstanding for music, as well as watching videos, TV shows, and movies, but they also add that the mic isn't that good for talking – the quality is pretty bad. Find this headset on Amazon for more info.
Sades SA-807
These unbreakable headphones are perfect for competitive gamers, and they're a pretty good Xbox One headset, so if you're looking for something sturdy and sleek, then look no further. The Sades SA-807 should be on your list to buy, because their almost closed ear design will deliver sound that's crystal clear. Amazon customers say that they dislike the low quality of appearance, but they really enjoy the extra-long cable that comes with them.
LucidSound LS30
This headset is fantastic for gamers looking for wireless freedom. With a very comfortable memory foam located in the ear cushions, they're incredibly well for listening to music, as well. Find them on Amazon for all further information.
Kingston HyperX Cloud
The finest Swedish headset perfect for Xbox One gaming is yours if you're looking for something that will deliver superior audio performance. The HyperX Cloud are comfy, and they're very affordable. The microphone is also detachable, but the downside is that to make this your best Xbox One headset, you'll need to buy the Xbox adapter. Check their price here.
Turtle Beach XO Seven Pro
With customizable EQ presets, as well as an option for bass boost, you'll probably get chills when each and every single explosion occurs.You can also mute your mic really quickly with this wonderful headset, and Amazon customers say that they are of tournament quality. Pretty good for a headset ranked at number 6.
ASTRO Gaming A40 TR
The fifth best model is the ASTRO Gaming A40 TR. This special headset resembles modular gadgets due to its open-back / closed-back noise isolation. The A40 TR is of outstanding quality, making them sturdy, lightweight, and leaves a great first impression. Unfortunately, the connection cable is somewhat short, judging by Amazon's customers. If it weren't for that issue, we would rank these headphones slightly better.
HyperX CloudX Pro
Proudly wearing the official Xbox license, the HyperX CloudX Pro are good for more reasons than one. With a tight and secure fit, you can be sure that this headset made exclusively for Xbox One gamers won't break during your intense online matches, and with noise cancellation built into the mic, you'll enjoy gaming even from your home. Check Amazon for more info.
Turtle Beach Stealth 420X+
Being one of the lightest headsets on the market, the Turtle Beach Stealth 420X+ seem like an extension of the Xbox One. With their fabulous black color and neon green accents, you'll enjoy this wonderful Xbox One headset for more reasons than just the design. Their sound quality is perfect, and they allow you to tweak game and chat volumes independently. The wireless capability also offers 15-hours of battery life(!). Happy Amazon customers are going crazy for this model.
Razer Kraken Pro V2
Lightweight, durable, perfection in sound quality are just some of the terms used to describe the Razer Kraken Pro V2. It's not a beastly headset in terms of its size, but with a cool neon green color, you can enjoy every single aspect of them. Their sound quality is outstanding for the price, and Amazon confirms that.
SteelSeries Siberia X800
With 7.1 Dolby surround sound that almost literally drags you inside your video game, the SteelSeries Siberia X800 wireless headset is by far the best Xbox One headset. With an Xbox One adapter in the box, you can control game and chat volumes right from the controller with ease. Their battery pack can be swapped without disturbance, and their rotating memory foam earcups sum up this masterpiece into a perfectly sculpted piece of equipment for gamers. Check them out on Amazon for all other technical details, and be sure that the SteelSeries Siberia X800 will not disappoint you!


text:
Cenk Tosun is aiming to become a mainstay in the Premier League after claiming he is now reading to 'adapt' to life at Everton.
The £27m January signing from Besiktas has struggled in the early weeks of his Toffees career, with the striker spending the past two matches on the bench as he acclimatises to life in England.
Tosun was part of the squad that recently returned from a five-day warm weather training camp in Dubai though and, speaking to Everton's official site, explained how the trip had now made him ready to tackle the rough and ready nature of England's top flight.
Tosun had started the encounter against Spurs and West Brom but, after not looking fit enough to carry on in that role, has been resigned to the subs' bench since.
The 26-year-old believes he is now set to reap the rewards of getting to know his Blues teammates better though as he revealed he is more 'comfortable' in his new surroundings.
He said: "The Premier League is more physical than how the game is played in Turkey, but I like this. I really enjoy the high-tempo of the game here. It's hard physically, it's a tough game, but I embrace this.
👌 | @CenkTosun_ at it during training in Dubai!— Everton (@Everton) February 19, 2018
And Duncan Ferguson believes the warm-weather training camp has provided strong foundations in our quest to climb the league table.
👉 https://t.co/5sMmmDKClD pic.twitter.com/mqWhjQKxkv
(You may also be interested in Besiktas President Offers Cenk Tosun Lifeline at Old Club as Star Struggles to Settle at Everton)
"The first few weeks were difficult maybe for my body and the adjustment, but I can feel already that I'm adapting and I'm more comfortable now."
Tosun netted 41 goals in 96 appearances for Besiktas before trading football in his homeland for Merseyside, and the Turkey international now harbours ambitions of picking up a trophy with the Toffees.
Indeed, Tosun admitted that things hadn't gone well for the Blues so far this term but he is confident that the Goodison Park-based side would learn from this season as he outlined his long-term ambitions for the club.
Tonight Cenk Tosun should have been playing at the Nou Camp in the champions league, instead he's banging em in whilst training in Dubai against Cuco Martina and Ashley Williams, what a legend, once a blue always a blue! #EFC— Andy Roberts (@ARobbo17) February 20, 2018
He added: "I want to be a player that can help Everton to achieve what we want to achieve as a Club. I am working hard to be that player.
"In the long-term I want to win some silverware in my career at Everton. Perhaps this season it will be tough to achieve the goals we would set out for ourselves because the first part of the season didn't really go to plan.
"But we have turned things around and are only two points back from seventh position, so we have given ourselves a chance."

subset: commoncrawl


text:
We are an Atlanta, Ga based pro wrestling network. We have shows that cover WWE, , NXT, Impact Wrestling, ROH, NJPW, and more. Check out The Weekly Wrap Up, The Pro Wrestling Personified Podcast, The 10 Count, The Guerrilla Press, and interviews. Enjoy all the shows by subscribing to just one channel! Available on ITunes, GooglePlay, Overcast, Tunein, Stitcher, Player FM, and more. Check out tappedoutwrestlingpodcast.com for more places to find us.
Mar 17, 2017
The Wrestling Dorks return for their final preview show before
joining the network full time. They talk all things Raw, Smackdown,
and more in the pro wrestling world.
Wrestling Podcast Network with shows discussing the goings on in the world of "Pro Wrestling" and "Sports Entertainment" that include WWE, Raw, Smackdown Live, NXT, Impact Wrestling, ROH, Indy Wrestling, and interviews.
Having trouble logging in?


text:
Student Quotes
HERE'S WHAT STUDENTS ARE SAYING ABOUT #HowToLife
Branson, Missouri
"How to Life brought me closer to God more than I ever anticipated! After I helped two girls rededicate themselves to Christ, I felt like I had a new bond with them and with Christ that I've never felt before. It was so powerful and I'm extremely thankful for the experience!"
Sami, 10th
"I saw God bring many people to Christ through all of the hard work and dedication by all of the students!"
Ryan, 10th
"What did I see God do at #HTL? I saw him touch a lot of hearts, including mine. It encouraged me to see so many people declaring their love for Christ!"
Gracelyn, 11th
"I had the privilege of sitting down with a Branson 8th grader who needed someone to talk to about his faith in Christ. At first it was an awkward conversation, but after we talked for a while we were both very thankful for each other's encouragement. I look forward to how God might use me in his life!"
Johnny, 12th
"God really reminded me that his love is everlasting. No matter what I do and how far I push him away, he is always right by me holding on tight! God's love will never fail and through him, I will never fail! :)"
Natalie, 11th
"I saw many people start or renew their relationship with God, and many people who already had a faith grew from the event."
Jeremy, 12th
"I saw God soften harden hearts and change lives!"
Jhonny, 12th
"At #HOWTOLIFE I saw God work in so many people's lives mainly through worship. There were so many people with their hands up just praising God, most of them were also in tears. It was so awesome to see God through that. I also had friends that usually don't go to church, and have been slipping away from God grow much closer, ending in tears and joining in a prayer circle with other friends at the end of the night."
Kailee, 12th
"I saw God show people how to be honest with themselves and their sin!"
Joshuwa, 12th
"This was a great opportunity to get our peers involved in an event centered around Christ."
Raleigh, 12th Grade
I loved every part of this event & I hope to become a part of this event for years to come. Thanks again for coming up with this idea & letting me be apart of it!!!
Hally, 10th
Harrison, Arkansas
"At #HowToLife I saw God, spiritually moving in so many people , and just really working in hearts, and changing so many lives."
Callie, 9th Grade
"God did some pretty amazing things at #HowToLife. He worked through us in some mighty ways. The words spoken and the stories told affected so many people. Being that they were told by teenagers, people could really relate. Sooo many people came up to begin or rededicated their relationship with Christ. This movement touched the lives of many. It is the talk of the school! People keep asking me when the next one is and how the event impacted their lives. #HowToLife was life changing. God is Amazing!"
Amber, 9th Grade
"God was seriously all over. He was welcomed into people's life's that had completely shut Him out before. God provided wisdom and words to everyone who spoke. He blessed the lives of many teens. As much as people were scared to show their faith, God still touched their hearts in a way that made them push through and to stand up. #HowToLife changed many lives. I've already seen some changes at school and it may just be my new perspective on everything, but I feel that this movement will be the greatest thing for our region, and for everywhere."
Kim, 10th Grade
"I saw a spark of hope for the community. It brought together different denominations and different people together for God. I also thought it was so awesome to see people there who have claimed to believe in nothing at all, because even if they were there for their friend, they were exposed. It just takes someone planting that seed in their life. It was such an awesome experience."
Amber, 12th Grade
"I saw hundreds of students worshipping The Lord and 75 people come to know him for the first time. I saw lives change and hearts become broken for God. The girls I counseled that night were so embarrassed to cry but what I told them is that when God breaks your heart, he breaks the old ugly chains that keep it together. And when he breaks it he puts it back together to love like he loves you. Crying is a beautiful thing when you realize how great God is. HowToLife was incredible and I can't thank you enough for letting me be a part of it. :)"
Tatum, 10th grade
"God worked though us to put on HowToLife. I think that it help the believers grow in their faith and it's was so great that's god worked though us to lead people to Christ. I had so many people text me after the event and tell me what HowToLife did for them. They told me that it was really deep and it was like a wake-up call."
Ellaina, 9th Grade
"At HowToLife, I saw God give the bravery to so many young people to come up and seek renewal in their hearts. God worked through all of us and people are so excited to live a life for Him. HowToLife opened so many eyes including mine. I've gotten many texts from people who are struggling telling me how inspiring and helpful HowToLife was."
Brynn, 9th Grade
"I saw God touch so many people, one of my best friends was there and when we prayed and he put his trust in God. I saw a relief in him to know that he had someone to go to whenever something happens that would cause him to get upset or be stressed."
Canyon, 11th Grade
"I saw God bring together and touch the hearts of hundreds of kids from around Arkansas in an epic get-together of the family of Christ!"
Brett, 12th Grade
"How to life was such a great experience and I am so happy I had the chance to get to be a part of it. This event gave God the opportunity to speak to people who otherwise, may never give him the chance throughout their normal day. God can reveal himself to people at any moment he chooses, but I think God was waiting for this to happen. God's love was really revealed through the skits, testimonies, and loving atmosphere. God spoke through so many people, and softened the hearts of the ones who were listening. He stood ready, with arms wide open, to embrace all the ones who finally broke their walls down and allowed their hearts to be touched. Furthermore, for the people who were already at a good place with Him, He encouraged us to keep pursuing and reminded us, that becoming a Christian, despite the struggles, is the best decision we will ever make. I think it is safe to say that HowToLife opened the door for people to see how big God's love is and that nobody left there without knowing how much God loves them."
Stacey, 11th Grade


text:
Westhoughton Age Support Project (W.A.S.P.)
About Us
On 17th July 1982 the 'Friends of Winifred Kettle house' was dissolved. Soon afterwards, the remaining members held an initial meeting in the hope of forming a service for Westhoughton's Senior Citizens. The meeting held at the home of a local resident, involved committed individuals, the then headteacher of Washacre CP School and representatives from Bolton Social Services. With the blessing of a small boy who had collected 50p for the cause, and after much discussion a suitable name chosen - Westhoughton Age Support Project - or the now commonly used and understood W.A.S.P. was formed. (Members are called 'The WASPs'.)
The new group would soon establish what its aims were, draw up an official constitution and have recognised committee members and a treasurer. Working with but independent of the local council, these steps would allow W.A.S.P., a voluntary group, to apply for recognition with the Charities Commission and be recognised as a Registered Charity (515388) some 12 months later. In the September of 1982, a working committee of ex-members of 'the Friends' was formed and so began monthly meetings and the Friday craft session, and new members would come along and join the new group. In December 1983, negotiations with Bolton Education Department took place and W.A.S.P. was to base itself at the new community centre for £2 a session.
Run by volunteers, for over 35 years W.A.S.P. has played a key role in supporting senior citizens in Westhoughton by providing regular activities, trips and friendship, enriching the lives of its members and contributing to community life in Westhoughton. There is a Management Committee overseeing who take care of general business, activity planning and fundraising; an AGM takes place every May.
This is a popular group and well respected by the wider community. In 2015 W.A.S.P. received the most votes at the community funding event 'Westhoughton You Decide' organised by Greater Manchester Police - the group was featured in the Bolton News (18/2/15). In 2018 the group has been chosen to receive money from the Co-op's Local Causes Fund helping to fund the current year's activities.
Download the information leaflet: W.A.S.P. - What We Do.
Regular Weekly Activities
- Monday afternoons at the John Holt Centre, Birch Avenue, Westhoughton.
Drop-in from 1:00pm to 3:30pm for cards, dominoes, bingo and refreshments.
- Thursday evenings at the Winifred Kettle.
Bingo night with fabulous prizes and refreshments, 6:00pm to 9:00pm
Upcoming Trips and Events
Throughout the year W.A.S.P. organises a number of special trips, usually once a month, which will include food and entertainment, such as Llandudno, The Lake District, St. Annes, Harrogate… or nearer trips such as to Rivington Barn to enjoy a 4-course lunch and show. There is also a much-anticipated Christmas Party. Costs are covered by W.A.S.P. from funds raised throughout the year with member contributions of £10 for trips - the budget for activities this year is over £10,000.
Programme of Events - 2018
- Friday, 23rd March - A '49 Club' Trip to The Bedford Hotel Lytham St. Annes. Leave Westhoughton at 11am for a 4-course lunch and entertainment. Leave 4pm.
- Monday, 14th May (1pm to 4pm) - W.A.S.P.'s A.G.M. at the John Holt Centre. Carr's Pasties, free bingo and raffle.
- Monday, 28th May - Afternoon Tea at the John Holt Centre. Catering by Karen's Little Kitchen (12:30pm to 4:30pm). Entertainment. Free Bingo. Transport provided (but not the Ring and Ride).
- Friday, 13th July - The Doric Hotel, Blackpool. Leave Westhoughton at 10:30am for a 4-course lunch, entertainment, followed by tea, coffee and biscuits. Leave 4:30pm.
- Friday, 24th August - Ryecroft Hall, Poulton-le-Fylde. Leave Westhoughton at 11am for a 3-course lunch, entertainment, followed by tea coffee and biscuits. Leave 4pm.
- Friday, 12th October - The Chadwick Hotel, Lytham St. Annes. Leave Westhoughton 11am for a 4-course lunch and entertainment. Leave 4:30pm.
- Friday, 16th November - '49 Club' Christmas Party at The Talbot Hotel, Southport. Leave Westhoughton 11am for a Turkey & Tinsel lunch and entertainment. Leave 4pm.
- Sunday 16th December - W.A.S.P.'s Christmas Party at the Brookfield Masonic Hall, Peel Street, Westhoughton. Arrive 12 noon for a 12:30pm lunch. Entertainment. A gift for everyone from Santa. Leave 4pm.
The pick up point for all events is the Park Gates, King Street, Westhoughton.
The total cost of activities for the year is £10,122, with individual trips costing on average £1,200. A contribution of £10 per person per trip is to be made for trips to The Doric Hotel, Ryecroft Hall and Chadwick Hotel. For non-members the cost is £22 each per trip - subject to availability.
Previous Year events for W.A.S.P. have included: trips to The Eagles Head Inn, at Over Kellet, Carnforth; taking in a fish and chips supper at Bolton's Olympus Chippy followed by the Wingates Brass Band 140th Anniversary Concert at the Victoria Hall; seeing the wartime nostalgia musical 'We'll Meet Again' at the Lowther Pavilion at Lytham St. Annes, and a visit to the world-renowned Whelan's Fish and Chips Restaurant.
Getting in Touch
You can meet or join up or find out more about W.A.S.P. at any of the regular events. You can also contact W.A.S.P. through the Westhoughton Community Network website and we will pass on any contact.
Westhoughton Age Support Project (W.A.S.P.)
Registered Charity No. 515388


text:
Minnesota Timberwolves Team Report – November 27
=== Minnesota Timberwolves Team Report – November 27 ===
(Sports Network) – The Minnesota Timberwolves were defeated Wednesday by the
New York Knicks, 97-92, at the Target Center.
Kevin Garnett scored 25 points and grabbed 14 rebounds for the Wolves, who
have lost two straight. Sam Cassell added 23 points and dished out 10 assists.
Gary Trent added 15 points in 32 minutes of play. Fred Hoiberg was a pleasant
surprise for the Wolves as he added 13 points off the bench.
Latrell Sprewell, playing against the team he spent the last five seasons with
before being traded, struggled all night. Sprewell scored just 5 points on 2-
for-11 shooting.
Cassell kept the game close for the Wolves, as he drained a deep shot to close
the gap to 94-92 with 37 seconds left, but the Knicks and Allan Houston
answered right back. Houston's jumper with 17 seconds left sealed the game.
Sprewell spent fives years with the Knicks before being traded to Minnesota.
The Timberwolves are off until Friday when they start a five-game road trip
against the Memphis Grizzlies.


text:
Enfusion is a leading multimedia company created by Edwin van Os. The team behind the organization is already in the business for decades, but in 2013, the passion and love for combat sports brought them together to create something truly special. With creativity, courage, will and tremendous effort. Enfusion's production achieved what both fans and broadcasters are expecting in quality, innovation and entertainment.
"Combat sports are our passion, entertainment is our life"
Enfusion works with Fighting Spirit, the leader in combat sports content distribution, to bring the band to worldwide audiences
The Enfusion brand represents the highest quality kickboxing in the world, as their shows constantly feature the best and most exciting lineups possible. With 20 live events per year in various cities and countries around the globe, the promotion established itself as a household name in the world stand-up fighting. The biggest names in the sport have competed at Enfusion live shows, such as Buakaw and Superbon from Thailand, Andy Souwer (The Netherlands), and Tayfun Ozcan (Turkey) to name a few.
Well-known veterans and established champions of the past are here to compete against the new generation of superstars. This premise combined with the top-notch production value, unforgettable atmosphere, spectacular action and jaw-dropping KO's are the simple reason for the brand's success.
Enfusion is a must-see event, not just for kickboxing fans, but all kinds of combat sports enthusiasts as well!
The program, where young and motivated fighters are groomed to be the next big names in kickboxing. The competition is fierce, as every fighter has aspirations to reach the top of the ladder, the main Enfusion show. Champions of old wanting to restore their names to past glory compete against young titans who are eager to prove themselves. Enfusion Talents also gives a stage for local fighters to perform in front of their hometown audience. The chance is given to every fighter to reach stardom, they just have to take it!
The first stage in a fighter's journey. Amateurs and newcomers from around the world come to compete on Enfusion Rookies to be professional warriors and someday may fight at a prestigious Enfusion live event. Enfusion's scouts are on a constant look for new talent and are responsible for finding many current superstars featured on the promotion's main shows. The youngsters on this program have to show real conviction and will to be able to climb from the bottom to the highest level of competition.
Enfusion MMA
Adding grappling into the mix.
The next step in the evolution of Enfusion. The goal of Enfusion MMA is to help a smooth transition for mainly stand-up fighters to mixed martial arts with ground techniques. Because of this, the new program will have a 1-minute ground limit, allowing kickboxers and boxers to familiarize themselves with this new portion of combat. This show is not created to compete head to head with other MMA organizations, but to act as a middle ground while still maintaining the high-level stand-up fighting which made Enfusion famous and successful.
Enfusion Reality
In-depth behind the scenes into athlete training.
After 7 successful seasons, Enfusion Reality saw stars emerging, friendships made, and rivalries born. The show gives a unique behind the scenes look to kickboxers' training, mindset and emotional state before and after fights along with daily struggles regarding weight cutting and more. The program's in-depth perspective on each athlete's accomplishments and sacrifices give a one-of-a-kind look on the competitiveness of kickboxing.
Follow the fighters as they train, fight, live together, and compete against each other to become tournament champions at the end of a season. Even though Enfusion Reality only has one winner, the competitors are sorted into teams with coaches of the opposite sex. During each season, challenges are designed to help teams build skills and provide advantages for each fight.
Enfusion Reality welcomes the viewer to a journey where new stars emerge!
Enfusion White Collar Kickboxing
Enfusion White Collar kickboxing will be the 6th brand of Enfusion.
A brand new label of kickboxing for non-professional fighters. The goal of the program is to give fighters a smooth entry to kickboxing with bigger sized gloves and shin protection. The profits from the show will go to charity!
History and career of Edwin Van Os
Edwin Van Os started training in kickboxing at an age of 19 in 1988. He saw a big potential in the sport, therefore in 1994, he bought the gym where he started, renaming it Gym Alkmaar in the process. The gym soon became a successful breeding ground for emerging stars such as Gago Drago, Badr Hari, Melvin Manhoef, and Thiago Tavares amongst others.
In 2002, Edwin started a new company with Simon Rutz for promoting events and managing fighters. The company was called It's Showtime. The promotion grew to become one of the top competitions in kickboxing, featuring all the big names in the business.
In 2006, Edwin, along with Remon Daalder, started the Superpro Samui gym in Thailand which is to this day is one of the top destinations for fighters to train.
In 2012, It's Showtime was sold to Glory, which gave an opportunity to Edwin to pursue his own new vision, which became Enfusion in 2013. After 6 years, Enfusion is better than ever, constantly featuring the top names in kickboxing and offer 20 live events per year.


text:
Our original giveaway post was the first one to disappear. I was distraught that the first huge giveaway we did and it just vanished..
So– here is a summary of the MonkeeBumz Grand Opening Giveaway!
Sherry is owner of MonkeeBumz, She is a wonderful WAHM (Work At Home Momma) who became completely complaint before opening her shop on October 26th, 2014 to celebrate her son who was born at 29 weeks birthday she put together this amazing giveaway! Sherry makes the cutest custom fleece covers for over cloth diapers they even have a feature you will not find anywhere else, snap in soakers to keep your little one completely dry! While Sherry sews in her free time, she also home-schools her middle daughter, all while volunteering for a cloth diaper bank too! She is simply dawlin' and her family is too!
Typically I'll only announce through Rafflecopter, however due to the circumstance of the original disappearing posts we will go ahead and end our first giveaway by announcing it here! Since a lot of you were able to enter via our page, instead of putting the Rafflecopter back in here since its over, i'll go ahead an announce that the winner of our HUGE MonkeeBumz giveaway is, Rebecca Dunbar Colon! She has 24 hours to respond or we will re-draw.
These amazing companies and some pretty amazing bloggers, Mommy Miranda, Odds and Evans, A Real Life Country Housewife and of course myself , put together a package for one luck winner in the U.S.
Please keep in mind Bloggers are not responsible for prize fulfillment, except of course what A Real Life Country Housewife and I have contributed into the giveaway. We hope to bring you more wonderful giveaways in the future, we hope that you enjoy this package, this is one lucky winner! (:
- Custom Fleece Cover from MonkeeBumz
- 'Fia Fluff Bottom Balm from 'Fia Fluff
- One Sized Pocket Diaper from Rock n' Bottoms
- Embrodidered Ring Sling from She Seams Sew Crafty (ME!)
- A pair of Gender Neutral Grow With Me pants from Active Duty Diapers
- 5 Cloth Wipes from Active Duty Diapers
- Charlie Banana Wetbag From Madelines Diaper Shoppe
- Infinity Scarf from A Real Life Country Housewife


text:
Graduate School of Business. Effective January 2006, the GMAT� and GMAT
CAT� will be created and administered by Pearson VUE and ACT, Inc. and the
current vendor ETS� (Educational Testing Service) will no longer be the GMAT
test developer because ETS�, according to GMAC�, has failed to make
investment in resources commensurate with the security and quality
expectations. This change in GMAT vendor from ETS� to Pearson VUE does not
affect GMAT test-takers planning to take the GMAT test during the rest of
this calendar year (2005). Effective January 2006, the GMAT test in paper
and pencil format will not be offered in any of the mobile GMAT exam centers
because mobile GMAT test centers will cease to exist.GMAT� is administered
in a CAT� (Computer Adaptive) format in which the GMAT test 'adapts' the
difficulty level of GMAT questions to your GMAT-specific 'comfort level',
with 'higher difficulty level GMAT questions' carrying higher GMAT raw
scores (GMAT Scaled Scores) than do 'lower difficulty level' GMAT questions.
The GMAT tests your Quantitative and Verbal Reasoning skills, and your
ability to make logical interpretation of information presented to you or
known to you in a conceptual sense, and to make logical decisions using the
logical interpretation. The GMAT� has three assessment areas: AWA
(Analytical Writing Assessment) that requires you to write Two essays,
one analyzing an Issue and the other analyzing an Argument. This first GMAT
section is not 'adaptive' and receives a separate score of between 2 and 6.
GMAT Quantitative Assessment is the first of the two 'adaptive' sections on
the GMAT, and requires that you answer 37 questions in problem solving and
in Data Sufficiency in 75 minutes. The last 'adaptive' section on the GMAT is
Verbal Assessment, which requires that you answer 41 questions in 75
The GMAT Verbal assessment includes three sections: GMAT Critical
Reasoning, GMAT Sentence Correction, and GMAT Reading Comprehension. GMAT
adaptive sections also include experimental questions, at least 9 in GMAT
Quantitative assessment and 11 in GMAT Verbal assessment. The two adaptive
sections on the GMAT receive a combined score of between 200 and 800. Most
A-List Business Schools rated in the top-10 will require a GMAT test score
of at least 650 in order for you to be competitive. Your best chance for
success lies in your ability to take the GMAT exam at the high difficulty
level throughout.


text:
During Tuesday`s meeting of the Knesset State Control Committee on the law enforcement agencies` handling of inciting rabbis, MK Karin Elharrar (Yesh Atid), who heads the committee, protested against the left-wing incitement against Justice Minister Ayelet Shaked (HaBayit HaYehudi) and said "an atmosphere has been created as though the state`s laws do not apply to the inciters. There is a red line for every opinion, certainly when such incitement produces violent terrorists."
Elharrar criticized the state`s failure to address the publication of the book Torat Hamelech, which says it is permissible in some situations to kill non-Jews according to Jewish law. "The Justice Ministry must create deterrence against the inciters by summoning them for questioning and filing indictments," she said, while charging that the Education and Welfare ministries are "helpless" in treating teenagers who drop out of school. The chairwoman also called on State authorities to take action against rabbis who hold official state positions and act against the state.
MK Karin Elharrar
According to MK Yaakov Peri (Yesh Atid), the state authorities failed in tackling the incitement problem in the country. "The General Security Service (Shin Bet), Israel Police and the Justice Ministry could not, or perhaps were afraid, to hold accountable rabbis who supported the Jewish underground in the 80s," he said, while fellow Yesh Atid MK Ofer Shelah said "the kingdom has for years been failing to perform its duty to uphold its honor, laws and recognition of its authority."
MK Tamar Zandberg (Meretz) said, "There is selective enforcement against the leftist camp, despite the fact that this camp is the one that is being persecuted and suffers from verbal violence and incitement." MK Yael German (Yesh Atid) argued that "a direct line has been stretched between incitement against homosexuals, Arabs and leftists," and protested the absence of a law against hate crimes.
Rabbi Gilad Kariv, the executive director of the Israel Movement for Reform and Progressive Judaism, told the committee that the authorities should not focus on extreme cases, but "be concerned about the fact that racism and verbal violence are becoming the norm within a broad segment of the population."
Rabbi Rafi Feuerstein of the Tzohar rabbinical organization told the committee that he prayed together with Sheikh Abdullah Nimar Darwish for the well-being of the Dawabsheh family, whose home in the Palestinian village of Duma was firebombed last July. The arson attack resulted in the loss of life of three of the family members; 18-month-old Ali Dawabsheh was burned alive in the fire, while both his parents died from their injuries within weeks. Feuerstein said education, not only legislation, is the way to deal with violence and incitement.
Attorney Amit Marari said on behalf of the Justice Ministry that it is working persistently to curb the incitement and protested against the claim of selective enforcement against the Left. Omri Cohen of the State Attorney`s Office said that most of the cases that are examined do qualify as incitement in the criminal and legal sense of the word.
Moran Zipper of the "Tag Meir" forum said "the ideological infrastructure which has grown over the past few years is legitimizing incitement and murder, and the enforcement and legal agencies remain silent."


text:
Charm Necklace in Gold, Silver & Blush
$65.00 $45.00
Free Shipping!
This beauty sparkles with femininity. The rhinestone 26" chain is complemented by charms of Silver & Gold Vintage Metal Findings, Silver and Gold Roses, and Blush accents. The focal point of the piece is the 3" Vintage Blush and Metal pendant. This beauty is secured by a hook latch closure.
*Handcrafted by Angela Resendiz


text:
Bromo's World - author: Vlado Janevski
The comic Bromos World is about the adventures of a cat and bear who work at a radio station, PAW2U. The cat, Bromo, has his own talk radio show for a diverse animal audience. Every aspect of life is discussed. Bromo and Bear's colleagues at work include a croc, robot and a strange looking pig who is their boss. Outside work, Bromo and Bear socialise with a cow, anteater, kangaroo, worm, rabbit and many others. There are also one or two aliens with a taste for cats. At home Bromo lives with a bird. His work mate, Bear, lives with a teddy bear.
Wednesday, December 22
Life is Short, but... #210
Posted by Author: at Wednesday, December 22, 2010
Labels: bear, Bromo, Bromos World, cartoon, cat, comic strip, deserted island, honey, life is short, merry xmas, nightmare, pissing, santa, Vlado Janevski, Vlados World: Vlado with his cat Bromo, webcomic
Subscribe to: Post Comments (Atom)


text:
I would add a few lines to Dowd's column this time. In fact, I have been trying to make time to do a list of lies from the Bush Administration -I realize, though, that's a full time job-. What I don't get to understand is how they get away with this on regular basis. Just the Medicare legislation, the cost of which was hidden from the begining just to gain that one vote that help passing it -you remember the charade, don't you? The three hours of arm twisting to force that particular vote.-
If my recollection isn't wrong, the passing of that legislation was based on the promise that the cost wouldn't be more than the amount agreed upon.(I don't remember the exact number.) That cost has just duplicated.
If this were a business with the corporate world that Bush so loves, that obvious lie would result in the cancellation of the transaction, since one of the parties made a false statement from the begining. But now, we are just stuck with it.
I guess we would need to do some reviewing of the ways we do legislation in this country. How come we have to keep going with a legislation that went through riding on a lie? Well, yeah, but that would mean we would need to leave Iraq today.
Well, back to my friend Maureen Dowd and her latest Bush's Barberini Faun. It's so fun, that I'll steal it from the NYT and just past it here for your enjoyment:
I am very impressed with James Guckert, a k a Jeff Gannon.
How often does an enterprising young man, heralded in press reports as both a reporter and a contributor to such sites as Hotmilitarystud.com, Workingboys.net, Militaryescorts.com, MilitaryescortsM4M.com and Meetlocalmen.com, get to question the president of the United States?
Who knew that a hotmilitarystud wanting to meetlocalmen could so easily get to be face2face with the commander in chief?
It's hard to believe the White House could hit rock bottom on credibility again, but it has, in a bizarre maelstrom that plays like a dark comedy. How does it credential a man with a double life and a secret past?
"Jeff Gannon" was waved into the press room nearly every day for two years as the conservative correspondent for two political Web sites operated by a wealthy Texas Republican. Scott McClellan often called on the pseudoreporter for softball questions.
Howard Kurtz reported in The Washington Post yesterday that although Mr. Guckert had denied launching the provocative Web sites – one described him as " 'military, muscular, masculine and discrete' (sic)" – a Web designer in California said "that he had designed a gay escort site for Gannon and had posted naked pictures of Gannon at the client's request."
And The Wilmington News-Journal in Delaware reported that Mr. Guckert was delinquent in $20,700 in personal income tax from 1991 to 1994.
I'm still mystified by this story. I was rejected for a White House press pass at the start of the Bush administration, but someone with an alias, a tax evasion problem and Internet pictures where he posed like the "Barberini Faun" is credentialed to cover a White House that won a second term by mining homophobia and preaching family values?
At first when I tried to complain about not getting my pass renewed, even though I'd been covering presidents and first ladies since 1986, no one called me back. Finally, when Mr. McClellan replaced Ari Fleischer, he said he'd renew the pass – after a new Secret Service background check that would last several months.
In an era when security concerns are paramount, what kind of Secret Service background check did James Guckert get so he could saunter into the West Wing every day under an assumed name while he was doing full-frontal advertising for stud services for $1,200 a weekend? He used a driver's license that said James Guckert to get into the White House, then, once inside, switched to his alter ego, asking questions as Jeff Gannon.
Mr. McClellan shrugged this off to Editor & Publisher magazine, oddly noting, "People use aliases all the time in life, from journalists to actors."
I know the F.B.I. computers don't work, but this is ridiculous. After getting gobsmacked by the louche sagas of Mr. Guckert and Bernard Kerik, the White House vetters should consider adding someone with some blogging experience.
Does the Bush team love everything military so much that even a military-stud Web site is a recommendation?
Or maybe Gannon/Guckert's willingness to shill free for the White House, even on gay issues, was endearing. One of his stories mocked John Kerry's "pro-homosexual platform" with the headline "Kerry Could Become First Gay President."
With the Bushies, if you're their friend, anything goes. If you're their critic, nothing goes. They're waging a jihad against journalists – buying them off so they'll promote administration programs, trying to put them in jail for doing their jobs and replacing them with ringers.
At last month's press conference, Jeff Gannon asked Mr. Bush how he could work with Democrats "who seem to have divorced themselves from reality." But Bush officials have divorced themselves from reality.
They flipped TV's in the West Wing and Air Force One to Fox News. They paid conservative columnists handsomely to promote administration programs. Federal agencies distributed packaged "news" video releases with faux anchors so local news outlets would run them. As CNN reported, the Pentagon produces Web sites with "news" articles intended to influence opinion abroad and at home, but you have to look hard for the disclaimer: "Sponsored by the U.S. Department of Defense." The agencies spent a whopping $88 million spinning reality in 2004, splurging on P.R. contracts.
Even the Nixon White House didn't do anything this creepy. It's worse than hating the press. It's an attempt to reinvent it.
E-mail: email@example.com


text:
Q: How can I return multiple values from a function?
A: There are several ways of doing this. (These examples show hypothetical polar-to-rectangular coordinate conversion functions, which must return both an x and a y coordinate.)
#include <math.h> polar_to_rectangular(double rho, double theta, double *xp, double *yp) { *xp = rho * cos(theta); *yp = rho * sin(theta); } ... double x, y; polar_to_rectangular(1., 3.14, &x, &y);
struct xycoord { double x, y; }; struct xycoord polar_to_rectangular(double rho, double theta) { struct xycoord ret; ret.x = rho * cos(theta); ret.y = rho * sin(theta); return ret; } ... struct xycoord c = polar_to_rectangular(1., 3.14);
polar_to_rectangular(double rho, double theta, struct xycoord *cp) { cp->x = rho * cos(theta); cp->y = rho * sin(theta); } ... struct xycoord c; polar_to_rectangular(1., 3.14, &c);(Another example of this technique is the Unix system call stat.)
See also questions 2.7, 4.8, and 7.5a.
Q: What's a good data structure to use for storing lines of text? I started to use fixed-size arrays of arrays of char, but they're just too restrictive.
A: One good way of doing this is with a pointer (simulating an array) to a set of pointers (each simulating an array) of char. This data structure is sometimes called a ``ragged array,'' and looks something like this:
You could set up the tiny array in the figure above with these simple declarations:
char *a[4] = {"this", "is", "a", "test"}; char **p = a;(where p is the pointer-to-pointer-to-char and a is an intermediate array used to allocate the four pointers-to-char).
To really do dynamic allocation, you'd of course have to call malloc:
#include <stdlib.h> char **p = malloc(4 * sizeof(char *)); if(p != NULL) { p[0] = malloc(5); p[1] = malloc(3); p[2] = malloc(2); p[3] = malloc(5); if(p[0] && p[1] && p[2] && p[3]) { strcpy(p[0], "this"); strcpy(p[1], "is"); strcpy(p[2], "a"); strcpy(p[3], "test"); } }(Some libraries have a strdup function which would streamline the inner malloc and strcpy calls. It's not Standard, but it's obviously trivial to implement something like it.)
Here is a code fragment which reads an entire file into memory, using the same kind of ragged array. This code is written in terms of the agetline function from question 7.30.
#include <stdio.h> #include <stdlib.h> extern char *agetline(FILE *); FILE *ifp; /* assume ifp is open on input file */ char **lines = NULL; size_t nalloc = 0; size_t nlines = 0; char *p; while((p = agetline(ifp)) != NULL) { if(nlines >= nalloc) { nalloc += 50; #ifdef SAFEREALLOC lines = realloc(lines, nalloc * sizeof(char *)); #else if(lines == NULL) /* in case pre-ANSI realloc */ lines = malloc(nalloc * sizeof(char *)); else lines = realloc(lines, nalloc * sizeof(char *)); #endif if(lines == NULL) { fprintf(stderr, "out of memory"); exit(1); } } lines[nlines++] = p; }(See the comments on reallocation strategy in question 7.30.)
See also question 6.16.
Q: How can I open files mentioned on the command line, and parse option flags?
A: Here is a skeleton which implements a traditional Unix-style argv parse, handling option flags beginning with -, and optional filenames. (The two flags accepted by this example are -a and -b; -b takes an argument.)
#include <stdio.h> #include <string.h> #include <errno.h> main(int argc, char *argv[]) { int argi; int aflag = 0; char *bval = NULL; for(argi = 1; argi < argc && argv[argi][0] == '-'; argi++) { char *p; for(p = &argv[argi][1]; *p != '\0'; p++) { switch(*p) { case 'a': aflag = 1; printf("-a seen\n"); break; case 'b': bval = argv[++argi]; printf("-b seen (\"%s\")\n", bval); break; default: fprintf(stderr, "unknown option -%c\n", *p); } } } if(argi >= argc) { /* no filename arguments; process stdin */ printf("processing standard input\n"); } else { /* process filename arguments */ for(; argi < argc; argi++) { FILE *ifp = fopen(argv[argi], "r"); if(ifp == NULL) { fprintf(stderr, "can't open %s: %s\n", argv[argi], strerror(errno)); continue; } printf("processing %s\n", argv[argi]); fclose(ifp); } } return 0; }(This code assumes that fopen sets errno when it fails, which is not guaranteed, but usually works, and makes error messages much more useful. See also question 20.4.)
There are several canned functions available for doing command line parsing in a standard way; the most popular one is getopt (see also question 18.16). Here is the above example, rewritten to use getopt:
extern char *optarg; extern int optind; main(int argc, char *argv[]) { int aflag = 0; char *bval = NULL; int c; while((c = getopt(argc, argv, "ab:")) != -1) switch(c) { case 'a': aflag = 1; printf("-a seen\n"); break; case 'b': bval = optarg; printf("-b seen (\"%s\")\n", bval); break; } if(optind >= argc) { /* no filename arguments; process stdin */ printf("processing standard input\n"); } else { /* process filename arguments */ for(; optind < argc; optind++) { FILE *ifp = fopen(argv[optind], "r"); if(ifp == NULL) { fprintf(stderr, "can't open %s: %s\n", argv[optind], strerror(errno)); continue; } printf("processing %s\n", argv[optind]); fclose(ifp); } } return 0; }
The examples above overlook a number of nuances: a lone ``-'' is often taken to mean ``read standard input''; the marker ``--'' often signifies the end of the options (proper versions of getopt do handle this); it's traditional to print a usage message when a command is invoked with improper or missing arguments.
If you're wondering how argv is laid out in memory, it's actually a ``ragged array''; see the picture in question 20.2. See also questions 8.2, 13.7, and 19.20.
K&R1 Sec. 5.11 pp. 110-114
K&R2 Sec. 5.10 pp. 114-118
ISO Sec. 126.96.36.199.1
H&S Sec. 20.1 p. 416
PCS Sec. 5.6 pp. 81-2, Sec. 11 p. 159, pp. 339-40 Appendix F
Schumacher, ed., Software Solutions in C Sec. 4 pp. 75-85
Q: What's the right way to use errno?
A: In general, you should detect errors by checking return values, and use errno only to distinguish among the various causes of an error, such as ``File not found'' or ``Permission denied''. (Typically, you use perror or strerror to print these discriminating error messages.) It's only necessary to detect errors with errno when a function does not have a unique, unambiguous, out-of-band error return (i.e. because all of its possible return values are valid; one example is atoi). In these cases (and in these cases only; check the documentation to be sure whether a function allows this), you can detect errors by setting errno to 0, calling the function, then testing errno. (Setting errno to 0 first is important, as no library function ever does that for you.)
To make error messages useful, they should include all relevant information. Besides the strerror text derived from errno, it may also be appropriate to print the name of the program, the operation which failed (preferably in terms which will be meaningful to the user), the name of the file for which the operation failed, and, if some input file (script or source file) is being read, the name and current line number of that file.
See also question 12.24.
ISO Sec. 7.1.4, Sec. 18.104.22.168, Sec. 184.108.40.206
CT&P Sec. 5.4 p. 73
PCS Sec. 11 p. 168, Sec. 14 p. 254
Q: How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
A: The most portable solution is to use text files (usually ASCII), written with fprintf and read with fscanf or the like. (Similar advice also applies to network protocols.) Be skeptical of arguments which imply that text files are too big, or that reading and writing them is too slow. Not only is their efficiency frequently acceptable in practice, but the advantages of being able to interchange them easily between machines, and manipulate them with standard tools, can be overwhelming.
If you must use a binary format, you can improve portability, and perhaps take advantage of prewritten I/O libraries, by making use of standardized formats such as Sun's XDR (RFC 1014), OSI's ASN.1 (referenced in CCITT X.409 and ISO 8825 ``Basic Encoding Rules''), CDF, netCDF, or HDF. See also questions 2.12, 12.38, and 12.42.
References: PCS Sec. 6 pp. 86, 88
Q: If I have a char * variable pointing to the name of a function, how can I call that function? Code like
extern int func(int, int); char *funcname = "func"; int r = (*funcname)(1, 2);or
r = (*(int (*)(int, int))funcname)(1, 2);doesn't seem to work.
A: By the time a program is running, information about the names of its functions and variables (the ``symbol table'') is no longer needed, and may therefore not be available. The most straightforward thing to do, therefore, is to maintain that information yourself, with a correspondence table of names and function pointers:
int one_func(), two_func(); int red_func(), blue_func(); struct { char *name; int (*funcptr)(); } symtab[] = { "one_func", one_func, "two_func", two_func, "red_func", red_func, "blue_func", blue_func, };Then, search the table for the name, and call via the associated function pointer, with code like this:
#include <stddef.h> int (*findfunc(char *name))() { int i; for(i = 0; i < sizeof(symtab) / sizeof(symtab[0]); i++) { if(strcmp(name, symtab[i].name) == 0) return symtab[i].funcptr; } return NULL; } ... char *funcname = "one_func"; int (*funcp)() = findfunc(funcname); if(funcp != NULL) (*funcp)();The callable functions should all have compatible argument and return types. (Ideally, the function pointers would also specify the argument types.)
It is sometimes possible for a program to read its own symbol table if it is still present, but it must first be able to find its own executable (see question 19.31), and it must know how to interpret the symbol table (some Unix C libraries provide an nlist function for this purpose). See also questions 2.15, 18.14, and 19.36.
References: PCS Sec. 11 p. 168
Q: How can I ensure that integer arithmetic doesn't overflow?
A: The usual approach is to test the operands against the limits in the header file <limits.h> before doing the operation. For example, here is a ``careful'' addition function:
int chkadd(int a, int b) { if(INT_MAX - b < a) { fputs("int overflow\n", stderr); return INT_MAX; } return a + b; }See also question 19.39.
Additional links: more sample code
Q: How can I manipulate individual bits?
A: Bit manipulation is straightforward in C, and commonly done. To extract (test) a bit, use the bitwise AND (&) operator, along with a bit mask representing the bit(s) you're interested in:
value & 0x04To set a bit, use the bitwise OR (| or |=) operator:
value |= 0x04To clear a bit, use the bitwise complement (~) and the AND (& or &=) operators:
value &= ~0x04(The preceding three examples all manipulate the third-least significant, or 2**2, bit, expressed as the constant bitmask 0x04.)
To manipulate an arbitrary bit, use the shift-left operator (<<) to generate the mask you need:
value & (1 << bitnumber) value |= (1 << bitnumber) value &= ~(1 << bitnumber)Alternatively, you may wish to precompute an array of masks:
unsigned int masks[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; value & masks[bitnumber] value |= masks[bitnumber] value &= ~masks[bitnumber]
To avoid surprises involving the sign bit, it is often a good idea to use unsigned integral types in code which manipulates bits and bytes.
See also questions 9.2 and 20.8.
K&R1 Sec. 2.9 pp. 44-45
K&R2 Sec. 2.9 pp. 48-49
ISO Sec. 126.96.36.199, Sec. 6.3.7, Sec. 6.3.10, Sec. 6.3.12
H&S Sec. 7.5.5 p. 197, Sec. 7.6.3 pp. 205-6, Sec. 7.6.6 p. 210
Q: How can I implement sets or arrays of bits?
A: Use arrays of char or int, with a few macros to access the desired bit in the proper cell of the array. Here are some simple macros to use with arrays of char:
#include <limits.h> /* for CHAR_BIT */ #define BITMASK(b) (1 << ((b) % CHAR_BIT)) #define BITSLOT(b) ((b) / CHAR_BIT) #define BITSET(a, b) ((a)[BITSLOT(b)] |= BITMASK(b)) #define BITCLEAR(a, b) ((a)[BITSLOT(b)] &= ~BITMASK(b)) #define BITTEST(a, b) ((a)[BITSLOT(b)] & BITMASK(b)) #define BITNSLOTS(nb) ((nb + CHAR_BIT - 1) / CHAR_BIT)(If you don't have <limits.h>, try using 8 for CHAR_BIT.)
Here are some usage examples. To declare an ``array'' of 47 bits:
char bitarray[BITNSLOTS(47)];To set the 23rd bit:
BITSET(bitarray, 23);To test the 35th bit:
if(BITTEST(bitarray, 35)) ...To compute the union of two bit arrays and place it in a third array (with all three arrays declared as above):
for(i = 0; i < BITNSLOTS(47); i++) array3[i] = array1[i] | array2[i];To compute the intersection, use & instead of |.
As a more realistic example, here is a quick implementation of the Sieve of Eratosthenes, for computing prime numbers:
#include <stdio.h> #include <string.h> #define MAX 10000 int main() { char bitarray[BITNSLOTS(MAX)]; int i, j; memset(bitarray, 0, BITNSLOTS(MAX)); for(i = 2; i < MAX; i++) { if(!BITTEST(bitarray, i)) { printf("%d\n", i); for(j = i + i; j < MAX; j += i) BITSET(bitarray, j); } } return 0; }
See also question 20.7.
Additional links: further explanation
References: H&S Sec. 7.6.7 pp. 211-216
Q: How can I determine whether a machine's byte order is big-endian or little-endian?
A: The usual techniques are to use a pointer:
int x = 1; if(*(char *)&x == 1) printf("little-endian\n"); else printf("big-endian\n");or a union:
union { int i; char c[sizeof(int)]; } x; x.i = 1; if(x.c[0] == 1) printf("little-endian\n"); else printf("big-endian\n");
(Note that there are also byte order possibilities beyond simple big-endian and little-endian[footnote] .)
See also questions 10.16 and 20.9b.
References: H&S Sec. 6.1.2 pp. 163-4
Q: How do I swap bytes?
A: V7 Unix had a swab function, but it seems to have been forgotten.
A problem with explicit byte-swapping code is that you have to decide whether to call it or not, based on the byte order of the data and the byte order of the machine in use. Question 20.9 shows how, but it's a nuisance.
A better solution is to define functions which convert between the known byte order of the data and the (unknown) byte order of the machine in use, and to arrange for these functions to be no-ops on those machines which already match the desired byte order. A set of such functions, introduced with the BSD networking code but now in wide use, is ntohs, htons, ntohl, and htonl. These are intended to convert between ``network'' and ``host'' byte orders, for ``short'' or ``long'' integers, where ``network'' order is always big-endian, and where ``short'' integers are always 16 bits and ``long'' integers are 32 bits. (This is not the C definition, of course, but it's compatible with the C definition; see question 1.1.) So if you know that the data you want to convert from or to is big-endian, you can use these functions. (The point is that you always call the functions, making your code much cleaner. Each function either swaps bytes if it has to, or does nothing. The decision to swap or not to swap gets made once, when the functions are implemented for a particular machine, rather than being made many times in many different calling programs.)
If you do have to write your own byte-swapping code, the two obvious approaches are again to use pointers or unions, as in question 20.9. Here is an example using pointers:
void byteswap(char *ptr, int nwords) { char *p = ptr; while(nwords-- > 0) { char tmp = *p; *p = *(p + 1); *(p + 1) = tmp; p += 2; } }
And here is one using unions:
union word { short int word; char halves[2]; }; void byteswap(char *ptr, int nwords) { register union word *wp = (union word *)ptr; while(nwords-- > 0) { char tmp = wp->halves[0]; wp->halves[0] = wp->halves[1]; wp->halves[1] = tmp; wp++; } }
These functions swap two-byte quantities; the extension to four or more bytes should be obvious. The union-using code is imperfect in that it assumes that the passed-in pointer is word-aligned. It would also be possible to write functions accepting separate source and destination pointers, or accepting single words and returning the swapped values.
References: PCS Sec. 11 p. 179
Q: How can I convert integers to binary or hexadecimal?
A: Make sure you really know what you're asking. Integers are stored internally in binary, although for most purposes it is not incorrect to think of them as being in octal, decimal, or hexadecimal, whichever is convenient. The base in which a number is expressed matters only when that number is read in from or written out to the outside world, either in the form of a source code constant or in the form of I/O performed by a program.
In source code, a non-decimal base is indicated by a leading 0 or 0x (for octal or hexadecimal, respectively). During I/O, the base of a formatted number is controlled in the printf and scanf family of functions by the choice of format specifier (%d, %o, %x, etc.) and in the strtol and strtoul functions by the third argument. During binary I/O, however, the base again becomes immaterial: if numbers are being read or written as individual bytes (typically with getc or putc), or as multi-byte words (typically with fread or fwrite), it is meaningless to ask what ``base'' they are in.
If what you need is formatted binary conversion, it's easy enough to do. Here is a little function for formatting a number in a requested base:
char * baseconv(unsigned int num, int base) { static char retbuf[33]; char *p; if(base < 2 || base > 16) return NULL; p = &retbuf[sizeof(retbuf)-1]; *p = '\0'; do { *--p = "0123456789abcdef"[num % base]; num /= base; } while(num != 0); return p; }(Note that this function, as written, returns a pointer to static data, such that only one of its return values can be used at a time; see question 7.5a. A better size for the retbuf array would be sizeof(int)*CHAR_BIT+1; see question 12.21.)
For more information about ``binary'' I/O, see questions 2.11, 12.37, and 12.42. See also questions 8.6 and 13.1.
Additional links: A long reply I sent to someone who was asking how to write a ``binary to decimal'' conversion function
References: ISO Secs. 220.127.116.11,18.104.22.168
Can I use base-2 constants
(something like 0b101010)?
Is there a printf format for binary?
A: No, on both counts, although there are various preprocessor tricks you can try (see the links below). You can convert base-2 string representations to integers with strtol. If you need to print numbers out in base 2, see the example code in question 20.10.
Additional links:
example by Jack Klein
preprocessor trick by Karl Heuer
prettier preprocessor trick by Bill Finke
Q: What is the most efficient way to count the number of bits which are set in an integer?
A: Many ``bit-fiddling'' problems like this one can be sped up and streamlined using lookup tables (but see question 20.13). Here is a little function which computes the number of bits in a value, 4 bits at a time:
static int bitcounts[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; int bitcount(unsigned int u) { int n = 0; for(; u != 0; u >>= 4) n += bitcounts[u & 0x0f]; return n; }
Q: What's the best way of making my program efficient?
A: By picking good algorithms, implementing them carefully, and making sure that your program isn't doing any extra work. For example, the most microoptimized character-copying loop in the world will be beat by code which avoids having to copy characters at all.
When worrying about efficiency, it's important to keep several things in perspective. First of all, although efficiency is an enormously popular topic, it is not always as important as people tend to think it is. Most of the code in most programs is not time-critical. When code is not time-critical, it is usually more important that it be written clearly and portably than that it be written maximally efficiently. (Remember that computers are very, very fast, and that seemingly ``inefficient'' code may be quite efficiently compilable, and run without apparent delay.)
It is notoriously difficult to predict what the ``hot spots'' in a program will be. When efficiency is a concern, it is important to use profiling software to determine which parts of the program deserve attention. Often, actual computation time is swamped by peripheral tasks such as I/O and memory allocation, which can be sped up by using buffering and caching techniques.
Even for code that is time-critical, one of the least effective optimization techniques is to fuss with the coding details. Many of the ``efficient coding tricks'' which are frequently suggested are performed automatically by even simpleminded compilers. Heavyhanded optimization attempts can make code so bulky that performance is actually degraded, by increasing the number of page faults or by overflowing instruction caches or pipelines. Furthermore, optimization tricks are rarely portable (i.e. they may speed things up on one machine but slow them down on another). In any case, tweaking the coding usually results in at best linear performance improvements; the big payoffs are in better algorithms.
If the performance of your code is so important that you are willing to invest programming time in source-level optimizations, make sure that you are using the best optimizing compiler you can afford. (Compilers, even mediocre ones, can perform optimizations that are impossible at the source level).
When efficiency is truly important, the best algorithm has been chosen, and even the coding details matter, the following suggestions may be useful. (These are mentioned merely to keep followups down; appearance here does not necessarily constitute endorsement by the author. Note that several of these techniques cut both ways, and may make things worse.)
Here are some things not to worry about:
(These are examples of optimizations which compilers regularly perform for you; see questions 20.14 and 20.15.)
It is not the intent here to suggest that efficiency can be completely ignored. Most of the time, however, by simply paying attention to good algorithm choices, implementing them cleanly, and avoiding obviously inefficient blunders (i.e. make sure you don't end up with an O(n**3) implementation of an O(n**2) algorithm), perfectly acceptable results can be achieved.
For more discussion of efficiency tradeoffs, as well as good advice on how to improve efficiency when it is important, see chapter 7 of Kernighan and Plauger's The Elements of Programming Style, and Jon Bentley's Writing Efficient Programs.
See also question 17.11.
Q: Are pointers really faster than arrays? How much do function calls slow things down? Is ++i faster than i = i + 1?
A: Precise answers to these and many similar questions depend of course on the processor and compiler in use. If you simply must know, you'll have to time test programs carefully. (Often the differences are so slight that hundreds of thousands of iterations are required even to see them. [footnote] Check the compiler's assembly language output, if available, to see if two purported alternatives aren't compiled identically.)
For conventional machines, it is usually faster to march through large arrays with pointers rather than array subscripts, but for some processors the reverse is true. (Better compilers should generate good code regardless of which notation you use, though it's arguably easier for a compiler to convert array indices to pointers than vice versa[footnote] .)
Function calls, though obviously incrementally slower than in-line code, contribute so much to modularity and code clarity that there is rarely good reason to avoid them. (Actually, by reducing bulk, functions can improve performance.) Also, some compilers are able to expand small, critical-path functions in-line, either as an optimization or at the programmer's request.
Before rearranging expressions such as i = i + 1, remember that you are dealing with a compiler, not a keystroke-programmable calculator. Any decent compiler will generate identical code for ++i, i += 1, and i = i + 1. The reasons for using ++i or i += 1 over i = i + 1 have to do with style, not efficiency. (See also question 3.12b.)
Q: I've been replacing multiplications and divisions with shift operators, because shifting is more efficient.
A: This is an excellent example of a potentially risky and usually unnecessary optimization. Any compiler worthy of the name can replace a constant, power-of-two multiplication with a left shift, or a similar division of an unsigned quantity with a right shift. (Ritchie's original PDP-11 compiler, though it ran in less than 64K of memory and omitted several features now considered mandatory, performed both of these optimizations, without even turning on its optional optimization pass.) Furthermore, a compiler will make these optimizations only when they're correct; many programmers overlook the fact that shifting a negative value to the right is not equivalent to division. (Therefore, when you need to make sure that these optimizations are performed, you may have to declare relevant variables as unsigned.)
Q: People claim that optimizing compilers are good and that we no longer have to write things in assembler for speed, but my compiler can't even replace i/=2 with a shift.
A: Was i signed or unsigned? If it was signed, a shift is not equivalent (hint: think about the result if i is negative and odd), so the compiler was correct not to use it.
Q: How can I swap two values without using a temporary?
A: The standard hoary old assembly language programmer's trick is:
a ^= b; b ^= a; a ^= b;But this sort of code has little place in modern, HLL programming. Temporary variables are essentially free, and the idiomatic code using three assignments, namely
int t = a; a = b; b = t;is not only clearer to the human reader, it is more likely to be recognized by the compiler and turned into the most-efficient code (e.g. perhaps even using an EXCH instruction). The latter code is obviously also amenable to use with pointers and floating-point values, unlike the XOR trick. See also questions 3.3b and 10.3.
Additional links: further reading
Q: Which is more efficient, a switch statement or an if/else chain?
A: The differences, if any, are likely to be slight. The switch statement was designed to be efficiently implementable, though the compiler may choose to use the equivalent of an if/else chain (as opposed to a compact jump table) if the case labels are sparsely distributed.
Do use switch when you can: it's certainly cleaner, and perhaps more efficient (and certainly should never be any less efficient).
See also questions 20.17 and 20.18.
Q: Is there a way to switch on strings?
A: Not directly. Sometimes, it's appropriate to use a separate function to map strings to integer codes, and then switch on those:
#define CODE_APPLE 1 #define CODE_ORANGE 2 #define CODE_NONE 0 switch(classifyfunc(string)) { case CODE_APPLE: ... case CODE_ORANGE: ... case CODE_NONE: ... }where classifyfunc looks something like
static struct lookuptab { char *string; int code; } tab[] = { {"apple", CODE_APPLE}, {"orange", CODE_ORANGE}, }; classifyfunc(char *string) { int i; for(i = 0; i < sizeof(tab) / sizeof(tab[0]); i++) if(strcmp(tab[i].string, string) == 0) return tab[i].code; return CODE_NONE; }
Otherwise, of course, you can fall back on a conventional if/else chain:
if(strcmp(string, "apple") == 0) { ... } else if(strcmp(string, "orange") == 0) { ... }(A macro like Streq() from question 17.3 can make these comparisons a bit more convenient.)
See also questions 10.12, 20.16, 20.18, and 20.29.
K&R1 Sec. 3.4 p. 55
K&R2 Sec. 3.4 p. 58
ISO Sec. 188.8.131.52
H&S Sec. 8.7 p. 248
Q: Is there a way to have non-constant case labels (i.e. ranges or arbitrary expressions)?
A: No. The switch statement was originally designed to be quite simple for the compiler to translate, therefore case labels are limited to single, constant, integral expressions. You can attach several case labels to the same statement, which will let you cover a small range if you don't mind listing all cases explicitly.
If you want to select on arbitrary ranges or non-constant expressions, you'll have to use an if/else chain.
See also questions 20.16 and 20.17.
K&R1 Sec. 3.4 p. 55
K&R2 Sec. 3.4 p. 58
ISO Sec. 220.127.116.11
Rationale Sec. 18.104.22.168
H&S Sec. 8.7 p. 248
Q: Are the outer parentheses in return statements really optional?
A: Yes.
Long ago, in the early days of C, they were required, and just enough people learned C then, and wrote code which is still in circulation, that the notion that they might still be required is widespread.
(As it happens, parentheses are optional with the sizeof operator, too, under certain circumstances.)
K&R1 Sec. A18.3 p. 218
ISO Sec. 6.3.3, Sec. 6.6.6
H&S Sec. 8.9 p. 254
Q: Why don't C comments nest? How am I supposed to comment out code containing comments? Are comments legal inside quoted strings?
A: C comments don't nest mostly because PL/I's comments, which C's are borrowed from, don't either. Therefore, it is usually better to ``comment out'' large sections of code, which might contain comments, with #ifdef or #if 0 (but see question 11.19).
The character sequences /* and */ are not special within double-quoted strings, and do not therefore introduce comments, because a program (particularly one which is generating C code as output) might want to print them. (It is hard to imagine why anyone would want or need to place a comment inside a quoted string. It is easy to imagine a program needing to print "/*".)
Note also that // comments have only become legal in C as of C99.
K&R1 Sec. A2.1 p. 179
K&R2 Sec. A2.2 p. 192
ISO Sec. 6.1.9, Annex F
Rationale Sec. 3.1.9
H&S Sec. 2.2 pp. 18-9
PCS Sec. 10 p. 130
Q: Why isn't there a numbered, multi-level break statement to break out of several loops at once? What am I supposed to use instead, a goto?
A: First, remember why it is that break and continue exist at all--they are, in effect, ``structured gotos'' used in preference to goto (and accepted as alternatives by most of those who shun goto) because they are clean and structured and pretty much restricted to a common, idiomatic usages. A hypothetical multi-level break, on the other hand, would rapidly lose the inherent cleanliness of the single break--programmers and readers of code would have to carefully count nesting levels to figure out what a given break did, and the insertion of a new intermediately-nested loop could, er, break things badly. (By this analysis, a numbered break statement can be even more confusing and error-prone than a goto/label pair.)
The right way to break out of several loops at once (which C also does not have) involves a syntax which allows the naming of loops, so that a break statement can specify the name of the loop to be broken out of.
If you do have to break out of more than one loop at once (or break out of a loop from inside a switch, where break would merely end a case label) yes, go ahead and use a goto. (But when you find the need for a multi-level break, it's often a sign that the loop should be broken out to its own function, at which point you can achieve roughly the same effect as that multi-level break by using a premature return.)
Q: There seem to be a few missing operators, like ^^, &&=, and ->=.
A: A logical exclusive-or operator (hypothetically ``^^'') would be nice, but it couldn't possibly have short-circuiting behavior analogous to && and || (see question 3.6). Similarly, it's not clear how short-circuiting would apply to hypothetical assignment operators &&= and ||=. (It's also not clear how often &&= and ||= would actually be needed.)
Though p = p->next is an extremely common idiom for traversing a linked list, -> is not a binary arithmetic operator. A hypothetical ->= operator therefore wouldn't really fit the pattern of the other assignment operators.
You can write an exclusive-or macro in several ways:
#define XOR(a, b) ((a) && !(b) || !(a) && (b)) /* 1 */ #define XOR(a, b) (!!(a) ^ !!(b)) /* 2 */ #define XOR(a, b) (!!(a) != !!(b)) /* 3 */ #define XOR(a, b) (!(a) ^ !(b)) /* 4 */ #define XOR(a, b) (!(a) != !(b)) /* 5 */ #define XOR(a, b) ((a) ? !(b) : !!(b)) /* 6 */The first is straight from the definition, but is poor because it may evaluate its arguments multiple times (see question 10.1). The second and third ``normalize'' their operands [footnote] to strict 0/1 by negating them twice--the second then applies bitwise exclusive or (to the single remaining bit); the third one implements exclusive-or as !=. The fourth and fifth are based on an elementary identity in Boolean algebra, namely that
_ _(where (+) is exclusive-or and an overbar indicates negation). Finally, the sixth one, suggested by Lawrence Kirby and Dan Pop, uses the ?: operator to guarantee a sequence point between the two operands, as for && and ||. (There is still no ``short circuiting'' behavior, though, nor can there be.)
a (+) b = a (+) b
Additional links: A definitive answer from Dennis Ritchie about ^^
Q: Does C have circular shift operators?
A: No. (Part of the reason why is that the sizes of C's types aren't precisely defined--see question 1.2--but a circular shift makes most sense when applied to a word of a particular known size.)
You can implement a circular shift using two regular shifts and a bitwise OR:
(x << 13) | (x >> 3) /* circular shift left 13 in 16 bits */
Q: Is C a great language, or what? Where else could you write something like a+++++b ?
A: Well, you can't meaningfully write it in C, either. The rule for lexical analysis is that at each point during a straightforward left-to-right scan, the longest possible token is determined, without regard to whether the resulting sequence of tokens makes sense. The fragment in the question is therefore interpreted as
a ++ ++ + band cannot be parsed as a valid expression.
K&R1 Sec. A2 p. 179
K&R2 Sec. A2.1 p. 192
ISO Sec. 6.1
H&S Sec. 2.3 pp. 19-20
Q: If the assignment operator were :=, wouldn't it then be harder to accidentally write things like if(a = b) ?
A: Yes, but it would also be just a little bit more cumbersome to type all of the assignment statements which a typical program contains.
In any case, it's really too late to be worrying about this sort of thing now. The choices of = for assignment and == for comparison were made, rightly or wrongly, over two decades ago, and are not likely to be changed. (With respect to the question, many compilers and versions of lint will warn about if(a = b) and similar expressions; see also question 17.4.)
As a point of historical interest, the choices were made based on the observation that assignment is more frequent than comparison, and so deserves fewer keystrokes. In fact, using = for assignment in C and its predecessor B represented a change from B's own predecessor BCPL, which did use := as its assignment operator. (See also question 20.38).
Q: Does C have an equivalent to Pascal's with statement?
A: No. The way in C to get quick and easy access to the fields of a structure is to declare a little local structure pointer variable (which, it must be admitted, is not quite as notationally convenient as a with statement and doesn't save quite as many keystrokes, though it is probably safer). That is, if you have something unwieldy like
structarray[complex_expression].a = structarray[complex_expression].b + structarray[complex_expression].c;you can replace it with
struct whatever *p = &structarray[complex_expression]; p->a = p->b + p->c;
Q: Why doesn't C have nested functions?
A: It's not trivial to implement nested functions such that they have the proper access to local variables in the containing function(s), so they were deliberately left out of C as a simplification. (gcc does allow them, as an extension.) For many potential uses of nested functions (e.g. qsort comparison functions), an adequate if slightly cumbersome solution is to use an adjacent function with static declaration, communicating if necessary via a few static variables. (A cleaner solution, though unsupported by qsort, is to pass around a pointer to a structure containing the necessary context.)
Q: What is assert() and when would I use it?
A: It is a macro, defined in <assert.h>, for testing ``assertions''. An assertion essentially documents an assumption being made by the programmer, an assumption which, if violated, would indicate a serious programming error. For example, a function which was supposed to be called with a non-null pointer could write
assert(p != NULL);A failed assertion terminates the program. Assertions should not be used to catch expected errors, such as malloc or fopen failures.
K&R2 Sec. B6 pp. 253-4
ISO Sec. 7.2
H&S Sec. 19.1 p. 406
Q: How can I call FORTRAN (C++, BASIC, Pascal, Ada, LISP) functions from C? (And vice versa?)
A: The answer is entirely dependent on the machine and the specific calling sequences of the various compilers in use, and may not be possible at all. Read your compiler documentation very carefully; sometimes there is a ``mixed-language programming guide,'' although the techniques for passing arguments and ensuring correct run-time startup are often arcane. Besides arranging calling sequences correctly, you may also have to conspire between the various languages to get aggregate data structures declared compatibly.
For FORTRAN, more information may be found in FORT.gz by Glenn Geers, available via anonymous ftp from suphys.physics.su.oz.au in the src directory. Burkhard Burow's header file cfortran.h simplifies C/FORTRAN interfacing on many popular machines. It is available via anonymous ftp from zebra.desy.de or at http://www-zeus.desy.de/~burow.
In C++, a "C" modifier in an external function declaration indicates that the function is to be called using C calling conventions.
In Ada, you can use the Export and Convention pragmas, and types from the package Interfaces.C, to arrange for C-compatible calls, parameters, and data structures.
References: H&S Sec. 4.9.8 pp. 106-7
Q: Does anyone know of a program for converting Pascal or FORTRAN (or LISP, Ada, awk, ``Old'' C, ...) to C?
A: Several freely distributable programs are available:
The following companies sell various translation tools and services:
Cobalt Blue 2940 Union Ave., Suite C San Jose, CA 95124 USA (+1) 408 723 0474
Promula Development Corp. 3620 N. High St., Suite 301 Columbus, OH 43214 USA (+1) 614 263 5454
Micro-Processor Services Inc. 92 Stone Hurst Lane Dix Hills, NY 11746 USA (+1) 516 499 4461
See also questions 11.31 and 18.16.
Q: Is C++ a superset of C? What are the differences between C and C++? Can I use a C++ compiler to compile C code?
A: C++ was derived from C, and is largely based on it, but there are some legal C constructs which are not legal C++. Conversely, ANSI C inherited several features from C++, including prototypes and const, so neither language is really a subset or superset of the other; the two also define the meaning of some common constructs differently.
The most important feature of C++ not found in C is of course the extended structure known as a class which along with operator overloading makes object-oriented programming convenient. There are several other differences and new features: variables may be declared anywhere in a block; const variables may be true compile-time constants; structure tags are implicitly typedeffed; an & in a parameter declaration requests pass by reference; and the new and delete operators, along with per-object constructors and destructors, simplify dynamic data structure management. There are a host of mechanisms tied up with classes and object-oriented programming: inheritance, friends, virtual functions, templates, etc. (This list of C++ features is not intended to be complete; C++ programmers will notice many omissions.)
Some features of C which keep it from being a strict subset of C++ (that is, which keep C programs from necessarily being acceptable to C++ compilers) are that main may be called recursively, character constants are of type int, prototypes are not required, and void * implicitly converts to other pointer types. Also, every keyword in C++ which is not a keyword in C is available in C as an identifier; C programs which use words like class and friend as ordinary identifiers will be rejected by C++ compilers.
In spite of the differences, many C programs will compile correctly in a C++ environment, and many recent compilers offer both C and C++ compilation modes. (But it's usually a bad idea to compile straight C code as if it were C++; the languages are different enough that you'll generally get poor results.)
See also questions 8.9 and 20.20.
Additional links:
Bjarne Stroustrup's answer on the subset/superset question
an article by Richard Stamp listing some differences
an article by ``Noone Really'' listing some more
References: H&S p. xviii, Sec. 1.1.5 p. 6, Sec. 2.8 pp. 36-7, Sec. 4.9 pp. 104-107
Q: I need a sort of an ``approximate'' strcmp routine, for comparing two strings for close, but not necessarily exact, equality.
A: Some nice information and algorithms having to do with approximate string matching, as well as a useful bibliography, can be found in Sun Wu and Udi Manber's paper ``AGREP--A Fast Approximate Pattern-Matching Tool.''
Another approach involves the ``soundex'' algorithm, which maps similar-sounding words to the same codes. Soundex was designed for discovering similar-sounding names (for telephone directory assistance, as it happens), but it can be pressed into service for processing arbitrary words.
Knuth Sec. 6 pp. 391-2 Volume 3
Wu and Manber, ``AGREP--A Fast Approximate Pattern-Matching Tool''
Q: What is hashing?
A: Hashing is the process of mapping strings to integers, usually in a relatively small range. A ``hash function'' maps a string (or some other data structure) to a bounded number (the ``hash bucket'') which can more easily be used as an index in an array, or for performing repeated comparisons. (Obviously, a mapping from a potentially huge set of strings to a small set of integers will not be unique. Any algorithm using hashing therefore has to deal with the possibility of ``collisions.'')
Many hashing functions and related algorithms have been developed; a full treatment is beyond the scope of this list. An extremely simple hash function for strings is simply to add up the values of all the characters:
unsigned hash(char *str) { unsigned int h = 0; while(*str != '\0') h += *str++; return h % NBUCKETS; }A somewhat better hash function is
unsigned hash(char *str) { unsigned int h = 0; while(*str != '\0') h = (256 * h + *str++) % NBUCKETS; return h; }which actually treats the input string as a large binary number (8 * strlen(str) bits long, assuming characters are 8 bits) and computes that number modulo NBUCKETS, by Horner's rule. (Here it is important that NBUCKETS be prime, among other things. To remove the assumption that characters are 8 bits, use UCHAR_MAX+1 instead of 256; the ``large binary number'' will then be CHAR_BIT * strlen(str) bits long. UCHAR_MAX and CHAR_BIT are defined in <limits.h>.)
When the set of strings is known in advance, it is also possible to devise ``perfect'' hashing functions which guarantee a collisionless, dense mapping.
K&R2 Sec. 6.6
Knuth Sec. 6.4 pp. 506-549 Volume 3
Sedgewick Sec. 16 pp. 231-244
Q: How can I generate random numbers with a normal or Gaussian distribution?
A: See question 13.20.
Q: How can I find the day of the week given the date?
A: Here are three methods:
#include <stdio.h> #include <time.h> char *wday[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; struct tm tm; tm.tm_mon = 2 - 1; tm.tm_mday = 29; tm.tm_year = 2000 - 1900; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; if(mktime(&tm) != -1) printf("%s\n", wday[tm.tm_wday]);When using mktime like this, it's usually important to set tm_isdst to -1, as shown (especially if tm_hour is 0), otherwise a daylight saving time correction could push the time past midnight into another day.
J is the number of the century [i.e. the year / 100], K the year within the century [i.e. the year % 100], m the month, q the day of the month, h the day of the week [where 1 is Sunday];
q + 26(m + 1) / 10 + K + K/4 + J/4 - 2J
h = (q + 26 * (m + 1) / 10 + K + K/4 + J/4 + 5*J) % 7;(where we use +5*J instead of -2*J to make sure that both operands of the modulus operator % are positive; this bias totalling 7*J will obviously not change the final value of h, modulo 7).
int dayofweek(int y, int m, int d) /* 0 = Sunday */ { static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; y -= m < 3; return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7; }
See also questions 13.14 and 20.32.
ISO Sec. 126.96.36.199
Chr. Zeller, ``Kalender-Formeln''
Q: Is (year % 4 == 0) an accurate test for leap years? (Was 2000 a leap year?)
A: No, it's not accurate (and yes, 2000 was a leap year). The actual rules for the present Gregorian calendar are that leap years occur every four years, but not every 100 years, except that they do occur every 400 years, after all. In C, these rules can be expressed as:
year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)See a good astronomical almanac or other reference [footnote] for details.
Actually, if the domain of interest is limited (perhaps by the range of a signed 32-bit time_t) such that the only century year it encompasses is 2000, the expression
year % 4 == 0 /* 1901-2099 only */is accurate, if less than robust.
If you trust the implementor of the C library, you can use mktime to determine whether a given year is a leap year; see the code fragments in questions 13.14 or 20.31 for hints.
Note also that the transition from the Julian to the Gregorian calendar involved deleting several days to make up for accumulated errors. (The transition was first made in Catholic countries under Pope Gregory XIII in October, 1582, and involved deleting 10 days. In the British Empire, eleven days were deleted when the Gregorian calendar was adopted in September 1752. A few countries didn't switch until the 20th century.) Calendar code which has to work for historical dates must therefore be especially careful.
See also question 13.14b.
Q: Why can tm_sec in the tm structure range from 0 to 61, suggesting that there can be 62 seconds in a minute?
A: That's actually a buglet in the Standard. There can be 61 seconds in a minute during a leap second. It's possible for there to be two leap seconds in a year, but it turns out that it's guaranteed that they'll never both occur in the same day (let alone the same minute).
Q: Here's a good puzzle: how do you write a program which produces its own source code as output?
A: It is actually quite difficult to write a self-reproducing program that is truly portable, due particularly to quoting and character set difficulties.
Here is a classic example (which ought to be presented on one line, although it will fix itself the first time it's run):
char*s="char*s=%c%s%c;main(){printf(s,34,s,34);}"; main(){printf(s,34,s,34);}(This program has a few deficiencies, among other things neglecting to #include <stdio.h>, and assuming that the double-quote character " has the value 34, as it does in ASCII.)
Here is an improved version, posted by James Hu:
#define q(k)main(){return!puts(#k"\nq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");})
Q: What is ``Duff's Device''?
A: It's a devastatingly devious way of unrolling a loop, devised by Tom Duff while he was at Lucasfilm. In its ``classic'' form, it was used to copy bytes, and looked like this:
register n = (count + 7) / 8; /* count > 0 assumed */ switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); }where count bytes are to be copied from the array pointed to by from to the memory location pointed to by to (which is a memory-mapped device output register, which is why to isn't incremented). It solves the problem of handling the leftover bytes (when count isn't a multiple of 8) by interleaving a switch statement with the loop which copies bytes 8 at a time. (Believe it or not, it is legal to have case labels buried within blocks nested in a switch statement like this. In his announcement of the technique to C's developers and the world, Duff noted that C's switch syntax, in particular its ``fall through'' behavior, had long been controversial, and that ``This code forms some sort of argument in that debate, but I'm not sure whether it's for or against.'')
Additional links: longer explanation
Q: When will the next International Obfuscated C Code Contest (IOCCC) be held? How do I submit contest entries? Who won this year's IOCCC? How can I get a copy of the current and previous winning entries?
A: The contest schedule varies over time; see http://www.ioccc.org/index.html for current details.
Contest winners are usually announced at a Usenix conference, and are posted to the net sometime thereafter. Winning entries from previous years (back to 1984) are archived at ftp.uu.net (see question 18.16) under the directory pub/ioccc/; see also http://www.ioccc.org/index.html .
References: Don Libes, Obfuscated C and Other Mysteries
Q: What was the entry keyword mentioned in K&R1?
A: It was reserved to allow the possibility of having functions with multiple, differently-named entry points, à la FORTRAN. It was not, to anyone's knowledge, ever implemented (nor does anyone remember what sort of syntax might have been imagined for it). It has been withdrawn, and is not a keyword in ANSI C. (See also question 1.12.)
References: K&R2 p. 259 Appendix C
Q: Where does the name ``C'' come from, anyway?
A: C was derived from Ken Thompson's experimental language B, which was inspired by Martin Richards's BCPL (Basic Combined Programming Language), which was a simplification of CPL (Combined Programming Language, or perhaps Cambridge Programming Language). For a while, there was speculation that C's successor might be named P (the third letter in BCPL) instead of D, but of course the most visible descendant language today is C++.
References: Dennis Ritchie, ``The Development of the C Language''
Q: How do you pronounce ``char''? What's that funny name for the ``#'' character?
A: You can pronounce the C keyword ``char'' in at least three ways: like the English words ``char,'' ``care,'' or ``car'' (or maybe even ``character''); the choice is arbitrary. Bell Labs once proposed the (now obsolete) term ``octothorpe'' for the ``#'' character.
Trivia questions like these aren't any more pertinent for comp.lang.c than they are for most of the other groups they frequently come up in. You can find lots of information in the net.announce.newusers frequently-asked questions postings, the ``jargon file'' (also published as The [New] Hacker's Dictionary), and the old Usenet ASCII pronunciation list. (The pronunciation list also appears in the jargon file under ASCII, as well as in the comp.unix frequently-asked questions list.)
Q: What do ``lvalue'' and ``rvalue'' mean?
A: Simply speaking, an lvalue is an expression that could appear on the left-hand sign of an assignment; you can also think of it as denoting an object that has a location. (But see question 6.7 concerning arrays.) An rvalue is any expression that has a value (and that can therefore appear on the right-hand sign of an assignment).
Q: Where can I get extra copies of this list?
A: An up-to-date copy may be obtained from ftp.eskimo.com in directory home/scs/C-faq/. You can also just pull it off the net; it is normally posted to comp.lang.c on the first of each month, with an Expires: line which should keep it around all month. A parallel, abridged version is available (and posted), as is a list of changes accompanying each significantly updated version.
The various versions of this list are also posted to the newsgroups comp.answers and news.answers. Several sites archive news.answers postings and other FAQ lists, including this one; two sites are rtfm.mit.edu (directories pub/usenet/news.answers/C-faq/ and pub/usenet/comp.lang.c/) and ftp.uu.net (directory usenet/news.answers/C-faq/). If you don't have ftp access, a mailserver at rtfm.mit.edu can mail you FAQ lists: send a message containing the single word ``help'' to firstname.lastname@example.com for more information. See the meta-FAQ list in news.answers for more information.
An extended version of this FAQ list has been published by Addison-Wesley as C Programming FAQs: Frequently Asked Questions (ISBN 0-201-84519-9). An errata list is at http://www.eskimo.com/~scs/C-faq/book/Errata.html and on ftp.eskimo.com in home/scs/ftp/C-faq/book/Errata .
Read sequentially: prev next up
about this FAQ list about eskimo search feedback copyright
Hosted by


text:
The GCP forum has been created as a tool to help those involved in clinical trials of Investigational Medicinal Products to comply with the clinical trials legislation and GCP requirements. It provides the ideal opportunity for extended communication between researchers and allows users to put forward their comments and get ?real-life? examples of ways in which they can manage robust quality procedures that ensure compliance and which dovetail with their own business needs and resources.
This forum should not be used for direct questions to the GCP Inspectorate/Clinical Trials Unit, reporting serious breaches or making formal complaints. These should follow the formal routes that are already in place.
Please read the Good Clinical Practice (GCP) Forum introduction and rules before posting on this forum.
Please read the Good Clinical Practice (GCP) forum introduction and rules before posting on this forum.
Good Clinical Practice (GCP)...
14th Oct 2011, 11:22 AM
23rd Mar 2019, 03:42 PM
6th Mar 2019, 05:02 PM
13th Oct 2017, 10:47 AM
23rd Jul 2018, 01:59 PM
6th Feb 2019, 09:02 PM
7th Oct 2016, 07:09 AM
MHRA and HRA Position on Who...
15th Jul 2015, 03:11 PM
25th May 2018, 04:10 PM
23rd Mar 2019, 04:41 PM
8th Feb 2019, 09:25 AM
31st May 2018, 04:47 PM
9th Aug 2018, 03:38 PM
5th Apr 2019, 02:48 PM
29th Nov 2017, 04:43 AM
Risk Managment Plan Template...
7th Apr 2017, 04:40 PM
8th Jun 2015, 02:01 PM
3rd Oct 2018, 04:48 AM
Courses on Sponsor Oversight...
26th Nov 2018, 03:25 PM
25th Aug 2016, 07:23 PM
Screening Log & Identifiable...
16th Apr 2019, 03:36 PM


text:
This blog post uses affiliate links. Please read disclaimer.
I admit, most company claims make me roll my eyes to the back of my head. Products allegedly shaving years of your face, singlehandedly tightening the skin around your jaw line so you look like your teenage self while transforming your undereyes from "Tired mom on a Monday" to "Bombshell on a tropical vacation" – I have seen it all.
What I haven´t seen that often though is a product that comes with reasonable claims that are, actually, an understatement!
Like, you read them, are all "Yeah, sounds nice", test the product and are blown away by what it actually can do for you.
That is how I felt when testing THE INKEY LIST Q10.