โŒ

Normal view

There are new articles available, click to refresh the page.
Yesterday โ€” 9 May 2024CodeProject Latest postings for The Lounge

Wordle 1,055 6/6*

Wordle 1,055 6/6*

โฌ›โฌ›โฌ›โฌ›๐ŸŸจ
โฌ›โฌ›โฌ›๐ŸŸจ๐ŸŸจ
๐ŸŸจ๐ŸŸฉโฌ›โฌ›โฌ›
โฌ›๐ŸŸฉโฌ›โฌ›๐ŸŸจ
โฌ›๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ

An AI experience via Copilot - #2

So, I'm extremely annoyed at MS these days. Every dang OS update I get some new advertising, etc. Anyway, so I decided to give Copilot (preview) a swing. Now, call me paranoid - I actually believe that corporations collecting data on us is completely out of control - with that said, I cannot run Copilot queries unless I'm logged into my MS account. There can only be one reason for that...
Charlie Gilley

โ€œThey who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.โ€ BF, 1759

Has never been more appropriate.

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:

Manual vs computerized business processes.

The IT segment catering to the latter of the subject, is the ERP segment.

Businesses still continued before computers, based on paper, file based manual systems. This comprise a host of activities like invoicing, physical stock,...etc.

A typical invoicing program would be in the range of several thousand lines of code, resulting in not less than around 10 man days.

Well that is the time it takes to INSTRUCT THE COMPUTER
to carry out the invoicing activity.

How long will it take to train a human to carry out the task of invoicing? Well if that human is smart, may be an hour or less. But let's say that it be one day(8 to 5).

So we are saying that we coders are dumb!!!! We are taking 10 times the time to code than the time to train!!!! How can that be?

Well, a human has a mind which can be trained. Well give the machine a mind. Real Mind, not AM(Artificial Mind).

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:

My boss's (sic?) favorite expressions...

Just sharing, rated "lounge SAFE " (MY opinion )
This rant contains no programming or instructions.

..if I want your opinion, I'll ask for it - more true today
...that and a dime will get you cup of coffee - monetary obsolete
.. here is a dime, call somebody who cares.. technologically obsoleted , he refered to payphone

Once again - "If it's Boeing, it ain't going"

Less than an hour after the Boeing/ULA rep made the (provably false) statement on live NASA TV that Starliner was riding on top of the most reliable rocket ever built, the launch was scrubbed due to an oxygen valve failure in the 2nd stage.

The slogan used to be "If it ain't Boeing, I ain't going". They lost this when they removed engineers from the C-Suite.

Changed state doesn't stick

Microsoft...please fix this. Is anyone else seeing this behavior?

I'm using the "new" Outlook client that is now bundled nowadays with a default Windows 10 installation. It's much better than the previous generic email client that was included, but this in particular bothers me.

The client downloads the content of my inbox. Some messages are marked as read, others as unread. I manually mark everything as read. I don't even shut down the app, I leave it running in the background all the time.

When the mailbox is refreshed, the messages that I explicitly marked as read revert back to unread. It's like it's not even relaying the fact that messages are now read back to the server, so the refresh undoes my changes.

THIS IS ONLY FOR GMAIL ACCOUNTS. I'm also using the same client to fetch accounts from hotmail.com, outlook.com, yahoo.com, and those all work correctly. Only the Gmail accounts exhibit this behavior.

Has anyone else seen this?

[Edit]
I suspect if I go to the actual gmail site and mark the unread items as read, the local account might fix itself (I haven't tried it yet), but the whole point of having a client that can manage multiple mailboxes is to avoid using the web interface (yuck!).

[Edit 2]
WTH...if I shut down the app and reload it, it now remembers I've changed messages from unread to read. So, it doesn't bother persisting that until you shut down, and refreshing the mailbox takes precedence over what the client is tracking...?

Did you miss me?

Just got back from a vacation in Poland.
Second time I've been there, great country!
My girlfriend is from Poland (this was my first time with her) so I guess I'll be going more often.

We were staying in Krakow, which is a beautiful city, or at least the city center is.
Been to Auschwitz and it's even worse than what you see on TV WTF | :WTF:
Salt mine Wieliczka was very impressive as well (but not in a maximum killing capacity kind of way).
We also went to Energylandia, great if you like roller coasters, which I do!
From my previous visit I can also recommend Malbork, largest castle in the world.

The "in-laws" are nice too, even though I can't really talk to them.
Can see myself going back again Smile | :)

Kinda wish I knew more about "AI"

But I can't be arsed to learn it.

I do have an idea though - using an LLM to do code synthesis.

Code synthesis is similar to code generation, but unlike code generation code created via code synthesis looks as though it was written by a human being.

This is particularly important for things like parser generators, where generated code tends to be rigid. For example - a generated LL(1) parser always matches greedy while a hand rolled recursive descent parser will switch between greedy and lazy consumption as the situation calls for it. The end result is more compact and more efficient.

I don't recommend using parser generators because of the code they produce - unless you like source files in the hundreds of thousands of kilobytes or even megabytes. Code synthesis stands a good chance of changing that.

Things like Github Copilot can produce code. Code synthesis seems like this functionality.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
Before yesterdayCodeProject Latest postings for The Lounge

Wordle 1,052

Wordle 1,052 6/6

๐ŸŸจ๐ŸŸจ๐ŸŸฉโฌ›โฌ›
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉโฌ›๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉโฌ›๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉโฌ›๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉโฌ›๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ

Welp, that was interesting.
Jeremyย Falcon
โŒ
โŒ