Integrity
Write
Loading...
Scott Stockdale

Scott Stockdale

2 years ago

A Day in the Life of Lex Fridman Can Help You Hit 6-Month Goals

More on Personal Growth

Glorin Santhosh

Glorin Santhosh

2 years ago

Start organizing your ideas by using The Second Brain.

Image by author

Building A Second Brain helps us remember connections, ideas, inspirations, and insights. Using contemporary technologies and networks increases our intelligence.

This approach makes and preserves concepts. It's a straightforward, practical way to construct a second brain—a remote, centralized digital store for your knowledge and its sources.

How to build ‘The Second Brain’

Have you forgotten any brilliant ideas? What insights have you ignored?

We're pressured to read, listen, and watch informative content. Where did the data go? What happened?

Our brains can store few thoughts at once. Our brains aren't idea banks.

Building a Second Brain helps us remember thoughts, connections, and insights. Using digital technologies and networks expands our minds.

Ten Rules for Creating a Second Brain

1. Creative Stealing

Instead of starting from scratch, integrate other people's ideas with your own.

This way, you won't waste hours starting from scratch and can focus on achieving your goals.

Users of Notion can utilize and customize each other's templates.

2. The Habit of Capture

We must record every idea, concept, or piece of information that catches our attention since our minds are fragile.

When reading a book, listening to a podcast, or engaging in any other topic-related activity, save and use anything that resonates with you.

3. Recycle Your Ideas

Reusing our own ideas across projects might be advantageous since it helps us tie new information to what we already know and avoids us from starting a project with no ideas.

4. Projects Outside of Category

Instead of saving an idea in a folder, group it with documents for a project or activity.

If you want to be more productive, gather suggestions.

5. Burns Slowly

Even if you could finish a job, work, or activity if you focused on it, you shouldn't.

You'll get tired and can't advance many projects. It's easier to divide your routine into daily tasks.

Few hours of daily study is more productive and healthier than entire nights.

6. Begin with a surplus

Instead of starting with a blank sheet when tackling a new subject, utilise previous articles and research.

You may have read or saved related material.

7. Intermediate Packets

A bunch of essay facts.

You can utilize it as a document's section or paragraph for different tasks.

Memorize useful information so you can use it later.

8. You only know what you make

We can see, hear, and read about anything.

What matters is what we do with the information, whether that's summarizing it or writing about it.

9. Make it simpler for yourself in the future.

Create documents or files that your future self can easily understand. Use your own words, mind maps, or explanations.

10. Keep your thoughts flowing.

If you don't employ the knowledge in your second brain, it's useless.

Few people exercise despite knowing its benefits.

Conclusion:

  • You may continually move your activities and goals closer to completion by organizing and applying your information in a way that is results-focused.

  • Profit from the information economy's explosive growth by turning your specialized knowledge into cash.

  • Make up original patterns and linkages between topics.

  • You may reduce stress and information overload by appropriately curating and managing your personal information stream.

  • Learn how to apply your significant experience and specific knowledge to a new job, business, or profession.

  • Without having to adhere to tight, time-consuming constraints, accumulate a body of relevant knowledge and concepts over time.

  • Take advantage of all the learning materials that are at your disposal, including podcasts, online courses, webinars, books, and articles.

James White

James White

2 years ago

I read three of Elon Musk's suggested books (And His Taste Is Incredible)

A reading list for successful people

Daniel Oberhaus via Flickr

Elon Musk reads and talks. So, one learns. Many brilliant individuals & amazing literature.

This article recommends 3 Elon Musk novels. All of them helped me succeed. Hope they'll help you.

Douglas Adams's The Hitchhiker's Guide to the Galaxy

Page Count: 193
Rating on Goodreads: 4.23

Arthur Dent is pulled off Earth by a buddy seconds before it's razed for a cosmic motorway. The trio hitchhikes through space and gets into problems.

I initially read Hitchhiker's as a child. To evade my mum, I'd read with a flashlight under the covers. She'd scold at me for not sleeping on school nights when she found out. Oops.

The Hitchhiker's Guide to the Galaxy is lighthearted science fiction.

Goodreads

