Those feel-good moments in tech

Those feel-good moments in tech
What was a memorable feel-good moment for you in technology? For me, it was the first time I wrote a program that made any noticable difference in CPU usage and wasn't just sitting there wasting cycles. It was a real
moment.

Other urls found in this thread:

forum.openmw.org/viewtopic.php?f=2&t=3419
greasyfork.org/en/scripts/32906//
creativecommons.org/licenses/by-sa/4.0///
twitter.com/NSFWRedditGif

It'll be when Zig Forums makes mandatory to upload a cover when creating a thread.

Young me doing C64 assembler programming: wanting to calculate a percentage with 16-bit unsigned values, however the BASIC rom only handled signed ints (30000 / 40000 -> 1.175272..) .. Aha!-moment-- divide both by 2 before doing the FP division.

Uni-age me: Installing NetBSD-0.9, downloading the source for TeX onto floppy, bringing it home, doing the build and watching web2c do its awesome thing on my own computer! .. 24 hours later, TeX and Metafont finished building completely without a single hitch. Fuck yeah-- now I have a Real Computer.

I can barely get basic programs to compile these days without complaining about needing dependencies for basic shit that doesn't add to the overall usefulness of the program.

Knuth is regarded as a God among Men for a reason..

I wrote a python script with ncurses to mass import morrowind mods into openmw and adjust load order and display the readme and whatnot.
It works so well I actually use it more than the official openmw launcher for mod editing.
forum.openmw.org/viewtopic.php?f=2&t=3419

Another feel-good moment was when I discovered a firefox addon created by some tinfoil russians: Third-party request blocker, the successor of RequestPolicy (and potentially also NoScript).
Some of the options made me laugh, but the issues they're resolving are no laughing matter at all. Those guys are actually leet.

Related feel-good moment: Set your user agent to "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/40.0" and you can browse YouTube without JavaScript.
I have no idea what yt executives thought when they made the decision to blacklist certain noscript users but not others.
In recent FF and TBB versions you need an addon to change the user agent because mozilla is shit.

Doesn't work. If it works for you, it's because your script blocker fucked up.

the first time i made a code-cave to cheat in an online game 12 years ago. then i learned about executable image formats and the machine architecture etc, learned that windows lacks any isolation, and learned all UNIX-based shit is just as bad. from there on there was not a single feel-good moment
[3 captchas were solved for this post]

Are you a fag or something? Use invidio.us or this
// ==UserScript==// @name Get me Old Youtube// @namespace greasyfork.org/en/scripts/32906// @version 1.2.2// @description Sets a Cookie which loads the old Youtube layout (as long as available)// @author Artain// @match *://www.youtube.com/*// @exclude *://www.youtube.com/tv*// @exclude *://www.youtube.com/embed/*// @exclude *://www.youtube.com/live_chat*// @run-at document-start// @homepageURL greasyfork.org/en/scripts/32906// @license creativecommons.org/licenses/by-sa/4.0/// @grant none// ==/UserScript==(function() { 'use strict'; function start() { var cookie = getPref(), pref = "f6=8"; if(cookie === "fIsAlreadySet") { return; } else if(cookie !== "noPref"){ for(var i = 0; i < cookie.length; ++i) { pref = pref + "&" + cookie[i].key + "=" + cookie[i].value; } } changePref(pref); } function changePref(values) { var d = new Date(); d.setTime(d.getTime() + (100*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = "PREF=" + values + ";" + expires + ";domain=.youtube.com;hostonly=false;path=/"; location.reload(); } function getPref() { var cookie = document.cookie, splitC = cookie.split(";"); for(var i = 0; i < splitC.length; ++i) { if(splitC[i].trim().indexOf("PREF") === 0) { if(splitC[i].trim().indexOf("f6=8") > -1) { return "fIsAlreadySet"; } var c = [], splitValues = splitC[i].substring(5).split("&"); for(var k = 0; k < splitValues.length; ++k) { var splitV = splitValues[k].split("="); if(splitV[0] !== "f6") { var kv = {}; kv.key = splitV[0]; kv.value = splitV[1]; c.push(kv); } } return c; } } return "noPref"; } start();})();

GMail can also run without javascript.

...it actually becomes a very good email client.

1) Trying to make a symbolic differentiator in C/C++ . I was in the 9'th or 10'th grade. It overwhelmed me.
Learned lisp because it seemed like the right thing to do it in. Wrote symbolic differentiation in lisp. It worked. High-level programing language powers now infused my brain, so I could do it in C if I wanted to.

At a later time I installed the Allegro common lisp server, and got a web page to do symbolic differentiation. Also was able to send lisp commands remotely at home if I configured it that way. Not very secure, but still, way cool.

2) At uni, at a contest in a foreign country, met a student who had to write an interpreter for a toy programing language in C. He was struggling at around 738 lines of code, and still didn't get all the control structures working correctly. I took a look at the the specifications and said "Dude, I can do it in 100 lines" . It actually took 137, was tight, yet abstract, and the control-flow made liberal use of goto to emulate all the other structures. The student was taught against go-to, but it's the mother of all control structures, so it's only fitting for it to be used to emulate them in an interpreter. I still consider it one of the most awesome pieces of code I've ever written.

3) I used modular arithmetic and correct data-structures (a linked list of arrays) to write a linear equation solver in C for a huge system. It was finally running correctly in constant memory. There were about 42600 equations with at least as many unknowns.

4) recently wrote a high-level numeric tensor library in Haskell in one morning at it just worked. All the ones I've looked at didn't use labeled indices, so writing and doing actual math in them was a pain. It only had a single bug with null-tensors, but I got it fixed. Having had just one bug at that kind of project is awesome.

