সোমবার, ৬ জানুয়ারী, ২০১৪

Exponents


In the table below, the number 2 is written as a factor repeatedly. The product of factors is also displayed in this table. Suppose that your teacher asked you to Write 2 as a factor one million times for homework. How long do you think that would take?
 Answer :

FactorsProduct of FactorsDescription
2 x 2 =42 is a factor 2 times
2 x 2 x 2 =82 is a factor 3 times
2 x 2 x 2 x 2 =162 is a factor 4 times
2 x 2 x 2 x 2 x 2 =322 is a factor 5 times
2 x 2 x 2 x 2 x 2 x 2 =642 is a factor 6 times
2 x 2 x 2 x 2 x 2 x 2 x 2 =1282 is a factor 7 times
2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 =2562 is a factor 8 times

Writing 2 as a factor one million times would be a very time-consuming and tedious task. A better way to approach this is to use exponents. Exponential notation is an easier way to write a number as a product of many factors.

     

   
BaseExponent :
                        The exponent tells us how many times the base is used as a factor.

For example, to write 2 as a factor one million times, the base is 2, and the exponent is 1,000,000. We write this number in exponential form as follows:

21,000,000  read as two raised to the millionth power

Example 1:Write 2 x 2 x 2 x 2 x 2 using exponents, then read your answer aloud.
Solution:2 x 2 x 2 x 2 x 2  =  252 raised to the fifth power

Let us take another look at the table from above to see how exponents work.
Exponential
Form
Factor
Form
Standard
Form
22 =2 x 2 =4
23 =2 x 2 x 2 =8
24 =2 x 2 x 2 x 2 =16
25 =2 x 2 x 2 x 2 x 2 =32
26 =2 x 2 x 2 x 2 x 2 x 2 =64
27 =2 x 2 x 2 x 2 x 2 x 2 x 2 =128
28 =2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 =256

So far we have only examined numbers with a base of 2. Let's look at some examples of writing exponents where the base is a number other than 2.


Example 2:Write 3 x 3 x 3 x 3 using exponents, then read your answer aloud.
Solution:3 x 3 x 3 x 3  =  343 raised to the fourth power

Example 3:Write 6 x 6 x 6 x 6 x 6 using exponents, then read your answer aloud.
Solution:6 x 6 x 6 x 6 x 6  =  656 raised to the fifth power

Example 4:Write 8 x 8 x 8 x 8 x 8 x 8 x 8 using exponents, then read your answer aloud.
Solution:8 x 8 x 8 x 8 x 8 x 8 x 8  =  878 raised to the seventh power


Example 5:Write 103, 36, and 18 in factor form and in standard form.
Solution:
Exponential
Form
Factor
Form
Standard
Form
10310 x 10 x 101,000
363 x 3 x 3 x 3 x 3 x 3729
181 x 1 x 1 x 1 x 1 x 1 x 1 x 11


The following rules apply to numbers with exponents of  0, 1, 2 and 3:
RuleExample
Any number (except 0) raised to the zero power is equal to 1.1490 = 1
Any number raised to the first power is always equal to itself.81 = 8
If a number is raised to the second power, we say it is squared.32 is read as three squared
If a number is raised to the third power, we say it is cubed.43 is read as four cubed


Summary:Whole numbers can be expressed in standard form, in factor form and in exponential form. Exponential notation makes it easier to write a number as a factor repeatedly. A number written in exponential form is a base raised to an exponent. The exponent tells us how many times the base is used as a factor.

Finding Ip Address Of A Website Using Command Prompt Or CMD


undefined
In this tutorial i will teach you to find IPfAddress of any website using Command Prompt or in short CMD. Using IP Address you can find location of the website server and do more stuff. I will demostrate this tutorial with Google but you can use this method to find IP Address of any website like twitter, facebook etc. So lets get started.

How to find IP ?

1. Go to Start > Type CMD and press Enter.
2. Now write Ping followed by website URL whose IP you want to find.
finding ip adddress of website

3. It will take less then a second and come up with the results as shown below.
finding ip adddress of website

In  my nextpost i will show you another easy way to find website IP Address and teach you to use this IP to find its location.

Clever Programming Tricks


All of these tricks are intended to save a factor of at least two (and often ten or more) by local changes to code. Of course algorithmic improvement can provide much greater efficiency gains, so I am assuming that you have done all you can in this respect, BEFORE using these tricks.

