Multithreaded natural language text parser (Rev.3)

Question: This is the third iteration of the Multithreaded natural language text parser code review. Special thanks goes to G. Sliepen who conducted the first two reviews.
Before reading this post, please read the previous iteration, since without it most of the text below doesn't make sense.
Functional specification
Implement a multithreading parser based on existing natural language tokenizer.

Parser should compile text into sequences of lexem ids.
Parser should create structures to get lexem text by id and id by lexem text.
Lexems id must be unique for lexem, but no any other stronger requirements are provided.

Performance and memory footprint is critical, since the amount of data is huge (gigabytes).
Nice to have the approach which could be portable to GPU for further speed up.
Changes

The excessive refactoring leftover 'tokenize_chunk' has been removed.
The  TextBaseSingleThreaded::tokenize and  TextBaseMultiThreaded::tokenize_chunk merged to one template.
Functional decomposition to  TextBase<LexemsMapType, DictMapType>::tokenize_chunk applied.

The code
Fully functional runnable demo.
Here is the updated code for the code review; could you please take a look and suggest further ways to improve or confirm that this is ready to go code?
Please note that godbolt.org doesn't run code with MSVC, so don't expect to see the output.
using lexem_t = unsigned int;

struct LexemData {
    lexem_t id;
    std::size_t count;
};

struct LexemDataAtomic {
    lexem_t id;
    std::atomic<std::size_t> count;

    LexemDataAtomic(unsigned int i, std::size_t count) :
        id{ i },
        count{ count }
    {
    }

    LexemDataAtomic(const LexemDataAtomic& rhs) :
        id{ rhs.id },
        count{ rhs.count.load() }
    {
    }

    LexemDataAtomic& operator=(const LexemDataAtomic& rhs)
    {
        if (&rhs != this)
        {
            id = rhs.id;
            count = rhs.count.load();
        }
    }

    LexemDataAtomic(LexemDataAtomic&&) = delete;  // atomic is not moveable
    LexemDataAtomic& operator=(LexemDataAtomic&&) = delete;
};

template <typename TextBaseType>
struct CompiledText {
    TextBaseType* text_base;
    std::vector<lexem_t> data;

    CompiledText(TextBaseType& text_base) : text_base(&text_base) {}
};

template <typename LexemDataType, typename LexemsMapType, typename DictMapType>
class TextBase {
protected:
    LexemsMapType   lexems_data;
    DictMapType     index;

    LexemDataType& add_to_dictionary(lexem_t& id, std::string_view lexem);
    void add_to_data(std::vector<lexem_t>& compiled, lexem_t code);

    std::vector<lexem_t> tokenize_chunk(std::string_view text, lexem_t start_id);
public:

    enum {
        use_all_available_threads = 0,
    };

    std::string_view lexem_by_id(lexem_t lex_id) {
        return index[lex_id]->first;
    }
};

template <typename LexemDataType, typename LexemsMapType, typename DictMapType>
LexemDataType& TextBase<LexemDataType, LexemsMapType, DictMapType>::add_to_dictionary(lexem_t& id, std::string_view lexem) {
    auto res = lexems_data.insert({ std::string(lexem),{ id, 0} });

    if (res.second) {
        index[id++] = res.first;
    }

    return res.first->second;
}

template <typename LexemDataType, typename LexemsMapType, typename DictMapType>
void TextBase<LexemDataType, LexemsMapType, DictMapType>::add_to_data(std::vector<lexem_t>& compiled, lexem_t code) {
    compiled.push_back(code);
}

template <typename LexemDataType, typename LexemsMapType, typename DictMapType>
std::vector<lexem_t> TextBase<LexemDataType, LexemsMapType, DictMapType>::tokenize_chunk(std::string_view text, lexem_t start_id)
{
    std::vector<lexem_t> compiled;
    auto id = start_id;

    for (auto lexem : TokenRange(text)) {
        auto lexem_data = add_to_dictionary(id, lexem);
        ++lexem_data.count;
        add_to_data(compiled, lexem_data.id);
    }

    return compiled;
}

struct TextBaseSingleThreaded
    : public TextBase<LexemData, std::unordered_map<std::string, LexemData>,
    std::unordered_map<lexem_t, std::unordered_map<std::string, LexemData>::iterator>>
{
    CompiledText<TextBaseSingleThreaded> tokenize(std::string_view text);
};

struct TextBaseMultiThreaded
    : public TextBase<LexemDataAtomic, Concurrency::concurrent_unordered_map<std::string, LexemDataAtomic>,
    Concurrency::concurrent_unordered_map<lexem_t, Concurrency::concurrent_unordered_map<std::string, LexemDataAtomic>::iterator>>
{
    CompiledText<TextBaseMultiThreaded> tokenize(std::string_view text, std::size_t threads = 0);
private:
};

CompiledText<TextBaseSingleThreaded> TextBaseSingleThreaded::tokenize(std::string_view text)
{
    CompiledText<TextBaseSingleThreaded> compiled_text(*this);
    compiled_text.data = tokenize_chunk(text, 0);

    return compiled_text;
}

// If n_chunks == 0, use all available threads
CompiledText<TextBaseMultiThreaded> TextBaseMultiThreaded::tokenize(std::string_view text, std::size_t n_chunks)
{
    n_chunks = n_chunks != use_all_available_threads ? n_chunks : std::max((std::size_t)std::thread::hardware_concurrency(), (std::size_t)1);

    std::size_t chunk_size = text.size() / n_chunks;

    std::vector<std::future<std::vector<lexem_t>>> results;
    results.reserve(n_chunks);

    std::size_t carry = 0;

    const TokenRange empty({});
    auto delimiters = empty.begin().get_delimiters();

    CompiledText<TextBaseMultiThreaded> compiled_text(*this);

    for (std::size_t chunk = 0; chunk < n_chunks; ++chunk) {
        if (carry >= chunk_size) {
            carry -= chunk_size;
            continue;
        }

        std::size_t chunk_start = chunk * chunk_size + carry;
        std::size_t chunk_end = (chunk + 1) * chunk_size;

        std::string_view search_range = text.substr(chunk_end - 1);

        carry = search_range.find_first_of(delimiters);

        if (std::string_view::npos == carry) {
            carry = search_range.size();
        }

        chunk_end += carry;

        results.push_back(std::async(std::launch::async, &TextBaseMultiThreaded::tokenize_chunk, this,
            text.substr(chunk_start, chunk_end - chunk_start), (lexem_t)(chunk_start)));
    }

    for (auto& result : results) {
        compiled_text.data.append_range(result.get());
    }

    return compiled_text;
}

void generate_text(std::string& text, std::size_t length)
{
    std::vector<char> alphabet;

    for (char c = 'a'; c <= 'z'; ++c)
        alphabet.push_back(c);

    for (std::size_t i = 0; i < 5; ++i)
        alphabet.push_back(' ');

    for (std::size_t i = 0; i < 3; ++i)
        alphabet.push_back(',');

    for (std::size_t i = 0; i < 2; ++i)
        alphabet.push_back('.');

    text.resize(length);

    std::mt19937 generator(0);
    std::uniform_int_distribution<std::size_t> gen(0, alphabet.size() - 1);

    std::ranges::generate(text, [&]() { return alphabet[(std::size_t)gen(generator)]; });
}

int main()
{
    _CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, [](int, char*, int*) { return 1; });

    {
        std::string sample = "Let's consider, this semi-simple sample, i.e. test data a+b with ints: 100, etc. For ... some testing...";

        std::stringstream simply_parsed;

        for (auto token : TokenRange(sample)) {
            simply_parsed << token << " | ";
        }

        std::cout << "Simply parsed version: " << simply_parsed.str() << "\n";

        TextBaseSingleThreaded single_threaded_text_base;
        auto single_threaded_compiled_text = single_threaded_text_base.tokenize(sample);

        std::stringstream single_threaded;

        for (std::size_t i = 0; i < single_threaded_compiled_text.data.size(); ++i) {
            single_threaded << single_threaded_text_base.lexem_by_id(single_threaded_compiled_text.data[i]) << " | ";
        }

        std::cout << "\nSingle-threaded version:" << single_threaded.str() << "\n";

        TextBaseMultiThreaded multi_threaded_text_base;
        CompiledText<TextBaseMultiThreaded> multi_threaded_compiled_text = multi_threaded_text_base.tokenize(sample);

        std::stringstream multi_threaded;

        for (std::size_t i = 0; i < multi_threaded_compiled_text.data.size(); ++i) {
            multi_threaded << multi_threaded_text_base.lexem_by_id(multi_threaded_compiled_text.data[i]) << " | ";
        }

        std::cout << "\nMulti-threaded version:" << multi_threaded.str() << "\n\n";

        std::cout << (simply_parsed.str() == single_threaded.str() ? "Single threaded test passed: OK" : "Single threaded test failed") << "\n";
        std::cout << (simply_parsed.str() == multi_threaded.str() ? "Multi threaded test passed : OK" : "Multi threaded test failed") << "\n";
    }

#define PERF
#ifdef PERF
    {
        std::cout << "\nPerformance testing:";

        const std::size_t text_length = 100'000'000;

        std::string text;
        generate_text(text, text_length);

        TextBaseSingleThreaded single_threaded_text_base;
        CompiledText<TextBaseSingleThreaded> single_threaded_compiled_text(single_threaded_text_base);
        TextBaseMultiThreaded multi_threaded_text_base;
        CompiledText<TextBaseMultiThreaded> multi_threaded_compiled_text(multi_threaded_text_base);

        decltype(std::chrono::duration<double>()) single_threaded_duration;
        {
            std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

            single_threaded_compiled_text = single_threaded_text_base.tokenize(text);

            std::chrono::high_resolution_clock::time_point now = std::chrono::high_resolution_clock::now();
            std::cout << "\nDuration of the single-threaded version = " << (std::chrono::duration<double>(now - start));
            single_threaded_duration = (std::chrono::duration<double>(now - start));
        }

        decltype(std::chrono::duration<double>()) multi_threaded_duration;
        {
            std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

            multi_threaded_compiled_text = multi_threaded_text_base.tokenize(text);

            std::chrono::high_resolution_clock::time_point now = std::chrono::high_resolution_clock::now();
            std::cout << "\nDuration of the multi-threaded version = " << (std::chrono::duration<double>(now - start));
            multi_threaded_duration = (std::chrono::duration<double>(now - start));
        }

        std::cout << "\nSpeed up (times): " << single_threaded_duration / multi_threaded_duration;

        auto is_compiled_texts_equal = std::ranges::equal(single_threaded_compiled_text.data, multi_threaded_compiled_text.data, std::equal_to{},
            [&](auto lex) {
                return single_threaded_text_base.lexem_by_id(lex); },
                [&](auto lex) {
                return multi_threaded_text_base.lexem_by_id(lex); });

        std::cout << "\n\n" << (is_compiled_texts_equal ? "Test passed: OK" : "Test failed") << "\n";

    }
#endif //PERF
}

Concerns
My main concerns again around this function decomposition I am not very happy with. I have decomposed the TextBase<LexemsMapType, DictMapType>::tokenize_chunk and now it looks better, but I still have at least two questions now.
The add_to_dictionary still has 3 different responsibilities if we adhere to function decomposition rules:

Add a value to the lexems_data
Update the index to lexems_data
Increment the id counter

I can somehow agree that first two could be considered as updating database with index in terms of a transaction. The third one is already suspicious, since doesn't have any relation to the operation itself and to dictionary (as a database).
This leads to the second question if this is a good idea to pass id as a reference to add_to_dictionary. First of all, I hate the idea to keep client blind on the fact that the id could be changed with the call to add_to_dictionary. Well, one could see the function signature, but, anyway, pure code reading on client side hides the fact that id could be changed. I hate the idea pass the address to reveal this, as well, since it would force me to check it in the add_to_dictionary for nullptr.
I have two options:

Pass the id be value and get the updated id as a return value std::paired with the current result, but this would be weird.
I can raise a level of abstraction and return instead bool to show if the record was added to the dictionary which seems much better. But now I will have to duplicate the check if (added) which already exists in add_to_dictionary. Better high-level design, worse the performance on the critical path.

So, I am still in two minds with the better solution for this id which is in a wrong place in add_to_dictionary, but gives performance and avoiding code duplication benefits.
Don't get me wrong, in case this was the problem, I would keep is as is and spend time for real tasks. I use this just as an example to show why I am concerned with functional "over"-decomposition which leads to the balance questions about performance/code duplication and nice functional decomposition. I will be thankful for any ideas except "programming is always searching trade-offs" which is correct, but obvious and, therefore, doesn't help because this leads to holy wars where everybody stays on his position saying "this is my choice" and we stay with programming as an art, instead of moving to science.
With this I am still eager to hear your feedback on
questions posted in form of comments to Natural language text fast tokenizer (Rev.3). Here is the summary of these questions, so the link above is just for the context.
Function extraction is one of the hardest problems for me and I am very interested in your help here.
Here is my reasoning.

Yes, extracted functions are private, but they visible for all members of this class; let's imagine a class with a function with complex calculations (find intersections of geometrical primitives); I will extract 50 sub-functions and this will be a mess of functions visible in this class.
I am not concerned with performance overhead, but I am concerned with source file size. Instead of 150 lines of large function I will have 400 lines of 50 small functions to be written, documented, learned, remembered and read by others. Well, I exaggerating to explain the idea, but I had the cases.
Most of these functions don't have any meaning outside of the large function context, so it is hard to name and document them, since function find_left_upper_corner_of_frastum_and_horizon_intersection() is crazy and preconditions like "array must be sorted, all characters must be lowercase", etc. could be deadly and function without them could be dangerous if used by another developer in support.
People always say, "you are a human, find the balance!", but when it is suggested to extract 3 lines of code to a separate function, making it 7 lines of code, where is a balance? What about Occam's razor?
To put in a nutshell, I love functional decomposition, I see that most of good software uses it, but until some technique invented better than "just nest a 'utils' or 'details' structure or namespace", I will be in twenty minds about over-extracting functions. Please help me, if you have good recommendation here.

Again, this list is short, just issues "on a surface".
Answers to the code review points

The total variation at the end will just be a small fraction of the total time your program runs, so you could ignore it, but you could also avoid mostly it.

I totally agree. The question is, is there a way to do this better or mitigate this? I mean, the statement is correct, but "so what?" question follows.

If the total time your program runs is not changed when you use 2 times less threads, then that means your program is not CPU-bound, and instead having more threads just makes it less efficient.

I am sorry, my wording was bad. Of course, I meant "nothing changed dramatically from the perspective of threads management"; the performance reduced with less threads number, but "as expected"; just wording. When I reduced the number of threads in 2 times, the performance degraded but this didn't lead to much benefit from savings on threads start/stops as you pointed out. So, no such influence here.

You should decouple the size of the chunk from the number of cores. For example, if you have 8 cores and 16 chunks, you start 8 threads and have each thread process 2 chunks.

I can't catch what you intend to achieve with this? For every core I will have two smaller chunks instead of one larger chunk, I will spend some (negligible, of course) effort to split two times more, but what I would be expected to win and in which way? I can implement this, but to implement this in correct way I need to understand the goal. Can you please help to catch it?

Another reason I mentioned this is that if parallelism doesn't give you the speedup you expected, then maybe you should focus your attention to the serial steps in your algorithm.

The code is on the table and it is quite simple. I am not sure this would be an easy take fruit to speed up this with linear execution in 4.4 times like I have on multithreaded CPU and I expect more on GPU. Do you have any clues what can be done to improve the linear version?

std::copy is the best case scenario for memory access. Your algorithm might not be able to achieve the same bandwidth.

Of course, it wouldn't, I am just saying that I am not memory-bound with this task, as you suspected in code review iteration one. With only one reservation, although in the next quote:

I think it is likely you can get more performance. I would first identify where the bottleneck really is, and measure the time for setting up the chunks, for running the threads, and for creating the compiled_text vector afterwards. Using a profiler like perf might also help finding out where most of the time is spent.

Of course, I do this from the early days, since performance is critical. The main bottleneck which could be considered for optimization is this std::map. The 80% of time I work with it for searching and adding and this could be improved. I have some ideas with plan structures like std::vector with B-tree inside without expensive memory operations and cache-unfriendly std::map on large data, but this is another story. It wouldn't be an easy taken fruit as multi-threading seems to be here.
Answer: To me this looks like a classic map-reduce problem. I would implement a map and reduce functions, of which mapping of chunks looks like

Setup thread local datastructures (no thread safety needed, because they are used by only one thread) and assign one to each worker

If the current chunk is bigger than threshold, divide it in half and search for closest end of a token, then generate two tasks from that (go to 1 again)

If the chunk is smaller or equal to threshold, perform normal tokenize

This allows a worker to concentrate on its own task and not contending on resources with other workers. With worker being threads, it will improve data locality thus leading to doing more useful things per CPU cycle.
After the mapping process finishes, the reduce part could be like the following:

Agree on common lexem ids

Post a task for each worker to establish lexem rename maps

Create a hashmap with value type being atomic (if false sharing is established to be a problem, pad entries to break false sharing)

Post task for every worker to sum the results of the index together

Although it looks like 4 might contend to update the same memory page, there will be at most number of worker contentions once, instead of number of workers multiplied by possible occurences. I do not know how long step 1 of reduce will take, but given sufficiently big text, I suppose it will be faster.
With the algorithm above, there will be multiple small taxes on performance (dividing the task, posting tasks for each worker, data structure allocations) and two big (establishing common lexem id map + rename maps for each worker). Number of unique lexems is likely much smaller than the text itself.
Static chunk scheduling suffers from variability in CPU time availability for the process. In most computing, the launched program is not the only running on the machine. Getting scheduled out might eat into CPU time of the process thus creating unevenness, stalling the other CPUs from progressing. Dynamic task scheduling with dividing the task into smaller chunks makes more work, but works a lot better in most situations.
Non-composable threading is not great example of executor. The code in question does not provide any means of cooperating with other threads in the program, nor does it allow the work chunks to be executed on something else. It would be great to be able to separate work division/scheduling from executor.
Comment: @DamirTenishev, about cooperation, your functions could be used as part of a library, that library might have its own opinions on what the number should be, then there is OpenMP/oneTBB/etc trying to compete for resources. OneTBB has better composability (not 100% as it cannot attach to threads spawned outside of it, but usually has constant amout of threads for the whole program).
Comment: Thank you for the review. Agree on most points. Some notes: (1) "Post a task for each worker to establish lexem rename maps". Nice catch, thank you! (2) "The code in question does not provide any means of cooperating with other threads" with only one reservation, `TextBaseMultiThreaded::tokenize' takes as an optional parameter the number of threads to be used; not so much, but something is this meaning. (3) "It would be great to be able to separate work division/scheduling from executor." not sure it worth doing here; can you share examples of such architecture in C++ to follow?
Comment: @DamirTenishev, my experience is mostly based on intel oneTBB, so it went along the lines of either throwing more tasks into task arena/group/graph. Unfortunately there is no agreement on what task means. Most of the time it was something along the lines of `std::function`/coroutine spawning more of themselves or returning a value/stopping. I would try to setup conan/vcpkg and play around with existing libraries like libunifex from facebook, intel's oneTBB, Boost.ASIO and others. Note that OneTBB allows using the caller thread to engage in the parallelism, thus providing natural way to sync.
Comment: @DamirTenishev I forgot the if in point of 4 of reduce. It is unlikely to be a problem given a good diversity of lexems, but if profiling establishes false sharing to be a problem, it might be worth it to break false sharing.


why wont ubuntu let me download microsoft products

Question: I would like to download Microsoft 8 to evaluate. Why will Ubuntu not run the windows setup.exe file. Any help would be really appreciated
Comment: It did allow you to download an `.exe` file, but you are not able to *run* it. That are two different things. If you want to evaluate Win8, then you probably need an existing windows system or a way to burn a CD/DVD (if you was provided with an iso). You can also try wine.
Answer: You wouldn't say you car wasn't "letting you" drive it if you filled it with the wrong fuel. The software you're trying to use is not designed for Ubuntu; it's designed for use on Windows. The same basic principal applies to most operating systems. The software is not simply cross-compatible.
I assume the "Microsoft 8" you're talking about is Windows 8. That is not clear but assuming I'm right, if you want to try it you'll need a plain ISO image that you can burn to CD/DVD (Brasero or k3b would be the applications you would use).
If the exe is just a downloader (like the old MSDNAA downloaders for students), you might be able to use Wine but your mileage may vary.
Again, this software is designed for use under Windows so the easiest route is going to be using a Windows machine. If you have access, and you don't want to get involved with Wine/etc, that's the easy get out.
Answer: Ubuntu hasn't stopped you from downloading anything.  It has stopped you from running / installing something.
This is a bit like asking why your shiny new mp3 player can't play your grannies old gramophone records: They are both music but they are in different formats.  In the same way Ubuntu is not Windows and Ubuntu and Windows do not understand each others program files.
Some Windows programs will run using a compatibility layer called Wine.  You can find Wine in the Software Centre but it does not work with all programs: check the Wine application database first.
The next option is a Virtual Machine.  There are several available Virtualbox is popular and can be found in the Software Centre too.  If what you have downloaded is an iso image for Windows 8 you can install this inside your Virtual machine.  If its not but a Windows application instead you will need to install Windows in the Virtual machine first.
Finally you can choose to dual boot both Ubuntu and Windows but both this option and a virtual machine will require legally licensed Windows install media.
Answer: Jammy, Welcome to AskUBUNTU.com
If I understood your question well, it is simply because unless you use programs like WINE` , etc there is no way of running win32 applications on Linux kernel.
If you would like to evaluate Windows 8, install VMware and specify a virtual machine for it (i.e. 1 CPU core, 1 GB of RAM and 20 GB of Hard-Disk) to test and see how it goes for you.
Answer: Ubuntu will not run exe as it's intended to run in windows only.
It's the same as you can't install a linux package(rpm,deb) in windows.
Still in Ubuntu it gives you a virtual platform named Wine to run windows software  but i don't anything such exists in windows to run linux software/packages.


