Skip to content

Advent of Code 2020: "Toboggan Trajectory" - Day 3

Have to admit, on first glance this challenge looks a bit complicated. It's well suited for languages which can do string manipulations, but it's not well suited for PostgreSQL. Earlier today I already looked at this problem together with the kid, in Python. Therefore I already knew that I have to jump multiple rows as well. To sum it up: adjust x, including overruns, jump multiple rows in y direction, count trees along the way. All in a single SQL query.

Decided to do the map search in a pl/pgSQL instead, and write a function for it.

Task 1: you get a map of "." and "#", where the "#" are trees. You get instructions to move a certain number of steps into x and y direction, and see if there is a tree. Then repeat until the end of the map. A detail problem is that the number of fields in x direction is smaller than the y direction. There are no clear instructions how to handle this, but the correct solution is to just start at the leftmost position again.

Task 2: Repeat the task from task 1, but 5 times with 5 different instructions for x and y movement. The resulting numbers are to be multiplied.

Continue reading "Advent of Code 2020: "Toboggan Trajectory" - Day 3"
  • Twitter
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Advent of Code 2020: "Toboggan Trajectory" - Day 3
  • Bloglines Advent of Code 2020: "Toboggan Trajectory" - Day 3
  • Technorati Advent of Code 2020: "Toboggan Trajectory" - Day 3
  • Fark this: Advent of Code 2020: "Toboggan Trajectory" - Day 3
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at YahooMyWeb
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at Furl.net
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at reddit.com
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at blinklist.com
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at Spurl.net
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at Simpy.com
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 at blogmarks
  • Bookmark Advent of Code 2020: "Toboggan Trajectory" - Day 3 with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Advent of Code 2020: "Password Philosophy" - Day 2

Day 2, another challenge: fix a broken password database. In order to do that, the passwords which violate the policy must be identified.

Task 1: I get a string, consisting of 2 numbers, a letter, and a password string. Check how many passwords have count(letter) which is between number 1 and number 2.

Task 2: The numbers are positions in the password string (beginning by 1, not 0). Exactly one of the two letters in the string must match the letter.

 

Continue reading "Advent of Code 2020: "Password Philosophy" - Day 2"
  • Twitter
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Advent of Code 2020: "Password Philosophy" - Day 2
  • Bloglines Advent of Code 2020: "Password Philosophy" - Day 2
  • Technorati Advent of Code 2020: "Password Philosophy" - Day 2
  • Fark this: Advent of Code 2020: "Password Philosophy" - Day 2
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at YahooMyWeb
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at Furl.net
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at reddit.com
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at blinklist.com
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at Spurl.net
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at Simpy.com
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 at blogmarks
  • Bookmark Advent of Code 2020: "Password Philosophy" - Day 2 with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Advent of Code 2020: "Report Repair" - Day 1

Started "Advent of Code" with the kid, the kid is polishing the Python (and English) skills. I thought I better do this in SQL.

The Task 1 for "Day 1" is: you get 200 numbers from the accounting department, find the two which in sum are 2020. This two numbers multiplied is the result of the task.

Task 2 is like task 1, except it's using three numbers. All three in sum will be 2020, and then multiply these three and that is the result.

 

Continue reading "Advent of Code 2020: "Report Repair" - Day 1"
  • Twitter
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Advent of Code 2020: "Report Repair" - Day 1
  • Bloglines Advent of Code 2020: "Report Repair" - Day 1
  • Technorati Advent of Code 2020: "Report Repair" - Day 1
  • Fark this: Advent of Code 2020: "Report Repair" - Day 1
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at YahooMyWeb
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at Furl.net
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at reddit.com
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at blinklist.com
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at Spurl.net
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at Simpy.com
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 at blogmarks
  • Bookmark Advent of Code 2020: "Report Repair" - Day 1 with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Google Summer of Code 2020 - Intermediate status update

The three PostgreSQL projects for this year’s Google Summer of Code are on track, and making good progress. All projects expect to finish on time.

