Normal view

There are new articles available, click to refresh the page.
Before yesterdayCodeProject Latest postings for The Lounge

MS Edge VPN: Built-in

Did you know that MS Edge has a built-in VPN?
It automatically applies VPN when you are connected to a public wifi.
Here are some more details[^] which I'm reading now.
I work out of a coffee shop once a week so this is important to me.
I'm trying to figure out :
1. how to know I'm actually protected
2. how "much" i'm protected by this VPN.

It is very interesting that MS is doing this though becuase it seems like the obvious thing to do that no other browser seems to do. Others you have to pay for separate VPN.

Copilot's answer about "Skip to content"

I asked Copilot about the "Skip to content" feature.

My Question
Raddevus asked:
Why has the accessibility feature "skip to main content" become prevalent in my browser in the recent weeks, even though I'd never seen it before in past years?


Copilot Answer
Copilot answered:
The “Skip to Main Content” feature has gained prominence recently due to increased awareness and emphasis on web accessibility. When keyboard-only users interact with a webpage, they rely on the tab key to navigate links. If a page has many links at the top (such as in headers or menus), users must tab through them to reach the main content. The “Skip to Main Content” link allows users to bypass these initial sections and jump directly to the main content, enhancing accessibility12. If you encounter this feature more frequently now, it’s likely because website developers are actively implementing it to improve accessibility for all users. 😊

Ok, whatevs! I know when I'm being gas-lighted (gas-lit?)!! Laugh | :laugh:

The Q-To-That-A (Question To That Answer)

Then why is no one else seeing this feature?
I must be the only one reading web sites, right?

Figured Out How To Recreate It Instantly
1) Go to github.com (or any site that uses the feature):
2) hit your tab key, one time -- you'll see it.
But why does mine recently show it if I don't tab?

Cease & Desist!
No worries, you won't hear about me talking about Skip To Main Content any more.
FYI - I posted a question to AskUbuntu[^] (Stack Exchange site).

Collection of "skip to main content" & request

I've created a compilation of the "Skip To Main Content" images hosted on my web site (so there are no ads or anything when you view the images) - at the bottom of this post.

UPDATE - Just got 2 more Google Drive, and Oreilly books (see images below)

My Discoveries
1. I thought maybe this was only occurring on Brave browser but I have now seen it in MS Edge also.
2. I'm running Ubunut 22.04.4 LTS (maybe this only happens in browsers running on Linux)
3. This "feature" occurs when you've
a. scrolled a bit down a page
b. switch to another tab
c. return to the original page that you scrolled down a bit on.
d. only occurs if the target web site has the "skip to main content" HTML included.
Request
If you've ever seen this "feature" can you please post back and let me know?
I really despise this "feature".
It basically offers no help and I don't believe the front-end devs who implement it really understand what it is supposed to do. It's supposed to help, not require more button clicks.

StackOverflow when running Brave browser
https://newlibre.com/assets/skipToMainContent_SO.png[^]

Microsoft docs when running Brave browser
https://newlibre.com/assets/skiptocontent_ms.png[^]

Github when running MS Edge browser
https://newlibre.com/assets/SkipToMainContent_github.png[^]

Wall Street Journal running MS Edge
https://newlibre.com/assets/skipToMainContent_wsj.png[^]

Google Drive on MS Edge
https://newlibre.com/assets/skiptomaincontent_googledrive.png[^]

Oreilly.com Books on MS Edge
https://newlibre.com/assets/skiptomaincontent_oreilly.png[^]

YAPM: Yet Another Package Mgr

I needed to update my skills with SignalR (real-time updates in your browser) so I can update my articles here on CP.

I just ran through the (very good) Microsoft tutorial: Get started with ASP.NET Core SignalR | Microsoft Learn[^]

It shows you how to use .NET Core (7.x/8.x) to build a SignalR app and that's all good.

But, one of the steps tells you to install the SignalR packages and points you to do the following:

Quote:

In the integrated terminal, run the following commands to install LibMan after uninstalling any previous version, if one exists.

.NET CLI

Copy
dotnet tool uninstall -g Microsoft.Web.LibraryManager.Cli
dotnet tool install -g Microsoft.Web.LibraryManager.Cli


Before I can even think, I can hear myself screaming inside my skull!! Roll eyes | :rolleyes: Yet another package manager!!! Dead | X|

I did not install that tool on my machine.
Instead I went to nuget (already a part of my .NET core system) and got the path to install SignalR:
dotnet add package Microsoft.AspNet.SignalR --version 2.4.3


After that, you have to follow these odd steps to copy the SignalR JS code to your project:

Downloading file https://unpkg.com/@microsoft/signalr@latest/dist/browser/signalr.js...
wwwroot/js/signalr/dist/browser/signalr.js written to disk
Installed library "@microsoft/signalr@latest" to "wwwroot/js/signalr"

I went ahead and traversed to the URL https://unpkg.com/@microsoft/signalr@latest/dist/browser/signalr.js[^] and saved the file in the appropriate location.

I like manual stuff. I don't need no stinkin' new package manager!! Cool | :cool:

Yes, the sample code from the project worked even though I did those steps "manually".

Can you believe there is a new package manager thing?
Oy!

How about :
* Homebrew
* Chocalatey
* NPM
* Yarn


or anyone of these[^]

It's too much!! Laugh | :laugh:

An AI experience via Copilot

ChatGPT
I’ve used ChatGPT (3.5) numerous times
It has written a few bash scripts for me & done a nice job
But for the most part it has just been passable, nothing special.

Copilot
I had not used copilot until just a few minutes ago.
I needed some info on a Arduino / ESP32 BLE (Bluetooth Low Energy) method pAdvertising->setMinPreferred(0x06);

Since I’ve switched to running MS Edge on all my devices and since copilot is built in I decided to ask it about the method (on my iPad).
Copilot gave me such a detailed, thoughtful and well-written answer I instantly thought “hmm…maybe I will never ask a question on SO again.”
copilot answer:
The line of code pAdvertising->setMinPreferred(0x06); sets the minimum preferred connection interval for Bluetooth Low Energy (BLE) advertising. Let me explain further:
Connection Interval:
The connection interval is the time between two consecutive data exchanges (connection events) between a BLE peripheral (like an ESP32) and a central device (such as a smartphone).
It determines how often the devices communicate during an active connection.

Preferred Connection Interval:
The preferred connection interval is a range (in milliseconds) that the peripheral suggests to the central device.
It indicates the desired frequency of communication.
In this case, 0x06 corresponds to a connection interval of approximately 7.5 ms (hex value multiplied by 1.25 ms).
Why Set Preferred Connection Interval?:
Setting the preferred connection interval can help improve communication efficiency.
Some devices (like iPhones) may ignore this suggestion, but it’s still good practice to set it.

Additional Notes:
The pAdvertising->setMinPreferred(0x06); line is often used in ESP32 code to enhance compatibility with iOS devices.
You might also see pAdvertising->setMaxPreferred(0x12); to set the maximum preferred connection interval1.

Remember that the actual connection interval negotiated during the connection setup may differ based on the central device’s capabilities and the peripheral’s suggestions. 😊

1. Yes it included the smiley and I liked that “personal” touch.
2. If you search the Web and SO and even the official arduino site you will not find this documented so Copilot is amazing.
3. With AI like this, who needs SO. Roll eyes | :rolleyes:

I switched to MS Edge (Linux, MacOS, iPad)

I'm now running MS Edge on my MacBook Pro M3 running Sonoma 14.4.1
I'm also running MS Edge on my desktop AMD R5 (12-core) running Ubuntu 22.04.4 LTS.
Also running it on my iPad (iOS) and I really like MS Edge so far.

