Showing posts with label প্রোগ্রামিং. Show all posts
Showing posts with label প্রোগ্রামিং. Show all posts

The Rising Popularity of Computer Programming



History of programming language


The evolution of programming

Cracking the code


infographic
Which Programming language should learn first ?


Cracking the Code: The Rising Popularity of Computer Programming

The Growing Economy
● It is estimated that, by 2020 computer-related employment will rise 22%
● Resulting in the creation of 1.4 MILLION jobs in computer sciences
● Strongest demand will be for software developers
● According to Code.org, computer-programming jobs are growing at 2X the US national average
● LESS THAN 2.4% of students graduate with degrees in computer science
● If current job trends continue, U.S. citizens will only fill 30% of our country’s computer science jobs
Learn the Basics
Coding teaches problem solving, creativity and communication skills to kids and adults alike.
● Algorithms
○ The math that makes up programs
● Cryptography
○ How confidential info is passed around the Internet
● Machine intelligence
○ How services like Netflix can learn your preferences
● Computational biology
○ How the genetic code works
● Heuristics
○ Experience-based problem-solving, learning and discovery

Big News for Coding

● Beginning in September, 2014, England will implement computer coding as a compulsory school subject at all grade levels
● U.S. Representative Tony Cardenas has introduced a new bill which, if passed will classify computer programming as a foreign language and allocate grants for schools to teach coding as early as kindergarten
● According to Jason Calanis, CEO of Mahalo and the founder of the startup showcase LAUNCH conference, an employee who understands how to code is worth $500,000 TO $1 MILLION toward a company’s total acquisition price
But How Do I Learn?
● Don’t worry. There are many programs and apps that offer resourcing to learn how to code
■ Codeacademy
■ Code.org
■ Code School
■ Udemy
■ Lynda
■ Treehouse
■ CoderDojo 



Uva : 10812 -- Beat The Spread!

Problem Link


সমস্যাটি সল্ভ করতে গিয়ে আমি যথেষ্ট পরিমাণ মজা পাইসি :D। প্রবলেমটির key word লেখা আসে একবারে লাস্টে। 
এখানে দুইটি কন্ডিশনকে Terminate করতে হবে প্রথমত, final scores must be non negative এবং দ্বিতীয়ত, পূর্ণ সংখ্যা হতে হবে।
প্রথম শর্তের জন্য (s>b) তাহলেই a=(s+d)/2 and b=(s-d)/2 positive হবে। 
অপর শর্তের জন্য, a and b দশমিক সংখ্যা হবে যখন   a and b এর মধ্যে একটি even and another must be odd number হবে। এজন্য (s+d)/2 কারন, দুটি বিজোড় সংখ্যার যোগফল সব সময় একটি জোড় সংখ্যা।

আমি মনে হয় ভালোভাবে গুছিয়ে লিখতে পারি নাই প্রবলেমটা ভালো মত পড়লেই পুরো বিষয়টা পরিষ্কার হয়ে যাবে।

Uva 10055 : Hashmat the brave warrior


Problem A
Hashmat the brave warrior
Input: standard input

Output: standard output


Hashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the opponent's soldier number. From this difference he decides whether to fight or not. Hashmat's soldier number is never greater than his opponent.


Input
The input contains two integer numbers in every line. These two numbers in each line denotes the number of soldiers in Hashmat's army and his opponent's army or vice versa. The input numbers are not greater than 2^32. Input is terminated by End of File.

Output
 For each line of input, print the difference of number of soldiers between Hashmat's army and his opponent's army. Each output should be in seperate line.

Sample Input:
10 12
10 14
100 200

Sample Output:
2
4
100
___________________________________________________________________________________ 
Shahriar Manzoor
16-12-2000


problem link






কোন কারনে আমার answer টা নিচ্ছিল না, ৩ বার চেষ্টা করার পর answer সাবমিট হইছে, পরে বুঝতে পারলাম কেন এরকম হল। 

int long long নিতে হবে তা না হলে value overflow হয়ে যাবে। দ্বিতীয়ত, ইনপুট কোনটা আগে দিবে হাশমত নাকি শত্রুপক্ষের এইটা দেওয়া নাই, একে কন্ট্রোল করতে হবে। End of file Termination করতে হবে। 
আমার যে সমস্যা হইছিল আমি  এই condition   (The input numbers are not greater than 2^32) কে কন্ট্রোল করার জন্য 

if(os>=hs && hs<=n && os<=n)
এরকম একটা condition দিছিলাম কিন্তু সেটার আসলে কোন প্রয়োজন নাই, কারন int long long নিলে অটোমেটিক এটা Terminate হয়ে যাবে।

n=pow(2,32);






ইউলার প্রবলেম নাম্বার ১০

problem : The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.
https://projecteuler.net/problem=10


