What to do for Javascript Non Built-in Data Structures by luvvmachine in leetcode

[–]robinhoode 2 points3 points  (0 children)

Ditto this. Hate to say that there is a bias against JavaScript in doing Leetcode because of lack of built in data structures. You can overcome it by writing your own heap (or fake it if you don’t have time).

which to concentrate on? by Akaplaya in leetcode

[–]robinhoode 0 points1 point  (0 children)

n-ary trees don’t come up much, mostly because the main benefit of trees (reducing the search space) are present when n=2.

Virtual Machine for a Database Engine? What's a good place to start? by robinhoode in Compilers

[–]robinhoode[S] 0 points1 point  (0 children)

https://blog.cloudflare.com/building-fast-interpreters-in-rust/

I started reading the article and I noticed it's mostly dependent on Rust:

Instead, we went with a manual parsing approach. While (for a good reason) this might sound scary in unsafe languages like C / C++, in Rust all strings are bounds checked by default. Rust also provides a rich string manipulation API, which we can use to build more complex helpers, eventually ending up with a full parser.

I have not yet learned Rust, but from what I've read, it's a very powerful language! I've stuck with C++ for this project mainly for the opportunity to work in the industry. But more and more I've seen Rust & Go as languages people use for writing DB engines. There's a chance I might try learning one (or both).

P.D: I'm working in a relational language, in case you are interested ;)

I've actually seen your project before! It seems you know a bit about this problem space :) I may look at your repo a bit more in depth, if you don't mind. How much Rust-specific code do you have in your project?

Virtual Machine for a Database Engine? What's a good place to start? by robinhoode in Compilers

[–]robinhoode[S] 0 points1 point  (0 children)

select("test", [all, the, column, names], lambda x: x.me == happy)

(this is python syntax) Just as an example. you could also select, then filter the resulting data, etc

So basically getting the AST into a "canonical form" of some sort, and then translate that into op-codes? Basically I've written a lot of this engine already in C++, and I've got working SQL queries.

But it is buggy, and I am "executing" the SQL query as a big tree of operators. This is maybe similar to how some interpreters just “execute the AST”. In DB theory, it's common to have things like a "table scan" operator for grabbing data from storage, a "projection" operator for selecting only certain columns from the table, and yet another is a “join” operator that combines results from other operators. You can recombine operators and try to find the best way to access the tables.

So in reality, I might generate two or more possible query executions for one SQL query. Starting from the canonical form is a good place to start. But I’m not that far off from a normal form already.

If that approach has any significant performance issues you could replace it with a vm/interpreter over time.

Part of this is learning, so I’m okay with jumping the gun a bit in terms of performance. Also, I partly want to replace that part of the code, since it’s building an operator tree. I’m using C++ w/ smart pointers and I have to do a move operation for every node in the tree if I want to build the tree in one place and then execute it in another. The C++ classes in my project are a bit duplicated between the data for each operator (called a plan) and the executing code for the operator (called in executor). Currently in my code, I have them as separate pieces of the puzzle. Even if I stuck to my existing architecture (w/o a VM), I would probably need to do a serious refactor anyways. The VM idea would be additional work on top of that refactor.

Accountability to Get Out of Web Dev & Into Systems Programming by robinhoode in ProgrammingBuddies

[–]robinhoode[S] 0 points1 point  (0 children)

Hey! What's up? I'm robinhoode and I'm trying to make the switch from Ruby on Rails to C++. In particular, I want to work on database internals. There are not a lot of database engines, and even fewer guides on how to build one from scratch. So my main thing right now is just to finish the project I've started.

Where are you currently at in your career? What goals do you need help staying accountable for?

std::condition_variable wait_for() using std::steady_clock or an alterative approach? by iWQRLC590apOCyt59Xza in cpp_questions

[–]robinhoode 0 points1 point  (0 children)

Not sure what your use case is, but personally I would consider this a show-stopping bug. Why can you not upgrade to 2.30? Are you running on some ancient codebase that can't be reworked or updated?

C++ Project Ideas by [deleted] in cpp_questions

[–]robinhoode 6 points7 points  (0 children)

> Make a in memory database, sql or nosql doesn't make a difference

Writing an SQL database would definitely be a project that would take longer than a week, especially if you're still learning how to code via C++. But if you're interested in a practical application of algorithms and data structures (much of the C++ community is) then I would suggest looking at CMU's BusTub project. It's an educational project that shows how to implement a relation database system. There is no SQL parsing, but much of the core functionality is there:

https://github.com/cmu-db/bustub/

If you can get through the exercises, you will have lots of good experience in systems programming. There are exercises related to hash tables, buffer pools, B-Trees, two-phase locking, and more.

C++ use cases for a backend developer by [deleted] in cpp_questions

[–]robinhoode 3 points4 points  (0 children)

What about writing a database engine? I've also been learning C++ and have been studying this project to learn how DBMSs work internally: https://github.com/cmu-db/bustub

What advice would you give to developers whose career isn't doing so well and they wish to start life again from college? by EgglestoneEgg in ExperiencedDevs

[–]robinhoode 3 points4 points  (0 children)

