Autonomie numérique et technologique

Code et idées pour un internet distribué

Linkothèque. Carnet de bord. Page 17


Promises simplify deferred and asynchronous computations. A promise represents an operation that hasn’t completed yet.

A promise can be:

fulfilled – The action relating to the promise succeeded
rejected – The action relating to the promise failed
pending – Hasn’t fulfilled or rejected yet
settled – Has fulfilled or rejected

Promise is used to overcome issues with multiple callbacks and provide better way to manage success and error conditions.

Promise is an object which is returned by the async function like ajax. Promise object has three states

pending :- means the async operation is going on.
resovled :- async operation is completed successfully.
rejected :- async operation is completed with error.

There are two parts using a promise object. Inside async function (Part1) and where its called (Part2).

Part1 — Inside Async function,

Promise object is created.
Async function returns the promise object
If async is done successfully, promise object is resolved by calling its resolve method.
If async is done with error, promise object is rejected by calling its rejected method.

Part2 — Outside Async function

Call the function and get the promise object
Attach success handler, error handler on the promise object using then method

Cross Domain Call

By Default, AJAX cannot make cross domain call, browser will reject the calls to the different domain. In order to make cross domain call there are two options

Using CORS
Using JSONP

Both the options requires some server changes. It cannot be done purely using javascript.

CORS is the new way to deal with cross origin AJAX request. github api are CORS enabled. In order to enable CORS, response should contain Access-Control-Allow-Origin header with the domain value or * to work for all. Github has set as *.

JSONP can also be used if CORS cannot be enabled by server or for old browsers. JSONP actually uses script tag to get the data from the server. Script is allowed to be fetched from any domain, So in JSONP, we need to create a script with the url as src and the server has to wrap the response in a callback function. Response sent by server is actually a javascript code which contains data inside a wrapper function. In JSONP, there is no ajax call being made.

Every document in Google Sheets supports the « Chart Tools datasource protocol », which is explained (in a rather haphazard way) in these articles:

« Creating a Chart from a Separate Spreadsheet »
« Query Language Reference »
« Implementing the Chart Tools Datasource Protocol »

To download a specific sheet as a CSV file, replace {key} with the document’s ID and {sheet_name} with the name of the sheet to export:

https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}

The datasource protocol is quite flexible. Various other options include:

Response Format: Options include tqx=out:csv (CSV format), tqx=out:html (HTML table), and tqx=out:json (JSON data).

Export part of a sheet: Supply the range={range} option, where the range can be any valid range specifier, e.g. A1:C99 or B2:F.

Execute a SQL query: Supply the tq={query} option, such as tq=SELECT a, b, (d+e)*2 WHERE c < 100 AND x = 'yes'. Export textual data: Supply the headers=0 option in case your fields contain textual data, otherwise they might be cut out during export.

…ALSA is responsible for giving a voice to all modern Linux distributions. It’s actually part of the Linux kernel itself, providing audio functionality to the rest of the system via an application programming interface (API) for sound card device drivers.

Users typically interact with ALSA using alsamixer, a graphical mixer program that can be used to configure sound settings and adjust the volume of individual channels. Alsamixer runs in the terminal, and you can invoke it just by typing its name. One particularly useful keyboard command is activated by hitting the M key. This command toggles channel muting, and it’s a fairly common fix to many questions posted on Linux discussion boards.

…the user-facing layer of the Linux audio system in most modern distributions is called PulseAudio.

The job of PulseAudio is to pass sound data between your applications and your hardware, directing sounds coming from ALSA to various output destinations, such as your computer speakers or headphones. That’s why it’s commonly referred to as a sound server.

If you want to control PulseAudio directly, instead of interacting with it through a volume control widget or panel of some sorts, you can install PulseAudio Volume Control (called pavucontrol in most package repositories).

If you feel that you have no use for the features provided by PulseAudio, you can either use pure ALSA or replace it with a different sound server.

