Autonomie numérique et technologique

Code et idées pour un internet distribué

Linkothèque. Carnet de bord


I love the WordPress Rest API and switching more and more from theme development to a headless WP approach, with an nice front-end framework. Right now I’m favoring Nuxt.js, which is build on Vue.js (check out wuxt, my very own dockerized nuxt/wp development environment).

For using WPs full strength with the Rest API I’ve collected/build a useful snippet library with WordPress Rest API extensions. I’ll try to maintain the following list as development goes on. All of the following extensions can be embedded in the functions.php file. If you wondering about the wuxt_ prefix, I’ve got the code from my Wuxt project and the prefix is as good as anyone.

Detecting the Safari browser: The user-agent of the Safari browser is “Safari”. This value is passed to indexOf() method to detect this value in the user-agent string. One additional check is required in the case of the Safari browser as the user-agent of the Chrome browser also includes the Safari browser’s user-agent. If both the user-agents of Chrome and Safari are in the user-agent, it means that the browser is Chrome, and hence the Safari browser value is discarded.

interact.js takes a slightly different approach compared to most drag and drop libraries. To give you as much control as possible, it tries to provide a simple, flexible API that gives you all the pointer event data you’ll need to move elements around.

The library doesn’t even do any moving at all! This is great because you decide exactly what feedback your users get. You can drag elements, draw on a canvas or (if you really need to) scroll the page.

Technically they’re all machine learning models, but checkpoints are usually referred to just as models. All models are static, meaning they only know what they were trained on. In order for them to learn something new, they have to be (re)trained again, also known as finetuning.

Their differences in very rough terms:

Checkpoints are the big models that make images on their own.

Loras and all their variations like Lycoris are « mini models » that plug into a checkpoint and alter their outputs. They let checkpoints make styles, characters and concepts that the base checkpoint they’re used on doesn’t know or didn’t know very well.

Hypernetworks are an older and not as good implementation of the same paper and same concept as Loras.

Textual Inversions are sort of bookmarks or compilations of what a model already knows, they don’t necessarily teach something new but rearrange stuff that a model already knows in a way that it didn’t know how to arrange by itself.

SD 1.x, SD 2.x and SDXL are both different base checkpoints and also different model architectures. Think of them maybe as non backwards compatible consoles if that’s easier to understand. SD 1.5 is say both the NES itself but also one game for it. All SD 1.x based models are compatible with SD 1.x Loras and models for extensions like ControlNet. SD 2.X is the SNES, it’s a different architecture so 1.x models won’t be compatible with it, same for SDXL if you say that’s like the N64.

ControlNet models are also machine learning models that inject into the Stable Diffusion process and control the denoising process, they’re used with an image made by preprocessor. That image is be used to guide and control that denoising process, also hence the name.

All these models come in safetensors format. Safetensors is the standard for machine learning models, since they only contain the necessary data for diffusion, hence their name. .ckpt is the old model format that’s outdated, because it’s an unsafe format that can contain and execute malicious code.

Pruned models are models that have unnecessary weights and data removed. Weights are part of what the model learned in order to denoise noise to make an image. Say a model has a weight for alien = 0.00000000000000000001, it’s so minimal that it won’t do anything, but it’s still taking up space. Now multiply that for a lot of more useless weights, pruning removes all of them so only the relevant data is left.

FP16 models are smaller than FP32 models because they have lower precision, it’s basically like calculating pi with less numbers, you’ll get close enough results, almost exactly the same in most cases, but still not as precise. Yet the images from FP16 models are also not that different or worse, and A1111 converts models to FP16 by default when loading them anyway, for faster speed.

To use a model, place them in their specific folder inside the UI you’re using. For A1111 they go in stable-diffusion-webui\models in self explanatory folders for Lora, etc. and in stable-diffusion-webui\models\Stable-diffusion for checkpoints.

Both checkpoints and Loras can be used either for poses or for styles, depending on what they were trained on. Pose Loras are a thing for example.

