Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Prime



  A Perl Regular Expression That Matches Prime Numbers

perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"' Can you figure out how it works? I give an explanation below, but try to figure it out yourself. Here is what happens when you run it: $ perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"' 1 2 2 is prime 3 3 is prime 4 5 5 is prime 6 7 7 is prime 8 9 10 11 11 is prime Here is how it works. First, the number is converted in its unary representation by (1x$_). For example, the number 5 gets converted into 1x5, which is ...

   Perl,Regex,Regular expression,Prime number,One line     2011-12-26 08:42:00

  Generate first N prime numbers

Recently I am taking an online course named "Startup Engineering" on coursera. There is one assignment which is to use NodeJS to write a program to generate the first 100 prime numbers. This may be very easy for many people. Here I just want to share with you the code to generate not only the first 100 prime numbers. but also any number of prime numbers. Below is the code snippet: //Helper class to generate prime numbers var PrimeProcessor=(function(){ var primeArray=[]; functio...

   Algorithm,Prime number,NodeJS,coursera,JavaScript     2013-06-29 22:08:22

  Microsoft Interview Riddle Questions

Every year, many people will send their resume to Microsoft and Google. So how do these IT companies hire people? What kind of interview questions will they ask. Let's see what Microsoft asked before in this article. These questions are more focusing on how you are reasoning, not necessary your technical skills. 1.  You’ve got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at...

   Microsoft,Interview question,Riddle questions,Answer     2012-03-10 04:56:48

  World leaders who know how to code

World leaders are those people who have extraordinary speaking skills and are a group of very busy people in most people's impression. But among them, there are a few who know how to program as well. Today we are going to summarize some of them. Lee Hsien Loong -- Singapore Prime Minister Lee Hsien Loong, Singapore Prime Minister posted a C++ program about Sudoku which he wrote several years ago. He shared the source code on Google Drive as well.  In 1971, Mr. Lee studied Mathema...

   World leader, Coding, Programming     2015-08-02 05:56:20

  Collection Of Puzzles For Programmers

Did you know that we have a nice collection of puzzles here on less than dot? Some are harder than others so there is something for everyone. You can pic any language you want, you will see that there are solutions in Ruby, Python, Visual Basic, SQL, JavaScript, C++ and other. Here is a partial list of what we have Friday the Thirteenths The goal is to identify all friday the thirteenths for a given timeframe Regular Pentagon Given a grid co-ordinate (x,y) as the centre point of a regu...

   Programming puzzle,Fibonacci,Prime,ASCII     2012-01-04 08:06:18

  Spending Too Much on Your Streaming Services? Read This

Remember the times when we thought ditching the cable TV might be a good idea to save time as well as all that money? Little did we know that platforms like Netflix, Hotstar, Hulu, HBO, Paramount, Disney Plus, and Apple TV Plus together cost more than the cable alone.  On the brighter side, there are ways to curb your streaming costs without much sacrifice. Do you want to binge-watch all your favorite shows at much fewer costs? Read on some great tips to save all that streaming costs to wa...

   NETFLIX,STREAMING     2022-06-13 07:20:37

  Write Scalable, Server-side JavaScript Applications with Node.js

If you live in the Silicon Valley area, you have already heard the buzz: Node.js is being hailed as the next big thing. It’s the silver bullet that offers scale, eases development, and can be leveraged by the vast pool of client-side JavaScript developers. So, what exactly is Node.js?Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model. It is based on Google's V8 JavaScript engine plus several built-in libraries. The excitement around Node.js is tha...

   Node.js,Server side,Scalable,JavaScript app     2012-03-29 13:50:50

  Why Outsourcing .Net Services is a Growing Trend?

IT companies are focusing more on .net for application development. This is because; the .net platform empowers developers with a wide range of tools and libraries to create diverse applications in an easy and efficient manner. The dot net framework allows users i.e. developers, to design and develop applications that can interact with web services and a range of online devices. .Net programming language is richer than others in many contexts. It has several objects oriented features like proper...

   dot net services, outsourcing, .net, framework     2014-10-23 22:30:43

  Expectations, Desperation And Anticipation All You Need To Know About iOS 9.3

With so much anticipation filled among the audience, iOS 9.3 on contrary came out to be as a blooper. All the users were filled with a lot of enthusiasm about the latest advancements in the software, but the final release went to several crest and troughs. iOS 9.3 was quite important for the users when it comes to mobile OS update, however this did not go as it was expected to be for the iOS. The latest software in some cases is locking users. Along with the users this has also creased the eye ...

   IPHONE APP DEVELOPMENT,IPHONE APP DEVELOPER,IOS DEVELOPER,IOS APP DEVELOPMENT,IPHONE APP DEVELOPERS     2016-04-11 03:05:15

  Turn Your Visitors Into Shoppers With Responsive Magento Website

In recent years, there has been an influential growth in the number of internet users across the world. If statistics are to be believed, almost 83% of the web users are engaged over smart devices like Tablets, Mobiles, Ipads, Laptops, Desktop, etc. In 2008, the core community of Magento released a spellbinding web development solution i.e Responsive Magento Website to uniformly serve the target audience. Due to technological advancement in digital realm, there has been a splurged introduction o...

   MAGENTO DEVELOPERS,RESPONSIVE WEBSITE     2015-10-13 01:50:26