Giter Club home page Giter Club logo

braindump's Introduction

Jethro's github stats

braindump's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar hraban avatar jethrokuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braindump's Issues

while(not

Locks are used for mutual exclusion. When you want to ensure that a piece of code is atomic, put a lock around it. You could theoretically use a binary semaphore to do this, but that's a special case.

Semaphores and condition variables build on top of the mutual exclusion provide by locks and are used for providing synchronized access to shared resources. They can be used for similar purposes.

A condition variable is generally used to avoid busy waiting (looping repeatedly while checking a condition) while waiting for a resource to become available. For instance, if you have a thread (or multiple threads) that can't continue onward until a queue is empty, the busy waiting approach would be to just doing something like:

//pseudocode
while(!queue.empty())
{
sleep(1);
}
The problem with this is that you're wasting processor time by having this thread repeatedly check the condition. Why not instead have a synchronization variable that can be signaled to tell the thread that the resource is available?

//pseudocode
syncVar.lock.acquire();

while(!queue.empty())
{
syncVar.wait();
}

//do stuff with queue

syncVar.lock.release();
Presumably, you'll have a thread somewhere else that is pulling things out of the queue. When the queue is empty, it can call syncVar.signal() to wake up a random thread that is sitting asleep on syncVar.wait() (or there's usually also a signalAll() or broadcast() method to wake up all the threads that are waiting).

I generally use synchronization variables like this when I have one or more threads waiting on a single particular condition (e.g. for the queue to be empty).

Semaphores can be used similarly, but I think they're better used when you have a shared resource that can be available and unavailable based on some integer number of available things. Semaphores are good for producer/consumer situations where producers are allocating resources and consumers are consuming them.

Think about if you had a soda vending machine. There's only one soda machine and it's a shared resource. You have one thread that's a vendor (producer) who is responsible for keeping the machine stocked and N threads that are buyers (consumers) who want to get sodas out of the machine. The number of sodas in the machine is the integer value that will drive our semaphore.

Every buyer (consumer) thread that comes to the soda machine calls the semaphore down() method to take a soda. This will grab a soda from the machine and decrement the count of available sodas by 1. If there are sodas available, the code will just keep running past the down() statement without a problem. If no sodas are available, the thread will sleep here waiting to be notified of when soda is made available again (when there are more sodas in the machine).

The vendor (producer) thread would essentially be waiting for the soda machine to be empty. The vendor gets notified when the last soda is taken from the machine (and one or more consumers are potentially waiting to get sodas out). The vendor would restock the soda machine with the semaphore up() method, the available number of sodas would be incremented each time and thereby the waiting consumer threads would get notified that more soda is available.

The wait() and signal() methods of a synchronization variable tend to be hidden within the down() and up() operations of the semaphore.

Certainly there's overlap between the two choices. There are many scenarios where a semaphore or a condition variable (or set of condition variables) could both serve your purposes. Both semaphores and condition variables are associated with a lock object that they use to maintain mutual exclusion, but then they provide extra functionality on top of the lock for synchronizing thread execution. It's mostly up to you to figure out which one makes the most sense for your situation.

That's not necessarily the most technical description, but that's how it makes sense in my head.

Possible to share ox-hugo setup?

I really love this setup, especially from org-roam to a beautiful hugo website. Is it possible for you to share the relevant files and setup so that others can replicate it? Additionally, is there a way to mark which files or perhaps a subfolder of files in the org-roam directory that would be exported (say if one wanted some files not to be exported)? Thank you in advance!!!

Full index page is being replaced by the topic clicked

I have a suggestion. The Full Index page opens on the left most pane. But when I click and topic in it, the topic replaces the Full Index page.
Instead, will it be possible to open these topics on the right side pane, just like any other internal link on your pages. It helps keep the full index page always accessible.

Also, how are the topics in the full index page arranged? According to their date of creation? Normally topics in index pages are arranged alphabetically.

[question] how is Backlinks generated in the markdown files

I really like the your braindump website, looks great and very useful.

I tried to mimic it but one thing I didn't figure out is how are the backlinks in the markdown files are generated? I think ox-hugo doesn't add that in my case.

For eg, books.md has something likes this:

## Backlinks {#backlinks}

-   [How To Take Smart Notes]({{< relref "how_to_take_smart_notes" >}})

Thanks a lot for your work!!

How does search work?

Hugo is an SSG. I was wondering how did you integrate search on Hugo? Are you using something like Algolio?

Bibliography

Hi Jethro,
I'm trying to build my own theme but I cannot seem to get the bibliography to appear as neatly as you did. I also noticed in the org files that you do not have #+print_bibliography. So I was wondering how you got this to work

How to make the automatic export of org-roam files

Hi,
I'm very happy using org-roam. Now I'm trying to make public my notes. But I really don't know how to make the automatic export of my orgfiles in my Dropbox folder to my content file.
Can you explain me the process?
thanks

~/.emacs.d/init.el file

Hello @jethrokuan,

Good day to you.

I saw your build.py based on your ~/.emacs.d/init.el

Could you share your init.el?

I am using Doom Emacs, I found ninja run emacs could NOT point to my Doom Configuration.
I guess this is reason why you are using init.el.

Have a nice day,
Boyang Yan

I just need some help ^^

Hi, first of all,thanks for posting your braindump (and org roam, it's really a great tool) .
Second, it's not really a "real issue", but I'm a bit confused and I think this will help other people too: I can't get Ninja to work with this repo.

I summarize: I downloaded the repository, I make a ./build.py. The output: ninja: no work to do. Perfect!

git submodule init
git submodule update

Yhea easy
And finally :
hugo server

Ok perfect !

Now I want to modify files, and it comes with several problems.

When I modify a file, I do a ./build.py, and I get the following output: ninja: no work to do. Hum, strange
First problem.
I look at build.py, and I spend A LOT of time to except find the problem.

And I can't find any solutions.
I have a clue: when I modify the files to be taken in ./build.py, the conversion starts and... never ends. YES. Second problem

No matter how hard I look at the problem, I can't do anything about it, but above all: I don't have any leads left to look for (I haven't managed to see the solution).

Thank you in advance for your future answers

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.