Saturday, June 29, 2024

Architecture: Sandcastle-Shaped Beach House

 Inside A Stunning Sandcastle-Shaped Beach House | On The Market | Architectural Digest - YouTube

rugged shores of Malibu, California to tour Sandcastle House, the remarkable family home of architect Harry Gesner. This stunning property was born from a promise to Gesner’s wife to build her dream house on the shores of Malibu. This one-of-a-kind home is made almost entirely from reclaimed materials salvaged from surrounding areas and inspired by the structural design of a sandcastle. But what makes Sandcastle House so special is Gesner built it with his own two hands for his family, making it a true labor of love.

Harry Gesner’s Malibu Sandcastle House Lists for $27.5 Million - Mansion Global

33604 Pacific Coast Highway, Malibu, CA, 90265 | Chris Cortazzo

Is Microsoft Teams new Internet Explorer?

Decades ago, Microsoft "bundled" IE with Windows to "kill" Netscape.
It kind-off worked, so well that it required anti-monopoly measures,
and major competition for more than a decade to "unstuck" web browsers progress.

Now by "bundling" MS Teams for "free" in MS Office, Microsoft has triggered the same reaction from EU. But this time seem to have pro-actively slightly adjust the practice.

 Microsoft splits Teams from Office as antitrust pressure ramps up - The Verge

Microsoft, possibly hoping to deflect the blow of an ongoing antitrust investigation in the EU, is spinning Teams off from Office 365 to sell as its own separate app globally,

good "All-in Podcast" discussion here

Presidential Debate Reaction, Biden Hot Swap?, Tech unemployment, OpenAI considers for-profit & more - YouTube

JavaScript logs, in color: chalk.js

(AI answer)

node.js: process.stdout.write() vs. console.log() 

In node.js, process.stdout.write() and console.log() are both used to write to the standard output (stdout), but there are some differences between them:

Formatting: console.log() supports formatted output, similar to printf() in C. For example, you can use placeholders like %s for strings, %d for numbers, and %j for JSON. process.stdout.write() does not support this kind of formatting.

Newline character: console.log() automatically appends a newline character (\n) at the end of the output, while process.stdout.write() does not. If you want a newline at the end of the output with process.stdout.write(), you have to add it manually.

Synchronous vs Asynchronous: console.log() is synchronous on Windows and asynchronous on POSIX (Unix, Linux, macOS). process.stdout.write() is synchronous if the destination is a terminal or a file (to prevent lost data), and asynchronous if it's a pipe or a socket.

Performance: process.stdout.write() can be faster than console.log() because it doesn't involve as much overhead (like string formatting and adding a newline character).

In general, you can use console.log() when you need formatted output or when you're debugging, and process.stdout.write() when you need to write raw output or when performance is a concern.

console.log('Hello, %s!', 'world'); // Hello, world!
process.stdout.write('Hello, world!\n'); // Hello, world!

color logs in node.js console / terminal

To change colors with console.log(), you can use ANSI escape codes. These are sequences of characters that can be used to change the color of the text in the terminal. Here's an example:

console.log('\x1b[36m%s\x1b[0m', 'I am cyan');
 // Outputs "I am cyan" in cyan.

In this code, \x1b[36m is the ANSI escape code for cyan, and \x1b[0m resets the color back to the default color. The %s is a placeholder that gets replaced with the string 'I am cyan'.

Here are the ANSI color codes for 8 different colors:

Black:   \x1b[30m
Red:     \x1b[31m
Green:   \x1b[32m
Yellow:  \x1b[33m
Blue:    \x1b[34m
Magenta: \x1b[35m
Cyan:    \x1b[36m
White:   \x1b[37m

Remember to reset the color back to the default after you're done, or else the color change will affect all subsequent text that gets printed to the console. You can do this with \x1b[0m.

Note: These color codes might not work in all terminals or operating systems. If you're writing a Node.js application that needs to be portable across different systems, you might want to use a library like chalk that handles these differences for you.

const chalk = require('chalk');
console.log('Hello, world!'));

chalk - npm 311 million weekly downloads!

color logs in web browser console

Since Chrome 69, ANSI escape codes are natively supported in the developer console.

you can also use colors in console.log() in web browsers, but the method is different from Node.js. In web browsers, you can use CSS to style your console output. Here's an example:

console.log('%cHello, world!', 'color: blue; font-size: 20px');

In this code, %c is a placeholder for CSS styles. The second argument to console.log() is a string of CSS properties that will be applied to the text. In this case, the text will be blue and 20 pixels in size.

Note that not all CSS properties are supported, and the exact support may vary between different browsers. Commonly used properties like color and font-size are generally well-supported.