jgrg, to PostgreSQL
@jgrg@mstdn.science avatar

Wow! I did not know that #DuckDB can connect to #SQLite, #PostgreSQL and #MySQL databases, and freely query and move data between them, all within transactions! (This in addition to its ability to query, import and export #CSV, #Parquet, #JSON etc… file format data, which I did know.) This from today's blog post:
https://duckdb.org/2024/01/26/multi-database-support-in-duckdb.html

notsle, to random
@notsle@kzoo.to avatar

Isn't it fun when an API returns JSON, when there is one result, the data is a object, but if its multiple, its an array of objects. But only some calls, on other calls its always an array.

So much for consistancy.

minioctt, (edited ) to AdobePhotoshop Italian

[⤴️ https://octospacc.altervista.org/2024/01/16/spaghetti-a-breve-termine/]

Non sono passati nemmeno 10 giorni da quando avevo detto “aaa è improbabile che aggiornerò ancora #MBViewer, dovrei provare a far iniziare a funzionare il progetto definitivo #alternativo migliore…” 🥴️

Però poi mi sono resa conto che: magari del #progetto alternativo non è semplice progettare tutta l’interfaccia e il suo funzionamento (cosa che va fatta, essendo una cosa da #costruire da zero), ma certamente non si posso comunque granché se prima non preparo dei #componenti logici che so già che mi dovranno servire… e allora, tanto vale iniziare a lavorare per quelli, integrandoli nella #app che (per quanto #spaghetti) è già esistente e funzionante, e acchiappare un bel 2 in 1 (espandere quel #programmino, e nel mentre accumulare codice che mi servirà per quel molto altro più tardi). 📦️

La prima cosa un po’ intricata che serve è il supporto all’ingestione di dati da #piattaforme diverse, con #schemi diversi. L’idea è di avere un solo #schema di dati che la app usa per lavorare internamente, per evitare di avere spaghetti, ma questo vuol dire che bisogna fare qualche tipo di conversione. Ci sarebbero diversi approcci: 🔪️

  • Il più classico sarebbe quello di scrivere (come degli schiavi indiani) delle #procedure di codice per tradurre ogni tipo di entità #API dai #formati esterni a quello interno, e viceversa… il che non solo è una pazzia, e richiede un botto di #lavoro (va scritto un numero di #funzioni complesse pari alle piattaforme da supportare, moltiplicato per 2), ma finisce per dare #rogne: appena decidiamo che lo schema di API interno va modificato o allargato, ecco che bisogna modificare in ognuna di quelle parti, ed ecco che magari escono nuovi errori e problemi. Ehhh, no, non ci sto dentro. 😩️

  • La mia idea, invece, è di usare un #documento di #trasformazione, almeno per quando le task sono semplicemente selezione e riassegnazione di chiavi di #dati (per operazioni più complesse, il codice è più appropriato del #markup). Era questo che avevo già provato a fare mesi fa (e funzionava eh!), ma, riguardandolo ora, mi stavo rendendo conto che lo strano #formato JSON da me inventato ha dei #limiti abbastanza forti, tra cui penso sia un casino tremendo usare 1 solo documento di #traduzione per fare sia avanti che indietro. Quindi, ho iniziato a ripensarlo da capo, ma ho pensato abbastanza in fretta che, beh… #JSON non va bene per sta roba, lo si vede anche dal come devo mettermi a scrivere chiavi tipo “__robo__“; JSON abuse, doing I am. Però l’idea credo sia bona… 😋️

E allora, fortunatamente sono tornata sana giusto in tempo, prima di #impazzire ancora una volta dopo mesi con Jason; almeno, abbastanza sana per capire che è meglio impazzire con #XML, se proprio proprio, in questo caso. E, boh, ci ho perso 1 giornata e qualcosa (soprattutto l’altra sera in cui, mezza drogata di sonno, mezza cringiata per colpa della situazione, ho iniziato ad andare un pochino mentale), ma bene o male l’ho fatto funzionare un minimo. C’è stato di tutto in mezzo ovviamente; tra cui, il #godere per aver sistemato un #bug, eccetto scoprire poco dopo che, no, nulla era sistemato… e averci dovuto perdere un’altra mezza giornata. 📆️

https://octospacc.altervista.org/wp-content/uploads/2024/01/image-9-960x451.pngIn #screenshot, i documenti di trasformazione: a sinistra, quello XML nuovissimo, credo definitivo; al centro, quello JSON vecchio: a destra, quello JSON nuovo che ho sperimentato per pochi quarti d’ora. 💎️Questa è una di quelle cose capaci di stupirmi anche se fatte da me: la sola #idea di poter raggiungere il 90% di quello scopo intricato semplicemente #componendo un documento XML in maniera adeguata, e avere vita facile per ogni #modifica, la trovo #pazza in concetto. Comunque, ho dovuto (iniziare a) scrivere una mega-funzione totalmente #originale per questa cosa perché, come già avevo constatato mesi fa, ma riconfermato appunto ieri, tutte le #librerie in giro per fare trasformazioni di dati così sono troppo generiche, a quel punto usare quelle sarebbe anche peggio che fare tutto in #codice. E credo di aver cercato fin troppo in giro. E, ahimè, prima o poi soffrirò di nuovo, perché dovrò scrivere pure la #funzione di traduzione inversa! 😵‍💫️

Che centra con la #applicazione mezza kangata? In pratica, avendo integrato questo #sistema già da ora, MBViewer può visualizzare (alcuni) #feed #RSS, e (con qualche problema, per ora) #profili #Mastodon, il che non è male. È male, invece, il mio aver scoperto solo ora che su Firefox avviene un problema con il parsing dei feed RSS, che dovrò sistemare… ma su #Chromium funziona tutto. Oh well. Ohhh, it’s so well. I #glitch non finiscono mai, la tortura della #programmazione è eterna!!! 😭️

https://octospacc.altervista.org/wp-content/uploads/2024/01/image-10.pngProvate idk, https://hub.octt.eu.org/MBViewer/#/SiteUrl=https://mastodon.uno/@octo.rss|platform=rss. (Da Cromio per ora, come ho detto, 😴️)https://octospacc.altervista.org/2024/01/25/mbviewer-per-distrarci/

#alternativo #API #app #applicazione #bug #Chromium #codice #componendo #componenti #costruire #dati #documento #feed #formati #formato #funzione #funzioni #glitch #godere #idea #impazzire #JSON #lavoro #librerie #limiti #markup #Mastodon #MBViewer #modifica #originale #pazza #piattaforme #procedure #profili #progetto #programmazione #programmino #rogne #RSS #schema #schemi #screenshot #sistema #spaghetti #traduzione #trasformazione #XML

gvwilson, to random
@gvwilson@mastodon.social avatar

I need a couple of dozen small blobs of similarly-structured-but-not-identically-structured JSON that look like they came from a biology lab to use in a tutorial on manipulating JSON in SQLite and Postgres. If you have such, I'd be grateful for a ping: gvwilson@third-bit.com. (Yes, I know, it's a weird request, but you're a weird bunch of people and I love you for it.)

thomas_sandmann,

@gvwilson Perhaps the NCBI dataset API could be useful? You can e.g. enter Entrez gene identifiers and get information about gene identifiers & synonyms: https://www.ncbi.nlm.nih.gov/datasets/docs/v2/reference-docs/rest-api/#get-/gene/id/-gene_ids- The output is well structured, but there are fields of varying lengths for different genes (because they have different numbers of synonyms, database ids, etc).Here is an example query for gene (entrezid) 59067: https://api.ncbi.nlm.nih.gov/datasets/v2alpha/gene/id/59067?table_fields=gene-id&table_fields=gene-type&table_fields=description Switch out 59067 for another entrez identifier to get more examples. #NCBI #REST #JSON

DaveMasonDotMe, to SQLServer
@DaveMasonDotMe@mastodon.social avatar

NEW POST:
✍ Compress & Uncompress Query Results for Faster Data Transfer over TDS

🔎 TDS doesn't have built-in compression support. Here's my attempt at coercing SQL Server to return compressed result sets.

👤 Dave Mason




https://www.davemason.me/2024/01/22/compress--uncompress-query-results-for-faster-data-transfer-over-tds

itnewsbot, to random
@itnewsbot@schleuss.online avatar

Toad Data Studio manages SQL, NoSQL, and cloud databases - Systems management and security software provider Quest Software is shipping Toad Data... - https://www.infoworld.com/article/3712250/toad-data-studio-manages-sql-nosql-and-cloud-databases.html#tk.rss_all

gnulinux, to linux German
@gnulinux@social.anoxinon.de avatar

JSON Query - Teil 2

Wie filtert man mit dem Werkzeug jq und stellt mehrere Werte in einer Zeile dar? Ein Artikel aus dem beruflichen Alltag.

https://gnulinux.ch/json-query-teil-2

minioctt, to telegram Italian

[⤴️ https://octospacc.altervista.org/2024/01/13/wordpress-che-non-e/]

Dunque, quel bellissimo #MBViewer, che ho iniziato a realizzare appena 3 giorni fa… è già #SpaghettiCode. Ehh, si, quel codice di #Telegram lì non è proprio fatto per gestire un caricamento di dati troppo avanzato e tutto #ClientSide: nel suo normale caso d’uso riceve #HTML già preparato dal server, ed usa #JavaScript non #moderno, quindi tentare il #retrofitting che ho fatto io è chiaro porti a difficoltà. Si può fare, perché nella #programmazione si può fare tutto, ma è un #casino. …E un po’ me lo aspettavo, e lo sapevo da quando ho iniziato. 😁️

Considerate, questa #idea mi era venuta per un motivo molto #semplice: era da un po’ che volevo implementare una vista più #minimale e con #comodità moderne (come lo scorrimento infinito, o la vista in contesto) per il #MicroBlog nuovo, ma tenendo comunque io il controllo dei miei #dati. Farlo dentro #WordPress non mi va, dato che alla fine comunque dovrei usare #script #JS, e a questo punto ho ritenuto #intrigante l’idea di fare proprio una cosa a parte, che potesse potenzialmente essere facilmente adattata per prendere i #contenuti anche da altre fonti (e lo fa, legge #JSON da ovunque, se opportunamente assemblato), qualora il #sito Altervista dovesse avere dei problemi. 🧭️

Però, questa non è la mia #soluzione a lungo termine. Per quello, in realtà, ho in mente un #progetto semi-segreto che iniziai mesi fa, ma che poi, presa da altre cose, non continuai. Doveva essere una #webapp per il Fediverso e, potenzialmente qualunque altro #protocollo #social grazie ad un layer di astrazione di #API interno. È Il #software che vorrei far funzionare con una doppia #interfaccia, a #messaggi o a “piazza” (stile Miiverse), e quindi in secondo luogo anche come #client Matrix, e in terzo e quarto per #blog e #feed standard… problema è che, dovendo non solo #progettare tutto il #frontend, ma anche svecchiare una spaventosa porzione del #codice, non è affatto una cosa rapida arrivare ad uno stato di primissimo #MVP. 😳️

Insomma, è per questo che questa piccola #applicazione, tirata su alla bene e meglio e che esiste in buona parte per via di #lavoro non mio, l’ho chiamata “#distrazione”. Continuerò ad aggiornarla, anche dopo che ora ho aggiunto l’ultima funzione fondamentale, ossia l’apertura di #post specifici? Probabilmente no, sarebbe meglio pensare a sistemare quell’altro progetto e fare un robo fatto bene. Importa qualcosa? Naaaah… come si dice, “the first rule of gun safety is to have fun“? Vale la stessa cosa per il #coding, quando l’arma è la propria tastiera insomma. Basta sia stato #divertente. 😈️

https://octospacc.altervista.org/2024/01/16/spaghetti-a-breve-termine/

#API #applicazione #blog #casino #client #ClientSide #codice #coding #contenuti #dati #divertente #feed #frontend #HTML #idea #interfaccia #intrigante #JavaScript #JS #JSON #lavoro #MBViewer #messaggi #MicroBlog #minimale #moderno #MVP #post #progettare #progetto #programmazione #protocollo #retrofitting #script #semplice #sito #social #software #soluzione #SpaghettiCode #Telegram #webapp #WordPress

hunleyd, to PostgreSQL
@hunleyd@fosstodon.org avatar
smallcircles, (edited ) to fediverse
@smallcircles@social.coop avatar

#LinkML may be a nice way to bridge #JSON-only and #LinkedData-based #ActivityPub

With LinkML schema's are written in YAML and can then be converted in a wide range of different formats.

Very interesting. I added it to the #SocialHub topic pondering whether AP should be considered JSON-first..

https://socialhub.activitypub.rocks/t/linkml-for-definition-of-activitypub-extension-schemas/3838

drupalthoughts, to drupal
@drupalthoughts@fosstodon.org avatar

I've been tasked to upgrade another inherited 9 site to 10, apply a some major updates to the existing theme, and stage it on
As-is, none of the contrib modules had been defined in its config, and it has quite a few complex added features and content types that may no longer be required. Let's see how this goes! 😎

SuitedUpDev, to random
@SuitedUpDev@mastodon.online avatar

It's bloody 2024.... Can people PLEASE, for everything that's holy, just offer proper #JSON #APIs instead of #SOAP.

wyri, to terraform
@wyri@haxim.us avatar

Oops! Looks like there is a translation error somewhere between , , , , and .....

PaulHammond51, to space
@PaulHammond51@fosstodon.org avatar

Mars: Ingenuity helicopter flight #70 is in the books.

#Ingenuity #Perseverance #Mars2020 #NASA #space #JSON #Data #Mars

tek_dmn, to random
@tek_dmn@mastodon.tekdmn.me avatar

Today's UTTERLY cursed coding is thus:

DJI drones export an SRT file (yes, subtitles) with their telemetry. Here's an example:

4726<br></br>00:02:37,642 --> 00:02:37,675<br></br><font size="28">SrtCnt : 4726, DiffTime : 33ms<br></br>2023-12-20 16:45:44.157<br></br>[iso : 100] [shutter : 1/30.0] [fnum : 170] [ev : 0] [ct : 5670] [color_md : default] [focal_len : 240] [dzoom_ratio: 10000, delta:0],[latitude: 21.164051] [longitude: -15.464029] [rel_alt: 29.800 abs_alt: 166.494] </font><br></br>

That's the frame number and subtitle on/off time as per SRT spec, and the rest is the...

  • Frame number (but in the text)
  • Delta time to previous frame
  • Timestamp
  • Camera ISO
  • Shutter speed
  • Aperture (x10)
  • Exposure compensation
  • Color Temperature (K)
  • Color Mode
  • Focal Length (mm x10)
  • Digital Zoom (amount, delta)
  • Lat/Lon
  • Altitude (ASL / relative to home/takeoff point)

...

tek_dmn,
@tek_dmn@mastodon.tekdmn.me avatar

You'll notice:

  • The dzoom_ratio item has a second value inside the brackets, delta. It's also the only item to be separated with a comma not a space.
  • dzoom_ratio, delta, latitude, longitude, rel_alt and abs_alt all do not have a space between the name and the colon. delta is the only one to not have a space between the colon and the value.

Now, see, I wanted to take these to make into a video overlay, why else would I be taking telemetry exports?

I can use in my projects, either with a Resolve add-on, or directly scripting values in python in Natron.

But how do I make it JSON?

Obviously: REGEX

...

PaulHammond51, to space
@PaulHammond51@fosstodon.org avatar

Mars: Ingenuity helicopter flight is in the books.

ewan, to fediverse

So, it seems I'll need to rewrite my #Fediverse widget if I ever move back to #Mastodon.

And I would also need to use #RSS instead of #JSON, ugh...

amiloradovsky, to random

some reasons not to use

  • full of webshit
  • login failed blocks the entire UI
  • debugging anything protocol-related is more difficult than it should be (no logs or logs flooded with garbage)
  • branding nonsense
amiloradovsky,

@ic3l9 @newt well, indeed XHTML ≠ XML, though the former may be viewer as the latter, forgetting about meaning of the tags, and indeed it is parsed as XML first and then the entities get interpreted
(I kinda know the difference, I generated from custom with and wrote custom for the validation of the XML)
unlike "HTML5" e.g. all the tags have to be closed or the browser will just signal an error and won't show anything — that's a good thing, and the reasons are the same as for strongly, strictly, and statically typed GPPLs

problem with is not that it's a bad format (although it really is) but that it isn't human read-/writeable and discourages separation of internal data-structures from protocols — data-structures may vary between implementations and versions but protocols must be stable, and just passing lists of hash tables as they are is not really a protocol design

of course all windows behavior is intentional, even if malicious — never mistake hostility for stupidity
specifically in case of , things like login failure for one server of one account block everything else, and the dialogs can't even be closed oftentimes — if it's intentional then they're just evil or it's a sabotage, should be avoided in either case

davidbisset, to random
@davidbisset@phpc.social avatar

Interesting potential tool called "jc" for #developers who work with JSON and command line.

https://github.com/kellyjonbrazil/jc

This "converts the output of popular command-line tools, file-types, and common strings to #JSON, #YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts". #CLI

hunleyd, to postgres
@hunleyd@fosstodon.org avatar
ctietze, to random
@ctietze@mastodon.social avatar

Transforming #JSON to Tables: the Impedance Problem https://christiantietze.de/posts/2023/12/transforming-json-to-tables-the-impedance-problem/

It's somewhat possible but not really comfy to transform a subset of JSON to tabular data.

oblomov, to random
@oblomov@sociale.network avatar

So, my recent review of #Teslagrad
(“Official” discussion thread: https://sociale.network/@oblomov/111471523707665307) has me facing an existential dilemma about my website.
Since its inception, I've endeavored to make it as lightweight as possible, or at least to maximize its “content to weight” ratio: until recently, posts were almost exclusively text-only, except for the sporadic self-hosted and often self-written vector graphic.

1/n

oblomov,
@oblomov@sociale.network avatar

Fascinating. The aforementioned #FediRender does turn the outbox from the backup into a browsable #HTML file. Curiously, the #JSON is 61MB, the HTML shrunk to “just” 7.8MB —which is still a lot, but an order of magnitude less!

Also interesting, the outbox.html crashes w3m but I can dump it in a more text-like format with lynx, which shrinks it even more to a much more reasonable 110KB, a sizable fraction of which is just … links.

18/n

annathepiper, to wordpress
@annathepiper@mastodon.murkworks.net avatar

Followup on this thread I posted earlier:

https://mastodon.murkworks.net/@annathepiper/111467755713006541

I have advanced the problem along a bit. My current problem is that in all my various directories of screenshot files, I have a metadata.json file I want to extract data from. I want to use the extracted data to build an appropriate "wp media import" command, to feed to WP-CLI.

Here's my dilemma: I don't know jq well enough yet. I've been trying to teach myself about how its filters work tonight, but I'm not quite comfortable enough with it or with bash to work out how to accomplish what I want to do.

Recommendations solicited. /1

#Wordpress #jq #json #bash

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines