HNHacker News
TopNewBestAskShowJobs

foooobaba

238 karma · joined June 5, 2020

submissionscomments
foooobaba··on OpenAI-to-SQLite
One strategy commonly used:

1. Create embeddings of your db entries by running through a nn in inference mode, save in a database in vector format.

2. Convert your query to an embedding by running it through a neural network in inference mode

3. Perform a nearest neighbor search of your query embedding with your db embeddings. There are also databases optimized for this, for example FAISS by meta/fb [1].

So if your network is already trained or you use something like OpenAI for embeddings, it can still be done in near real time just think of getting your embedding vector as part of the indexing process.

You can do more things too, like cluster your embeddings db to find similar entries.

[1] https://engineering.fb.com/2017/03/29/data-infrastructure/fa...

foooobaba··on Bard and new AI features in Search
Nah pry not, since search results are ranked by ads, same thing just in a chat based format.
foooobaba··on Bard and new AI features in Search
User: What should I be doing today?

AI: You have a court appearance today, I have booked a route for you on google maps. Next buy a gift for your mum’s birthday, here are some recommendations sorted by ad spend spend. For your travel, I recommend these options, sorted by ad spend.

Me: What about the leaking faucet in my house?

AI: You don't have the time to fix it yourself, here is a list of contractors that can fix the leak, sorted by google ad spend.

foooobaba··on Ask HN: Share your favorite YouTube channels focused on mastering a skill/craft
Jeremy Fielding, mechanical engineering: https://m.youtube.com/channel/UC_SLthyNX_ivd-dmsFgmJVg

Some highlights are his c&c machines he built and a robotic industrial arm he built. Also covers things like electrical motors, cad design tips, mechanical design.

foooobaba··on Ask HN: What's the best lecture series you've seen?
+1 very easy to follow too.
foooobaba··on Show HN: PlantUML based collaborative UML editor is now open source
Oh cool, thanks for sharing that.
foooobaba··on Show HN: PlantUML based collaborative UML editor is now open source
We use plantuml all the time for sequence diagrams, we check the code into git and use the generated images in the documentation, then the readme.md provides detailed doc of our subsystems, plus people can comment on exact lines of code in the plantuml source during pull requests…

So thanks for building this, it’s awesome!

foooobaba··on The six dumbest ideas in computer security (2005)
Well, it isn’t easy and there is no silver bullet. In practice must use your engineering judgment and THINK about these tradeoffs for every problem you encounter.

That being said, there are some principles you can think about to help you get the tradeoffs right when you encounter a problem.

The main principal the author discussed is the idea of enumerating the good, rather than enumerating the bad. Deny everything except the good by default, and do it at every level of your system. This a good idea to consider, but may not apply to everything.

If there is something you don’t control, you are taking a risk, so understand it, and limit it’s potential impact. In some cases it might be better to use a tried and true library or roll your own vs using some fancy new dependency - or maybe not, that’s for you to think about, but it is worth considering carefully.

Try to keep things as simple as possible and use tech that are easier to understand, well documented, well maintained, hard to shoot yourself in the foot with over things that are fancy and cool.

For example say you’re building a distributed system.

At the network level, only allow the types of traffic you need, so don’t allow incoming traffic you don’t need, and don’t allow outbound traffic you don’t need. This means it’s going to be much harder for an attacker to get in, or exfiltrate data out. Use secure channels, for example mTLS where both sides authenticate each other.

At the application level, think about what data the user has control of and treat it carefully. Is there a way you can authenticate the user is valid, and authorize them to only perform certain actions that are allowed - can you use something like signatures to ensure that every subsystem can verify the data isn’t tampered with.

At the technology level, yes think about your dependencies, and keep things as simple as possible. This makes it easier to secure but also easier to maintain, reduces risk of vendor lock in ect. Depending on what your are dealing with, yes, you might actually want to have someone audit all your dependencies, or if that’s too expensive maybe you can isolate parts of the system that deal with sensitive information so those subsystems don’t use many dependencies. Your value proposition as an engineer is not to just string together code, but to build useful, reliable, secure, flexible software and juggle the tradeoffs. The dependencies you choose, and the way you choose to use them DO matter. Just like someone designing a bridge must use materials manufactured by a 3rd party, and assembled by another 3rd party they must be careful with who they select, and perform their own testing to ensure things will work. But those tradeoffs are going to be completely different than if you make cheap toy drones for example.

So basically in practice think carefully about the risks, costs, benefits and what tradeoffs are worth making. Keep relevant principles in mind like: favor only allowing the good, rather than trying to enumerate the bad, assume threats at every level, avoid foot-guns, favor simplicity, favor tested/trustworthy dependencies.

foooobaba··on The six dumbest ideas in computer security (2005)
This has nothing to do with ASLR and stack canaries.. Log4jshell wasn’t a buffer overflow exploit, it was the result of yet another dumb idea, adding remote jndi loading capability into the logging framework.

You can assume any input to your program will be manipulated by an attacker. This implies if you use a non memory safe language you’ll need to make sure there is no way the user can input enough data to overflow your buffer, which will corrupt your memory, and get it right 100% of the time. If you’re building a logging framework it’s extremely likely people will be logging some sort of information from the outside, so not a great idea to execute it as code. Similarly for sql injections, if you simply use prepared statements you remove a whole class of problems. Knowing an attacker will probably inject some garbage into the input of your program, and assuming user input is malicious, is a basic principle you can use to design better systems. I believe this is what the author meant by his statement.

foooobaba··on The six dumbest ideas in computer security (2005)
With respect to this example, I think he is saying it would be better if we were using memory safe languages, rather than trying to come up with these sorts of mitigations (which is enumerating the bad). Of course it’s probably not possible in every scenario because we’ve been doing it badly for so long, but I think the principle still holds.
foooobaba··on Architecture diagrams should be code
Sort of related but an interesting idea is take it one step further with the Feature Oriented Active Modeler (FOAM) [1,2] paradigm and use code to model your whole system, which generates diagrams model, and runnable code in whatever language needed. The project is still young and it may not be practical today with the available tooling but it seems like a cool idea and project. It is influenced by the unix principle of “coding the perimeter not the area” which is essentially factoring your dev tasks into building NxM capabilities, but instead of building NxM things individually build N+M tools that can be composed into NxM capabilities [2].

So with FOAM the idea is if we want to maintain a model of our software, and build it as well, what if we can use one composable tool to generate both, rather than model everything and code it separately.

[1] https://github.com/kgrgreer/foam3

[2] https://foam-framework.github.io/foam/

[3] https://m.youtube.com/watch?v=3Ea3pkTCYx4

foooobaba··on Ghana plans to buy oil with gold instead of dollars
Regarding France, actually they play this game too. Check out the West/Central African CFA franc [2]. These currencies are pegged to 1/100 French franc, which currently about 1/656 euros. Many former French colonies are required to use the CFA franc, minted by France, and required to keep 85% in reserve in French banks, including during times of hardship, but they can always barrow against their reserve and pay France the interest if they need to. In 2019 France has promised to drop it and let the africans have their own called eco [2] by 2027, but, also it keeps getting postponed and was supposed to already happen by 2020, so who knows. Trying to go against france can result in an assassination or coup, or other creative acts by france (see Opération Persil [3]).

[1] https://en.m.wikipedia.org/wiki/West_African_CFA_franc

[2] https://en.m.wikipedia.org/wiki/Eco_(currency)

[3] https://en.m.wikipedia.org/wiki/Op%C3%A9ration_Persil

foooobaba··on Ask HN: Math books you recommend just for the way they are written?
Came here to also say this, amazing book. There are also lectures on YouTube from the author.
foooobaba··on Consider working on genomics
Yeah, I agree, I looked into this before, and the pay doesn’t come close to other swe jobs, as far as I have seen whenever I look. It is usually like 2x less, it’s hard to want to choose that just to work on something a bit more interesting. I even have a background in bioinformatics, but I never found anything that compensates it as much as pure swe roles.
foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
Similar to that one, he also teaches a more recent course geared for applications of linear algebra: Matrix Methods In Data Analysis, Signal Processing, And Machine Learning

https://ocw.mit.edu/courses/18-065-matrix-methods-in-data-an...

foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
+1 his videos are great.
foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
Thanks for sharing, I’ll have to check these out.
foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
Me too! This book has a special place in my heart since it’s the first time I actually understood programming. When I was 13 my goal for the summer was to learn to code. I was struggling hard to understand javascript after learning html, but it just made no sense to me. Then I randomly found this book, worked thru it in about a month, then c++ and even JS also made sense. All though did have like 8+ hr a day to devote to it since my “job” was to babysit my siblings lol.
foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
You might also find it interesting to implement a CPU on an fpga, a double win if you’ve never programmed an fpga before. For me it helped soldify exactly how a basic cpu works. In uni we had to do this for MIPS architecture with 5 state pipeline. The project was similar to [1] we also used the same book “ Computer Organization and Design”. You end up making your own assembly language in the process too.

[1] https://github.com/valar1234/MIPS

foooobaba··on Ask HN: Do you recall any book or course that made a topic finally click?
3blue1brown linear algebra + the linear algebra chapter from “all the math you missed but need to know for graduate school” - linear algebra and abstract vector spaces in general finally feel familiar.

Also, timbuktu manuscripts - showed a history that I had never really heard of. These are written manuscripts of african scholars which are hundreds of years old, and still exist today. Some record the history of great west african civilizations along with other things they studied (e.g. science, religion, math, literature, ect). I was never taught this history even existed but yet was made to learn the various details about asian, european, middle eastern, central/south american history. This, and the attempts to destroy/steal these manuscripts at various points in history, made it click how serious power of controlling information, and ultimately influencing beliefs can be, with respect to giving legitimacy to the various rulers/authorities. Beliefs/perceptions matter quite a lot. This 1hr lecture is quite good: https://m.youtube.com/watch?v=lQiqyyRfL2Y&t=16s

Behavioral biology class from Dr. Sapolsky (Sanford) - explains a lot of why we behave the way we do, from different biological perspectives https://m.youtube.com/playlist?list=PLqeYp3nxIYpF7dW7qK8OvLs...

foooobaba··on Ask HN: How do you deal with the human ability to never take responsibility
I’ll pick up the pen and give it a go.

I argue that lack of understanding and communication is why there is even a war. The war only benefits a small amount of people, the various authorities of NATO and Russian authorities depending who wins. NATO authorities stand to gain by threatening Russia leading up the war, which can be used as leverage in other negotiations to exploit Russia, and Russian authorities stand to gain for whatever spoils it gets, and reducing the threat of NATO presence in Ukraine. But what about all us individual people, and solders duped into fighting this war?

The war doesn’t help the common people in the rest of the world, people in Ukraine, or the common people in Russia, with the sanctions hurting the economics and people’s livelihood. The war doesn’t benefit the solders dying.

But because the communication is influenced/controlled by the various authorities, a mass lack of understanding of how we as individual people can work together exists. We think we have to kill each other, but do we? There is propaganda, and lies being spread to help make it happen, which is the opposite of understanding. We have thousands of people spending their time killing each other. Instead of helping out, understanding each other, finding the balance of meeting each others needs. We have people listening to the various authorities that tell us to go threaten and kill each other. If we don’t listen, we may be threatened by people who do, people that don’t understand that this is a waste of time that could be spent doing something beneficial.

In the end, way more people will be left suffering than those who benefited, including the ones on the ground actually pulling the trigger, making it happen. If we could come to this understanding together, as individuals, without the corruption of authorities trying to manipulate us into killing each other, would we still be fighting? I don’t think so. Even the authorities, will they achieve peace and happiness, since now they will have to constantly watch their back, fear losing their power, double down on their lies to stay in power, because they now created more enemies, suffering, and hate?

foooobaba··on Ask HN: How do you deal with the human ability to never take responsibility
This is the truth. We should look out for each other, and try to build one another up. Instead of exploiting and taking from each other to achieve security, let’s understand and help one another so we can live in peace and balance with ourselves, each other, and laws of nature.
foooobaba··on Ask HN: How do you deal with the human ability to never take responsibility
The basic reason this happens is fear, which is natural. Fear that by revealing a weakness, something bad can happen, or we may need to change in a way we are not sure is possible, both of which may or may not be the case. However, you should not fear discovering a weakness in yourself, because that is now something that you can learn from. You can learn how to live with it, or improve upon it. If you discover a problem, or someone else discovers one, that is a good thing, it is something that you can work on fixing, even fix it together.

Don’t lie to yourself, even if you think you need to lie to others to avoid something bad. Avoid lying to others: it can erode trust, make it difficult to openly be yourself, and you may accidentally lie to yourself in the process.

So what to do? You can start by trying to never lie to yourself, with the knowledge that it will only hold you back. Try to accept things for how they are, and how they may play out. Notice that we are not perfect, but at least we can improve and find ways to mitigate our weaknesses (and each others). Don’t dwell on the past, thinking you’re no good, that’s not healthy either.

It’s okay to be who you are, with your strengths, weaknesses, set backs, problems, desires, irritations, blessings, mistakes, failures and successes. If we live in balance with them, we will find our way to get through life. Understanding is key to finding balance. Honest, quality communication helps to achieve understanding, and ultimately balance with ourselves, each other, and the natural world.

foooobaba··on Following the Unix philosophy without getting left-pad (2021)
Programs/functions like left-pad do not follow the unix philosophy (which the author did say). The idea of the unix philosophy is to write less programs. Not write a ton of tiny programs, but a small number of composable programs. So instead of left-pad, right-pad, middle-pad, and anything else to get specific need you can use sprintf which can format a string in general, one program that can do implement the features of all of those.

It is about “coding the permitter, not the area”, so if you have NxM features to build, don’t write N*M individual programs/functions, instead write N+M programs/functions that can be composed together to get all NxM features. This video explains it well: https://youtu.be/3Ea3pkTCYx4

foooobaba··on Graduate students question career options
I didn’t realize it was possible to do this without a PhD. I want to do research, I’m working as SWE at a startup and finishing MS now, but it is online without advisor or anything. If that’s possible, that’s awesome, how does that work, like to get the position and so on, I’m guessing you would need to publish some work on your own first.
foooobaba··on How to deal with extreme physical pain (2020)
He talks about sort of observing the pain, and doing breathing exercises, which I guess sometimes I would do to, maybe it is some way to isolate the pain from other senses, then when you feel it, you can sort of categorize those senses away as noise, and zone it out.

I remember practicing this once when I was teenager as an exercise. I read this in some book about becoming a ninja, (I don’t remember the title now). I went outside in the winter barefooted and stood still in the snow and as it started to make my feet hurt I just kept allowing myself to feel the pain completely and while doing a breathing exercise. After that I could run outside in the snow barefooted without feeling it so much, impressing my friends, lol. It probably wasn’t a great idea, given the risk of frostbite, but it seems similar to one of the methods of allowing yourself to feel it, instead of the cognitive dissidence.

foooobaba··on How to deal with extreme physical pain (2020)
When I was growing up I was was frequently subjugated to violence on a daily basis, over time I learned to zone out of reality, and remind myself that the bruising and cuts would heal and after some time (probably before I reached kindergarten) it just became instant, and I didn’t feel the pain the same way anymore, like I can feel pain, but isn’t something I remember and isn’t in my conscious awareness, like it’s happening outside my immediate focus in a way. Getting over the emotional trauma, on the other hand was a much more difficult thing and took over 15+ years to get over that, but thats a whole different topic.

But, even then, I am sometimes frustrated with how difficult it is for me to do creative work when dealing with certain types of pain like headaches, toothaches, fatigue. I could always do basic physical labor while in pain, even headache/toothache/fatigue, but trying to learn anything complicated or do intellectual work was harder. I was decent at endurance running, I think this was somehow related, I would basically zone out how my legs and lungs are burning, and how tired I felt.

However, unless I was extremely motivated such that then I could sort of hold onto the task in my mind and zone everything else out, it was next to impossible for me to do focus on it. For example stuff that is mundane, boring, tedious or something I don’t care about, it was very hard for me to get anything done while being in pain, for example I recently got 2nd degree burns all over my face and tore my rotor cuff again (not simultaneously), I was able zone out the pain, but it was hard for me to concentrate on work, or school, until the pressure of getting the work done became so high that I felt it was important to do it, and then I could push thru and get it done, but otherwise I wasn’t able to. I guess it’s like I was in some sort of survival mode, and if certain work didn’t feel needed for survival I wouldn’t be able to concentrate on it.

I always wonder how people with chronic pain can even get anything intellectually done, based on reading this, it wasn’t clear to me, but I guess it seems like he is holding a strong motivation to face the pain and succeed despite the pain, which does make sense.

foooobaba··on We've filed a lawsuit against GitHub Copilot
True, that’s another good point.
foooobaba··on We've filed a lawsuit against GitHub Copilot
This makes sense, it produces chunks not the whole source where a search engine would also give you the license.
foooobaba··on We've filed a lawsuit against GitHub Copilot
It seems like we should come to agreement on what the license is intended for, given that when the licenses were created in a time before AI like this existed. If the authors did not intend their code to be used like this, should we not respect it? Also, does it make sense to create new licenses which explicitly state whether using it for AI training is acceptable or not - or are our current licenses good enough?
← PreviousPage 2 of 3Next →