How much should I consider lens mount when buying all-manual lenses?

I’m mostly shooting micro four thirds, and am looking at buying a set of primes. It occurs to me, that if I buy an MFT lens set, then those lenses can only by used with MFT cameras and those with shorter flange distances (like Sony’s E-mount). But lens adapters are cheap, and if I can buy a set of Nikon F-mount primes, then I can adapt that to Canon, MFT, Sony, any number of mounts. So if I’m shooting manual everything, is there any reason not to just buy a set with the longest flange distance and rely on adapters?

How much slower is it to draw on “half pixels”?

I’ve noticed that games like Diep.io are using floating decimal points for thin stroke lines on the grid. I have even tried this myself, by adding 0.5 to all of the positions for the grid lines to make the lines more thin.

I heard it from a friend that drawing on half pixels causes the GPU to do more work to smooth it out, like anti-aliasing. I am really trying to make my game look nice, by making the most smoothest lines as I can. How much slower is it really, and should I use it in an online competitive 2D game using Canvas?

How stop google from giving too much link juice to particular URLs?

We have a product website with separate pages for product details, product images, product videos, product reviews.

We want to design a card for our products which we can use everywhere i.e. on internal website ads, cross-sell etc. Below is a sample card.

bike toy product - seo

There is a problem that we see here – this will create too many linkages to our product review, images and videos page. The most important page for us is the product details page and we want to give maximum link juice to that page.

How can we fix this link juice distribution problem and indicate to google that product details is the most important link out of all these links?

We are apprehensive of doing no-crawl/no-follow as we are not sure if it would solve this issue.

Ubuntu 18.10 is much slower with Wayland than X.org

Disclaimer: I am not that advanced Ubuntu/Linux user.

I have just recently installed Ubuntu 18.10 on my desktop. There is an issue which I can’t understand: if I start a session with Wayland (choosing this while logging in), the system noticeably slower. I mean, even the mouse and typing are with a small (but noticeable) delay. If I run htop, I see that all the cores are constantly 40-50% busy, and the most CPU-hungry processes are **gnome-shell*.

Where can I look into the problem in my Ubuntu? What to start with?

Why is it bad to use exceptions for handling this type of validation? It seems like it makes the code so much cleaner

I’m working on a .NET Core REST API and I’m writing a service class to create new user accounts. I have the following code:

    public async Task<UserDto> RegisterNewUserAccount(CreateAccountDto userInfo)     {         EnsureUserDoesNotAlreadyExist(userInfo);         EnsureRfidCardIsNotAlreadyClaimed(userInfo);          var user = new UserDto()         {             Email = userInfo.EmailAddress.ToLower(),             FirstAndLastName = userInfo.FirstAndLastName,             Rank = 1200,             JoinedTimestamp = DateTime.UtcNow.ToString()         };          await _usersRepository.CreateUser(user);          var passwordHasher = new PasswordHasher<AccountCredentials>();         var credentials = new AccountCredentials()         {             Email = userInfo.EmailAddress.ToLower(),             HashedPassword = passwordHasher.HashPassword(null, userInfo.Password)         };          await _accountCredentialsRepository.InsertNewUserCredentials(credentials);         await _emailSender.SendNewUserWelcomeEmail(userInfo);          return await _usersRepository.GetUserWithEmail(user.Email);     }      private void EnsureUserDoesNotAlreadyExist(CreateAccountDto userInfo)     {         if (_usersRepository.GetUserWithEmail(userInfo.EmailAddress) != null)         {             throw new ResourceAlreadyExistsException("Email already in use.");         }     }      private void EnsureRfidCardIsNotAlreadyClaimed(CreateAccountDto userInfo)     {         if (_usersRepository.GetUserWithRfid(userInfo.RfidNumber) != null)         {             throw new ResourceAlreadyExistsException("RFID card already in use.");         }     } 

To me, this code is clean, readable, and obvious in what it does. However, it seems like a lot of people are strictly against using exceptions for this type of logic. I know exceptions shouldn’t be used for normal control flow, but for something like this, it seems so natural. The one thing I’ve considered changing is renaming the two helper methods to ThrowIfUserAlreadyExists and ThrowIfRfidCardIsAlreadyClaimed, to make it more clear that these private helper methods serve no purpose other than to throw an exception if a condition is met.

Obviously, I wouldn’t want to use exceptions for validating general user input, such as making sure their password meets the requirements, etc., but in cases like this the line seems blurred.

If you believe this is bad practice, how would you write code such as this instead? Why is it bad to do it the way I have?

How much classical deformation theory do spectral sequences give you for free?

Many foundational results in deformation theory are proven using long, tedious and unsatisfying diagram chases, of the sort that I suspect could be `automated’ using spectral sequences. For instance,

  1. If $ X=\text{Spec}A$ is an affine scheme over $ k$ , its first-order deformations are $ \text{Ext}^1(\textbf{L}_{A/k},A)$ .
  2. If $ J\to C”\to C’$ is an extension of artin local rings, a deformation $ X’$ of $ X$ over $ C’$ can be extended to $ C”$ iff a certain obstruction in $ \text{Ext}^2(\textbf{L}_{A/k},A\otimes J)$ vanishes. If so, the set of extensions is $ \text{Ext}^2(\textbf{L}_{A/k},A\otimes J)$ .
  3. Now letting $ X$ be a general scheme over $ k$ , there are three obstructions to extension, lying in $ $ H^i(X,\mathcal{E}\text{xt}^j(\textbf{L}_{X/k}, X)\otimes J) \ \ \ \text{ for }i+j \ = \ 2$ $ and if these obstructions are all zero, the set $ \square$ of extensions of $ X$ fit into a sequence $ $ 0 \ \longrightarrow \ H^1(X,\mathcal{T}^0_{X}\otimes J)\ \longrightarrow \ \square \ \longrightarrow \ H^0(X,\mathcal{T}^1_{X}\otimes J) \ \longrightarrow \ H^2(X,\mathcal{T}^0_{X}\otimes J) \ \longrightarrow \ \cdots$ $ (writing $ \mathcal{T}^i_X=\mathcal{E}\text{xt}^j(\textbf{L}_{X/k}, X)$ ).

Are there any proofs of 1-3 using spectral sequences?


I’ve tried looking in Illusie’s and Laundal’s books, but I found it hard to tell whether they had done (something equivalent to) this.

More evidence that spectral sequences might appear here: $ 3$ looks like a five-term exact sequence, there’s an appearance of $ i+j=n$ , we’re working with a complex $ \textbf{L}$ so it’s likely that spectral sequences naturally arise (c.f. hypercohomology, mixed Hodge structures,… ), the Quillen spectral looks slightly related.

How many libraries is too much before there is a performance issue?

We are using Paragraphs module to allow for selecting of up to 15 different Paragraph Types. As part of this, each one requires its own CSS and JS since they are vastly different. We already have a common set of CSS and JS that can be shared (25% overall), but there is a large percentage (75%) that is unique to each Paragraph Type.

We were able to combine lots of the CSS and JS, which resulted in the creation of 10 libraries and 1 general library to help with the management of these types. We are concerned that if we add more Paragraph Types the number of libraries could increase to anywhere between 20-30 as newer Paragraph Types are needed.

How many libraries is too much for a custom subtheme before it cause a performance issue (if any)?

Since there is no extra preprocessing needed per Paragraph Type, we simply add them using the {{ attach_library('mytheme/name') }} in twig templates. The only hook that is used is the one to add the general library.

mytheme is a subtheme and is set as default and enabled

Examples:

paragraph--carousel.html.twig

{# this is the paragraph type specific library #} {{ attach_library('mytheme/carousel') }}   <div class="carousel__wrapper">    <div class="carousel__title"> {{ content.field_title }} </div>   <div class="carousel__subtitle"> {{ content.field_sub_title }} </div>   <div class="carousel__text"> {{ content.field_description }} </div>   <div class="carousel__image"> {{ content.field_image }} </div>   <div class="carousel__dots"> </div> </div> 

paragraph--jump-menu.html.twig

{# this is the paragraph type specific library #} {{ attach_library('mytheme/jump-menu') }}   <div class="jmenu__wrapper">    <div class="jmenu__tab"> {{ content.field_title }} </div> </div> 

mytheme.module

function mytheme_preprocess_paragraph(&$  variables) {   // Add general library for paragraphs.   $  variables['#attached']['library'][] = 'mytheme/global'; }