সোমবার, ২৬ মার্চ, ২০১৮

Why do you learn programming?

Let's start with a problem. Suppose you were told to find out the sum of the number of 1 to 10 which can be divided into three numbers. The job is very simple, because 1 to 10 divided by 3 would be 3, 6 and 9. Their sum is 18. To make sure it does not take you more than a minute, it's sure. But if it is said to divide the numbers from 1 to 1000 which can divide by 3 or 5, then you will be a little confused. Because now you have to verify with a number but it will take a lot of time. 
Right here you need a magnifying glass or computer. If you tell the computer that the number between 1 and 1000 is divided by 3, keep them separate and finally add all and say the answer, then in a second you will get the answer.
For this instruction, the computer can not be interpreted as a Bengali. In that case you have to write a program using special language. That is to use the programming language. Here's the importance of the computer, the importance of programming languages ​​here. With these we can speed up a lot of big calculations. 
Now let's move on with the problem above. By typing the program, you can now divide the numbers between 1 and 1000 that divide by 3. In that case, you have to run a loop, which will turn around and perform the same instructions. The value of a variable inside this loop is going from 1 to 1000 and every time the clock rotates the circle will be divided by 3. If the fraction is empty then you add the number to another variable. In that case, the type of code will be as follows - 
x = 0
For i in range (0,1000): 
if i% 3 == 0: 
x = x + i 
print (x) 
Now if you understand that, then by writing it in any programming language you can solve the problem. Here the first x = 0 is actually assumed to be a variable (declared) and its value is zero. Now a for loop has been executed, where there is another variable named 'i', which can go from 0 to 1000 inside the loop and it will have the value of i that is going to change it to 3, it will see if the remainder is 0. If the (if) fraction is 0, then the value of i will be added to x. And at the end of the program, x will print the value of your screen (show on screen). 
The problem is solved here, is it? But there is another interesting thing here. See, if you can solve the problem without running a loop from 0 to 1000!
First we will see our sum from 1 to 10-- 
18 = 3 + 6 + 9 is also 
written like this - 
18 = 3 (1 + 2 + 3) In 
this case you get a series of n and a number of algebraic series. In the case of 100, this series is like this: 
3 (1 + 2 + 3 + 4 + ... + 33) 
The sum of these series but you can easily find out through this formula-
If you do not do this in the loop, then you can put this form in your program and do it. It has a benefit. Each time it takes a certain time to run the loop. So if the loop rotation is more than the amount of time it will take longer. You will not see this in case of small shorter work. But if this problem range from 0 to 100,000,000? When you solve your home computer with a loop, it will be a matter of time. Here the mathematical formula implies that we reduced this timeframe to say it's Optimization. This is also the goal of a skilled programmer.
At the beginning of programming, many people do not understand what language they start with. Java, C ++ or Python? Again those who start with C continue to feel like they are worn again - "C ++ is more advanced or upgraded, would not it be good to start with?" The real thing is, you can start with any one. But to become a proficient programmer, you first need to know how to deal with a problem first. Before solving a problem, it needs to be sorted out in our thinking world. If you can not think of that, you can not be a very skilled programmer even after learning four or five programming. 
Basically the basics of programming that need to be learned are variables, conditional programs, loops, data structures and libraries. If you catch these five ideas, you can get acquainted with any programming language.
If you have a programming language, you will need to understand the basics of any other, for just two days. There is no lack of programming tools on the Internet. A lot of information is being added in Bangla language But before that you have to learn how to think. In that case you can learn a language and solve some programming problems online. In this case, Hackerrank, UVa, URI is good for starting these three websites. 
Some questions 
1. How many problems will be solved for being proficient in programming? 
Many people have been annoyed at the first part of the writing, hearing the consolidation of the problem. You might want to create a great application for desktop or smartphones by a creative person who quickly learns the programming. That's why the problem needs to be taken positively.
You can learn C ++ or Python if you want to create a desktop application. The advantage of learning Python is, it is easy to learn and is very popular at the present time. If you want to create a mobile app, you have to learn Java. But in this case, if you want to write a program efficiently, it is better to experience some problems beforehand. This will increase your programming skills, as well as the patience to deal with different problems. But the competition programmer will not work. The problem solving of programming is actually like a game to programmers. 
2. What is the need to learn mathematics in order to learn programming?
It is better to know at least the level of school level math. Actually mathematics is a tool that we can use to make things easier for us. As we have seen above, how we make a program easier or simpler by using a formula. You do not need to know all the time for this how the formula came exactly. You must know basically how and where to use mathematics. Mathematics is not usually taught in our field at the school-college level. So it is seen that many people are afraid of mathematics. 
3. Where to learn Bangla programming?
Now many people in this country write blogs in bangla Those who do programming also write too. So programming resources in Bangla are very fast. Google will get a lot of information. You can see Subin's blog to start with C. Besides, there are many books in Bengali that are available on programming. There are also tutorials on YouTube. 
4. What should be brilliant for being a proficient programmer?
What is the definition of merit before that? Well, tell me from my own experience. At our university, at the beginning of the programming course, I saw a friend who was getting computer for the first time in life. It would have been easier to find out what the programming would do, where the keyboard had a letter. But he was able to raise his skills so much that he studied in the waking hours of his life and so much that the students who had already studied had fallen behind him. You do not have to be talented to become a proficient programmer, but if you learn to do programming efficiently then people will call you meritorious.

