performance – JMeter: how to asign a single distinct value from CSV Data Set Config to each thread in thread group?

I have to make a load test for a relatively large number of users so I cant really use User Parameters pre-processor to parametrize each thread with custom user data. I’ve read that I should use CSV Data Set Config instead. However I run into a problem with how JMeter interprets the input of this Config.

Example:

I have a thread group of 3 threads and Loop Count:10 with one HTTP request sampler with server www.example.com and path: ${user}.
The csv file (bullet is a single line in file) for CSV Data Set Config to extract the user parameter:

Expected output is that for thread 1-x the path of the request should be: x. So the output file should consist of 10 samples per thread namely:

  • for thread 1-1 : 10 requests to www.example.com1
  • for thread 1-2 : 10 requests to www.example.com2
  • for thread 1-3 : 10 requests to www.example.com3

but instead i get requests to each 1 – 5 and then to EOF. Does anyone know how to achieve the expected effect with CSV Data Set Config in jmeter 2.9?

python – Leetcode group anagrams

Link here

I’ll include a solution in Python and C++ and you can review one. I’m mostly interested in reviewing the C++ code which is a thing I recently started learning; those who don’t know C++ can review the Python code. Both solutions share similar logic, so the review will apply to any.


Problem statement

Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

Example:

Input: strs = ("eat","tea","tan","ate","nat","bat")
Output: (("bat"),("nat","tan"),("ate","eat","tea"))

Both solutions involve creating a mapping from word characters ordered alphabetically to corresponding word and each word encountered that is a match, is added to the corresponding group. And since it was suggested earlier in my previous posts not to rely on leetcode’s stats because they are inaccurate, I timed both c++ and python solutions for 1,000,000 runs on the same set of words and see what comes up. Surprisingly, python solution outperforms the c++ solution almost by 2x. The resulting times ~= 10, 20 seconds for python and c++ respectively when run on my i5 2.7 GHZ mbp. Given that both implementations are almost similar, shouldn’t c++ be 10x times faster than python?

group_anagrams.py

from collections import defaultdict
from time import perf_counter


def group(words):
    groups = defaultdict(lambda: ())
    for word in words:
        groups(tuple(sorted(word))).append(word)
    return groups.values()


def time_grouping(n, words):
    print(f'Calculating time for {n} runs ...')
    t1 = perf_counter()
    for _ in range(n):
        group(words)
    print(f'Time: {perf_counter() - t1} seconds')


if __name__ == '__main__':
    w = (
        'abets',
        'baste',
        'beats',
        'tabu',
        'actress',
        'casters',
        'allergy',
        'gallery',
        'largely',
    )
    print(list(group(w)))
    time_grouping(1000000, w)

Results:

(('abets', 'baste', 'beats'), ('tabu'), ('actress', 'casters'), ('allergy', 'gallery', 'largely'))
Calculating time for 1000000 runs ...
Time: 8.801584898000002 seconds

group_anagrams.h

#ifndef LEETCODE_GROUP_ANAGRAMS_H
#define LEETCODE_GROUP_ANAGRAMS_H

#include <vector>
#include <string>

std::vector<std::vector<std::string>> get_groups(const std::vector<std::string> &words);

#endif //LEETCODE_GROUP_ANAGRAMS_H

group_anagrams.cpp

#include "group_anagrams.h"
#include <algorithm>
#include <chrono>
#include <iostream>
#include <map>


std::vector<std::vector<std::string>>
get_groups(const std::vector<std::string> &words) {
    std::map<std::string, std::vector<std::string>> word_groups;
    std::vector<std::vector<std::string>> groups;
    for (const auto &word: words) {
        auto sorted_word = word;
        std::sort(sorted_word.begin(), sorted_word.end());
        if (word_groups.contains(sorted_word)) {
            word_groups(sorted_word).push_back(word);
        } else {
            word_groups(sorted_word) = {word};
        }
    }
    groups.reserve(word_groups.size());
    for (auto const &imap: word_groups)
        groups.push_back(imap.second);
    return groups;
}


int main() {
    std::vector<std::string> words{
            "abets", "baste", "beats", "tabu", "actress", "casters", "allergy",
            "gallery", "largely"
    };
    auto groups = get_groups(words);
    for (const auto &group: groups) {
        for (const auto &word: group)
            std::cout << word << ' ';
        std::cout << 'n';
    }
    size_t n_times{1000000};
    std::cout << "nCalculating time for " << n_times << " runs ..." << 'n';
    auto t1 = std::chrono::high_resolution_clock::now();
    while (n_times > 0) {
        get_groups(words);
        n_times--;
    }
    auto t2 = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::seconds>(
            t2 - t1).count();
    std::cout << duration << " seconds";
}

Results:

abets baste beats 
tabu 
actress casters 
allergy gallery largely 