Sharing history and links across devices is good (if you want to -- you don't have to).

I ran FireFox on all these devices but when I watched videos my Ubuntu desktop would lock sometimes -- became quite often.
Switched to Brave and had an odd issue.
Now I'm trying Edge and so far it's really nice.

I use DuckDuckGo as my default search engine. I try to switch it up: use different OS, different search engine, different "office" suite. Mix it up a bit.

Have you tried Edge? It's better than I expected.
This message posted from MacBookPro and MS Edge.

skip to main content (part 2), anyone else?

I just saw this "feature" show up on stackoverflow (snapshot[^]).j

EDIT --> I think this shared image will show up: https://i.sstatic.net/IYvAfm0W.png[^]

I'm running the Brave browser (chrome-based) and this is a useless feature that is implemented on the server side (in the web page.

Have You Ever Seen This?
Have you ever seen this "feature"? It is very odd.

i'm probably going to switch from Brave soon, because it is so annoying and the only browser I've seen it appear in so far.

skip to main content, browser feature?

NOTE: fixed link
Have any of you noticed this "skip to main content" feature in your browser shown in this snapshot[^].?

I absolutely hate it. I'm running Brave (chrome-based) and the latest release includes this so that it can help you get to the main content, but it does not work properly and it's just something else annoying that you have to click so you can see the content. It makes no sense at all.

It's a Genius-Feature, by half!

On the example page above it moves me to the first sentence of the article, but I was already sitting on the first sentence of the article.

I've tried to discover how to turn it off but it looks like there is no way to turn it off.
I seriously can't believe this is a "feature". This is the functional equivalent of the <blink> tag. Remember that gem?

How many web sites do you visit? Not like the old days.

Reading a very interesting book Read, Write, Own by Chris Dixon (MIT Press)[^] and it got me thinking about how few sites I actually visit these days.

Remember the old days when there were multiple search engines (altavista, askjeeves, yahoo, lycos, etc.)?
Remember those days when you visited actual web sites instead of just scrolling down a feed on social media?

from Read, Write, Own intro...
Starting in the mid-2000s, a small group of big companies wrenched control away. Today the top 1 percent of social networks account for 95 percent of social web traffic and 86 percent of social mobile app use. The top 1 percent of search engines account for 97 percent of search traffic, and the top 1 percent of e-commerce sites account for 57 percent of e-commerce traffic.
Outside of China, Apple and Google account for more than 95 percent of the mobile app store market. In the past decade, the five biggest tech companies grew from about 25 percent to nearly 50 percent of the market capitalization of the Nasdaq-100. Startups and creative people increasingly depend on networks run by megacorporations like Alphabet(parehnt of Google and YouTube), Amazon, Apple, Meta (parent of Facebook & Instagram), and Twitter (rebranded as X) to find customers, build audiences and connect with peers.

The internet got intermediated, in other words. The network went from pemisionless to permissioned.


Well, here's one web site that I stumbled upon yesterday and it really has some great articles: Henrik Warne's blog | Thoughts on programming…[^]

How many sites would you say you visit each day?

I'm probably at about 6-8 :
codeproject
dev.to
stackoverflow
amazon
linkedin
youtube
oreilly (books)
microsoft dev docs
instructables .com
I use duckduckgo for search

That's about it.

Even though everything is about "curated" content now and a lot of people just want "processed media blocks" to tell them what to view, the old days were more fun, I think.

Win10: All That Work On Icons, For What?

Here are some questions that need to be asked about Win10 icons... Laugh | :laugh:

Every time I "pin an app to the Start menu" the system makes the icon "medium" in size.

However, none of the icons enlarge themselves to fill up the space of the "medium" size icon (see snapshot link).

So, there's an empty border around the icon that just takes up space. (See this snapshot[^] of my medium and small icons.)

Is Someone at MS Earning $ When I Resize Icons? Roll eyes | :rolleyes:
So, I always just resize the icon to small size anyways.

It's just extra work.

So, was this just functionality that was never carried out?

Or, do I have to have some magic resolution that makes medium sized icons resize to the space?

Large Icons?
And, where are the large size icons. There's no choice on the menu. Usually when you have small and medium you also have large? Laugh | :laugh:

So, why is there even a choice for medium sized icons, because making them "small" allows me to move them together much more nicely. And medium seems to have no benefit.

Win11
And, is this "fixed" in win11? Do icons fill up the empty space in win11?

Locality of Behavior: term you've been looking for

I was watching a commentary video (Scams In Software Engineering[^]) by Primeagen (funny youtuber who really understands dev and comments on development ideas).

While watching that video he mentions:

“The primary feature for easy maintenance is locality: Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.”
The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code


This is actually something I have been interested in for a long time and why I wrote a recent article here on CP: Is Dependency Injection the Missing Technique That's Holding Your Career Back? [^]

In that article I discuss how that DI causes a redirection of code (lack of Locality Of Behavior) so bad that DI can be quite terrible.
Two Issues
1) Seeing a call to a method DoThatThing(), only to discover that the implementation is in an injected class that is in another assembly and then you have to jump into that assembly to even see what it is doing, is a terrible part about DI.
2) Added on top of that, you have to know how all of the associated classes work to understand how the small piece of code works.

EDIT
Also, this idea of getting Locality of Behavior could be a naive one also. Meaning that only simple problems can have simple code and advanced coding for larger systems may require more obscurity in the code due to necessity of DI, patterns etc.

What do you think?

The Recycle Bin on C:\ is corrupted (win11)

Have any of you seen this error message (looks like this snapshot[^])?

Herself's computer (recently updated to win11) popped up this message on top of the lock screen:
Win11
The Recycle Bin on C:\ is corrupted. Do you want to empty the Recycle Bin for this drive?



I had ran Windows 10 on that same computer for over 3 years and I've never had this problem occur (it's an SSD).

Suddenly, I update the computer to Win11 and now she got this error.
It's quite odd.
It wouldn't allow her to do anything else on the machine until she chose Yes/No but then suddenly the error went away. Confused | :confused:

EDIT / Update
Also, I've looked up how to fix it -- thought it seems to have resolved itself.
I'm not asking how to fix it.
Instead, I'm wondering if this is a "feature" of Win11? Roll eyes | :rolleyes:

Is Anyone Using Unix?: My Findings

For some reason today, I started wondering if anyone (companies specifically) was still using Unix -- any distro from the past which was still considered Unix & being used at a company.
I was assuming that Linux has killed Unix installations and forward development.

I found this: Unix is dead. Long live Unix! • The Register[^]

What is your experience with this? Any company you are working for that is using a Unix distro?
Just curious.

Oh, and I wrote this from my new Mac PowerBook M3 (36GB ram) and maybe macOS is considered Unix?
Not sure, but I'm reading this article now: https://www.howtogeek.com/441599/is-macos-unix-and-what-does-that-mean/[^]

EDIT 2
I thought maybe BSD was still around, but looks like it isn't: Berkeley Software Distribution - Wikipedia[^]

EDIT 3
Very interesting (from that 1st article above):
Quote:
There are two standards that certify UNIX: POSIX and Single UNIX Specification (SUS). SUS is a superset of POSIX. So, something can be POSIX compliant, but that doesn't make it UNIX. However, if something is SUS-compliant, it's a UNIX.

password reset: please commiserate with me

(please note, this is marked as RANT!!)

Been trying to help wife reset password for her ms account.
It's ridiculous! She is signed in on her laptop. She is signed in to her outlook account, but we can't change the password, because we don't know the old one.

