join lines

Question: on a windows form, i have RichTextBox, with some text, in several lines. and one button on a form.
i wolud like when i click on that button, to join all richtextbox of lines in one line, but not to loose text style (like font family, color, etc.)
i can not do it with Replace, like \r\n, and not with the Replace(Environment.NewLine, "")........
:-((
i have also tryed to replace \par and \pard, but still no luck.......
please help!!!

richTextBox1.Text = richTextBox1.Text.Replace(Environment.NewLine, "");

this one is not ok, because with that loose font definitions (color, bold, undesline etc).
ok, again to be more specific...
i have RichTextBox control, with 4 lines of text:
line 1
line 2
line 3
line 4

line 3 is colored red.
i need to get following:
line 1 line 2 line 3 line 4

(and that "line 3" be red as it was before).
when i try with
richTextBox1.Text = richTextBox1.Text.Replace(Environment.NewLine, " ");
... i get:
line 1
line 2
line 34

"line 2" is colored red.
what do i have to do, to solve this problem?
Comment: Sorry, your question is not very very clear. What happens when you do Replace? Can you include a 'before' and 'after' example of what you want?
Answer: This will work:
        // Create a temporary buffer - using a RichTextBox instead
        // of a string will keep the RTF formatted correctly
        using (RichTextBox buffer = new RichTextBox())
        {
            // Split the text into lines
            string[] lines = this.richTextBox1.Lines;
            int start = 0;

            // Iterate the lines
            foreach (string line in lines)
            {
                // Ignore empty lines
                if (line != String.Empty)
                {
                    // Find the start position of the current line
                    start = this.richTextBox1.Find(line, start, RichTextBoxFinds.None);

                    // Select the line (not including new line, paragraph etc)
                    this.richTextBox1.Select(start, line.Length);

                    // Append the selected RTF to the buffer
                    buffer.SelectedRtf = this.richTextBox1.SelectedRtf;

                    // Move the cursor to the end of the buffers text for the next append
                    buffer.Select(buffer.TextLength, 0);
                }
            }

            // Set the rtf of the original control
            this.richTextBox1.Rtf = buffer.Rtf;
        }

Answer: The TextBox control has its own methods for finding and replacing text. Take a look at this article (it's VB.NET but I hope you will get the idea): http://www.codeproject.com/KB/vb/findandriplace_rtb.aspx
Answer: I bet you're just calling Replace on the text string, what you need to do is something like this:
richTextBox1.Text = richTextBox1.Text.Replace(Environment.NewLine, "");

The key here is that you need to assign the result of the function to the text of the rich text box, otherwise nothing happens. See, strings are immutable and whenever you perform an operation on one you must assign the result of the operation to something (even the original variable will work) otherwise nothing happens.
Answer: I think this help you:
StringBuilder strbld = new StringBuilder();

for (int i = 0; i < this.richTextBox1.Text.Length; i++)
{
   char c = this.richTextBox1.Text[i];

   if (c.ToString() != "\n")
      strbld.Append(c);
}

MessageBox.Show(strbld.ToString());

ok, ChrisF is right. How about this:
string strRtf = richTextBox1.Rtf.Replace("\\par\r\n", " ");
strRtf = strRtf.Replace("\\line", " ");
richTextBox2.Rtf = strRtf;

:-|
Comment: This will just concatenate the text, and strip the formatting

join lines


Non-surjectivity of $\exp$ map for non-compact Lie group.

Question: I have often read that the exponential map from the Lie algebra of a non-compact Lie group is not surjective, however the product of exponentials involving the compact and non-compact generators of the algebra is surjective. At the moment such a proof is beyond my capability, might someone be able to give me a reference to this result (preferably the original paper, I think it may have been due to Cartan)?
Answer: For some non-compact Lie groups such as $\text{SL}_2(\Bbb R)$ it is the
case that not every group element is a power of a Lie group element.
See Proving that any element of $\text{SL}(2,\mathbb{R})$ can be expressed as $\pm\exp(z)$.
On the other hand, there are non-compact groups such as $\Bbb R^n$
(under addition) where every group element is a power of a Lie group element.
Comment: @SigmaAlpha That's not so special. In fact, *every* element of *every* real  connected Lie group with Lie algebra $\mathfrak g$ can be written as $\exp(X).\exp(Y)$, for some $X,Y\in\mathfrak g$. This was proved in 2003 by Martin Moskowitz and Richard Sacksteder.
Comment: Hi Lord Shark, that thread you linked was posted from my other account. Are you saying that non all elements of a non-compact lie group can be represented as a product of exponentials from the Lie algebra? The link below claims the contrary, that all elements of $\text{SL}(2,\mathbb{R})$ can be represented as a product of two exponentials. One involving the compact generator and one involving the non-compact generators of $\mathfrak{sl}(2,\mathbb{R})$. Although I haven't been able to find a reference for this claim... http://www.physics.drexel.edu/~bob/LieGroups/LG_07.pdf
Comment: I think $\text{SL}(2,\mathbb{R})$ is a special case... since we can express any $N\in\text{SL}(2,\mathbb{R})$ as $\pm\exp(z)$ for some $z\in\mathfrak{sl}(2,\mathbb{R})$ and since $-Id$ is in the image of the exponential, it follows that any element can be expressed as the product of two exponentials.. right ? But I am looking for something much more general than this, something about non-compact groups in entirety.
Comment: Thank you Jose, this is what I was looking for. I think I have found the paper, although it is from 2008.

http://intlpress.com/site/pub/files/_fulltext/journals/mrl/2008/0015/0006/MRL-2008-0015-0006-a010.pdf
Comment: Actually this is probably the one you are talking about. http://www.kurims.kyoto-u.ac.jp/EMIS/journals/JLT/vol.13_no.1/moskola2e.pdf


Which coins can butterfly-labs miners mine

Question: Can I use a butterfly-labs miner to mine any crypto-currency?
Answer: Look at http://dustcoin.com/mining.  The currencies designated as having SHA-256 algorithms (e.g., Bitcoins, PPCoins, Namecoins, and Devcoins) stand a good chance of being mined with BFL-like ASIC mining hardware. Remember, some currencies support merged mining - mine once and get paid in multiple currencies. Either your centralized pool supports merged mining or you have to do it on your own.
Answer: The Butterfly Labs miners definitely work for Bitcoin, I have one, it works as advertised (better in my case) and mines successfully.


making scalloped potatoes, need to be in oven for 3 hours,what temperature should I have them on

Question: I need to put scalloped potatoes in the oven for 3 hours, what tempterature should I have them on?
Comment: What is the need to have them in the oven so long?
Comment: I think until you explain your reasoning for this time period you are unlikely to get good answers.
Answer: I found a recipe for slow baked potatoes that has the potatoes in the oven for 3 hours set at 350F. According to the author:
"The accepted practice is to bake potatoes for an hour. But here's how long to bake a baked potato if you want it to be nutty and soft: three hours, yes, that's no typo, it really is 'three' hours. The skin and flesh are both completely delicious when slow-baked for a long time."
Recipe here.
However, I am unsure whether this theory holds true for scalloped potatoes. Most scalloped potatoes recipes I came across had the potatoes being baked in the oven for ~1 hr at ~350F.
Comment: @JSM I can understand worrying about overcooking, but *dangerous*?
Comment: @Jefromi Not dangerous like base-jumping while drunk.  Danger isn't always life threatening...  That being said, I am not sure at what temperature potatoes and/or dairy carbonizes or ignites.  Probably 450 or more.  Still not jumping-dangerous, but possibly burn-out-your-oven dangerous.
Comment: I want to try that 3 hour baker.  But as far as the question, I would think three hours at anything above 250 or so would be dangerous.  Scalloped potatoes usually include dairy (milk and/or cheese), and I think the proteins in there wouldn't like a long, slow cook like that.  It may take a few tries, but I would imagine baking around 300 covered for 2-2.5 hours would be ok, then uncover, add cheese on top, and up the temp to 400 to get the bubbly crust.
Comment: @JSM I knew you probably didn't mean it'd blow up your house, but you just said "dangerous", no way for anyone to have any idea what kind of danger you meant. And I definitely disagree: you're not going to set anything on fire. Even without the liquid, you'd at worst char things, but it'd just ruin your food (and maybe your pan). With scalloped potatoes, worst case is burning/browning it onto the pan, and charring the top. (But at 350F I'm not sure you'd even char the top in 3 hours...)
Answer: Baking mine at 265F for 2.5 hrs. Same as my spiral cut Ham. Turned out beautiful. No char, no burning. Milk proteins stayed intact and became the creamy addition they were meant to be. I used half and half.
Answer: 350° for amt. time, check slice. Also use greased, Pam fine, whatever vessel using!!!


Can we clear inventory_reservation table. Magento2.3.1

Question: I have recently upgraded to 2.3.1 and noticed that some of the salable quantities do not match the actual quantities. I make sure that there are not more pending or processing orders and that everything is complete. Is it ok to delete the reservations? Would it cause any problems?
Comment: did you find an answer?
Comment: I upgraded to 2.3.2 and still the same. No solution yet
Comment: I also have this q.. just tried deleting the row and the stock appears correctly in backend and frontend so it looks ok to me..
Answer: In Magento 2, main quantity which you see in the qty field of the product might be different than salable quantity. Customers can buy buy products according to salable quantity only. Salable quantity is calculated using main quantity in product and entries available in inventory_reservation table for that product.
Logic of salable quantity for any sku is:
main quantity + (sum of quantity field for that sku in inventory_reservation table)

What is stored in inventory_reservation table?
inventory_reservation table tracks quantity of sku let's say ABC in any order. If an order is placed, a new entry is created in inventory_reservation for sku ABC and value of quantity field is -1. When shipment is created for this order, a new entry is created with quantity +1.
Please remember when a order is placed, main quantity of the product will not decrease instantly but salable quantity will decrease according to above logic.
For example, sku ABC has 10 quantity and order is placed for 1 quantity, main quantity remains 10 but a entry is created in inventory_reservation table, with quantity -1. So salable quantity becomes 10 + (-1) = 9. This is the max quantity customers can purchase for this product.
Once the order is complete for any sku, the sum of quantity field in inventory_reservation table becomes 0.
If you see any mismatch in the main quantity and salable quantity even after all orders are completely processed that means some entries are missing in the inventory_reservation table. Any of the order creation, shipment creation, order cancellation, etc entry might be missing in the table.
Can you truncate inventory_reservation table?
If you are sure main quantity and salable quantity is same for all of your sku's available then you can truncate inventory_reservation table.
Alternatively you are also insert the missing entries in inventory_reservation table and both main quantity and salable quantity will be same but this is a long process.
Answer: Disclaimer: I am no magento expert, just sharing my personal experience.
I truncated the inventory_reservation table several times and nothing crashed or misbehaved afterwards. All it did was removing the reservation amount for each sku/product - which is exactly what I wanted. So I would say you can go ahead and give it a try. Just make sure you are not actually deleting the table (just use truncate).
Comment: You are better than Magento experts. They just insist that it can't be done. They are just developers and don't understand the real operational issues that arise. They don't bother to find out or learn. They only focus on development. They are a bunch of ignorant people.
Answer: It will cause several problems, because all the placed orders that do not yet have a shipment will keep a quantity in your reservation table that will be eventually released at the shipment time.
Imagine you have a product with quantity 10 and one order with quantity 2 of such product. The mechanism works as follow:

At order time: quantity is 10, reservation is 2, availability is $qty - SUM(reservation) = 10-2 = 8
At shipment time: quantity is $qty - $shippedQty = 10-2 = 8, reservation is $reservation+$compensation = 2 + (-2) = 0, availability is $qty - SUM(reservation) = (10-2) + (2-2) = 8

So, now, if you drop your reservation table, at shipment time you will have a ghost compensation increasing your availability.
In few words: NO, it is not safe at all unless you know perfectly what you are doing.
Instead, you may want to use:

bin/magento inventory:reservation:list-inconsistencies
bin/magento inventory:reservation:create-compensations
Comment: Given the prerequisite:
> I make sure that there are not more pending or processing orders and that everything is complete.
The case you describe should not be an issue.
Comment: Certainly. Once you've completed all the pending orders, please proceed to clear and organize everything by removing all items.
Answer: Refer below module for Remove Inventory Reservation on Order Place.
https://github.com/AmpersandHQ/magento2-disable-stock-reservation


Why are name_tag and nametag different ID items?

Question: When I enter /give @s name into my chat on MCBE, the autocomplete shows both name_tag and nametag as viable options for items.

Why do they have separate IDs? They seem to stack.
Comment: @ExpertCoder14 but the weird thing is it was introduced in the 1.16.100 update and it has never been a part of the game and it is weird that only this item is affected (maybe because of the legacy id?). Maybe it is, but the weird thing is **they stack**. I was wondering if there was some technical difference for them.
Answer: Unresolved bug: ID changes left behind legacy IDs

The ID changes from this beta are a great step to parity, but now duplicate items exist.
All items that changed their ID have their old ID still as a valid value, eg record_mellohi alongside music_disc_mellohi.
This affects both renamed items and items which got split up (dyes, boats, spawn eggs).
Affected items:

Scute
Enchanted Apple
Dark Oak Sign
Boat
Lodestone Compass
Raw Cod
Tropical Fish
Cooked Cod
Dye
Melon
Glistering Melon
Spawn Egg
Fire Charge
Empty Map
Carrot on a Stick
Nether Star
Firework Rocket
Firework Star
Iron Horse Armor
Gold Horse Armor
Diamond Horse Armor
Leather Horse Armor
Raw Mutton
Cooked Mutton
Popped Chorus Fruit
Totem of Undying
Music Disc - 13
Music Disc - Cat
Music Disc - Blocks
Music Disc - Chrip
Music Disc - Far
Music Disc - Mall
Music Disc - Mellohi
Music Disc - Stal
Music Disc - Strad
Music Disc - Ward
Music Disc - 11
Music Disc - Wait
Music Disc - Pigstep
Banner Pattern
Name Tag


script does not execute

Question: I have rPi B+ running ArchLinux with kernel Linux comp001 3.18.6-2-ARCH #1 PREEMPT Sun Feb 8 09:43:43 MST 2015 armv6l GNU/Linux with Real Time Clock hardware RTC Pi. However, I would like to check if there is internet connection at boot time with running ntp client. If ntp client connects to ntp server and fetches clock, I do now want to sync clock with hardware. I want to use hw clock only when internet connection (ntp client check return code) is offline. I've built a service, which runs ok, but I do not know how to check if ntp client was launched without any problems. How do I chechk that? Ok, I have been working on following script with corrected spaces and still does not work:
#!/bin/sh

if [ ?('modprobe -v rtc_ds1307') = 0 ]; then
    # rtc is connected and working, use it

    echo "RTC Hardware connected, getting time"

    systemctl disable ntpd.service
    systemctl stop ntpd.service

    echo "ds1307 0x68" > /sys/class/i2c-adapter/i2c-1/new_device
    hwclock -s
else
    # rtc is offline / not connected, get time via ntp

    echo "RTC Hardware disconnected/battery dead/offline, use NTP"

    systemctl enable ntpd.service
    systemctl start ntpd.service
fi

Why does exeuction of script fails in first 3rd line with:
./script_rtc.sh: line 3: syntax error near unexpected token `'modprobe -v rtc_ds1307''
./script_rtc.sh: line 3: `if [?('modprobe -v rtc_ds1307')=0]; then'

Answer: I've rewritten the if clause via:
#!/bin/sh

modprobe -v rtc_ds1307

if [ $? -eq 0 ]; then
    # rtc is connected and working, use it

    echo "RTC Hardware connected, getting time"

    systemctl disable ntpd.service
    systemctl stop ntpd.service

    echo "ds1307 0x68" > /sys/class/i2c-adapter/i2c-1/new_device
    hwclock -s
else
    # rtc is offline / not connected, get time via ntp

    echo "RTC Hardware disconnected/battery dead/offline, use NTP"

    systemctl enable ntpd.service
    systemctl start ntpd.service
fi

and now it works ok!

script does not execute


Checking that a sheaf is coherent in the proof of Hartshorne exercise III.3.1

Question: I'm doing Hartshorne exercise 3.1 of chapter 3, which asks one to prove that if $X$ is a Noetherian scheme, then $X_{red}$ affine implies $X$ affine.  To do this, I'm trying to show that the higher cohomology of any coherent sheaf $\mathscr{F}$ on $X$ vanishes.  Letting $\mathscr{N}$ be the sheaf of nilpotents on $X$, we have the filtration
$$
\mathscr{F} \supset \mathscr{N} \cdot \mathscr{F} \supset \mathscr{N}^2 \cdot \mathscr{F} \supset \dots
$$
and the quotients $\mathscr{N}^{i-1} \scr{F}/\mathscr{N}^i \mathscr{F}$ naturally have an action of $\mathscr{O}_X/\mathscr{N} = \mathscr{O}_{X_{red}}$.  I think I can conclude what I want if I can show that these quotient sheaves are actually coherent on $X_{red}$, but I'm having trouble with this verification.  I've tried to use the fact that quotients/pullbacks of coherent sheaves are coherent and I suspect that $\mathscr{N}^{i-1} \scr{F}/\mathscr{N}^i \mathscr{F}$ is the pullback under the natural map $i: X_{red} \to X$ of something like $\mathscr{N}^{i-1} \scr{F}$, but so far I haven't been able to show this.
Answer: You're right, $\mathscr{N}^{i-1} \scr{F}/\mathscr{N}^i \mathscr{F}$ is exactly $i^*\mathscr{N}^{i-1} \scr{F}$. It suffices to verify this affine-locally, so take $X=\operatorname{Spec} A$, $\mathscr{F}=\widetilde{F}$, and $\mathscr{N}=\widetilde{N}$. Then $i^*\mathscr{N}^{i-1}\mathscr{F}\cong (N^iF\otimes_A A/N)^\sim$, and as $R/I\otimes_R M\cong M/IM$, we have $N^{i-1}F\otimes_A A/N\cong N^{i-1}F/N^iF$. Taking the associated sheaf, this gives the claim.
To finish from here, one observes that for any map of noetherian schemes $f:X\to Y$, $f^*$ pulls back coherent sheaves to coherent sheaves and then also that $\mathscr{N}^i\mathscr{F}$ is coherent for any $i$, as both $\mathscr{N}^i$ and $\mathscr{F}$ are coherent.
Comment: Yes, that's correct. It shouldn't be so surprising that there are different sheaves which pull back to the same thing under a closed immersion - basically, the difference between the two sheaves happens away from the image of the closed subscheme in $X$. What is kind of interesting here is that $X$ and it's reduction have the same points, so you have to come up with a slightly funny interpretation of what "away from the image" means.
Comment: Thanks!  I tried the same computation to pullback $\mathscr{N}^{i-1} \mathscr{F} / \mathscr{N}^i \mathscr{F}$ on $X$ to $X_{red}$, and weirdly I get that this pullback is also the sheaf $\mathscr{N}^{i-1} \mathscr{F} / \mathscr{N}^i \mathscr{F}$ on $X_{red}$.  Is this correct / is there some intuitive explanation for why this pullback also equals $i^* \mathscr{N}^{i-1} \mathscr{F}$?


Together forever to the stars in latin

Question: How would I write "Together forever, to the stars" in Latin please? I am looking at getting a ring engraved and would like this on the inside. Thanks
Comment: Welcome to the site! Can you [edit] and add more context, please? For example, who are the people or things that are together? Latin cares about gender.
Answer: I like the approach taken by Vincent in his answer; however, I would make a few tweaks:

The verb coniungere for "unite" seems more suitable than coniugare. It is the word for (among other things) people joined in friendship, love or marriage. There is a particular connection to marriage, and the derived noun coniunx means spouse. (By the way, you could also use unire, from which the English "unite" ultimately derives, but it is not a common expression in Latin.)
I would use a passive perfect form like in English.
For "forever," we should perhaps allow ourselves a little more flourish than semper. Perhaps in aeternum, in pepetuum or in omne tempus.

So I would for example suggest:

In aeternum coniuncti ad astra.
Comment: I like this suggestion a lot. I'd only add a note on gender: If the people being united are all female, it's the feminine *coniunctae*, but if there's at least one male, it's the masculine *coniuncti*, and neuter is an option only if it's not about people.
Answer: What I can contribute
Semper coniugēmus, ad astra.
Comment: Feel free to edit your post and add this information in. It's fine to offer an imperfect translation, but a good answer explains why you have translated it that way. (You can also tweak it as necessary!)
Comment: Hi Valens, and welcome to the site! Could you explain more why this answers the question? Why is _conjugemus_ the best choice for "together", for example?
Comment: Did you perhaps rather mean to use the verb *coniungere* instead of the pretty rare *coniugare*? (Even so, I would have used a passive form.)
Comment: As Simon mentions its the ring that he wants to engrave. I think it's for his marriage. I think of word 'coniūnx' but want to pick the verb. And yes, coniungere' should be more commonly used. Somehow the word 'coniugō' was reflected in my mind. Perhaps the passive form is more suitable. (I may be too ambitious to give my first answer :p)
Answer: There are many good answers to this question. Here are a few:
Semper conjuges, ad astra, always joined together, to the stars.
Semper conjuncti, ad astra, pretty much the same as above, but with more emphasis on the verb "join together".
Or you can do two rings: his and hers: Semper conjunctus, ad astra for him, and Semper conjuncta, ad astra for her.

Together forever to the stars in latin


Do I need special gloves for mozzarella stretching?

Question: I'd like to pick up some gloves for stretching mozzarella. I've seen gloves sold for just this on specialty sites like thebeveragepeople.com and thecheesemaker.com, but I can't tell if they're just a generic product sold as something specific. Is there something generic that will work equally well for (1) hot temperatures and is (2) food safe? I'd like to be able to buy it on Amazon in particular.
Comment: Hi! Your question is a very interesting one. Being a Q&A site, we prefer all "titles" to contain a real question and not just a topic, so I edited it for you.
Comment: @rumtscho : I thought his title was fine ... sometimes it's better when the title isn't a question (like when the title question isn't the same as the body question).
Comment: @Joe It's a networkwide policy to make titles be phrased as questions. In this case, the old one was too unspecific. What does he want to know about mozzarella gloves? It's possible that I misunderstood the body and chose a title which doesn't sum up the problem well, in which case we should try to find a better question-title.
Comment: @joe OK, I have an apology: After researching, I saw that having titles worded as questions is a proposal which has been discussed, but never made into binding policy. The important part is to write meaningful, nonambiguous titles. See http://meta.stackexchange.com/questions/10647/writing-a-good-title for guidelines.
Answer: There is no requirement for specific gloves so far as I know. Gloves themselves aren't actually even necessary. They do however keep your hands clean, and they keep any nasties that could be on your hands or arms out of the cheese. When I make mozz for my family I usually just use my clean bare hands. If I was making to sell I'd most likely use food service gloves with a little butter on them to prevent sticking during stretching, similar to when you're pulling taffy.
Comment: The main reason why I'm looking for gloves is due to discomfort from the hot mozzarella stretching. I've tried in the past and struggled with the hot temperatures on my hands. I've ended up with poor results, which I think is because I'm unable to stretch the cheese until it has cooled down a bit.

What are "food service gloves"? I imagine plain latex gloves might melt. Would rubber gloves work? (are there even food safe rubber gloves?) I'd like something reusable.
Comment: We usually use nitrile gloves because we have them on hand (they're basically hypoallergenic latex gloves). They don't provide any protection from heat though. I get your concerns though - it can be a hot for the hands. Usually I just suffer through it until it's done (it shouldn't be THAT hot and should cool quickly). You could always try layering them - get some work gloves from a car store and then latex or nitrile gloves a size or 2 larger than usual and put them over the work gloves. You'll lose some deftness but it should cut down on the heat.
Answer: The reason why Beverage People and Cheesemaking.com recommend medium neoprene gloves is that they do protect you from the heat for a short time (as in, less than a minute), while still allowing you to get a fairly good grip on the cheese.  The neoprene gloves which you link to are fairly standard; search on "neoprene gloves" on Amazon and you'll be presented with lots of options.
However, these will still be somewhat clumsy compared to just using latex or nitrile gloves or your bare hands so if you can stand the heat, you shouldn't use the gloves.


A subgroup of corank 1 in a free group contains a primitive element?

Question: Let $F$ be the free group on $\{x_i\}_{i=1}^\infty$, and let $H \leq F$ be a subgroup with $\langle H \cup \{x_1\} \rangle = F$. Must there be a free basis $B$ of $F$ for which $B \cap H \neq \emptyset$ ?
Comment: Here is an idea that may work: let $H=\langle x_i^2, x_1 x_i^3 x_1^{-1} \mid i \ge 2\rangle$. Then the subset $S=\{ x_i^2, x_1 x_i^3 x_1^{-1} \mid i \ge 2\}$ freely generates $H$ and $F=\langle H,x_1 \rangle$. It seems plausible that $H$ contains no primitive elements of $F$. Perhaps Whitehead's algorithm could be used to show it?
Answer: Assuming $x_1 \notin H$, we can construct a basis for F as follows:
for each j,
if $x_j \notin H$, we set $b_j=x_j$ (in particular, $b_1=x_1$);
if $x_j \in H$, set $b_j=x_1x_j$.
Then, $B=\{b_1, b_2, b_3,...\}$ is a basis for $F$ not containing any element of $H$.
It seems here that the condition $\langle H\cup \{x_1\}\rangle=F$ is unnecessary. We only need $x_1\notin H$.
Comment: The question asks whether there always exists a basis that intersects $H$, not whether there exists a basis disjoint from $H$.


Difference between "Thanking you" and "Thank you"?

Question: I always use in my letter "Thanking you in advance for your time and consideration."
But one of my colleagues said thanking you was not correct usage of English, it should be thank you.  So my question is: can I use thanking you or should I use thank you?
Comment: Indian English tends to use "-ing" more often than British English or American English. Maybe that was part of your friend's concern.
Answer: I think your colleague wasn't really correcting the grammatical accuracy of your Complimentary Close (I'm assuming it's the Complimentary Close of your e-mails because otherwise it would be a bigger problem.)
Using Participial Phrases (V+ing) in the Complimentary Close lessens the total impact of the business letter:

Thanking you in advance for your time and consideration.
Assuring you of our wish to be of service to you in the future.

It's considered better style to end with a clear-cut idea:

We thank you in advance for your time and consideration.
If we can be of use to you in the future, will you let us know?

The preference for Participial Phrases came about because a letter was once considered less stiff if it ended with less emphasis and diverted from the actual subject.
Comment: I have a friend that wrote a program to randomly generate dubious Complimentaries from a list to insert before the signature line of an e-mail. It was great. We had ones like "Wishing you were her," "With blatant disregard for your personal safety,"  "Cantankerously,"  etc. It was a lot of fun coming up with them.
Answer: Short answer:
Both are correct.

Long Answer:
"Thanking" is the present participle of thank,

English present participles: English verbs that are conjugated to indicate ongoing events at unspecified moments

Source
So by using "thanking you", the author indicates that they are unsure of the exact moments at which the gratitude is offered (because they don't know when the reader has given up their "time and consideration"), but the gratitude is continuous. I would consider this more formal
"Thank" is the present simple. This would indicate "I thank you right now for anything you might do for me."
Answer: The participle form is more often used as a closing remark, thus:

Thanking you in advance for your ..., [I remain,]
Yours sincerely,
[your name]

indicating that you are anticipating some service from the adressee, while the straightforward present form would be used at the beginning (or anywhere else in the body of the letter) in the case where you are expressing thanks for a service that has already been rendered.
Comment: You added "I remain" in brackets, but I would say it is quite close to being mandatory when using the participial form—even though it is somewhat stiff and old-fashioned. Without it, as Cool Elf notes, a clear-cut idea seems better style to me.
Answer: The present participle is generally used to indicate an ongoing activity. The present tense generally indicates a more discrete action.
"[I am] thanking you in advance . . ." suggests that the appreciative activity is beginning now and will continue until the sought for benefit is received (and perhaps long thereafter). It seems quite appropriate in that context.
If the benefit has already been received, or is a short or very discrete action (such as reading a brief missive that conveys the thanks), the terser "thank you" seems apropos.
Answer: 'Thanking you' as a complimentary closing in a letter or mail  seems a little awkward, because it has no subject and no main verb; it is a phrase, not a sentence. A 'Thank you' is complete and is definitely better than a , 'Thanking you'.


What is the clunking sound that happens from 5 to 30 mph

Question: I have a clunky rubbing noise that happens at around 5 mph, gets louder then subsides around 30 mph, sounds like the rear but that may be an illusion. When I hot he breaks, it stops, also as I said higher speeds make it disappear. I looked at the sway bar bushing and it does look like it needs to be replaced, but this sound does not seem to be related to bumps. Also to by clear it appears to be Rhythmic, with the speed of the tire.
Answer: If it is rhythmic to the speed of the tire and stops when you brake, check the brakes.  They make noise when they need attention.
If it's a clacking type sound, likely the brake pads are worn and need to be replaced and are rattling in their seats.  You could also be missing one of the clips that holds the brake pad in place (they're poorly made little things that serve great purpose).
I would recommend a brake inspection to rule that out first.


What happens after sharing the secret key in quantum cryptographic schemes to send the message bits?

Question: As a person working on the physics perspective of quantum communication, I understand the process upto which the quantum key is shared securely. What happens after this process to send message bits? The literature that I've come across talk about encryption and decryption algorithms and not anything further in detail. Shouldn't the length of the key be equal to the number of bits to be ultimately sent?
Comment: That's the nice thing about modern cryptography: You can use fixed-length keys to encrypted arbitrary amounts of data in a secure way against all relevant attackers.
Answer: The actual "process upto which the quantum key is shared securely" is nontrivial from an information theoretic perspective, to the point that few people understand it fully (I don't), and some do not even realize that prerequisites include a shared secret. See sections A and B in this for an overview, and section E.1 for why we should take the security claims with more than a grain of salt.
What occurs after that Quantum Privacy Amplification (often called Quantum Key Distribution) step depends on the objective:

If we want confidentiality without unproven mathematical hypothesis (as in the previous step), we need as many key bits as data bits enciphered; and some more for integrity. See C.1 in above link.
Alternatively, if we want a fast link, we use classical cryptography with the key established (perhaps, periodically) by Quantum Privacy Amplification. But we must trust the (symmetric) crypto used, despite lack of mathematical proof that it is safe. See C.2 in above link.


What order does a court case take place?

Question: I'm doing homework for US Government and there are questions about steps in a Trial but I couldn't find any information that would help me with this online as links I could find didn't clearly explain the order it should go in. What would be the correct order for the screenshot given?
Comment: Do you have textbook? Generally it will have the answers to questions in it (even if the textbook is badly formatted and badly written).
Comment: try ILBDFEHGCKANMJ
Answer: So you can learn and not cheat:
Court refers to all parts of the trial (and is generally personified as the judge.  If the judge has to rule about his or herself, they will refer to themselves as "The Court" i.e. It is the opinion of the Court... which can be read as "It is my opinion"
The Jury must first be sworn in as they assess guilt... usually (Bench Trials, i.e. the Judge also does the jury's job are also possible, and the decision to one is the right of the Defendant.  It's often referred to as refusing such a right.)
As the Prosecution is making the case and because you cannot defend against something without knowing what you're being accused of, the Prosecution will make the first opening remarks, followed by the Defense*.
Since the Prosecution must go first so the defense can properly defend against the charges, the Prosecution gets to call it's witnesses first.  Each witness is direct examined, then cross-examined (there is also a period of re-direct and re-cross).  Each level can only ask questions related to those brought up in the prior questioning line (Cross can only ask questions about direct.  Re-Direct can only ask about Cross.  Re-Cross can only ask about Re-Direct).
After all prosecution witnesses are called, the defense calls its witnesses and the order is held in the same manner (direct then cross).
After this, both sides make closing remarks, and the defense will go first (they have had time to prepare remarks, as this basically sums up their defense.  Given that it just happened, it's fresher in the jury's mind, so the Prosection will get the final closing remarks to drive his points home and answer the Defense's arguments.
This is followed by the Judge giving the Jury the final instructions, and the jury is sent to deliberate the guilt or innocense of the defendant.  When they finish this, they will read their verdict.
*Note that in the United States and most other Common Law or adversarial court systems, it is the right of the Defendant to not testify to anything... up to and including calling no witnesses and offering no rebuttal to his case... this normally doesn't happen as the prosecution needs to show some evidence in pre-trial that their accusations have merit and they aren't just accusing defendant because they do not like their face... there is a point in the trial where the defense may ask the judge to close the case because the Prosecution hasn't proven a damn thing (Right after the Prosecution rests), though the judge rarely carries the motion.  The lack of defense testimony may not be used as evidence of guilt as the defendant need not contribute anything to his/her prosecution.
Comment: I think this answer may confuse the OP. They are clearly talking about a civil trial and this answer is about criminal procedure. There is not"guiltless or "prosecution" in a civil trial.


Is there a reaction between ethanol and aluminum?

Question: Is there a potential reaction that would occur between ethanol and aluminum? If so, would it potentially create anything toxic?
Comment: In what situation? Normally there's no significant reaction.
Comment: Yes it is, it is an industrial way to prepare aluminiuum isopropoxide.
Comment: Mercury(II) chloride is a necessary condition for this synthesis to occur, because usual aluminum is covered by a thin waterproof and continuous protective layer of aluminum oxide (alumina). This layer prevents the metal aluminum to get in touch with any liquid. In the presence of dissolved mercury chloride, the layer is not continuous anymore. So aluminum can react with water, ethanol, or isopropanol, producing gaseous hydrogen and aluminum hydroxide (or ethoxide, or isopropoxide).
Comment: @Maurice, For rapid *synthesis*, a way of breaking the Al2O3 coating is needed (might Ga would work, too?), but for long-term *storage*, aluminum is attacked by the lower alcohols, as I've observed by using a container with (unanodized) Al top for storing isopropanol. After a year or so, the top was covered with a white crust and badly corroded. No Hg was involved in this inadvertent test!
Comment: Thank you for the information, Dr Pippik. I did not know about this extremely slow reaction. And of course, gallium works as well.
Answer: The reaction of aluminum and ethanol forms aluminum triethoxide,  $\ce{ Al(OC2H5)3}$, but the reaction is fairly slow at room temperature, particularly if the aluminum is anodized. In the presence of any moisture it decomposes into aluminum hydroxide and ethanol.
The Safety Data Sheet indicates that aluminum triethoxide is both flammable and can cause "severe skin burns and eye damage", but in atmospheric conditions it likely decomposes as quickly as it forms, so the main adverse effect will be the corrosion of the aluminum, covering it with a white crust of $\ce{Al2O3}$ (I've seen this happen to an aluminum lid on a container used for ethanol).
UNH has posted a chart that shows that anodized aluminum is resistant to ethanol attack, but does not state at what temperature, so you may have to experiment to see if it suitable in your application.
BTW, many other alcohols react in a similar manner, such as isopropanol, which forms aluminium isopropoxide with aluminum.
Comment: I have seen the same:  the main adverse effect will be the corrosion of the aluminum, covering it with a white crust of Al2O3
A
l
2
O
3
 (I've seen this happen to an aluminum lid on a container used for ethanol).


What other academic disciplines aside from literature can a writer who hates mathematics specialize in?

Question: Almost every discipline in humanities and science requires some level of math. It seems to me that math majors can specialize in any field they like, while people who are good with words are stuck with editorial or journalistic jobs. I'm not trying to make an unwarranted dichotomy between linguistic intelligence and mathematical intelligence. I'm quite sure that mathematicians are good with words too; otherwise they won't be able to explain their ideas in a persuasive and elegant manner. What I'm trying to say is that many writers are just not interested in math, to say the least. But I don't think this should hinder them from studying our world the way scientists do. Physics, Chemistry, and Biology, which are by far the most mathematical disciplines, may not be for someone who loves words but hates math. But there must be some other objective disciplines (maybe in the social sciences or law) that a writer can specialize in.
Comment: What do you mean by "math"?  Are you averse to pretty much everything where you see a number, or do you just not want to spend all day immersed in abstruse alien symbology?
Comment: You would be surprised to discover how many accomplished physicists, biologists  and chemists have relatively poor mathematical background and abilities.
Answer: The problem is that if you want to be objective, you usually have to present hard numbers. Which means that at a bare minimum you need to know some very basic statistical analysis to determine if your numbers are actually interesting. (To be nitpicky: this is calculations, not math. Everyone can learn to do calculations, there is no special "mathematical intelligence" needed. Not everyone can be Paul Erdős. Anyone can learn to carry out a t-test with the help of a computer.)
As a mathematician in academia, I can't afford to say that writing is boring or teaching is boring. It's a part of my job, and if I don't enjoy it, I shouldn't be in academia. You seem to want to work in a "hard" discipline, but without dealing with the numbers that make it "hard". The world doesn't work like that.
Mathematicians in general might not be good at writing, but the ones that are also successful at communicating their ideas and hence successful academics most definitely are good at writing. They didn't write annoyed posts online about how it's unfair that people don't just understand what the meant: they spent some time and learned it. A mathematician who wants to be an academic has to learn to communicate efficiently. A writer who wants to study our world like a scientist has to learn to use the main tool scientists use: math. If the write is not interested in math, maybe they should reconsider going in to a scientific field. It's like a scientist saying that they want to be a writer, but they don't want to deal with pens or keyboards. Science without math is no longer science.
I'm only starting out as a grad student, but one of the things I've learned about academia, and one of the reasons I wanted to be in academia in the first place is that it's an extremely demanding, varied job. A good academic is excellent at doing research in their area, and then very good at other things. These other things may include writing, teaching, mentoring students, coding, and analysing data, depending on their field. (Interestingly enough, I think the only field where you can get away without doing any data analysis ever is math. I did a poll in my office, and only 4 out of 40 grad students in math could carry out a t-test off the top of their head). You can't just pick a single thing to be good at: you need the whole package. That includes some math skills if you want to work in an objective discipline. Suck it up and learn some math. Math is great.
Comment: *"Not everyone can be Paul Erdős. Anyone can learn to carry out a t-test with the help of a computer."* Nice.
Answer: Your question answers itself in the last sentence: law and the social sciences could be a good fit.  Of course you should probably stay away from tax law if you want to avoid mathematics entirely, but most legal studies don't involve mathematics.  Quantitative work in the social sciences involves statistics, but there's plenty of qualitative work (e.g., based on ethnographic methods).  And I don't believe your assertion that mathematics is widespread in the humanities.  What about history, for example?  Mathematical techniques in the humanities are the exception, not the rule.
There's no way to make a comprehensive list of topics that don't involve mathematics.  If you're considering your future academic career and worried about the prevalence of mathematics, you could address this fear by looking over the books or papers of potential advisors.  Someone who uses lots of statistics or formal mathematical models wouldn't be a good choice if you don't like that approach.  If you can't find anybody who takes a qualitative approach to the topics you are interested in, then you're looking at the wrong department or wrong field for you.  If you can, then you have a potential path forwards.
But let me put in a plug for learning a little statistics.  If you avoid statistics because you don't understand it, then that will limit the scope of your work.  If you avoid it because you don't like it, but you can handle it when necessary, then you'll have more flexibility and freedom.  (And in practice I've talked with many more people who regret not having studied statistics than people who regret having wasted time studying it.)
Comment: Law is (at least in principle) all about formal logical arguments.  Math can almost be defined as the study of formal logical arguments.  You might avoid **numbers** by going into law, but you definitely aren't going to avoid "math".
Comment: Modern Philosophy requires an understanding of mathematical logic and decision making. It might be one of the most mathematically dependent humanity.
Comment: OK, that's a reasonable point and I'll remove philosophy.  I believe most philosophers never use any mathematical logic in their work, but they still have to study a little logic.  (For example, I just checked that in the Princeton and Harvard Ph.D. programs, you can get away with never taking a graduate course in logic, but you have to take at least an undergraduate course, so there's no way to get a philosophy Ph.D. in those programs without taking one pretty mathy course.)
Comment: Law may be similar in spirit to mathematics in that sense, but studying law in the U.S. requires no formal study of mathematics beyond whatever minimum is required to graduate from college, and plenty of lawyers have no interest in or knowledge of mathematics beyond that. (And, although I'm not a lawyer, I'd argue that legal arguments feel very different from mathematics. Lawyers almost never attempt to formalize rigorous proofs the way mathematicians do, and there's a huge role for concepts like precedents or what a reasonable person would conclude, which play no role in formal mathematics.)
Comment: Yes, the one time I got semi-involved in a legal case (as a "statistical expert"), I was surprised at how handwavy all the lawyering was.
Comment: @AnonymousMathematician Anecdotal evidence from a parent who is a lawyer suggests that math is not an uncommon background in law, and that understanding and being comfortable with logical arguments is one of the most important requirements (also, the LSAT is pretty much "are you good at logical reasoning"). It depends somewhat on the type of law, but you aren't avoiding formal logical arguments by going into that field.
Answer: This probably isn't the answer you're hoping for, but hear me out. As a scientist with a healthy interest in the humanities, I think it's a bad idea to limit yourself from vocations that remotely involve math. You would be surprised how little mathematics (read: work) is needed to have a relatively good understanding of the physical world.
As such, highly recommend for you to check out the book: A Mind for Numbers by Barbara Oakley. It is written by a linguist who hated mathematics and science until she decided to give it a fresh shot in adulthood. Don't fear, it doesn't aim to make you a theoretical physicist or a mathematician.
The world is only going to continue becoming more scientific minded, and in my opinion, it'd be good for a writer to plan for that direction :)
Good luck !
Answer: As a social scientist my academic research is generally mostly qualitative and in social sciences such as socio-cultural anthropology and qualitative sociology, you can get away with doing 0% math.
However, I also complete pro-bono/paid contracts for applied social research, in which some basic quantitative skills (math) are required. I have no experience in working with large data sets or 'big data' but I know enough to conduct small-scale surveys and build on these with qualitative analysis. Currently, one of the projects I recently completed is being turned into a journal article, where my co-author will be helping out with the math portion (survey results).
Really, the only profession other than writing novels/literature that I can see a 100% absence of math would be something like visual art, and even then, there's a 'kind' of math involved in understanding how to use different materials (such as painting/mixing with other types of chemicals such as oils etc). Even music and dance are highly reliant on a form of math.
I have a dyscalculia which is a learning disorder around math and numbers, so I can 100% empathise with a hatred for the subject. I quadruple check all equations etc and have a really good handle on excel to calculate things for me and get my partner to check for me as well, whose pretty good at math.
But I'm not letting this disorder get to me, and I use math constantly for marking, my research and so on, I just don't specialise in that area. The minute a project calls for a high level of stats/data/quant, I get someone else involved.
As others have said, math is everywhere and you can't get away from math, but sometimes it can be helpful and doesn't require intense equations or the like. Just having a basic handle on it is enough in many disciplines!
Answer: While it is understandable that you would not want to work with hardcore maths if you don't like the subject, I think you need to get over the mental block that you cannot handle anything even remotely connected to mathematics. Most humanities subjects, apart from economics, geography, geology, or modern philosophy would not require a high level of mathematical application. Subjects within the social sciences, such as sociology, history, politics, etc. might work well for someone who can write well but not want to study mathematics. However, if you completely shut yourself off the moment you see even a simple calculation, your choice of subject might become very restricted.
Answer: If you hate math but you're a good writer, you could write good books about why math is hateful, for other people who hate math.  Many people hate math already, so many in fact that you could find yourself tapping a great untapped market.
Comment: Does it actually answer the question?  The question asked for academic disciplines people who don't like math can specialize in, and I wouldn't say writing books about the hatefulness of math is an academic discipline.
Comment: I think it's implicit in my response that I'm advising him to choose a discipline in the humanities, while the explicit part of my response suggests a possible career.


Beaglebone Black Upgrade

Question: I'm currently using a Beaglebone Black as a multipurpose toolkit and I'm having trouble finding a replacement. The specs (that I use) are the following:

512 MB RAM (somewhat low for updates but it works)
USB client (absolutely required for the gadget functionality)
4 GB onboard flash (somewhat low as the kernel sources and portage tree take up a large portion of it)
MicroSD slot (only used for music, ISO files for mass storage/CD gadget, and storage for traffic dumps)
Ethernet (ideally 2+ for bridging and logging traffic)
USB (ideally 2+, used for Bluetooth or a second Ethernet adapter since the BBB (non-wireless) does not have either of those built in)

The other features (dual PRU, GPIO) have potential uses, but those are less important than the list items. Additional Ethernet can be added with more USB ports, but carrying the extra dongles along is a hassle.
Built in wireless with a chipset that can be put into monitor mode would also be nice, but not if it replaces Ethernet.
The nice thing about the BBB is I can use most of the features with just USB power from my laptop so I don't need to worry about a power source, I just can't find anything better that can replace it.
Answer: Soekris Net5501 fits the bill. Have a look at it. It has GPIO, 4 ethernet ports, serial port, SATA host, USB port.
It's not tiny, but it's not uncomfortably big either.

Beaglebone Black Upgrade


Kiai, the Hara and Dantian (etymology and philosophy)

Question: I'm trying to figure out what, precisely, Kiai means.
I've done some reading, and am aware that the Kiai is supposed to come from the Hara, or Dantian - the stomach area.
Literally Kiai, means 'join energy', but Ki can refer to the mystical energy force from Chinese medicine as well as just 'energy' in the western context.
Reason this is interesting is that the Dantian is the 'Sea of Ki', presumably a reservoir of it - so is there some deeper meaning to this? Is there some mystical connection, with the kiai bringing forth one's Ki up and out of the body? Or is it just an etymological coincidence?
Comment: The Dantian is also the physical centre of mass of a human.  It moves with your posture.
Answer: Ki (気) does mean "energy" or "mood", but the A (合) is just a shout of enthusiasm (Korean does use the energy+join setup with K'ihap), so no, there's nothing mystical about it any more than a sports team breaking their huddle by shouting something like, "go team!"
Answer: You are mixing world religions and confusing Chinese chi with Japanese ki. This is problematic. They are different interpretations of mystical force.
Since you used the term "kiai" I will speak from the Japanese interpretation since kiai is a Japanese word.
The usage and meaning of kiai varies depending on context and origin. The Japanese have many thoughts on kiai and it is represented mostly in martial arts.
In martial arts you either have physical styles that focus and destroying the opponent or you have spiritual styles that focus on metaphysical analysis of phemenoma that can not be explained readily in western scientific terms.
Physical styles vary in their approach but depending on level of eliteness, ki starts with a physical change in physiological structures that can be measured scientifically i.e. punching harder. Proper biomechanics through breath control allows muscles to tighten in the diaphragm allowing a more rigid body allowing more force to travel through targets. This is similar to specialized breathing done during bench pressing weights or rowing where the breathing action is coordinated with the movement and breath is held so that the body is harder allowing more weight to be moved. This is superficial ki but beneficial to fighters.
Spiritual styles more or less worship ki as a connection to the divine and use meditative measures to establish a connection with the divine. They are trying to tap into that reservoir you referred to. Kiai is used in all Japanese martial arts not just striking based ones like karate, but it is also used outside martial arts and can indeed be found pretty much in all areas of Japanese life, especially those that are greater influenced by Shinto Buddhism.
Karate and jujitsu are heavily influenced by zen and buddhism. In Sanchin kata you are training to be centered and have a connection to the ground. You picture a "ball" in the middle of your body just below the navel and this is attached to the core of the earth thus making you "rooted". This "rootedness" shares likeness with seiza or zazen, there is this idea that when in seated position you are bound to the earth.
From a martial arts perspective mixing highly specialized arts with each other leads to compatibility issues and creates weaker arts. They become too esoteric. It is like mixing world religions and then claiming you have the best religion. It is just too agnostic. Chinese chi or qi is not ki and hara is not dantien. It would be like calling mormons baptists or protestants. Yes there are similar generalities but you would not consider them to be interchangeable terms as they have different pedigrees and take views and practice far apart from each other despite having common roots in a parent system.
What does kiai mean? The meaning of kiai has no formal definition. It's exact meaning is based on individual personal views. You can not "codify" kiai. In Japanese culture learning travels in a circles where when you master something you end at square 1 the beginning, a take on rebirth and starting anew. From not knowing what kiai is you will learn and that experience will shape your definition. When you have mastered what kiai means to you will be at step 1 supposedly ready to take in new knowledge (from the universe).
"Dantian is the 'Sea of Ki'" does not exist, you mean to say Dantian is the 'Sea of qi'. This is not appropriate to switch in an out of Chinese to Japanese as they are separate cultures with their own formalized opinions. It is like speaking "Spanglish". You are botching both systems and lacks harmony and misrepresents each separate style as one. Kung fu is not karate but mixing them and calling it "karate fu" is sure to raise eyebrows since this portmanteau would be seen as comical wordplay and nothing else.
Raising one's ki out of the body refers to Aikido and that is called bugei or "ghost technique". To take aikido and make it practiced in a physical way implies breath power or dragon power but there is no kiai To practice it in a spiritual way is more philosophical and more like a religious cult with meditation and ceremony. Taking this ceremony and habitual ritualistic repetition and combining it with tai chi it for entertainment purposes only. This would be similar to televangelism, you are commercialing the concepts for a broader mass appeal.
Etymological coincidence? No. More like etymological error. The Japanese took their alphabet from China. The two languages have similar sounds and words but vastly different meanings. The two share no connection except a distant past. Research how the Emperor of Japan created the Japanese language and how the Chinese misunderstand each other through speaking Mandarin and Cantonese. These three languages are not transferable in meaning.
Kiai on a basic level is yelling when punching in karate and karate only (maybe judo when throwing). It exists nowhere else (except maybe grunting while swinging a tennis racket or lifting heavy objects). Karate is dense and obtuse and does not go in for Chinese medicine. It is too simple and pragmatic to deal with fancy notions like that. Upper class sophisticated types are more into philosophy and drawing conclusions of the metaphysical with the physical world but do not engage with manual training and practical application of karate. Ki exists in kiai as energy but there is no kiai in ki. Qi is not ki and definitely does not have kiai in it or anything like it. Saying it does is a poor representation of our current understanding of physics.
If you are intent on creating a agnostic one world religion then the kiai is the third chakra, which is associated with sexual organs the loins and intestines, and to be conscious or aware you need insight from shape shifting reptiles would will teach you forbidden knowledge. The legendary Musashi is said to have defeated these creatures. The only battle he ever lost is said to be by the inventor of the jo (aikido weapon) who learned how to make it from the same creatures who come from the abyss (abyss means portal to another dimension but is represented as a whirlpool or other body of water). Physics cannot find these portals. As such demonology and spirit worship comes into play along with themes of lgbt. See  wikipedia https://en.wikipedia.org/wiki/Kappa_(folklore).
Comment: Korean martial arts (e.g. Taekwondo and Tang Soo Do) feature a shout called a "ki'hap"  ("Ki" meaning "energy", "hap" meaning "to join", "to harmonise", or "to amplify" - which overlaps with the Japanese word "ai" meaning "joining"), so saying that *"Kiai on a basic level is yelling when punching in karate and karate only"* is patently false.
Comment: As I said, Korean martial arts use the term "ki'hap" for the same phenomenon.  If you're now trying to say that doesn't count because the name they use is different, then that contradicts your comment about swinging a tennis racket.  (But, judo, aikido, kendo, Okinawan kobudō or even Taiko drumming all use kiai anyway)
Comment: What korean martial art uses the term kiai? For ki to overlap is a western fore drawn conclusion. No korean would ever say"kiai" or use that tem because in Korean "kiai" means "ouch".
Answer: From a purely mechanical perspective, the purpose of a kiai in a punch is to force the abdominal muscles to engage, allowing for the transfer of effort (kinetic energy) from the legs and hips to the chest and arms in event of a punch (providing a backstop in accordance with Newton's Third Law of Motion), allowing more of this power to be delivered to the target (instead of pushing you backwards)
For a kick, you are using the abdominal muscles to help lift or swing the leg, using your torso as a counterweight (for an extreme example of the principle, consider how a cat is able to rotate mid-air to land on its feet) - done correctly, this replaces and supplants any benefit that styles such as Muay Thai get from swinging the guard-hand behind them as a counterweight.
As Joseph Malone mentioned, this is like the special breathing exercises done in things like weightlifting or rowing - using your abdominal muscles to join the kinetic energy generated from your upper and lower body.  The word "ki", left untranslated, has picked up unwarranted mystical connotations, due to it being a homophone for the unrelated Chinese concept of "Qi"
Answer: Kiai means merging your energy. (Ki = energy, Ai = merge/join/blend/combine.)
The short story is that what you're attempting to do is, in the moment that you shout, you merge the ki throughout the body. In kiko (chi-kung) practice, this means circulating the energy from the dantien through the governing and conception vessels and out through to your limbs and back again. This is supposed to be done in a fraction of a second and completes when your fist strikes your opponent. At the end of the execution, you have ki being shot through your entire body, establishing a path from your fist down through your dantien and down through your feet.
It's a sudden release of energy which flows through and therefore joins the entire body together. Once the ki is connected throughout your body, the internal "pressure" of the ki is high, and the pressure is used to reinforce your strike. It's sort of like when you turn on the water through a fireman's hose. The hose will go from being limp and loose to being completely firm and immovable. That's what you're trying to do with your ki in your body in that exact moment your strike reaches its target.
So that's the meaning behind the the "ai" part (merging / blending).
In terms of shouting, this comes from Chinese martial arts, which in turn comes from Indian martial arts and healing practices (we're talking transmission between 600 and 1500 AD).
In Chinese martial arts, the yell is done to aid the sudden shooting of ki throughout the body. And different forms of Chinese martial arts do it differently, both in terms of what they imagine they're doing with the ki in their body and the sound they make. Different sounds have different purposes. There's even a different sound for each of the 5 elements of traditional Chinese medicine and martial arts. There are books written on this subject, and it can get fairly involved.
Don't get me wrong, though. I'm not promoting the theory. In fact, I don't believe in any of it personally. I just wanted to share what I've picked up over the years. The rabbit hole goes down pretty far, if you want to follow it.
Hope that helps.
Answer: From Hapkido  by Marc Tedeschi while interviewing Grandmaster Han-Jae Ji, "Ki-power is adrenaline only? Yes. Adrenaline only. There is no energy out there in the universe that we bring into our bodies? No. Why does virtually every book written on Eastern thought state something quite different-energy is absorbed from nature, the body possesses three tanjon regions,etc? I don't know. The human body has everything inside it to make Ki-power. It's not from the outside. It all comes from the inside."
I misspoke earlier. When Japan conquered Korea native arts were banned. Koreans copied shotokhan military karate and it helped influence tae kwon do's development. This mixing of styles lead from a departure of internal martial arts to more external martial arts, the hard styles. Koreans favor defense over offense while Japanese favor offense. The Japanese train to be invaders. The Koreans started emphasizing defense since they felt insufficient in that area because of being invaded. They wanted to be prepared next time.
The idea of mixing world religions ties into ki as a western occultic practice. It is not martial science. Occultic practices, like voodoo, say that energy comes from god or a balance between god and the devil. The story of the kappa inspired a real assassination of a Japanese lord who was sitting on his toilet and was stabbed in the anus by a spear. The assassin came from the abyss.
Chronocidal is right when he says there is an overlap. Styles were overlapped because Koreans choose to copy the style that had defeated them but they took their training to weird places because they had to train in secrecy. As a result there understanding of kiai is not accurate and kiai only exists in Karate. Ki as a generic term for energy is universal but "kiai" only exists in karate. In that sense "hapkido" and "aikido" as eclectic blended styles share the same parental roots in daito-ryu aikijutsu, there are similarities. For etymology I do not know how accurate you want to be. If you want to study history then etymology matters. If you want better martial arts then you should focus on physical training as too much talking interferes with that. Most students undertrain. Deeply researching history as a librarian comes when you are too old to fight. At that point you become a war and history buff.
If you are using the term kiai then you are claiming to be a Japanese karate student or at the very least you are paying homage to Japanese styles. Ki'hap is not kiai. It would be inappropriate to use the term to refer to Korean styles. It is confusing world cultures and is insensitive but more over it misrepresents the martial art styles and tries to draw comparisons where there isn't any. Most of it is political but the rest deals with combating fraud. If I made a style I would not want someone teaching incorrectly and embarrassing me and making me look bad. Sometimes pedigree matters. I'm sure American Tae kwon do schools use the term kiai. In a mixed martial arts world where everything is homogenized cultural subtlety is lost. If you just wanted to fight then just mix it up. If you wanted historical accuracy and preservation of the truth then that would affect time spent on learning to fight and ability but you would be telling the truth. Qi versus ki and kiai versus ki'hap almost boils down to quibbling over semantics. These are arguments I wish to avoid however is should be stated that the terms are different and should not be interchangeable. It is like using an ordinal indicator as a degree symbol just because it looks similar. It is similar in cosmetics only but it's function differs.
Yes all styles may use ki as adrenaline to move harder or faster. I am unsure how ki'hap generates force but it is different than kiai. It is lower. Kiai is faster and lighter. "Kiai" means speed and power and you are trying to blend, roughly, kizamitsuki and gyakutsuki together. This makes a speedy jab and a strong cross combo. This is repeated and you get sanbon, yonbon,gobon which is 3,4,5 hit combos. Koreans do not punch like this at all and do not think like this at all. Their thinking is entirely different and does not focus on this strategy or method of producing force. That is not how they fight nor their views on the martial arts. I do karate and do not want to speak for them as it would marginize them.
On another note there is the western concept of the alpha zone or "being in the zone". This refers to increased levels of alpha waves produced by the brain causing increased focus and mental acuity. Alpha waves differ from beta waves and delta waves. Alpha waves are rare. These are naturally occurring metrics that can be measured by science and have although research is quite limited on the subject.
Professional athletes and martial arts claim to benefit from these alpha waves and that time slows down allowing them to make quicker moves or decisions. They can act without thinking and things happen automatically. This is related to the samurai concept of "mushin" or "no mind" where they react on their training and honed instincts instead of thinking about it.
Please forgive any oversights. This is a complex issue. I can not explain everything in such a short space.
Comment: I don't know that I agree with everything you say, but I appreciate the breadth of the answer.
Answer: A kiai comes from the hara or dantian in the same way that a singer projects using their diaphragm. You can point to a physical place on your body and say this is where the hara is, or this is where the dantian is, and this place is roughly where you feel pressure when your diaphragm pushes down into your abdomen as you inhale deeply. In this limited sense, a kiai comes from the dantian because it comes from the lower belly area.
The dantian is primarily an energetic concept, not a physical one. The location does correspond roughly the center of mass, but the basic idea is that once your body and mind are sufficiently relaxed and concentrated, you will feel the dantian.
The martial arts I have encountered (taiji, xing yi, and bagua; the so called internal arts) that believe a direct experience of the dantian is important do not use a kiai. Let me try to explain why the loud, explosive kiai does not make sense in the internal arts context. There is a taiji concept that you should attack when your opponent has spent their old strength and not gathered new strength, for example when they have punched, but not yet reset their arm or stance. Conversely, when you attack, you want to minimize (ideally eliminate) the window between when you attack and are ready to attack again. A person executing a kiai enlarges this window and provides an unmistakable verbal cue for when they are expending their strength.


Why are the HSL and HSV color models not considered "perceptually uniform"?

Question: The HSL/HSV color spaces are not considered "perceptually uniform" despsite being widely used. Is there a detailed reason for this?
Comment: Are you asking why it isn't widely used or why it isn't perceptually uniform? Because I fail to see why being perceptually uniform would necessitate it being widely used. Unless what your question is really about is whether being "perceptually uniform" is a thing you should care about.
Comment: perceptual uniformity is a bit more than just complex. its also sort of a lie as human eyes dont perceve colors the same way in all instances, colors closer to eachother are further and further closer. Even a CIE Lab isnt really uniform, because of this its just sortof uniform. Generally we can build color systems that do one thing but fail in others.
Answer: This is just a physiological truth. Perceptually uniform colorimetric models are complex and there must be a strong justification to use them (why would you need perceptual uniformity, after all ?).
On the other hand, HLS/HVS provide a sufficient empirical decomposition in dominant color, lightness and colorfulness.
Answer: In a perceptually uniform colour space the perceived difference in colour of two colours is proportional to the difference of the values used to describe the two colours in the colour space. For colour spaces such as CIELAB and CIELUV this was the main reason for the creation of the colour space.
If two colours are represented in CIELAB with the values L1, a1, b1 and L2, a2, b2, then the perceived difference of the colours is intended to be the square root of ((L2-L1)^2 + (a2-a1)^2 + (b2-b1)^2). This means that if two colours are represented by values in CIELAB which are significantly different then the colours will be perceived as significantly different.
This is not true of HSL and HSV. Two colours such as H1=0, S1=100%, L1=100% and H2=359, S2=100%, L2=100% have greatly different values for H, but will appear nearly identical. Similarly H1=60, S1=100%, L1=1% and H2=240, S2=25%, L2=1% differ greatly in H and S values, but will appear nearly identical, being both nearly black.
HSL and HSV are useful and widely used because it is easier to tell from the H, S and L/V values what the colour is, but they are not perceptually uniform and should not be used as the basis to calculate the perceived difference of two colours. Colours should be converted from HSL/HSV to e.g. CIELAB to calculate the perceived difference.


How does an LED in an LED-strip like WS2811 know when it should be on or off

Question: I was experimenting with an Arduino board and an LEDstrip WS2811
it works all perfect, but I do not understand how a particular led knows when it is called or adressed. Does every led have a unique address?
Comment: You might find the explanations at https://www.edn.com/design/led/4438797/Tips-and-tricks-for-driving-WS2811-LED-strips---Part-1 , https://forum.arduino.cc/index.php?topic=365474.0 and the datasheet https://cdn-shop.adafruit.com/datasheets/WS2811.pdf useful.
Comment: **after a reset**, the WS2811 saves the **first colour value it receives** and passes the rest of colour values to its output   ..... imagine a line of people and a deck of coloured cards ... the people are instructed `when you hear the bell (that is the reset), keep the first card you receive and pass any other card to the next person` ... use you imagination to fill in the rest
Answer: The WS2811 is the driver chip, that is embedded into the strip. In principle it is some kind of shift register, that outputs PWM values, and on the strip they are daisy-chained (data output of one is connected to data input of the next). With the Arduino you shift out a stream of bytes, when using a RGB strip 3 bytes per LED (1 byte per color). The first WS2811 reads these 3 bytes, sets it's outputs (PWM) according to them and outputs the rest of the datastream to another pin, so that it can reach the next WS2811. The LEDs on the strip are connected to the WS2811's outputs.
So all in all the WS2811 chip saves the current desired state of it's LED, which it got through the data stream from the Arduino. The chips don't have a direct address, but can be identified by their position in the strip. So you cannot only write to the 5th LED without also writing values to the LEDs before it. But, if you don't want to set the whole strip, you can output less data, than the strip as LEDs, effectively ignoring the LEDs at the end.

EDIT:

but How does it recognize the first led?

The strip has somewhat like a data line. When you look at the markings for this line on both ends of the strip, you normally should see something like "DI" and "DO", which means Data In and Data Out, each at one end of the strip. Each LED has it's own Data In and Data Out, which are chained to the next and the previous LED. The first and last LED expose their Data In or Data Out (respectively) to the outside of the strip. You feed the data into Data In of the first LED driver, which outputs the rest of the data at it's Data Out pin, where the data can go to the next driver. So the direction, in which the data flows through the strip is already defined and hardwired. You cannot send data in the other direction through the strip. So the first LED is that one, that is directly attached to the Data In line of the strip and will be connected to the Arduino.
Keep in mind, that this is not an address. You can cut the strip at an appropriate place (so that you don't destroy the circuit. Most strips have these pieces regularly after every or every third LED) and get a new first LED, if you now connect the Data In, where you cut the strip, to the Arduino. An LED strip with WS2811's is not an array or a matrix of LEDs, it is a chain of LEDs. This difference is important in how you control them.
Comment: Clear answer, but How does it recognize the first led?
Comment: @AnneMabellon  I added extra explanations for this. I hope it is clear now.
Answer: The LED units don't have any unique addresses of their own, instead they are indexed by their position in the string of LEDs. When you feed data into the first LED, you put the entire sequence of color values into the first one. It will then set its own color to the first one in the sequence, and then output all the rest to the next LED in the series.
None of the LEDs actually "know" where in the strip they are located, they only take the first value that comes in and set their own color to that value, and then output the rest of the values to the next LED in the series.


Where does the EV3 software store its crash reports?

Question: I cannot find where the crash reports generated by my EV3 software are stored. I have looked where it tells me to, but I can't find any.
Comment: What OS are you using (Windows/Mac)? And what is the path that it told you to look for?
Comment: Maybe the software never even crashed, that could be why.
Answer: The location of the crash logs would depend on the system you are using. I have mapped out the three candidates below:
If you are using the classic LEGO MINDSTORMS EV3 Education software:

Open your existing or a new experiment.
Go to the Tools menu and select Data Log File Manager.
Browse to the .rdf file and click the Import button. (It can be on the brick or on your computer.)
If the directory is empty, there are no crash logs (yet)

If you are using EV3 Python, you are running through Visual Studio Code, and the crash handling will be done by VS.
On Windows, this would make the crash logs appear under %AppData%\Microsoft\VisualStudio\
If you are using EV3 Classroom
On Windows, this would make the crash logs appear under %AppData%\LEGO\Mindstorms\Logs\
On OSX, you can look for them at /Applications/LEGO\MINDSTORMS\EV3\Home\Edition.app/Contents/MacOS/MindstormsEV3
If you are using some third party program, the program provider should be able to advise you where logs are stored.


Why isnt the World Championship formatted like that?

Question: Just have the Men's section, Women's section and Junior's section and the 3 winners play each other in a quadruple robin round format (each player plays 8 games) and the winner becomes the next World Champion.Why isn't the World Championship formatted like that?
Answer:
Why isn't the World Championship formatted like that?

Because it makes no sense.
First, your assumptions are wrong. There is no "Men's" section. There is an open section which, as implied, is open to everyone. Both women and juniors are free to enter. The Candidates places are open for all players. Whoever qualifies, man, woman, junior, is entitled to play in the Candidates. Whoever wins that, man, woman or junior, then gets to play the reigning world champion for the title. The open world champion is THE world champion.
Comment: And take away a spot  from somebody who has been through the *open* qualifying procedure? What if that person was a women or a junior? *Anybody* can enter the open section. *That* is the way to qualify.
Comment: Or at least make the Womens and Juniors World Champion qualify for the Candidates.
Comment: I mean shouldnt we reward the fact that someone is a champion?
Answer:
The real action would currently all be in the Men's section. A woman or person under 20 has never been world champion.

A 3 way format would be, perhaps, unfair. If player A lost all their games to player B but put up a fight against player C, then B could win the championship despite a losing record against C.

This format does not allow the current champion to defend their World Champion title, as is usually done.

It's unnecessary. Under current practice anyone meeting the criteria can contend for the title; there's not a "Men's section" which excludes women or juniors.
Comment: Or at least make the Womens and Juniors World Champion qualify for the Candidates.
Comment: @Cerise Hmm. They don't get an automatic berth to the Candidates but they *do* both get an automatic berth in the World Cup, and the top three in the World Cup tournament qualify for the candidates. The Women's World Champion also gets an automatic berth in the FIDE Grand Swiss, and the top two from that tournament get berths in the Candidates. So there is, at least, a clear path.
Comment: Ah okay this sounds fair.


The difference between 皮膚【ひふ】 and 皮【かわ】

Question: What's the difference? I got told that 皮膚【ひふ】 only works for mammals (and humans), and 皮【かわ】 for other animals too.
Comment: There's another word, 肌{はだ}, which is used for humans. It mainly refers to the surface of the skin, and is used in phrases like 肌がきれい or 肌がかゆい.
Answer: 皮膚{ひふ} is generally a formal word for skin, used in academics, clinics etc. (but also frequently in everyday speech).
For example, some fishes do 皮膚{ひふ} 呼吸{こきゅう}. So it's not really for mammals only.
My layman definition is that it has to be on an animal, and doesn't include extra structures like hairs, feathers, scales etc. (but does include the smooth underlying tissue).
皮{かわ} is more colloquial and can refer to any organic, generally thin structure that can be peeled. For example, 木{き}の皮{かわ}.
Answer: I agree that 皮膚 is only for mammals, but 皮 does not even have to be of an animal. It can be any kind of skin, those of: fruits, vegetables, wrapped food (dumpling, etc.), etc.

The difference between 皮膚【ひふ】 and 皮【かわ】


How can I Eject CashDrawer with Android?

Question: Could you give me some idea to eject cash drawer by Android ?
Other people use DOS to eject it, but Android is a Linux Kernel. My device is "Acer Iconia tab a500 + usb cash drawer.
Answer: What's the cash drawer's input? Does it directly have a USB cable, or is it plugging into a USB driven receipt printer? Many cash drawers don't actually have a USB interface of their own, instead they expect to plug into something like a receipt printer that has USB connection, and which provides the right signal to energize the cash drawer's solenoid when a certain character is printed.
First step I'd do is to plug the USB thing (whether it's the cash drawer or the receipt printer) into a PC and figure out what sort of device it is (I'd guess that it probably shows up as a serial port, because that would be easy for the developers to do). Once you know what sort of USB device you're dealing with, then you'll need to figure out how to make the Android device talk to that sort of USB device.
For making an Android device control USB devices, I'd look into the Android Open Accessory Development Kit because that seems to have what is needed.
If the cash drawer does NOT actually have a USB connector, but instead has something like an ethernet or phone connector, then the cash drawer ISN'T USB. Instead, it's expecting whatever it is plugged into to energize it's solenoid with a pulse on some of the wires on that connector. You'll have to look at the spec sheets (or take it apart) to figure out how to energize it properly.
Comment: Thank you , for your suggestion , i'll try to work hard with these : )

last time i got some idea to print out with wireless printer

it's a good idea to work with it .
Comment: perhaps take a look at Raspberry PI or similar hardware which you might be able to setup as a cheap server solution combining receipt printer and cash drawer, then let the Raspberry PI run a service that will allow the Android to connect to the PI and send an "eject command" you build into the service.


Sharepoint 2013 REST add to document library with custom content type - JS

Question: I'm on a project where I'm implementing a CRUD for a Sharepoint 2013 Document Library which includes two custom content types, the default one I'll call MyDoc which is derived from Document and another type I'll call MyDocSet which is derived from Document Set. I'm doing this with JS/jQuery.
I can't seem to figure out how to set the content type when creating a list item. I want to add an item of content type MyDocSet, but it always wants to assume the default content type.
Here is my unsuccessful attempt:
<code>var executor = new SP.RequestExecutor(baseUrl);
var bodyContent = JSON.stringify({
    "__metadata": {"type": "SP.Data.LineJSubmitItem"},
    //How to set content type ID?
});
executor.executeAsync({
    url: baseUrl + "/sites/linej/_api/web/lists/GetByTitle('LineJSubmit')/items",
    method: "POST",
    headers: {
        "Accept": "application/json;odata=verbose",
        "content-type": "application/json;odata=verbose",
        "X-RequestDigest": formDigestValue,
        "content-length": bodyContent.length,
    },
    body: bodyContent,
    success: function(data) {
        alert("success");
    },
    error: function(data, errorCode, errorMessage) {
        var jsonObject = JSON.parse(data.body);
        var errMsg = jsonObject.error.message.value;
        alert(errMsg);
    }
});
</code>
Answer: With the SP.RequestExecutor you have to make sure the appweburl and hostweburl parameters are used properly. For example, I assume the 'baseUrl' value you are using is really the appweburl that you receive from SharePoint.
Additionally, you will need to append the target url (the hostweburl) to your URL string.
Though this deals with updates, it may be useful to see my post here.


What happens if I buy BTC from an ATM, but the transaction never confirms?

Question: I bought bitcoin through the atm machine, it was sent to me but is yet to be confirmed over 52hrs.. if the transactions later disappeared from the mempool / blockchain, how will the sender get back the fund, since not send from a wallet?
Answer: In this case, you would need to contact the ATM operator / service provider, and provide them with some proof of your purchase and the failed transaction. When completing your interaction with the ATM, you should receive some sort of receipt that details this information, though the exact specifics will likely vary from one ATM to another.
If you are running a full node, perhaps you could find the transaction which was supposed to pay you in your node's mempool, and then save it to be rebroadcast in case of an extended period of non-confirmation.
But I think that in most cases, you will just need to contact the customer service department of the ATM operator, and request that they complete the transaction.


Linearising with a density fluctuation

Question: I have some trouble understanding orders. Starting with the continuity equation
$\partial_t\rho=-\nabla_r .(\rho \vec{u})$ and applying a peturbation to the density $\rho(\vec{r},t)=\bar{\rho}(\vec{r})+\delta\rho(\vec{r},t)$ I know that the result to linear order is $\partial_t\delta\rho=-\nabla_r .(\bar{\rho} \vec{u})$. I do not understand clearly why terms with $\nabla.\delta$ are treated as second order. Does a derivative imply higher order, because as far as I am aware higher order would be a product of flucuations i.e. $\delta\delta$ terms.
Answer: I'd wager the reason why the perturbed approximation looks like that is because you're actually perturbing both the density and the velocity in the following way:
$$\rho(\vec{r},t) = \bar{\rho}(x) + \delta\rho'(x,t)$$
$$\vec{u}(\vec{r},t) = \vec{0} + \delta\vec{u}'(x,t)$$
In this case, the only term that is inside the divergence in the final approximation is the only term that isn't quadratic in $\delta$, $\bar{\rho}(x)\delta\vec{u}'(x,t)$, justifying the approximation without needing to reference the magnitude of spatial gradients. Note the $\delta$ in the velocity perturbation is often omitted because you're perturbing off of a rest state.
Given the cosmology tag, I'll add some specific context; when considering the expansion of the universe, you'd have to consider Hubble flow and co-moving coordinate frames, but the process is the same as the one I detailed above in the correct reference frame.
Both of these approaches are discussed fairly well here.
Comment: Indeed I have been using these very same notes, I was not careful in considering the velocity perturbation.  Thanks. ( I still wonder about spatial gradients and magnitude arguments though)
Comment: No problem! I'll add that this approximation can fairly often fail to hold water, particularly when small length scales are considered (precisely because spatial gradients can be big even though the differentiated function can be tiny).

Linearising with a density fluctuation


Quantifier elimination vs decidability

Question: Quantifier elimination is used as a technique to get decidability (e.g. $Th( \mathbb{N}, +)$ ) of theories, but typically one has to go over to some expansion. Are there examples of theories which are decidable but there is (provably) no expansion which has (effective) QE?
Answer: The answer is no, because in fact every theory $T$ admits quantifier elimination in an expansion, over a theory $\bar T$ that is conservative over $T$. Furthermore, the quantifier elimination procedure in the expansion is computable (assuming the original language has an effective enumeration), regardless of whether $T$ is decidable or even computably axiomatizable.
The idea is simply to add new predicates to represent the old formulas, so that they become quantifier-free. Specifically, if $T$ is a theory in language $\cal L$, then for each formula $\varphi(\vec x)$ in ${\cal L}$ let us add a new predicate symbol $R_{\varphi}$ to form the language $\bar{\cal L}$. We then form the expansion theory $\bar T$ by augmenting the original theory $T$ with the additional axioms $$\forall\vec x\ \left(\varphi(\vec x)\iff R_{\varphi}(\vec x)\right).$$
It is manifest that any model of $T$ can be expanded to a model of $\bar T$ simply by interpreting the $R_\varphi$ according to their definitions, and so $\bar T$ is conservative over $T$. But meanwhile, $\bar T$ has quantifier elimination, because every formula $\bar\varphi$ in the language $\bar L$ can be translated back into an $\cal L$-formula $\varphi$, by expanding all the $R_\psi$ that arise in it according to their definitions, and this formula $\varphi$ is equivalent to $R_\varphi$ in $\bar T$, an atomic formula. Thus, we have quantifier-elimination in the expansion. Furthermore, the procedure $\bar\varphi\mapsto R_\varphi$ is effective, regardless of the decidability of $T$.
Comment: Could you suggest me a good book/paper/link where I can find information about the quantifier elimination?
Comment: @MaryStar I would think that this is covered in any of the usual model theory texts, but I don't have any close at hand at the moment.
Comment: I saw in your profile that you have answered to questions about decidability. Could you maybe take a look at my question http://math.stackexchange.com/questions/1516207/undecidability-of-positive-existential-theory-related-to-differential-equations ?
Comment: I don't know what the "theory of algebraic differential equations" means exactly. This is a first-order theory? What is the language? It seems to me you have some experts over there helping you out, who are also unsure about what you mean. Perhaps you can focus your question more precisely?
Comment: The language is $\{+, \cdot , ', 0, 1, t\}$. The formulas in the theory is of the form $tx'=ax$, they are algebraic differential equations (algebraic means that the coefficients are polynomials). So, can we say that this theory in this language is the structure $$(F[t]; +, \cdot , ', 0, 1, t)$$ ? I will try to edit the question to make it more precisely.

Quantifier elimination vs decidability


Where do you store your configurations? Dockerfiles, gitlab-ci, application.properties, deploy scripts

Question: Let´s suppose that our repository contents is something that will be shared. Is strange that we include the deploy scripts there, explaining how to deploy in our machines
Answer: If by "Shared" you mean that your team has access to the files then it should be stored in Source Control so that everyone on the team is using the same scripts.  You can consider a secrets manager so that team members do not share sensitive information (e.g., Docker Secrets, AWS Secrets Manager, Azure Key Vault).
If this will be publicly available you can still use a secrets manager to publish these files with the sensitive data removed.
Comment: It will be shared with different clients


Independence assumption in maximum entropy models in NLP

Question: I am reading Klein and Manning's notes on Maximum Entropy for Natural Language Processing. On slide 22, they have an equation saying,
$P(C|D,\lambda) = \Pi _{(c,d)\in (C,D)} P(c|d,\lambda)$. I am not sure how they obtain this or what it really means. In the coursera video on this topic, Manning says that this follows because the random variables are independent and identically distributed. However, I thought, Maximum Entropy methods are prefered over Naive Bayes because they don't make the "naive" independence assumptions. If someone has a reference for this equation, that will be great.
Answer: The individual samples in the dataset are iid.  The features within a given sample are not assumed to be iid.
Comment: Thanks for the answer. I am still a bit confused though. What does C really mean if we are varying over the samples in a dataset? For example, if are doing named entity recognition (an example that they have been using), the individual date pieces (words in this instance) within a document can be associated with a class and a corresponding feature weight. What does $P(C|D,\lambda)$ mean in this case?
Comment: P(C|D,λ) refers to the probability distribution of classes to every instance in the dataset, given a particular weight vector λ.  EG, the probability that instance 1 has class 3 and instance 2 has class 1 and instance 3 has class 1 is a single entry in that distribution.  If there are m classes and n instances, there are m^n entries in the distribution.


Is the gradual progression of day(light) into night a clue that the earth is a sphere?

Question: If the earth was flat, would the transition between day and night be sudden?
Answer: Well, assuming a lot of things aren't true, then no. For example, if the Earth was shaped like a pizza, and the sun revolved around it, then it would have the same transition.
Comment: thanks.
My question relates to a claim of Islamic apologists.
The claim is that the quran couldn't possibly be describing a flat earth because it says:

 "seest thou not that Allah merges Night into Day and He merges Day into Night?" Luqman: 29.

and an example of the claim below:

"Merging here means that the night slowly and gradually changes to day and vice versa. This phenomenon can only take place if the earth is spherical. If the earth was flat, there would have been a sudden change from night to day and from day to night."
Answer: Depends on the size of the sun.
If it's capable of illuminating the entire surface of the earth at once, then the transition would be sudden.  Take a torch, and a coin, and sit in a dark room.  Shine the torch obliquely onto one face of the coin.  You can then choose whether the coin spins so alternating faces are exposed to the torchlight, or the torch orbits the coin, achieving the same effect.  It quickly becomes obvious that the transition is quite sudden, no matter how slowly the coin moves.  Do the same thing with a ball or a marble, and the transition is gradual.
However, if the sun is only capable of lighting a small portion of the surface, like a spotlight, then the transition could be gradual, as the beam sweeps about the surface.  The Flat Earth Society even has a snazzy graphic about it here.   Of course, that raises all kinds of other issues such as whether one could construct a path that exactly reproduces the observed day/night transition times, but they seem to be only tangential to your question, and if we're arguing about what was observable from the Middle East in 700CE, that makes it even less relevant.
Comment: wouldnt we still have dawn and dusk on a flat earth?

Surely the angle of the flat earth relative to the sun would still induce variations in the amount of light.?


Feature selection with L1 regularization on sklearn's LogisticRegression

Question: I'm using sklearn's LogisticRegression with penaly=l1 (lasso regularization, as opposed to ridge regularization l2). Lasso is causing the optimization function to do implicit feature selection by setting some of the feature weights to zero (as opposed to ridge regularization, which will preserve all features with some non zero weight). Is it possible to extract this weight information (feature selection) from sklearn somehow?
Answer: Yes, as demonstrated in the documentation: http://scikit-learn.org/stable/auto_examples/linear_model/plot_logistic_path.html
Welcome to DataScience.SE
Comment: Thanks. So the magic attribute is `coef_`, called on the LogisticRegression object after fitting, eg. `alg.coef_`.