Ask HN: What projects are you working on now?
809 pointsWith the quarantine being placed in effect in a lot of cities across the world, we all likely have a little bit more time to focus on personal projects or learning something new from the comfort of our homes. What are you guys up to these days?
Comments (1,237) 697 threads
Earlier commentsContinue this thread — 1 reply
Most of them will cut power after a minute of so if you don't draw more than like 100mA of current, but that shouldn't be a problem with 350 LEDs. It'll save your Arduino's voltage regulator some grief, too :)
http://correll.cs.colorado.edu/?p=2315
Click to make buildings (above the tree line only right now) and click and drag the sun down to go to night. Drag the moon to return to day.
Gif of night sky: https://twitter.com/simonsarris/status/1235761030996901888
The point is to replace the background town that's currently on https://simonsarris.com (which is animated purely by CSS right now, including the birds) with a much more interactive and playful one. (the current site background gives you an idea of what will be built and why it currently only works behind the tree line). The time consuming part right now is making pretty graphics. I had begun with buildings made from Canvas drawing code, with procedural params and all that, but I'm switching to images because it will be much prettier in the long run.
https://getpolarized.io/
It's been out for about 1.2 years now and we're really starting to nail some important features.
JUST about to post a new release now.
COVID19 is having us pivot a bit in that we're going to experiment with collaborative group reading in the hopes that students can work more efficiently with their colleagues without having to leave home.
The core idea is to have a fully-integrated reading platform sort of like an integrated development environment but for non-fiction material (textbooks, research papers, documentation, plus web content).
Right now we support PDF and web content but are actively working on EPUB and improved reading of web content.
The key functionality is built around annotating your documents and taking notes and building flashcards so you can maintain a personal knowledge repository.
It's also Open Source and supports cloud sync. We have a mobile webapp now and working on porting it over to Android soon.
It's a useful tool for DBA to identify issues in SQL queries automatically. Only 50 rules for now, but more than 1000 described in backlog :)
Funny, but initially this tool aimed at developers' needs.
I've made a lot of microservices, which only started the database queries. I came up with the idea of making a tool that would automatically generate all the microservices based on SQL queries. The MVP of such a tool was implemented, which reduced the developer workload by at least a quarter. In this tool, it was required to write queries in a certain way that did not make it universal and did not give a connection with the database structure.
The next step was to create a system that relies on the text description of the database schema in SQL format (DDL) and automatically understands the types that will return the SQL query. Such a tool can automatically inform the developer about possible errors on the interface between the application and database when changing the structure or the SQL queries themselves. It can also be built into the CI to provide the automatic code review at the version control system level and prevent the erroneous code from entering the repository.
But the developers did not appreciate all the advantages, as most projects are developed using ORM :(
But at the same time, DBAs expressed interest in implementing a system of the automatic search for bad requests already on the production database.
Any questions are welcome :)
I too have been diving into writing raw SQL some while ago and I liked it.
The idea is that the tool will only work with the sources of SQL queries, and I had to work hard to implement it.
The work consists of several steps 1) get the AST (Abstract Syntax Tree) database schema (DDL). At this stage, only Postgresql up to version 10 is supported. Soon I will deal with the parser from Postgresql 13. This is not a trivial task. I have to build everything from the source code of Postgresql :)
2) Building a database model. We parse all DDL-commands one by one and apply changes. For example, apply all ALTER TABLE to the table described above, add user-defined functions to the list of built-in functions, and so on. It is necessary to have a complete overview of all types of tables, indexes, and each table described in a DDL script.
3) get an AST query (DML) and build a model of the result. This is the most complex and interesting part :) The task is to get a list of field names and their types, which will be returned after the query execution. You need to consider CTE and the list of tables specified in FROM. You need to understand what function will be called and what result will be output. For example, function ROUND is described in three variants, from different arguments and with varying types of result, function ABS - in six variants. I.e., it is required to understand the types of arguments before selecting a suitable one :) In the process, implicit type casting is considered if necessary.
The same is valid for operators. An operator in Postgresql is a separate entity that you can create yourself. Postgresql 11, for example, describes 788 operators.
Various types of syntax are taken into account, for example - SELECT , t1., id, public.t2.name, t3.* FROM t1, t2, myschema.t3 - will be parsed correctly.
But even this is not the most challenging thing :) The most exciting thing is to be able to understand two things: A. whether each of the fields can be NULL or not. It depends on many factors, such as - how the JOIN of the table with the source column is made, whether there is a FOREIGN KEY, what type of JOIN is used, what conditions are described in the ON section, what is written in the WHERE conditions. B. How many records will return the query described in the NONE, ONE, ONE OR NONE, MANY, MANY OR NONE categories. Again, this is affected by the conditions described in JOIN and WHERE, whether there are aggregation functions, whether there is GROUP BY, whether there are functions that return multiple records.
This function, by the way, is also used in the first step - to get types for VIEW.
This was a brief description of the first part of the service ;). It can already be a service in itself. It is possible to generate types and all code of microservices, including JSON-schema and tests, based on DLL and DML set. But as I wrote above, most people prefer to use an ORM such as Django or RoR. :( For this reason, I've removed this functionality from a playground and will take it to a separate project when I get my hands on it. It will also include various tools, such as - information about all possible exceptions that may be thrown by request, automatic creation of migrations to CI if your DDL files are in the repository, whether there are unused indexes or fields and many other exciting things :)
And the second part of the service that I plan to promote in the first place is a tool to search for bugs, architectural, and performance problems automatically. The target audience here is DBA, who have to deal with forgeries RoR-developers and their colleagues :) This part is entirely based on all information obtained in the previous stages. Part of the errors can be understood by AST (linter principle), but the most interesting rules are based on knowledge about types, understanding of NULL/ IS NOT NULL, and the number of returned records.
There are more than a thousand such rules, but I suppose there will be about 5000 of them in the next couple of years :) Also described are about 200 rules that can lead to runtime errors, but they are not needed by DBA, because their job is to find problems in valid queries :) There will be more than 1000 such rules as well since Postgresql describes more than 1700 runtime errors.
And yes, this is all about Postgresql. After I start commercially using Postgresql, I plan to do the same for Mysql and then perhaps for Clickhouse if there are no special offers of cooperation :)
But my application was to be able to use raw SQL queries instead of an ORM in an application. By statically analyzing the SQL queries, then you can, in a statically typed language, automatically type-check the parameters to and results of the queries. Combining that and an IDE like the Jetbrains ones, which provide intelligent SQL autocompletion/refactoring, then tbh., I think it would beat an ORM in terms of ergonomics. Some people like LINQ or various Haskell/Scala ORMs because they are type-safe. This would be totally natural to those who know SQL without the downsides of being totally unanalyzed and type-checked.
It would be like the clojure library called hugs, but with static type-checking.
Continue this thread — 3 replies
sadly it wasn't picked up.
Congrats on product, there is a big market for it
Continue this thread — 1 reply
It is crucial that you add the actual database schema (DDL) before checking.
This functionality will appear soon (client cabinet, API).
Please note that analysis is performed using static methods only! No connection to the database is required. In particular, statistics and other environmental parameters that may affect the query performance are not taken into the analysis. I would like to be able to enrich the data obtained by static methods with data from the database production, but at the moment, this is a very far-reaching plan.
The tool will make recommendations that are necessary, but not enough.
The actual database parameters affect the real query plan. There are a lot of such settings, and the impact changes over time.
Keeping an eye on these parameters and adjust them - there is a significant layer of work that is not a priority at this stage. Excellent tools have already been made for this purpose, such as postgres.ai.
DBA work is divided into two parts - to monitor the quality of queries and database schema and configure the parameters of production servers.
My tool covers the needs of the first part and does not cover the second part.
I talked to product owners of companies producing products or services related to the second part, and they agreed to integrate our products when I come ready.
All comments shown.
Couldn't load more comments. Check your connection and try again.