My favorite book quotes are:

  • “Space is big. You won’t believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to space.”

  • “Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this at a distance of roughly ninety-two million miles is an utterly insignificant little blue-green planet whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea.”

  • “On planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much — the wheel, New York, wars, and so on — whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man — for precisely the same reasons.”

the Sun Tzu book The Art Of War

Page Count: 273
Rating on Goodreads: 3.97

It's a classic. You may apply The Art of War's ideas to (nearly) every facet of life. Ex:

  • Pick your fights.

  • Keep in mind that timing is crucial.

  • Create a backup plan in case something goes wrong.

  • Obstacles provide us a chance to adapt and change.

This book was my first. Since then, I'm a more strategic entrepreneur. Excellent book. And read it ASAP!

Goodreads

My favorite book quotes are:

  • “Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win.”

  • “Engage people with what they expect; it is what they are able to discern and confirms their projections. It settles them into predictable patterns of response, occupying their minds while you wait for the extraordinary moment — that which they cannot anticipate.”

  • “If you know the enemy and know yourself, you need not fear the result of a hundred battles. If you know yourself but not the enemy, for every victory gained, you will also suffer a defeat. If you know neither the enemy nor yourself, you will succumb in every battle.”

Peter Thiel's book Zero to One

Page Count: 195
Rating on Goodreads: 4.18

Peter argues the best money-making strategies are typically unproven. Entrepreneurship should never have a defined path to success. Whoever says differently is lying.

Zero to One explores technology and society. Peter is a philosophy major and law school graduate, which informs the work.

Peters' ideas, depth, and intellect stood out in Zero to One. It's a top business book.

Goodreads

My favorite book quotes are:

  • “The most valuable businesses of coming decades will be built by entrepreneurs who seek to empower people rather than try to make them obsolete.”

  • “The next Bill Gates will not build an operating system. The next Larry Page or Sergey Brin won’t make a search engine. And the next Mark Zuckerberg won’t create a social network. If you are copying these guys, you aren’t learning from them.”

  • “If your goal is to never make a mistake in your life, you shouldn’t look for secrets. The prospect of being lonely but right — dedicating your life to something that no one else believes in — is already hard. The prospect of being lonely and wrong can be unbearable.”

Mia Gradelski

Mia Gradelski

2 years ago

Six Things Best-With-Money People Do Follow

I shouldn't generalize, yet this is true.

Spending is simpler than earning.

Prove me wrong, but with home debt at $145k in 2020 and individual debt at $67k, people don't have their priorities straight.

Where does this loan originate?

Under-50 Americans owed $7.86 trillion in Q4 20T. That's more than the US's 3-trillion-dollar deficit.

Here’s a breakdown:
🏡 Mortgages/Home Equity Loans = $5.28 trillion (67%)
🎓 Student Loans = $1.20 trillion (15%)
🚗 Auto Loans = $0.80 trillion (10%)
💳 Credit Cards = $0.37 trillion (5%)
🏥 Other/Medical = $0.20 trillion (3%)

Images.google.com

At least the Fed and government can explain themselves with their debt balance which includes:

-Providing stimulus packages 2x for Covid relief

-Stabilizing the economy

-Reducing inflation and unemployment

-Providing for the military, education and farmers

No American should have this much debt.

Don’t get me wrong. Debt isn’t all the same. Yes, it’s a negative number but it carries different purposes which may not be all bad.

Good debt: Use those funds in hopes of them appreciating as an investment in the future

-Student loans
-Business loan
-Mortgage, home equity loan
-Experiences

Paying cash for a home is wasteful. Just if the home is exceptionally uncommon, only 1 in a million on the market, and has an incredible bargain with numerous bidders seeking higher prices should you do so.

To impress the vendor, pay cash so they can sell it quickly. Most people can't afford most properties outright. Only 15% of U.S. homebuyers can afford their home. Zillow reports that only 37% of homes are mortgage-free.

People have clearly overreached.

Ignore appearances.

5% down can buy a 10-bedroom mansion.

Not paying in cash isn't necessarily a negative thing given property prices have increased by 30% since 2008, and throughout the epidemic, we've seen work-from-homers resort to the midwest, avoiding pricey coastal cities like NYC and San Francisco.