Performance Farm

The data gathering for performance farm members is completed, as well as the new implementation for the JSON data transfer. The project iteratively updated it’s goals, and adjusted for newly identified UI issues.

Current work centers around making the website more pretty and useful, as well as reducing the number of used JavaScript libraries. The next step is presenting the work to the PostgreSQL Community for broader feedback.


PL/Java build system

The PL/Java project has just merged (PR #288) the first major pull request of new code from GSoC, creating a new plugin for the Maven build system that allows its actions to be guided by script snippets clearly exposed in the build files.

The same effect was formerly achieved by a workable but brittle combination of an existing Maven plugin that could handle most of the build requirements with another plugin that was able to run Ant, which was able to run scripts. That resulted in a non-ideal division of labor, where a good deal of build logic was hidden away inside plugins, while some parts were exposed in script out of necessity, rather than because they were interesting or likely to need adjustment.

This pull request proves the concept of a new plugin where the hardcoded Java portions are the uninteresting building blocks, and the overall logic of the build is clearly exposed in script.

For now, the new plugin is used to retire the maven-javadoc-plugin and remove the constraints it had imposed on the project's javadocs (such as the need for absolute URLs for intermodule references, making the resulting tree hard to preview or relocate).

Work continues to reimplement the C native build and retire the nar-maven-plugin and maven-antrun-plugin, to be delivered in a future PR.


WAL-G Performance

We’ve just completed the decoupling of the complex WAL-G internal class. Thanks to it, the new functionality developed in July for a more intelligent backup creation process can now be safely integrated. This feature involves major changes so it requires time to verify that everything is working as expected. We plan to finish the integration in parallel with working on other features.

Currently, we are working on merging the new series of commands for the WAL archives that have been uploaded to storage. These commands will allow end users to analyze the storage for any missing WAL segments that may prevent performing a PITR. Also, Dan now is in the process of implementing the last feature and he expects to finish it on time.


Thanks to all mentors for the status update!

  • Twitter
  • Bookmark Google Summer of Code 2020 - Intermediate status update at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Google Summer of Code 2020 - Intermediate status update
  • Bloglines Google Summer of Code 2020 - Intermediate status update
  • Technorati Google Summer of Code 2020 - Intermediate status update
  • Fark this: Google Summer of Code 2020 - Intermediate status update
  • Bookmark Google Summer of Code 2020 - Intermediate status update at YahooMyWeb
  • Bookmark Google Summer of Code 2020 - Intermediate status update at Furl.net
  • Bookmark Google Summer of Code 2020 - Intermediate status update at reddit.com
  • Bookmark Google Summer of Code 2020 - Intermediate status update at blinklist.com
  • Bookmark Google Summer of Code 2020 - Intermediate status update at Spurl.net
  • Bookmark Google Summer of Code 2020 - Intermediate status update at Simpy.com
  • Bookmark Google Summer of Code 2020 - Intermediate status update at blogmarks
  • Bookmark Google Summer of Code 2020 - Intermediate status update with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Google Summer of Code 2020 started

The PostgreSQL Project participates in Google Summer of Code (GSoC) 2020, with 3 projects. After the “Community Bonding” period finished last week, we are now in the active development phase - “Coding” as Google calls it. All three projects make good progress!

 

Performance Farm

The project defined a number of milestones, and evaluated the current database structure. Modifications are required on this front, and will be applied over the following days. Also the structure for sending data from the client to the project server is re-evaluated and modified. The student started with the database design modifications, and also with documenting the changes and terminology used.

 

PL/Java build system

Thanks to the ongoing work setting up the continuous integration, PL/Java's master branch - which will become the 1.6 release - is now getting regular CI builds against several PostgreSQL and Java versions on amd64 Ubuntu and Mac OS X, and the student has moved on to setting up the same for Windows. We had a goal to enable test options in the CI builds that were otherwise impractically strict, and identify ways to filter the output down to a manageable volume which is exposing real issues. Through a combination of fixes to some real PL/Java warnings, and a small state machine now keeping known non-PL/Java ones out of the log, the project now builds -Xcheck:jni clean. The first actual bug found through the students work got fixed before the bonding period ended - the bug had been there for fifteen years.

The later part of the work will involve more straight-up coding, to replace a Maven plugin now used in PL/Java's build that isn't quite suited to the need. The proposal outlined a few reasons for that and the preliminary work has already uncovered more reasons. It was already a goal of that work to improve the signal-to-noise ratio of diagnostics from that plugin, so already solving a similar problem for -Xcheck:jni was a good warmup.

 

WAL-G performance

First 2 weeks are going almost as we planned, the student started working on the first task during the phase of proposals. In the first week he updated his PR and we merged it. The first feature already works. This week he updated it with several improvements (mostly refactorings) and started working on test coverage of the first feature and also making some drafts on the second feature. Now we have discussion about design details of the second feature. I hope it will help to implement it according to the current plan.

 

Thank you to all mentors for the status update!

  • Twitter
  • Bookmark Google Summer of Code 2020 started at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Google Summer of Code 2020 started
  • Bloglines Google Summer of Code 2020 started
  • Technorati Google Summer of Code 2020 started
  • Fark this: Google Summer of Code 2020 started
  • Bookmark Google Summer of Code 2020 started at YahooMyWeb
  • Bookmark Google Summer of Code 2020 started at Furl.net
  • Bookmark Google Summer of Code 2020 started at reddit.com
  • Bookmark Google Summer of Code 2020 started at blinklist.com
  • Bookmark Google Summer of Code 2020 started at Spurl.net
  • Bookmark Google Summer of Code 2020 started at Simpy.com
  • Bookmark Google Summer of Code 2020 started at blogmarks
  • Bookmark Google Summer of Code 2020 started with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Related Projects

The PostgreSQL main website has a new page: "Related Projects".

This page lists the projects which help running and maintaining the PostgreSQL project, the infrastructure, and other things like the translations for press releases. For each project it lists links to the source, as well as information where to send updates, patches, or input.

If you want to get involved in one of the projects, that's your starting point. If a project is missing, please send a note or a patch to pgsql-www.

Many thanks to Jonathan S. Katz for polishing the patch, and making it look nice!

  • Twitter
  • Bookmark Related Projects at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Related Projects
  • Bloglines Related Projects
  • Technorati Related Projects
  • Fark this: Related Projects
  • Bookmark Related Projects at YahooMyWeb
  • Bookmark Related Projects at Furl.net
  • Bookmark Related Projects at reddit.com
  • Bookmark Related Projects at blinklist.com
  • Bookmark Related Projects at Spurl.net
  • Bookmark Related Projects at Simpy.com
  • Bookmark Related Projects at blogmarks
  • Bookmark Related Projects with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

PostgreSQL Data Types workshop at SCALE18x

SCALE 18x is taking place during the next week, in Pasadena, CA. I will present a 3 hours workshop about PostgreSQL data types on Friday morning.

In order to attend, you need a SCALE registration. No special knowledge is required for the workshop. If you want to follow the exercises, you need a PostgreSQL database installed on your computer.

 

See you there!

  • Twitter
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg PostgreSQL Data Types workshop at SCALE18x
  • Bloglines PostgreSQL Data Types workshop at SCALE18x
  • Technorati PostgreSQL Data Types workshop at SCALE18x
  • Fark this: PostgreSQL Data Types workshop at SCALE18x
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at YahooMyWeb
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at Furl.net
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at reddit.com
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at blinklist.com
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at Spurl.net
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at Simpy.com
  • Bookmark PostgreSQL Data Types workshop at SCALE18x at blogmarks
  • Bookmark PostgreSQL Data Types workshop at SCALE18x with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

SELECT pg_sleep_until('#800Monies');

Pavlo recently pointed out that the pg_sleep() function in PostgreSQL has two alternatives: pg_sleep_for() and pg_sleep_until().

What do they do?

 

Continue reading "SELECT pg_sleep_until('#800Monies');"
  • Twitter
  • Bookmark SELECT pg_sleep_until('#800Monies'); at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg SELECT pg_sleep_until('#800Monies');
  • Bloglines SELECT pg_sleep_until('#800Monies');
  • Technorati SELECT pg_sleep_until('#800Monies');
  • Fark this: SELECT pg_sleep_until('#800Monies');
  • Bookmark SELECT pg_sleep_until('#800Monies'); at YahooMyWeb
  • Bookmark SELECT pg_sleep_until('#800Monies'); at Furl.net
  • Bookmark SELECT pg_sleep_until('#800Monies'); at reddit.com
  • Bookmark SELECT pg_sleep_until('#800Monies'); at blinklist.com
  • Bookmark SELECT pg_sleep_until('#800Monies'); at Spurl.net
  • Bookmark SELECT pg_sleep_until('#800Monies'); at Simpy.com
  • Bookmark SELECT pg_sleep_until('#800Monies'); at blogmarks
  • Bookmark SELECT pg_sleep_until('#800Monies'); with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

PostgreSQL @ FOSDEM 2020

The PostgreSQL Project is present with a booth at FOSDEM ever since 2007. Since 2008 we organize a Devroom, since 2013 we have our own PGDay on the Friday before FOSDEM. This year marks the 8th FOSDEM PGDay.

This blog post presents useful information about the PGDay, the booth and Devroom at FOSDEM.

 

Continue reading "PostgreSQL @ FOSDEM 2020"
  • Twitter
  • Bookmark PostgreSQL @ FOSDEM 2020 at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg PostgreSQL @ FOSDEM 2020
  • Bloglines PostgreSQL @ FOSDEM 2020
  • Technorati PostgreSQL @ FOSDEM 2020
  • Fark this: PostgreSQL @ FOSDEM 2020
  • Bookmark PostgreSQL @ FOSDEM 2020 at YahooMyWeb
  • Bookmark PostgreSQL @ FOSDEM 2020 at Furl.net
  • Bookmark PostgreSQL @ FOSDEM 2020 at reddit.com
  • Bookmark PostgreSQL @ FOSDEM 2020 at blinklist.com
  • Bookmark PostgreSQL @ FOSDEM 2020 at Spurl.net
  • Bookmark PostgreSQL @ FOSDEM 2020 at Simpy.com
  • Bookmark PostgreSQL @ FOSDEM 2020 at blogmarks
  • Bookmark PostgreSQL @ FOSDEM 2020 with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Google Summer of Code 2019 - PostgreSQL participates with 5 projects

For the 13th year, the PostgreSQL Project is participating in Google Summer of Code (GSoC). This project is a great opportunity to let students learn about Open Source projects, and help them deliver new features. It is also a chance to engage the students beyond just one summer, and grow them into active contributors.

In GSoC, students first learn about the Open Source organization, and either pick a summer project from the list provided by the org, or submit their own idea for review. After a “community bonding” period, the students have time to implement their idea, under supervision of mentors from the Open Source organization. There is also an incentive: first, Google pays the students for their work on improving Open Source projects. And second, having a completed GSoC project in a CV is well recognized.

Continue reading "Google Summer of Code 2019 - PostgreSQL participates with 5 projects"
  • Twitter
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Google Summer of Code 2019 - PostgreSQL participates with 5 projects
  • Bloglines Google Summer of Code 2019 - PostgreSQL participates with 5 projects
  • Technorati Google Summer of Code 2019 - PostgreSQL participates with 5 projects
  • Fark this: Google Summer of Code 2019 - PostgreSQL participates with 5 projects
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at YahooMyWeb
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at Furl.net
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at reddit.com
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at blinklist.com
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at Spurl.net
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at Simpy.com
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects at blogmarks
  • Bookmark Google Summer of Code 2019 - PostgreSQL participates with 5 projects with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca