I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.
| using System; | |
| namespace channelbench | |
| { | |
| using System.Collections.Concurrent; | |
| using BenchmarkDotNet.Jobs; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Attributes.Jobs; | |
| using BenchmarkDotNet.Running; | |
| using System.Collections.Generic; |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.AspNetCore.Routing; | |
| using Microsoft.AspNetCore.Http; |
Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
|
[ Update 2025-03-24: Commenting is disabled permanently. Previous comments are archived at web.archive.org. ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
##Golang Type Switch - Arbitrary JSON Array Parsing I'm writing this mostly as a reference for myself. This could also be helpful to people who are new to GO.
####Note 1: Until Problem 3 we will assume we are dealing with a JSON for which we know the data types of key,value pairs. Only in Problem 3 we will look at how Type Switch is used to parse a 100% arbitary JSON
####Note 2: I know the following examples given here can be easily solved by declaring approprite structs and just decoding the PUT JSON into them, but, as im not able to come up with a better scenario, im going to stick with this to explain arbitrary JSON parsing.
| package main | |
| import ( | |
| "net/http" | |
| "log" | |
| ) | |
| func redirect(w http.ResponseWriter, req *http.Request) { | |
| // remove/add not default ports from req.Host | |
| target := "https://" + req.Host + req.URL.Path | |
| if len(req.URL.RawQuery) > 0 { |
| # Block Skype ads | |
| 127.0.0.1 *.msads.net | |
| 127.0.0.1 *.msecn.net | |
| 127.0.0.1 *.rad.msn.com | |
| 127.0.0.1 a.ads2.msads.net | |
| 127.0.0.1 ac3.msn.com | |
| 127.0.0.1 ad.doubleclick.net | |
| 127.0.0.1 adnexus.net | |
| 127.0.0.1 adnxs.com | |
| 127.0.0.1 ads1.msn.com |
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
| // Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
| $ git ls-files | xargs wc -l |