Tuesday, September 29, 2009

About C / C++ / C#: A Big Fat D'oh...

About.com    C / C++ / C#
In the Spotlight | More Topics |
  from David Bolton
So I published Challenge 28 (still one day left to get 27 in- hint!) and then some of the far too clever readers pointed out that the challenge may not be at all challenging. It's Challenge 25 all over again.. Don't ask. So I'll tinker with 28 and if that fails then I'll throw it out and replace it with a better one. Have a good week. Mine can only get better!

 
In the Spotlight
Programming Challenge 28
Only one day to go for Challenge 27 so get a move on! Here's Challenge 28, which may need amending. Write a program that works out the optimal number of trucks and fuel depots to move a large quantity of fuel across a thousand miles of desert. That's it, but there are a few constraints. There are costs for moving trucks (full and empty) and for setting up fuel depots. You can read all about it at the link below.

 
           More Topics
On Programmer productivity
If you work as a programmer, have you ever tracked how exactly you spend your week hour by hour? Here's a breakdown of mine for a typical 40 hour week, I.e. not one when I'm supporting users which is every 6 weeks.
  • Meetings: 4 Hours
  • Interacting with Colleagues : 4 hours
  • Web Browsing: 1 Hour
  • Work Phone Calls: 1 Hour
  • Coffee/Toilet Breaks: 2 hours (Does not include lunch breaks)
  • Emails:4 Hours
  • Supporting Users: 2 Hours
  • Programming: 20 Hours
  • Wasted Time 2 Hours
Just half my time or less is spent programming, and some of that time is documenting or creating sql queries as well as coding and debugging. Wasted time is all the time that's hard to account for, such as 30 seconds bouncing a ball off another developer, personal phone calls, buying cakes from supermarket, signing leaving card, checking personal email on iPhone, etc. Those figures are typical for me except when I'm facing deadlines and then it's hunker down and probably get programming time up to 30 hours a week. It's not surprising though that the main problem with programmer productivity is interruptions. If you're concentrating on a problem and get interrupted, it's believed to take 5-10 minutes to regain your concentration after the interruption. I use headphones and music to signal to my colleagues that I'm busy. What do you use?

 
Illustrated AES with Stickmen
Encryption can be a complicated subject but developer Jeff Moser decided to simplify explaining it. He got out a pen and after reading up on the subject came up with A Stick Figure Guide to the Advanced Encryption Standard (AES) plus accompanying C# code to help study it. The AES (Advanced Encryption Standard) was the winner of a competition to produce a replacement for the DES (data Encryption standard0 which had become crackable due to advances in computing power and better mathematical techniques. It looks like it might take quite a few more years before the same is true for AES. The big worry is that some genius mathematician might come up with a break through perhaps in factorizing large numbers. It hasn't happened yet so for now we can all sleep safe.

 
 
Sponsored Links
 
Cell Phone Picker
Find the Best Cell Phone for You
Simply answer a few easy questions about size, price and features, and you'll receive a personalized list of the five phones that best match your requirements.

C / C++ / C# Ads
Advertisement
 
 
Visit Related About GuideSites:
Search About   

 
Sign up for more free newsletters on favorite topics.

You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter as jarloszy2.profile@BLOGGER.COM. If you wish to change or remove your email address, please visit:
http://www.about.com/nl/usgs.htm?nl=cplus&e=jarloszy2.profile@BLOGGER.COM

About respects your privacy. Our Privacy Policy.

Our Contact Information.
249 West 17th Street
New York, NY, 10011

© 2008 About, Inc.

Monday, September 28, 2009

About Today: Best Cheap Cell Phones by Carrier

About.com    Today
In the Spotlight | More Topics |
  from Jen Hubley
The other day, a friend of mine lost her cell phone. I was really sympathetic, of course. Everyone knows how much it stinks to get everyone's phone number all over again. Then she told me the real issue: Her phone cost $600. Then I died a little.

 
In the Spotlight
Best Cheap Cell Phones by Carrier
I lose things like it's my job. In the past year, I've lost my house keys twice, my cell phone once, and at least three books I was reading, just when I was getting to the good part. I clearly cannot have a cell phone that costs that much money.

 
           More Topics
