Christ is my all
2391 stories
·
3 followers

CarPlay Seems Essential for Rental Fleets

1 Share

Joe Rosensteel:

I have no plan to purchase a GM vehicle, but I do rent cars. GM makes up a sizable portion of rental car fleets. At some point in the future those cars will no longer support CarPlay. I’m not going to sign up for a GM federated ID that stores my login credentials in their cloud. I’m not going to individually sign into apps in the car like Google Maps with my Google ID that I use for way more than just navigation. There’s no chain of trust with me and this random car from GM. No convenience that is achieved in exchange for increased exposure risk for storing my sensitive data in a car I don’t own.

If GM goes through with this abandonment of CarPlay, I don’t see how they’ll continue to sell any vehicles to rental agencies. I would never rent a car without CarPlay, and I would never consider signing up for a GM cloud service just to drive a rental car. Complete dealbreakers.

Read the whole story
rtreborb
23 minutes ago
reply
San Antonio, TX
Share this story
Delete

One Mind, Two Bodies: Man With Brain Implant Controls Another Person’s Hand—and Feels What She Feels

1 Share

It sounds like science fiction, but the system could help people with brain or spinal cord injuries regain lost abilities.

In 2020, Keith Thomas dived into a pool and snapped his spine. The accident left him paralyzed from the chest down and unable to feel and move his arms and legs. Alone and isolated in a hospital room due to the pandemic, he jumped on a “first-of-its-kind” clinical trial that promised to restore some sense of feeling and muscle control using an innovative brain implant.

Researchers designed the implant to reconnect the brain, body, and spinal cord. An AI detects Thomas’ intent to move and activates his muscles with gentle electrical zaps. Sensors on his fingertips shuttle feelings back to his brain. Within a year, Thomas was able to lift and drink from a cup, wipe his face, and pet and feel the soft fur of his family’s dog, Bow.

The promising results led the team at Feinstein Institutes for Medical Research and the Donald and Barbara Zucker School of Medicine at Hofstra/Northwell wondering: If the implant can control muscles in one person, can that person also use it to control someone else’s muscles?

A preprint now suggests such “interhuman” connections are possible. With thoughts alone, Thomas controlled the hand of an able-bodied volunteer using precise electrical zaps to her muscles.

The multi-person neural bypass also helped Kathy Denapoli, a woman suffering from partial paralysis and struggling to move her hand. With the system, Thomas helped her successfully pour water with his brain signals. He even eventually felt the objects she touched in return.

It sounds like science fiction, but the system could boost collaborative rehabilitation, where groups of people with brain or spinal cord injuries work together. By showing rather than telling Denapoli how to move her hand, she’s nearly doubled her hand strength since starting the trial.

“Crucially, this approach not only restores aspects of sensorimotor function,” wrote the team. It “also fosters interpersonal connection, allowing individuals with paralysis to re-experience agency, touch, and collaborative action through another person.”

Smart Bridge

We move without a second thought: pouring a hot cup of coffee while half awake, grabbing a basketball versus a tennis ball, or balancing a cup of ice cream instead of a delicate snow cone.

Under the hood, these mundane tasks activate a highly sophisticated circuit. First, the intention to move is encoded in the brain’s motor regions and the areas surrounding them. These electrical signals then travel down the spinal cord instructing muscles to contract or relax. The skin sends feedback on pressure, temperature, and other sensations back to the brain, which adjusts movement on the fly.

This circuit is broken in people with spinal cord injuries. But over the past decade, scientists have begun bridging the gap with the help of brain or spinal implants. These arrays of microelectrodes send electrical signals to tailored AI algorithms that can decode intent. The signals are then used to control robotic arms, drones, and other prosthetics. Other methods have focused on restoring sensation, a crucial aspect of detailed movement.

Connecting motor commands and sensation into a feedback loop—similar to what goes on in our brains naturally—is gaining steam. Thomas’s implant is one example. Unlike previous implants, the device simultaneously taps into the brain, spinal cord, and muscles.