The reason for your results is because you’re using SD 1.5 as a checkpoint. The base SD 1.5 checkpoint is almost a year old and the Lora you’re using was trained using not only newer checkpoints, but also checkpoints trained better on anime. I recommend a newer anime checkpoint for the image you’re trying to make. The base model field on Civitai models is really more like base architecture. Also it’s recommended to not go below 512 in resolution for SD 1.x models and not below 1024 for SDXL models.

Each of the events were 4-nights. One was more “professional”, with people paying €1500-2500 for a ticket. The others were more lowkey, with tickets between €200-500. All of our events are priced on a sliding scale so people with more income contribute more, making it more accessible to people with low income. Co-living guests paid €200-350/week (all inclusive)..

Nati & I were left with a €5k profit for the co-living period, and about a €10k profit for the 4 events we facilitated. €15k for 3 months is not an amazing salary for two people, but considering all our living expenses were covered, and the work is satisfying, it’s quite doable.

Next to the dinner table was the “community mastery board” – a facilitation tool we learned from our friend Drew from Agile Learning Centers. This is an easy way for people to name small problems and quickly come up with solutions together, like “the downstairs bedrooms have poor sound insulation” → “let’s keep the noise level down in that part of the house between 10pm and 8am”

If you’re an aspiring community-builder: I would definitely recommend you run an experiment something like this. But I should note there are other factors that enabled us to be successful.

For one: reputation. We’re well connected in multiple networks: TPOT, The Hum, Microsolidarity, and Enspiral. From my position in that web, it’s pretty easy to get an invitation in front of a few thousand people, so that takes most of the effort out of event promotion. 96% occupancy across 4 events is exceptionally high, and it’s the result of a decade of network-building internationally.

Another factor: skills for living in community.

Stable Diffusion images per minute. Benchmarking 50 GPUs

We’ve benchmarked Stable Diffusion, a popular AI image generator, on the 45 of the latest Nvidia, AMD, and Intel GPUs to see how they stack up. We’ve been poking at Stable Diffusion for over a year now, and while earlier iterations were more difficult to get running — never mind running well — things have improved substantially. Not all AI projects have received the same level of effort as Stable Diffusion, but this should at least provide a fairly insightful look at what the various GPU architectures can manage with AI workloads given proper tuning and effort.

The easiest way to get Stable Diffusion running is via the Automatic1111 webui project. Except, that’s not the full story. Getting things to run on Nvidia GPUs is as simple as downloading, extracting, and running the contents of a single Zip file. But there are still additional steps required to extract improved performance, using the latest TensorRT extensions. Instructions are at that link, and we’ve previous tested Stable Diffusion TensorRT performance against the base model without tuning if you want to see how things have improved over time. Now we’re adding results from all the RTX GPUs, from the RTX 2060 all the way up to the RTX 4090, using the TensorRT optimizations.

For AMD and Intel GPUs, there are forks of the A1111 webui available that focus on DirectML and OpenVINO, respectively. We used these webui OpenVINO instructions to get Arc GPUs running, and these webui DirectML instructions for AMD GPUs. Our understanding, incidentally, is that all three companies have worked with the community in order to tune and improve performance and features.

Portada del Calendario zaragozano de 2017

El calendario Zaragozano es una publicación anual española que incluye una predicción meteorológica-astronómica no científica del tiempo para un año. El contenido del pequeño calendario viene indicado por el siguiente subtítulo: “Juicio universal meteorológico, calendario con los pronósticos del tiempo, santoral completo y ferias y mercados de España”.

Physics has empiricism. If your physical theory doesn’t make a testable prediction, physicists will make fun of you. Those that do make a prediction are tested and adopted or refuted based on the evidence. Physics is trying to describe things that exist in the physical universe, so physicists have the luxury of just looking at stuff and seeing how it behaves.

