Galois group of unramified extension of $\mathbb{Q}_p$ is cyclic

I have seen that there for every $ f$ there exists a unique unramified extension to $ \mathbb{Q}_p$ of degree $ f$ , and it is $ \mathbb{Q}_p(\delta)$ where $ \delta$ is a primitive $ (p^f-1)$ -root of unity. Looking at the polynomial \begin{equation*} p(x)=x^{p^f-1}-1 \in \mathbb{Q}_p[X] \end{equation*} we see that it is seperable with the roots $ \{1,\delta,\ldots,\delta^{p^f-2}\}$ and splitting field being $ \mathbb{Q}_p(\delta)$ so $ \mathbb{Q}_p(\delta)/\mathbb{Q}_p$ is a Galois extension of degree $ f$ with basis $ \{1,\delta,\ldots,\delta^{f-1}\}$ . An automorphism $ \sigma \in \mathbb{Q}_p(\delta)/\mathbb{Q}_p$ is determined by where it sends $ \delta$ and since $ p(\delta)=0$ we see that $ \sigma$ takes $ \delta$ to a new $ (p^f-1)$ -root of unity. This means that $ \sigma(\delta) = \delta^i$ where $ i=1,2\ldots,p^f-2$ . We can then look at the group homomorphism \begin{equation*} \phi:Gal(\mathbb{Q}_p(\delta)/\mathbb{Q}_p) \rightarrow (\mathbb{Z}/(p^f-1)\mathbb{Z})^\times \end{equation*} defined by $ \phi(\sigma) = i$ where $ \sigma(\delta)=\delta^i$ . This homomorphism is injective so $ Gal(\mathbb{Q}_p(\delta)/\mathbb{Q}_p)$ is isomorphic to a subgroup of $ (\mathbb{Z}/(p^f-1)\mathbb{Z})^\times$ . Unfortunately, $ (\mathbb{Z}/(p^f-1)\mathbb{Z})^\times$ is not cyclic so my proof doesn’t really work. In most notes I have read they use other results to prove this but I am interested in a more straightforward approach, if there is one.

Golang extension on visual studio

When I am making the golang environment in visual studio, visual studio recommand a golang extension – “goreturns”

I just pressed install, but the output tells that I had failed to install

However, I tried the same code in terminal, it is success

But, after I had installed by terminal, when I back to my code, it still cannot detect the extension, even I had restarted the visual studio code.

Do any one knows that what is happening? Many thanks

Unit testing extension method adding view location expander


Introduction

I’m writing unit tests for an extension method I wrote. Its only purpose it is to wrap startup logic which extends ViewLocationExpanders list by an instance implementating IViewLocationExpander. ViewLocationExpanders is a property of RazorViewEngineOptions, which can be configured in application startup in ConfigureServices() method. I’m using XUnit 2.4.1.

Usage

Instead of:

services.Configure<RazorViewEngineOptions>(options => {     options.ViewLocationExpanders.Add(new ViewLocationExpander()); }); 

I can use:

services.AddViewLocationExpander(new ViewLocationExpander()); 

ViewLocationExpander

public class ViewLocationExpander : IViewLocationExpander {     public IEnumerable<string> ExpandViewLocations(         ViewLocationExpanderContext context,          IEnumerable<string> viewLocations)     {         if (context == null)         {             throw new ArgumentNullException(nameof(context));         }          if (viewLocations == null)         {             throw new ArgumentNullException(nameof(viewLocations));         }          /*             * Note:             * {0} = action name             * {1} = controller name             * {2} = area name             */          var newViewLocations = new string[]         {             // Example: '/Views/Home/_Partials/FooBar.cshtml'             "/Views/{1}/_Partials/{0}.cshtml",         };          // Add new locations *AFTER* MVC default locations.         return viewLocations.Union(newViewLocations);     }      public void PopulateValues(ViewLocationExpanderContext context)     {         context.Values["customviewlocation"] = nameof(ViewLocationExpander);     } } 

Extension method

public static IServiceCollection AddViewLocationExpander(     this IServiceCollection services,      IViewLocationExpander viewLocationExpander) {     if (services == null)     {         throw new ArgumentNullException(nameof(services));     }      if (viewLocationExpander == null)     {         throw new ArgumentNullException(nameof(viewLocationExpander));     }      return services.Configure<RazorViewEngineOptions>(options =>     {         options.ViewLocationExpanders.Add(viewLocationExpander);     }); } 

Unit tests

[Fact] public void ExtensionMethodAddsNewViewLocationExpander() {     // Arrange     var services = new ServiceCollection();     services.AddMvc();      // These two are required to active the RazorViewEngineOptions.     services.AddSingleton<IHostingEnvironment, HostingEnvironment>();     services.AddSingleton<ILoggerFactory, LoggerFactory>();      // Act     var serviceProvider = services.BuildServiceProvider();     var oldOptions = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>().Value;     services.AddViewLocationExpander(new ViewLocationExpander());     serviceProvider = services.BuildServiceProvider();     var newOptions = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>().Value;      // Assert     Assert.True(newOptions.ViewLocationExpanders.Count > oldOptions.ViewLocationExpanders.Count); } 

Questions

  1. Am I going beyond the scope of what unit testing should include? I’m afraid that my code is actually testing the basic functions of generic collections and/or aspects of ASP.NET Core.
  2. If my concern above is true, that should I write unit tests to this at all? How should it work?

¿Como puedo indexar archivos pdf o de otra extensión en solr y demás?

Necesito escoger entre elasticsearch y solr ya que la finalidad de cuyos programas es de poder escoger entre ambos con respecto a sus caracteristicas entre ellas la que más destaca es implementación.

Mi objetivo fundamental es el de instalar el solr en un servidor Debian 9 y crear una interfaz web para que los usuarios puedan buscar información acerca de los documentos que desean.

He investigado y me he inclinado más por Solr aún busco por medio de su documentación y aún no encuentro la solución a los siguientes problemas.

1) Necesito indexar documentos masivamente alrededor de un Terabyte de memoria en el que estan incluido archivos pdf, word, ppt y no tengo idea como seria la manera más practica, considere realizar un script en python con la libreria de tika para extraer toda la metadata y subirla por una API.

2) Una vez subida la data necesito buscar en el contenido de ella (de los pdf subidos) frases claves y que estas me muestren el número de página y la línea donde posiblemente se encuentre esa información por Ejemplo:

  • Subí una serie de libros de cocina en la cual ponga en el buscador la palabra sopa de pollo y me pueda aparecer todos los lugares donde se repita esa palabra, las paginas exactas donde se encuentra y las líneas resaltada ejemplo (Receta: La sopa de pollo es buena para la salud).

De verdad disculpen mi ignorancia y forma de hacer las preguntas pero busco más una orientación.

Magento 2 – How get extension attributes from product collection

I need to get the product collection with all extension attributes, specifically I need then to get the stockItem object with $ product->getExtensionAttributes()->getStockItem(). So I have created a function like this:

protected function getCollection(ProductInterface $  product): Collection {     $  collection = $  this->productCollectionFactory->create();      $  collection         ->addAttributeToSelect('*')         ->addAttributeToFilter('visibility', ['eq' => Visibility::VISIBILITY_BOTH])         ->addAttributeToFilter('status', ['eq' => Status::STATUS_ENABLED])         ->addFieldToFilter('entity_id', ['neq' => $  product->getId()])         ->setPageSize(5);      return $  collection; } 

then I get all items from collection with $ collection->getItems(), but in the loop of getItems() the extension attributes are null, why and how can I get them?

protected function populateProductList(Collection $  collection) {     $  items = $  collection->getItems();      $  products = array_map(function ($  product): ProductInterface {         $  stockItem = $  product->getExtensionAttributes()->getStockItem();         var_dump($  stockItem);die; // IS NULL          return $  product;     }, $  items);      return $  products; } 

If I get a Product from the get method of productRepository, that product has all extension attributes compiled, I don’t want to use productRepository to get another time the products for “only” the extension attributes, I want to avoid another call for performance reasons.

Finite extension of $K[[X]]$ and the norm

Let $ R \colon= K[[X]]$ be a formal power series ring over a field $ K$ . We consider a monic polynomial $ f(T) \in R[T]$ as follows$ \colon$

$ $ f(T) = T^e + c_{e-1}T^{e-1} + \ldots + c_1T + c_0. $ $

Let $ \overline{f(T)} \in K[T]$ be the reduction of $ f(T)$ by the ideal $ (X)$ . Suppose that both $ f(T)$ and $ \overline{f(T)}$ are irreducible. Let \begin{align*} & S \colon= R[T]/(f(T)) \ & L \colon= K[T]/(\overline{f(T)}) \end{align*} be finite extensions of $ R$ and $ K$ , respectively.

Choose an element $ \alpha \in L$ and consider $ {\mathrm{Norm}}(\alpha) \in K$ by the finite extension $ L/K$ .

Q. Choose an element $ \beta \in R$ such that $ \beta \mapsto {\mathrm{Norm}}(\alpha)$ via the surjection $ R\twoheadrightarrow K$ by $ {\mathrm{mod}}\,(X)$ . Does there always exist a lift $ \gamma \in S$ of $ \alpha \in L$ such that the following two conditions are satisfied?$ \colon$

\begin{align*} \gamma & \equiv \alpha \quad {\mathrm{mod}}\,(X) \ {\mathrm{Norm}}(\gamma) & = \beta. \end{align*}

Ocultar extensión .Aspx en la URL del Navegador

Cordial Saludo.

Estoy trabajando con VB.NET y por petición solicito ocultar la extensión del lenguaje .aspx por seguridad, ya intente con el package NuGet.

Microsoft.AspNet.FriendlyUrls 

El instala unos complementos en la solución pero la clase RouterConfig no se reconoce en el Global.asax.

Agradeceria si alguno ya trabajo con este NuGet el aporte de que me falta.