প্রবলেমটা বুজতে অসুবিধা হওয়ার কথা না।1 – 2000000 range এর মধ্যে সবগুলা প্রাইম নাম্বারের যোগফল বের করতে হবে।
এখানে মূল বিষয়টি হচ্ছে আপনাকে প্রোগ্রামটি efficient  করতে হবে।
প্রাইম নাম্বার বের করার অনেক গুলো কনসেপ্ট আছে
১. n number টি ১ এবং n দ্বারা বিভাজ্য হলে প্রাইম নতুবা প্রাইম না।
২. 1 থেকে  n/2 range এর মধ্যে যতগুলো  নাম্বার আছে সেগুলো দিয়ে যদি n বিভাজ্য হয় তাহলে n প্রাইম নাম্বার।
৩. 1 থেকে n পর্যন্ত  যতগুলো নাম্বার আছে তাদের মধ্যে শুধুমাত্র বিজোড় সংখ্যা গুলো চেক করতে হবে।(২ একমাত্র জোড় প্রাইম নাম্বার )।

১ নাম্বার লজিক দিয়ে সমস্যাটি সমাধান করা যাক


কি ব্যাপার execute হচ্ছে না কেন !!?? হবে ধৈর্য ধরে 8/9 মিনিট অপেক্ষা করুন হবে :D
উপরের বাকি লজিক গুলো দিয়ে সল্ভ করলেও একই অবস্থা হবে programming contest এ আপনার ৩/৪ সেকেন্ড  execution time  দেওয়া থাকে সেখানে এত সময় লাগলে হবে না।

এই ধরনের বড় বড় প্রাইম নাম্বার সমস্যা সমাধানের জন্য আপনাকে সিভ অফ এরাটস্থেনিজ(Sieve of Eratosthenes) অ্যালগরিদম জানতে হবে। সিভ মানে হল ছাঁকনি। এই এলগোরিদমে কম্পোজিট নাম্বারগুলো থেকে প্রাইম নাম্বারগুলোকে ছেঁকে আলাদা করা হয়। আর গ্রিক গণিতবিদ এরাটস্থেনিজ  (২৭৬ পূর্বাব্দ – ১৯৫ পূর্বাব্দ) এই এলগোরিদমের আবিষ্কারক বিধায় এলগোরিদমটির নাম দেওয়া হয়েছে ‘সিভ অফ এরাটস্থেনিজ’। দ্রুততার সাথে প্রাইম নাম্বার বের করার ক্ষেত্রে এলগোরিদমটি এতোটাই কার্যকর যে ২২০০ বছরের পুরোনো এই এলগোরিদম আজও কম্পিউটার বিজ্ঞানে ব্যবহার করা হয়! এর সাহায্যে ১০ মিলিয়নের মধ্যে অবস্থিত সকল প্রাইম নাম্বার অনায়াসেই বের করে ফেলা যায়।

সিভ অফ এরাটস্থেনিজ )Sieve of Eratosthenes)  থিওরিঃ সকল যৌগিক সংখ্যার অন্তত একটি উৎপাদক সংখ্যাটির বর্গমূলের ছোট বা সমান হবেই।অর্থাৎ n সংখ্যাটি prime হবে যদি √n এই সীমার মধ্যে একটি সংখ্যা দিয়েও n বিভাজ্য না হয়। 
সিভ অফ এরাটস্থেনিজ (Sieve of Eratosthenes)  থিওরি প্রয়োগ করে সমাধান






long long int  নেয়ার কারন হল int  by default  size 32 bit  long long  means 32+16+16=64 bit.
প্রথমে ধরা যাক নাম্বারটি প্রাইম তাই count=1, child লুপে চেক করা হয়েছে i প্রাইম কিনা এজন্য i কে একবার ভাগ করলেই হবে যদি i%j==0  হয় তাহলে সংখ্যাটি প্রাইম আর তা না হলে লুপ থেকে বের হয়ে যাবে এবং parent লুপে গিয়ে sum=sum+i হবে অর্থাৎ প্রাইম সংখ্যা গুলোকে যোগ করবে।


Projecteuler.net সাইটে আপনার সমাধান সঠিক হলে আপনি ঐ সমাধানের একটি উপর বিস্তারিত অ্যালগরিদম সহ একটি pdf file পাবেন যেখানে ঐ সমস্যা সমাধানের জন্য কি থিওরি ব্যাবহার করতে হবে সব বিস্তারিত ব্যাখ্যা করা আছে। তবে সমাধান না করা পর্যন্ত আপনি pdf file টি পাবেন না। নিচে ফাইলটির ডাউনলোড লিংক দেওয়া আছে ডাউনলোড করে নিতে পারেন,অনেক কিছুই জানতে পারবেন।