The emergence of the Maker Movement has taken place in the context of a design practice and research that is now open, peer-to-peer, diffuse, distributed, decentralized; activity-based; meta-designed; ontologically-defined and defining; locally-bounded but globally-networked and community-centered. For many years the author participated and worked in the Maker Movement, with a special focus on its usage of digital platforms and digital fabrication tools for collaboratively designing and manufacturing digital and physical artifacts as Open Design projects. The author’s main focus in practice and research as a meta-designer was in understanding how can participants in distributed systems collaboratively work together through tools and platforms for the designing and managing of collaborative processes. The main research question of this dissertation is: How can we support and integrate the research and practice of meta-designers in analyzing, designing and sharing open and collaborative design and making processes within open, peer-to-peer and distributed systems?

The focus evolved and changed with three main phases: from facilitating collaborative design processes with 1) guidelines for a generic design approach, process and tools, to the use of 2) design tools and workshops that encode the methodology to developing 3) a digital ontology and the related digital platform. In the latter, the ontology for describing, documenting, sharing and designing collaborative design processes was developed as part of a broader conceptual framework, OpenMetaDesign, that builds the ontology on top of concepts describing design processes, and encodes it in a digital platform. The role of the ontology is to support the practice and research with a Research through Design approach that works not just on understanding the practice but also informing it, navigating it and continuously redesigning it. This dissertation is an exploration of the possible role, practice and profile of meta-designers that work in facilitating distributed, open and collaborative design and making processes in the Maker Movement. As a result, it provides insights on the practice and artifacts of the author and also a strategy and tools for applying the same exploration to other meta-designers. Following a Research through Design framework for bridging practice and research, the dissertation redefines Meta-Design in the Maker Movement as the design of digital ontologies of design processes as design material. Ultimately, the practice of designing a Metadata Ontology for Ontological Design through the design of bits (digital environments) and atoms (physical artifacts) with and for Open, Peer-to-Peer, Diffuse, Distributed and Decentralized Systems. Finally, it redefines meta-designers as designers, facilitators, participants, developers and researchers embedded in social networks that define their activities, profiles and boundaries for the ontologies they design.

Essentially, a promise is a returned object to which you attach callbacks, instead of passing callbacks into a function.

A common need is to execute two or more asynchronous operations back to back, where each subsequent operation starts when the previous operation succeeds, with the result from the previous step. We accomplish this by creating a promise chain.

Promises solve a fundamental flaw with the callback pyramid of doom, by catching all errors, even thrown exceptions and programming errors. This is essential for functional composition of asynchronous operations.

MBR does have its limitations. For starters, MBR only works with disks up to 2 TB in size. MBR also only supports up to four primary partitions—if you want more, you have to make one of your primary partitions an “extended partition” and create logical partitions inside it. This is a silly little hack and shouldn’t be necessary.

GPT stands for GUID Partition Table. It’s a new standard that’s gradually replacing MBR. It’s associated with UEFI, which replaces the clunky old BIOS with something more modern. GPT, in turn, replaces the clunky old MBR partitioning system with something more modern. It’s called GUID Partition Table because every partition on your drive has a “globally unique identifier,” or GUID—a random string so long that every GPT partition on earth likely has its own unique identifier.

GPT doesn’t suffer from MBR’s limits. GPT-based drives can be much larger, with size limits dependent on the operating system and its file systems. GPT also allows for a nearly unlimited number of partitions.

On an MBR disk, the partitioning and boot data is stored in one place. If this data is overwritten or corrupted, you’re in trouble. In contrast, GPT stores multiple copies of this data across the disk, so it’s much more robust and can recover if the data is corrupted.

GPT also stores cyclic redundancy check (CRC) values to check that its data is intact. If the data is corrupted, GPT can notice the problem and attempt to recover the damaged data from another location on the disk. MBR had no way of knowing if its data was corrupted—you’d only see there was a problem when the boot process failed or your drive’s partitions vanished.

En esta charla repasamos varios proyectos del colectivo Colaborabora, una cooperativa que diseña entornos colaborativos. Trabajan en participación ciudadana, arte contextual y diseño trans. Qué es el diseño trans? Bueno, de eso vamos a aprender durante esta entrevista. Y de muchas cosas más como economía feminista y como hacer para poder hacer partícipes a comunidades más vulnerables de un proceso participativo en la ciudad. Te adelantamos, que no hay fórmulas mágicas, todo es cuestión de dedicarle tiempo a lo que creemos y apostar a un trabajo hecho con cuidado y corazón. Una entrevista que te va a inspirar y dejar pensando como hacer las cosas de una manera diferente, porque según Ricardo, cambiando los comos podemos llegar a cambiar los ques. Por eso ellos diseñan muchas herramientas, como la guía incompleta para colaborar. Cambiar las cosas es un problema de diseño del que podemos aprender.