Calculating time for 1000000 runs ...
22 seconds

Add AD Groups to Sharepoint Online Group using CSOM

I have the following situation:

AD:

Sharepoint:

The hole point is to add both the users and the groups from AD to Sharepoint. I got adding the users to work using the following code:

    User adUser = ctx.Web.EnsureUser(ad.LogOnName);
    ctx.Load(adUser);
    gc.Users.AddUser(adUser);
    ctx.Load(gc, x => x.Users);

Where the LogOnName is the User Principal Name of the user. When adding the groups as LogOnName is used the group name.

Any suggestions where I am mistaken wehn adding the groups?

Summing Columns Based off Different Criteria in a group by in a Query Function in Google Sheets?

I would like to know how to sum a column based on different criteria in a group by in google sheets query function.
Here’s the data
And
Here’s what I want

Currently, I have a separate query for each summed column, and I need to copy down the row whenever the customer changes and the service providers change.
Is there some way to put this into one formula so I don’t need to always be copying and pasting? If one could put a query function into an array formula, that would be useful, but sadly, that is not possible. Group by allows summing of 1 column, so if I could just have multiple sums, that would be very useful.
Does anyone know the best way to do this?
Thanks,

2010 – send email to a group of user using three state workflow

I’ve created a request form using a custom list. And I also have added a three-state workflow to send an email after a new item has been created in the list. For now, I can only send the email to the requester and also another one user. My problem is, I need to send the email to a group of users who is the administrator of the page.

I can’t use Sharepoint Designer or MS InfoPath due to permissions are not granted.

How can I do that? Is it possible?

2010 – How to add a group of columns and add a “+” button

I have a problem on adding a group of the same column name in the custom list. I need to add the button for user to add the same columns. If user click on the “+” button, the columns will displayed in the form with the same name. Is it possible to do this? If yes, how can I solve this issue without using Sharepoint Designer?

For example, I want to add the ‘Parameter’, ‘Mapping Info’ and ‘Error Handling Details’ if user click on the + button.

Example

multithreading – Jmeter tearDown Thread Group can’t access previous thread group used file

I have a Test plan with several thread groups that write summary report results in the same csv file hosted in a server, this works fine using a networkdrive (z:) and changing jmeter.properties -> resultcollector.action_if_file_exists=APPEND.

Finally I have a tearDown Thread Group that insert the csv data into a sql server (the previous used networkdrive is hosted in this server in c:jmeterresults.csv) and then it deletes the csv.
The case is when I run the test plan full I always have this error: “Cannot bulk load because the file “c:jmeterresults.csv” could not be opened. Operating system error code 32″

The strange thing is that if I start the tearDown Thread Group alone it works fine, it makes the bulk insert in sql server and then it deletes de csv.

I started 2 days ago with Jmeter, so I’m sure I am misunderstanding something :S

Summary Report Config

JDBC Request

BeanShell PostProcessor that deletes csv

Test plan Structure

dg.differential geometry – A tri-grading on the de Rham complex of a Lie group?

The tangent space of a (compact) Lie group $G$ is given by its Lie algebra. Assuming for convenience that $G$ is connected, its Lie algebra $frak{g}$ decomposes into a Cartan part, as well as positive and negative root spaces:
$$
frak{g} simeq g_{-} oplus frak{g}_0 oplus frak{g}_+.
$$

This gives a dual decomposition on the space of differential one-forms
$$
Omega^1 simeq Omega^1_- oplus Omega^1_0 oplus Omega^1_+.
$$

This should extend to a $mathbb{N}_{0}^3$-grading on the de Rham complex of $G$, if I am not missing something. Taking the differential into account, do we have some type of tri-complex here? (I am of course thinking of the analogy with complex manifolds.) If so, what is the geometric significance of all of this? Do there exist Riemannian metrics interacting well with this structure?

How can I join in a group in messenger that i have left?

How can I join a group in messenger that I have left?

abstract algebra – Why are the cosets of the Bruhat decomposition independent of the representation of the Weyl group chosen?

Why are the cosets of the Bruhat decomposition independent of the representation of the Weyl group chosen?

For the sake of concreteness, let $G=SL_n$. Let $B_+$ the subgroup of upper triangular matrices and $B_-$ the subgroup of lower triangular matrices and let $T = B_+ cap B_-$. Then the Weyl group $W$ of $SL_n$ be can canonically identified with $frac{N(T)}{T}$, and furthermore we obtain two BRuhat decomposition’s:

$SL_n = bigsqcup_{w in W} B_+wB_+=bigsqcup_{v in W} B_-vB_-$

The Weyl group here is being understood as the quotient group $frac{N(T)}{T}$. Can somebody help me understand why the double coset $B_+wB_+$ is independent of the reprentative chosen for $w$ from the quotient group? Thanks