Algorithmic Ideas

  • Use a lookup table instead of calculating things when needed. Nowadays tables of 10^6 entries are cheap; indeed tables of 10^8 entries can easily be stored on a CD. Example: Noughts and Crosses (Amer. Tic-Tac-Toe): It may be amusing to write a planner for this game, but for efficiency... Pre-compute a table of size at most 3^9 (9 squares holding 0,X or blank) Positions encode `who is to move' by counting 0's and X's. Mark completed games (wins/draws/losses) as 1/0/-1 (unreachable positions like `both sides have won' can be marked randomly, e.g. draw). Back-propagate to mark all positions (using min or max according to turn). This will mark initial position with result if both sides play as well as possible (i.e. draw for this game). Adding a `best move' entry to the table for each position can be done cheaply during back-propagation. Cost is at most 9*3^9 operations (up to 9 predecessors of each position) which is 177147 steps. Cost to play a move is 1 instruction.

Low level hacks

These are all coded in strictly conformant ANSI C; we use 'unsigned' arithmetic to ensure overflow is ignored. Numeric postfixes like `unsigned32' mean that *at least* 32 bits are required to make this work. (ANSI C guarantees `long' has at least 32 bits, but does not necessarily provide a type suitable for `int64' etc). General assumption. If a routine tests (e.g.) a 32-bit integer having a certain property then the actual argument is assumed to be zero-extended to the size of the container type.
  • Determine parity of a 8-bit byte (assumed zero padded). Really this should be done by a lookup-table, but the following idea (adapted from Digital's DEC-10 assembler manual) is pretty:
    int parity(unsigned8 x) {
      return (((x * 0x10101) & 011111111) * 011111111) >> 21 & 1;
      /* MULT makes 3 copies of x, then AND re-selects each bit in `x' only */
      /* once (separated).  MULT adds up all such in bit 21 (cf long        */
      /* multiplication); OK since there can be no carry in to bit 21.      */
    }
    
  • Determine if a 32-bit word has a zero (8-bit) byte (useful in strcpy/strcmp)
    int haszerobyte(unsigned32 x) {
      return ((x - 0x01010101) & (~x) & 0x80808080) != 0;
    }
    
  • Determine if a 64-bit word has a zero (8-bit) byte (useful in strcpy/strcmp)
    int haszerobyte(unsigned64 x) {
      return ((x - 0x010101010101010) & (~x) & 0x8080808080808080) != 0;
    }
    
  • Count the `1' bits in a 9-bit value:
    int count_ones(unsigned36 x) {
      return ((((x * 01001001001) & 0x111111111) % 15;
    }
    
  • if A is a 9 bit quantity, B gets number of 1's (Schroeppel)
            IMUL A,[1001001001]     ;4 copies
            AND A,[42104210421]     ;every 4th bit
            IDIVI A,17              ;casting out 15.'s in hexadecimal
    
    ;if A is 6 bit quantity, B gets 6 bits reversed (Schroeppel)
            IMUL A,[2020202]        ;4 copies shifted
            AND A,[104422010]       ;where bits coincide with reverse repeated base 2^8
            IDIVI A,377             ;casting out 2^8 - 1's
    
    ;reverse 7 bits (Schroeppel)
            IMUL A,[10004002001]    ;4 copies sep by 000's base 2 (may set arith. o'flow)
            AND A,[210210210010]    ;where bits coincide with reverse repeated base 2^8
            IDIVI A,377             ;casting out 377's
    
    ;reverse 8 bits (Schroeppel)
            MUL A,[100200401002]    ;5 copies in A and B
            AND B,[20420420020]     ;where bits coincide with reverse repeated base 2^10
            ANDI A,41               ;"
            DIVI A,1777             ;casting out 2^10 - 1's
    
References: (Search for hakmem on the web) e.g. http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html  section ofhttp://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html 

Some Tips Of Learning A Programming Language

  • For most people, programming something that interests them or that they can use is more interesting than textbook examples. Use a search engine to find out about projects that interest you.
  • Talk to other programmers; read other programs. This is more important than any book or training course.
  • Practice everyday at least for couple of hours, remember, a perfect practice makes a man perfect.
  • Make use of up-to-date application programming interfaces and official reference materials available from the software publisher.
  • References are there to help you. Don't be ashamed if you don't remember everything by heart; that comes with time. The important thing is knowing where to find reference material.
  • When you learn something new, it is often helpful to implement it yourself and then tweak the design, predicting the results, to make sure you understand the concept.
  • Get involved in a language standardization effort. It could be the ANSI C++ committee, or it could be deciding if your local coding style will have 2 or 4 space indentation levels. Either way, you learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so.
  • Try to solve simulation type problems.
  • If you are interested in game programming, investigate Python, C++, and Java. Of the three, C++ is probably the best performer, Python by far the easiest to learn, and Java best able to run on Windows, Mac OS, and Linux without change.
  • Learn about Free software. Study the source code of the programs available at the Free software directory. Why re-invent the wheel when you can make it better? Just make sure you understand what you're programming.
  • Solve a good number of problems in Java.
  • Take notes and design your own solutions for any particular problems, then seek assistance from others.
  • Learn the most-used and industry-level algorithms.
  • Tutorials of any sort are not sufficient to learn a language well. Try to find people around you who have the same interests, and learn from one another. Browse and join message boards so you can be exposed to the techniques and discussions of a dynamic programming community.
  • For practice, try to teach others. It will not only make you more competent but let you think more deeply from different perspectives.
  • For automating tedious tasks ("scripting") on Windows, look up C# (which is similar to Java), Visual Basic; for other platforms, Perl, Python, and bash (or other shells) are common.

How to Learn a Programming Language

Whether you want to design a video game, develop some cool apps for iPhone or Android or just want to do it for fun, programming is the way to go. Keep reading for detailed instructions on learning a programming language.


1
Decide your goal. Learning a programming language can be both quite interesting and challenging. Even university graduates study a language for years but they might not be able to figure out their specialty. So first decide what you want to become, for example a programmer, a game developer or a robotics expert.


2
Choose a programming language. Always start to learn from a core language. When you first begin to learn, choose mid-level language like C and afterwards C++. Learning these two is a must for any competent and complete programmer, as these are industry standards. Don't start off learning high level languages such as Java or something else as they can prove to be very confusing for a beginner. (You can always learn other languages later, of course, but you'll want to have C and C++, at a minimum, under your belt.). Since C/C++ could look too hard to true beginner, you may prefer Python also. It is widely considered as a good language for beginners. Study a language for at least one year. Learn the common programming paradigms, especially procedural and object-oriented. Read a lot and practice with a compiler or IDE (there are many free ones online). Once you've mastered a language, do not rush to implement. Instead buy some good books on data structure and learn the key subjects like searching, sorting, binary tree and linked list creation etc. Whether it is about game or software development, data structure is the protege. Later, you may move on to a high level language such as Java[1]. For serious programming learn computer algorithms like divide and conquer, greedy method, backtracking, etc. for another year at least.


3
Fall in love with mathematics. For various reasons, many avoid mathematics or just hate them. But to become a good programmer you must solve and exercise a good number of problems on a daily basis, say one problem for one day. As you can see, it is easy to say but difficult to do. It is not important how much knowledge you have in a language but its relevance to a particular problem. Most problems are related to mathematical series (Fibonacci, Floyd triangle, Fourier Series etc). Not only that, there are many mathematical equations that can save a lot of time. So, start to learn new equations and their aspects. Learn discrete mathematics and calculus. Without mathematics, coding is like grassing the cattle.


4
Be self-motivated. Remember, Rome was not built in a day. So don't rush to learn all in a day. Learning programming is not so easy because it employs logic frequently. So, try to understand the logic and practice it, practice until you memorize it. If you are only trying to memorize, you will miss the fun and the concept will be left unclear to you. So, stretch yourself to the limit, but don't try to run before you can walk.


5
Take your time. Even the most accomplished programmers fail to solve a simple problem on certain occasions. So, try to relax when solving a particular problem. Take notes, find a proper algorithm or prepare your own. This is why you must learn data structure and study mathematics. It takes many hours of practicing problem-solving skills on different types of problems before you can call yourself an expert. Sites like Project Euler or Codecademy[2] have many small programming assignments and tutorials that will help you practice and hone your skills.


6
Never back down. Programming can be very frustrating and annoying too if you act carelessly but once you solve a problem all frustration will disappear. Do a lot of calculus (Fourier, Vector, Boundary Problem, Linear Algebra, Matrix). When working on a particularly intricate problem, take periodic breaks to let your brain relax and relegate the problem to your subconscious mind. Make a good schedule for working. When you feel bored, take a nap or walk but never give up, never back down.


7
Become a master. Try to teach others and show your developed applications to others. If you know someone who is better than you, share your thoughts and problems with them, share experience as it will enrich your arsenal. Try to develop your own application imitating professional software like text editor, windows application. Take part in competitions to push yourself to the limit if you dare. Knowing one programming language is good, but mastering more is better, as you'll not only have more tools in your toolbox, but expose yourself to other ways of solving problems, because Regardless of what language you use most often, having knowledge of others to draw on will make you a better programmer and better able to understand common constructs and problems in the abstract. So learn several programming languages, especially two or three with different design philosophies, such as Lisp, Java, and Perl. But learn each of them properly.


8
Be a bookworm. Most well versed programmers are good readers too. They think before they even type a line of code. So, read a lot and think. Recheck your works once a week. (Document your code well, in order to make said rechecking easier.) Further, invest some money in good books. Try to buy the best (not necessarily the best selling) resources. Never slavishly follow a single resource as it will make your outlook narrower. So once you master something, research on it for more use and variations.


9
Invest in Training Centers. If you are not satisfied with your teach-yourself technique, enroll yourself into some beginner's course. But before the enrollment, always research on the previous graduates.

10
Have a lot of practice. Solve hundreds of programming problems. It would be the best if you can invent a lot of them yourself. However, if you can't, several web-sites could be useful:
  • TopCoder - popular US competitive programming website - it can really boost your algorithm knowledge.
  • Codeforces - other competitive programming website - contests here are held bit more often than at TopCoder.
  • Project Euler - great web-site with math-related programming problems.
  • CodeAbbey - problems targeted to real newcomers in programming, simpler then at the resources above.

Best Way Of Learning Programming Languages

With thousands of programming languages out there, it can be daunting to find a language to start with and a good course that assumes no prior knowledge. Especially if you are someone who is busy and wants to learn on their own time and don’t have the flexibility to take an in-person class, getting started with programming can be difficult. This post highlights programming languages that are good for beginning programmers and some resources to get started. 

For those with no experience

These courses have been designed for people who have little or no programming experience.

C

C is one of the most widely used programming languages and often used as an introduction to programming. It has influenced many languages that came after it, and knowledge of C will make learning later languages, such as Objective-C (used by Apple), easier. It influences many later languages you could want to learn, so starting with C will give you a deeper understanding of how computers work.

Java

Java is a higher level language which is designed to be compatible with any operating system. It has similar syntax to C and C++. It’s a great programming language to start with because it is widely used and practical, however it won’t give you as deep of an understanding of computer operation as a lower level language like C will.

C++

C++ bridges the gap between a language like C and Java as it has features of both low-level and high-level languages. It’s another commonly used language that has a wide range of uses and compatibility. It’s based off of C and adds object-oriented features. It has also influenced many other languages such as C# and Java.

Python

Python is a language that was designed with human readability in mind. Because of this, it doesn’t take as much code to execute programs as other languages. It’s a great, easy way to learn recurring concepts in computer science and has real world use in the creation of scripts.

Ruby

Ruby has similar function to Python but is less readable. It’s more object-oriented than Python and is similarly designed with simplicity in mind. It has many applications, but is most often used for web applications.

HTML and CSS

HTML and CSS are used for webpage design. While these languages won’t really help pave the way for learning more traditional programming languages, they are essential for webpage design. HTML (Hypertext Markup Language) is a “markup language” which allows you to put content into a webpage whereas CSS (Cascading Style Sheets), is used to format and define the layout of a page.

MIT App Inventor for Android

If you aren't interested in programming as a profession (at least at the moment) it may be worth looking at using the MIT App Inventor for Android. It requires no coding, but will teach you how programmers think and provide knowledge on some concepts in computing. Plus, you’ll end up being able to make Android apps once you've mastered it!

What’s next?

If you already have knowledge of another programming language then these are great follow-up languages.

C#

C# is primarily used for Windows applications in the .NET Framework. Learning C# is easy if you have experience in C, C++, or Java. The syntax is similar. It’s popularity has been increasing as C# is used for third-party apps on Windows 8 or Windows Phone.

Objective-C

Objective-C is primarily used for Apple’s operating systems, OSX (for Macs) and iOS (for iPhone and iPad). If you are looking to develop for Mac, Objective-C is the way to go. Apple provides lots of support for learning Objective-C through their developer program.

JavaScript

JavaScript (little relation to Java) is a common language used to make webpages more dynamic. With a syntax similar to C, it doesn't require a lot of effort to set up as it’s built into web browsers. It’s also used in other applications such as PDFs.

PHP

PHP is another language often used for web development, although it works well as a general-purpose language as well. PHP can be implemented directly into HTML. Those looking to learn PHP should already know HTML, CSS, and JavaScript.