From f36ec238fc153c275d95ef22c5a5c6c59c801630 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Fri, 22 Mar 2024 21:12:30 +0100 Subject: [PATCH 1/4] Use the blog plugin from mkdocs-material --- docs/stories/.authors.yml | 5 ++++ docs/stories/index.md | 3 ++ .../assets/deployment.drawio.svg | 0 .../assets/idea.drawio.svg | 0 .../content.md | 19 ++++++++++--- .../20240315-hejda-autoliv/assets/esafe.png | Bin .../posts}/20240315-hejda-autoliv/content.md | 26 +++++++++++++----- mkdocs.yml | 7 +++-- requirements.txt | 9 +++--- 9 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 docs/stories/.authors.yml create mode 100644 docs/stories/index.md rename docs/{blogs => stories/posts}/20221123-for-starters-how-this-was-built/assets/deployment.drawio.svg (100%) rename docs/{blogs => stories/posts}/20221123-for-starters-how-this-was-built/assets/idea.drawio.svg (100%) rename docs/{blogs => stories/posts}/20221123-for-starters-how-this-was-built/content.md (87%) rename docs/{blogs => stories/posts}/20240315-hejda-autoliv/assets/esafe.png (100%) rename docs/{blogs => stories/posts}/20240315-hejda-autoliv/content.md (85%) diff --git a/docs/stories/.authors.yml b/docs/stories/.authors.yml new file mode 100644 index 0000000..2ff0964 --- /dev/null +++ b/docs/stories/.authors.yml @@ -0,0 +1,5 @@ +authors: + baluyotraf: + name: Raf Baluyot + description: Creator + avatar: https://avatars.githubusercontent.com/u/7478783 \ No newline at end of file diff --git a/docs/stories/index.md b/docs/stories/index.md new file mode 100644 index 0000000..e1db61b --- /dev/null +++ b/docs/stories/index.md @@ -0,0 +1,3 @@ +# Stories + +Here are stories and updates written about software and machine learning. \ No newline at end of file diff --git a/docs/blogs/20221123-for-starters-how-this-was-built/assets/deployment.drawio.svg b/docs/stories/posts/20221123-for-starters-how-this-was-built/assets/deployment.drawio.svg similarity index 100% rename from docs/blogs/20221123-for-starters-how-this-was-built/assets/deployment.drawio.svg rename to docs/stories/posts/20221123-for-starters-how-this-was-built/assets/deployment.drawio.svg diff --git a/docs/blogs/20221123-for-starters-how-this-was-built/assets/idea.drawio.svg b/docs/stories/posts/20221123-for-starters-how-this-was-built/assets/idea.drawio.svg similarity index 100% rename from docs/blogs/20221123-for-starters-how-this-was-built/assets/idea.drawio.svg rename to docs/stories/posts/20221123-for-starters-how-this-was-built/assets/idea.drawio.svg diff --git a/docs/blogs/20221123-for-starters-how-this-was-built/content.md b/docs/stories/posts/20221123-for-starters-how-this-was-built/content.md similarity index 87% rename from docs/blogs/20221123-for-starters-how-this-was-built/content.md rename to docs/stories/posts/20221123-for-starters-how-this-was-built/content.md index f3b87a7..60b5fb5 100644 --- a/docs/blogs/20221123-for-starters-how-this-was-built/content.md +++ b/docs/stories/posts/20221123-for-starters-how-this-was-built/content.md @@ -1,14 +1,25 @@ +--- +authors: + - baluyotraf +date: + created: 2022-11-23 +categories: + - software +--- + # For Starters, How This Was Built ## Idea and Concept I always planned to create a website, but I didn't really have the motivation to go for it. I've always been more of the Machine Learning and back-end -person. Though I worked recently with [Jetpack Compose]. Pretty fun! +person. Though, I worked recently with [Jetpack Compose]. Pretty fun! + + Well, speaking of websites, surprisingly I made a lot of them. But these are the documentation websites for the APIs and library I developed. So my idea -is to leverage these tools so I can have some things to start with, the build +is to leverage these tools, so I can have some things to start with, the build things from there. *You know, the agile way.*
@@ -27,7 +38,7 @@ alternatives that worked well with other pages. And from there I found [MkDocs]. [MkDocs] uses markdown files in order to create documentation. This is -something familiar as most `README` files are written in markdown. +something familiar, as most `README` files are written in Markdown. [MkDocs] also has a theme called [MkDocs Material]. It looks good and has a lot of customization options that are available. I am so impressed with how @@ -38,7 +49,7 @@ much it provides out of the box. The code is hosted in [GitHub], so it was easy to go for deploying it in [GitHub Pages] with [GitHub Actions]. Documentations are mostly static web -pages so [GitHub Pages] are enough for it. For CI, [MkDocs] and +pages, so [GitHub Pages] are enough for it. For CI, [MkDocs] and [MkDocs Material] have you covered with their [GitHub Actions] support and examples. diff --git a/docs/blogs/20240315-hejda-autoliv/assets/esafe.png b/docs/stories/posts/20240315-hejda-autoliv/assets/esafe.png similarity index 100% rename from docs/blogs/20240315-hejda-autoliv/assets/esafe.png rename to docs/stories/posts/20240315-hejda-autoliv/assets/esafe.png diff --git a/docs/blogs/20240315-hejda-autoliv/content.md b/docs/stories/posts/20240315-hejda-autoliv/content.md similarity index 85% rename from docs/blogs/20240315-hejda-autoliv/content.md rename to docs/stories/posts/20240315-hejda-autoliv/content.md index 34c20c4..9a499c8 100644 --- a/docs/blogs/20240315-hejda-autoliv/content.md +++ b/docs/stories/posts/20240315-hejda-autoliv/content.md @@ -1,10 +1,22 @@ +--- +authors: + - baluyotraf +date: + created: 2024-03-15 +categories: + - software + - machine-learning +--- + # Hejdå Autoliv! Today, March 15, 2024, I spent my last day in Autoliv. I went to the Vårgårda office to meet my colleagues from research and gave everyone thanks. In -return I also got a lot of compliments. Oh and there's some depth estimation +return, I also got a lot of compliments. Oh, and there's some depth estimation project where my input was appreciated. + + Thinking about it, my contract lasted for 1 year and 10 months. And I thought it would be nice to look back at the things I've done with the team. @@ -17,7 +29,7 @@ generates their documentation, then send its documentation to the **Documentation Hub**. To make it easier for people to integrate their documentation to the hub, -I created an Azure Pipeline Template to allow people add the process to their +I created an Azure Pipeline Template to allow people to add the process to their CI pipeline. The page for the **Documentation Hub** is actually public, but I am not sure if I am allowed to share it. Though there's not much to get there as the private information and keys requires an Autoliv account. @@ -36,7 +48,7 @@ is a summary of the things I contributed to the system. * RESTful APIs * Kotlin Multiplatform SDK for iOS/Android * Android Demo Application -* Service Now and Azure AD Integration (OpenIDC) +* ServiceNow and Azure AD Integration (OpenIDC) * Pre-commit and CI Pipelines * Full Unit and Integration Test Suite via Docker Compose * Autoliv Security Approval @@ -52,7 +64,7 @@ to Autoliv, I had to work on a research project for Vinnova. The paper is available in the [Vinnova Publication] for more details. In the project, we got a lot of data from electric scooters with front facing -cameras. My main contribution on the project are the computer vision outputs. +cameras. My main contribution to the project are the computer vision outputs. This means working mostly on object detection, distance estimation, object tracking, and video stabilization. Below are some of the examples of the data we processed, as shown in the paper. @@ -63,7 +75,7 @@ we processed, as shown in the paper. ## Motorcycle Airbags -Autoliv has officially announced its [Motorcycle Airbags] and I was one of the +Autoliv has officially announced its [Motorcycle Airbags], and I was one of the person who is working on it. Specifically, I was working on the algorithm to detect when should we trigger the airbag. It was a lot of watching videos of motorcycles and dummies getting decimated in the crash track and processing @@ -78,7 +90,7 @@ time series data to make sure the kinematic data matches the video. I had also supported our thesis students who are working on LLMs and transportation mode classification. Unfortunately, I did not stay long enough to see their presentation. But I believe they are at the stage where they can -continue the work together with the members of the team. I hope they make a +continue to work together with the members of the team. I hope they make a good paper! ## Next Chapters @@ -90,5 +102,5 @@ working on the following things. Maintenance. * Write an open source library for typed and composable handwritten SQL in Python. Current planned name is alternative queries (altqq). -* Keep up with the latest advancements in LLMs. Thankfully I did work with a +* Keep up with the latest advancements in LLMs. Thankfully, I did work with a chatbot company before and have the fundamentals to built my knowledge on. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index c513d76..1a9c9da 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,15 +8,16 @@ copyright: Copyright © 2024 Raffaello Baluyot nav: - Home: index.md - - Blogs: - - blogs/20240315-hejda-autoliv/content.md - - blogs/20221123-for-starters-how-this-was-built/content.md + - Stories: + - stories/index.md - Projects: - Education: projects/education.md plugins: - include-markdown - social + - blog: + blog_dir: stories markdown_extensions: - md_in_html diff --git a/requirements.txt b/requirements.txt index 442605c..1c8b21a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -CairoSVG==2.5.2 -mkdocs==1.4.2 +CairoSVG==2.7.1 +mkdocs==1.5.3 mkdocs-include-markdown-plugin==3.9.1 -mkdocs-material==8.5.8 -Pillow==9.3.0 +mkdocs-material==9.5.14 +mkdocs-material-extensions==1.3.1 +Pillow==10.2.0 From f53ddfb5b9e7287e0b2371d7fac6f92b4ba585a6 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Fri, 22 Mar 2024 21:20:34 +0100 Subject: [PATCH 2/4] Remove project details from the Autoliv post --- .../posts/20240315-hejda-autoliv/content.md | 58 +++++-------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/docs/stories/posts/20240315-hejda-autoliv/content.md b/docs/stories/posts/20240315-hejda-autoliv/content.md index 9a499c8..9a33cdc 100644 --- a/docs/stories/posts/20240315-hejda-autoliv/content.md +++ b/docs/stories/posts/20240315-hejda-autoliv/content.md @@ -3,6 +3,7 @@ authors: - baluyotraf date: created: 2024-03-15 + updated: 2024-03-22 categories: - software - machine-learning @@ -12,52 +13,32 @@ categories: Today, March 15, 2024, I spent my last day in Autoliv. I went to the Vårgårda office to meet my colleagues from research and gave everyone thanks. In -return, I also got a lot of compliments. Oh, and there's some depth estimation -project where my input was appreciated. +return, I also got a lot of compliments. Oh, and there's some project where my +input was appreciated. Thinking about it, my contract lasted for 1 year and 10 months. And I thought it would be nice to look back at the things I've done with the team. -## Documentation Hub +## Software Services -In the team, we generate our documentation using automated tools. Each -programming language however has their own tooling around documentation. For -example, we have mkdocs/Sphinx for Python, Dokka for kotlin, etc. Each project -generates their documentation, then send its documentation to the -**Documentation Hub**. - -To make it easier for people to integrate their documentation to the hub, -I created an Azure Pipeline Template to allow people to add the process to their -CI pipeline. The page for the **Documentation Hub** is actually public, but I -am not sure if I am allowed to share it. Though there's not much to get there -as the private information and keys requires an Autoliv account. - -## Autoliv Connected Services Platform - -The Autoliv Connected Services Platform is a service that existed before I came -in. However, it was more of a POC rather than a production ready system. After -I came in, we came to a conclusion that we had to rework the system. - -Now that I'm leaving, the system is ready for production and its iOS -application is in Apple test flight. I won't go through the details but below -is a summary of the things I contributed to the system. +A lot of the things we did in research are software driven, without going to +details of the services, here are the things I added to those services. * Database Migrations, Proper Indexing and Constraints * RESTful APIs * Kotlin Multiplatform SDK for iOS/Android -* Android Demo Application +* Android Application * ServiceNow and Azure AD Integration (OpenIDC) * Pre-commit and CI Pipelines +* Reusable CI Templates +* Automated Documentations * Full Unit and Integration Test Suite via Docker Compose -* Autoliv Security Approval +* Security Review * Data Migration Script -In the end, I am happy to see that everything is sorted out before I leave and -that the application will be ready to go prime time. - -## E-Safe Pre-Study +## E-Safe Pre-Study and Other Research Electric powered mobility solutions has been gaining popularity. After coming to Autoliv, I had to work on a research project for Vinnova. The paper is @@ -71,27 +52,20 @@ we processed, as shown in the paper. ![E-safe Pre-study](assets/esafe.png) +Aside from this, there are also other internal researches that I've been a part +of, both with employees and thesis students. + [Vinnova Publication]: https://www.vinnova.se/en/p/e-safe-pre-study/ ## Motorcycle Airbags -Autoliv has officially announced its [Motorcycle Airbags], and I was one of the -person who is working on it. Specifically, I was working on the algorithm to -detect when should we trigger the airbag. It was a lot of watching videos of -motorcycles and dummies getting decimated in the crash track and processing -time series data to make sure the kinematic data matches the video. +Autoliv has officially announced its [Motorcycle Airbags], and part of the work +I've done is making sure that the crash algorithm is robust and capable. ![Motorcycle](https://www.autoliv.com/sites/default/files/pr/202306017153-2.png) [Motorcycle Airbags]: https://www.autoliv.com/press/autoliv-launch-its-first-motorcycle-airbag-2025-2132315 -## Thesis Projects - -I had also supported our thesis students who are working on LLMs and -transportation mode classification. Unfortunately, I did not stay long enough -to see their presentation. But I believe they are at the stage where they can -continue to work together with the members of the team. I hope they make a -good paper! ## Next Chapters From b7c57bad77e8f8ddddf423b04c3ad01f0ce99491 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Fri, 22 Mar 2024 21:56:39 +0100 Subject: [PATCH 3/4] Add annoucement post for altqq --- .../content.md | 77 +++++++++++++++++++ mkdocs.yml | 5 ++ 2 files changed, 82 insertions(+) create mode 100644 docs/stories/posts/20240322-blog-updates-and-altqq/content.md diff --git a/docs/stories/posts/20240322-blog-updates-and-altqq/content.md b/docs/stories/posts/20240322-blog-updates-and-altqq/content.md new file mode 100644 index 0000000..8aeef43 --- /dev/null +++ b/docs/stories/posts/20240322-blog-updates-and-altqq/content.md @@ -0,0 +1,77 @@ +--- +authors: + - baluyotraf +date: + created: 2024-03-22 +categories: + - software + - data +--- + +# Blog Updates and Alternative Queries + +Today, I would like to announce some blog updates and the release of my SQL +helper library, Alternative Queries (altqq). + + + +## Blog Updates + +As of today, the blogs in the page are powered by MkDocs Material's blog +plugin. This means that the blog page will now have additional features such +as archive, categories, and previews. If you're interested in creating blogs, +be sure to check the [MkDocs Material Documentation]. If you're not aware how +to start, you can check the [Software+ML Code]. + +## Alternative Queries + +If you work a lot with handcrafted SQL queries and prefer to have type-checked +parameters, and reusable queries, feel free to check my library called +Alternative Queries (altqq). + +### Managing Ordered Parameters + +Alternative Queries also allows you to manage your query parameters. For +example, for ODBC databases, `pyodbc` does not allow named parameter. If means +that to reuse queries, one needs to make note of the parameters, as they must +be in order. For example + +```python +query1 = """SELECT * from "Users" where "Id" = ?""" +query2 = """SELECT * from "Users" where "Name" = ?""" + +full_query = f"{query1} UNION ALL {query2}" +parameters = [uuid4(), "Arie"] +``` + +The simple above looks simple, but if `query1` takes 3 parameters, and the +`full_query` reuses 3-5 existing queries, the scenario becomes more complex. +Even in this case, there is a possibility to define `parameters` as +`["Arie", uuid4()]` if one is not careful. + +### Managing Named Parameters + +`psycopg` support is not yet implemented in the current version. But as an +example, `psycopg` provides named parameters. The advantage of named parameters +are obvious: no parameter repetition, and more context from parameter names. + +```python +query1 = """SELECT * from "Users" where "Id" = %(id)s""" +query2 = """SELECT * from "Users" where "Name" = %(name)s""" + +full_query = f"{query1} UNION ALL {query2}" +parameters = {"id": uuid4(), "name": "Arie"} +``` + +This solution already looks better. There's no way of mistaking the query +parameters, even if the queries are merged improperly. However, this can be +an issue if the queries are complex and a lot of reuse is required. It is +possible to merge different queries that require the same name. + +If you find these problems interesting, check the [Alternative Queries Documentation] +and play around it by downloading the [Alternative Queries Package]. + +[MkDocs Material Documentation]: https://squidfunk.github.io/mkdocs-material/ +[Software+ML Code]: https://github.com/baluyotraf/softwareplusml +[Alternative Queries Documentation]: https://altqq.baluyotraf.com/stable/ +[Alternative Queries Package]: https://pypi.org/project/altqq/ \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 1a9c9da..6a4c6f6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,12 +15,17 @@ nav: plugins: - include-markdown + - search - social - blog: blog_dir: stories markdown_extensions: - md_in_html + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + auto_title: true theme: name: material From 8886145db7e2b0345de6b21d4be0a50b4d4885fc Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Fri, 22 Mar 2024 22:01:35 +0100 Subject: [PATCH 4/4] Add alternative queries entry in projects --- docs/projects/altqq.md | 13 +++++++++++++ mkdocs.yml | 1 + 2 files changed, 14 insertions(+) create mode 100644 docs/projects/altqq.md diff --git a/docs/projects/altqq.md b/docs/projects/altqq.md new file mode 100644 index 0000000..384f004 --- /dev/null +++ b/docs/projects/altqq.md @@ -0,0 +1,13 @@ +# Alternative Queries + +Alternative Queries is a library to help created type-checked and reusable +handcrafted SQL queries. The library also manages merging of parameters from +nested queries, making sure that the parameters are passed to your database +connection correctly. + +The library is still in development and there's still no `0.1` release. If +you are curious however, feel free to check the [Alternative Queries Documentation] +and try it out by downloading the [Alternative Queries Package]. + +[Alternative Queries Documentation]: https://altqq.baluyotraf.com/stable/ +[Alternative Queries Package]: https://pypi.org/project/altqq/ \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 6a4c6f6..a8b3e49 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,6 +11,7 @@ nav: - Stories: - stories/index.md - Projects: + - Alternative Queries: projects/altqq.md - Education: projects/education.md plugins: