Four Thousand Weeks: Time Management For Mortals by Oliver Burkeman | Notes

What this book is about: This is a book about how most humans only live about 4,000 weeks, and we should realize that In the long run, we’re all dead Notes face the reality that time is limited once you deeply grasp that fact that doing everything is impossible, you’ll be newly empowered to resist doing everything, and to focus instead on building the most meaningful life you can know that you will not achieve peace of mind just by doing more things....

The Most Common First Names of MLB Draftees

For some reason I wanted to know if there was any trend in first names of MLB draftees. If you ask me, the first names of MLB draftees & players have some kind of perceived stereotype, and I wanted to see if that was true. For example, it seems like a lot of JJs are drafted. First Step: Get (Extract) the data From googling around and just looking at data on the internet for many years, I knew there was an MLB Stats-API....

Supercommunicators: How to Unlock the Secret Language of Connection by Charles Duhigg | Notes

What this book is about: This is a book about the art of conversation It has some case studies and lays some rules out on how to have good conversations Notes people love talking to people who let them come away feeling “a little smarter, funnier, more interesting” people want to feel as if they have been heard and like they have some kind of bond with who they are talking a goal for meaning for discussions is to have a “learning conversation” learn how people around us see the world and help them understand out perspectives to communicate with someone we must connect with them absorb what someone is saying and comprehend what we say when a good conversation happens brains align, bodies synchronize and neural simultaneity occurs To become a supercomminiucator: listen close to what is said and unsaid ask right questions recognize and match others moods make our own feelings easy for others to perceive Three types of conversations: Decision Making - What’s this really about?...

Social Network Relationship Graph | SQL Use Case

Here is SQL test I took during a job interview. First is the description, or you can skip directly to the answer. Description: A social network under development needs a query that returns all profiles and the types of their relationships with each other. The result should have the following columns: profile | %related_profile_1% .. %related_profile_N% - type of relation of specific profiles: The column name is the related profile username....

Dialer Application Weekly Call Stats | SQL Use Case

Here is SQL test I took during a job interview. First is the description, or you can skip directly to the answer. Description: As part of developing the call history functionality of a dialer application, create a query that returns a list of all contacts, the total duration of their calls, and the number of calls during the work week and weekends. The result should have the following column: full_name | phone | type | workweek | weekend....

Using a table of users and their transactions, a SQL query that shows users' first and last transaction | SQL Use Case

I took this SQL test during a job interview. The instructions are (spelling mistake is theirs): “We’d like a data model for quick lookup per user. Create a query that returns 1 row per user containing information on their first purchance and their last.” We have a table that looks like this - the table is called subscriptions which can also be considered transactions. Table "public.subscriptions" Column | Type | Collation | Nullable | Default ----------------+-----------------------------+-----------+----------+--------- transaction_id | character(36) | | not null | purchased_at | timestamp without time zone | | not null | purchase_price | double precision | | not null | user_id | character varying(255) | | not null | The way I did this was with two sub queries....

Convert seconds to HH:MM:SS PostgreSQL

Here’s how to convert a numeric integer field of seconds to HH:MM:SS. Use the INTERVAL PostgreSQL data type. The INTERVAL data type is used to store and manipulate a time period. Example SELECT 120 * interval '1 sec'; Output |120 seconds to HH:MM:SS| |-----------------------| |00:02:00| An example with a table of rows of call records that have the length of call in seconds in a column called duration. select duration , duration * interval '1 sec' seconds_to_hh_mm_ss , duration * interval '1 min' min_to_hh_mm_ss from calls; Output...

Using RStudio – editing your user level and project level .RProfile file

Using the .Rprofile file in RStudio is a great way to automatically load packages and functions upon startup. If you know of additional ways to use this file, let me know. For now, here are easy ways to edit these files at each level. Very simply, use the usethis::edit_r_profile() command to edit your .RProfile file. It defaults to edit the user level file but you can add scope = c("user", "project") to the argument of the function....

How to download (export) your WordPress posts and data from your free WordPress blog

It is real easy. First go to the WP Admin page of your blog. It is the same URL as your blog with /wp-admin/ appended to the end. Then click Tools > Export. You should now be on the “Export Content” screen. Follow the instructions on this screen to get your posts and other data.

R – how to select all rows of a data frame where a condition is met

Here is an example, the data looks like this with 3 columns. > fd_nba_raw Position Nickname Injury.Indicator 1 PG Luka Doncic 2 PF Giannis Antetokounmpo 3 C Karl-Anthony Towns GTD 4 SF Kevin Durant 5 SF LeBron James 6 PF Anthony Davis GTD 7 PG Kyrie Irving O 8 SG CJ McCollum 9 SF Kawhi Leonard 10 PG Damian Lillard GTD To select only those with Injury.Indicator = ‘O’ fd_nba_raw[fd_nba_raw$Injury.Indicator == 'O',] You can also include & and I (and & or) conditions....