Show newer
namark boosted
namark boosted

how in the world can -DNDEBUG or -fno-rtti make code slower?! >.<

namark boosted
namark boosted

I failed to design a CPU yesterday specifically suited to voice recognition, but today I'd like to explain how I'd (naively) design a general purpose CPU to address their current vulnerabilities.

Basically I'd add length & permissions data to every pointer (making them 128bits long), and store a bitmask indicating which bytes are pointers. Thereby moving more fine-grained security checks into the hardware.

This would break *some* C programs, but the damage should be minimal and worth it.

namark boosted

Now that the upgrade is complete a lot of you are probably curious about the new features we added. They were mostly pulled in from the Fedibird fork, but the code had to be considerable modified to get fully working. The following is the complete list of new features introduced in this upgrade.

Domain Subscriptions - Bring another instance's local timeline as a feed in QOTO, no need to have an account on another server again, just import their timeline here!

Keyword Subscriptions - Create custom timelines based off keywords not just hashtags, you can even use regex for advanced matching

Account Subscriptions - This allows you to follow a remote accounts public toots in your Home timeline without actually following them, great for following users with locked accounts.

Misskey compatible quoting of toots

Bookmarking of toots

Support for WebP and HEIC media uploads

An update to the getting-started menu to include center stage links to #QotoJournal and the @QOTO announcements account (me!)

#QOTO #Mastodon #Mastoadmin

namark boosted

riddle: no ambition of its own, waits, to be acted upon. 

object

namark boosted

ah, lets check out the examples folder of this nice library made for humans, I'm sure it's minimal in its scope to demonstrate basic usage, and ease you into more complex stuff.
*sees a huge monstrosity that accepts like 20 command line parameters, handles intricacies of some completely unrelated file format and uses every API it possibly could for its purpose, while meticulously checking for all possible errors* -_-

namark boosted

Let's make a video of my project and share it with the world! How hard could it be?

*Your 10+ year old laptop can't record your project at reasonable frame rate.* Alright, I have full control of the rendering, I'll integrate a video encoder into my project and encode the frames directly. Let's try libtheora, how hard could it be?

*Theora uses a different color space, and conversion rules are specified from it to RGB not the other way around, so you need to solve a set of linear equations*
I learnt how to solve a set of linear equations at school, it was a lot of fun, but alas I vowed to never do homework again. Also solving them and then hard-coding my solution would make it difficult to verify against the original specification, therefore I'll essentially duplicate the specification in code, and then write a program that would solve the equations at compile time and embed the solutions wherever the conversion is necessary.

Why is everything so hard? -_-

*Can't you just use your ~5 year old desktop instead?*
... NO!

namark boosted

exploiting intellectuals for my mathematical needs 

While pondering about a pointless optimization of a pointless feature of one of my pointless projects, I stumbled upon a #toyprogrammingchallenge similar to this one
qoto.org/@Absinthe/10319412553
but different.

A couple of ways to put it.

Colloquial(mathy jargon):
Given a prime factorization of a number, generate all of its factors(prime or otherwise) in ascending order.

Down to code(with fumbling):
Given a multiset(in ascending order) of prime numbers, generate all numbers... whose prime factors are subsets of that set... too mathy?... maybe then "that can be obtained by multiplying numbers from that set together"... in ascending order.

Examples:

Input: 30 = (2,3,5)
Output: ([1,]2,3,5,6,10,15[,30])

Input: 60 = (2,2,3,5)
Output: ([1,]2,3,4,5,6,10,12,15,20,30[,60])

namark boosted

I spend several minutes to convince myself that all common divisors of two natural numbers are divisors of their greatest common divisor... no wonder my projects move at a snail's pace.

namark boosted

I discovered an awesome #Vim trick... It can create numbered lists! If you have this list of numbers:
1.
1.
1.
1.

... you can Visually select the last three lines and press <g CTRL-A> to get:
1.
2.
3.
4.

Think of this a variant of <CTRL-A> that increments the number under the cursor. Without the <g> it would increment every number in the selection by 1.

namark boosted

here you go:

template<class Int, Int... Is>
void lower_bound_use_case(std::integer_sequence<Int,Is...>)
{
Int array[] = {Is...};
auto i = lower_bound(std::begin(array), std::end(array), Int{});
}

Show thread

I need to do lower_bound on an integer_sequence...

namark boosted

Not surprised, but still disappointed. Repeated attempts to convince the Organization I work for to donate out of service PCs have yet to gain support. We have a room stacked full i5 and i7 optiplexes collecting dust. It is still my intention to install Linux on all of them and donate to the community and public facilities. I will continue to poke the 🐻 with a stick until it agrees or mauls me.

clang can optimize one thing, gcc can optimize the other thing, neither can optimize everything... it's wonderful for competition, but terrible for my precious layered abstractions...

after many attempts to dumbify the code, clang wins as it optimizes the least ugly of the ugly versions better, but also looses as it optimizes the most ugly version slightly worse than gcc...

disroot.org is amazing for many reasons, and one of them is: the support team are human beings, and they treat you like a human being.

namark boosted

For the start of #YoutubeWalkout let me ask: What kept you on YouTube? Is it their recommendations engine?

What can we do instead? For promoting our videos or discovering them?

I've got some answers I'm experimenting with, but alone they are not enough.

Show older
Gamedev Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!