Finding Position of a Nested List By A Value Test

What I am looking for is an understanding of why what seems to me a straightforward extension of finding elements in lists does not extend (without returning error messages) to nested lists.

A couple of different syntaxes that return the position in flat lists:

test1 = {1, 2, 3, 4}; FirstPosition[test1, _?(# > 2 &)] FirstPosition[test1, n_ /; n > 2] 

In both cases the expected result of 3 is returned.

If I try what seems to me the logical way of specifying a value to test in a nested list, like:

test2 = {{1, 100}, {2, 200}, {3, 300}, {4, 400}}; FirstPosition[test2, _?(First[#] > 2 &)] FirstPosition[test2, n_ /; First[n] > 2] FirstPosition[test2, n_ /; n[[1]] > 2] 

They return the value (3) as I expect. But they also return similar error messages like:

First::normal: Nonatomic expression expected at position 1 in First[List] 

with a stack trace ending in:

FirstPosition[{{1, 100}, {2, 200}, {3, 300}, {4, 400}}, _?(First[#1] > 2 &)] 

I do not understand what the error is here, or how it can be avoided. I would like to understand so that I can perform similar tests on arbitrarily complex nested lists, using the regular indexing syntax to reference the values to be tested without getting error messages.

There is nothing special about using FirstPosition in this example, other functions like Position, etc. are equally relevant.

My test of Google Cloud CDN is not as good as cdnperf.com

Firstly I see https://www.cdnperf.com/ and its result. It seems Google is the 2nd fastest CDN provider in the world. Even for different continents, its speed is among the top 3.

Then I perform test by myself, by using Google Cloud Storage Bucket and then create a https load balaner and then enable CDN and create the frontend.

My Google CDN settings are:

  1. Cache static content
  2. Client TTL set to 1 day. Default and Max TTL set to 30 days.

Then I try to use Uptrends.com to perform the test. Which will download files from Google CDN from 227 checkpoints of Uptrends servers(the default selected checkpoints in their system) around the world. To my surprise:

  1. For a 12.2MB exe file, its speed is faster than Azure for many times, but not always.
  2. For a 24.6kb png image file, its speed is much slower than Azure, Cloudflare.

I check this and it seems Google will add overhead for each connection, which may explain why a smaller file does not have a good performance.

But in cdnperf, it said ""Performance" is the time it took for a user to download a 500byte image from a CDN.". So it is also testing on a rather small file(500 byte).

Why my result is so different from those from cdnperf? Am I doing something wrong?

I then recheck cdnperf for how it gets the performance, and it said ""Performance" is the time it took for a user to download a 500byte image from a CDN.", so its result is also for a small file.

Sample — test — data for large WordPress install

I’m working on a plugin, Index WP MySQL for Speed. For testing it would be helpful to have a very large WordPress installation containing many thousands of posts, pages, metadata entries, media items, users, options, and so forth. The meaning of the data doesn’t matter — it can be lorem ipsum text — but having a lot of it would be great. For my purposes I don’t care whether the media files in wp-content/uploads are available. I just want to bring my test installation’s MySQL database server to its knees.

It would be great if it were a WooCommerce test site.

(I’m aware of the theme unit test data file at https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml. But it’s not big enough for my specific purpose.)

Is there some such importable dataset available? Is there some sort of tool I can leave running for many hours to generate random data? If it comes to that, how would I create such an automated content production tool?

If I must generate my own load test dataset I’ll definitely GPL it.

Custom Menu not working on Test Server

I need to add custom menus to the footer of a WordPress Site. Following a tutorial I updated my files as follows:

functions.php

function register_my_menus() { register_nav_menus(     array(          'product-range' => __( 'Product Range' ),          'industry-types' => __( 'Industry Types' ),          'services' => __( 'Services' )      )  ); } add_action( 'init', 'register_my_menus' ); 

footer.php

<div class="container">             <div class="col-3" style="float:left"><h3>Product Range</h3> <?wp_nav_menu( array( 'footer' => 'product-range', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Industry Type</h3>                 <?wp_nav_menu( array( 'footer' => 'industry-type', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Services</h3>                 <?wp_nav_menu( array( 'footer' => 'services', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Address/Social Media Stuff</h3></div> </div> 

This worked fine on my local development machine — I ended up with additional menus in the CMS that I could add to as required. However when I uploaded my custom theme to the test server I saw the following where the menu should be:

product-range', 'container_class' => 'footer-menu' ) ); ?>

Can anybody tell me why this isn’t working here?

Google Optimize for A/B test: Trying to edit existing HTML but says it’s over the limit even when I test deleting some of it?

I am trying to set up an A/B test of a company’s website for my project. There are certain changes I’d like to make such as changing the ‘favourites’ products on the home page to one with the top selling products which I was trying to do by substituting the existing code simply with the top selling products instead (i.e. their jpg, their links, their names etc).

However I found that when making ANY change (by selecting the element and clicking ‘edit HTML’), even testing it by deleting one character from the original code, that it then pops up with this error notification saying that it’s over the word limit. Even when I put the character back for example, the error message is still there. And it will say weirdly that it is quite a lot of the word limit even though it’s basically the original code! I then have to click cancel every time.

Please see the attached photo for reference (where I deleted one character from the original code to demonstrate how any editing (even deletion of original working code) then comes up with the error that the html is over the limit).

View post on imgur.com

Thanks in advance!

Guidelines for setting haggle test difficulty when using the tracking money option?

I have been running a game of WFRP 4e and my players haven’t really been enjoying tracking money much so I was thinking of switching to the optional tracking money rule on page 290 of the rule book.

Where some groups like to track every penny closely, perhaps even using chits or fantasy coins to represent in-game coins, others prefer to ignore all fiscal book-keeping. The game rules assume you are counting every coin, but if you wish to simplify money, you can do so using your Status. If an item costs less than your Status level — so if you have a Status of Silver 2, any item costing 2 silver shillings or less — you are assumed to be able to buy as much as needed of that item. Beyond that, you can buy a maximum of one item a day that costs more with a Haggle Test, with the difficulty set by the GM according to the cost of the item and the local markets.

My problem is that according to the rules only a gold tier character can reasonably afford a main gauche let alone other weapons so my players will need to make haggling tests however I couldn’t find a guideline for haggle tests when using this system.(And the regular haggle rules woul not be appropriate on the grounds that the most you can negotiate is a %50 off) So what I wish to ask is Are there any guidelines somewhere for setting haggle difficulty and if not what are the rules you use on your table?

Not authorized on test to execute command

Here is my code:

mongoose.connect(consts.database, {     useNewUrlParser: true,     useUnifiedTopology: true,     sslCA: consts.databaseCert, }); //... const user = await db.userModel.findOne({     username: usernameLowerCase }).exec(); 

Here is my DB connection string (anonymized):

mongodb://myUser:userPW@SG-staging-111.servers.mongodirector.com:27017,SG-staging-43334.servers.mongodirector.com:27017?replicaSet=RS-staging-0&ssl=true&authSource=stagingDB 

I’m getting this error:

MongoError: not authorized on test to execute command {     find: "users",     filter: {         username: "bob"     },     projection: {},     limit: 1,     singleBatch: true,     batchSize: 1,     returnKey: false,     showRecordId: false,     lsid: {         id: UUID("0a9400e3-83e3-429c-b8c9-92ade2ff210e")     },     $  clusterTime: {         clusterTime: Timestamp(1613200171, 1),         signature: {             hash: BinData(0, FED473B580D13E7E5073756DB5140981AADB2985),             keyId: 6928615819992774977         }     },     $  db: "test" }  

DB user’s info:

myUser  [{"role":"readWrite","db":"stagingDB"}] 

I have no clue why I am getting this error not authorized on test to execute command, and in the return string $ db: "test" I don’t even have a database named test. What could I be doing wrong? I just recently added this new user myUser, but now I’m getting this error. Does this error mean that the user is not authorized to "test" commands? Or, does it mean that I am trying to (somehow) connect with a DB named "test"?

New more extensive reliability test for proxy

Hi @Sven, I am placing this discussion in the SER category but it could also be for Gsa Proxy Scraper.
I thinking about this for several days. Every time I test (public) proxies with Bing tests and use them in SER, 90% burns in a few minutes.
They are not that they get banned by the search engine because I do not use them to scrape, the listings are imported.
I know our IP can be banned by proxies after a few uses but in my opinion it is not that, 90% is too much.
I think we should add another test, a test that tests the sending and receiving of data for each proxy.
For the downlnoad, downloading a photo for example would suffice but for the upload? Something must be found.
I also appeal to all members who read this post. What could we use heavily enough to do an upload/download test?
I’m thinking for example is file sharing sites for example … Of course, the test could also be done for download right after.
Of course, an anonymity test to be carried out before or after is mandatory :

https://www.google.com/search?ei=_Z4JYMDoFeWq1fAPhPu2iAw&q=upload+file&oq=upload+file&gs_lcp=CgZwc3ktYWIQAzIECAAQQzIECAAQQzIECAAQQzICCAAyAggAMgIIADICCAAyAggAMgIIADICCAA6BAguEEM6BQgAELEDOggIABCxAxCDAToLCAAQsQMQxwEQowI6CAguELEDEIMBOgcIABCxAxBDOgUILhCxA1DNEFjEIGD1ImgAcAF4AIABa4gBtgaSAQQxMC4xmAEAoAEBqgEHZ3dzLXdpesABAQ&sclient=psy-ab&ved=0ahUKEwiA2_XxrK3uAhVlVRUIHYS9DcEQ4dUDCA0&uact=5&safe=images

A proxy whose upload and download have been tested beforehand would be much less inclined to burn under load.

Does anyone want to test my game?

Dear Game Devolepment Conumity I am a 14 year old game developer and have developed a game called Super shadow cube myself. My game is a 3D parcour game where you have to jump on invisible objects with a cube to reach the goal. Every invisible floating platform, staircase or random object leaves a perspective shadow.my game is a 3d parcour game in which you have to jump with a cube onto invisible objects to reach the destination. Each invisible floating platform, stairs or random object leaves a perspective shadow If someone wants to test my game and could write a short feedback I would be very happy. link:

https://play.google.com/store/apps/details?id=com.Lomusire.SuperShadowCube

Screenshot