-
Looking beyond JSON Output format from LLMs
While working on my site for Learning and Quiz Generation I noticed that asking LLM’s for JSON outputs was problematic. Too many times the output was not a valid JSON. After multiple such issues, I felt that I should like at other output formats that I can then parse. Once such method that seems to…
-
BigQuery Bulk Insert using Python
To insert multiple rows at once using DML in BigQuery, you can do something like this: The above snippet inserts multiple rows into the table (table with columns: id and createdAt) in one go. You can also see that values types are being supplied (id:STRING and createdAt:TIMESTAMP). Binding the values this way (using parameters) will…
-
Row to Column in MySQL
Say you have two tables like these: And you have these values: id name 1 Kesavan 2 Madhavan user_id attribute_name attribute_value 1 GENDER M 1 PREMIUM_USER N 1 SUBSCRIBED_TO_NEWSLETTER Y 2 GENDER M 2 PREMIUM_USER Y To get a result like this: id name GENDER PREMIUM_USER SUBSCRIBED_TO_NEWSLETTER 1 Kesavan M N Y 2 Madhavan M…
-
PHP openssl_encrypt tip
-
Using Generators to flatten a JSON doc in PHP
-
Jenkins parallel pipeline
I was very excited to know about the ‘parallel’ feature in Jenkins Pipeline, but, there are many gotchas while making use of the pipeline feature (many of which are documented here: Jenkins Pipeline Example). After trying and reading a few different solutions, following worked for me (notice in screenshot that the browser jobs run in…
-
darker background image
-
casperjs output to html
-
Checking for the existence of domains from commandline in Bash
-
PHP as a replacement for sed/awk