Mathematics has rigor. If your mathematical claim can’t be broken down into the language of first order logic or a similar system with clearly defined axioms, mathematicians will make fun of you. Those that can be broken down into their fundamentals are then verified step by step, with no opportunity for sloppy thinking to creep in. Mathematics deals with ontologically simple entities, so it has no need to rely on human intuition or fuzzy high-level concepts in language.

Philosophy has neither of these advantages. That doesn’t mean it’s unimportant; on the contrary, philosophy is what created science in the first place! But without any way of grounding itself in reality, it’s easy for an unscrupulous philosopher to go off the rails. As a result, much of philosophy ends up being people finding justifications for what they already wanted to believe anyway, rather than any serious attempt to derive new knowledge from first principles. (Notice how broad the spread of disagreement is among philosophers on basically every aspect of their field, compared to mathematicians and physicists.)

This is not a big deal when philosophy is a purely academic exercise, but it becomes a problem when people are turning to philosophers for practical advice. In the field of artificial intelligence, things are moving quickly, and people want guidance about what’s to come. Should we consider AI to be a moral patient? Does moral realism imply that advanced AI will automatically prioritize humans’ best interests, or does the is-ought problem prevent that? What do concepts like « intelligence » and « values » actually mean?

Sobre la Gestión del conocimiento en las organizaciones:
Las tres leyes de la dinámica del conocimiento (Debra Amidon)
1. Cuando se comparte conocimiento, este se multiplica.
2. El valor se crea cuando el conocimiento se mueve desde un punto de origen a otro punto en el que existe una oportunidad o necesidad.
3. El apoyo mutuo con conocimiento proporciona la utilización óptima de los recursos, tanto tangibles como intangibles.

Herramientas citadas:
https://alternativeto.net/
https://www.zotero.org/
https://www.lesbonscomptes.com/recoll/pages/index-recoll.html
https://calibre-ebook.com/
https://gephi.org/users/download/
https://en.wikipedia.org/wiki/Zettelkasten
https://maadix.net/en/
https://latempesta.cc/es.html

Carlo Padial y Kike G de la Riva explicando mejor que nadie a donde viene y a donde va Internet
https://www.youtube.com/watch?v=c7dylxtVma4

Portada de La isla de las mujeres

Un piloto de acrobacias deseado por todas las mujeres, un pervertido incombustible, un aviador francés en plena I Guerra Mundial y un pobre diablo abatido y naufragado en una isla « aparentemente » desierta…A partir de aquí, este cómic dará un vuelco a todo lo creíais que era…

Página de La isla de las mujeres

macos-guest-virtualbox.sh is a Bash script that creates a macOS virtual machine guest on VirtualBox with unmodified macOS installation files downloaded directly from Apple servers.

A default install only requires the user to sit patiently and, less than ten times, press enter when prompted by the script, without interacting with the virtual machine.

Tested on bash and zsh on Cygwin. Works on macOS, CentOS 7, and Windows on x86 CPUs with VT-x or AMD-V. Should work on most modern Linux distros.

macOS Catalina (10.15), Mojave (10.14), and High Sierra (10.13) currently supported.

Jango Fett en El ataque de los clones

Watch the seeds of Anakin Skywalker’s transformation take root in Star Wars: Episode II – Attack of the Clones. Ten years after the invasion of Naboo, the galaxy is on the brink of civil war. Under the leadership of a renegade Jedi named Count Dooku, thousands of solar systems threaten to break away from the Galactic Republic. When an assassination attempt is made on Senator Padmé Amidala, the former Queen of Naboo, twenty-year-old Jedi apprentice Anakin Skywalker is assigned to protect her. In the course of his mission, Anakin discovers his love for Padmé as well as his own darker side. Soon, Anakin, Padmé, and Obi-Wan Kenobi are drawn into the heart of the Separatist movement and the beginning of the Clone Wars.

Cartel Star Wars 2, Attack of the Clones