During the years in which the women’s liberation movement has been taking shape, a great emphasis has been placed on what are called leaderless, structureless groups as the main — if not sole — organizational form of the movement. The source of this idea was a natural reaction against the over-structured society in which most of us found ourselves, and the inevitable control this gave others over our lives, and the continual elitism of the Left and similar groups among those who were supposedly fighting this overstructuredness.

The idea of « structurelessness, » however, has moved from a healthy counter to those tendencies to becoming a goddess in its own right. The idea is as little examined as the term is much used, but it has become an intrinsic and unquestioned part of women’s liberation ideology. For the early development of the movement this did not much matter. It early defined its main goal, and its main method, as consciousness-raising, and the « structureless » rap group was an excellent means to this end. The looseness and informality of it encouraged participation in discussion, and its often supportive atmosphere elicited personal insight. If nothing more concrete than personal insight ever resulted from these groups, that did not much matter, because their purpose did not really extend beyond this.

« Freemen » creen que el derecho escrito es un contrato, y que las personas son libres de someterse a ella, o escoger vivir bajo lo que ellos llaman leyes « naturales », o ley « común ». Según su teoría, las leyes naturales sólo requieren que los individuos no perjudiquen a otros, no dañen la propiedad de los demás, y no utilicen « fraude o malicia » en los contratos. Dicen que todas las personas existen en dos formas: – su cuerpo físico y su persona jurídica. Esta última está representada por su certificado de nacimiento, algunos freeman reclaman que este último se limita exclusivamente a la partida de nacimiento. Según esta teoría, se crea un « hombre de paja » cuando se emite un certificado de nacimiento, y que esta es la entidad que está sujeta al derecho escrito. El cuerpo físico se conoce por un nombre ligeramente diferente, por ejemplo « Juan de la familia Smith », en lugar de « John Smith ».

The script would:
– extract all file versions to /tmp/all_versions_exported
– take 1 argument – relative path to the file inside git repo
– give result filenames numeric prefix (sortable)
– mention inspected filename in result files (to tell apples apart from oranges:)
– mention commit date in the result filename (see output example below)
– not create empty result files

Huh, any idea which ODM?

That’s not something we disclose, and to my knowledge nobody managed to figure out for our existing lineup. Regardless, these aren’t white-box devices we are simply repackaging. We work with an ODM to make customizations to a reference board/design, including (but not limited to) keyboard layout/feel, hardware kill switches, display type, hardware TPM, display type, chassis materials, etc. All of which add significant NRE cost (which we have to pay upfront)

Edward Snowden has spent the last six years living in exile in Russia and has now decided to publish his memoirs, Permanent Record. In the book he reflects on his life leading up to the biggest leak of top secret documents in history, and the impact this had on his relationship with his partner, Lindsay Mills. The Guardian’s Ewen MacAskill, who helped break Snowden’s story in 2013, has been given exclusive access to meet him.

Pangea es el proveedor de servicios de Internet para entidades de la Asociación Pangea – Coordinadora Comunicación Para la Cooperación.. La entidad y el proyecto « Pangea » se crearon en 1993, con el fin de hacer llegar Internet y las nuevas tecnologías de la información y la comunicación a las asociaciones, ONG, personas y colectivos sin ánimo de lucro La misión de Pangea es promover el uso estratégico de las redes de comunicación y las tecnologías de la información y comunicación (TIC) para el desarrollo y la justicia social y convertirse en una herramienta que ayude a cumplir los objetivos de colectivos sociales, organizaciones y movimientos sociales. Así como, promover que las organizaciones y movimientos sociales compartan información, conocimiento y recursos técnicos para el uso efectivo y estratégico de las TIC, especialmente de Internet, de forma sostenible y respetuosa con la diversidad y los valores de la cultura y sociedad local y global. Pangea está dirigida por una Junta que marca las principales líneas de trabajo de la entidad.

Actualmente Pangea está formada por más de 600 socios y socias

David Joy is the author of the Edgar nominated novel Where All Light Tends To Go (Putnam, 2015), as well as the novels The Weight Of This World (Putnam, 2017) and The Line That Held Us (Putnam, 2018). He is also the author of the memoir Growing Gills: A Fly Fisherman’s Journey (Bright Mountain Books, 2011), which was a finalist for the Reed Environmental Writing Award and the Ragan Old North State Award.

Joy lives in the North Carolina mountains.

GitDuck is a video chat built for developers. It enables developers to talk, share their code in real-time and do pair programming.

We built GitDuck because we were struggling to communicate and collaborate while working remotely. It allows us to collaborate as if we were in the same room so we can talk, share our code and learn from each other.

Olivia est développeuse full stack en indépendante. Ce qu’elle préfère c’est travailler avec sa communauté d’une dizaine d’indépendants, spécialisés en front, en UX design et en graphisme, en qui elle a toute confiance.

Mais Olivia se rend compte qu’elle refuse trop souvent des projets qui demandent des compétences que sa communauté n’a pas, parce qu’elle n’aime pas recruter et qu’elle ne sait pas à qui à faire confiance. Pire, elle et d’autres membres de sa communauté se retrouvent parfois avec trop peu de boulot.

Elle s’est branchée sur Hubl et y a invité sa communauté. Ils se servent du chat pour communiquer, et en se connectant à douze autres communautés qu’elle connaît bien, elle a désormais accès à leurs offres de mission et à leurs annuaires de profil. Ça lui permet de trouver des projets intéressants et des indépendants de confiance avec qui les réaliser.

Not too long ago I decided to write a jQuery plugin for making the use of iScroll a little less painful. Since I made the plugin at work I’m not really at liberty to share it. But what I can share is a step by step tutorial for creating a jQuery plugin of your own. Let’s get started.

Alberto Cairo escribe y diseña visualizaciones de datos. En esta entrevista nos cuenta sobre sus libros y sus descubrimientos. El nos dice que “Una visualización es un argumento visual. Necesita tiempo y atención para poder leerlo con cuidado.” Y que no tenemos que usar los gráficos para confirmar lo que creemos. También nos cuenta como son las clases para infografistas y como reflexionan a través de los gráficos. Hablamos de un futuro con más alfabetización visual, donde la gente está más entrenada a leer gráficos y las interpretaciones que proponen. El sostiene que para enseñar infografía es importante enseñar a interpretar los números y que la visualización de datos nos permite entender los números de una manera más crítica.

virtualenvwrapper is a set of extensions to Ian Bicking’s virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.
Features

Organizes all of your virtual environments in one place.
Wrappers for managing your virtual environments (create, delete, copy).
Use a single command to switch between environments.
Tab completion for commands that take a virtual environment as argument.
User-configurable hooks for all operations (see Per-User Customization).
Plugin system for creating more sharable extensions (see Extending Virtualenvwrapper).

Well, a virtual environment is just a directory with three important components:

A site-packages/ folder where third party libraries are installed.
Symlinks to Python executables installed on your system.
Scripts that ensure executed Python code uses the Python interpreter and site packages installed inside the given virtual environment.

(venv) % pip freeze
numpy==1.15.3

And write the output to a file, which we’ll call requirements.txt.

(venv) % pip freeze > requirements.txt

Duplicating Environments

Sara% cd test-project/
Sara% python3 -m venv venv/
(venv) Sara% pip install -r requirements.txtCollecting numpy==1.15.3 (from -r i (line 1))
Installing collected packages: numpy
Successfully installed numpy-1.15.3

…python -m pip executes pip using the Python interpreter you specified as python. So /usr/bin/python3.7 -m pip means you are executing pip for your interpreter located at /usr/bin/python3.7.

But when you use python -m pip with python being the specific interpreter you want to use, all of the above ambiguity is gone. If I say python3.8 -m pip then I know pip will be using and installing for my Python 3.8 interpreter (same goes for if I had said python3.7).

While we’re on the subject of how to avoid messing up your Python installation, I want to make the point that you should never install stuff into your global Python interpreter when you. develop locally (containers are a different matter)! If it’s your system install of Python then you may actually break your system if you install an incompatible version of a library that your OS relies on.