Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Trapick
Apr 17, 2006

Docker in Mac OS can definitely run linux containers, can't speak to others.

Adbot
ADBOT LOVES YOU

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Docker for Mac/Windows integrate a hidden Linux VM and run containers on Linux within that VM. The docker executable abstracts away the differences. Docker for Windows can also run Windows based containers, but everybody can run Linux due to that VM.

carry on then fucked around with this message at 02:03 on Mar 28, 2019

downout
Jul 6, 2009

The Fool posted:

Docker for windows can run linux and windows containers.

Docker for linux can only run linux containers.

Can't speak for Mac OS, but probably only linux containers.

Ya pretty sure Mac is just linux underneath. edit: I'm wrong - see above.

KOTEX GOD OF BLOOD
Jul 7, 2012

I am a big dumb Squarespace baby trying to use some custom CSS to accomplish something from this solution. I would ask the guy myself but I don't have the "reputation" (gently caress you stack exchange.)
code:
#block-yourblockid .archive-group-name-link:not([href$='Your Category']) {
  display: none;
}

#block-yourblockid .archive-group-name-link:not([href$='Your Category']) + * {
  display: none;
}
This works fine if the category is one word, but if it's two words with a space (like 'Your Category',) doesn't seem to work. I tried using double quotes instead of single quotes and that didn't help. It's also not clear how one would use this for multiple categories, or to exclude showing a category.

The Fool
Oct 16, 2003


KOTEX GOD OF BLOOD posted:

I am a big dumb Squarespace baby trying to use some custom CSS to accomplish something from this solution. I would ask the guy myself but I don't have the "reputation" (gently caress you stack exchange.)
code:
#block-yourblockid .archive-group-name-link:not([href$='Your Category']) {
  display: none;
}

#block-yourblockid .archive-group-name-link:not([href$='Your Category']) + * {
  display: none;
}
This works fine if the category is one word, but if it's two words with a space (like 'Your Category',) doesn't seem to work. I tried using double quotes instead of single quotes and that didn't help. It's also not clear how one would use this for multiple categories, or to exclude showing a category.

href$ is going to be selecting on the last portion of a link. It's likely that instead of a space it will be "Your%20Category", look at the actual links squarespace is generating to check.

You should be able to select multiple categories like this:
code:
#block-yourblockid .archive-group-name-link:not([href$='Your%20Category1'],[href$='Your%20Category2']) {
  display: none;
}

#block-yourblockid .archive-group-name-link:not([href$='Your%20Category1'],[href$='Your%20Category2']) + * {
  display: none;

KOTEX GOD OF BLOOD
Jul 7, 2012

Oh I figured this out, it uses a "+" instead of a space. Your solution for multiple categories works great. Thanks a lot!

NecroBob
Jul 29, 2003
Anyone here know where to find best practices when developing a MS SQL Server Analysis Services tabular data model, or know of any best practices themselves?

I created and have been maintaining our data model at work for the last 2.5 years. It works, management gets their reports, and they're happy. I have refactored it a couple times, but I always feel like I'm doing something wrong, or could improve it somehow.

I know it's a little niche, but really just looking for some pointers.

duck monster
Dec 15, 2004

downout posted:

Ya pretty sure Mac is just linux underneath. edit: I'm wrong - see above.

Its a mutant BSD kernel over a Mach microkernel. Apple to their credit does open source the kernel (Darwin). It'd be nice if they ported over BSD's lunix compatibility layer, but they've never shown any interest in doing so.

Docker for Mac just spins up a background VirtualBox. Its crufty, but it works reliably well.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

NecroBob posted:

Anyone here know where to find best practices when developing a MS SQL Server Analysis Services tabular data model, or know of any best practices themselves?

I created and have been maintaining our data model at work for the last 2.5 years. It works, management gets their reports, and they're happy. I have refactored it a couple times, but I always feel like I'm doing something wrong, or could improve it somehow.

I know it's a little niche, but really just looking for some pointers.

There's a dedicated SQL thread that might have better ideas:
https://forums.somethingawful.com/showthread.php?noseen=0&threadid=2672629