Toni Segarra está considerado como el mejor creativo publicitario español del XX. Creador de anuncios cómo el de “Te gusta conducir” de BMW, “Bienvenido a la república independiente de tu casa” de Ikea o el de “¿A qué huelen las nubes?” de Evax. Durante su carrera ha ganado 39 leones en el Festival de Cannes y más de 100 soles en el Festival de San Sebastián. Ha trabajado en muchas agencias de publicidad como Vizeversa o Contrapunto y después montó la suya SCPF con varios amigos. La dejo en 2017 y decidió fundar Alegre Roca para ganar libertad y poder hacerse un poco más freelance.

Couverture de Saint-Elme 4

Gregor Mazur et son entourage débarquent à Saint-Elme pour l’enterrement de Roland Sax. Quatrième tome spectral de la saga de Lehman et Peeters.

La mort de Roland Sax crée des remous : Gregor Mazur et son entourage débarquent à Saint-Elme pour assister à l’enterrement. À la Vache Brûlée, Franck se remet de ses blessures et tente de convaincre Philippe de rester en ville malgré le danger. Stan et Yérim font un tour en boîte de nuit. Yves Mertens cherche une maison à louer. Et Piotr est touché par la grâce.

Sam Altman – the executive behind ChatGPT – has scanned the irises of more than two million people with a metal sphere, to prove that they’re human.

The process is simple: you install an application on your mobile phone and receive a QR code. Then, you must allow a metallic sphere to look at you with its eye and generate a “personality test.” The proof is then associated with the QR code and the app becomes a passport called World ID. This also acts as a digital wallet for a cryptocurrency called Worldcoin.

Many shopping centers are already offering this service. But the question is: why would anyone want to submit this personal information?

en el caso de que se estén empleando plugins para el desarrollo de una solución WordPress que no sean compatibles con WPML, por ejemplo PODS, una solución interesante, es duplicar el mismo post o tipo de contenido, que ha sido creado con elementos del plugin incompatible y aprovechar cada versión para cada uno de los idiomas que hemos configurado para nuestro sitio, diferenciando cada post con una nomenclatura, por ejemplo con el diminutivo (_en, _es, _fr) del idioma en el slug o (-EN, -ES, -FR) en el nombre del mismo.

Para que luego WordPress distnga cual de esos bloques o contenidos pertenece al idioma concreto, utilizamos la constante ICL_LANGUAGE_CODE, definida por WPML, que se pueden emplear como parte del nuestro tema, para poder invocar el contenido de un post u otro en dependencia del idioma actual con el que se está navegando en nuestro sitio, idioma almacenado en la constante antes mencionada.

De esta manera un ejemplo podría ser:

if (ICL_LANGUAGE_CODE == 'en')

We can cycle through the reproduction modes by pressing the m key. The modes define the range of song which are considered in the library view. When using the all from library mode, all the song in the library will be considered. In the artist from library mode the player will consider only the songs in the library which belongs to the same artist of the song which is currently playing. Finally, in the album from library mode, the player will only consider the songs belonging to the same album of the one currently in reproduction.

If the C function is active, as in our case, when cmus finishes reproducing the currently playing song, it will automatically start playing the next one in the list. To toggle this functionality we must press shift+c.

If the R function is active cmus will start again reproducing the group of songs we selected once it reaches the end of the list. For example, if we are using the artist from library mode, once all the songs of the artist are played, the player will start reproducing the artist’s collection from the start. For this function to be effective the C function must also be active. When the S function is active, the player is in shuffle mode, so it will choose random tracks from the library.

When the F function is active the player will always automatically select the current playing song on the list. To be more clear, suppose we have the C function enabled: when the player finishes playing the currently selected song it will start playing the next in the list, but, by default, it will not “select” it (it will not highlight it with the “selection bar”). When the F function is enabled, instead, the two things will always be in sync, and the song currently in reproduction will always be selected automatically.

They use the term « open source » incorrectly and provide design files that are a mix of open source licensed files along with other design files that are under a restrictive license.