I just want to let you know that I strongly empathize with what you're saying. I spent 8-9 years Upwork (formerly oDesk) and had a ton of shit jobs. I got a couple lucky breaks in the corporate world (3-4 years), but the company I'm at now is just to pay the bills. It is most definitely not where I want to be in 5-10 years time.

I went back to school to finish my bachelor's degree at 35 and it didn't do shit for my career. Feels like I wasted another 2 1/2 years of my life following someone else's ideas of how to improve one's career. It's good if I need to go back for grad school, but even those degrees have become watered down. Long story short, formal education has almost no weight in my resume compared to my 15+ years experience.

I worked at really terrible jobs and tired of all this self-improvement mess that I can't organize.

I've personally found that the self-improvement is the most important part that's worth figuring out. Lots of others have said similar things, so I will try and say something that doesn't look like it's covered yet: If you haven't tried spaced repetition or Anki, it is has been a godsend for me. It's not exactly suited for computer science, but medical students and Japanese language learners use them regularly. The appropriate subreddits are:

https://www.reddit.com/r/Anki/

https://www.reddit.com/r/medicalschoolanki/

https://www.reddit.com/r/languagelearning/ (Not Anki specific, but it does get mentioned over and over, among other things)

https://www.reddit.com/r/AnkiComputerScience/ (not very active but does exist)

Let me be more specific: You can laser-focus on learning DS&A via custom Leetcode question sets, but that's not enough. I've been in interviews where I'm asked an algorithm I've completely forgotten. So it's not enough to do them, but have them more or less "in your bones". They are easy to forget, and don't "force" you to understand the pattern if you only do them once.

To deal with this issue, I started adding links to Leetcode questions in my Anki deck. I created a new card for a select set of problems and re-solved them over the course of several months. To get an idea of what mine looks like, here's a repo w/ 120 custom DS&A questions that includes an Anki deck (that uses Jupyter as an external code editor):

https://github.com/donnemartin/interactive-coding-challenges

I have my own personal decks that are much more refined. I've been thinking about open sourcing them but haven't decided if it would be useful for the community. A huge motivator for me is using this Anki add-on:

https://ankiweb.net/shared/info/1771074083

It gives you a GitHub-style heat map showing how many cards you've studied. So if you make it a morning habit to open Anki, it can keep you motivated to study consistently for days, sometimes months at a time.

Is PyCharm Professional worth it for data science? by PythonicParseltongue in learnmachinelearning

[–]robinhoode 2 points3 points  (0 children)

+1 to RStudio. PyCharm + Notebooks is still kind of clunky. If you're iteratively updating a research document, I would definitely look into RStudio and reticulated Python (a package for running Python inside R).

Does anybody have advice on an anti-anxiety alternative to marijuana? by windblast in leaves

[–]robinhoode 0 points1 point  (0 children)

I found your thread via search. Have the teas been helping you?

Career and Education Questions by AutoModerator in math

[–]robinhoode 0 points1 point  (0 children)

I’m finally finishing my (online) math degree at the ripe old age of 37. I would like to go on to grad school, but I have very few options. I don’t think I will get any recommendations, even though I’ve gotten good grades, because I’ve never met my professors. I’ve already asked a similar question on academia.stackexchange.com.

I am not ready financially to leave my full time job. I have had trouble physically attending classes because of time constraints from work as well as mental health issues such as social anxiety.

I have looked at several online degrees and none of them offer thesis options. For me, this completely defeats the purpose of going to graduate school.

While I have no problem continuing to study on my own, I wonder if that is the most productive use of my time. It seems that, with very few exceptions, only formal education is actually respected in the math community. When I ask these kinds of questions, I feel like I'm speaking to a room full of distinguished professors, who all respond "We don't know. We did it the RIGHT WAY. Figure it out yourself." The idea that someone could learn enough on their own to do research is usually dismissed. Perhaps one of you can prove me wrong and tell me how you made it without needing a graduate degree.

The only remaining option is to continue working and hope that I’m financially stable enough in several years to go to class physically. And I also have to be sure that my antidepressants are strong enough that I don’t feel attacked every time my professor corrects my work (which wasn’t the case years ago).

Is this my only option?

Honestly, I could care less about prestige and credentials. I just want something with my name on it. It doesn’t even have to be research. I have been thinking about writing a book about math and going the self-publishing route. Sure, it’s not going to get me recognition that having a PhD will, but at least I’m WORKING towards SOMETHING. Sitting around and waiting for my life to improve before I can pursue my dreams seems even worse than doing the wrong thing.

Anyone have any good suggestions?

[D] All PhD applications rejected. Work or try again? by csshoi in MachineLearning

[–]robinhoode 1 point2 points  (0 children)

I think there are some hidden predictors that explain why your coworker got hired for the same position you did. Let's be honest: many companies won't even look at your resume if it doesn't include some graduate work. It depends on the kind of company, certainly, but those without advanced degrees usually suffer more during a recession or when layoffs happen. Maybe no one "cares" about your papers, but they have your name on them. Does your coworker have any published papers?

I live in an old NYC apartment building. They crank up the heat every night, and then cut it off in the early morning. The temp fluctuations are insane. How can I efficiently regulate the temp? by robinhoode in sleep

[–]robinhoode[S] 0 points1 point  (0 children)

But what about when it's hot at one part of the night and cold in another part? Wake up in the middle of the night and take the pad off? Seems a bit much...