By no means do I think NYC is dead, nothing will replace this beautiful city that never sleeps, and now is the perfect time to rent or buy when everything is below average value for people who always wanted to come but never could. Once social distance ends, cities will recover. 24/7 sardine-packed subways prove New York isn't designed for isolation.

When buying a home, pay 20% cash and the balance with a mortgage. A mortgage must be incorporated into other costs such as maintenance, brokerage fees, property taxes, etc. If you're stuck on why a home isn't right for you, read here. A mortgage must be paid until the term date. Whether its a 10 year or 30 year fixed mortgage, depending on interest rates, especially now as the 10-year yield is inching towards 1.25%, it's better to refinance in a lower interest rate environment and pay off your debt as well since the Fed will be inching interest rates up following the 10-year eventually to stabilize the economy, but I believe that won't be until after Covid and when businesses like luxury, air travel, and tourism will get bashed.

Bad debt: I guess the contrary must be true. There is no way to profit from the loan in the future, therefore it is just money down the drain.

-Luxury goods
-Credit card debt
-Fancy junk
-Vacations, weddings, parties, etc.

Credit cards and school loans are the two largest risks to the financial security of those under 50 since banks love to compound interest to affect your credit score and make it tougher to take out more loans, not that you should with that much debt anyhow. With a low credit score and heavy debt, banks take advantage of you because you need aid to pay more for their services. Paying back debt is the challenge for most.

Choose Not Chosen

As a financial literacy advocate and blogger, I prefer not to brag, but I will now. I know what to buy and what to avoid. My parents educated me to live a frugal, minimalist stealth wealth lifestyle by choice, not because we had to.

That's the lesson.

The poorest person who shows off with bling is trying to seem rich.

Rich people know garbage is a bad investment. Investing in education is one of the best long-term investments. With information, you can do anything.

Good with money shun some items out of respect and appreciation for what they have.

Less is more.

Instead of copying the Joneses, use what you have. They may look cheerful and stylish in their 20k ft home, yet they may be as broke as OJ Simpson in his 20-bedroom mansion.

Let's look at what appears good to follow and maintain your wealth.

#1: Quality comes before quantity

Being frugal doesn't entail being cheap and cruel. Rich individuals care about relationships and treating others correctly, not impressing them. You don't have to be rich to be good with money, although most are since they don't live the fantasy lifestyle.

Underspending is appreciating what you have.

Many people believe organic food is the same as washing chemical-laden produce. Hopefully. Organic, vegan, fresh vegetables from upstate may be more expensive in the short term, but they will help you live longer and save you money in the long run.

Consider. You'll save thousands a month eating McDonalds 3x a day instead of fresh seafood, veggies, and organic fruit, but your life will be shortened. If you want to save money and die early, go ahead, but I assume we all want to break the world record for longest person living and would rather spend less. Plus, elderly people get tax breaks, medicare, pensions, 401ks, etc. You're living for free, therefore eating fast food forever is a terrible decision.

With a few longer years, you may make hundreds or millions more in the stock market, spend more time with family, and just live.

Folks, health is wealth.

Consider the future benefit, not simply the cash sign. Cheapness is useless.

Same with stuff. Don't stock your closet with fast-fashion you can't wear for years. Buying inexpensive goods that will fail tomorrow is stupid.

Investing isn't only in stocks. You're living. Consume less.

#2: If you cannot afford it twice, you cannot afford it once

I learned this from my dad in 6th grade. I've been lucky to travel, experience things, go to a great university, and conduct many experiments that others without a stable, decent lifestyle can afford.

I didn't live this way because of my parents' paycheck or financial knowledge.

Saving and choosing caused it.

I always bring cash when I shop. I ditch Apple Pay and credit cards since I can spend all I want on even if my account bounces.

Banks are nasty. When you lose it, they profit.

Cash hinders banks' profits. Carrying a big, hefty wallet with cash is lame and annoying, but it's the best method to only spend what you need. Not for vacation, but for tiny daily expenses.

Physical currency lets you know how much you have for lunch or a taxi.

It's physical, thus losing it prevents debt.

If you can't afford it, it will harm more than help.

#3: You really can purchase happiness with money.

If used correctly, yes.

