Ontopic Random Computer-Electronics Thread

wetwille

Butt Hamster
May 24, 2018
13,423
15,442
323
60
Mid MIchigan
Marklar
₥53,753.48
Marklar
M53,753
In fairness, here's how I'd write it in C.

Code:
#define STATE_COUNT 52

char *alaska_str = "alaska";
char *alaska_abbr_str = "AK";
char *alabama_str = "alabama";
char *alabama_abbr_str = "AB";
// ...

char *state_names[STATE_COUNT] = [
  alaska_str,
  alabama_str,
// ...
];

char *state_abbrs[STATE_COUNT] = [
  alaska_abbr_str,
  alabama_abbr_str,
  // ...
];

char *state_abbr(char *state_name) {
  for (int state = 0; state < STATE_COUNT; state++) {
    if (strcmp(state_name,state_names[state]) == 0) {
      return state_abbrs[state];
    }
    // assume if someone can't spell their state, they're from florida
    return florida_abbr_str;
  }
}
I'm sorry my dear CANADIAN - but Alabama is "AL". ;)
 

Domon

enjoys a good porkin'
May 19, 2011
42,761
25,366
723
Marklar
₥43,115.69
Marklar
M43,116
aww. The ethernet i ran as an afterthought to the outbuildings like 10 years ago when i trenched power and water to em is no good.

I just tossed a cable in the trench, not rated for outdoor or anything. Finally hooked something up to it today (mesh access point to cover up to the front acre), and no go. On first test i had 3 out of 8 conductors not registering, i cut away an area where the outer cable had uv degraded and got to 8/8 conductors, but the light on the cable tester is super dim, and the cable wont transmit data or power.

Oh well. Ill just have to use the thing in mesh mode where it can wirelessly downlink to the house.

There was one more section of cable damaged that i could cut away and terminate behind it, i suppose i could give that a shot before i give up. the underground portio nactually seems in great shape. PVC shealthing is still flexible and looks good. Who knows if its all oxidized inside though
 
  • Sad
Reactions: wetwille

fly

Osharts 11
Oct 1, 2004
68,936
21,307
1,073
Marklar
₥46,624.23
Marklar
M46,624
Steam
mattressfish
aww. The ethernet i ran as an afterthought to the outbuildings like 10 years ago when i trenched power and water to em is no good.

I just tossed a cable in the trench, not rated for outdoor or anything. Finally hooked something up to it today (mesh access point to cover up to the front acre), and no go. On first test i had 3 out of 8 conductors not registering, i cut away an area where the outer cable had uv degraded and got to 8/8 conductors, but the light on the cable tester is super dim, and the cable wont transmit data or power.

Oh well. Ill just have to use the thing in mesh mode where it can wirelessly downlink to the house.

There was one more section of cable damaged that i could cut away and terminate behind it, i suppose i could give that a shot before i give up. the underground portio nactually seems in great shape. PVC shealthing is still flexible and looks good. Who knows if its all oxidized inside though
I'm shocked that you didn't do it correctly. I mean, why the fuck did you half ass it???
 

Josh

Biff Clurton
Oct 9, 2006
6,787
2,953
273
37
Marklar
₥6,122.72
Marklar
M6,123
aww. The ethernet i ran as an afterthought to the outbuildings like 10 years ago when i trenched power and water to em is no good.

I just tossed a cable in the trench, not rated for outdoor or anything. Finally hooked something up to it today (mesh access point to cover up to the front acre), and no go. On first test i had 3 out of 8 conductors not registering, i cut away an area where the outer cable had uv degraded and got to 8/8 conductors, but the light on the cable tester is super dim, and the cable wont transmit data or power.

Oh well. Ill just have to use the thing in mesh mode where it can wirelessly downlink to the house.

There was one more section of cable damaged that i could cut away and terminate behind it, i suppose i could give that a shot before i give up. the underground portio nactually seems in great shape. PVC shealthing is still flexible and looks good. Who knows if its all oxidized inside though
Probably full of water esp if it was not direct burial, gel-filled.
 

fly

