ছেড়ে সামগ্রীতে যান
টুইটার পরিষেবাগুলি ব্যবহার করে আপনি আমাদের কুকিজ ব্যবহারএ সম্মতি জানাচ্ছেন৷ আমরা এবং আমাদের পার্টনাররা বিশ্বব্যাপী কাজ করি এবং অ্যানালিটিক্স, ব্যক্তিগতকরণ এবং বিজ্ঞাপন সমেত বিভিন্ন কারণে কুকি ব্যবহার করি৷
  • হোম হোম হোম, বর্তমান পৃষ্ঠা।
  • সম্বন্ধে

সংরক্ষিত অনুসন্ধানসমূহ

  • সরান
  • এই কথা-বার্তাতে
    যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @
প্রস্তাবিত ব্যবহারকারীগণ
  • যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @
  • যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @
  • ভাষা : বাংলা.
    • मराठी
    • हिन्दी
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • একটি অ্যাকাউন্ট আছে? লগ ইন
    একটি অ্যাকাউন্ট আছে?
    · পাসওয়ার্ড ভুলে গেছেন?

    টুইটার-এ নতুন ?
    নিবন্ধন করুন
colmmacc-এর প্রোফাইল
Colm MacCárthaigh
Colm MacCárthaigh
Colm MacCárthaigh
@colmmacc

Tweets

Colm MacCárthaigh

@colmmacc

AWS, Apache, Crypto, Irish Music, Haiku, Photography

Seattle
notesfromthesound.com
যোগদান করেছেন এপ্রিল ২০০৮

Tweets

  • © 2018 টুইটার
  • সম্বন্ধে
  • সাহায্য কেন্দ্র
  • শর্তাবলী
  • গোপনীয়তা নীতি
  • কুকিগুলো
  • বিজ্ঞপ্তি তথ্য
খারিজ
পূর্ববর্তী
পরবর্তী

একজন ব্যক্তির প্রোফাইলে যান

সংরক্ষিত অনুসন্ধানসমূহ

  • সরান
  • এই কথা-বার্তাতে
    যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @
প্রস্তাবিত ব্যবহারকারীগণ
  • যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @
  • যাচাইকৃত অ্যাকাউন্টসুরক্ষিত টুইটসমূহ @

এই টুইটটির প্রচার করুন

