|
Nice!
Thanks for sharing
|
|
|
|
|
honey the codewitch wrote: a whole bunch of extra RAM and CPU I don't need That's it. We've had enough of your heretical notions, witch.
Software Zen: delete this;
|
|
|
|
|
Glad to see your post. It reaffirms my decision to only work with business applications
|
|
|
|
|
I mean, when it comes down to it, nothing wastes hardware like business apps. Throw .NET at something and it costs 30% of your CPU bandwidth compared to C++
Then you have endless frameworks where maintainability and compliance are more important than performance.
Add to that the notion that hardware is cheaper than software.
IoT waste has nothing on bizdev.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I concur strongly… working on heavy business application where I need to allow parallel run between a legacy system and its replacement. I have to deal with 15 processes written by 5 different devs. One person did a little refactoring earlier which is helping a lot.
|
|
|
|
|
Don't get me wrong - there's not anything terribly wrong with the approach - it can be cost effective or it wouldn't be done so often. It's just sometimes shocking when you stop and think about all the CPU cycles and RAM that never needed to be used.
"hardware is cheaper than software" is more accurately "something already developed and tested is cheaper than something still in development", but the former, while more specific, is easier to fit on a bumper sticker.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: Then you have endless frameworks where maintainability and compliance are more important than performance.
This is always true, even when working on bleeding-edge high performance computing. Always keep in mind that we don't write code for the CPU, but for our fellow developers.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It's not always true with IoT.
Sometimes you have to count CPU cycles.
For example, when bitbanging a USB host interface.
Recently I had to dynamically generate machine code and execute it.
The only alternative was the code not working at all.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I'm certain that you documented the obscure code thoroughly, so any maintainer (or yourself, a few months down the line) would be able to follow it.
Your code was written for humans, not for the CPU.
QED
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I guess we delineate differently.
I consider documentation separate from code, because in most cases code should be self documenting. Comments are "out of band information" in my view. Yes, included they make up the functional codebase, so I see where you are coming from, but for me, I see comments as existing in spite of the code - where the code itself couldn't do the entire job.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Last time I encountered this situation, I simply used a "PIC Micro".
There's a staggering number of the darn things, with just about every possible conceivable peripheral on that you can think of.
They range in price from hundreds of $$ per unit, right down to a fraction of a cent per unit.
I had a look through the device matrix:
https://www.microchip.com/en-us/parametric-search.html/717
and eventually after a good chunk of comparing specs, I settled on an 8 bit, I think it was in the 16F series that had the absolute basics on that I needed, 6 gpio with configurable pin routing, I2C and USB peripherals, and essentially made myself an I2C accessible USB port which I then just connected to my ESP32 as an I2C gadget.
Programming PIC's is very straight forward, it's a pretty standard serial protocol, not much different to the one used on the arduino. Personally I do actually have a "Pic-KIT 3" (And a 2) programmer. But the specs are all public domain, so to be fair you could probably use a modified arduino programmer to do the job.
The core dev language is in C just like the Arduino, and MPLAB and all the associated compilers can be freely downloaded from Microchip.
Finally, Microchip will actually allow you to request 10 sample devices free, per year (or is it per month.. again I can't remember) , so if you find a bunch of possible's from the device matrix, they will actually send you one each of those devices free to test your design before ordering.
I've done numerous projects over the years, using PIC's alongside arduino's and ESP32's (and others, even rPI's) and they usually work out really well.
|
|
|
|
|
This week I tried to upgrade our Postgres 10 Windows installation to Postgres 14, following the official instructions here:
PostgreSQL: Documentation: 14: pg_upgrade[^]
Sadly this turned out to be no walk in the park, and cost me several days to get it working.
First problem was this command: RUNAS /USER:postgres "CMD.EXE"
We don't have a Windows user "postgres" on our installations, and as far as I known the default install does not create one !
Finding helpful information on the internet was not easy, a lot of articles appear to be Linux only and the authors don't even bother to mention which platform they are using.
Bypassed the user problem, by skipping the RUNAS command and setting an environment variable PGPASSWORD=xxxxxxx
Similar to the example here:
windows - Error: Consult the last few lines of "pg_upgrade_dump_1.log" - Stack Overflow[^]
But although there could be no rights problems as I had given all rights to the Postgres directories, still got an error at the end of the upgrade process.
It turned out to be an encryption problem, the old pg_hba.conf file used "md5" and the new pg_hba.conf used a default setting of "scram-sha-256".
See answer here: postgresql - upgrade from postgres 12 to 13 causes user authority problem - Stack Overflow[^]
Changed all occurrences of "scram-sha-256" to "md5", and everything worked!
|
|
|
|
|
md5 is pretty vulnerable. That's almost certainly why they changed it. Be careful.
To err is human. Fortune favors the monsters.
|
|
|
|
|
The idea was indeed that upgrading was needed for security reasons, so that will be the next step.
But first a well deserved rest after all this hard labour!
[Edit]
It seems we are in luck: Quote: Beginning with Postgres 10, you can change your PostgreSQL password authentication to SCRAM-SHA-256, which is a more secure authentication method than md5 and plain password. Change PostgreSQL Password Authentication to SCRAM-SHA-256[^]
modified 4-Jun-22 6:47am.
|
|
|
|
|
Having upgraded from earlier versions of postgres since at least v 7.1, the way I have always found is the easiest way to do it, no matter what the platform is as follows:
1) Install the new version that you want to upgrade too, in a different location (File system wise) and listening on a different TCP port to the old instance.
2) Configure the Postgres pg_hba.conf file to allow the terminal your working from full access (The MD5 warnings are valid here), MD5 is fine if the server is not exposed to the internet as you are only allowing this access for the duration of the upgrade, if you make the access address have an IP V4 address with a 32 bit mask, no one except your workstation will be able to access it anyway...
3) Configure an second access in pg_hba.conf that allows the IP address of the already running older postgres server to also access the new one.
4) use "pg_dump -U postgres -h oldpgip -p oldpgport dbname | psql -U postgres -h newpgip -p newpgport dbname" to copy directly from the old DB to the new DB, make sure that ALL apps using the old db are shut down and inactive before you do this.
5) Wait.... possibly a long time.... I usually do things like this overnight....
6) Once the transfer is complete, shut down the old instance and remove it (After first testing the new instance has the data in it etc) then if you desire configure the new instance to have be on the same port/IP etc as the old one.
This trick will work on a machine where both servers are on the same machine, and that's even better because you can then just assign the pg_hba entries with IP=127.0.0.1/32 with trust authentication, then use the PG command line tools on the same box. Just make sure you configure the data directories to be separate from each other.
This is great in another respect too, because as long as you have the required add on extensions installed for the new version (EG: PostGIS) then this will transfer across all the required statements to re-add user accounts, extension objects, data types you name it.
|
|
|
|
|
Thanks, useful information!
But my problem is that I have to do it all programmatically from C#, got this working already and it is in the testing phase. If there is enough interest (don't get the impression) I could be persuaded to write a CodeProject article about it
|
|
|
|
|
no worries rick, just thought I'd mention that's the way it's worked for me all these years.
However, if you have to do this in C#, you might want to take a look at the latest version of NpgSQL and the fact if now supports bulk upload/download in a binary format
basically, you would skip the PG dump step and replace that with your tool using NpgSQL.
I wrote the syncfusion eBook on postgres years ago (And if I'm being honest, it needs an update ), anyway... point being, feel free to ask me if you have any PG queries...
|
|
|
|
|
Wordle 350 6/6
⬜⬜⬜⬜⬜
⬜🟨🟨⬜⬜
⬜🟨🟩🟨⬜
🟨🟩🟩⬜⬜
⬜🟩🟩🟨🟨
🟩🟩🟩🟩🟩
Just managed.
|
|
|
|
|
Wordle 350 4/6
⬜⬜⬜⬜⬜
⬜🟨🟨🟩🟩
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
4 again...
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Wordle 350 4/6
🟨⬜⬜⬜⬜
⬜🟨🟩⬜🟨
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 350 5/6*
⬜🟩⬜⬜⬜
⬜🟩⬜⬜⬜
🟨🟩🟩⬜⬜
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 350 3/6
⬜🟩⬜⬜⬜
🟨🟩⬜⬜⬜
🟩🟩🟩🟩🟩
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 350 4/6
⬜⬜🟨🟩⬜
🟨⬜⬜⬜⬜
🟩🟩🟩⬜⬜
🟩🟩🟩🟩🟩
I didn't know this word, got lucky on my third guess.
|
|
|
|
|
How can you guess a word if you don't know it?
If you did, I would say you (re)invented it
|
|
|
|
|
Because I have 4/5th or 3/5th of the word, and any other letter wouldn't make sense
In this case, I had "fro" and some spare letters.
I know it's not "froqx" or something like that, but "th" is a valid end of word and "froth" sounds like it may be an existing word.
So I tried "froth" and it worked, but it's a bit of (educated) trial and error sometimes.
|
|
|
|