So, we ask MS to send her a code to her back up email account -- which I cannot find listed in her account anywhere (and that's just another part of this horrendous story).

MS Expires Code Before You Can Get It
We can log into that backup email account and receive the code, but by the time the code gets there MS has expired the code and says we have to send a new one.


Also, I actually tested the backup email account by sending other email to and from it and it is not that the back up email account is getting stuff slow, it is actually that MS is sending the code slowly.

But, It Gets Worse
Well, they finally sent 5 codes all at once and we got them and luckily the last one worked.
We got into her account. So I went to reset her password, but you need to know the old one.
Ok, they have a "forgot password" option there too and they said they would send a code.

So I went through the form and said send the code, but then MS said, "Oh, you've received too many codes today so try again tomorrow." To which I say WTF?!!!!Mad | :mad:

Here's The Topper

Now I will make fun of even more of this terrible terrible process.

Check out this form (snapshot)[^] and really read what it says.
It has many errors and problematic things.

Note: I had to alter the real characters and email address so I wouldn't give anything away, but the rest of the form is exactly as MS provides it.
And that black vertical line is representing the flashing cursor that you see where you are supposed to type on the line.

All The Errors and Confusions of That Form
The form says (my emphasis),

"To verify that this is your email address, complete the hidden part and click "Send code" to receive your code."

Let's say the email address is :
[email protected]

What do you think you need to type on that line?

They say, "complete the hidden part" which to me means, type the "hidden part".
I think you're supposed to type:
HIDDENLETTERS

But that is not correct!!!Confused | :confused:

You have to type [email protected]

Makes no freaking sense at all.

And, Another Thing

There is no "Send code" button.

There is a "Get code" button. WTF | :WTF:

Oy!!!

Well, I had time to create this rant, because I'm waiting until "tomorrow" to see if they'll send me another code.

By The Way, When's Tomorrow?
"Does anyone really know what time it is?" (ala Chicago)
I wonder if "tomorrow" is 12:01am in my time zone or the server's time zone? Or is "tomorrow", 24 hours later? Is it 24 hours later than my last request which was considered too many requests?

Thank you, for feeling my pain, it helps me cope. Laugh | :laugh:

EDIT : NEW DISCOVERY
If I attempt to log into her account via microsoft.com it automatically sends a code to the backup email. Confused | :confused: I get the code instantly and can log into her microsoft account.

But, then if I try to reset the password. Then it says, "Wait 24 hours". WTF | :WTF:WTF | :WTF:

All high-level classes must depend only on Interfaces

I'm very interested in feedback on this. Yes, it's somewhat related to my latest article[^], but I'm going through what I explain below, right now..

What if you were going to design some new service or app and you were told:
Development Manger:
"All high-level classes must depend only on Interfaces."
What if I told you that and was entirely serious.
Would you balk? or think, "Yes, that is the way it is and should be."

After that your manager says,
Development Manager:
"Something else will decide how to build the implementation which will fulfill the Interfaces."
Would that sound normal to you, or completely crazy? Or somewhere in between?

The Implications
Do you honestly understand the implications?

No Implementation Code
One of the implications is that the code Service or App you are creating basically has no implementation code in it. (Or very little.)
Why?
Because your high-level app only depends on easily-replaceable Interfaces.
That means if you want to see the implementation, you'll need to go to the Library (probably a separate project) which contains the implementation that is used to fulfill the Interface.

How do you feel about that?

Do you know how crazy it is to look at project that has been designed this way?
Have you ever experience a project that is carried out like this?

Why I'm Thinking About This Even More?
I have just completed 50 pages (of a total of 241) of the very old book (2013) DependencyInjection With Unity (free PDF or EPUB at link)[^].

Opposite of Spherical Cows? Inventor's Paradox

Wow, while reading the wikipedia entry for Dependency inversion principle - Wikipedia[^] I stumbled upon...

The Inventor's Paradox[^], which states:
From wiki entry:
"The inventor's paradox is a phenomenon that occurs in seeking a solution to a given problem.
Instead of solving a specific type of problem, which would seem intuitively easier, it can be easier to solve a more general problem, which covers the specifics of the sought-after solution."

Very interesting, because this often explains why problems take longer than expected to solve.
You're actually solving an entire classification of problems.

This also made me think about the Spherical Cow[^] solution (kind of the opposite):
from wiki entry
Milk production at a dairy farm was low, so the farmer wrote to the local university, asking for help from academia.

A multidisciplinary team of professors was assembled, headed by a theoretical physicist, and two weeks of intensive on-site investigation took place. The scholars then returned to the university, notebooks crammed with data, where the task of writing the report was left to the team leader.

Shortly thereafter the physicist returned to the farm, saying to the farmer, "I have the solution, but it works only in the case of spherical cows in a vacuum."
❌
❌