Osharts 11
Oct 1, 2004
68,936
21,307
1,073
Marklar
₥46,624.23
Marklar
M46,624
Steam
mattressfish
I'm thinking of migrating my home server to Unraid. Initially, I would just pass all the disks through to the Windows OS, with the eventual goal of running (docker?) VMs for all the tools and shit. According to some of their docs and posts, it seems drive performance will decrease and some posts seem to indicate that it will decrease by a lot. Any one of you fucks have any idea if that is true?
 

Domon

enjoys a good porkin'
May 19, 2011
42,761
25,366
723
Marklar
₥43,115.69
Marklar
M43,116
I'm thinking of migrating my home server to Unraid. Initially, I would just pass all the disks through to the Windows OS, with the eventual goal of running (docker?) VMs for all the tools and shit. According to some of their docs and posts, it seems drive performance will decrease and some posts seem to indicate that it will decrease by a lot. Any one of you fucks have any idea if that is true?
I planned to do this for a while, but never did.

not like your drive performance is anything to call home about anyway. Are you concerned about reads or writes? Writes can be taken care of with a cache drive in unraid, but reads are what they are.

I havent seen any documentation on performance degredation though.

Ask yourself what you would gain if you're gonna run shit in a windows vm anyway. Dockerization is nice for isolation, but adds complexity... and windows supports docker containers natively anyway now... so why throw an unraid layer in there.
 

fly

Osharts 11
Oct 1, 2004
68,936
21,307
1,073
Marklar
₥46,624.23
Marklar
M46,624
Steam
mattressfish
I planned to do this for a while, but never did.

not like your drive performance is anything to call home about anyway. Are you concerned about reads or writes? Writes can be taken care of with a cache drive in unraid, but reads are what they are.

I havent seen any documentation on performance degredation though.

Ask yourself what you would gain if you're gonna run shit in a windows vm anyway. Dockerization is nice for isolation, but adds complexity... and windows supports docker containers natively anyway now... so why throw an unraid layer in there.
The goal would be to get rid of Windows altogether. Hell, I'd like to get rid of my Windows workstation too, ideally just run a linux VM on the Unraid server that a remote into from an RPi or something. Either way, that's a long way down the road. The first step is to migrate the server.

And yeah, I'm not too concerned about drive performance unless it means it will be REALLY bad, meaning people can't stream shit, and that's what I'm asking about. Finally, at least with my limited exposure, Windows Docker sucks.
 

Domon

enjoys a good porkin'
May 19, 2011
42,761
25,366
723
Marklar
₥43,115.69
Marklar
M43,116
The goal would be to get rid of Windows altogether. Hell, I'd like to get rid of my Windows workstation too, ideally just run a linux VM on the Unraid server that a remote into from an RPi or something. Either way, that's a long way down the road. The first step is to migrate the server.

And yeah, I'm not too concerned about drive performance unless it means it will be REALLY bad, meaning people can't stream shit, and that's what I'm asking about. Finally, at least with my limited exposure, Windows Docker sucks.
Where you gonna put all your data if you convert? Drives gotta be reformatted to XFS, and its a funky unraid version of XFS.
 

OzSTEEZ

¡ɟɟo ʞɔnɟ ʇunɔ 'ᴉO
Nov 11, 2008
34,694
9,024
473
39
Oz
Marklar
₥25,442.40
Marklar
M25,442
Go look at the code I posted.

First one is gonna be as slow or slower than the original if/then/else code that got posted, which will likely compile to the same machine code as a switch statement anyway. Second code was arguably fast but unsafe as shit, and looking at it again, doesn't even work. Third code is even unsafer, and requires a 26^6 (308.9M entry) lookup table.

And the purpose of those three bits of code? to convert a state to an abbreviation. How many times does a function like that actually get hit? Is it going to remove 25% of the servers out of a data center and save megawatts of power to optimize a dumb function like that?

but nooooo, this is a SERIOUS argument about NANOSECONDS
I was never going to review the code to check for seriousness. Especially when you are joking about something that's a huge problem in the industry.

I don't really care as I will never write another line of code again. Woohoo!