Code Monkey home page Code Monkey logo

brainylog's Introduction

BrainyLog

Your brain is pretty impressive! But sometimes it has trouble remembering things. BrainyLog is the extension to your brain, combining it's amazing cognitive abilities with a super-convenient tool that lets you access anything you wanted to remember, without having to remember the specifics of what you wanted to remember.

BrainyLog keeps track of any info you want to remember for posterity, be it specific research, or tasks that you don't want to leave un-completed.

And there's no need to be selfish. BrainyLog even allows you to share and collaborate memories - it's almost if you could share your brains (the memory part only, of course).

Sounds too good to be true? It is right now. Because we're in version v 0.1. But it won't be once it's given some time to mature.

Quickstart

You didn't master your mind in a few days. But you could get started the day you were born. BrainyLog works the same way, only faster.

BrainyLog commands run on the command line in your favorite Windows, Linux, or MacOS terminal: Before you can run any commands though, create an empty log.bl file in your current directory. BrainyLog will warn if this file does not exist in the current directory. This file is used to store all your logs, so be careful with it!

Add information:

$ brainylog a l The small bananas are my favorite.

The a command tells brainyLog to log some info. The l is an argument that tells brainyLog to add whatever comes after it to the logs.

Add tasks:

$ brainyLog a t l Bake a cake.
This works the same as the above command, except it adds a task "Bake a cake." The task is in the created state by default.

Retrieve information:

$ brainyLog g
This simply retrieves all the logs that haven't been deleted.

$ brainylog g l bake cake.
Bake a cake. [0]

The g command tells brainyLog to retrieve all lines that match some of the keywords that come after l. The lines are retrieved along with a number that can let you access the line directly using this number - more on this later.

You can use the nm argument to tell brainyLog not to display any metadata:

$ brainyLog g nm l cake Bake a cake.

You can also retrieve tasks in any given state:

$ brainyLog g t progress l bake cake

Also, given a line, you can get lines above and below it, including the line itself:

$ brainyLog g n 3 Each line displayed would have a new positional number, overwriting the previous number mappings.

If you want to keep the current number mapping, you can display these lines without the metadata:

$ brainyLog g n 3 nm

You can also process tasks, moving them to a different state:

$ brainyLog t t complete n 5

And retrieve tasks by state:

$ brainyLog g t progress

Or simply all tasks:

$ brainyLog g t allTasks

You can delete any logs entered by accident:

$ brainyLog d n 3

Find the complete documentation here:
https://github.com/thehamzarocks/brainylog/blob/master/doc.md

Local Setup

Want to fiddle around? Or give back? Get started with the source code on your own system:

A quick go tutorial:

https://howistart.org/posts/go/1/

Clone the repo

$ git clone https://github.com/thehamzarocks/brainylog.git

Install go for your env (look it up)
Set the environment for go commands

$ mkdir bin/

$ go env -w GOBIN=/some_path/bin

Build and install

$ go build

$ go install

Create a default log.bl file

$ touch log.bl

You're good to go!

$ ./brainyLog v
(add the binary to your path to call it without the ./)

brainylog's People

Contributors

thehamzarocks avatar

Stargazers

Shawn Pereira avatar mustafa avatar

Watchers

James Cloos avatar  avatar

brainylog's Issues

Command to add basic info to log.bl

$ brainylog a this is some info

Should add

(2020-06-27T13:25:53+05:30)[1593244553012.0]5609c717-8ff8-4b33-808f-c208feacfb0d>this is some info
into a new line in log.bl.

Also support multiline info:

$ brainylog a "this is one line
this is the next?
Yup"

Only the first line will have the timestamps and uuids

Display surrounding lines of lines matched with n or u in g commands

On line match, display surrounding lines too.

Need clarification on exact functionality - would this be done by default on every get? - might lead to lots of text, maybe the user can specify the number of surrounding lines as an option.

Another important requirement is to display the surrounding lines of a particular line using its hash.

For version v 0.1, for any line uuid or pos number, we'll display 5 lines above and below if the following command is entered:

$ brainyLog g -u lyg66g7 (based on uuid)
$ brainyLog g -n 3 (based on temporary positional number)

Search Relevance Algo

Instead of simple searches based on if any of the keywords match, use the following algo to come up with scores to determine the relevance of a line in the result and return the lines in order of relevance whenever the get command is used:

Parameters affecting relevance
tf-idf - use a smart version of this
timeStamp - more recent lines are more relevant

File Organization

In addition to the default log.bl, users should be able to create their own .bl files for organization.

Support lookups and adds on a specific file, as well across all of the user's .bl files.

Should fail to process task on info logs

Currently, the task processing outputs success when done on info logs.

There is no change in the log itself, but this message should be changed to say
"Cannot change task state on info log!"

Design for Brainy Web

We need to come up with a design for our web UI.

The following are the priorities from a user perspective:

  1. Clean interface, focus on operations, no clutter.
  2. Minimal taps, UI elements resize based on current action so the most important ones are in view.

A basic transition: Landing Page -> sign up -> Available memories (files) -> add or get
If add -> Fill up UI with editable section, the user adds an element.
If get -> searchbar and results on whole page -> the user selects an element - > the search elements resize and a new view with actions on the given element along with a section based on the action selected fills up the view.

Allow lines to be marked for delete

Having your log file full of unwanted data is no fun!
Mark lines as deleted so they won't be retrieved by brainyLog.

Have a status metadata for every line (s-00 by default)

Status 00 means it's a normal line.
Status 01 means it's deleted.

Delete lines using the following command:

$ brainyLog d u 724gh

Or using temporary positional number:

$ brainyLog d n 3

Lines once deleted cannot be undeleted (at least for now!)

Set log.bl file path to current directory

Change the path of the file to the current directory.
This will require the user to actually be in the same directory as the file to execute commands that require the file

Polish command response messages

All brainyLog commands should output meaningful messages when executed.

Major interface redesign! Showing all the line metadata by default makes no sense. The UUID should hardly ever be visible to the user, and the temporary positional number should be used instead. The UUID could have been used as a quick way to refer to a particular line with 100% certainty, but now seems silly as the get command is supposed to return relevant results all the time anyway.

For info logs:
Show line content and positional number.

For tasks:
Show line content, status, and positional number.

nm shows only line contents, and the temporary positional number should not be updated in this case.

This should help ensure the interface isn't intimidating and is joyous to use.

Fuzzy search

The keywords needn't be entirely contained in the line.
Typos and missing chars can be allowed.
Relevance to be determined.

Access log.bl from any location

Currently, the file path bin/log.bl is used to access the file, change this so it can be accessed from anywhere.