I might have a similar question in future as we transition to a dedicated report services model too!

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

duck monster posted:

Its a mutant BSD kernel over a Mach microkernel. Apple to their credit does open source the kernel (Darwin). It'd be nice if they ported over BSD's lunix compatibility layer, but they've never shown any interest in doing so.

Docker for Mac just spins up a background VirtualBox. Its crufty, but it works reliably well.

What is crufty about it?

The Fool
Oct 16, 2003


carry on then posted:

What is crufty about it?

Because you're running your containers in a vm in virtualbox.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

The Fool posted:

Because you're running your containers in a vm in virtualbox.

1. It's not virtualbox.
2. What do you propose for providing a fully compatible Linux kernel instead?

The Fool
Oct 16, 2003


carry on then posted:

1. It's not virtualbox.
2. What do you propose for providing a fully compatible Linux kernel instead?

1. Sorry, hyperkit, which is better I suppose.
2. Actually use linux.


that's not to say I think there is a better way to run docker on mac or windows, just that it is adding another layer to the stack, which does indeed bring it into the 'crufty' territory.

mystes
May 31, 2006

All the cool kids are using kernel translation layers in 2019.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

The Fool posted:

1. Sorry, hyperkit, which is better I suppose.
2. Actually use linux.


that's not to say I think there is a better way to run docker on mac or windows, just that it is adding another layer to the stack, which does indeed bring it into the 'crufty' territory.

lmao there it is

No.

luchadornado
Oct 7, 2004

A boombox is not a toy!

It might feel crufty when you say it out loud, but have you ever noticed it or have a problem with it? I've been using Docker extensively at home and work for years and it's never been something I thought about.

If that level of cruftiness bothers you, don't ever look into how OSs, programming languages, etc. work. You're surrounded by abstractions that are both useful for ergonomics and have imperceptible performance ramifications.

Linear Zoetrope
Nov 28, 2011

A hero must cook

Thermopyle posted:

To expand on what rjmccall said, I wouldn't be surprised if there's edge cases where updating Rust like leaves you in some weird state. Other languages just avoid that whole hassle by not doing it.

I'm sure you could update Python without an uninstall, it would just require a lot of careful handling without being 100% confident you handled all cases of mishap.

It's possible, but Rustup isn't really doing anything complicated anyway. All the Rust executables (including optional components like clippy) and documentation live in a .cargo directory in your home folder, and when installing multiple toolchains all the tool does is download and extract what it will put in there into a .rustup. Switching toolchains is literally just wiping everything in the .cargo directory and cping the files from the proper directory under .rustup. In fact, the recommended way to uninstall Rust (on Unix-likes) is literally just rm -rf ~/.rustup ~/.cargo and removing the line export "PATH=$HOME/.cargo/bin:$PATH" from your .bashrc/.bashprofile etc. The only non-rudimentary thing I think it backs up is the download cache for that version, and I think if compiling a cached version fails Rust tries redownloading before it gives up so it's pretty fault tolerant. I'm sure you could gently caress it up by indiscriminately scribbling in or messing with things in either directory, but the only automatic way anything is likely to screw up is probably legitimate file corruption.

Linear Zoetrope fucked around with this message at 21:34 on Mar 30, 2019

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I'm doing more weird combinatorics stuff, and I'm wondering if there's a good algorithm for finding the i'th permutation of a multiset (in O(n) time for a length n word) as well as the inverse operation, given a "word" to tell what index 'i' it would correspond to. The actual ordering used to determine 'i' doesn't matter to me as long as it works for all permutations (0 < i <= the multinomial coefficient for the multiset).

edit: nevermind, figured it out

peepsalot fucked around with this message at 01:14 on Apr 1, 2019

Mr Shiny Pants
Nov 12, 2012

peepsalot posted:

I'm doing more weird combinatorics stuff, and I'm wondering if there's a good algorithm for finding the i'th permutation of a multiset (in O(n) time for a length n word) as well as the inverse operation, given a "word" to tell what index 'i' it would correspond to. The actual ordering used to determine 'i' doesn't matter to me as long as it works for all permutations (0 < i <= the multinomial coefficient for the multiset).

edit: nevermind, figured it out

Now I am curious. :)

Why and how?

duck monster
Dec 15, 2004

The Fool posted:

1. Sorry, hyperkit, which is better I suppose.
2. Actually use linux.


that's not to say I think there is a better way to run docker on mac or windows, just that it is adding another layer to the stack, which does indeed bring it into the 'crufty' territory.

Hyperkit is a management layer that wraps around virtualbox.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

duck monster posted:

Hyperkit is a management layer that wraps around virtualbox.

Not on macOS it doesn’t.

And Docker for Windows uses Hyper-V. Where are you getting VirtualBox from? The only thing that uses that is Minikube.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



carry on then posted:

Not on macOS it doesn’t.

And Docker for Windows uses Hyper-V. Where are you getting VirtualBox from? The only thing that uses that is Minikube.

I thought most people used VirtualBox because a lot of containers don't support Hyper-V, but I'm basing that on some poking around I did ~3 years ago, so IDK what the facts on the ground are now.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Munkeymon posted:

I thought most people used VirtualBox because a lot of containers don't support Hyper-V, but I'm basing that on some poking around I did ~3 years ago, so IDK what the facts on the ground are now.

No one uses virtualbox.

When you install Docker for Windows it sets up a Hyper-V machine.

Really, unless you're curious and poked around you'd never know what Docker was doing, because you just use it and its all completely transparent to the user.

The Fool
Oct 16, 2003


Thermopyle posted:

No one uses virtualbox.

When you install Docker for Windows it sets up a Hyper-V machine.

Really, unless you're curious and poked around you'd never know what Docker was doing, because you just use it and its all completely transparent to the user.

Docker Toolbox does, it's still available to support older os / older hardware, and was what Windows had to use before the current Docker for Windows was released 2 or 3 years ago.

Docker Toolbox for Mac vs. Docker for Mac is the same, but I don't know what the time frame of the switch to the newer architecture was.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Mr Shiny Pants posted:

Now I am curious. :)

Why and how?

drat, you gonna make me effortpost.

Ok, first the "how":
Basically I worked this out on paper, and have not implemented it in code yet.
To start we'll say we have a set of symbols {A,B,C}
And we'll define our multiset by the multiplicities of each symbol, lets say the multiset is {1,2,2}, meaning there is 1 A, 2 B's, 2 C's in our "word"
The word length 'n' is the sum of the multiplicities: 5
The total word permutations for this multiset are equal to the multinomial function, which I'll write as M(5,{1,2,2}) = 5!/(1!2!2!) = 30

So we can start enumerating words in lexicographical order just to get an idea of what we're looking at (the algorithm itself need not actually enumerate through them):
code:
0  ABBCC
1  ABCBC
2  ABCCB
3  ACBBC
4  ACBCB
5  ACCBB
6  BABCC
7  BACBC
8  BACCB
...
29 CCBBA 
So we start by setting i=0, and look at the first character.
If the letter matches the first non-zero multiplicity in our multiset, then we move on to the next letter without changing i.
If the character is out of order (its index in the multiset is greater than any non-zero multiplicities), then we add to 'i' the count of all the words that would have begun with those symbols it displaced.
Every time we move over one character, decrement n, as well as the multiplicity for whichever symbol we found.