শুক্রবার, ২৩ মার্চ, ২০১৮

প্রোগ্রামিং কেনো শিখব?

একটি সমস্যা দিয়ে শুরু করা যাক। ধরুন আপনাকে বলা হলো ১ থেকে ১০ পর্যন্ত সংখ্যার যে ক’টি সংখ্যা ৩ দিয়ে ভাগ করা যায় সেগুলোর যোগফল কত তা বের করতে। কাজটা কিন্তু খুবই সহজ, কারণ ১ থেকে ১০ এর মধ্যে ৩ দিয়ে ভাগ যায় ৩, ৬ ও ৯। এদের যোগফল ১৮। এটা সমাধান করতে যে আপনার এক মিনিটের বেশি লাগবে না সেটা নিশ্চিত। কিন্তু যদি বলা হয় ১ থেকে ১০০০ পর্যন্ত যে সংখ্যাগুলো ৩ অথবা ৫ দিয়ে ভাগ যায় তার যোগফল বের করতে, তাহলে কিন্তু আপনি একটু ঝামেলায় পড়ে যাবেন। কারণ এবার আপনি একটি একটি সংখ্যা নিয়ে যাচাই করতে গেলে কিন্তু অনেক সময় লেগে যাবে।
ঠিক এখানে আপনার দরকার একটি গণকযন্ত্র বা, কম্পিউটার। আপনি যদি কম্পিউটারকে বলেন ১ থেকে ১০০০ এর মধ্যে যে সংখ্যাগুলো ৩ দিয়ে ভাগ করা যায় তাদের আলাদা করে রাখো এবং শেষে সবগুলো যোগ করে উত্তরটা বলো, তাহলে এক সেকেন্ডেই আপনি উত্তর পেয়ে যাবেন।
এই যে নির্দেশনা দিচ্ছেন এর জন্য তো আর কম্পিউটারকে বাংলায় বলে বোঝাতে পারবেন না। সেক্ষেত্রে আপনাকে বিশেষ ভাষা ব্যবহার করে একটি প্রোগ্রাম লিখতে হবে। অর্থাৎ প্রোগ্রামিং ভাষা ব্যবহার করতে হবে। এখানেই কম্পিউটারের প্রয়োজনীয়তা, এখানেই প্রোগ্রামিং ভাষার গুরুত্ব। এগুলো দিয়ে আমরা অনেক বড় বড় হিসাবের কাজ দ্রুত করিয়ে নিতে পারি।
এবার তাহলে উপরের সমস্যাটা নিয়েই এগোনো যাক। প্রোগ্রাম লিখে এখন আপনি ১ থেকে ১০০০ এর মধ্যে যে সংখ্যাগুলো ৩ দিয়ে ভাগ যায় সেগুলোকে আলাদা করবেন। সেক্ষেত্রে আপনাকে একটি লুপ বা ঘূর্ণি চালাতে হবে, যেটা বার বার ঘুরে ঘুরে একই নির্দেশনা সম্পাদন করবে। এই লুপের ভেতর একটি চলকের মান ১ থেকে শুরু করে ১০০০ পর্যন্ত যাবে এবং প্রতিবার ঘোরার সময় চলকটিকে ৩ দ্বারা ভাগ করা হবে। যদি ভাগশেষ শূন্য হয় তাহলে সংখ্যাটিকে আপনি আরেকটি চলকের সাথে যোগ করবেন। সেক্ষেত্রে আপনার কোডটির ধরন হবে অনেকটা এরকম-
x = 0
for i in range(0,1000):
if i%3==0:
x = x + i
print(x)
এখন এটুকু যদি আপনি বুঝতে পারেন তাহলে যেকোনো প্রোগ্রামিং ভাষাতেই তা লিখে আপনি সমস্যাটির সমাধান করতে পারেন। এখানে প্রথম x = 0 দিয়ে আসলে একটি চলক ধরে নেয়া হয়েছে (declare করা হয়েছে) এবং তার মান ধরা হয়েছে শূন্য। এবার একটি for লুপ চালানো হয়েছে যেখানে ‘i’ নামের আরেকটি চলক রয়েছে যার মান লুপের ভেতর ০ থেকে ১০০০ পর্যন্ত যাবে এবং প্রতি ধাপে এটি i এর যে মান থাকবে তাকে ৩ দিয়ে mod করে দেখবে যে ভাগশেষ ০ থাকে কিনা। যদি( if ) ভাগশেষ ০ হয় তাহলে i এর মান x এর সাথে যোগ করবে। এবং প্রোগ্রাম শেষে x এর মান আপনার স্ক্রিনে print করে দেবে (স্ক্রিনে দেখিয়ে দেবে)।
সমস্যাটা এখানেই সমাধান হয়ে গেল, তাই তো? কিন্তু এখানে আরো একটি মজার ব্যাপার আছে। দেখুন, তো ০ থেকে ১০০০ পর্যন্ত লুপ চালানো ছাড়াই আপনি সমস্যাটা সমাধান করতে পারেন কিনা!
প্রথমে দেখুন ১ থেকে ১০ পর্যন্ত আমাদের যোগফল এরকম আসবে-
18 = 3 + 6 + 9
একে এরকমও লেখা যায়-
18 = 3(1+ 2 + 3)
এক্ষেত্রে আপনি কিন্তু একটা সিরিজ n সংখ্যক সংখ্যার একটা বীজগাণিতিক সিরিজ পাচ্ছেন। ১০০ এর ক্ষেত্রে এই সিরিজটা হবে এরকমঃ
3(1+2+3+4+…+33)
এ ধরনের সিরিজের যোগফল কিন্তু আপনি সহজেই এই সূত্র দিয়ে বের করতে পারবেন-
সেক্ষেত্রে কিন্তু আপনাকে লুপ না চালিয়ে এই সূত্র আপনার প্রোগামে বসিয়ে নিমিষেই কাজটা করে ফেলতে পারছেন। এর একটা সুবিধা আছে। প্রতিবার লুপ চালাতে একটা নির্দিষ্ট সময় খরচ করা লাগে। তাই লুপ ঘোরার পরিমাণ বেশি হলে সময়টাও বেশি লাগবে। ছোট খাটো কাজের ক্ষেত্রে ব্যাপারটা আপনার চোখে পড়বে না। কিন্তু এই সমস্যাটির সীমা যদি ০ থেকে ১০০,০০০,০০০ এর মধ্যে হয়? তখন আপনি লুপ দিয়ে আপনার বাসার কম্পিউটারে সমাধান করতে গেলে সময়ের ব্যাপারটি চোখে পড়বে। এখানে গাণিতিক সূত্র প্রয়োগ করে যে আমরা এই সময়সীমা কমিয়ে আনলাম একে বলে Optimization। এটাও একজন দক্ষ প্রোগ্রামারের লক্ষ্য।
প্রোগ্রামিং শেখার শুরুতে অনেকে এই ভেবেই কূল পায় না যে, কোন ভাষা দিয়ে শুরু করবেন। Java, C++ নাকি Python? আবার যারা C দিয়ে শুরু করেন তাদের মনে আবার খচ খচ করতে থাকে – “C++ তো আরও আধুনিক বা, আপগ্রেডেড, ওটা দিয়ে শুরু করলে ভালো হত না?” । আসল কথা হলো, আপনি যেকোনো একটা দিয়ে শুরু করতে পারেন। কিন্তু দক্ষ প্রোগ্রামার হওয়ার জন্য আসলে আগে প্রয়োজন আপনি একটি সমস্যাকে কীভাবে দেখেন। একটি সমস্যা প্রোগ্রামিং করে সমাধানের আগে সেটা আসলে আমাদের চিন্তার জগতে সমাধান করা লাগে। সেই চিন্তাটাই যদি আপনি না করতে পারেন তাহলে চার পাঁচটা প্রোগ্রামিং শিখেও আপনি খুব একটা দক্ষ প্রোগ্রামার হতে পারবেন না।
মূলত প্রোগ্রামিংয়ের বেসিক যে ধারণাগুলো শেখার দরকার হয় সেগুলো হলো- চলক (variable), শর্তমূলক নির্দেশনা (conditional program), লুপ, ডাটা স্ট্রাকচার এবং লাইব্রেরি। এই পাঁচটি ধারণা আপনি ধরতে পারলে যেকোনো প্রোগ্রামিং ভাষাই আপনি রপ্ত করে নিতে পারবেন।
একটি প্রোগ্রামিং ভাষা পারলে অন্য যেকোনোটির মূল কথা বুঝতে আপনার সময় লাগবে মাত্র দুই দিনের মতো। ইন্টারনেটে প্রোগ্রামিং বিষয়ক উপকরণের অভাব নেই। বাংলা ভাষাতেও প্রচুর তথ্য যুক্ত হচ্ছে। কিন্তু তার আগে আপনাকে চিন্তা করাও শিখতে হবে। সেক্ষেত্রে আপনি একটি ভাষা শিখে সেটি দিয়ে অনলাইনে কিছু প্রোগ্রামিং সমস্যার সমাধান করতে পারেন। সেক্ষেত্রে Hackerrank , UVa, URI এই তিনটি ওয়েবসাইট শুরু করার জন্য ভালো।
কিছু প্রশ্ন
১. প্রোগ্রামিংয়ে দক্ষ হওয়ার জন্য কতগুলো সমস্যার সমাধান করবো?
অনেকে হয়তো লেখার প্রথম অংশে সমস্যা সসমাধানের কথা শুনে বিরক্ত হয়ে গেছেন। আপনি হয়তো একজন সৃষ্টিশীল মানুষ যে প্রোগ্রামিংটা দ্রুত শিখে ফেলে ডেক্সটপ বা স্মার্টফোনের জন্য দারুণ দারুণ এপ্লিকেশন বানাতে চান। সেজন্য সমস্যাকে ইতিবাচক দিক থেকে গ্রহণ করতে হবে।
আপনি যদি ডেক্সটপ এপ্লিকেশন (অ্যাপ) বানাতে চান সেক্ষেত্রে C++ বা Python শিখতে পারেন। Python শেখার সুবিধা হলো, এটি শেখা সহজ এবং এখনকার সময়ে অনেক জনপ্রিয়। আর মোবাইল App বানাতে চাইলে আপনাকে Java শিখতে হবে। তবে এক্ষেত্রেও দক্ষভাবে প্রোগ্রাম লিখতে গেলে আগে থেকে কিছু সমস্যা সমাধানের অভিজ্ঞতা থাকা ভালো। এতে আপনার প্রোগ্রামিং দক্ষতা যেমন বাড়বে, বিভিন্ন সমস্যা মোকাবেলা করার ধৈর্য্যও বাড়বে। কিন্তু প্রতিযোগী প্রোগ্রামার না হলেও চলবে। প্রোগ্রামিং সমস্যার সমাধান করা আসলে প্রোগ্রামারদের কাছে একটা খেলার মতো।
২.প্রোগ্রামিং শেখার জন্য খুব বেশি করে গণিত শেখা দরকার কি?
অন্তত স্কুল লেভেলের গণিত ভালোভাবে জানা থাকলেই ভালো। আসলে গণিত একটি হাতিয়ার যেটি আমরা বিভিন্ন কাজে ব্যবহার করে আমাদের কাজ সহজ করে ফেলতে পারি। উপরে যেমনটি দেখালাম, একটি সূত্র ব্যবহার করে আমরা কীভাবে একটি প্রোগ্রামকে সহজ বা সরল করে ফেললাম। এর জন্য আপনাকে সব সময় জানার দরকারও পড়বে না সূত্রটা ঠিক কীভাবে এলো। আপনাকে মূলত জানতে হবে গণিত কীভাবে এবং কোথায় ব্যবহার করতে হয়। আমাদের দেশে স্কুল-কলেজ পর্যায়ে আসলে বেশিরভাগ ক্ষেত্রেই গণিতকে আনন্দের সাথে শেখানো হয় না। তাই দেখা যায় গণিত নিয়ে অনেকের মধ্যে ভয় কাজ করে।
৩. বাংলা ভাষায় প্রোগ্রামিং শিখবো কোথায় থেকে?
এখন এদেশে অনেকেই বাংলায় ব্লগ লেখে। প্রোগ্রামিং যারা করে তারাও লিখছে খুব। তাই বাংলাতে প্রোগ্রামিং বিষয়ক রিসোর্স খুব দ্রুতই সমৃদ্ধ হচ্ছে। গুগল করলেই অনেক তথ্য পেয়ে যাবেন। C দিয়ে শুরু করার জন্য সুবিনের ব্লগ দেখতে পারেন। এছাড়া বাংলায় অনেক বই আছে প্রোগ্রামিং-এর উপর । ইউটিউবেও টিউটোরিয়াল আছে।
৪. দক্ষ প্রোগ্রামার হওয়ার জন্য কি মেধাবী হতে হবে?
তার আগে জানতে হবে মেধাবীর সংজ্ঞা কী? আচ্ছা, আমার নিজের অভিজ্ঞতা থেকে বলি। আমাদের ইউনিভার্সিটিতে প্রোগ্রামিং কোর্সের শুরুতে এক বন্ধুকে দেখেছিলাম যে কিনা জীবনে প্রথমবারের মতো কম্পিউটার ধরছে। প্রোগ্রামিং কী করবে , কী-বোর্ডের কোথায় কোন অক্ষর আছে তা খুঁজতেই দিন পার হয়ে যেত। কিন্তু সে নিজের চেষ্টায় রাত জেগে জেগে অনুশীলন করে নিজের দক্ষতা এতটাই বাড়াতে সক্ষম হয়েছে যে আগে থেকে শিখে আসা শিক্ষার্থীরাও তার পেছনে পড়ে গিয়েছিল। আসলে দক্ষ প্রোগ্রামার হওয়ার জন্য আপনাকে মেধাবী হওয়ার দরকার নেই, বরং প্রোগ্রামিং দক্ষভাবে করতে শিখে গেলে লোকজনই আপনাকে মেধাবী ডাকবে।

সোমবার, ৫ মার্চ, ২০১৮

Shortcut key

Technology makes our life easier and comfortable . Now a days people find the shortcut form of his every steps.  So every time people try to minimize their work.

A keyboard is the most commonly input device, where data is entered manually by pressing the key. A keyboard has 101 to 105 key.

Today I want to discuss with you about the shortcut key.

General Windows keyboard shortcuts

Alt+Tab
Switch between open applications in all versions of Windows. Reverse the direction by pressing Alt+Shift+Tab at the same time.
Ctrl+Tab
Switches between program groups, tabs, or document windows in applications that support this feature. Reverse the direction by pressing Ctrl+Shift+Tab at the same time.
Alt+double-click
Display the properties of the object you double click  on in Windows 95 and later. For example, doing this on a file would display its properties.
Alt+Print Screen
Create a screenshot  only for the active program window in all versions of Windows. For example, if you opened the calculator and pressed these shortcut keys, only the calculator window would be created as a screenshot. If just the print screen key is pressed the whole screen will be made into a screenshot.
Ctrl+Alt+Del
Open the Windows option screen for locking computer, switching user, task manager , etc. in later versions of Windows. Pressing Ctrl+Alt+Del multiple times will rebot  the computer.
Ctrl+Shift+Esc
Immediately bring up the Windows Task Manager  in Windows 2000 and later.
Ctrl+Esc
Open the Windows Start Menu in most versions of Windows. In Windows 8 this opens the Start menu and in Windows 3.x this would bring up the Task Manager.
Alt+Esc
Switch between open applications on task bar in Windows 95 and later.
Alt+Spacebar
Drops down the window control menu for the currently open Windows program in Windows 95 and later.
Alt+Enter
Opens properties window of selected icon or program in Windows 95 and later.