## Nice auto insurance website

Why are you selling this site?
I own hundreds of sites and this is just a small one I have not really done anything with.

How is it monetized?
Media.net ads as well as several other networks. I bought these and never even changed all the networks over to mine.

Does this site come with any social media accounts?
No

How much time does this site take to run?
I spend no time on it now

What challenges are there with running this site?
none

## Nice insurance website for sale

Why are you selling this site?
I bought three of these together and just never did anything with them. The site does make a little money (a few dollars a month) from media.net ads

How is it monetized?
media.net

Does this site come with any social media accounts?
no

How much time does this site take to run?
I do not spend any time on them at all

What challenges are there with running this site?
none

## Is there a “nice” way to show navigation icons so they don’t clutter the UI?

I’ve got a small desktop application that scans music folders and randomly chooses an album to play. The first version is WinForms and has “previous” and “next” buttons next, to the album art, that are activated when there are more albums by the same artist.

I’m not happy with this UI as the buttons take up too much space.

I’m rewriting the application using WPF and I’m looking for a better way of indicating that there are other albums by the same artist. I’ve experimented with displaying the buttons on top of the cover art and only showing them when the mouse rolls over their position but I’m not happy with the result primarily because there’s no indication that the options are there.

I found a neat trick on Brian Stevens Photography site where the cursor changes to “+” and “-” over each half of the image to indicate navigation, but I also use a click on the image to play that album so I’d have to adapt this approach if I wanted to use it myself.

Is there a better way or is a carousel or coverflow control the way to go with this?

For a bit more background read this blog post of mine.

## How do I make “days-since-epoch” values play nice with std::chrono?

I’m obtaining from a magical gremlin an array of non-negative integer values in memory, say of type I. Each of these represents a number of days since the epoch (which is many years before 0 in the ISO 8601 calendar).

Now, I want to wrap these values – essentially through pointer or reinterpretation – by C++ classes, which can interact well with the code of std::chrono, or perhaps I should say be used with code which normally takes std::chrono timepoints and durations.

What would be my best course of action for this? Note I don’t want to replace any data in the array nor create a new value for each of the existing ones, elsewhere.

## Machine learning, kNN and NB algorithm. Is there a way make the code more compact and nice looking?

So this is the task I am working on:

“In this assignment you will implement the K-Nearest Neighbour and Naïve Bayes algorithms and evaluate them on a real dataset using the stratified cross validation method. You will also evaluate the performance of other classifiers on the same dataset using Weka. Finally, you will investigate the effect of feature selection, in particular the Correlation-based Feature Selection method (CFS) from Weka.”

I have done the weka part and also written seperate code for performance evaluation. Here, I need help with the main code where I am implementing kNN and NB algorithm.

Here is my code! I want to reduce the number of lines and possibly make it look more neat. Please help as much as you can. I have tried splitting into more functions and then calling them to do the work but is there a way I can do more? Also, is there a way the for loops can be written more compactly?

import heapq import sys import math as m from decimal import Decimal  class Entry:     def __init__(self, attributes):         self.attributes = attributes         self.diabetes = "yes" if "yes" in attributes else "no" if "no" in attributes else ""      def __str__(self):         string = ""         for attributeNum, attribute in enumerate(self.attributes):             if attributeNum == len(self.attributes) - 1:                 string += str(attribute)             else:                 string += str(attribute) + ','         return string      def set_ifdiabetes(self, diabetes):         self.diabetes = diabetes      def euclidean(self, other_entry):         sum = 0.0         for i in range(len(self.attributes)):                 sum += m.pow(float(self.attributes[i]) - float(other_entry.attributes[i]), 2)         return m.sqrt(sum)  class NB:     def __init__(self, training_data, testing_data):         self.training_data = training_data         self.testing_data = testing_data          self.training_entries = []         self.testing_entries = []          self.diabetes_yes = []         self.diabetes_no = []          self.mu_diabetesyes = []         self.mu_diabetesno = []          self.sigma_diabetesyes = []         self.sigma_diabetesno = []          self.num_attributes = 0          self.p_diabetesyes = 0         self.p_diabetesno = 0          self.num_diabetesyes = 0         self.num_diabetesno = 0      def train(self):         self.traincleandata()         self.get_mus()         self.get_sigmas()      def traincleandata(self):         for line in self.training_data:             if self.num_attributes == 0:                 self.num_attributes = len(line.split(','))                 for i in range(self.num_attributes):                     self.diabetes_yes.append([])                     self.diabetes_no.append([])                     self.mu_diabetesyes.append(0.0)                     self.mu_diabetesno.append(0.0)                     self.sigma_diabetesyes.append(0.0)                     self.sigma_diabetesno.append(0.0)             params = line.split(',')             cleanparams = getcleanparams(params)             entry = Entry(cleanparams)             self.training_entries.append(entry)              if (entry.diabetes == "yes"):                 for i in range(len(entry.attributes) - 1):                     self.diabetes_yes[i].append(Decimal(entry.attributes[i]))                 self.p_diabetesyes += 1                 self.num_diabetesyes += 1             else:                 for i in range(len(entry.attributes) - 1):                     self.diabetes_no[i].append(Decimal(entry.attributes[i]))                 self.p_diabetesno += 1                 self.num_diabetesno += 1          self.p_diabetesyes = Decimal(self.p_diabetesyes) / len(self.training_entries)         self.p_diabetesno = Decimal(self.p_diabetesno) / len(self.training_entries)      def get_mus(self):         for i in range(self.num_attributes - 1):             self.mu_diabetesyes[i] = sum(self.diabetes_yes[i]) / len(self.diabetes_yes[i])             self.mu_diabetesno[i] = sum(self.diabetes_no[i]) / len(self.diabetes_no[i])      def get_sigmas(self):          sigSumYes = [0] * self.num_attributes         sigSumNo = [0] * self.num_attributes          for i in range(self.num_attributes - 1):             for j in range(self.num_diabetesyes):                 sigSumYes[i] += m.pow(self.diabetes_yes[i][j] - self.mu_diabetesyes[i], 2)             self.sigma_diabetesyes[i] = m.sqrt(sigSumYes[i] / (len(self.diabetes_yes[i]) - 1))             for j in range(self.num_diabetesno):                 sigSumNo[i] += m.pow(self.diabetes_no[i][j] - self.mu_diabetesno[i], 2)             self.sigma_diabetesno[i] = m.sqrt(sigSumNo[i] / (len(self.diabetes_no[i]) - 1))      def test(self):         self.testcleandata()         self.testalgo()      def testcleandata(self):         for line in self.testing_data:             params = line.split(',')             cleanparams = getcleanparams(params)             entry = Entry(cleanparams)             self.testing_entries.append(entry)      def testalgo(self):         counter = 1         P_diabetesyes = [0] * self.num_attributes         P_diabetesno = [0] * self.num_attributes         for entry in self.testing_entries:             pYesEntry = 1             pNoEntry = 1             for i in range(self.num_attributes - 1):                 P_diabetesyes[i] = Decimal((1 / (self.sigma_diabetesyes[i] * m.sqrt(2 * m.pi))) * m.pow(m.e, (-m.pow(Decimal(entry.attributes[i]) - self.mu_diabetesyes[i], 2) / (2 * m.pow(self.sigma_diabetesyes[i], 2)))))                 P_diabetesno[i] = Decimal((1 / (self.sigma_diabetesno[i] * m.sqrt(2 * m.pi))) * m.pow(m.e, (-m.pow(Decimal(entry.attributes[i]) -self.mu_diabetesno[i], 2) / (2 * m.pow(self.sigma_diabetesno[i], 2)))))                 pYesEntry *= float(P_diabetesyes[i])                 pNoEntry *= float(P_diabetesno[i])              pYesEntry *= float(self.p_diabetesyes)             pNoEntry *= float(self.p_diabetesno)              entry.set_ifdiabetes("yes") if (pYesEntry/pNoEntry >= 1) else entry.set_ifdiabetes("no")             counter += 1  class kNN:     def __init__(self, training_data, testing_data, k):         self.k = k         self.training_data = training_data         self.testing_data = testing_data         self.training_entries = []         self.testing_entries = []      def __str__(self):         string_to_return = ''         for entry in self.training_entries:             string_to_return = string_to_return + str(entry) + '\n'         return string_to_return      def train(self):         for line in self.training_data:             params = line.split(',')             self.training_entries.append(Entry(getcleanparams(params)))      def test(self):         counter = 1         for line in self.testing_data:             params = line.split(',')             self.testing_entries.append(Entry(getcleanparams(params)))         for testEntry in self.testing_entries:             nearest = []             for trainEntry in self.training_entries:                 current_entry = (testEntry.euclidean(trainEntry), str(trainEntry.diabetes), str(trainEntry))                 nearest.append(current_entry)             heapq.heapify(nearest)             nearest.sort()             nearest = nearest[:int(self.k)]             num_diabetes = 0             for entry in nearest:                 if (entry[1] == "yes"):                     num_diabetes += 1             testEntry.set_ifdiabetes("yes") if (num_diabetes >= int(self.k)/2) else testEntry.set_ifdiabetes("no")             counter += 1      def compare(self):         for entry in self.testing_entries:             print("-----------")             print(entry.compare(self.training_entries[0]))             print(entry)             print(self.training_entries[0])   def getcleanparams(params):     params_nospaceortab = []     for param in params:         params_nospaceortab.append(param.strip())     return params_nospaceortab   if __name__ == '__main__':     training_file = open(sys.argv[1])     testing_file = open(sys.argv[2])     classifier_input = sys.argv[3]      training_lines = training_file.readlines()     training_cleanlines = getcleanparams(training_lines)      testing_lines = testing_file.readlines()     testing_cleanlines = getcleanparams(testing_lines)      if classifier_input == "NB":         classifier = NB(training_cleanlines, testing_cleanlines)         classifier.train()         classifier.test()         for entry in classifier.testing_entries:             print(entry.diabetes)     elif "NN" in classifier_input:         classifier = kNN(training_cleanlines, testing_cleanlines, (classifier_input.index('NN') - 1))         classifier.train()         classifier.test()         for entry in classifier.testing_entries:             print(entry.diabetes)     else:         print("Error: unknown classifier type")         sys.exit()

## Do I need a transit Visa with my Turkish passport traveling from Istanbul to Munich (Germany) and to Nice (France) to finally go to Canada?

I keep searching in this website and calling the French embassy, but I still don’t know if a transit visa is enough for this kind of layover. Or would I need a full Visa for a 1:30 h layover in Nice coming from Munich.

## Does a (nice) centerless group always have a centerless profinite completion?

This is an extension of a question I asked here on Math.SE

Assume that I have a finitely generated residually finite centerless group $$G$$. Is it true that the profinite completion $$\hat{G}$$ also has trivial center?

In the linked question, user YCor was able to show that this fails in general if you do not assume either finite generation or residually finite. However, the result is happens to be true if $$G$$ is a surface group. I’d like to know if this is a phenomenon specific to surface groups or if this is a more general fact.

## Does a (nice) centerless group always have a centerless profinite completion?

This is an extension of a question I asked here on Math.SE

Assume that I have a finitely generated residually finite centerless group $$G$$. Is it true that the profinite completion $$\hat{G}$$ also has trivial center?

In the linked question, user YCor was able to show that this fails in general if you do not assume either finite generation or residually finite. However, the result is happens to be true if $$G$$ is a surface group. I’d like to know if this is a phenomenon specific to surface groups or if this is a more general fact.

## Nice Form of Vector Field

Let $$G$$ be a reductive algebraic group (maybe reductive is not necessary) over an algebraically closed field $$k$$ of characteristic zero. Let $$X$$ be a homogeneous affine $$G$$-variety, i.e. $$X=G/K$$ for some reductive subgroup $$K$$ of $$G$$.

In this case we obtain an action by vector fields of the Lie algebra $$\mathfrak{g}$$ of $$G$$ on functions on $$X$$, the algebra $$k[X]$$. Choose an element $$u\in\mathfrak{g}$$.

My question is: are there statements about nice local forms of $$u$$? e.g., I would like to know about statements of the form: If $$u$$ vanishes at a point $$a$$ on $$X$$ there exists a neighborhood $$U$$ of $$a$$ with coordinates $$x_1,\dots,x_n$$ (coming from an etale map $$U\to\mathbb{A}^n$$) such that $$u=\sum\limits_i x_{j_i}\partial_{x_{k_i}}$$ Any references or comments are greatly appreciated!