Skip to content

Instantly share code, notes, and snippets.

from whoosh import index, fields
from whoosh import qparser
# Fake data from external files
files = [
(u"t1.txt", u"Earth is a beautiful planet.Earth is the third planet from the Sun. It is the densest and fifth-largest of the eight planets in the Solar System. It is also the largest of the Solar System's four terrestrial planets. It is sometimes referred to as the world or the Blue Planet."),
(u"t2.txt", u"jupiter is the biggest planet."),
(u"t3.txt", u"earth is known as blue planet."),
(u"t4.txt", u"earth is the 3rd most planet in the universe."),
import os.path
import sqlite3 as sqlite
from sqlite3 import Binary
from whoosh.kv.db import Database, DBReader, DBWriter, Cursor
from whoosh.kv.db import OverrunError, ReadOnlyError
class Sqlite(Database):
default_table = "kv"

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@mchaput
mchaput / quick_labs_menu_autofill.qml
Created October 1, 2024 21:54
Minimal example of issue where Qt labs Menu element gets an extra "AutoFill" submenu if it's in the same window as a TextField
import QtQuick
import QtQuick.Controls
import Qt.labs.platform as Labs
ApplicationWindow {
id: root
width: 640
height: 64
visible: true
Rectangle {