Proposed solution:

  • Set an env variable containing the path to the file (can be done using a "setup" command.
  • Reference this env variable in all file accesses in code.
  • If the file is found, use it, else look for .log.bl in the current directory.
  • If neither match, display an error to the user.

Ensure compatibility with Windows/ Linux and MacOS

log.bl will be in same directory as brainyLog

To keep things simple, if no log.bl exists in the current directory, brainyLog errors, and asks the user to create an empty log.bl in the current directory, with the warning that the file would be empty if the command is an add.

For commands other than add, brainyLog simply errors.

Release v0.1

Standard Release Procedures:

  1. Ensure README is up to date
  2. Verify binary works on Windows, Linux and Mac
  3. Reach out to potential users and receive feedback on improvements, bugs, and features.

v0.1 Specific Procedures:

Different View Modes

Currently, brainyLog g gets matching lines along with all their metadata.

Edit the below description - we will generate a scratch file on every write. The user can play around. But on next write the changes would be overwritten with whatever's in the .bl file.

This can be the default behavior. But also allow a --filemode flag to define the view

$ brainyLog g --filemode

This creates a file named .log-scratch.bl in the same directory as .log.bl.
This would be a regular text file that's editable independent of brainyLog, with lines in temporal order.

The command also outputs a list of line numbers corresponding to the matches of the g command in the .log-scratch.bl file.

Once this file has been created by brainyLog, it's completed independent. The user can do whatever he wants with the file, but it will be overwritten on next run of the g command with --filemode.
The command can prompt a confirmation if the file would be overwriten, allowing the user to make a copy of the file if necessary.

Restrict to single-line logs for version v 0.1

While we could technically incorporate multi-line logs at this early stage, there would be several things that would need to be polished. We'd need to set limits (or not?), decide how to display them to the user and so on.

For now, in our goal to deliver a smooth, clean experience with every version, we're only going to support single-line logs.

Prevent user from entering multi-line log in brainyLog a

Allow temporary line identifier instead of uuid to match line

Currently, the user needs to input the UUID of the required line for certain operations.

The get command should also return a temporary line identifier (can be digits from 0-...) and the user can enter these instead of the UUID for those operations.

Command to retrieve lines from log.bl based on keyword match

Simple keyword matching for now. Ignore relevance and fuzzy matching.
Linear search for keywords - list all lines that have keywords that match along with timestamps and hashes
For multiline info, show only the first line with (m) before all line metadata for that line.

Redesign command syntax

Using -'s is hard on a mobile keyboard.
Also, we need a way of identifying when the command's arguments have ended and when the log actually begins so we can enter argument chars in the actual log too.

$ brainyLog a t l bake a cake
Add a task "bake a cake"

$ brainyLog g t progress l l is a wonderful letter
Get in-progress tasks that match l is a wonderful letter

Temporal Positioning

It's time to bring together relevant logs - temporal locality to the rescue!

Steps:

  1. User does a search:

$ brainyLog g milk
drink milk [0]
milk is good for you [1]
This milk has gone sour [2]

  1. The user uses the a command with the n (temporal positioning) key and the value as the positional number to add the new log just after the specified one:

$ brainyLog a n 2 l milk goes sour if left undrunk

n can be combined with the t flag to temporally position tasks.

Get tasks in a given state

The user can retrieve all tasks in a given state using the get command with the -t option:

$ brainyLog g -t created

Also provide an all option to get all tasks:
-t all

The user can also optionally specify a search input to filter tasks:

$ brainyLog g -t progress heat leftovers

Due Dates and Priorities for Tasks

Not all tasks are equal. Some are more important than others. And some simply need to be done now!

Provide an interface for prioritizing tasks, as well as setting deadlines (soft and hard).

And then provide quick and easy methods to get the tasks you should be working on.

Improve search algo by incorporating idf

Currently using nromalize term frequency on tokens and exact match scores on keywords to get scores for each line.

Can be improved using idf and other heuristics.

Refer to the last comment issue:
#26
for current implementation details

Add and retrieve tasks

The user should be able to pass in a -t flag while adding a log to denote it as a "task" log.
Append the following to the end of the epoch element [...]: (T0)

Retrieval works exactly the same as for info logs for now.

Add info flag to get command

Since tasks could be repeatedly entered (example: buy milk!), having all these entries show up when we're looking for some information would be annoying at the very least!

Allow an i flag for g commands which only search for info logs.

Process Tasks

The following are the task states and the command option to move them to that state
T-0 - Task Created - automatically done when a task log is added
T-1 - Task In Progress - progress
T-2 - Task Suspended - suspend
T-3 - Task Cancelled - cancel
T-4 - Task Completed - complete

The user can move any task log to any one of these states at any time using the t command:

$ brainyLog t ggh67y complete

Paginate get results

Since brainyLog is supposed to help you find whatever, there might be loads of matches on every get l.

To avoid filing up the interface with loads of irrelevant results, paginate the results, showing the next set of results only on a particular keypress.

This helps ensure matches are (mostly) always found, even though poor search terms may require a lot of sifting through results.

Sharing memories

Currently, to share information with other users, a user would have to send him a copy of his .bl file.

But we can also have a feature to merge memories in a single .bl file in real-time for collaboration.

Add file lookup

Need more information on the requirements:

What kind of files? What do they contain?
Lookup by filename only or based on contents also?

Use the N flag to reference the last entered line / retrieved single line

Temporal locality works fine with the n < position >, but if the user wants to add multiple entries one after the other, always referencing the same position will result in the entries being added in reverse order.

The N flag would also be a convenient way to work on immediate data.

Eg:

$ brainyLog g l some info
$ brainyLog a n 3 l some info 1
$ brainyLog a N l some info 2
$ brainyLog a N l some info 3

This would add the three info's just after some info in that order.

Can also be used with the t and d commands to process the immediately added/retrieved line.

The line bound to N is unaffected if multi-line retrieval is performed.

Search on any file - task search and processing

This is a bit fiddly. We can simply do a search on each line, that's fine. But for tasks, we need some special demarcation, maybe a (T-0) at the end?

The task states would then be manually entered by the user using (T-< state number >)

This is on the user to ensure the manual editing of text files is accurate. BrainyLog provides no guarantees, only conveniences on such files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.