Skip to content

Instantly share code, notes, and snippets.

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@paulogaspar7
paulogaspar7 / bash-to-zsh-hist.py
Created July 31, 2020 19:21 — forked from muendelezaji/bash-to-zsh-hist.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@paulogaspar7
paulogaspar7 / SmallRomans.scala
Last active April 24, 2016 20:02
Romans number parser with (some) validation. Not beautiful, not efficient, just small...
def table(i: Char, v: Char, x: Char) = Seq("", s"$i", s"$i$i", s"$i$i$i", s"$i$v", s"$v", s"$v$i", s"$v$i$i", s"$v$i$i$i", s"$i$x" )
val x1000 = Seq("", "M", "MM", "MMM", "MMMM")
val x100 = table('C', 'D', 'M')
val x10 = table('X', 'L', 'C')
val x1 = table('I', 'V', 'X')
val lookup: Map[String, Int] = (1 to 4999).foldLeft(Map.empty[String, Int]) {
case (m, d) => m.updated(x1000(d / 1000) + x100((d % 1000) / 100) + x10((d % 100) / 10) + x1(d % 10), d)
}
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
public class SpringExceptionTranslationExecuteListener
extends DefaultExecuteListener {
/** {@inheritDoc} */
@Override
public void exception(ExecuteContext ctx) {
String name = productName(ctx.configuration().dialect());
/* Prefer product name, if available. */
SQLExceptionTranslator translator = (name != null)
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so
WeakHashMap<Integer, String> map = new WeakHashMap<Integer, String>();
map.put(new Integer(10), "aaa"); // remove entry
// map.put(10, "aaa"); // don't remove entry
// map.put(Integer.valueOf(10), "aaa"); // don't remove entry
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (map.size() != 0) {
System.out.println("At iteration " + i + " the map still holds the reference to object");
} else {
@paulogaspar7
paulogaspar7 / bash.sh
Created January 6, 2014 02:16 — forked from hugocf/bash.sh
#!/usr/bin/env bash
# Created by Hugo Ferreira <[email protected]> on isoD.
# Copyright (c) 2012 Mindclick. All Rights Reserved.
# Licensed under the BSD License: http://creativecommons.org/licenses/BSD
readonly BASEDIR=$(cd "$(dirname "$0")" && pwd) # where the script is located
readonly CALLDIR=$(pwd) # where it was called from
# Script configuration
readonly CONSTANT="value"
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="building">
<echo>
---------------------------------------------------