Your Coding Teacher
前往频道在 Telegram
Coding, software engineering & #bitcoin technologies. I'll make you a better thinker, not just a better developer | Ex Amazon, Senior DevOps @eBay
显示更多未指定国家技术与应用98 126
334
订阅者
无数据24 小时
无数据7 天
无数据30 天
帖子存档
I've also wasted long hours debugging issues that came from:
- Reading the wrong configuration file
- Using outdated information from an internal wiki page
- Problems with someone else's code
- Copy-paste related errors
When things go wrong, check your assumptions.
Bit-level operations on an integer x
x |= 1<<7 -> set bit 7 (the first bit starts at index 0)
x &= ~(1<<7) -> clear bit 7
x ^= 1<<7 -> toggle bit 7
mask = ((1<<8)-1) -> create an 8 bit mask
(x >> 16) & 0xf -> extract bits 16 through 8
(x >> 7) & 1 -> test bit 7
We live in a world governed by distributed systems.
From small intranets, to share printers, to the Internet
4 JavaScript interview questions
What is a Callback function?
What are Arrow functions?
What is the usage of Function.prototype.bind?
How to check if a value is null?
Instead of trying to figure out what's the next incremental improvements for a slow algorithm,
sometimes it's better to try a complete different approach
"The language in which we express our ideas has a strong influence on our thought processes."
- Donald Knuth
The best thing about a boolean is even if you are wrong, you are only off by a bit
"There are no significant bugs in our released software that any significant number of users want fixed."
- Bill Gates
In GCP, you can use preemptible virtual machines to save up to 80% of your costs.
They are ideal for fault-tolerant, non-critical applications.
You can save the progress of your job in a persistent disk using a shut-down script to continue where you left off.
Message queues in a tweet
- Allows for asych processing
- Stores messages that servers will read and process
- Adds reliability (no message is lost)
- Dead-letter queue: receives messages that couldn't be routed to their destination
- Ex: SQS, Kafka, Rabbit MQ, Pub/Sub
Python's list comprehensions provides a concise way of creating a list from another.
For example:
cubes = [x**3 for x in a].
In general, they are clearer than maps and filters built-in function.
"Debugging is like being the detective in a crime movie where you are also the murderer."
- Filipe Fortes
In C++, to prevent resource leaks, use RAII
Resource Acquisition Is Initialization
Acquire resources in constructors and release them in destructors
The first 90% of a project takes 90% of development time.
The last 10% takes the other 90% of the time.
It's possible to "increase the available RAM" on a Linux machine using disk.
The Linux virtual memory system can move data from memory disk and viceversa, in a process called swapping.
The disk area used to store memory pages is called swap space.
Software is more like science that mathematics.
You cannot prove that you'r software is correct (no bugs).
You can write a bunch of tests to show that your code hasn't failed (so far).
Anything that can go wrong will go wrong
Anything that can't go wrong will go wrong anyway