Happiness and satisfaction differ.

It won't bring you fulfillment because you must work hard on your own to help others, but you can travel and meet individuals you wouldn't otherwise meet.

You can meet your future co-worker or strike a deal while waiting an hour in first class for takeoff, or you can meet renowned people at a networking brunch.

Seen a pattern here?

Your time and money are best spent on connections. Not automobiles or firearms. That’s just stuff. It doesn’t make you a better person.

Be different if you've earned less. Instead of trying to win the lotto or become an NFL star for your first big salary, network online for free.

Be resourceful. Sign up for LinkedIn, post regularly, and leave unengaged posts up because that shows power.

Consistency is beneficial.

I did that for a few months and met amazing people who helped me get jobs. Money doesn't create jobs, it creates opportunities.

Resist social media and scammers that peddle false hopes.

Choose wisely.

#4: Avoid gushing over titles and purchasing trash.

As Insider’s Hillary Hoffower reports, “Showing off wealth is no longer the way to signify having wealth. In the US particularly, the top 1% have been spending less on material goods since 2007.”

I checked my closet. No brand comes to mind. I've never worn a brand's logo and rotate 6 white shirts daily. I have my priorities and don't waste money or effort on clothing that won't fit me in a year.

Unless it's your full-time work, clothing shouldn't be part of our mornings.

Lifestyle of stealth wealth. You're so fulfilled that seeming homeless won't hurt your self-esteem.

That's self-assurance.

Extroverts aren't required.

That's irrelevant.

Showing off won't win you friends.

They'll like your personality.

#5: Time is the most valuable commodity.

Being rich doesn't entail working 24/7 M-F.

They work when they are ready to work.

Waking up at 5 a.m. won't make you a millionaire, but it will inculcate diligence and tenacity in you.

You have a busy day yet want to exercise. You can skip the workout or wake up at 4am instead of 6am to do it.

Emotion-driven lazy bums stay in bed.

Those that are accountable keep their promises because they know breaking one will destroy their week.

Since 7th grade, I've worked out at 5am for myself, not to impress others. It gives me greater energy to contribute to others, especially on weekends and holidays.

It's a habit that I have in my life.

Find something that you take seriously and makes you a better person.

As someone who is close to becoming a millionaire and has encountered them throughout my life, I can share with you a few important differences that have shaped who we are as a society based on the weekends:

-Read

-Sleep

-Best time to work with no distractions

-Eat together

-Take walks and be in nature

-Gratitude

-Major family time

-Plan out weeks

-Go grocery shopping because health = wealth

#6. Perspective is Important

Timing the markets will slow down your career. Professors preach scarcity, not abundance. Why should school teach success? They give us bad advice.

If you trust in abundance and luck by attempting and experimenting, growth will come effortlessly. Passion isn't a term that just appears. Mistakes and fresh people help. You can get money. If you don't think it's worth it, you won't.

You don’t have to be wealthy to be good at money, but most are for these reasons.  Rich is a mindset, wealth is power. Prioritize your resources. Invest in yourself, knowing the toughest part is starting.

Thanks for reading!

You might also like

Gajus Kuizinas

Gajus Kuizinas

2 years ago

How a few lines of code were able to eliminate a few million queries from the database

I was entering tens of millions of records per hour when I first published Slonik PostgreSQL client for Node.js. The data being entered was usually flat, making it straightforward to use INSERT INTO ... SELECT * FROM unnset() pattern. I advocated the unnest approach for inserting rows in groups (that was part I).

Bulk inserting nested data into the database

However, today I’ve found a better way: jsonb_to_recordset.

jsonb_to_recordset expands the top-level JSON array of objects to a set of rows having the composite type defined by an AS clause.

jsonb_to_recordset allows us to query and insert records from arbitrary JSON, like unnest. Since we're giving JSON to PostgreSQL instead of unnest, the final format is more expressive and powerful.

SELECT *
FROM json_to_recordset('[{"name":"John","tags":["foo","bar"]},{"name":"Jane","tags":["baz"]}]')
AS t1(name text, tags text[]);
 name |   tags
------+-----------
 John | {foo,bar}
 Jane | {baz}
(2 rows)

Let’s demonstrate how you would use it to insert data.

Inserting data using json_to_recordset

Say you need to insert a list of people with attributes into the database.

const persons = [
  {
    name: 'John',
    tags: ['foo', 'bar']
  },
  {
    name: 'Jane',
    tags: ['baz']
  }
];

You may be tempted to traverse through the array and insert each record separately, e.g.

for (const person of persons) {
  await pool.query(sql`
    INSERT INTO person (name, tags)
    VALUES (
      ${person.name},
      ${sql.array(person.tags, 'text[]')}
    )
  `);
}

It's easier to read and grasp when working with a few records. If you're like me and troubleshoot a 2M+ insert query per day, batching inserts may be beneficial.

What prompted the search for better alternatives.

Inserting using unnest pattern might look like this:

await pool.query(sql`
  INSERT INTO public.person (name, tags)
  SELECT t1.name, t1.tags::text[]
  FROM unnest(
    ${sql.array(['John', 'Jane'], 'text')},
    ${sql.array(['{foo,bar}', '{baz}'], 'text')}
  ) AS t1.(name, tags);
`);

You must convert arrays into PostgreSQL array strings and provide them as text arguments, which is unsightly. Iterating the array to create slices for each column is likewise unattractive.

However, with jsonb_to_recordset, we can:

await pool.query(sql`
  INSERT INTO person (name, tags)
  SELECT *
  FROM jsonb_to_recordset(${sql.jsonb(persons)}) AS t(name text, tags text[])
`);

In contrast to the unnest approach, using jsonb_to_recordset we can easily insert complex nested data structures, and we can pass the original JSON document to the query without needing to manipulate it.

In terms of performance they are also exactly the same. As such, my current recommendation is to prefer jsonb_to_recordset whenever inserting lots of rows or nested data structures.

Ethan Siegel

Ethan Siegel

1 year ago

How you view the year will change after using this one-page calendar.

The conventional way we display annual calendars, at left, requires us to examine each month separately, either relegating the full year to a tiny font on a single page or onto 12 separate pages. Instead, the one-page calendar, at right, enables you to find whatever you want all throughout the year. (Credit: E. Siegel, with a public domain conventional calendar at left)

No other calendar is simpler, smaller, and reusable year after year. It works and is used here.

Most of us discard and replace our calendars annually. Each month, we move our calendar ahead another page, thus if we need to know which day of the week corresponds to a given day/month combination, we have to calculate it or flip forward/backward to the corresponding month. Questions like:

  • What day does this year's American Thanksgiving fall on?

  • Which months contain a Friday the thirteenth?

  • When is July 4th? What day of the week?

  • Alternatively, what day of the week is Christmas?

They're hard to figure out until you switch to the right month or look up all the months.

However, mathematically, the answers to these questions or any question that requires matching the day of the week with the day/month combination in a year are predictable, basic, and easy to work out. If you use this one-page calendar instead of a 12-month calendar, it lasts the whole year and is easy to alter for future years. Let me explain.

Rather than a calendar displaying separate images for each month out of the year, this one-page calendar can be used to match up the day of the week with the dates/months of the year with perfect accuracy all in a single view. (Credit: E. Siegel)

The 2023 one-page calendar is above. The days of the month are on the lower left, which works for all months if you know that:

  • There are 31 days in January, March, May, July, August, October, and December.

  • All of the months of April, June, September, and November have 30 days.

  • And depending on the year, February has either 28 days (in non-leap years) or 29 days (in leap years).

If you know this, this calendar makes it easy to match the day/month of the year to the weekday.

Here are some instances. American Thanksgiving is always on the fourth Thursday of November. You'll always know the month and day of the week, but the date—the day in November—changes each year.

On any other calendar, you'd have to flip to November to see when the fourth Thursday is. This one-page calendar only requires:

  • pick the month of November in the top-right corner to begin.

  • drag your finger down until Thursday appears,

  • then turn left and follow the monthly calendar until you reach the fourth Thursday.

To find American Thanksgiving, you need to find the 4th Thursday in November. Using the one-page calendar, start at November, move down to find Thursday, then move to the left to count off to the fourth Thursday in November. In 2023, that date will be November 23rd. (Credit: E. Siegel)

