Categories
ActivityPub Fediverse Void

Composable with microservices in the backend

I was listening to the Decoder podcast, where Jay Graber (the CEO of Bluesky) was interviewed, and it reminded me of a mental trap that I often fall into. It’s much better now because I detect it a mile away and successfully stop myself fast.

When I start a new project, I devise a grand plan. It all looks perfect in my head, like magic. Then, I deconstruct that grand plan into reality. I call this process first principles reversal. I start stacking ideas on top of ideas, forcing squares into circles until I achieve a Frankensteinian creation.

During this process, I am in awe of myself, in a state of absolute arousal. I’m a genius. Then, when I attempt to build my vision, I realize how complex it will become. Little by little, things start to not make sense, and in the angst of moving forward, I keep adjusting course and forcing pieces of the puzzle into places they do not belong.

After some time, I completely forgot what I was trying to achieve in the first place and created something that makes little sense because there are much simpler solutions that basically accomplish the same thing.

I am not saying saying that this is the case with Jay Graber. I don’t know Jay, and I have never used Bluesky or read through Bluesky’s documentation (who in their right mind would want to read that). Plus, I don’t believe Jay would be hired as CEO of a multimillion-dollar project if that were the case. I am just sharing that I enjoyed listening to the podcast because it reminded me how much better I feel when I stop myself from this mental trap.

Categories
Fediverse

Fediverse: what can we do now that we couldn’t before?

After listening to the DotSocial Podcast episode “Moving the Fediverse Forward at FediForum and Beyond, with Johannes Ernst of Dazzle Labs“, a question stuck with me and I think is very relevant: What can we do now that the Fediverse exists that we couldn’t before?

One example Johannes Ernst provides is someone trying to make money with Linux instead of considering what it allows since it’s free and open.

A similar situation happens with the Fediverse. I don’t believe the aim should be “How can I make money with this” (I have seen people wondering that question time and again) but “What can one do that wouldn’t be possible before”.

Categories
Personal Poetry Quotes

E vou escrever esta história para provar que sou sublime

Fiz de mim o que não soube,
E o que podia fazer de mim não o fiz.
O dominó que vesti era errado.
Conheceram-me logo por quem não era e não desmenti, e perdi-me.
Quando quis tirar a máscara,
Estava pegada à cara.
Quando a tirei e me vi ao espelho,
Já tinha envelhecido.
Estava bêbado, já não sabia vestir o dominó que não tinha tirado.
Deitei fora a máscara e dormi no vestiário
Como um cão tolerado pela gerência por ser inofensivo
E vou escrever esta história para provar que sou sublime.

– Álvaro de Campos
Categories
Dev

PHP floating point precision

I was attempting to find if the result of a calculation returned a number with any decimals.

So, I was doing something like:

$num=123.1/0.1;
if(floor($num)!=$num){
  echo "has decimals";
}else{
  echo "doesn't have decimals";
}
//has decimals

To my surprise the code above returns: ‘has decimals’

If you do the math in any calculator the result of 123.1/0.1=1231 and in fact that is what PHP displays when you do:

echo 123.1/0.1;
//1231

But internally PHP stores the value in float and when you do:

echo floor(123.1/0.1);
//1230

As I only need to know if the number has any decimals, I ended up doing:

$num=round(123.1/0.1,1);
if(floor($num)!=$num){
  echo "has decimals";
}else{
  echo "doesn't have decimals";
}

I completely understand why Steve Wozniak never got round to add floating point support on BASIC, no sane person wants to deal with floating points.

Categories
Mac

Remote Control another Mac on your network

You need to go to the Mac you want to access and under System Preferences->Sharing activate the following:

macOS Sharing Settings

On all this options you can limit the users that can have access.

On the File Sharing option, you can determine what folders can be accessed in the network and by whom.

On Remote Management you will be asked what you want from this list, use option/alt click to select all:

macOS Remote Management Options

Once that is done you can go to the other Mac you want to use and in Finder you should see the Mac on the sidebar under Locations or click Network:

macOS Finder ScreenShare Connect As

You see on the top right options to Share Screen or Connect As. Click Share Screen to get remote control of the other Mac or Connect As to simple browse the folders that you gave permissions on the File Sharing step.