ব্লক করুন

  • একটি অবস্থান সহ টুইট করুন

    আপনি আপনার টুইটগুলিতে ওয়েব থেকে এবং তৃতীয়-পক্ষ অ্যাপ্লিকেশনগুলির মাধ্যমে অবস্থান তথ্য যেমন শহর বা সুনির্দিষ্ট অবস্থান যোগ করতে পারবেন। আপনার কাছে আপনার টুইটের অবস্থান ইতিহাস মোছার বিকল্প থাকবে। আরও জানুন

    আপনার তালিকাসমূহ

    একটি নতুন তালিকা তৈরি করুন


    100 অক্ষরের কম, ঐচ্ছিক

    গোপনীয়তা

    লিঙ্কটিকে টুইটে অনুলিপি করুন

    এই টুইট স্থাপিত কর

    Embed this Video

    নীচের কোডটি অনুলিপি করে আপনার ওয়েবসাইটে এই টুইটটি যোগ করুন। আরও জানুন

    নীচের কোডটি অনুলিপি করে আপনার ওয়েবসাইটে এই ভিডিওটি যোগ করুন। আরও জানুন

    হুম, সার্ভারে পৌঁছনোর একটি সমস্যা ছিল।

    আপনার ওয়েবসাইটে বা অ্যাপে টুইটার সামগ্রী এম্বেড করে আপনি টুইটার ডেভেলপার চুক্তি এবং ডেভেলপার নীতি-এর সাথে সম্মত হচ্ছেন।

    প্রাকদর্শন

    আপনি কেন এই বিজ্ঞাপন দেখছেন

    টুইটারে লগইন করুন

    · পাসওয়ার্ড ভুলে গেছেন?
    কোনও অ্যাকাউন্ট নেই? নিবন্ধন করুন »

    টুইটারে নিবন্ধন করুন

    টুইটারে নেই? নিবন্ধন করুন, আপনির পছন্দের বিষয়গুলির সাথে যুক্ত হন, এবং তাদের বিষয়ে হালনাগাদ পান।

    নিবন্ধন করুন
    একটি অ্যাকাউন্ট আছে? লগ ইন »

    দুটি উপায় (প্রেরণ এবং গ্রহণ) শর্ট কোড:

    দেশ কোড গ্রাহকদের জন্য
    মার্কিন যুক্তরাষ্ট্র 40404 (যে কোন)
    কানাডা 21212 (যে কোন)
    যুক্তরাজ্য 86444 Vodafone, Orange, 3, O2
    ব্রাজিল 40404 Nextel, TIM
    হাইতি 40404 Digicel, Voila
    আয়ারল্যান্ড 51210 Vodafone, O2
    ভারত 53000 Bharti Airtel, Videocon, Reliance
    ইন্দোনেশিয়া 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    ইতালি 4880804 Wind
    3424486444 Vodafone
    » অন্য দেশসমুহের এসএসএস সংক্ষিপ্ত কোড দেখুন

    নিশ্চিতকরণ

     

    হোমে স্বাগতম!

    আপনার কাছে গুরুত্বপূর্ণ বিষয়গুলি সম্পর্কে তাত্ক্ষণিক আপডেট পেয়ে সময়রেখাতে আপনি সবচেয়ে বেশী সময় কাটান।

    আপনার জন্য টুইটগুলি কাজ করছে না?

    প্রোফাইল ছবির উপরে যান এবং কোনো অ্যাকাউন্টকে করা অনুসরণ বাতিল করতে অনুসরণ করছি বোতামটি ক্লিক করুন।

    অল্প কথায় অনেক কিছু বলুন

    আপনি যখন পছন্দের কোনো টুইট দেখেন তখন হৃদয়টি আলতো চাপুন — এতে যে ব্যক্তি সেটি লিখেছেন তিনি জানবেন যে আপনি ভালোবাসা শেয়ার করেছেন।

    শব্দ ছড়িয়ে দিন

    আপনার অনুসরণকারীদের সাথে কারোর টুইট শেয়ার করে নেওয়ার সবচেয়ে দ্রুত উপায় হল পুনঃটুইট। অবিলম্বে তা পাঠাতে আইকনটি আলতো চাপুন।

    কথোপকথনে যোগ দিন

    জবাব দিয়ে যেকোনো টুইট সম্পর্কে আপনার মতামত যোগ করুন। আপনার আবেগের কোনো প্রসঙ্গ খুঁজুন ও সরাসরি তাতে চলে যান।

    সাম্প্রতিক জানুন

    লোকেরা এখন কী নিয়ে কথা বলছে তাতে তাত্ক্ষণিক অন্তর্দৃষ্টি পান।

    আপনার ভালোবাসার জিনিস আরও পান

    আপনার আগ্রহের প্রসঙ্গ সম্পর্কে তাত্ক্ষণিক আপডেটগুলি পেতে আরও অ্যাকাউন্ট অনুসরণ করুন।

    কী ঘটছে দেখুন

    অবিলম্বে যেকোনো প্রসঙ্গ সম্পর্কে সাম্প্রতিক কথোপকথনগুলি দেখুন।

    কখনও কোনো মুহূর্ত মিস করবেন না

    সেরা কাহিনীগুলি প্রকাশিত হলে তা অবিলম্বে পান।

    Colm MacCárthaigh‏ @colmmacc ২৯ জুন

    Have you ever needed to generate a random number in code? whether it's for rolling a dice, or shuffling a set, this tweet thread is here for you! There's no reason that it should be easy or obvious, very experienced programmers repeat common mistakes. I did, before I learned ...

    ৮:৩০ AM - ২৯ জুন, ২০১৮
    • ৯৯৪টি পুনঃ টুইট
    • ২,৮৮৫টি পছন্দ
    • Esther Wang Moe ☕🍃 Safa Yasin Müjdeci Flameyyy P. David E. B. Ruthvik Piotr Jarzemski Juliano Nando! Quintanilla
    ৩৭ replies ৯৯৪ টি পুনঃটুইট ২,৮৮৫টি পছন্দ
      1. নতুন কথা-বার্তা
      2. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        O.k. let's start with the most common problem, and the most common mistakes: how do we pick a random number between 0 and N inclusive, let's say N = 5, so like a dice that starts at zero because we're nerds.

        ১ reply ০ টি পুনঃটুইট ৫২টি পছন্দ
        এই থ্রেডটি দেখান
      3. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        A common solution is to r = rand() % (N + 1). Easy, right? Wrong! This solution is biased. To see how, imagine that RAND_MAX is "15". 0 % 6 == 0, 6 % 6 == 0, and 12 % 6 == 0 , so there are three rand() values each that return 0. Same works for 1, 2, 3 ...

        ৬ replies ৬ টি পুনঃটুইট ৬৩টি পছন্দ
        এই থ্রেডটি দেখান
      4. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        But there are only two rand() values that return 4: 4 % 6 and 10 % 6. Same for 5. So 0, 1, 2, 3 are all 50% more likely than 4 or 5. That's bias! Of course with a big RAND_MAX, this bias diminishes, but it's still there. So don't do it this way.

        ১ reply ২ টি পুনঃটুইট ৪২টি পছন্দ
        এই থ্রেডটি দেখান
      5. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        O.k. so what if we use a float to avoid this? It's tempting! We can build a float between 0.0 and 1.0 by doing f = (float) rand() / (float) RAND_MAX. So we build a little macro or function for that, and now we can just do r = randFloat() * 5, right?

        ২ replies ১ টি পুনঃটুইট ২১টি পছন্দ
        এই থ্রেডটি দেখান
      6. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        No! This doesn't work other, because FLOATING POINT IS LIES. The distribution between 0.0 and 1.0 is not evenly spread and there's all sorts of rounding fuzziness that will make r non-uniform. No good.

        ৬ replies ৮ টি পুনঃটুইট ৯১টি পছন্দ
        এই থ্রেডটি দেখান
      7. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        The solution here is pretty interesting and totally non-intuitive. What you have to do is to compute the highest multiple of n that is smaller than RAND_MAX. Then you call rand() and if you get a number that's higher, you discard it and go again. E.g. https://github.com/awslabs/s2n/blob/643976c1c03c7f4a3003d7e066f18536c410c2b4/utils/s2n_random.c#L166 …

        ২ replies ২২ টি পুনঃটুইট ১৫০টি পছন্দ
        এই থ্রেডটি দেখান
      8. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        int random(int max) { while(1) { int r = rand(): if (r < (RAND_MAX - (RAND_MAX % max))) { return r % max; } } }

        ৩ replies ৯ টি পুনঃটুইট ১৩১টি পছন্দ
        এই থ্রেডটি দেখান
      9. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        O.k, so there's some probability that this program might never finish! HALTING PROBLEM, etc, etc. The probability is worst when max == (RAND_MAX / 2) + 1. But even then it's a very rapidly diminishing binomial distribution ... so we just shrug our shoulders. It's fine.

        ৪ replies ১ টি পুনঃটুইট ৪৫টি পছন্দ
        এই থ্রেডটি দেখান
      10. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        This is why you should use those APIs that ask for the max, that's why they exist, and this is what's going on under the hood. But if you have to do it yourself. This is how. O.k. next, what if we need to random selection ...

        ২ replies ৪ টি পুনঃটুইট ৫৫টি পছন্দ
        এই থ্রেডটি দেখান
      11. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        OBVIOUSLY to select elements at random, you can just throw them in an array, and choose a random index into the array. But this is BORING. This is a terrible approach for weighted sets, if you want to favor some elements, and it's also common that you want to choose multiples ...

        ১ reply ২ টি পুনঃটুইট ২৬টি পছন্দ
        এই থ্রেডটি দেখান
      12. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        And when you choose multiples, you usually don't want duplicates, so what you often need is a shuffle. How do you shuffle? Well you can call sort() with some kind of customer random as-me comparator. DON'T DO THIS.

        ২ replies ৩ টি পুনঃটুইট ২৬টি পছন্দ
        এই থ্রেডটি দেখান
      13. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Also, DON'T LET YOUR FRIENDS DO THIS. Instead do a Fisher-Yates shuffle. They are super easy ...

        ৩ replies ১ টি পুনঃটুইট ৪৭টি পছন্দ
        এই থ্রেডটি দেখান
      14. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        jumble = [ A , B , C, D, E, F ] for (i = 0; i < jumble.length; i++) { int r = rand(i) save = jumble[i] jumble[i] = jumble[r] jumble[r] = save It's O(N) and it works every time. Super easy to remember if you code it a few times.

        ৮ replies ৮ টি পুনঃটুইট ১৪৪টি পছন্দ
        এই থ্রেডটি দেখান
      15. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        O.k. so that's shuffling, like for your playlist or whatever. But what about weighted sets and selection? What if you want to choose elements but also put a thumb on the scale?

        ১ reply ২ টি পুনঃটুইট ১৮টি পছন্দ
        এই থ্রেডটি দেখান
      16. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Well you could build a set or an array that just repeats elements in them w times, where w is the weight. Eats a lot of space though! and gets super inefficient if you don't want to have duplicates. The COOLEST answer here is to use Vose's Alias.

        ১ reply ৪ টি পুনঃটুইট ২৬টি পছন্দ
        এই থ্রেডটি দেখান
      17. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Sadly, this one is too long for a tweet until next year when twitter decides that we need more space to offend one another, so for now, bookmark this page http://www.keithschwarz.com/darts-dice-coins/ … , or print it out and frame it in case the Internet ever dies. It's one of the best bits.

        ১ reply ১৪ টি পুনঃটুইট ১৭২টি পছন্দ
        এই থ্রেডটি দেখান
      18. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        You can read it for yourself, but it uses a 2d approach to do weighted selection in O(1) time with O(n) space. MAD THAT THIS WORKS. And it reminds me of something else, the last and BONUS randomness item I'll get into ...

        ৩ replies ৩ টি পুনঃটুইট ৩২টি পছন্দ
        এই থ্রেডটি দেখান
      19. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        How do we generate numbers that honor a normal distribution?

        ৩ replies ০ টি পুনঃটুইট ১৭টি পছন্দ
        এই থ্রেডটি দেখান
      20. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        A normal distribution is a super common statistical distribution, it describes the distribution of lots of phenomena and the central limit theorem says that basically any distribution is secretly just one step removed from the normal distribution.

        ১ reply ১ টি পুনঃটুইট ২০টি পছন্দ
        এই থ্রেডটি দেখান
      21. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        That probably didn't make any sense. Here's a Wikipedia page that also won't make much sense: https://en.wikipedia.org/wiki/Normal_distribution … . It especially doesn't make sense that those totally differently looking lines are supposed to be "the same". That's ok though.

        ১ reply ১ টি পুনঃটুইট ২১টি পছন্দ
        এই থ্রেডটি দেখান
      22. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        It's ok because STATISTICS DOESN'T MAKE SENSE. They work really well, but if you think about them for too long and too deeply, you fall into a transcendent state. That's also how we know that statistics are pure science. Anyway, back to the topic ...

        ২ replies ২১ টি পুনঃটুইট ১১৫টি পছন্দ
        এই থ্রেডটি দেখান
      23. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        A cool, though not common any more, way to generate normally distributed numbers is called the Box-Muller transform, https://en.wikipedia.org/wiki/Box–Muller_transform …, and it combines the "Just throw the bad crap away" (aka rejection sampling) and two-dimensional approaches we've seen already.

        ১ reply ২ টি পুনঃটুইট ৩৩টি পছন্দ
        এই থ্রেডটি দেখান
      24. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        With Box-Muller, we choose two random values, between -2^^31 and 2^^31 say, we plot them as x and y on a two dimensional plane. If (x,y) lies within the circle of radius size 2^^31, we keep the point, otherwise we go again. r is the distance from the origin to (x, y) squared.

        ২ replies ০ টি পুনঃটুইট ২০টি পছন্দ
        এই থ্রেডটি দেখান
      25. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Here's a picture from Wikipedia, but basically we're throwing darts at a square and if they land in a circle we're good. It's amazing how much low-level stuff is dumb-as-rocks.pic.twitter.com/pQ97dvdD8x

        ২ replies ৩ টি পুনঃটুইট ৫৫টি পছন্দ
        এই থ্রেডটি দেখান
      26. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        O.k. some parting thoughts before ending this thread. First, if you need to generate random numbers in constant time, or exotic distributions, get super deep into this stuff. There are seriously rough weeds to tackle.

        ২ replies ১ টি পুনঃটুইট ২৫টি পছন্দ
        এই থ্রেডটি দেখান
      27. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Second: if you find yourself building a whole RNG, it's really very hard, again, get deep in the weeds and learn about DRBGs, fork-safety, thread-safety, /dev/urandom, getrandom() and so on. Avoid if you can!

        ৫ replies ০ টি পুনঃটুইট ২৮টি পছন্দ
        এই থ্রেডটি দেখান
      28. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Third: always use a secure RNG, your language or programming environment should have one. *Don't* ever seed an RNG yourself. One exception: for fuzz inputs and other tests, where you may want repeat deterministically for debugging. But DON'T LET IT LEAK INTO PRODUCTION.

        ৪ replies ১ টি পুনঃটুইট ৪২টি পছন্দ
        এই থ্রেডটি দেখান
      29. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Another exception is games, where you may want to generate content and play based on a small seed value, BUT UNDERSTAND THAT THIS IS NOT SECURE.

        ৩ replies ০ টি পুনঃটুইট ৩১টি পছন্দ
        এই থ্রেডটি দেখান
      30. Colm MacCárthaigh‏ @colmmacc ২৯ জুন

        Last tip: always measure your little random functions with a histogram or whatever. I still code these wrong and have to check. Thanks for reading!

        ১১ replies ৮ টি পুনঃটুইট ১২৮টি পছন্দ
        এই থ্রেডটি দেখান
      31. কথা-বার্তা শেষ

    লোড হতে বেশ কিছুক্ষণ সময় নিচ্ছে।

    টুইটার তার ক্ষমতার বাইরে চলে গেছে বা কোনো সাময়িক সমস্যার সম্মুখীন হয়েছে আবার চেষ্টা করুন বা আরও তথ্যের জন্য টুইটারের স্থিতি দেখুন।

      বিজ্ঞাপিত টুইট

      false

      • © 2018 টুইটার
      • সম্বন্ধে
      • সাহায্য কেন্দ্র
      • শর্তাবলী
      • গোপনীয়তা নীতি
      • কুকিগুলো
      • বিজ্ঞপ্তি তথ্য