It's obvious: 2023 is the 23rd American Thanksgiving. For every month and day-of-the-week combination, start at the month, drag your finger down to the desired day, and then move to the left to see which dates match.

What if you knew the day of the week and the date of the month, but not the month(s)?

A different method using the same one-page calendar gives the answer. Which months have Friday the 13th this year? Just:

  • begin on the 13th of the month, the day you know you desire,

  • then swipe right with your finger till Friday appears.

  • and then work your way up until you can determine which months the specific Friday the 13th falls under.

If you know which date/day-of-the-week combination you’re seeking but don’t know which months will meet that criteria, start with the date (1–31), move to the right until you find the day of the week you want, then move up and find which months match that criteria. Every year will always have at least one such combination. (Credit: E. Siegel)

One Friday the 13th occurred in January 2023, and another will occur in October.

The most typical reason to consult a calendar is when you know the month/day combination but not the day of the week.

Compared to single-month calendars, the one-page calendar excels here. Take July 4th, for instance. Find the weekday here:

  • beginning on the left on the fourth of the month, as you are aware,

  • also begin with July, the month of the year you are most familiar with, at the upper right,

  • you should move your two fingers in the opposite directions till they meet: on a Tuesday in 2023.

That's how you find your selected day/month combination's weekday.

If you were curious as to which day of the week July 4th, 2023 fell on, rather than flipping a conventional calendar to July and seeing, you could trace “4” to the right and “July” down, finding where they meet (on a Tuesday) revealing the day-of-the-week. (Credit: E. Siegel)

Another example: Christmas. Christmas Day is always December 25th, however unless your conventional calendar is open to December of your particular year, a question like "what day of the week is Christmas?" difficult to answer.

Unlike the one-page calendar!

Remember the left-hand day of the month. Top-right, you see the month. Put two fingers, one from each hand, on the date (25th) and the month (December). Slide the day hand to the right and the month hand downwards until they touch.

They meet on Monday—December 25, 2023.

Using the one-page calendar for 2023, you can figure out the day-of-the-week of any calendar day by placing one finger on the “date” at left and another on the “month” at top. By moving your fingers respectively to the right and down, where they meet will reveal the day of the week to you. (Credit: E. Siegel)

For 2023, that's fine, but what happens in 2024? Even worse, what if we want to know the day-of-the-week/day/month combo many years from now?

I think the one-page calendar shines here.

Except for the blue months in the upper-right corner of the one-page calendar, everything is the same year after year. The months also change in a consistent fashion.

Each non-leap year has 365 days—one more than a full 52 weeks (which is 364). Since January 1, 2023 began on a Sunday and 2023 has 365 days, we immediately know that December 31, 2023 will conclude on a Sunday (which you can confirm using the one-page calendar) and that January 1, 2024 will begin on a Monday. Then, reorder the months for 2024, taking in mind that February will have 29 days in a leap year.

This image shows the one-page calendar view for the next leap year we’re going to experience: 2024. Note that the monthly patterns have changed from how they were in a non-leap year, displaying a new pattern unique to leap years, corresponding to the fact that February has 29 days instead of 28. (Credit: E. Siegel)

Please note the differences between 2023 and 2024 month placement. In 2023:

  • October and January began on the same day of the week.

  • On the following Monday of the week, May began.

  • August started on the next day,

  • then the next weekday marked the start of February, March, and November, respectively.

  • Unlike June, which starts the following weekday,

  • While September and December start on the following day of the week,

  • Lastly, April and July start one extra day later.

Since 2024 is a leap year, February has 29 days, disrupting the rhythm. Month placements change to:

  • The first day of the week in January, April, and July is the same.

  • October will begin the following day.

  • Possibly starting the next weekday,

  • February and August start on the next weekday,

  • beginning on the following day of the week between March and November,

  • beginning the following weekday in June,

  • and commencing one more day of the week after that, September and December.

Due to the 366-day leap year, 2025 will start two days later than 2024 on January 1st.

The non-leap year 2025 has the same calendar as 2023, expect with the days-of-the-week that each month begins on shifted forward by three days for each month. This is because 2023 was not a leap year and 2024 was, meaning that an extra 3 days are needed over and above the 104 full weeks contained in 2023 and 2024 combined. (Credit: E. Siegel)