What does the implementation of .NET string.Split(char[], StringSplitOptions) look like from inside?

Question: That is if we were to see how Microsoft wrote this method what would it look like?
I'm mainly interested in the use of the StringSplitOptions enumeration with the other parameter and how they probably structured their code to account for each option.
Answer: To find out what the implementation looks like for any part of the Framework, you can do one of two things:

You can download the .NET Framework Source Code from here, or
You can use a decompiler, like Telerik JustDecompile.

The latter choice is by far the easiest.
I downloaded and installed JustDecompile, and loaded up .NET Framework 3.5.  Then I opened up mscorlib.dll (where the String class is located) and looked at the Split methods.
Without getting into too much detail, there's an if statement that checks the StringSplitOptions enumeration, and runs one of two different methods depending on which StringSplitOptions setting is specified.  The two methods are called  InternalSplitKeepEmptyEntries and InternalSplitOmitEmptyEntries.  They are pretty much two completely different implementations.
Comment: The source to the method is now online: http://referencesource.microsoft.com/#mscorlib/system/string.cs
Comment: -1 DeCompiling shows the compiler's ultimate *interpretation* of the developer's implementation, not the actual implementation. It's very possible you'll see an optimized version of the code.
Comment: @RubberDuck: Which is why I also mentioned the Reference Source.  That said, the decompilation and the original source don't differ *all that much;* many of the transformations you would see amount to syntactic sugar, and much of the optimization occurs in the JIT, not in the compiler.  Which you would have known had you compared the reference source to JustDecompile's output.
Comment: In this case, maybe, but the compiler can do a lot of arcane magic, particularly when async/await or lambda expressions come into play.


Are incenses burned inside LDS temples like the ancient Jerusalem Temple? Why or Why not?