OpenDesk.cc has also started restricting access to their design files so that they are only given out by request.

I have collected a list of their designs here, with notes indicating whether they fall under a free/libre license. A local copy of the free/libre design files are provided for convenience here.

¿De dónde sale el apodo de “Animal”?

En mi tercer concierto con los Enemigos íbamos de Zaragoza a Alicante y llegábamos tarde… muy tarde, como pasaba por aquel entonces, era el año 89. Íbamos en la furgoneta, entramos por las calles de Alicante para llegar al garito donde íbamos a tocar y de repente llegamos a una calle muy estrecha de sentido único. Había un R5 aparcado con el culo muy despegado de la acera y no cabíamos, la furgoneta no pasaba, no había forma… El road manager pitando y pitando y allí no salía nadie, y nosotros con una prisa que no veas, agobiados. Total que dije: “yo lo aparto…” me bajé de la furgoneta, cogí el coche por la parte trasera y apoyando la espalda en el cristal con las manos por el paso de rueda de atrás lo llevanté y lo metí en su sitio. Hay que decir que eso lleva una técnica… yo tenía un R5 y solía hacer eso cuando me quedaba mal aparcado, con lo cual ya sabía como hacerlo; no fue cosa del momento. Cuando entré en la furgoneta todos estaban callados mirándome, petrificados de lo que acababan de ver. Llegamos a tiempo a la sala, tocamos y todo salió bien. El viernes siguiente a aquella actuación, creo que fue, hicimos el programa ‘Música Golfa’ de Paco Pérez Bryan de TVE. Nos presentaba él mismo y Paco estaba hablando con Josele sobre el nuevo disco, la nueva incorporación que era el batería y le preguntó como se llamaba… y Josele le dijo: “Animal”. Curiosamente “Animal” era el apodo de un fotógrafo barbudo, con gafas y pelo largo que salía en la serie ‘Lou Grant’ de los años 80 y a mí aquel apodo me encantaba. Pero claro, el problema es que los apodos no los eliges tú, te los ponen logicamente… resulta que años después estoy tocando con Los Enemigos y Josele me presenta en pleno concierto como “Animal” así que a partir de ahí fui “Animal” y lo sigo siendo…

The json() method of the Response interface takes a Response stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON.

const myList = document.querySelector("ul");
const myRequest = new Request("products.json");

fetch(myRequest)
  .then((response) => response.json())
  .then((data) => {
    for (const product of data.products) {
      const listItem = document.createElement("li"); 
      listItem.appendChild(document.createElement("strong")).textContent = product.Name; 
      listItem.append(` can be found in ${product.Location}. Cost: `); 
      listItem.appendChild(document.createElement("strong")).textContent = `£${product.Price}`; 
      myList.appendChild(listItem);
    }
  })
  .catch(console.error);

The Function.prototype.bind() method lets you establish a fixed this context for all subsequent calls — bypassing problems where it’s unclear what this will be, depending on the context from which your function was called. Note, however, that you’ll need to keep a reference to the listener around so you can remove it later.

class Something {
  name = "Something Good";
  constructor(element) {
    // bind causes a fixed `this` context to be assigned to `onclick2`
    this.onclick2 = this.onclick2.bind(this);
    element.addEventListener("click", this.onclick1, false);
    element.addEventListener("click", this.onclick2, false); // Trick
  }
  onclick1(event) {
    console.log(this.name); // undefined, as `this` is the element
  }
  onclick2(event) {
    console.log(this.name); // 'Something Good', as `this` is bound to the Something instance
  }
}

const s = new Something(document.body);