Now, looking at the 2025 calendar, you can see that the 2023 pattern of which months start on which days is repeated! The sole variation is a shift of three days-of-the-week ahead because 2023 had one more day (365) than 52 full weeks (364), and 2024 had two more days (366). Again,

  • On Wednesday this time, January and October begin on the same day of the week.

  • Although May begins on Thursday,

  • August begins this Friday.

  • March, November, and February all begin on a Saturday.

  • Beginning on a Sunday in June

  • Beginning on Monday are September and December,

  • and on Tuesday, April and July begin.

In 2026 and 2027, the year will commence on a Thursday and a Friday, respectively.

The one-page calendars for 2026 and 2027, as shown next to one another. Note that the calendars are identical, save that the day-of-the-week that each month begins on is shifted by one day from the prior year to the next. This occurs every time a non-leap year is followed by another non-leap year. (Credit: E. Siegel)

We must return to our leap year monthly arrangement in 2028. Yes, January 1, 2028 begins on a Saturday, but February, which begins on a Tuesday three days before January, will have 29 days. Thus:

  • Start dates for January, April, and July are all Saturdays.

  • Given that October began on Sunday,

  • Although May starts on a Monday,

  • beginning on a Tuesday in February and August,

  • Beginning on a Wednesday in March and November,

  • Beginning on Thursday, June

  • and Friday marks the start of September and December.

This is great because there are only 14 calendar configurations: one for each of the seven non-leap years where January 1st begins on each of the seven days of the week, and one for each of the seven leap years where it begins on each day of the week.

This example of a one-page calendar, which represents the year 2028, will be valid for all leap years that begin with January 1st on a Saturday. The leap year version of the one-page calendar repeats every 28 years, unless you pass a non-leap year ending in “00,” in which case the repeat will either be 12 or 40 years instead. (Credit: E. Siegel)

The 2023 calendar will function in 2034, 2045, 2051, 2062, 2073, 2079, 2090, 2102, 2113, and 2119. Except when passing over a non-leap year that ends in 00, like 2100, the repeat time always extends to 12 years or shortens to an extra 6 years.

  • The pattern is repeated in 2025's calendar in 2031, 2042, 2053, 2059, 2070, 2081, 2087, 2098, 2110, and 2121.

  • The extra 6-year repeat at the end of the century on the calendar for 2026 will occur in the years 2037, 2043, 2054, 2065, 2071, 2082, 2093, 2099, 2105, and 2122.

  • The 2027s calendar repeats in 2038, 2049, 2055, 2066, 2077, 2083, 2094, 2100, 2106, and 2117, almost exactly matching the 2026s pattern.

For leap years, the recurrence pattern is every 28 years when not passing a non-leap year ending in 00, or 12 or 40 years when we do. 2024's calendar repeats in 2052, 2080, 2120, 2148, 2176, and 2216; 2028's in 2056, 2084, 2124, 2152, 2180, and 2220.

Knowing January 1st and whether it's a leap year lets you construct a one-page calendar for any year. Try it—you might find it easier than any other alternative!

Shalitha Suranga

Shalitha Suranga

2 years ago

The Top 5 Mathematical Concepts Every Programmer Needs to Know

Using math to write efficient code in any language

Photo by Emile Perron on Unsplash, edited with Canva

Programmers design, build, test, and maintain software. Employ cases and personal preferences determine the programming languages we use throughout development. Mobile app developers use JavaScript or Dart. Some programmers design performance-first software in C/C++.

A generic source code includes language-specific grammar, pre-implemented function calls, mathematical operators, and control statements. Some mathematical principles assist us enhance our programming and problem-solving skills.

We all use basic mathematical concepts like formulas and relational operators (aka comparison operators) in programming in our daily lives. Beyond these mathematical syntaxes, we'll see discrete math topics. This narrative explains key math topics programmers must know. Master these ideas to produce clean and efficient software code.

Expressions in mathematics and built-in mathematical functions

A source code can only contain a mathematical algorithm or prebuilt API functions. We develop source code between these two ends. If you create code to fetch JSON data from a RESTful service, you'll invoke an HTTP client and won't conduct any math. If you write a function to compute the circle's area, you conduct the math there.