The setup first records electrical activity from Thomas’s brain using sensors placed in its motor regions. The sensors send these signals to a computer where they’re decoded. The translated signals travel to flexible electrode patches, like Band-Aids, placed on his spine and forearm. The patches electrically stimulate his muscles to guide their movement. Tiny sensors on his fingertips and palm then transmit pressure and other sensations back to his brain.

Over time, Thomas learned to move his arms and feel his hand for the first time in three years.

“There was a time that I didn’t know if I was even going to live, or if I wanted to, frankly. And now, I can feel the touch of someone holding my hand. It’s overwhelming,” he said at the time. “The only thing I want to do is to help others. That’s always been the thing I’m best at. If this can help someone even more than it’s helped me somewhere down the line, it’s all worth it.”

Human Connection

To help people regain their speech after injury or disease, scientists have created digital avatars that capture vocal pitch and emotion from brain recordings. Others have linked up people’s minds with non-invasive technologies for rudimentary human-to-human brain communication.

The new study incorporated Thomas’s brain implant with a human “avatar.” The volunteer wore electrical stimulation patches, wired to his brain, on her forearm.

In training, Thomas watched his able-bodied partner grasp an object, such as a baseball or soft foam ball. He received electrical stimulation to the sensory regions of his brain based on force feedback. Eventually, Thomas learned to discriminate between the objects while blindfolded with up to over 90 percent accuracy. Different objects felt strong or light, said Thomas.

The researchers wondered if Thomas could also help others with spinal cord injury. For this trial, he worked with Denapoli, a woman in her 60s with some residual ability to move her arms despite damage to her spinal cord.

Denapoli voiced how she wanted to move her hand—for example, close, open, or hold. Thomas imagined the movement, and his brain signals wirelessly activated the muscle stimulators on Denapoli’s arm to move her hand as intended.

The collaboration allowed her to pick up and pour a water bottle in roughly 20 seconds, with a success rate nearly triple that of when she tried the same task alone. In another test, Thomas’s neural commands helped her grasp, sip from, and set a can of soda down without spillage.

The connection went both ways. Gradually, Thomas began to feel the objects she touched based on feedback sent to his brain.

“This paradigm…allowed two participants with tetraplegia to engage in cooperative rehabilitation, demonstrating increased success in a motor task with a real-world object,” wrote the team.

The implant may have long-lasting benefits. Because it taps into the three main components of neurological sensation and movement, repeatedly activating the circuit could trigger the body to restore damage. With the implant, Thomas experienced improved sensation and movement in his hands and Denapoli increased her grip strength.

The treatment could also help people who suffered a stroke and lost control of their arms, or those with amyotrophic lateral sclerosis (ALS), a neurological disease that gradually eats away at motor neurons. To be clear, the results haven’t yet been peer-reviewed and are for a very limited group of people. More work is need to see if this type of collaborative rehabilitation—or what the authors call “thought-driven therapy”—helps compared to existing approaches.

Still, both participants are happy. Thomas said the study gave him a sense of purpose. “I was more satisfied [because] I was helping somebody in real life…rather than just a computer,” he said.

“I couldn’t have done that without you,” Denapoli told Thomas.

The post One Mind, Two Bodies: Man With Brain Implant Controls Another Person’s Hand—and Feels What She Feels appeared first on SingularityHub.



Read the whole story
rtreborb
34 minutes ago
reply
San Antonio, TX
Share this story
Delete

I am sorry, but everyone is getting syntax highlighting wrong

2 Shares

Syntax highlighting is a tool. It can help you read code faster. Find things quicker. Orient yourself in a large file.

Like any tool, it can be used correctly or incorrectly. Let’s see how to use syntax highlighting to help you work.

Christmas Lights Diarrhea

Most color themes have a unique bright color for literally everything: one for variables, another for language keywords, constants, punctuation, functions, classes, calls, comments, etc.

Sometimes it gets so bad one can’t see the base text color: everything is highlighted. What’s the base text color here?

