
Hieu Nguyen Minh retweeted
Chinese scientists have developed,
The best shortest-path algorithm in 41 years!
A team from Tsinghua University has broken Dijkstra's "sorting barrier" - the first improvement since 1984.
Just use for a world-map ๐คฏ
Paper - arxiv.org/pdf/2504.17033
Hieu Nguyen Minh retweeted
wow.. this AI is crazy
you can now use Google Gemini 2.0 image editor on FLORA and its much more advanced
you can edit image with simple text and turn it into commercial video directly
it's free to use for a limited time now, link in comment
10 examples:
Hieu Nguyen Minh retweeted
Journey Through History: A Visual Thread of Ancient Wonders & Places Reimagined by AI๐งต
(Let`s go back into History)
Hieu Nguyen Minh retweeted
๐ Exciting news for @WebStormIDE and @JetBrainsRider users! WebStorm and Rider are now free for non-commercial use.
Hieu Nguyen Minh retweeted
Contribute to open source, learn through self-education or courses, record educational podcasts, or grow your pet project easily with a FREE Rider subscription for non-commercial development.
Download and start today ๐
jb.gg/rd-free
Spread the word! #dotnet #gamedev
Hieu Nguyen Minh retweeted
๐ Just announced! WebStorm is now free for non-commercial use!
Whether youโre learning #JavaScript, working on open-source projects, creating content, or coding as a hobby, you can now do so for free ๐ฅณ
๐ jb.gg/WS-non-commercial
Hieu Nguyen Minh retweeted
Most developers can't explain how Single Sign-On (SSO) works.
โ
This was one of my favorite questions during technical interviews. I love to ask about it because it's not a trivial topic.
โ
Here is a 5-minute overview of how Single Sign-On works.
โ
We all hate passwords; the less we use them, the better, and SSO helps with that.
โ
When you log in to Google once and visit YouTube, Gmail, Drive, and any other connected service without re-entering your password, three players are working behind the scenes:
โ
โข A user trying to access an application. You, in this case.
โข The application you want to access. For example, YouTube.
โข An Identity Provider (IDP) that will verify your identity. Google, in this case.
โ
Here is what happens when you try to access one application for the first time:
โ
1. You try to log in to YouTube, and the application redirects you to the Identity Provider (IDP) for authentication.
โ
2. The IDP (Google) checks your credentials and confirms your identity. It creates a new session for you on its server and sets a session cookie in your browser.
โ
3. The IDP also creates a token for YouTubeโa small piece of data that contains information about your identity.
โ
4. Your browser grabs the token and presents it to YouTube.
โ
5. YouTube checks the token, and if it is valid, lets you in.
โ
But then you want to access Google Drive:
โ
1. You go to Google Drive, and the application redirects you to the IDP.
โ
2. The IDP recognizes that you are still logged in because you have the session cookie. It doesn't need to ask for your credentials.
โ
3. Instead, the IDP generates a new token for Drive.
โ
4. Your browser grabs the token and presents it to Google Drive. If the token is valid, Drive lets you in.
โ
You can now access multiple applications without re-entering your password. This is probably one of the best things we've invented since sliced bread!
โ
But, of course, implementing Single Sign-On is a nightmare! If you are a developer, don't try to reinvent the wheel. I've been implementing SSO since dinosaurs were around, and I can tell you you want to check out @auth0.
โ
Auth0 makes implementing SSO 100x easier. They just updated their free plan, and you get a lot without having to pay a single cent. 25,000 monthly active users, unlimited social connections, and you can go to production with custom domains. FOR FREE!
โ
They are sponsoring this post. To save your time, keep your sanity, and have a really solid and secure solution, head over to their website:
โ
auth0.com
Hieu Nguyen Minh retweeted
A farmer couldn't attend his auntโs funeral,
so he put out heart-shaped food for his sheep so that "she could see it from heaven."
Hieu Nguyen Minh retweeted
๐ช๐ต๐ฎ๐ ๐ ๐น๐ฒ๐ฎ๐ฟ๐ป๐ฒ๐ฑ ๐ณ๐ฟ๐ผ๐บ ๐๐ต๐ฒ ๐ฏ๐ผ๐ผ๐ธ "๐ฆ๐ผ๐ณ๐๐๐ฎ๐ฟ๐ฒ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด ๐ฎ๐ ๐๐ผ๐ผ๐ด๐น๐ฒ"
The Software Engineering at Google book is not about programming, per se, but about the engineering practices utilized at Google to make their codebase sustainable and healthy.
What you can learn from this book:
๐ญ. ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐๐ต๐ฒ ๐ฑ๐ถ๐ณ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฏ๐ฒ๐๐๐ฒ๐ฒ๐ป ๐ฆ๐ผ๐ณ๐๐๐ฎ๐ฟ๐ฒ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด
Programming is about writing code. You take a task and write code to solve it. Software engineering is when you take that piece of code and consider how this task will grow, how you can understand this code in the future, what happens if the business becomes more extensive, how it scales, etc.
๐ฎ. ๐๐ฒ๐๐ผ๐ป๐ฐ๐ฒ ๐ฟ๐๐น๐ฒ ๐ฎ๐ป๐ฑ ๐๐๐ฟ๐๐บ'๐ ๐น๐ฎ๐
Hyrum's Law says that with a sufficient number of users of an API,
it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.
The Beyonce rule says that if Joe liked that bug, he should put a test on it. When you fix the bug, his test breaks, and you say,ย "Oh shit, gotta fix Joe's code too."
๐ฏ. ๐ฆ๐ต๐ถ๐ณ๐ ๐น๐ฒ๐ณ๐
The earlier you find a mistake, the easier it is to fix:
โ
Run static analysis in your editor.
โ
Write fast unit tests.
โ
Write integration tests; they can catch edge cases.
โ
Code review is a great way to share knowledge and learn from others.
โ
QAย takes a few hours or days to ensure everything works together as expected.
๐ฐ. ๐๐๐๐ผ๐บ๐ฎ๐๐ฒ ๐ฐ๐ผ๐บ๐บ๐ผ๐ป ๐๐ฎ๐๐ธ๐
When your team grows, it is similar to scaling a software system. So we need to automate code formatters, linters, codemods, continuous integration pipelines, and anything else you can use to take work off people's plates.
๐ฑ. ๐ฆ๐๐๐ฏ๐ ๐ฎ๐ป๐ฑ ๐บ๐ผ๐ฐ๐ธ๐ ๐บ๐ฎ๐ธ๐ฒ ๐ฏ๐ฎ๐ฑ ๐๐ฒ๐๐๐
Your tests are only as good as your mocks. They hide the actual behavior of your system, drift away from reality, and take much effort to maintain. Google recommends using fakes instead.
๐ฒ. ๐ฆ๐บ๐ฎ๐น๐น ๐ณ๐ฟ๐ฒ๐พ๐๐ฒ๐ป๐ ๐ฟ๐ฒ๐น๐ฒ๐ฎ๐๐ฒ๐
A minor release is easier to manage, more accessible to revert, and easier to understand.
๐ณ. ๐จ๐ฝ๐ด๐ฟ๐ฎ๐ฑ๐ฒ ๐ฑ๐ฒ๐ฝ๐ฒ๐ป๐ฑ๐ฒ๐ป๐ฐ๐ถ๐ฒ๐ ๐ฒ๐ฎ๐ฟ๐น๐, ๐ณ๐ฎ๐๐, ๐ฎ๐ป๐ฑ ๐ผ๐ณ๐๐ฒ๐ป
It's the same deal as releases. The smaller the change, the easier to manage. Upgrading from 4.5.8 to 4.5.9 is no big deal. Going from 4.5.8 to 4.8.0 might require a few changes. You can run around and update.
Read more in the book (find the link in the comments; it's free to download).
#softwareengineering
Hieu Nguyen Minh retweeted
๐๐ผ๐ ๐๐ผ ๐น๐ฒ๐ฎ๐ฟ๐ป ๐ฆ๐ค๐?
Structured Query Language (SQL) is a domain-specific programming language designed to manage data held in relational database management systems for many years. It was developed at IBM in the early 1970s. As relational databases are still very prevalent, any developer must use them.
The SQL language has ๐ฐ๐น๐ฎ๐๐๐ฒ๐, which are components of statements and queries; ๐ฒ๐
๐ฝ๐ฟ๐ฒ๐๐๐ถ๐ผ๐ป๐, which can produce scalar values or tables; ๐ฝ๐ฟ๐ฒ๐ฑ๐ถ๐ฐ๐ฎ๐๐ฒ๐, which specify conditions that can be evaluated using SQL three-valued logic; and ๐พ๐๐ฒ๐ฟ๐ถ๐ฒ๐, which retrieve data based on criteria and other elements.
There are five main components of SQL:
๐น ๐๐๐ (๐๐ฎ๐๐ฎ ๐๐ฒ๐ณ๐ถ๐ป๐ถ๐๐ถ๐ผ๐ป ๐๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ): Defines and manages database schema elements, using commands like CREATE, ALTER, and DROP to create, modify, or delete tables and other database structures.
๐น ๐๐ ๐ (๐๐ฎ๐๐ฎ ๐ ๐ฎ๐ป๐ถ๐ฝ๐๐น๐ฎ๐๐ถ๐ผ๐ป ๐๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ): manages the data within database tables, using commands like INSERT, UPDATE, DELETE, and SELECT to add, update, remove, or retrieve data.
๐น ๐๐๐ (๐๐ฎ๐๐ฎ ๐๐ผ๐ป๐๐ฟ๐ผ๐น ๐๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ): Controls access to the database, using GRANT and REVOKE to provide or remove user permissions for data access and manipulation.
๐น ๐ง๐๐ (๐ง๐ฟ๐ฎ๐ป๐๐ฎ๐ฐ๐๐ถ๐ผ๐ป ๐๐ผ๐ป๐๐ฟ๐ผ๐น ๐๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ): Manages database transactions to ensure data integrity, using commands like COMMIT, ROLLBACK, and SAVEPOINT to finalize, undo, or save transaction states.
๐น ๐๐ค๐ (๐๐ฎ๐๐ฎ ๐ค๐๐ฒ๐ฟ๐ ๐๐ฎ๐ป๐ด๐๐ฎ๐ด๐ฒ): This language primarily involves the SELECT command, which queries and fetches data from the database based on specific criteria.
So, the question is ๐ต๐ผ๐ ๐๐ผ ๐น๐ฒ๐ฎ๐ฟ๐ป ๐ฆ๐ค๐?
Here are some (free) resources that I can recommend:
๐ญ. ๐ฆ๐ค๐๐๐ผ๐น๐ - is an entirely free, fully interactive introductory course. All SQL basics include writing queries, filtering, joins, aggregations, and creating, updating, and deleting tables. sqlbolt.com
๐ฎ. ๐ฆ๐ค๐๐ญ๐ผ๐ผ โIt provides both tutorials and exercises, which is why it is equally useful for someone just starting with SQL and programmers who know SQL but want some good practice to master it. sqlzoo.net/wiki/SQL_Tutorial
๐ฏ. ๐ฆ๐ค๐ ๐ง๐๐๐ผ๐ฟ๐ถ๐ฎ๐น ๐ฎ๐ ๐๐ฟ๐ฒ๐ฒ๐๐ผ๐ฑ๐ฒ๐๐ฎ๐บ๐ฝ - This SQL course has more than 7 million views, and I think it's Youtubeโs most popular free SQL course. youtube.com/watch?v=HXV3zeQKโฆ
๐ฐ. ๐ฃ๐ผ๐ฝ๐ฆ๐ค๐ is a really interesting tool for collaborative SQL querying. It enables multiple users to share queries, stores commonly used queries in a searchable library, and provides a visual interface for analysis. popsql.com/learn-sql
๐ฑ. ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด ๐ฆ๐ค๐ ๐ฏ๐ ๐๐น๐ฎ๐ป ๐๐ฒ๐ฎ๐๐น๐ถ๐ฒ๐ ๐ณ๐ฟ๐ฒ๐ฒ ๐ฏ๐ผ๐ผ๐ธ. This book provides helpful context regarding the language's history and current usage, offers an overview of query and table architecture, and covers more complex SQL subjects than the abovementioned courses. r-5.org/files/books/computerโฆ
#sql
Hieu Nguyen Minh retweeted
10 Key Data Structures We Use Every Day
- list: keep your Twitter feeds
- stack: support undo/redo of the word editor
- queue: keep printer jobs, or send user actions in-game
- hash table: cashing systems
- Array: math operations
- heap: task scheduling
- tree: keep the HTML document, or for AI decision
- suffix tree: for searching string in a document
- graph: for tracking friendship, or path finding
- r-tree: for finding the nearest neighbor
- vertex buffer: for sending data to GPU for rendering
Over to you: Which additional data structures have we overlooked?
--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
Hieu Nguyen Minh retweeted
Object-oriented programming in under 3 minutes.
Object-oriented programming (OOP) is a programming paradigm in which programs are designed using ๐ฐ๐น๐ฎ๐๐๐ฒ๐ ๐ฎ๐ป๐ฑ ๐ผ๐ฏ๐ท๐ฒ๐ฐ๐๐. This design allows related functions and data to be grouped together in ๐๐ฒ๐น๐ณ-๐ฐ๐ผ๐ป๐๐ฎ๐ถ๐ป๐ฒ๐ฑ ๐ฎ๐ป๐ฑ ๐ฟ๐ฒ๐๐๐ฎ๐ฏ๐น๐ฒ ๐๐ป๐ถ๐๐.
A class is a template or blueprint from which objects are made from. Classes define the properties and methods that an object can have, and objects are unique instances of a class.
For example, let's say you want to create a life simulation game where players can adopt and raise pets. You would have a "Pet" class that defines the properties of each pet (like "name" and "age"), as well as behaviors they can do (like "speak" and "eat").
You could then create objects, or instances, of this class for each specific pet. Each object could have its own values for each property. For example, you could have a 2-year-old pet named "Winston", & a 1-year-old pet named "Wesley"; both initialized from the "Pet" class.
๐ข๐ฏ๐ท๐ฒ๐ฐ๐-๐ผ๐ฟ๐ถ๐ฒ๐ป๐๐ฒ๐ฑ ๐ฝ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด ๐ต๐ฎ๐ ๐ฐ ๐บ๐ฎ๐ถ๐ป ๐ฝ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ๐; ๐ฒ๐ป๐ฐ๐ฎ๐ฝ๐๐๐น๐ฎ๐๐ถ๐ผ๐ป, ๐ถ๐ป๐ต๐ฒ๐ฟ๐ถ๐๐ฎ๐ป๐ฐ๐ฒ, ๐ฎ๐ฏ๐๐๐ฟ๐ฎ๐ฐ๐๐ถ๐ผ๐ป, ๐ฎ๐ป๐ฑ ๐ฝ๐ผ๐น๐๐บ๐ผ๐ฟ๐ฝ๐ต๐ถ๐๐บ.
๐๐ป๐ฐ๐ฎ๐ฝ๐๐๐น๐ฎ๐๐ถ๐ผ๐ป hides internal details but exposes data & methods via a public interface, preventing unintentional changes. E.g. โ a player can view a pet's age but can't accidentally change it. But they can run methods avail on the public interface like changing a pet's name.
๐๐ป๐ต๐ฒ๐ฟ๐ถ๐๐ฎ๐ป๐ฐ๐ฒ allows classes to inherit properties and methods from other classes, making code reusable and organized. E.g. โ A "SuperPet" class that extends from "Pet "and would inherit "age", "name", "eat", and "speak"; while defining new behaviors like "fly"
๐ฃ๐ผ๐น๐๐บ๐ผ๐ฟ๐ฝ๐ต๐ถ๐๐บ is a principle that enables objects to change their form by extending or overriding existing methods. E.g. A "Dog" & "Cat" class that extended from the "Pet", shouldn't share the same "speak" method. You'd override it to have its own logic like "woof" or "meow"
๐๐ฏ๐๐๐ฟ๐ฎ๐ฐ๐๐ถ๐ผ๐ป reduces complexity by only surfacing the information needed for a given context or use case. E.g. A โPlayerโ class doesnโt need to know how the โeatโ method works in the โPetโ class, it just needs to know how to interact with it โ i.e. its input and output.
OOP provides a way to design your program that makes it ๐ฟ๐ฒ๐๐๐ฎ๐ฏ๐น๐ฒ, ๐๐ฒ๐ฐ๐๐ฟ๐ฒ, ๐๐๐ฎ๐ฏ๐น๐ฒ, ๐ฎ๐ป๐ฑ ๐ฒ๐ฎ๐๐ ๐๐ผ ๐๐ป๐ฑ๐ฒ๐ฟ๐๐๐ฎ๐ป๐ฑ. But it isn't without disadvantages. A couple of arguments against it are that it can lead to over-engineering and complexity on a large scale.
~~
A big thank you to our partner Postman who keeps our content free to the community.
Did you know that you can now generate instant API documentation? Postbot can take care of this for you and save you a load of time. Check it out: drp.li/postbot-postman-z7tt
Hieu Nguyen Minh retweeted
Spring Framework vs. Spring Boot
javaguides.net/2023/08/diffeโฆ
Hieu Nguyen Minh retweeted
Unusual Evolution of the Netflix API Architecture
The Netflix API architecture went through 4 main stages.
๐๐จ๐ง๐จ๐ฅ๐ข๐ญ๐ก. The application is packaged and deployed as a monolith, such as a single Java WAR file, Rails app, etc. Most startups begin with a monolith architecture.
๐๐ข๐ซ๐๐๐ญ ๐๐๐๐๐ฌ๐ฌ. In this architecture, a client app can make requests directly to the microservices. With hundreds or even thousands of microservices, exposing all of them to clients is not ideal.
๐๐๐ญ๐๐ฐ๐๐ฒ ๐๐ ๐ ๐ซ๐๐ ๐๐ญ๐ข๐จ๐ง ๐ฅ๐๐ฒ๐๐ซ. Some use cases may span multiple services, we need a gateway aggregation layer. Imagine the Netflix app needs 3 APIs (movie, production, talent) to render the frontend. The gateway aggregation layer makes it possible.
๐
๐๐๐๐ซ๐๐ญ๐๐ ๐ ๐๐ญ๐๐ฐ๐๐ฒ. As the number of developers grew and domain complexity increased, developing the API aggregation layer became increasingly harder. GraphQL federation allows Netflix to set up a single GraphQL gateway that fetches data from all the other APIs.
Over to you - why do you think Netflix uses GraphQL instead of RESTful?
References:
[1] How Netflix Scales its API with GraphQL Federation: bit. ly/3MPuAsi (image source)
[2] Why You Can't Talk About Microservices Without Mentioning Netflix: bit. ly/3LKn0On
โ
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/3KCnWXq
Hieu Nguyen Minh retweeted
๐ Introducing StreamLine! ๐
Java concurrent stream leveraging Project Loom's virtual threads for unmatched efficiency. Perfect for developers aiming for scalability without complexity. Dive in now!
โก๏ธ github.com/YunaBraska/streamโฆ
โ
Functional design
โ
No reflection
โ
No magic
โ
Pure Java
โ
Performant
โ
GraalVM ready
#Java #ProjectLoom #DeveloperTools #CodeSimplified #Efficiency #GraalVM #Concurrency #StreamLine



