When to Buy a Refurbished Phone
Refurbished phones are cheaper than new ones, but watch that warranty. (Especially if you're like me, and tend to misplace things.)

 
Which is the Best Phone? Which is Worst?
I have never heard of the worst phone on this list, but it sounds like something Boris and Natasha would have invented while trying to kill moose and squirrel. That is never a good sign.

 
 
Sponsored Links
 
Cell Phone Picker
Find the Best Cell Phone for You
Simply answer a few easy questions about size, price and features, and you'll receive a personalized list of the five phones that best match your requirements.

Today Ads
Advertisement
 
 
Visit Related About GuideSites:
Arts & Entertainment Automotive Careers
Citysearch Cities & Towns Computing & Technology Education
Food & Drink Health & Fitness History
Hobbies & Games Homework Help House & Home
Industry & Business Magazines Money
News & Issues Parenting & Family People & Relationships
Religion & Spirituality Shopping & Style Small Business
Sports Teens Travel
Search About   

 
Sign up for more free newsletters on favorite topics.

You are receiving this newsletter because you subscribed to the About Today newsletter as jarloszy2.profile@BLOGGER.COM. If you wish to change or remove your email address, please visit:
http://www.about.com/nl/usgs.htm?nl=todaysl&e=jarloszy2.profile@BLOGGER.COM

About respects your privacy. Our Privacy Policy.

Our Contact Information.
249 West 17th Street
New York, NY, 10011

© 2008 About, Inc.

Friday, September 25, 2009

About Today: How to Make Gummy Worms

About.com    Today
In the Spotlight | More Topics |
  from Jen Hubley
I'm not a huge sweets person, but even I am helpless to resist the siren song of gummy worms. The combination of gross name/delicious taste is too much for me. Also, there's the whole playing with your food thing, which never ever gets old.

 
In the Spotlight
How to Make Gummy Worms
These worms are raspberry and orange striped, which is, to my way of thinking, the most realistically wormy of all gummy worm colorations.

 
           More Topics
How to Make Chocolate Turtles
Chocolate turtles are delicious and silly, which are two of the very best things to be. (Note: It's important to go to the trouble to arrange the pecans so that they look like little turtle arms and legs. Otherwise, all you have has is delicious, and no silly. That won't do.)

 
How to Make Kibble Candy
It might seem strange to encourage your kids to make (and eat) something that looks like dog chow, but let me tell you: This stuff is delicious. Just, uh, don't give it to the actual dog.

 
 
Sponsored Links
 
Seasonal Pollen Allergies
What is a Seasonal Allergy?
Just when you thought it was safe to leave the house, it's time for fall allergy season to begin. Find out what causes fall allergies and share your coping tips.

Today Ads
Advertisement
 
 
Visit Related About GuideSites:
Arts & Entertainment Automotive Careers
Citysearch Cities & Towns Computing & Technology Education
Food & Drink Health & Fitness History
Hobbies & Games Homework Help House & Home
Industry & Business Magazines Money
News & Issues Parenting & Family People & Relationships
Religion & Spirituality Shopping & Style Small Business
Sports Teens Travel
Search About   

 
Sign up for more free newsletters on favorite topics.

You are receiving this newsletter because you subscribed to the About Today newsletter as jarloszy2.profile@BLOGGER.COM. If you wish to change or remove your email address, please visit:
http://www.about.com/nl/usgs.htm?nl=todaysl&e=jarloszy2.profile@BLOGGER.COM

About respects your privacy. Our Privacy Policy.

Our Contact Information.
249 West 17th Street
New York, NY, 10011

© 2008 About, Inc.

Thursday, September 24, 2009

Welcome to ddankwa Programming Tutorials

hi Fellow Programmers,
              You are all welcome to ddankwa Programming Tutorials. For tutorials on Programming staffs ,  Please  the relevant links that you come across in the course of your browsing. Have a nice day.

       



Little Knowledge in.............

The Below codes are for illustrating what goes into programming

    
#include 
#include 
#include 

#include "fibsrch.h"

/*
 * If val is found in arr, return the index of its location in arr.
 * Otherwise, return the index of the smallest element greater than val
 */

static int binsrch_geq(const int *arrint nint val)
{
register int lowhighmid;
int geq;

  low=0high=n-1geq=-1;

  /* binary search for finding the element with value val */
  while(low<=high){
    mid=(low+high)>>1//(low+high)/2;
    if(val<arr[mid]){
        high=mid-1;
        geq=mid;
    }
    else if(val>arr[mid])
        low=mid+1;
    else
      return mid/* found */
  }

  return geq/* not found */
}

/*
  Fibonaccian search for locating the index of "val" in an array "arr" of size "n"
  that is sorted in ascending order. See http://doi.acm.org/10.1145/367487.367496

  Algorithm description
  -----------------------------------------------------------------------------
  Let Fk represent the k-th Fibonacci number where Fk+2=Fk+1 + Fk for k>=0 and
  F0 = 0, F1 = 1. To test whether an item is in a list of n = Fm ordered numbers,
  proceed as follows:
  a) Set k = m.
  b) If k = 0, finish - no match.
  c) Test item against entry in position Fk-1.
  d) If match, finish.
  e) If item is less than entry Fk-1, discard entries from positions Fk-1 + 1 to n.
     Set k = k - 1 and go to b).
  f) If item is greater than entry Fk-1, discard entries from positions 1 to Fk-1.
     Renumber remaining entries from 1 to Fk-2, set k = k - 2 and go to b)

  If Fm>n then the original array is augmented with Fm-n numbers larger
  than val and the above algorithm is applied.
 */


int fibsrch(const int *arrint nint val)
{
register int kidxoffs;
static int prevn=-1prevk=-1;

/*  Precomputed Fibonacci numbers F0 up to F46. This implementation assumes that the size n
 *  of the input array fits in 4 bytes. Note that F46=1836311903 is the largest Fibonacci
 *  number that is less or equal to the 4-byte INT_MAX (=2147483647). The next Fibonacci
 *  number, i.e. F47, is 2971215073 and is larger than INT_MAX, implying that it does not
 *  fit in a 4 byte integer. Note also that the last array element is INT_MAX rather than
 *  F47. This ensures correct operation for n>F46.
 */

const static int Fib[47+1]={011235813213455891442333776109871597258441816765,
             1094617711286574636875025121393196418317811514229832040134626921783093524578,
             5702887922746514930352241578173908816963245986102334155165580141267914296,
             43349443770140873311349031701836311903INT_MAX};

  /* find the smallest fibonacci number that is greater or equal to n. Store this
   * number to avoid recomputing it in the case of repetitive searches with identical n.
   */

  if(n!=prevn){
#if 1
    k=(n>1)? binsrch_geq(Fibsizeof(Fib)/sizeof(int), n) : 1;
#else /* the above binary search call can be substituted by the following code fragment: */
    {
      register int f0f1t;

      for(f0=0f1=1k=1f1<nt=f1f1+=f0f0=t, ++k)
                            ;
    }
#endif
    prevk=k;
    prevn=n;
  }
  else k=prevk;

  /* If the sought value is larger than the largest Fibonacci number less than n,
   * care must be taken top ensure that we do not attempt to read beyond the end
   * of the array. If we do need to do this, we pretend that the array is padded
   * with elements larger than the sought value.
   */

  for(offs=0k>0;  ){
    idx=offs+Fib[--k];

    /* note that at this point k  has already been decremented once */
    if(idx>=n || val<arr[idx]) // index out of bounds or val in 1st part
      continue;
    else if (val>arr[idx]){ // val in 2nd part
      offs=idx;
      --k;
    }
    else // val==arr[idx], found
      return idx;
  }

  return -1// not found
}

#if 0
/* Sample driver program for fibsrch() */

main()
{
int data[]={14579111316182025273032333639414447515355};
int ixn;

  x=30n=sizeof(data)/sizeof(int);
  i=fibsrch(datanx);
  if(i>=0)
    printf("%d found at index %d\n"xi);
  else
    printf("%d was not found\n"x);
}
#endif

PROGRAMMING TUTORIALS

The World Of Programming Being Made Better......To start with , someone may ask, "what is the essence of programming in the first place. ?" . And another may also ask, "If Programming basically tells us about the extent of TECHNOLOGY, THEN, what is PROGRAMMING?" There a whole lots of disciplines to talk about when talking about Programming. Material on Programming comes in the forms of Video and Books