The problem with that is, if everything is highlighted, nothing stands out. Your eye adapts and considers it a new norm: everything is bright and shiny, and instead of getting separated, it all blends together.

Here’s a quick test. Try to find the function definition here:

and here:

See what I mean?

So yeah, unfortunately, you can’t just highlight everything. You have to make decisions: what is more important, what is less. What should stand out, what shouldn’t.

Highlighting everything is like assigning “top priority” to every task in Linear. It only works if most of the tasks have lesser priorities.

If everything is highlighted, nothing is highlighted.

Enough colors to remember

There are two main use-cases you want your color theme to address:

  1. Look at something and tell what it is by its color (you can tell by reading text, yes, but why do you need syntax highlighting then?)
  2. Search for something. You want to know what to look for (which color).

1 is a direct index lookup: color → type of thing.

2 is a reverse lookup: type of thing → color.

Truth is, most people don’t do these lookups at all. They might think they do, but in reality, they don’t.

Let me illustrate. Before:

After:

Can you see it? I misspelled return for retunr and its color switched from red to purple.

I can’t.

Here’s another test. Close your eyes (not yet! Finish this sentence first) and try to remember what color your color theme uses for class names?

Can you?

If the answer for both questions is “no”, then your color theme is not functional. It might give you comfort (as in—I feel safe. If it’s highlighted, it’s probably code) but you can’t use it as a tool. It doesn’t help you.

What’s the solution? Have an absolute minimum of colors. So little that they all fit in your head at once. For example, my color theme, Alabaster, only uses four:

  • Green for strings
  • Purple for constants
  • Yellow for comments
  • Light blue for top-level definitions

That’s it! And I was able to type it all from memory, too. This minimalism allows me to actually do lookups: if I’m looking for a string, I know it will be green. If I’m looking at something yellow, I know it’s a comment.

Limit the number of different colors to what you can remember.

If you swap green and purple in my editor, it’ll be a catastrophe. If somebody swapped colors in yours, would you even notice?

What should you highlight?

Something there isn’t a lot of. Remember—we want highlights to stand out. That’s why I don’t highlight variables or function calls—they are everywhere, your code is probably 75% variable names and function calls.

I do highlight constants (numbers, strings). These are usually used more sparingly and often are reference points—a lot of logic paths start from constants.

Top-level definitions are another good idea. They give you an idea of a structure quickly.

Punctuation: it helps to separate names from syntax a little bit, and you care about names first, especially when quickly scanning code.

Please, please don’t highlight language keywords. class, function, if, elsestuff like this. You rarely look for them: “where’s that if” is a valid question, but you will be looking not at the if the keyword, but at the condition after it. The condition is the important, distinguishing part. The keyword is not.

Highlight names and constants. Grey out punctuation. Don’t highlight language keywords.

Comments are important

The tradition of using grey for comments comes from the times when people were paid by line. If you have something like

of course you would want to grey it out! This is bullshit text that doesn’t add anything and was written to be ignored.

But for good comments, the situation is opposite. Good comments ADD to the code. They explain something that couldn’t be expressed directly. They are important.

So here’s another controversial idea:

Comments should be highlighted, not hidden away.

Use bold colors, draw attention to them. Don’t shy away. If somebody took the time to tell you something, then you want to read it.

Two types of comments

Another secret nobody is talking about is that there are two types of comments:

  1. Explanations
  2. Disabled code

Most languages don’t distinguish between those, so there’s not much you can do syntax-wise. Sometimes there’s a convention (e.g. -- vs /* */ in SQL), then use it!

Here’s a real example from Clojure codebase that makes perfect use of two types of comments:

Disabled code is gray, explanation is bright yellow

Light or dark?

Per statistics, 70% of developers prefer dark themes. Being in the other 30%, that question always puzzled me. Why?

And I think I have an answer. Here’s a typical dark theme:

and here’s a light one:

On the latter one, colors are way less vibrant. Here, I picked them out for you:

Notice how many colors there are. No one can remember that many.

This is because dark colors are in general less distinguishable and more muddy. Look at Hue scale as we move brightness down:

Basically, in the dark part of the spectrum, you just get fewer colors to play with. There’s no “dark yellow” or good-looking “dark teal”.

Nothing can be done here. There are no magic colors hiding somewhere that have both good contrast on a white background and look good at the same time. By choosing a light theme, you are dooming yourself to a very limited, bad-looking, barely distinguishable set of dark colors.

So it makes sense. Dark themes do look better. Or rather: light ones can’t look good. Science ¯\_(ツ)_/¯

But!

But.

There is one trick you can do, that I don’t see a lot of. Use background colors! Compare:

The first one has nice colors, but the contrast is too low: letters become hard to read.

The second one has good contrast, but you can barely see colors.

The last one has both: high contrast and clean, vibrant colors. Lighter colors are readable even on a white background since they fill a lot more area. Text is the same brightness as in the second example, yet it gives the impression of clearer color. It’s all upside, really.

UI designers know about this trick for a while, but I rarely see it applied in code editors:

If your editor supports choosing background color, give it a try. It might open light themes for you.

Bold and italics

Don’t use. This goes into the same category as too many colors. It’s just another way to highlight something, and you don’t need too many, because you can’t highlight everything.

In theory, you might try to replace colors with typography. Would that work? I don’t know. I haven’t seen any examples.

Using italics and bold instead of colors

Myth of number-based perfection

Some themes pay too much attention to be scientifically uniform. Like, all colors have the same exact lightness, and hues are distributed evenly on a circle.

This could be nice (to know if you have OCR), but in practice, it doesn’t work as well as it sounds:

OkLab l=0.7473 c=0.1253 h=0, 45, 90, 135, 180, 225, 270, 315

The idea of highlighting is to make things stand out. If you make all colors the same lightness and chroma, they will look very similar to each other, and it’ll be hard to tell them apart.

Our eyes are way more sensitive to differences in lightness than in color, and we should use it, not try to negate it.

Let’s design a color theme together

Let’s apply these principles step by step and see where it leads us. We start with the theme from the start of this post:

First, let’s remove highlighting from language keywords and re-introduce base text color:

Next, we remove color from variable usage:

and from function/method invocation:

The thinking is that your code is mostly references to variables and method invocation. If we highlight those, we’ll have to highlight more than 75% of your code.

Notice that we’ve kept variable declarations. These are not as ubiquitous and help you quickly answer a common question: where does thing thing come from?

Next, let’s tone down punctuation:

I prefer to dim it a little bit because it helps names stand out more. Names alone can give you the general idea of what’s going on, and the exact configuration of brackets is rarely equally important.

But you might roll with base color punctuation, too:

Okay, getting close. Let’s highlight comments:

We don’t use red here because you usually need it for squiggly lines and errors.

This is still one color too many, so I unify numbers and strings to both use green:

Finally, let’s rotate colors a bit. We want to respect nesting logic, so function declarations should be brighter (yellow) than variable declarations (blue).

Compare with what we started:

In my opinion, we got a much more workable color theme: it’s easier on the eyes and helps you find stuff faster.

Shameless plug time

I’ve been applying these principles for about 8 years now.

I call this theme Alabaster and I’ve built it a couple of times for the editors I used:

It’s also been ported to many other editors and terminals; the most complete list is probably here. If your editor is not on the list, try searching for it by name—it might be built-in already! I always wondered where these color themes come from, and now I became an author of one (and I still don’t know).

Feel free to use Alabaster as is or build your own theme using the principles outlined in the article—either is fine by me.

As for the principles themselves, they worked out fantastically for me. I’ve never wanted to go back, and just one look at any “traditional” color theme gives me a scare now.

I suspect that the only reason we don’t see more restrained color themes is that people never really thought about it. Well, this is your wake-up call. I hope this will inspire people to use color more deliberately and to change the default way we build and use color themes.

Read the whole story
rtreborb
44 minutes ago
reply
San Antonio, TX
Share this story
Delete

Clean Amazon links

1 Share