Lets say our word is "BACBC" and we don't know what index i it corresponds to.
Looking at the first letter B; we expected A, so i += (# of words began with A)
To figure out how many began with A, we can conceptually "cover up" the A column in our list above, examining words of length *4* that *don't* begin with A, and it is apparent that there are M(4,{0,2,2}) = 6 possibilities.
So i += 6
We are now considering M(4,{1,1,2}) and our new first letter is A, that's the first non-zero value in our multiset, so i doesn't change, moving on
Now M(3,{0,1,2}) and the letter is C, where we wanted a B if things were in order, so i += (M(2,{0,0,2}) = 1)
Now M(2,{0,1,1}) and letter matches expectations, 'i' remains unchanged.
We don't need to read the last letter because there is only 1 permutation of a 1 letter word.
So we got i=7, which matches our list above, yay!

The worst case is if our word is completely reversed "CCBBA", i = M(4,{0,2,2}) + M(4,{1,1,2}) + M(3,{0,2,1}) + M(3,{1,1,1}) + M(2,{0,2,0}) + M(1,{0,1,0}) = 6+12+3+6+1+1= 29

Also I should say that would be O(n) in the best case, and worst case I'm not sure, but it might be O(nk) where k is the number of symbols in the multiset.
This assumes you can compute the multinomial in O(1) time. To do this it is assumed to be initialized with a precomputed factorial lookup, and that the multinomial numerator and divisor are tracked separately.
Then you just divide the numerator by n before decrementing, and divide the divisor by whichever count from your multiset before decrementing that, and a a third final division (numerator/divisor) before adding to i.

As for "why": its a pet project I started recently where I'm experimenting with what I think is a novel lossless data compression technique. Not gonna go into much more detail than that until I have a functioning prototype and some hard data to back it up. I'm sort of analyzing the theoretical compression efficiency for various inputs at the moment as I work out the implementation.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Thermopyle posted:

No one uses virtualbox.
I want to believe. I did some digging around and it sounded like I can't boot up a container with a GUI. Some of the stuff I have to qualify involves kicking off 2d and 3d loads, so that would be a deal-breaker. Is this false? The way I could build up a container was very nice and I don't look forward to trying to do something like with with Virtualbox at all.

necrotic
Aug 2, 2005
I owe my brother big time for this!
I don't see why you couldn't, but you'd probably need X11 running on the host and mount some socket into the container to use it.

Edit: here's a post on running an X11 GUI https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

necrotic posted:

I don't see why you couldn't, but you'd probably need X11 running on the host and mount some socket into the container to use it.

Edit: here's a post on running an X11 GUI https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110

Some of my stuff is Windows though. I'm having to do my vetting on both Windows and a smorgasbord of Linux flavors.

MikeJF
Dec 20, 2003




Anyone have any resources for cross-thread atomic state/model management in C#?

necrotic
Aug 2, 2005
I owe my brother big time for this!
Ah, I haven't seen a way to do Windows with a GUI. X11 works since its just over a dumb socket.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
So... plan B is vagrant with VirtualBox or something? This is for spinning up some QA virtual machines so it's not like I'm trying to deploy some service or whatever.

Mr Shiny Pants
Nov 12, 2012

Thanks for posting an explanation, to be honest that went way over my head. :)

feedmegin
Jul 30, 2008

necrotic posted:

Ah, I haven't seen a way to do Windows with a GUI. X11 works since its just over a dumb socket.

I mean, if X11 works, so should Wine :shobon:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



IIRC CygWin can install an X client on Windows and, if not CygWin, I know there are X clients out there because I've used them. Not recently, but they probably still work because Windows.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Munkeymon posted:

IIRC CygWin can install an X client on Windows and, if not CygWin, I know there are X clients out there because I've used them. Not recently, but they probably still work because Windows.

Xming.

Download and install and done!

(haha, its never done, there will be a half dozen enviornment variables that have mysterious effects)

Volguus
Mar 3, 2009

Thermopyle posted:

Xming.

Download and install and done!

(haha, its never done, there will be a half dozen enviornment variables that have mysterious effects)

Isn't XMing not updated since the last Ice Age? Isn't cygwin (if only for that reason) better than that? I personally never had a problem with cygwin in the last 5-ish years, it was at most a click next, start X, go to town (ssh -X or -Y ...) .

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Volguus posted:

Isn't XMing not updated since the last Ice Age? Isn't cygwin (if only for that reason) better than that? I personally never had a problem with cygwin in the last 5-ish years, it was at most a click next, start X, go to town (ssh -X or -Y ...) .

I have no idea, it just works for me.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

There's also vcxsrv which I haven't used but is updated more often.

https://sourceforge.net/projects/vcxsrv/

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Suspicious Dish wrote an X client that runs in the browser if all else fails :v:

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Munkeymon posted:

Suspicious Dish wrote an X client that runs in the browser if all else fails :v:

it's not a real X client, it's just something that's decently close

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply