How to efficiently move the decimal point in a number until reaching some threshold [migrated]

Say I have a double x, whose value is > 0 and < 1 million. I want to move its decimal point left until it is > 1 million and < 10 million. So for example, 23.129385 becomes 2313938.5.

What I’m doing now is just multiplying by 10 until reaching the stopping condition. However I’m performing this algorithm a lot so if I can optimize it somehow it would be helpful. A constant time solution, irrelevant of the magnitude of x, is obviously ideal but so far I haven’t been able to come up with one.

What can be done against DDoS attacks when I just have only small number of “known” clients reaching a server?

Description of the Situation:

Let’s say 1000 “known” clients/workers are collecting time-sensitive data from the field and sending to a server. Therefore, we need to secure the server from DDoS attacks at a specific day and period of nearly 3 hours. It is expected to have DDoS attack during this process.

Question: What are the possible ways of securing this process for that critical period of time? Maybe load balancing + firewall for allowing only 1000 “known” IP addresses … etc?

Reaching Shannon capacity of a channel

Suppose I have the following from alphabet $$\mathcal{X} = \{0 ,1\}$$ to $$\mathcal{Y} = \{0 ,1\}$$. The channel simply does

\begin{align} 0 \rightarrow 0&\quad \text{with probability 1} \ 1 \rightarrow 0&\quad \text{with probability 1/2}\ 1 \rightarrow 1&\quad \text{with probability 1/2} \end{align}

The classical capacity of this channel is given by the mutual information between the input register, $$X$$ and output register $$Y$$ maximized over input probability distributions, $$p(x)$$. That is,

$$C = \max_{p(x)} H(Y) – H(Y|X)$$

The appropriate distribution turns out to be $$(0.6, 0.4)$$ and the capacity is $$0.3219$$ bits.

How does one actually use this result to practically communicate (in the asymptotic limit) over this channel at this rate? Does it mean that I should use input codewords that obey these statistics over the input alphabet for example?

Flight reaching at terminal 03 in Dubai & have to pick car from terminal 01

arriving at terminal 3 and the europ car desk is in terminal 1. is the desk air side or land side (before or after immigration)? can they pick the car up from terminal 1 if they are arriving in terminal 3? please advise

SharePoint 2016 People picker error “Sorry, we’re having trouble reaching the server”

My users facing error on SharePoint 2016 when they try to add more than 15 users to share a file/folder. However, this error happen intermittently and have different results on different network connection. I have extended the timeout from default 25s to 60s. After that, the issue reoccurs when a user was adding names in the people picker, left the computer idle for a while and when he comes back to continue adding more names, he encounters the error message.

Does the network connectivity have anything to do with the people picker extracting names from AD? Is it normal for the people picker to timeout if left idle for some time? How can the users avoid facing this error again?

CPU reaching 99%

Hello everybody,

I’m using scrapebox for a month now and I really like it. At the begining, I had no problem grabbing emails by crawling sites. But for 2 days, when I start grabbing emails from the url’s harvested using proxies, it works well for several minutes but at a time, the CPU starts to raise quickly until 99% and then the program (and the entire computer) freezes.

Do you know where the problem could come from ?

I tried to use a program to limit manually the cpu dedicated to scrapebox but scrapebox reachs the limit and then freeze. I don’t if there is a link with the program update I made or the addons installed..

Sort 2D arrays so that cost of reaching new position as described at each iteration is minimized

Problem is as following:

We are 8 trumpet players in an orchestra.

There are for example 4 parts so there are always two players on the same part.

Now, there are not always the same two players playing the same part meaning the combination of players that play the same part change from piece to piece.

What is the cheapest way in terms of distance and/or the least amount of switches resulting that the players playing the same parts can sit next to each other on every piece?

Trumpet Players: a,b,c,d,e,f,g,h

Parts: 1,2,3,4

Seats are arranged like that:

 1st piece | a1 | b1 | c2 | d2 |  | e3 | f3 | g4 | h4 |  Next piece the players might play the following parts: | a2 | b1 | c3 | d1 |  | e3 | f4 | g2 | h4 |  and the next one againt different distribution of the parts: | a4 | b3 | c1 | d3 |  | e2 | f4 | g2 | h1 |

how do we seat the players so that the least amount has to be traveled in order to reach the desired positions for the players playing the same parts to sit next to each other in the next piece?

additional notes: i dont care where the pairs are starting and if a1 sits left of b1 or the other way around.

UK: Questions to NON-EU tourists prior to reaching the border

PLEASE NOTE THAT THIS QUESTION IS NOT A DUPLICATE AS SUGGESTED. This deals with information provided BEFORE reaching the border.

Are international (NON-EU/EEA/SCHENGEN) tourists generally required before entering the UK at the border (so for instance, in their visa application/interview…) to provide any information at all about the person they’re visiting (both in case they’re staying at this person’s place, or in case they’re staying in a hotel) if they’re coming to the UK to visit a family member or a friend?

In case of a positive answer to the above: is this information only provided orally, informally and off-the-records, or will a record be kept?

Sharepoint O365 Sorry, we’re having trouble reaching the server

This happens only with one user (That I know of) We have an on-premise AD that syncs with Azure AD. We are unable to type in the one users’ email address or name and have it return the option to send an invite from a Sharepoint Team site. Created a new test team site, and when I try to add the same user, I get Sorry, we’re having trouble reaching the server. The AD account was imported from another AD a year or so ago. I can choose people from the same OU that were imported the same way without issue.

How long do I need from landing to reaching the train station in Zürich Airport?

I am flying from Berlin to Zürich and continuing my travel by train. I am considering booking a fixed-connection train ticket, which is available for a train departing 1 hour 3 min after landing.

I have never been to Zürich Airport and don’t know how large it is or how easy it is to reach the train station. So I have trouble calculating if there is a reasonable chance that I catch the train. What would be a rough estimate of the expected time needed to reach the train station, under following factors:

• assume that the flight arrives roughly on time
• I am an EU citizen, so shouldn’t need to pass too many control points
• I don’t have checked luggage on that flight
• I am flying with Swiss (do they get preferred slots close to the terminal, so the passengers don’t need to wait for the bus?)
• I have a cheap ticket, so won’t be able to leave the plane early
• I can sustain a brisk walking speed
• assume that nothing out of the ordinary happens (e.g. security pulling me out for questioning)

If some other factor creates multiple expected times, I’ll also be happy with an answer like “it’s about 30 minutes if you land at Terminal 1, but takes over an hour if you land at Terminal 2”, or whatever other (frequently encountered) condition can cause a significant difference.