Complexity of brute force primality test in the number of digits

I’m wondering how to express the complexity of a brute force primality testing algorithm in the number of digits the number under test has. The brute force algorithm just checks whether $ n$ is prime by checking if there is a number $ k$ from $ 2 \leq k \leq \lfloor\sqrt{n}\rfloor$ that cleanly divides $ n$ . How would I go about expressing the complexity of this algorithm in the number of digits $ n$ has?

How to force Google search to only return English results?

I’m in France and trying to use Google in English only. My Google settings are set to English everywhere:

enter image description here

I’ve also clicked on the link “use” but when I do a search, it still shows some results in French, and I suspect the results are somehow tweaked for a French audience, which means some important English ones might be missing.

enter image description here

Is there any way to force it to really use only English (except for using a VPN or proxy server)?

D3v4 force layout transition from clustered layout to one node

I was wondering if I could get some input on how to make my code more concise, since I think in particular with the force simulation sections I have some repetition. And any other input to make my code more readable would be great. I have a mixing of jQuery and D3 but that is just a quick demo for putting some working code together since there is a lot more to the final visualization, and it doesn’t actually use jQuery. Thank you!

This code basically creates a force simulation using D3, reads in data (on sharks), and at first the nodes are sized based on the size of the shark and the nodes are clustered based on shark families. If the user clicks on the “Greenland shark” button then only the node with the common_name property “Greenland Shark” would be visible. And if the user clicks on the button “Sharks by family” then all the nodes would appear again clustered by family. Below is my code.

  var margin = {       top: 50,       right: 50,       bottom: 20,       left: 50   };      var width = 1200 - 300 - margin.left - margin.right;    var heightInitial = 700;   var height = heightInitial - - margin.bottom;     var svg ="#graph")       .style("width", width + margin.left + margin.right + "px")       .append("svg")       .style("width", width + margin.left + margin.right + "px")       .style("height", height + + margin.bottom + "px")       .attr("width", width + margin.left + margin.right)       .attr("height", height + + margin.bottom).attr("class", "svg")    var g = svg.append("g")       .attr("transform", "translate(" + margin.left + "," + + ")");     var forceStrength = 0.03;    var colorScale = d3.scaleOrdinal()       .range(['#450303', '#6e0505', '#951f1f', '#d09b9b', '#ad5151', '#e7cdcd',           '#b30000', '#e34a33'       ])    var familyXScale = d3.scaleOrdinal()       .range([width * 0.2,           width * 0.4,           width * 0.55,           width * 0.7,           width * 0.8,           width * 0.9       ]);    var familyYScale = d3.scaleOrdinal()       .range([height * 0.2,           height * 0.4,           height * 0.55,           height * 0.7,           height * 0.8,           height * 0.9       ]);    var yPositionScale = d3.scaleLinear()       .domain([1, 50])       .range([height / 2 - 50, height / 2 + 50])    var center = {       x: (width + margin.left + margin.right) / 2,       y: (height + + margin.bottom) / 2   };    var radiusScale = d3.scaleSqrt()       .range([0, 1])    d3.queue()       .defer(d3.csv, "./data2.csv")       .await(ready)    function ready(error, nodes) {        var families =, function(d) {           return       }).keys();        var sharks = {           return       });        var indexarray = [...Array(families.length).keys()];        var mapIndex = d3.scaleOrdinal().domain(families).range(indexarray);        colorScale           .domain(families)        familyXScale           .domain(families)        var simulation = d3.forceSimulation();        simulation.force('x', d3.forceX(function(d) {               var i = mapIndex(;               return xposition(i)           }).strength(0.03))           .force('y', d3.forceY(function(d) {               var i = mapIndex(;               return yposition(i)           }).strength((0.03)))           .force('collide', d3.forceCollide(function(d) {               return radiusScale(+d.size)           })).velocityDecay(0.1).alphaDecay(0.001);         var circles = g.selectAll(".sharks")           .data(nodes)           .enter().append("circle")           .attr("class", "sharks")           .attr("r", function(d) {               return radiusScale(+d.size)           })           .attr("fill", function(d) {               return colorScale(           })           .attr('stroke', '')         simulation.nodes(nodes)           .on('tick', ticked);         nodes.forEach(function(d) {           d.x = familyXScale(           d.y = yPositionScale(sharks.indexOf(       })         function ticked() {           circles               .attr("cx", function(d) {                   return d.x               })               .attr("cy", function(d) {                   return d.y               })       }          function charge(d) {           return -Math.pow(d.radius, 2.0) * forceStrength;       }        $  ("#greenlandshark").on('click', function() {           greenlandShark();       })        $  ("#sharksbyfamily").on('click', function() {           sharksByFamilyRev();       })          function sharksByFamilyRev() {            circles = g.selectAll(".sharks").data(nodes);            circles.exit().transition().duration(750)               .attr("r", 0)               .remove();            circles.transition().duration(750)               .attr("fill", function(d) {                   return colorScale(               }).attr("r", function(d) {                   return radiusScale(+d.size);               })            circles = circles.enter().append("circle").attr("class", "sharks")               .attr("fill", function(d) {                   return colorScale(               }).attr("r", function(d) {                   return radiusScale(+d.size);               })               .attr('stroke', '')               .merge(circles);            simulation.force('x', d3.forceX(function(d) {                   var i = mapIndex(;                   return xposition(i)               }).strength(0.03))               .force('y', d3.forceY(function(d) {                   var i = mapIndex(;                   return yposition(i)               }).strength((0.03)))               .force('collide', d3.forceCollide(function(d) {                   return radiusScale(+d.size)               })).velocityDecay(0.1).alphaDecay(0.001);            simulation.nodes(nodes)               .on('tick', ticked);            simulation.alpha(1).restart();        }        function greenlandShark() {            var newNodes = filterNodes('common_name', 'Greenland shark');            circles = g.selectAll(".sharks").data(newNodes);            circles.exit()               .transition()               .duration(1000)               .attr("r", 0)               .remove();            circles               .attr('r', function(d) {                   return radiusScale(+d.size)               })               .attr('fill', function(d) {                   return colorScale(               });            simulation.nodes(newNodes)               .on('tick', ticked);            simulation.force('x', d3.forceX().strength(0.03).x(center.x))               .force('y', d3.forceY(function(d) {                   return height / 2               }).strength((0.03)));            simulation.alpha(1).restart();        }        function filterNodes(key, group) {           var newnodes = nodes.filter(function(d) {               return d[key] == group;           });           return newnodes;       }     }     function xposition(i) {       if (i % 6 == 0) {           return width * 0.2       } else if (i % 6 == 1) {           return width * 0.4       } else if (i % 6 == 2) {           return width * 0.55       } else if (i % 6 == 3) {           return width * 0.7       } else if (i % 6 == 4) {           return width * 0.8       } else {           return width * 0.9       }   }    function yposition(i) {       if (i >= 0 && i <= 5) {           return width * 0.2       } else if (i >= 6 && i <= 11) {           return width * 0.4       } else if (i >= 12 && i <= 17) {           return width * 0.55       } else if (i >= 18 && i <= 23) {           return width * 0.7       } else if (i >= 24 && i <= 29) {           return width * 0.8       } else {           return width * 0.9       }   } 

Does apple force you to go through ApplePay for in-app purchases and subscriptions?

i am running a cordova app. And was planning to add some premium features to it for users paying monthly subscription. I am looking into stripe payments for that and they allow you to bill your users monthly.

But my questions is – does apple allow to go through stripe for subscriptions or other in-app payments or does apple force you to go through ApplePay. – if apple forces you to only deal with ApplePay and not other payment processors, can anyone shed some light on how it works in cordova app?

Thanks in advance.

Do ability scores force a character to act in a certain way? [duplicate]

This question already has an answer here:

  • How do character stats affect the personality of the character? 7 answers

As a group, most of the players at our table are fans of rolling for stats. This leads and has led to multiple amazing characters and some .. a bit less amazing.

Something that is rather consistent is that players are often good at emphasizing what their characters are specialized in based on their stats (for example: the charismatic bard, the nimble rogue, the strong barbarian). The thing that lags behind in this concept are often the characters flaws that come from their lower skills.

The roll of the dice gives us a basic way of handling this, because the character will simply fail a lot of the checks related to this skill, but this only goes so far.

An example was our recent very charismatic (17) warlock who wasn’t that blessed when it came to Intelligence (7). The problem here is that the player behind the character is far from dimwitted and has an in-depth knowledge of the lore of the world that’s being played in.

The question is two-fold:

  1. Should a DM enforce a base-level of adherence to a characters stats when they’re RPing?
  2. If yes, what would be a good way of enforcing this?

Shouting “Your character doesn’t know that, they are not intelligent enough!” whenever the player makes a profound observation about History or the use of Arcana will most likely turn stale very quickly.

Encryption Key vs. One-Time Pad Brute Force

How does an attacker know when they’ve cracked a traditional encryption key?

Wikipedia describes the one-time pad:

A 140 character one-time-pad-encoded string subjected to a brute-force attack would eventually reveal every 140 character string possible, including the correct answer – but of all the answers given, there would be no way of knowing which was the correct one.

So if you don’t know when you’ve solved OTP, what is a giveaway when a traditional encryption key is solved?

Force Javascript Ad Resize On Site

Hi folks! I need some help, $ 20 to anyone that can help me solve this one:

I have a WordPress site which has a theme width of 1020px. I'm serving a 970px wide ad via Javascript as a leaderboard spot. I need to force this script to call ads at 1020px wide instead in order to match the theme content width.

So calling 970×120 ads and forcing them to resize to 1020×126.

Anyone? PM me. Thanks!

How to force SSL on all FTP connections on a VPS Windows Server 2018

I have a VPS server that is running on Windows Server 2016. I added FTP access to one site on that VPS. But every time the user tries to connect using FileZilla FTP the user is prompted with the following.

enter image description here

I think I am forcing all FTP connection to use SSL but not positive.

In IIS Manager, I selected the site I want to force SSL on from the left tree. Then I selected “FTP SSL Settings” as you see in the picture below

enter image description here

Then I selected “Require SSL connections” and selected the SSL certificate that is used by that site.

How can I solve this problem and force all connections to use a secure connection?

Force ‘fetch joined’ relations to include IDENTITY of their ManyToOne relations using HYDRATE_ARRAY?

I have a query in which I’m joining a number of tables to my original Person entity. A Person may have multiple Child relations (OneToMany), and a Child may have a School they go to (ManyToOne). Problem is, I don’t need the entire School entity that connects to each child, only their id, which is already stored on Child.

I’m using a Paginator to iterate through the results and I use HYDRATE_ARRAY to reduce overhead of the ORM parsing data to entity objects. But the id fields of unfetched relations are not returned this way, and thus, the School id isn’t either.

I may join the School entity too, but since the identity is already stored on the Child records, I don’t see why I should further reduce performance by having the database join another table. Fetching results as entity objects would also solve the problem, but also at the cost of performance. How can I get the id to apper the results without having to unnecessarily join the the School entity or having to hydrate the results as objects?

$  query = $  em->getRepository(Entity\Person::class)->createQueryBuilder('p');  $  query   ->select([     'p as person',     ' as workplace_name',     'c',   ])   ->leftJoin('p.children', 'c') //Entity\Child   ->leftJoin('p.workplace', 'w') //Entity\Company   //...  ; $  paginator = new Paginator($  query); $  paginator->getQuery()   ->setHydrationMode(\Doctrine\ORM\Query::HYDRATE_ARRAY);