DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
function prime($n){
 
      //all numbers that will be evaluated as prime       
     for($i=1;$i<=$n;$i++){     
               $counter = 0; 
              //all probability of divisible factors
              for($j=1;$j<=$i;$j++){                   
                    //$i is divisible by $j, increament the counter
                     if($i % $j==0){                       
                          $counter++;
                    }
              }          
           /*how many greens? they have to be 2 
            ( each prime number has exactly 2 (two) divisors)*/
             if($counter==2){
                 print $i." is Prime <br/>";
             }
      }
} 


prime(20);  //find the Prime for 1-20 range
Highq Collaborate04/09/14
850 views
0 replies

Enterprise collaboration news: March 2014 round-up

The enterprise collaboration news in March was about getting real when it comes to business innovation. This included considering the ways in which technology has influenced business practices, reviewing which improvements need to be made, and suggesting how businesses can not only become more innovative, but help others do so too.

Adi Gaskell04/09/14
418 views
0 replies

The ambiguous relationship between academia and social media

MOOCs are kind of a big deal, with millions of learners from around the world participating in a whole host of courses, the vast majority of which are offered by some of the leading universities in the world.

Michael Brenner04/09/14
517 views
2 replies

The Top 8 Social Networks For Business

Recently, Adobe’s CMO.com released their 5th annual CMO Guide to The Social Landscape highlighting the top 8 social networks for businesses.

Adi Gaskell04/09/14
290 views
0 replies

Are our leaders hampering social business?

A few months ago I wrote about the importance of conscientiousness to social business. People with high levels of conscientiousness have a strong level of compassion for the group, coupled with a confidence to speak up when required.

Allan Kelly04/09/14
4687 views
0 replies

Software Developers: prototype of future knowledge workers?

We work with our brains rather than our brawn. We generate value because of what we know and what that knowledge allows us to do.

Mike Bushong04/09/14
1523 views
0 replies

DIY vs DIFY networking

There is probably never going to be a perfect balance in the industry between Do-it-yourself (DIY) and Do-it-for-you (DIFY) networking

Andrew Fuqua04/09/14
3386 views
0 replies

Don’t Estimate Spikes

If you implement all of your spikes for each release in a “Sprint 0″, you could estimate them. If you do, do so always so that your velocity will be reliable. Spikes are, like defects, generally harder to estimate correctly relative to user stories. It’s best to time-box them.

Lukas Eder04/09/14
8484 views
0 replies

10 Reasons why Java Rocks More Than Ever

But why does Java rock so much? Is it the JVM? Is it the backwards-compatibility? Is it the easy syntax? Or the millions of free and commercial software available to build your software? All of this and much more.

Paul Andrews04/08/14
250 views
0 replies

How to Boost Creativity in the Workplace

Many business owners are focusing their attention on things that they can do in order to increase the creativity of their employees in the workplace.

Christopher Taylor04/08/14
514 views
0 replies

What makes customer loyalty so critical right now?

During a recent trip to the grocery store, I commented at the checkout that I always receive coupons for baby food and diapers along with my receipt. I said sarcastically to the clerk, “You’d think I shop for those things and they know it.

Adi Gaskell04/08/14
614 views
0 replies

The delusions of leadership

I’m sure most of you are familiar with the illusory superiority bias, whereby people tend to believe they’re much better at things than they actually are. Suffice to say, such a lack of self awareness is generally speaking a pretty bad thing in the workplace.

@ Better_working04/08/14
517 views
0 replies

Tool Fragmentation in the Workplace and What You Can Do About It

The rise of the mobile worker, the appetite for flatter and more flexible organisational structures, and an upcoming generation of millennials favouring participation in online communities and social platforms are key factors which have contributed to the recent proliferation of collaborative tools that aim to bring together people and content at work.

Adi Gaskell04/08/14
757 views
0 replies

New site aims to facilitate patient led innovations

The last few years have seen a number of projects form that aim to involve patients much more in the healthcare process. Whilst there have been many sites that have solicited reviews and feedback from patients, they’re not the kind of sites that I’m talking about, interesting though they are.

Allan Kelly04/08/14
3482 views
0 replies

The Prototype of Future Knowledge Workers

Highlighting IT workers as knowledge workers allows us to learn from the existing body of knowledge on the subject.

Lieven Doclo04/08/14
3578 views
0 replies

Johnny Five: a nice introduction to Arduino

Learning Arduino is not simple, especially if you’re not C-minded. It took me a while to see the potential, but if you think about it and join a Raspberry Pi running Node.js with an Arduino with Firmata, there’s not a lot you can’t do.

Oscar Berg04/07/14
513 views
0 replies

Standing On The Shoulders Of Giants

We see more and farther than our predecessors, not because we have keener vision or greater height, but because we are lifted up and borne aloft on their gigantic stature

Adi Gaskell04/07/14
466 views
0 replies

Flexible working bias in academia

A few weeks ago I looked at flexible working and how, despite the numerous benefits of doing so, be that improved productivity, employee engagement, lower office costs and so on, it still wasn’t taking off.

Mark Morrell04/07/14
548 views
0 replies

How to collaborate while you are mobile

I am looking forward to participating at the World Class Mobile and Social- Enabled Enterprises event on 5 and 6 June in Frankfurt, Germany.

Adi Gaskell04/07/14
360 views
0 replies

Don’t forget your workplace wins

Feedback is one of those parts of workplace life that is often easier to talk about than actually give. There have been numerous studies revealing its impact upon things like employee engagement and productivity. Of course, this very much depends upon the nature of the feedback we receive.