5) Wrote a toy program that simulates 2d motion in various geometries. Eg. sphere torus, hyperbolic space. Got inspired by hyper rouge. This is a (low-res) screenshot of the spaceship (the light-blue triangle) being in some sort of closed-hyperbolic space. All light-blue triangles of it are "mirrors", so they move simultaneously. It first goes up, then comes from the upper-right side, etc. It's beautiful to watch. I'll try and find the program and learn how to make a gif of the spaceship moving.

Attached: hyp.jpg (400x400, 21.85K)

People got told "goto man bad" by idiots who never read Dijkstra themselves and keep perpetuating that myth. Dijkstra never said to not use goto, he said that languages should be designed in a way that goto should not be needed.

Of course if you have a language where there are legitimate use-cases for goto (like in C) you should use it. I used to follow the advice like a sheep as well, but when I noticed that goto would allow me to write shorter and cleaner code I thought to myself "there is no way a man as intelligent as Dijkstra could have said something this stupid". And sure enough, when I looked up the man himself I found out that he never said anything that stupid.

How did you get in constant memory when just the size of the input is linear? Also, i'm curious to see your implementation cause I don't see how modular arithmetic and linked lists of arrays help in this case.

Attached: you_seem_transparent.jpg (480x361, 40.37K)

I recently became a Senior Software Engineer. Greatest accomplishment of my life.

I found the old code. Well, you know if you want a full 46200*46200 array of integers you're probably fucked. The point is, most of the entries in the equation were zero, so it was what you call a "sparse system".
It was actually a set of equalities between two systems, something along the lines of:
y1 + y2 = x1 + 2*x2 + x4
y1 = 5*x1 + x3
y2 = x2
And I was actually looking for a combination of terms such that the left-hand side gives 0.
I ended up storing the linear system as a linked-list of pairs of (non-fixed length) arrays. Representing the right hand side and left-hand side of the equation. Now, since the majority of terms were zero-valued, i used an array of (index,value) type elements, and stored only the non-zero values. Eg:
6*x1 + 2*x2 + 5*x7 = y1 + y2 would be "abstractly", something along the lines of:
3, [(1,6) , (2,2) , (7,5)]
for the left-hand side and something similar for the right hand side. A structure formed from an integer representing the size of the array and an array of (index,value) pairs representing the indices of the non-zero values in the equation. The indices were always sorted. So you see, because I used sparse representation, the size would alter dynamically if I added two equations, because the number of non-zero indices would change.

I kept the list of equations "sorted" so that the equations with the smallest non-zero index on the left-hand side would always appear first. The empty list would be considered to be smallest of all. Then, if the left-hand side was zero we were done, and if it wasn't, I could check if the next equation in line had a greater first non-zero index. If it had a greater index, we could eliminate the first equation, because there was no combination of it that would eliminate its first index. If they had the same index, we added them in linear combination to eliminate it, insert the resulting equation to the list (it would now either be 0 of the left-hand side or have a greater first non-zero index), delete the first equation, and continue on with the algorithm.

That's the algorithm. Now, why modular arithmetic? I actually used arithmetic mod 2147483647, which is one of the largest primes smaller than or equal to max-int. The system had integer coefficients, and I needed an integer solution. The problem with C++ is I kept getting (unnoticed) overflows and they fucked with the result. If you use modular arithmetic you're safe from overflows, but you only get the result mod p. The point is, p was big enough and the coefficients of the result small enough that I could recover the result r from (r times a constant) mod p.

The code itself is not very readable, tough I'll upload if if you want. i learned tough that it makes a ton of difference in memory usage and performance what structures you use. I initially used linked-lists instead of arrays for the equations, but the pointer-arithmetic and memory overhead was not worth it. You're not sorting the members, you're just adding and subtracting them. Linked lists are not worth it in this case.

Attached: fish.jpg (660x440, 60.61K)

Admittedly , it was never exactly constant size, but comparing to the linked-list version, the memory alterations and usage were so small it might as well have been (up to 3gb for the linked list version compared to a maximum of 300 mb for the array version, for the given data-set)

So yeah, it was wrong to call it "constant memory".
I had a fixed given system to solve, and all the old version of the program usually kept gobbling memory until it crashed (tough it might have worked on 32gb computers) . The new (array) version stayed low memory. Just my impression and I forgot to detail the context.

Anytime I automate something I used to do manually, ie my clusterfuck of a backup system

Every time just everything falls into place and *just works*. That is always satisfying. Also every time a "feels good man" moment when I realize my networked machines take care of themselves well and only present me with the high level decisions. I became the guy I dreamt of being when I was the kid that just learned some BASIC. Also always feels good when I realize how I easily manage to do things the non-bloated, old-school way with tools thirty and more years old while self-declared specialists that hold speeches and go to conventions couldn't do the same if they tried.

The moment I built my ARM workstation and realized I could do most of the things I want to do with a computer that fits into my pocket. For the young ones not a big thing, but kinda mind-boggling for someone who started out with a C64 sometimes. I still have more powerful machines that I use as X clients and VMs I get my stuff remotely from. Again, it just works and that tiny computer barely consuming 3W is just comfy all around.

The moment I realize I turned a system I thought up into something working for my 4x game I've been writing on for years and see everything in the simulation just fall into place and the by now all the rather complex parts interacting with each other. I don't even play the game, a lot of times I just like watching what happens.

The moment I quit working in the tech field. It gave me the enjoyment of tech related things back. Don't turn your hobby into work, kids. Not quite related to the question but also the moment I realized I don't need much to be content and gave up on the rat race. I'm much happier now. No matter how much you earn, there is no way to buy the time back you lost.

I've set it to that via a cookie.