When your source code gets more mathematical, you'll need to use mathematical functions. Every programming language has a math module and syntactical operators. Good programmers always consider code readability, so we should learn to write readable mathematical expressions.

Linux utilizes clear math expressions.

A mathematical expression/formula in the Linux codebase, a screenshot by the author

Inbuilt max and min functions can minimize verbose if statements.

Reducing a verbose nested-if with the min function in Neutralinojs, a screenshot by the author

How can we compute the number of pages needed to display known data? In such instances, the ceil function is often utilized.

import math as m
results = 102
items_per_page = 10 
pages = m.ceil(results / items_per_page)
print(pages)

Learn to write clear, concise math expressions.

Combinatorics in Algorithm Design

Combinatorics theory counts, selects, and arranges numbers or objects. First, consider these programming-related questions. Four-digit PIN security? what options exist? What if the PIN has a prefix? How to locate all decimal number pairs?

Combinatorics questions. Software engineering jobs often require counting items. Combinatorics counts elements without counting them one by one or through other verbose approaches, therefore it enables us to offer minimum and efficient solutions to real-world situations. Combinatorics helps us make reliable decision tests without missing edge cases. Write a program to see if three inputs form a triangle. This is a question I commonly ask in software engineering interviews.

Graph theory is a subfield of combinatorics. Graph theory is used in computerized road maps and social media apps.

Logarithms and Geometry Understanding

Geometry studies shapes, angles, and sizes. Cartesian geometry involves representing geometric objects in multidimensional planes. Geometry is useful for programming. Cartesian geometry is useful for vector graphics, game development, and low-level computer graphics. We can simply work with 2D and 3D arrays as plane axes.

GetWindowRect is a Windows GUI SDK geometric object.

GetWindowRect outputs an LPRECT geometric object, a screenshot by the author

High-level GUI SDKs and libraries use geometric notions like coordinates, dimensions, and forms, therefore knowing geometry speeds up work with computer graphics APIs.

How does exponentiation's inverse function work? Logarithm is exponentiation's inverse function. Logarithm helps programmers find efficient algorithms and solve calculations. Writing efficient code involves finding algorithms with logarithmic temporal complexity. Programmers prefer binary search (O(log n)) over linear search (O(n)). Git source specifies O(log n):

The Git codebase defines a function with logarithmic time complexity, a screenshot by the author

Logarithms aid with programming math. Metas Watchman uses a logarithmic utility function to find the next power of two.

A utility function that uses ceil, a screenshot by the author

Employing Mathematical Data Structures

Programmers must know data structures to develop clean, efficient code. Stack, queue, and hashmap are computer science basics. Sets and graphs are discrete arithmetic data structures. Most computer languages include a set structure to hold distinct data entries. In most computer languages, graphs can be represented using neighboring lists or objects.

Using sets as deduped lists is powerful because set implementations allow iterators. Instead of a list (or array), store WebSocket connections in a set.

Most interviewers ask graph theory questions, yet current software engineers don't practice algorithms. Graph theory challenges become obligatory in IT firm interviews.

Recognizing Applications of Recursion

A function in programming isolates input(s) and output(s) (s). Programming functions may have originated from mathematical function theories. Programming and math functions are different but similar. Both function types accept input and return value.

Recursion involves calling the same function inside another function. In its implementation, you'll call the Fibonacci sequence. Recursion solves divide-and-conquer software engineering difficulties and avoids code repetition. I recently built the following recursive Dart code to render a Flutter multi-depth expanding list UI:

Recursion is not the natural linear way to solve problems, hence thinking recursively is difficult. Everything becomes clear when a mathematical function definition includes a base case and recursive call.

Conclusion

Every codebase uses arithmetic operators, relational operators, and expressions. To build mathematical expressions, we typically employ log, ceil, floor, min, max, etc. Combinatorics, geometry, data structures, and recursion help implement algorithms. Unless you operate in a pure mathematical domain, you may not use calculus, limits, and other complex math in daily programming (i.e., a game engine). These principles are fundamental for daily programming activities.

Master the above math fundamentals to build clean, efficient code.