Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "it all begins"
Would you like to smile for 10 seconds? Read this short story:
During World War II, numerous fighter planes were getting hit by anti-aircraft guns. Air Force officers wanted to add some protective armour/shield to the planes.
The question was "where"?
The planes could only support few more kilos of weight. Mathematicians were called for a short consulting project.
Fighter planes returning from missions were analysed for bullet holes per square foot.
They found 1.93 bullet holes/sq. foot near the tail of planes whereas only 1.11 bullet holes/sq. foot close to the engine.
The officers thought that since the tail portion had the greatest density of bullets, it would be the logical location for putting an anti-bullet shield.
A mathematician said exactly the opposite; more protection is needed where the bullet holes aren't - that is -around the engines.
His judgement surprised everyone. He said "He said We are counting the planes that returned from a mission. Planes with lots of bullet holes in the engine did not return at all".
Moral: Not everything that counts can be counted, and not everything that can be counted, counts.
Source: From the book -
"How Not To Be Wrong", by Jordan Ellenberg.4
Two big moments today:
1. Holy hell, how did I ever get on without a proper debugger? Was debugging some old code by eye (following along and keeping track mentally, of what the variables should be and what each step did). That didn't work because the code isn't intuitive. Tried the print() method, old reliable as it were. Kinda worked but didn't give me enough fine-grain control.
Bit the bullet and installed Wing IDE for python. And bam, it hit me. How did I ever live without step-through, and breakpoints before now?
2. Remember that non-sieve prime generator I wrote a while back? (well maybe some of you do). The one that generated quasi lucas carmichael (QLC) numbers? Well thats what I managed to debug. I figured out why it wasn't working. Last time I released it, I included two core methods, genprimes() and nextPrime(). The first generates a list of primes accurately, up to some n, and only needs a small handful of QLC numbers filtered out after the fact (because the set of primes generated and the set of QLC numbers overlap. Well I think they call it an embedding, as in QLC is included in the series generated by genprimes, but not the converse, but I digress).
nextPrime() was supposed to take any arbitrary n above zero, and accurately return the nearest prime number above the argument. But for some reason when it started, it would return 2,3,5,6...but genprimes() would work fine for some reason.
So genprimes loops over an index, i, and tests it for primality. It begins by entering the loop, and doing "result = gffi(i)".
This calls into something a function that runs four tests on the argument passed to it. I won't go into detail here about what those are because I don't even remember how I came up with them (I'll make a separate post when the code is fully fixed).
If the number fails any of these tests then gffi would just return the value of i that was passed to it, unaltered. Otherwise, if it did pass all of them, it would return i+1.
And once back in genPrimes() we would check if the variable 'result' was greater than the loop index. And if it was, then it was either prime (comparatively plentiful) or a QLC number (comparatively rare)--these two types and no others.
nextPrime() was only taking n, and didn't have this index to compare to, so the prior steps in genprimes were acting as a filter that nextPrime() didn't have, while internally gffi() was returning not only primes, and QLCs, but also plenty of composite numbers.
Now *why* that last step in genPrimes() was filtering out all the composites, idk.
But now that I understand whats going on I can fix it and hypothetically it should be possible to enter a positive n of any size, and without additional primality checks (such as is done with sieves, where you have to check off multiples of n), get the nearest prime numbers. Of course I'm not familiar enough with prime number generation to know if thats an achievement or worthwhile mentioning, so if anyone *is* familiar, and how something like that holds up compared to other linear generators (O(n)?), I'd be interested to hear about it.
I also am working on filtering out the intersection of the sets (QLC numbers), which I'm pretty sure I figured out how to incorporate into the prime generator itself.
I also think it may be possible to generator primes even faster, using the carmichael numbers or related set--or even derive a function that maps one set of upper-and-lower bounds around a semiprime, and map those same bounds to carmichael numbers that act as the upper and lower bound numbers on the factors of a semiprime.
Meanwhile I'm also looking into testing the prime generator on a larger set of numbers (to make sure it doesn't fail at large values of n) and so I'm looking for more computing power if anyone has it on hand, or is willing to test it at sufficiently large bit lengths (512, 1024, etc).
Lastly, the earlier work I posted (linked below), I realized could be applied with ECM to greatly reduce the smallest factor of a large number.
If ECM, being one of the best methods available, only handles 50-60 digit numbers, & your factors are 70+ digits, then being able to transform your semiprime product into another product tree thats non-semiprime, with factors that ARE in range of ECM, and which *does* contain either of the original factors, means products that *were not* formally factorable by ECM, *could* be now.
That wouldn't have been possible though withput enormous help from many others such as hitko who took the time to explain the solution was a form of modular exponentiation, Fast-Nop who contributed on other threads, Voxera who did as well, and support from Scor in particular, and many others.
Thank you all. And more to come.
Links mentioned (because DR wouldn't accept them as they were):
It's funny to consider that my previous rant (https://devrant.com/rants/4510906/...) before I stopped checking this platform as regularly was about what the perfect job would look like to me
Because I just landed it today, people!
Signed with a very chill, medium sized, local dev company that appreciates me as much as I do appreciate them. Starting next month I won't be just a random intern (although they never treated me as such anyway) anymore but a professional developer, with even a slightly more important pay than what you (at least I)'d expect for a junior
Adios annoying courses and mediocre marks, now the fun begins!14
I tried LSD yesterday!
Backstory: I have a weird combo of bipolar type 1 and autism. During the day, my brain works inconsistently. Here how my day usually goes:
09:00. I wake up. Uninterested, cold, masculine. No thoughts in the background. No OCD.
12:00. Brain warms up. Thought process begins. Thoughts are short in their length
14:00. Thoughts start to get longer. Stress starts to accumulate. Background thoughts start, now typically 2–3 at a time.
16:00. Twitching begins. Thought chains are now 5–6 concepts long, one following the other. Perception level rises quickly. I start to feel more feminine. It is in this state that I start to spot imperfections and mistakes looking at code or text without reading it. I see it like a painting, and mistakes appear as “visually wrong” parts. This does not depend on formatting.
17:00. OCD becomes more severe. I HAVE to touch all the surfaces around me, evenly, as if my hands were text highlighters, and I had to paint everything evenly, without overlaps or spots that are brighter or darker than the others. Some surface textures become irritating, and feel quite unpleasant to the touch. If I go for a run now, like 3 km or so, I feel somewhat relieved.
18:00. Things are getting serious. Creativity levels through the roof. I speak in long, never-ending, profound sentences. Background and foreground thoughts almost become one. I appear visually drunk and happy, despite never drinking alcohol. Femininity rises even further. Sometimes, when I speak to a small group of people, especially if I go with friends to meet new people, and we go to some bar, new people ask to record my voice or to write down whatever I’m saying. To be honest, this reason alone is a huge boost to how I see yourself.
19:00. OCD is crazy now. Surfaces have soul.
21:00 <— Gotta take my meds and go to sleep here to prevent what comes at 22:00
22:00. All thoughts, both foreground and background, fully became one. Now my brain officially disobeys me and thinks on its own, and I can ride it like a surfer at best. Twitching becomes concerning. I develop a 1000-yard stare. I am officially a female. Physical strength is somewhat enhanced. Pain tolerance lowered significantly.
23:00. Derealization begins. The world around me appears two-dimensional and flat, like a picture. It is hard to get home on foot, even in close (less than one km) proximity. Brain is fully numb. All that thought monstrosity that was building up is just noise now. Zero “flops” available to think about something I want to think about, like how much money I have on me or what time it is.
I go to sleep. I see nightmares. I wake up, and the cycle repeats.
Contrary to a popular opinion, I never take any “brain-boosting” meds like antidepressants, and I think now you can see why. I consume neither alcohol nor caffeine. Neither me, nor my doctors want my brain to explode. I only take lamotrigine that helps to “lower down” mania, and quetiapine, a neuroleptic, that slows down my brain, like a neuroleptic. Both are there to slow down my brain, to kinda “throttle” my brain like a CPU to cool it down.
That said, 100ug of LSD just… brought me my usual 18:00 state, but in the morning?
All that small-dose recreational ordeal? The thing that helps people feel more energetic and creative?
People pay money… for that? To feel the way I feel every evening?10