Dans ma famille, il y a un type qui s’appelle Jean-François. Il a 80 ans mais ne les fait pas. J’ai toujours bien aimé le regarder parce qu’il est petit, rond, avec une longue barbe, il ressemble à un personnage de conte de fées. Et puis, il est assez poétique. Il accorde les pianos, travaille le bois, fabrique des meubles, répare des trucs, construit des objets très délicats, comme de petits acrobates en cordes et baguettes qui font de très gracieux mouvements. Dans la famille, on le considère un peu comme un original parce qu’il dit des trucs un peu bizarres parfois, qu’il fait des blagues qu’on ne comprend pas toujours, qu’il ne sait jamais qui est qui. Mais sous ses airs, non seulement il est très habile de ses mains, mais il sait plein de choses, il est toujours au courant de l’actu, il a élevé quatre enfants, il conduit une voiture qui a l’air presque neuve. Bref, Jean-François, il n’a pas l’air très empêché dans la vie.

Et pourtant, il vit complètement en dehors du monde numérique, et même de l’informatique la plus basique. Ca, je l’ai appris dernièrement, au hasard d’une discussion. Au début, ça m’a juste fait marrer, mais ça m’a trotté dans la tête pendant quelques mois. Je me suis dit qu’en parler avec lui, ce serait peut-être le moyen de comprendre plein choses. Déjà, comment on peut vivre aujourd’hui sans internet, sans smartphone ? Mais ce qui m’intéresse aussi, c’est de comprendre pourquoi il vit comme ça ? Manifestement, dans son cas, ce n’est pas un problème économique. Est-ce que c’est un choix ? Est-ce qu’il a décroché un moment et n’a plus été capable de raccrocher les wagons ? Est-ce que ça l’angoisse ? Est-ce qu’il a l’impression de comprendre encore le monde dans lequel il vit ?

# Python3 code to demonstrate working of 
# Append suffix / prefix to strings in list 
# Using list comprehension + "+" operator 
 
# initializing list 
test_list = ['a', 'b', 'c', 'd'] 
 
# printing list 
print("The original list : " + str(test_list)) 
 
# initializing append_str 
append_str = 'gfg'
 
# Append suffix / prefix to strings in list 
pre_res = [append_str + sub for sub in test_list] 
suf_res = [sub + append_str for sub in test_list] 
 
# Printing result 
print("list after prefix addition : " + str(pre_res)) 
print("list after suffix addition : " + str(suf_res)) 
Page de La dernière reine

Jean-Marc Rochette explique : « On m’a reproché de faire des histoires virilistes, sans femme ou presque. C’est faux : dans Ailefroide, ma mère, une femme forte, et ma grand-mère sont présentes. Là, j’ai mis au cœur de La dernière reine une femme comme moteur. Dans ce récit, il s’agit d’ailleurs d’un homme sauvé par une femme. Edmond Roux n’existe pas sans elle. Dans les scènes d’amour, c’est une vision inverse des codes habituels de la sexualité qui est présentée. C’est Jeanne qui ausculte Edmond, qui lui demande de se déshabiller, qui lui dit qu’elle le trouve beau et qu’il a un corps magnifique. Elle commence d’ailleurs par soulever le voile qu’il porte pour dissimuler son visage abîmé. C’est d’une sensualité folle. Mais je ne l’ai vue qu’après avoir dessiné. »

Détail de la couverture de La dernière reine

Gueule cassée de 14, Édouard Roux trouve refuge dans l’atelier de la sculptrice animalière Jeanne Sauvage. Elle lui redonne un visage et l’introduit dans le milieu des artistes de Montmartre. En échange, Édouard lui fait découvrir la majesté du plateau du Vercors et l’histoire du dernier ours qu’il a vu tué quand il était enfant. Au cœur du Cirque d’Archiane, il lui dévoile la Dernière Reine et incite Jeanne a créer le chef d’œuvre qui la fera reconnaître.
Dans la veine des grands romans feuilletons du 19e, La Dernière Reine croise les destins du dernier ours du Vercors et d’Édouard Roux gueule cassée de 14.
Comme précédemment dans Le Loup, homme et animal se confrontent dans un récit puissant, mêlant questionnements écologiques, féminisme, histoire d’amour et histoire de l’art.