A footnote in last night’s post mentioned that the Amazon links therein had been cleaned of cruft. Today, I’ll show the simple automated way I do that.

When I say “cruft,” I mean the unnecessary additions to the URL that are presumably used by Amazon to benefit Amazon rather than you. For example, I just went to Amazon, searched for “homepod,” and clicked the link for a refurbished HomePod mini. This is the URL:

https://www.amazon.com/Apple-HomePod-mini-Black-Renewed/dp/
B0FK8JL74Q/ref=mpsa12?dib=eyJ2IjoiMSJ9.
okyLqpx2YKuwgWlCBKI2sx5DMA0QRhm1CnQPmA4KRzU8prbSTnXdAbE97fG0
tEwplRuboB2VvY5O6X6RZlvBK-MDyqaDNPwuqLUtqglS2gVwxITbCrE-
A5JKngZ9MmPHgucGCJSduRY0Ap3RUqVJy42OrYI9eh-
GcIQn52Fj7NgpN2pv3jyeZBvnCXsUcbFhTREmb2NV66tKI0ccT4OUg.4yYkD
-bBpGy0yyNVWMQnH8ZirFh3NhnFov0B0BZDIQ&dib_tag=se&keywords=
homepod&qid=1760794983&sr=8-2

I’ve added line breaks to make it easier (sort of) to read. I got this using Vivaldi, a browser I downloaded to my phone a while ago but haven’t used to visit Amazon before. It was definitely not signed into my Amazon account. Even so, I wouldn’t be surprised to learn that some part of this monstrous string is tied to me and my current session at Amazon.

Regardless, virtually none of this URL is needed. The key features are the dp at the end of the first line and the alphanumeric string that starts the second line. That string is the product’s ASIN. This simplified URL,

https://www.amazon.com/dp/B0FK8JL74Q

is enough to get to the product page. To go from the long URL to the shorter one, I use this Keyboard Maestro macro:

KM Clean Amazon Link

There’s not much to it. It grabs the URL of the current Safari page1 and puts it on the clipboard. It then does a search-and-replace on the clipboard using this regular expression for searching:

^.*/(?:dp|gp/product)/([^/?]+).*$

Over the years, I’ve noticed that some URLs have the ASIN after gp/product instead of dp, which is why you see the alternative there in the first set of parentheses. The ?: that follows the opening parenthesis means that this is a non-capturing group. What is captured is the ASIN that follows, which is why you see $1 at the end of the replacement regex:

https://www.amazon.com/dp/$1

The last part of the macro is a simple bit of error handling. I’ve noticed that I sometimes run this macro when I’m not on an Amazon page, which would put a URL I don’t want on the clipboard. So this checks the clipboard for the proper form. If it’s right, the Glass sound plays; if it’s wrong, the Basso sound plays and the clipboard goes back to what it was before.

If you download the macro (right click the link so you can save it with a .kmmacros extension) and import it into Keyboard Maestro, it will appear in the Global Macro Group and will be activated. I have it in the Global group because I sometimes use it in Messages or Mail to keep the URL I’m sending short. It’s not just for writing posts.

I should mention that I wrote about a very similar TextExpander abbreviation a decade ago. In that post, I had TextExpander run JavaScript for Automation to get and simplify the URL. I was also somewhat dismissive of using Keyboard Maestro—which I didn’t own back then—for a task like this. Times have certainly changed.


  1. Yes, the long URL is from Vivaldi, not Safari, but I had the same product page open in Safari. The short URL is the same for both because the dp/B0FK8JL74Q part of the long URL is the same for both. 

Read the whole story
rtreborb
1 day ago
reply
San Antonio, TX
Share this story
Delete

Witches

1 Share


(via Fark)
Read the whole story
rtreborb
1 day ago
reply
San Antonio, TX
Share this story
Delete

Why I Stopped Being Anxious About Things Outside of My Control and Started Being Depressed About Things Within My Control

1 Share
Read the whole story
rtreborb
1 day ago
reply
San Antonio, TX
Share this story
Delete
Next Page of Stories