Question: I apologize if this question is not appropriate because I understand and I respect that the ordinances performed within the walls of LDS temples are sacred and holy and are not talked about. However, I know they are not secret (as there are open houses), so I'm not sure if asking about incense burning qualifies as an ordinance or not. If it is, please feel free to remain mum about it, but if it's permissible to talk about -- can an LDS member tell me if incense burning occurs in modern LDS temples akin to the Jerusalem Temple? Why or why not?
Comment: I don't know for sure so I won't post a full answer, but I believe the burning of incense [was symbolic of prayer](https://www.lds.org/scriptures/ot/ps/141.2?lang=eng#1), which has its own place in the modern ceremony. Further, [burning incense was a ritual of the Law of Moses](https://www.lds.org/scriptures/ot/ex/30.34-35?lang=eng#33) which was fulfilled when Christ completed the Atonement.
Comment: This is an appropriate question. And to answer the first part, incense is not burned in LDS temple ceremonies.
Comment: Thanks for letting me know it's an okay question! I wasn't sure.  Do you happen to know why incenses are not burned like in the original Jerusalem temple?
Answer: No, incense is not burned in LDS temples.
In the temple at Jerusalem, and in some traditional Christian liturgy (such as the Catholic mass), burning incense is used as a symbol for prayer, which ascends to heaven and is pleasing to God. It is also a symbol of the Savior Jesus Christ.
As part of the LDS temple ceremony, participants gather around a table representing an altar to pray. A temple worker kneels to lead the prayer, just as the priest offered prayer in the temple at Jerusalem. Prayer is offered on behalf of those attending, as well as friends and family members with specific needs.
The symbolism and ritual used to teach in temples shares ancient roots with Jewish and Catholic ritual, but has been adapted to meet the needs of people today.
Answer: My best response is that the burning of incense was used with burnt sacrifices which were symbolic of the forthcoming sacrifice of Christ. When Christ came, he "fulfilled the law" and live sacrifices were no longer needed.
The LDS faith recognizes Christ as the Savior and having fulfilled that law and thus no longer needing sacrifice (burnt offerings, and incense). Instead, God requires a broken heart and a contrite spirit as our sacrifice, meaning we appreciate the value of the Atonement such that we apply it in our own life through repentance, turning to Him, accepting the gift of the Atonement, keeping the commandments. We partake of the sacrament each week in remembrance of Him. Christ said "in me the Law of Moses has been fulfilled and a new law I give unto thee to love one another...."  No longer was the law an eye for an eye but forgiveness (7 x 70) because he had fulfilled law and we can now trust in it. I hope that helps. :)
Comment: Welcome to Christianity SE and thank you for your contribution. When you get a chance, please take the [tour] to understand how the site works and [how it is different than others](https://christianity.meta.stackexchange.com/a/1809/50259).


Why do some metals with bcc structure show ductile-brittle transition in charpy impact test?

Question: I was learning about the charpy impact test and came across the graph on this webiste that shows the impact energy for bcc and fcc structures as a function of temperature. I tried searching for an explanation as to why the graph differs for the two crystal systems but couldn't find any. Some places say it's because of the slip planes but I still didn't understand.
Comment: The question should be  "why do some BCC  steels show a brittle transition and others do not ?" . Many BCC steels are very tough ; Had one nearly stop the Charpy hammer ( it is one of those things where people in the room look around and say "what just happened ?".
Comment: @blacksmith37 Oh Okay thanks can you suggest an edit?
Comment: There is a library full of information . Mostly starting with WW 2  Liberty ship brittle fractures. But some going back to the Boston molasses tank failure of about 1900. The Naval Research Lab started the serious research because of the liberty ships ( Authors : Pellini, Puzak , Goode , Judy, etc ). Now generally under the heading of Linear Elastic Fracture Mechanics and Fracture Toughness.
Answer: It essentially depends on the fracture mechanisms available to the material at the temperature in question. In general, dislocations are more mobile at higher temperatures, enabling plastic deformation and ductile fracture.
FCC materials have more slip systems, or ways for dislocations to move, than BCC materials. A metal needs five independent slip systems to plastically deform. As you lower the temperature, certain slip systems will be "frozen out", meaning that it is essentially impossible for dislocations to move according to that slip system. Because BCC metals have fewer slip systems to start with than FCC metals, they become brittle at higher temperatures than FCC metals.
Answer: No one has found the mechanism after over 100 years of investigation; Admittedly I have not followed literature for about 20 years. Some steels have a low transition temperature = good toughness ; some steels have a high transition temperature = poor toughness. There is a library full of techniques to improve toughness , but no basic understanding of the mechanism causing poor toughness in some BCC steels.


How to compute the mass flow rate for a turboprop at cruise given the static sea level value?

Question: I am trying to obtain the mass flow rate of the Allison T56-A-15 used on the C130H at cruising altitude (so as to solve the Joule-Brayton cycle at cruising altitude). I know from "Turboshaft, Turboprop and Propfan: database Handbook" that the mass flow rate is 14.7 kg/s at static sea level (not sure about the meaning of this). In order to compute the mass flow rate at cruising altitude, what should I do? I've tried writing $\dot{m} = \rho A_{in} v_{TAS}$ but in this way I obtain a value of mass flow rate that I consider excessive. Any suggestions?
Comment: Hi and welcome to the site. I have changed the title to match the problem you're solving. Please check the edit and see if other improvements can be made.
Comment: Mass flow is determined by the thrust.
Answer: What you are attempting to calculate is an off-design operating condition based on a known reference point (Sea Level Static performance, which is usually off-take performance).
You cannot simply do this by hand, this requires a model for the engine and knowledge of the off-design characteristics of the engine (map characteristics, e.g. compressor map), furthermore you need the cruise power specification.


How writing in debugfs controls ftrace?

Question: Ftrace is controlled by manipulating the debug fs files. But how is it possible ? How kernel be aware of writing in this files and start its required actions?for exmple if 1 is written to tracing_on , kernel turns on tracing .
Is it something related to a special file structure or kernel subscribes to changes of debugfs or I'm missing something obvious ?
Answer: I think I found it . according to this link
In the kernel, a character-type device is represented by struct cdev, a structure used to register it in the system. Most driver operations use three important structures: struct file_operations, struct file and struct inode.
As mentioned above, the character device drivers receive unaltered system calls made by users over device-type files. Consequently, implementation of a character device driver means implementing the system calls specific to files: open, close, read, write, lseek, mmap, etc. These operations are described in the fields of the struct file_operations structure:
struct file_operations {
struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
[...]
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
[...]
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *, fl_owner_t id);
int (*release) (struct inode *, struct file *);
[...]

so we can initialize above function pointers with our desired functions.
for example for tracing_on this is the initialization in kernel/trace/trace.c and the functions are implemented in the same file:
static const struct file_operations rb_simple_fops = {
.open       = tracing_open_generic_tr,
.read       = rb_simple_read,
.write      = rb_simple_write,
.release    = tracing_release_generic_tr,
.llseek     = default_llseek,
};

and also this is the code for creating this directory:
trace_create_file("tracing_on", 0644, d_tracer,
          tr, &rb_simple_fops);

Comment: The code in /sys/kernel/debug/tracing is implemented by the tracefs file system. You can look at the code in fs/tracefs. The tracefs file system is a pseudo file system, which means there's no actual hardware behind it (like debugfs and tmpfs). By writing 1 into tracing_on, it triggers several system calls (sys_open, sys_write, sys_close), which will follow those functions you point out, and eventually you get to rb_simple_write() which will call tracer_tracing_on() which starts enables the ring buffer to allow recording.

How writing in debugfs controls ftrace?


Reliable Rankings of US Universities?

Question: I am aware of US News which publishes the rankings for US Universities every year.
But somehow I feel that they try to emphasize more on private universities than public(state) universities.
Also they have recently stopped showing the rankings according to fields of study(CS, ECE, Mechanical, etc) without paying them.
Google also could not help me find any reliable ranking organisation.
I would like to know whether there is any respectable ranking organisation other than US News.
Comment: No one said that US News is reliable. :) Seriously!
Comment: @paulgarrett I was thinking of making that comment, but then I couldn't decide if anyone ever said they were respectable either.
Answer: Both of these organisations are International but you can search by region and study area.
Top Universities is complied by the QS Quacquarelli Symonds
This page explains the methodology they use to rank institutions.
The Times Higher Education rankings are compiled by the Times Higher Education magazine in the UK with the help of Thomson Reuters. According to their site

rankings employ 13 carefully calibrated performance indicators to provide the most comprehensive and balanced comparisons available, which are trusted by students, academics, university leaders, industry and governments.
Comment: Unidimensional rankings are pretty meaningless. For example, Times Higher Education says the world's greatest school is Cal Tech, with Oxford second. What in the world does that mean? You go to those schools for completely different reasons. They claim that Berkeley is better than Yale. Well, Berkeley and Yale are completely different places; one is a big state school in a major metropolitan area, while the other is a small private school in a small city where there's nothing to do but go to bars and drink.
Comment: I think Times ranking is not logical at all. Top Universities is the best of the 3 for me.
Answer: If your goal is a general list, @gman's answer, as well as other general guides, will do.
If your goal is to select a graduate program to apply for, I recommend phds.org.  You can specify which criteria are most important to you: research productivity, support for graduate students, diversity, funding, etc.  Based on your choices, you will get a personalized ranking of the graduate programs in your area.
Comment: In principle, it makes sense to have this kind of multidimensional ranking. In practice, I wasn't  impressed with the phds.org web site. It's disorganized and buggy, and they try to get users to provide a lot of private and irrelevant personal information so they can spam them and call them on the phone. Also, their rankings don't seem very accurate, e.g., in physics they rank Yale immediately below Cal Tech and Stanford, which is utterly wrong -- Yale is much, much lower. (I got my PhD in physics from Yale.)
Comment: I totally agree with Ben on this one. Although the website also provide some useful information.

Reliable Rankings of US Universities?


Java android client communication with C# server

Question: I am currently writing an application having a client server architecture.
The client is a Java android application
The server is a C# application.
The client will pull data from the server but in some cases push some data to the C# server as well.
The data that server needs to forward the clients is list of data structures (perhaps in the form of XML?), sometime binary data like files.
The client and server are communicating over a wireless network.
Speed and scalability is my top most priority in the design of the system,...
I have to write server as well as the client myself. I will  be using sockets for communication.
I need your advise on the form of protocol I should use to exchange data between the Java client and C# server.
Should I write similar data structures (which seems redundant) in java and C# and serialize them ??
or should I exchange xml ??
I am not sure yet what is the best way to do it ..
Essentially there will be commands from client and server will respond with data
Please advise me on this topic the data communicated could be be as large as several gigs over wifi so speed is very important.
Comment: Overly broad for a SO answer.
Comment: It is a concern I need to address at the architecture/design level. I think have been specific about technologies.
Answer: I believe WCF might be approperiate for this, WCF uses soap so a Java implementation should work well.  WCF also supports steaming, so transferring large files is possible, though I'm not sure if Java supports the streaming protocol.
As for performance, you will probably be limited by the speed of the device and not the protocol.
Answer: It would probably be worth looking into MonoDroid if you want to share code between client and server (and if serialize/de-serialize makes sense).
As I don't know what you're building, I would advise you to read up on REST before you continue though. It should give you valuable pointers on how to create a nice API that can be easily consumed by various clients.
Answer: Have a look at this session from TechEd 2011: "My Customers Are Using iPhone/Android,But I'm a Microsoft Guy. Now What?"
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DPR304
Answer: Well, there's always JSON.  It should be well-supported on both ends and is easy for your server to generate and client to consume.  Not sure it helps with your bandwidth concerns any...


How can i convert a modulated DSB-SC signal to a SSB-SC signal?

Question: I am designing a simple transmitter using an SI5351A to generate the carrier, then modulating it with a diode ring modulator to generate a dsb-sc signal, then somehow converting it to ssb modulated signal to send into a class E amp, but I'm not sure how to extract just one sideband from the dsb signal, I know it can be done with filters but with my frequency changing I would need to change the filters dependent on my transmitting frequency, is there another way to achieve this?
Comment: Traditionally, with filters at IF, then mix up to where you want it. But first, I don't think you can transmit SSB with a class E amplifier, at least without some careful predistortion. Can you clarify - why class E - what's driving the modulator? - why not just modulate, filter and mix up?
Comment: i'm was thinking of driving the modulator with a carrier of the frequency i want to transmit from the SI5351A, i'm using class E because i'm a beginner to PA's and class a or ab amps are well out of my knowledge, but i suppose i could use an if, then mix it, then feed it into the amp and maybe it would work
Answer: That makes no sense: you wouldn't convert the already modulated, high-powered signal to SSB.
That would require steep filters at the RF frequency, and that filter needs to also be low-loss and high-power capable. That's prohibitively complicated and expensive, and sometimes not even physically possible.
But: you already have a chip that can produce two different tones, and you want to have suppressed carrier: This would suggest you want to go with a superheterodyne transmission scheme!
You'd mix your audio with a relatively low frequency (say, 140 kHz), use a filter to get rid of one sideband and the carrier, then mix with your target frequency minus 140 kHz, and use another filter to get rid of the carrier and the unwanted mirror at the target frequency - 140 kHz. Done! Amplify that.
Of course, that's a very 1940s way of doing this. Realistically, instead of analog mixing to IF and filtering there, you'd just directly produce the single-sideband IF signal, e.g. in a microcontroller. Much easier, much cleaner. Your listeners will prefer that ;)

ssb modulated signal to send into a class E amp,

Class E?? Oh well, then this does make even less sense.
With a class E amplifier, your amplifier is also your mixer.

Figure from the original paper introducing the class E amplifier, [1 ]
As you can see in the diagram from [1 ], there's a switch you need to actuate. In fact, you need to actuate it at the intended RF architecture. The switch switches (haha) the input signal and thereby amplifies its amplitude; class E is highly efficient for constant envelope signals, because in that case, the "active switching device" (essentially, a transistor) will be "on" or "off" most of the time, and only very shortly in a transition between these states, where it dissipates power as heat. So, you drive the amplifier with a square wave of the up-conversion frequency.
Now, you're applying this amplifier topology to an AM signal; that means you need to vary the power flow into the amplifier, and in the diagram above, that equates to modulating the "DC POWER SUPPLY"[2 ]. That's fine – but it's not lossless thing (it depends on the efficiency of another amplifier supplying the DC voltage), compromising the efficiency advantage of the class-E amplifier.
But: That's fine! Square waves can easily be used in the generation of SSB signals; use two class E amplifiers in parallel, but drive them with two square waves that are ¼ period out of phase (that will require a PLL if you want to derive these square waves from your SI5351A; you usually wouldn't do that, but get a synthesizer that offers you an inphase and quadrature oscillation to begin with), and add their output (using an RF combiner, typically). You'd then numerically generate a sine and a cosine of half your audio bandwidth, mix your audio (typically, also numerically) with that separately, and use a low pass filter on each branch. Feed one branch each into one of your class-E amplifier's modulation input.
Done, you just built a Weaver modulator; the magic is that adding your sine and cosine-modulated audio cancels out one sideband.
Honestly, though, this is where the complications begin, and you'll notice that gain differences (which we'd call IQ imbalance in a direct conversion mixer) need to be compensated for spectral cleanliness. It's really not clear to me why in a AM waveform application of a beginner, a class E amplifier is the way to go. There is a lot of attractiveness in combining phase-offset class E amplifiers, especially in suppressing the harmonics, but to realize these advantages would take feedback loops, thus modelling of the behaviour of the amplifier pair as control system, and thus a lot of math. And at least in the microwave region, I don't think this is done commercially – certainly not because it's mathematically intractible, but because component (and especially switching speed) imperfection make this an architecture hard to tame. There are experimental application of class D / class F with some matching (which kind of is close to being class E, but is distinctively not class E) for HF that I'm aware of. That's a clever choice: with modern FETs and modern gate drivers, we can directly apply pulse-width modulation, and get something that works over a larger frequency and amplitude range without changing component values. Compared to the class C, a practical class E would probably only have minor advantages on the efficiency front - and with digital predistortion being a commodity function in silicon-integrated RF chains, I'd assume that you'd much rather find class C amplifiers than class E among those practically employed with a matched load for fixed frequency.

i'm a beginner to PA's and class a or ab amps are well out of my knowledge,

Wow! Honestly, I'm more of a discrete-time, Laplace and Fourier kind of guy than an analog circuit design guy, but even for me, the way class-E works is (much) harder to understand than class-A or class B, which can essentially be understood from DC inputs (and extended to modelling in a couple parasitic capacitors should one need to understand the high-frequency behaviour).

[1 ] Nathan O. and Alan D. Sokal, "Class E – A New Class of High-Efficiency Tuned Single-Ended Switching Power Amplifiers". IEEE Journal of Solid-State Circuits, June 1975
[2 ] Fredreick H. Raab, "Idealized Operation of the Class E Tuned Power Amplifier", IEEE Transactions on Circuits and Systems, December 1977


using the Arduino internal reference 1.1v

Question: So i want to measure a resistor of around 20 ohm in a voltage divider with an Arduino UNO R3.
Is there any way on an arduino to use 1.1v instead of 5v?
I want to do this to decrease the current, because the resistor to be measured is a small speaker.
Comment: Can't you use a resistor in series with one you are testing?
Comment: The ATMega328 and presumably other related processors allow you to use Aref or and external voltage close to it or the internal 1.1V reference - it's just a matter of selecting the reference via bits specified in the ADC section. I THINK you can get the 1.1V ref available on ARef if you do this - see the processor data sheet (about 600 pages )..
Answer: The Arduino Uno R3 has a default Reference Voltage of 5V.
You can change it to 1.1V using the analogReference() command as follows:
analogReference(INTERNAL)

Or you can apply an External reference to the ARef pin (0V to 5V):
analogReference(EXTERNAL)

Similar, but different, commands exist for the Mega.
From a circuit perspective, I assume you have an external voltage to apply to your resistor. If the external voltage is not that accurate connect it to an Analog pin for calibration purposes (<1.1V). Or if it is accurate use that as an External Reference.
Answer: You can use the 1.1V reference to change what the ADC measures the incoming voltage against.  You can't use the 1.1V reference to do the actual measuring though.
That is, you have no access to that 1.1V from outside the chip to connect your resistance to.  You would have to provide your own 1.1V (or lower) supply to the resistor network to provide a voltage in the 0-1.1V range.  Typically you would then also connect that supply voltage to the \$V_{REF}\$ pin and switch to the external analog reference.  That would give you more accurate results since you are measuring it against the same voltage that is used to generate the output you are measuring.


How would one go about getting the USA to brain drain Russia by giving out green cards?

Question: It has been suggested that offering green cards to Russians with STEM degrees can be an effective sanction against Putin. What would the political process for that be? Which political body in the USA could make such a decision?
Comment: This question is not opinion based in the least, neither in this version nor as originally posted.  The political process for modifying immigration criteria can be described objectively.  The powers of various US government entities in making such decisions are well specified by constitution, statute, and regulation.  Measures that American and Russian citizens can take to bring about these changes are well known (though for Russian citizens there's not much on the list).  I've voted to reopen the question.
Answer: Since the collapse of the Soviet Union in 1991, millions of "Russians" have emigrated to western countries, mostly to the United States (see here) and Israel (Jewish Russians, see 1990s post-Soviet Aliyah), and to lesser extent to Europe and Australia. I put "Russians" in quotation marks, since westerners has been for decades calling Russian everyone coming from the USSR, even if they were Ukrainians, Georgians, Latvians, etc.
This immigration included many skilled immigrants, notably scientists - that is not simply people with advanced University degrees, but some world-known E.g., Alexei Abrikosov received his Nobel Price as an American for the work that he had done many years ago while working in Soviet Union. Garry Kasparov is another high profile example of a former "Russian" living in the US.
With Russian borders open (unlike during the Soviet era), anyone wishing to develop their research or engineering career in US or Europe was free to do so, as long as they had enough talent to compete with the locals and those coming from elsewhere (India and China are two notable sources of qualified Western manpower).
Thus, what we are facing now is rather a possibility of a reverse trend: in its desire to hit "Russians" some western countries crack on scholarships and visas for Russian citizens (e.g., Belgium) - ironically hitting the very people who are more pro-western. This is not a new phenomenon - e.g., Japanese Americans were famously interned in concentration camps during the World War 2 (see Internment of Japanese Americans). Similarly, Jewish and political refugees from Germany wandering in Europe were interred in camps at the beginning of the war as enemy citizens, and later often delivered to Germany, when the host country was overrun by the Wehrmacht.
Comment: I don't think this answers my question. Entrance to USA is not currently free, one needs a visa. An H1B visa takes half a year to get, and there are quotas. An O1 visa can take years to obtain https://mobile.twitter.com/alexeyguzey/status/1498051043925581826 Many USA companies require permission to work in USA before you can apply for a job.
Comment: @seed The point is that by now there is not much left to drain: all those who wanted to leave Russia, but couldn't do so previously, have done so in the last three decades, whereas the newly minted degree owners are not more valuable than those coming from elsewhere - there is no reason to give them special advantage. Note also that Universities are exempt from the H1B quotas, and student F-1 visa has rather favorable conditions for further staying in the US.
Comment: But there are reasons: 1. It would weaken Putin's regime and punish him for the aggression; 2. It would make USA richer and create jobs, since a huge proportion of immigrants become entrepreneurs; 3. It would make the immigrants themselves richer and give them access to basic human rights... US visa policies never treated all foreigners equally in the first place, e.g. there is a Visa Waiver Program for some countries but not others, and the Jay Treaty gives some people a special advantage based on their race. Anyway, my question is how to achieve this, not whether you approve of it.
Comment: You might have a somewhat distorted view of Russia: it is a developed country, where people do have *basic human rights* (despite possible problems with democracy) and where the level of life, although lower than North America or  the EU, is still comparable to those - people buy cars and houses, go to vacations to warm countries, etc. This especially applies to those with university degrees.
Comment: Article 5 of Universal Declaration of Human rights: No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment. People get routinely tortured in Russian prisons. Article 7: protection against discrimination. Gay propaganda is banned. Article 15: No one shall be arbitrarily deprived of his nationality. Oleg Sentsov was issued a Russian passport against his will. 18, freedom of religion: Jehova Witnesses are banned. 19, freedom of opinion: people go to prison for expressing opinions. 20, freedom of assembly: rallies get dispersed, participants arrested.
Comment: @seed One can cite all this to say that there are problems in Russia, but it still doesn't change the fact that most people live rather normal lives. There is plenty of palce between the heaven and the hell. The US, e.g., is a *flawed democracy*, but one doesn't see many Americans running to Europe or Canada (even though some do).
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/134526/discussion-between-seed-and-roger-vadim).
Answer:
What would the political process for that be?

Congress could amend the Immigration and Nationality Act, which establishes the criteria for admitting new immigrants to the US.

Which political body in the USA could make such a decision?

Congress, through the normal procedure for enacting statutes (which means that the president must assent or that congress must override the veto).  There are various decisions vested in the president or the Secretary of Homeland Security, but they do not have the authority to create new categories of immigrants, and they do not have the authority to increase the number of immigrants eligible for existing categories.  The president can increase the refugee quota but cannot make refugee status contingent on educational credentials.


Sketch: cut item in half with particular pattern

Question: I'm trying to take a heart icon and cut it in half with a zig zag or lightning shaped pattern so it looks like this broken heart.
Answer: Here is my solution:
We have heart icon (I just downloaded it from https://thenounproject.com/)

Modify icon that corner points placed exact on pixel grid intersections it will help us later. Place rulers on this points:

Place rectangle on one half of the heart.

Choose rect and select Edit by pressing button on toolbar. Add two point exact on rulers intersections, it will snap automatically. These point should be in Straight mode.

In Edit mode add point that will represent zig zag. All points should be Straight.

Group heart and rect shapes into group, duplicate group and rename them Left and Right.

Temporarily hide Right group by pressing the eye icon. Select rect and heart icons in Left group and press Substract button on toolbar. Now you have left half of broken heart :)

Select left group press Rotate button on toolbar place rotation point exact on lower rulers intersections. Then rotate left half by for instance 5 degree using mouse

Hide Left group, then select right rect and heart shape and press Intersect button on toolbar, now we have right half of the heart

Select right half, press Rotate button, move rotation point to lower rulers intersections and rotate by moouse for -5 degree.

Unhide left half, and final result is:

Download Sketch file
Answer: I don't use a Mac so have no access to Sketch, but most vector editors work in a similar way.
In the documentation for Sketch I see that it says you can use boolean operations.
Here's a quote from the page here

Boolean Operations
When the shape you need is not among the standard shapes you will have
  to create it yourself. The first impulse might be to to use Vector
  tool and draw the shape from scratch. However you will find that many
  times, a complex shape is easy to break down into the basic shapes.
  With boolean operations you can do exactly that; combine basic shapes
  to create more complex ones.

And it lists the operations in a diagram

So you could easily draw the heart shape, and draw the zig zag shape with the Vector Tool (sometimes called the Pen tool in other applications) to overlap the heart, then select both and apply the Subtract boolean operation.
Here's a similar drawing, but in Inkscape - the similar boolean operation is called Difference in Inkscape; the idea is the same. The same is also possible in Adobe Illustrator with Minus Front, in the Pathfinder.


What is the mechanism for reduction of alkylmercuric compounds by hydrides?

Question: What is the mechanism of the reductive elimination of mercury metal using hydrides that is carried out after oxymercuration of the alkene? I have come across a free radical mechanism, but that suggests loss of the stereospecificity of the product, while the reaction is stereospecific in reality. Also, why isn't an acid sufficient to remove the mercury as it is with alkynes? Why is a reducing agent necessary at all?
Answer:
The reducing agent NaBH4 is used for this reaction because it is highly selective. If H2SO4 were used in place of NaBH4 in this reaction the molecule would be dehydrated and we would probably see some HgSO4 form as well. The main thing to remember here is that a reducing agent has much more selectivity than an acid solution.
Comment: Do organomercury compounds in general give alkanes with acids (save the case when alcohol groups are also present in the compound, or any such groups which might also react with the acid)? Grignard's reagents are also organometallics, and they do.


Why are lens hoods rectangular for professional videocameras, and why not for DSLRs?

Question: Why do videographers have rectangular lens hoods available? Do they only use internally-focusing lenses? Lastly, why don't DSLRs use rectangular hoods?
Answer:
Why do videographers have rectangular lens hoods available?

Primarily because videographers frequently mount rectangular filters such as NDs and ND grads, and for the ability to use flags or barn doors to more finely control light blocking.
Light control is more important in videography than in photography, because one exposure control variable, shutter speed, is not a free variable under the videographer's control (they are limited by the frame rate for the video). The adjustable barn doors / flags correspond to the image's aspect ratio crop. Of course, straight-edged barn doors that correspond to the rectangular aspect ratio allow for tight light control, as well as being easy and inexpensive to manufacture. Rounded or curved barn doors with adjustable cone shapes are a lot more complicated and expensive to make, and are not useful because they don't match the aspect ratio crop.
Adjustable barn doors are not as useful in photography. The photographer's position is typically more fluid / transient, and even when it's not, shading and flagging needs are usually only for a few shots, and can be easily controlled by an intern with gobos or block cards, or stands with clamps to hold the gobos.

Do they only use Internally-focusing lenses?

Pretty much, yes. But not necessarily exclusively. All of the cine lenses I've seen are internally-focusing (but my experience with cine lenses is rather limited). Non-IF lenses are undesirable in videography because everything in front of the lens (matte box, filters, etc.) have to move in conjunction with focus changes. And because of the weight of matte boxes and filters, they aren't mounted onto the lens; they are mounted on the video accessory rails in front of the lens.

Lastly, why don't DSLRs use rectangular hoods?

Most photographic lens hoods are round (or tulip shaped) for compactness. A round lens nestled in a round hood in a round or round-ish lens pocket or camera bag compartment allows us to be more space-efficient with our gear.
Note that some photographic lens hoods are rectangular. While not DSLRs, many hoods for rangefinder camera lenses are rectangular. As WayneF notes in his answer, the tulip-shaped hoods on many DSLR lenses are the approximate intersection line between the projected rectangular field of view and a cylinder or cone.
In the context of slide-in square or rectangular filters, rectangular hoods are not very convenient in photography. Videographers never have to worry about orientation: their video is always presented in landscape orientation1. Photographers frequently change between landscape and portrait orientation. For shooters who use them, directionally-oriented filters (such as polarizers and ND grads) need to be large enough to be usable for either orientation. Note that ND grads and polarizers must maintain the same position/orientation with respect to the scene, regardless of camera orientation. As I mentioned, that isn't a concern in videography (for the most part). But in photographic uses, that requirement of orientation-independence strongly implies rotational symmetry, i.e., circles. That doesn't require filters to be circular; rather, it implies that if a filter covers a certain circular area, it is guaranteed to cover the lens's entire image circle, regardless of camera orientation. This is one of the reasons you don't typically see hoods mounted in front of square/rectangular filter holders on photographic cameras. But you often see matte box filter holders with barn door, bellows, or other rectangular hoods in front of them.
For photographers who do need or want rectangular hoods or matte boxes, they are available. Those users are just a relatively small portion of the DLSR-wielding population.

1 : I'm not talking about people who take vertical videos with their smartphones.
Comment: Mostly good answer, but the rotational symmetry part assumes that you can attach the hood any direction you like onto the lens. *Some* lens hoods — particularly the generic ones that attach to the filter threads — do allow that, but lens hoods purpose-made for a specific lens generally click into the proper orientation. Thus, as the lens rotates around its axis, so does the hood.
Comment: @WarrenYoung that part I was actually referring to filters, and rectangular filter holders. Photographers need their ND grad filters & polarizers to work in any camera orientation, so they tend not to be used in the context of a matte box with a built-in aspect ratio. My point there was that rectangular matte boxes like used in video don't work as well in photography. But you are right, and after rereading, I can see that my point wasn't very clear.
Comment: In videography shutter speed is in effect a free variable via shutter angle. But the shot may constrain the variable to ensure a specific look, necessitating external light control.
Answer: The tulip shaped hoods are a rectangular field...  http://www.google.com/search?q=tulip+lens+hood
Comment: Yes. To clarify, for anyone too lazy to click through the link, the odd shape we call "tulip" with lens hoods comes from taking a circular lens hood and projecting the imaging area's rectangle through it, clipping away the parts that the sensor simply can't see. Then the shape is rounded off a bit from there. Thus, a tulip lens hood effectively adapts a round shape (the end of the lens) to a rectangular shape (the rectangular pyramid of the imaging area projected through the hood' space).
Comment: Specifically, the [Lens hood article at toothwalker.org](http://toothwalker.org/optics/lenshood.html) has good illustrations of the various lens hoods (at the bottom of the article). I wish they were CC-BY-SA licensed, those are excellent illustrations.


Visual Basic infopath print button XDocument not declared

Question: I have an InfoPath form where I am trying to add a print button and add visual basic to print the form.
What I have done so far:
1) Add a button to the form
2) in button properties click edit form code...
3) The code is as follows :
Imports Microsoft.Office.InfoPath
Imports System
Imports System.Xml
Imports System.Xml.XPath

Namespace Performance_and_Development_121_form

    Public Class FormCode

        ' Member variables are not supported in browser-enabled forms.
        ' Instead, write and read these values from the FormState
        ' dictionary using code such as the following:
        '
        ' Private Property _memberVariable() As Object
        '     Get
        '         _memberVariable = FormState("_memberVariable")
        '     End Get
        '     Set
        '         FormState("_memberVariable") = value
        '     End Set
        ' End Property

        ' NOTE: The following procedure is required by Microsoft InfoPath.
        ' It can be modified using Microsoft InfoPath.
        Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup
            AddHandler DirectCast(EventManager.ControlEvents("CTRL97_60"), ButtonEvent).Clicked, AddressOf CTRL97_60_Clicked

            AddHandler DirectCast(EventManager.ControlEvents("PrintForm"), ButtonEvent).Clicked, AddressOf PrintForm_Clicked
        End Sub

        Public Sub PrintForm_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
            XDocument.PrintOut()
        End Sub
    End Class
End Namespace

The only thing I added was XDocument.PrintOut() the rest was generate already.
I am getting an error saying XDocument is not declared, this is the same when I add thisXDocument
I am using InfoPath 2010 and Visual basic
Answer: I think you have the answer here:

XDocument is only available in the 2003 object model.  In 2007 and 2010, you would use this.Print();


Can I speed up iCloud photo sync between iPhone and Macbook?

Question: I have an iPhone 5 running iOS 9.1 and a Macbook Pro running Yosemite.
Both devices are set up to sync photos to and from iCloud.
When I take a photo on the iPhone (for further processing on the Macbook), it takes an inordinate amount of time until the photo shows up in the Macbook's photos library - sometimes up to 10-20 minutes. Sometimes it seems to work faster if I quit the Photos app on both devices, and start it again.
I often end up sending myself photos through E-Mail because it's quicker. That seems ridiculous!
Is there a way to force a sync on the iPhone, or to speed up the process some other way?
Comment: I have the same problem. Nowadays photos will take until the next day to show up on my MacBook (the day after I took the photo on my iPhone). It used to work almost instantaneously, but within the last couple of months it started taking overnight.
Comment: I've had ok experiences the past couple of months when opening Gallery (or Photos, or whatever it's named, I forget) on the iOS device. I have some version of iOS 9 installed. To the very bottom it will now say something along the line of "uploading x pictures" and it'll synchronize reasonably fast.
Comment: What did you find to start analyzing this problem?
Answer: When you take a photo from your iPhone, switch to the Photos app. At the very bottom of the Photos tab, you should immediately see the indicator Uploading…
If your MacBook is plugged in to a power source and/or has the Photos app open, it will download photos as soon as they are in iCloud.
Both your devices need to be connected to Wi-Fi for the aforementioned to occur.
The key is for you to open the Photos app on your iPhone. It used to upload as soon as you connected to Wi-Fi (possibly only if you had sufficient battery), but as of iOS 9 that no longer appears to be the case. I'm guessing this was done to keep from eating up your bandwidth while you may be doing something else.
If you don't open the Photos app, your iPhone will upload new photos if it is connected to a power source and locked, and it has sufficient battery.
Update: Starting with iOS 10, I am once again seeing immediate uploads of photos from my iPhone when connected to Wi-Fi, whether I'm using the phone or not, and whether connected to a power source or not (might still need to be above 50% battery). Low power mode should be turned off too.
Comment: It took me a long time to realize that keeping my phone on low power mode was preventing my photos from being uploaded to iCloud.
Comment: I added a photo on my MacBook Pro and it says "Updated just now". I launched Photos on my iPhone (iOS 10.3.2), locked it, plugged into a power source and it is at 89% and on WiFi. Its "Last updated" is 2.5 hours ago. ¯\\_(ツ)_/¯
Comment: Easy way to test is to do a "Copy iCloud link" for a photo you want to push to iCloud. This function can only work if the photo is pushed to iCloud. If it fails it will give you an error with a meanfull description for example "Upload paused. These photos will continue uploading when your device is no longer in Low Power Mode".
Answer: I've an iPhone running 9.2 and MBP running El Cap (Photos v1.2). I do the following:

Open Photos on my MBP and let it stabilize (finish its startup processing).
Take a photo(s) on my iPhone.
View the photo(s) on my iPhone -- even just popping into and out of the app is enough to ensure the sync process has started.
Return to my MBP, and the photo(s) appear there, usually within 2 minutes.

The syncing of the photo on OS X corresponds with the process photolibraryd jumping to the top of my process list, as viewed in Activity Monitor. I think the key is to have Photos open and switching into Photos on iOS -- the latter step signals the app that you have stopped taking photos and it's safe to start the sync. More experimentation is obviously needed, for example, I've not yet been able to see if photolibraryd runs on a periodic schedule, or if some other process signals it that there is new data in the cloud that needs to be sync'd.
Answer: No, unfortunately the process is completely automated and no "force sync" exists, you simply have to wait.
Obviously understand that your iPhone needs to be on Wi-Fi (and the faster this is the better) for the sync to iCloud to happen. Photo app sync doesn't happen over 3G / 4G.
For me this process is lightning quick - I take a photo on my iPhone 6S and within seconds my Photo's are updating through iCloud. Now, I should point I'm checking the upload through www.icloud.com and not the Photo's app but you could do the same to check if at least the iPhone is getting the shots up quickly and whether the slow down is between iCloud and your Mac.
Answer: You absolutely can speed up iCloud photo sync. Server.app can run on most any Mac and act as a caching server.
Once you've set up the caching server, you can opt in to caching your iCloud data (encrypted and secured) on the local server which in my experience greatly increases the download time from iCloud to a device.
I haven't experienced any upload delays of more than a few minutes lately, but that might also be affected by the caching server and wireless sync peer to peer if you update the iOS and mac OS devices.


When typing something in the URL bar in Safari with google as my default search engine without pressing "enter", does google log what I've typed?

Question: When typing in the URL bar in safari with google as my default search engine without pressing enter (i.e not actually searching), does the text I've typed or my IP get logged to google?
Answer: If you have search suggestions enabled, which sends each keystroke to Google so that it can provide you with a list of possible completions, then yes, they will know your IP. Otherwise you will only connect to them when you press enter. I do not know if Safari uses suggestions by default.
Comment: Hi, is autocomplete the same as suggestions? For example, when I type something in the URL, there's a drop down menu with possible completions I can choose, it doesn't complete in the URL itself.
Comment: Yes, search suggestions is what I meant. My bad.


Web ReportViewer authentication

Question: I need some help with authentication when using the web reportviewer to view SSRS reports.
In IIS I've set "Windows Authentication" only and unchecked "Anonymous Access" and the other checks in the Directory Security tab. The result in my website is that WindowsIdentity.GetCurrent() returns the ASPNET user and Request.LogonUserIdentity the domain account of the user that logged in. On the page that hosts the ReportViewer control, I programmatically impersonate the Request.LogonUserIdentity, then set all the report/server properties and refresh the ServerReport, however this returns the "The request failed with HTTP status 401: Unauthorized." error and I'm 100% sure the Request.LogonUserIdentity has access to the report. To proof the impersonation worked, WindowsIdentity.GetCurrent() returns the same user as Request.LogonUserIdentity after the impersonation and I'm using the same impersonation when I need to query the database, just with a specific user.
I've noticed that on the ReportViewer1, the ServerReport property has a property for ImpersonationUser, but I'm not able to set this and can't find where to either.
Can anyone shed some light please! I've been working on this for days now....
Answer: It's not clear why you need to do impersonation yourself. If you're using Windows Authentication and have disabled anonymous access, then simply let ASP.NET flow the end-user's credentials to Reporting Server. Try adding the <identity> element to your web.config file:
<identity impersonate="true" />

Another issue you might be encountering (if your Reporting Server is on a different machine to your web server) is the NTLM double-hop problem and you may need to configure Kerberos in order to support credential delegation over multiple machines.

Web ReportViewer authentication


how to stop repeated content in view

Question: I am showing content from product content type of commerce module using view but view is showing some repeated content.how to solve this problem.
Answer: Did you check How do I remove duplicates when using the random sort? before?
If it does not help you check views_distinct module

Relationships or other joins in Views often create "duplicate"
  results. For example, a node with a field that has multiple values may
  show up in the View once per value in the multi-value field. It's
  frustrating, and the "DISTINCT" SQL query option in the Views UI does
  not actually solve the problem because the result row is technically
  distinct. This module aims to give a simple GUI method to remove or
  aggregate these "duplicate" rows.

how to stop repeated content in view


How to detect in runtime is KASLR enabled or disabled?

Question: How to detect if KASLR is enabled or disabled in runtime?
Answer: To answer the question:
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.14.27-041427-generic root=UUID=f3f8e7bc-b337-4194-88b8-3a513f6be55b ro quiet splash loglevel=0 vga=current udev.log-priority=3 fastboot kaslr acpiphp.disable=1 crashkernel=384M-2G:128M,2G-:256M vt.handoff=7

Answer: I wasn't satisfied with the prior answers as they really don't get to the meat of validating what KASLR is all about - especially embedded or custom kernels that don't implement the same kernel command-line interface (e.g. ARM64 requires a device-tree chosen node called kaslr-seed to be present when the kernel boots. This is usually implemented by the bootloader using a secure random number generator).
At runtime I know of two things you can check:

the /proc/kallsyms file to see the symbol addresses in virtual memory address space.
lsmod to see the kernel module addresses in virtual memory address space. Note: On some machines, lsmod may not show the addresses. In that case, try using cat /proc/modules as root. If not using root, the addresses may be all zeros (cleared for security reasons). ~~Thanks to user @crass for the comment!~~

Both 1 & 2 are similar checks, but depending on what's available to you on your system, you might need to use one or the other.
1. /proc/kallsyms
To do so, simply look at the first few lines of /proc/kallsyms:
root@device:~# head -n 3 /proc/kallsyms
ffffff8008080000 t _head
ffffff8008080000 T _text
ffffff8008080800 T do_undefinstr

Note that the address for, e.g., _head is ffff ff80 0808 0000.
Now reboot your machine and check again.
root@device:~# head -n 3 /proc/kallsyms
ffffff9fc8c80000 t _head
ffffff9fc8c80000 T _text
ffffff9fc8c80800 T do_undefinstr

Note that the address for, e.g., _head is now ffff ff9f c8c8 0000.
Compare the high-level bytes and find that ffffff80080 != 0xffffff9fc8c so the addresses are being changed across reboots => KASLR is enabled.
2. lsmod
Similar to /proc/kallsyms method above: check lsmod, reboot, check lsmod again, and compare the addresses.
root@device:~# lsmod
iptable_filter 16384 0 - Live 0xffffffa1c49b9000
ip_tables 28672 1 iptable_filter, Live 0xffffffa1c49ad000

Note that the address for, e.g., iptable_filter is ffff ffa1 c49b 9000.
Now reboot your machine and check again.
root@device:~# lsmod
iptable_filter 16384 0 - Live 0xffffff2100716000
ip_tables 28672 1 iptable_filter, Live 0xffffff210070a000

Note that the address for, e.g., iptable_filter is now ffff ff21 0071 6000.
Compare the high-level bytes and find that ffffff2100716 != 0xffffffa1c49b9 so the addresses are being changed across reboots => KASLR is enabled.
You can do these tests iteratively to determine the quality of the randomness. How different are the addresses across reboots? Are there obvious patterns? The security benefit of KASLR is proportional to the quality of randomness, or entropy.
References:
Debugging Linux Kernels with KASL
Linux Kernel Driver Database for RANDOMIZE_BASE
Comment: On my machine `lsmod` does not show the module addresses. Using `cat /proc/modules` as root shows the addresses.  If not using root, the addresses may be all zeros (cleared for security reasons).
Answer: Check your kernel command line. (example on debian 8)
$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-`uname -r` root=/dev/mapper/`hostname`-root ro quiet

kASLR is available starting with Ubuntu 14.10 but it is not enabled by
  default. Specify the "kaslr" option on the kernel command line to use
  kASLR.
Note: Enabling kASLR will disable the ability to enter hibernation mode.

source: https://wiki.ubuntu.com/Security/Features
Comment: Now kASLR is enabled by default on Ubuntu. So this check won't work.  See @bhass1 or my answer for a better method of kASLR detection.
Answer: I like @bhass1's answer here, however I didn't want to have to reboot my computer to do the test.  So you can perform essentially the same test but in a virtual machine, if that's available to you.  I'm using qemu with the -kernel and -initrd options, and here's how I do it:
First, I check which kernel you're running by looking at cat /proc/cmdline
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.2.0-42-generic root=/dev/sda1 ro vt.handoff=7

So I'm using kernel vmlinuz-5.2.0-42-generic.
We need to run the kernel with an initrd just to have a minimal environment to be able to check the addresses.  I use the initrd that corresponds to my kernel, to make the simulation more real, but it really should not matter.  I also use the kernel commandline of the running kernel, to keep the simulation as close to the running kernel as possible, and add break=top to the kernel commandline to get to a shell as quickly as possible.
Next, I run the qemu virtual machine:
sudo qemu-system-x86_64 -m 1024 -kernel /boot/vmlinuz-5.2.0-42-generic \
  -append "$(cat /proc/cmdline) break=top" -initrd /boot/initrd.img-5.2.0-42-generic

When I get to the shell I get the loaded module addresses:
(initramfs) cat /proc/modules
usbhid 57344 0 - Live 0xffffffffc0269000
hid 131072 1 usbhid, Live 0xffffffffc0248000

Now I'll check the running system to see what the module address is for one of the modules to see if its different:
sudo grep hid /proc/modules
hid_generic 16384 0 - Live 0xffffffffc20ac000
usbhid 57344 0 - Live 0xffffffffc1a09000
hid 131072 2 hid_generic,usbhid, Live 0xffffffffc1c96000

So we can see here that the addresses for the hid module are different (running: 0xffffffffc1c96000 and virtual: 0xffffffffc0248000).  So my kernel is running with kASLR, even though its not on the kernel command line (its turned on by default now on some distros).
You can check the module address again in another qemu instance and verify that the module address changes on every qemu run.  Also, you can add nokaslr to the kernel commandline (the -append qemu option) and run qemu a couple times to verify that the module addresses do not change.


modelling the sound wave of a guitar string with an equation

Question: Currently I'm doing a physics related coursework on guitar strings and wave. I would like to ask how I can model the sound wave of a guitar with an equation. I asked some of my teachers and they told me that I should use Fourier analysis, but after reading it from Wolfram Alpha and doing a few example questions, I still don't know how to model the sound wave of a guitar. Can someone give me some advice or tell me if I'm doing anything wrong?
Comment: I believe in particular that [this answer](http://physics.stackexchange.com/a/111916/26969) from the question @ja72 linked in his comment is most helpful in explaining what you need to do. Note also that different frequencies will be damped to different degrees in a real guitar - so the amplitudes of the components change with time.
Answer: So the shape of the string (of length $\ell$) is defined with a general series equation that depends on constants $A_1,A_2,\ldots$ and $B_1,B_2,\ldots$.
$$ y(x,t) = \sum_{i=1}^{\infty} \sin \left(\frac{i\pi x}{\ell} \right)
\left(
  A_i \sin \left( \frac{i \pi c t}{\ell} \right)+ B_i \cos \left( \frac{i \pi c t}{\ell} \right)
\right) $$
The wave speed $c$ is defined from the tension $T$ and the mass per length with $c^2 = \dfrac{T}{{m}/{\ell}}$
If you can fit the initial shape of the plucked string into the equation above, and match the coefficients then you can know the relative amplitude $\sqrt{A_i^2+B_i^2}$ for each frequency $f_i =i \frac{c}{2 \ell} $ for $i=1\ldots\infty$
reference: http://hyperphysics.phy-astr.gsu.edu/hbase/waves/string.html
To match the shape of a plucked string with a finger a distance $x_p$ from the end of the string use $$ y(x,0) = \begin{cases}
  Y\frac{x}{x_p} & 0\leq x \leq x_p\\
  Y\left(1-\frac{x-x_p}{\ell-x_p}\right) & x_p > x \leq \ell
\end{cases} $$
and $\dot{y}(x,0)=0$ since the string is at rest initially. This yields the following coefficients (using Fourier analysis) with $i=1\ldots n$ coefficients. How to choose the number of terms $n$ is up to you.
$$\begin{align}  A_i &= 0 \\
B_i &= Y \frac{2 \ell^2 \sin \left( \frac{i \pi x_p}{\ell} \right)}{\pi^2 i^2 x_p (\ell-x_p)} \end{align} $$
Finally, to go from the string shape to the corresponding wave amplitude of sound is beyond my abilities and maybe someone else can chime in.
Answer: To some approximation -- probably a pretty bad one -- a guitar string is described by simple wave equation for small enough oscillations. If $y(x,t)$ is the displacement of a portion of the guitar string $x$ meters from the fretboard, at time $t$, then the equation governing the motion is: $$c^2\frac{\partial ^2 y}{\partial x^2}= \frac{\partial^2 y}{\partial t^2}$$
 This short equation gives rise to all of the animations in the wikipedia page I linked, and it is solved by any solution of the form $$A\sin(\frac{\omega}{c} (x-c t)+\alpha)$$, where $\alpha$ is a constant angle, $A$ is in meters and is the amplitude of the wave, and $\omega$ is the [angular] frequency of the wave.
This equation also has solutions of the form $f(x-ct)$, for ANY function $f$. This means you can have a waveform of any shape travelling down the string.
In addition to that, ja72's method also solve the wave equation.
And finally, you can solve it numerically. I wrote this little seventeen line javascript program for situations like this! Watch out though, the code may still be too complicated. In the limit of an infinite number of circles, this simulation solves the simple wave equation. The only rule in the simulation is that neighboring circles influence each other (in the vertical direction only) according to Hooke's law.
Comment: Hey, Great Code. I did a spin off, that simulates the plucking action a little better. Look at https://www.khanacademy.org/computer-programming/string-pluck-code/6480604953706496
Comment: @ja72 fun simulation!


Definite article before cardinal number in official document

Question: The bothering sentence is:
"Custom duties fees for the 99 boxes"
The document is only about this 99 boxes, no other quantities are mentioned, in other line above this sentence is written "Missing 99 boxes in container".
So no need to highlight this boxes as it is clear we are speaking only about the same boxes.
Please advise with rules
Comment: I will add that articles are seldom about clarity. It's very easy for a native speaker to understand speech or writing from which all the articles have been removed. For the most part, we use them where "the rules" tell us to use them, because not doing so sounds strange to our ears.
Comment: Can you expand on just what the situation is here? As it stands it is a bit hard to tell the background. Who sent the boxes? Why are they missing? What is the container involved?
Comment: You write: **it is clear we are speaking only about the same boxes**. This is precisely why the article is used—to indicate that we are referring to the boxes that were just mentioned.
Comment: @Lena Al Could you please ask a clear question? All you've done is describe a situation
Answer: Using the definite article, the writer is speaking about a specific or certain object:

Custom duties fees for the 99 boxes

means reference to a specific collection of 99 boxes that the custom duties apply to, as opposed to

Custom duties fees for 99 boxes

refers to any collection of 99 boxes.
In the second sentence:

Missing 99 boxes in container

The emphasis is that boxes were not in the container and were missing, it could be rephrased:

The 99 boxes were missing from the container

However, to change the used sentence to

Missing the 99 boxes in container

would be a bit awkward.


Adverse Events for Avastin - vision issues

Question: I need a list of the adverse events for Avastin drug. I mainly would like to see a list of adverse events concerning vision issues.
Answer: This API call should help you get started with all adverse event (AE) reports involving Avastin:
https://api.fda.gov/drug/event.json?search=brand_name:avastin&limit=100

but be sure to read through the comprehensive docs at https://open.fda.gov/drug/event/reference/ to see if you want to be searching for a subset of this data set which is where Avastin was the suspect drug. I am not 100% sure that would be possible through the API since you want to limit your search to a nested object.
To search for only AE reports where a certain AE related to vision was reported, you'll want to look through the list of all AEs from the above API call (https://api.fda.gov/drug/event.json?search=brand_name:avastin&count=patient.reaction.reactionmeddrapt.exact) and then filter based on those.
You can also use a more user-friendly tool that Brian Norris and I built at http://researchae.com. Here's a hyperlink to only Avastin AE reports.
Hope this helps and good luck!


What are the documents necessary for a 15 year-old Nepalese to travel to India?

Question: I live in Nepal. I  will be 16 this December but I need to travel to India in September. I will get my citizenship only when I am 16. I neither have passport or voter card. I will be travelling alone. Can I travel? What are the documents required?
Comment: Jonathan, Your flag is invalid. Here a Nepalese citizen is travelling to India who does not have a passport issued by Nepal Govt.

Both are entirely different things, Your mark does not taste good!
Answer:
Nepal and Bhutan nationals if entering India by land or air from the
  Nepal or Bhutan border respectively do not require a passport for
  entering into India. However, they are required to possess, authorized
  identity proof. Further if they are entering India from a place other
  than their own country then possession of passport is a must.

No you do not require to have either a passport or a visa to enter India.
For more info read here
Hope it helps!


What is the worst scenario if I stop paying the last four months of rent?

Question: So here's my situation. I have signed a pretty standard rent contract saying that I would rent an apartment in Atlanta for 12 months (August 2019 to July 2020). Because of COVID, I have vacated the apartment and will not be returning. So, the apartment is empty and noone will be living in it, yet I still have to pay $XXXX/month for the next four months. Does anyone know a way around this? What is the worst thing that could happen if I just don't pay my rent?
Comment: You can of course try to negotiate with the landlord: offer to pay a smaller amount $YYY in exchange for terminating the lease.  The landlord might accept this because they can then re-rent the unit immediately, so $YYY is potentially pure profit to them.  Of course, if they don't think they can easily find a new tenant, they may not accept your offer.
Answer: Financially, the landlord can take you to court and get a judgment against you where you have to pay that rent, so you won't save any money. If you hire an attorney to defend you in the lawsuit, that will cost you extra money, so you could be worse off than just paying rent and staying there. The lease might have late payment fees, and if you that would be additional money that you would owe. In addition, there could be some reputational damage to you that could affect your ability to secure a lease in the future (a black mark on your credit history). Also note that in Georgia, a landlord has no obligation to seek an alternative tenant, so he can let the unit sit empty for 4 months (though he cannot collect twice on the same unite).
Answer:
So, the apartment is empty and noone will be living in it, yet I still have to pay $XXXX/month for the next four months.

Not necessarily.  There's a second option.
You leave the unit broom-clean and fit for showing. Why? Because you need the landlord's voluntary help here, and you need to do everything you possibly can to help the landlord say "yes". Obviously if you left the unit in an unfit state, then the landlord has no earthly reason to help you, outside of fear that you won't pay the owed rent.
Now, you ask the landlord to offer the unit and re-let it before the lease is up.  (Once, I did my own advertising and found a tenant acceptable to the landlord. Worked slick as  a whistle).  Anyway, the landlord puts the unit back on the market.  With any luck, a new tenant is found, the landlord accepts your surrender of the property, and you're off the hook.  In most states, this "duty to mitigate" on the landlord's part is the law.

Now, what can the landlord do about it?  Depends how serious the landlord wants to be.  First, the landlord can report you to a credit reporting agency, and take a big bite out of your credit rating, especially where landlords are concerned: no one will want to rent to you for 7 years.  So congrats, future homeowner!
The landlord can also dun you indefinitely. The landlord can either hire a collection agency to dun you, or outright sell your debt to a collector.  At that point, you'll get collector robo-calls and mails relentlessly and constantly.  After some years the debt will be time-barred (statute of limitations expired), but the collectors will keep calling - especially if they have data showing that you're doing alright.  They figure you don't know it's time-barred.  You can tell them to stop, but then they'll just horse-trade the debt to another collector who you haven't told to stop.  That can go on for 20 years.
Lastly, the landlord can sue you.  People don't sue over trivial amounts, but since you used a 4-digit figure to describe your rent, it's surely at least $4000. The landlord knows you're out-of-state and rather unlikely to contest the matter.  So going to court over $4000 is probably worth it.  The court judgment resets the statute of limitations to a longer number.  Now the landlord can go after your assets which are reachable in Georgia, bank accounts in banks that do business in Georgia, wages from an employer who operates in Georgia, etc.
Comment: @Moo Because restarting the clock on the time-bar/statute of limitations requires the consent of *both* parties (otherwise what would be the point of it?)  The "stop calling me" provision is from the FDCPA, which is Federal.   It has limits.
Comment: @Moo: Well, you can write your legislators and tell them you think so.  But the counter-argument might be that if the creditor wants the assistance of the courts in collecting the debt, he'd better bring his case within a reasonable amount of time.  As years pass, important evidence (to either party) can get lost, and important witnesses may lose their memories or become impossible to find.
Comment: If the debt is valid and being actively pursued, why can it either expire (I thought that was just for debts that were not being actively pursued in a timeframe) and why can the debtor just tell the collection agency to "stop" (if its valid, and the agency is correct in pursuing it, surely a debtor cannot just tell the agency to go away)?
Comment: Seems ludicrous that a debtor can simply run the time out on someone actively pursuing the debt, by either of those approaches.