Cauchy-Schwarz inequality for Bochner spaces

Question: Let $(\Omega, \mathcal{F}, \mu)$ be a measure space, $(X, \Vert \cdot \Vert_X)$ be a Banach space, and let $(L^p(\Omega, X), \Vert \cdot \Vert_p)$, for $p \in \mathbb{N}$ be the Bochner space of measurable functions $u \colon \Omega \to X$ with finite norm
$$
\Vert u \Vert_{L^p(\Omega, X)}^p = \int_\Omega \Vert u(\omega) \Vert_X^p d\mu(\omega).
$$
One would hope that the Cauchy-Schwarz inequality holds for these spaces. Is this true for generic $X$ and $\mu$? Is there a reference where the Cauchy-Schwarz inequality is treated for these spaces, as opposed to the usual case $B=\mathbb{R}$ case
Comment: Do you perhaps mean Holder's Inequality? https://en.wikipedia.org/wiki/H%C3%B6lder%27s_inequality Cauchy-Schwarz only applies when $p=2$ and you have an inner product structure.
Comment: Well, I do need Cauchy-Schwarz, but Hölder would be even better of course. Do you have such reference for the Hölder inequality?
Answer: Holder's inequality very generally states that for every measurable function $f,g:\Omega\to [0,\infty]$, we have for every $1\leq p\leq\infty$ that
\begin{align}
\int_{\Omega}fg\,d\mu\leq \|f\|_{p}\|g\|_q,
\end{align}
where we allow the RHS to be infinite (and $q$ is the Holder conjugate). Using this carefully gives all sorts of corollaries.
Now, suppose you have three Banach spaces $X,Y,Z$ and a bounded bilinear map $\beta:X\times Y\to Z$. Rather than writing $\beta(x,y)$, let us write $x\cdot_{\beta} y$ (to remind us that $\beta$ is a 'product'). Now, for any two (measurable) maps $u:\Omega\to X$ and $v:\Omega\to Y$, we can define the pointwise $\beta$-product map $u\cdot_{\beta} v:\Omega\to Z$. At each point, we have the estimate
\begin{align}
\|u(\omega)\cdot_{\beta} v(\omega)\|&\leq\|\beta\|\cdot \|u(\omega)\|\cdot\|v(\omega)\|.
\end{align}
So, taking $f(\omega)=\|u(\omega)\|$ and $g(\omega)=\|v(\omega)\|$ respectively, we have by Holder's inequality that
\begin{align}
\int_{\Omega}\|u(\omega)\cdot_{\beta}v(\omega)\|\,d\mu(\omega)&\leq\|\beta\|\int_{\Omega}\|u(\omega)\|\cdot\|v(\omega)\|\,d\mu(\omega)\leq\|\beta\|\cdot\|u\|_{L^p(\Omega,X)}\cdot\|v\|_{L^q(\Omega,Y)}.
\end{align}
So, in short,
\begin{align}
\|u\cdot_{\beta}v\|_{L^1(\Omega,Z)}&\leq\|\beta\|\cdot\|u\|_{L^p(\Omega,X)}\cdot\|v\|_{L^q(\Omega,Y)},
\end{align}
which is exactly the usual Holder's inequality we expect. In fact, taking $X=Y=Z=\Bbb{C}$, and $\beta$ the usual multiplication of complex numbers, we have $\|\beta\|=1$, so we get the usual complex-valued Holder's inequality. Next, if $X$ is a Hilbert space, then taking $Y=X$ and $Z=\Bbb{C}$, you can let $\beta=\langle\cdot,\cdot\rangle_X$ be the inner-product on $X$, and you get the integral version of Cauchy-Schwarz for Hilbert-space valued functions. There are lots of other types of bilinear pairings one might consider, for example:

let $X=\Bbb{C}$ and $Z=Y$, and $\beta:\Bbb{C}\times Y\to Y$ the usual scalar multiplication (a very natural thing to consider).
$X=\text{Hom}(Y,Z)$ and $\beta$ the bilinear evaluation map of operators on vectors. A very important special case is when $Z=\Bbb{C}$, in which case $\beta$ is the duality pairing $Y^*\times Y\to\Bbb{C}$ (typical cases include $Y=L^r(\Omega,\Bbb{C})$ or some Sobolev space (assuming $\Omega$ is open in $\Bbb{R}^n$, with say nice boundary etc), or whatever other function space of interest). The case of a Hilbert space (which I described above) is a special case of this once we use Riesz-representation to identify the Hilbert space with its dual using the inner product.
take $X,Y,Z$ to be certain spaces of operators, and $\beta$ to be composition of operators.

These $\beta$'s all have $\|\beta\|\leq 1$, so you don't even notice anything different from the usual Holder's inequality. There are of course lots of other types of $\beta$'s to consider.
Comment: Thanks. Can $X=Y=Z=C(D)$, the space of continuous function on a compact $D$, or  $X=Y=Z=L^2(D)$, for instance?
Comment: As long as you have a $\beta$ in mind, sure.
Comment: I guess what escapes me is what is the natural $\beta$ for the case $C(D)$, which I typically assume being endowed with the supremum norm. I would really want to use just the point wise product for $C(D)$, and similarly for $L^2(D)$.
Comment: Ok, sure, for $C(D)$ with $D$ a compact topological space, equipped with supremum norm, you can consider the pointwise product. However for $L^2(D)$ ($D$ any measure space), the pointwise product lands you in $L^1(D)$ (by the usual Cauchy-Schwarz:) so you should take $X=Y=L^2(D),Z=L^1(D)$. For both these cases, $\|\beta\|\leq 1$.
Comment: That's fantastic, thank you!
Comment: And by a similar note, due to Holder's inequality, you can take $X=L^r(D),Y=L^{r'}(D), Z=L^1(D)$ ($r,r'\in [1,\infty]$ Holder-conjugate exponents).
Comment: One last thing if I may: it seems I could also take for $\beta$ the standard inner product in $L^2(D)$ and take $Z=\mathbb{R}$.
Comment: yes, I already mentioned that right before my bullet points (and again in the second bullet point). In fact all the discussion in the comments is a special case of the bullet points lol


Mac only booting into Ubuntu and not rEFInd

Question: I installed rEFInd on my Mid-2010 13-inch MBP and installed Ubuntu on another partition. The Mac does not boot into rEFInd to select OS X or Ubuntu, it only boots into Ubuntu. I can still access the data on my OS X partition from Ubuntu, but I can't boot into the OS X partition.
Answer: Try holding down the Option (or Alt) key as you start up the computer. This should provide you with a menu you can use to select the OS to boot. Using that menu, boot to OS X. You can then re-install rEFInd. With any luck that will fix the problem.
If you continue to boot straight to Ubuntu, look for a directory called /sys/firmware/efi. If it's present, you've booted in EFI mode; if it's absent, you've booted in BIOS/CSM/legacy mode. If you boot Ubuntu in EFI mode, you may be able to use efibootmgr to adjust the boot order -- but Macs are a bit weird and doing this may not work in quite the normal way.


Lock/Unlock a github branch

Question: How can I lock a github develop branch so that no one can merge PR (even if PR approved) until I unlock the branch? This is needed because I want to create a release branch, out of develop and restrict unintended merge until branch out. I went through branch protection rules and it does not serve my purpose i.e. there is no option that says lock/unlock a branch.
Explanation:
I have a develop branch and developers can create feature branches from develop branch and raise PRs, and once PRs get reviewed and get approval, developers can merge their PRs to develop. Now, I want to create a release branch from develop so I want to restrict all the developers to be able to merge their PRs to develop branch even if PRs got approved. It may take a few days to create a release branch because whatever code I have in develop branch, I want to test and by this testing time, I want to lock the develop branch, so that no one can merge their PRs into develop branch. Once testing successfully done, I will create a release branch from develop and I will then unlock the develop branch, so that, from now on developers can merge their PRs to develop branch.
Comment: @han Based on your edit, you just need to fix your process. Create a release branch as soon as you're ready to start stabilizing for release, then stabilize in the release branch. Later, any stabilization changes made in the release branch need to be integrated back downstream so you don't have regressions. This is a very common pattern if you're following GitFlow.
Comment: Why do merge restrictions not provide this exact solution?
Comment: You can protect branches in github, but it has no effect on local repos. Github cannot control local repos/branches at all
Comment: guys, I never said it is a local branch.
Comment: Sorry, I read a comment as though it was yours. My mistake. Still, I'm not clear on the problem.
Comment: If you create a *new* release branch from `develop`, no further additions to `develop` will appear in your release branch. There's no need to lock `develop`; just don't provide write access to the release branch.
Comment: FYI: bitbucket has an option that restricts all kinds of changes in a branch. In the branch permission, you can enable `Prevent all changes`
Comment: @DanielMann we follow GitFlow with some adjustment. we cannot create a release branch until the intended features QA test in dev environment and there is a gap(2-3 days) between the features being merged & QA testing complete. That's why I want to lock develop branch for those 2-3 days for QA completion.  Seems like there is no essay option in github unlike bitbucket/azure devops.
Comment: I think the explanation on this question is muddying the waters here, since that specific reason wouldn't require a "lock" (because you can create a release branch from any commit you wish). Ultimately *why* you want to lock the branch shouldn't matter, it's a good question to ask what an easy way would be to temporary block PRs from getting completed when branch protection is already on. (For example, if 20 people can complete PRs, you could change the list of people to 1 person, but I'm not sure if that's an "easy" way to enable a lock for a few hours and then put it back later in the day).
Answer: You can create a branch at any time from any commit, there is no reason to lock an active branch and prevent people from working.
git checkout -b <new branch name> <commit hash>, then git push.
Comment: I understand what you are saying but for our business case it does not apply
Answer: This functionality is not available in git itself. This can be handled by whichever server you use to manage the repo. See Managing a branch protection rule @ Github. You can set rules by branch name or pattern and require a PR to merge to that branch. You should also be able to set who can merge and other rules related to branch management.
Comment: "handled by whichever server you use to manage the repo" Not necessarily. Since it's not a Git matter, it depends completely on the server and the interface that it provides.
Answer: Since Oct. 2022, you actually can lock a branch:

New Branch Protections: Last Pusher and Locked Branch (Oct. 2022)
Push protection enabled.
This allows for branches to be locked, prohibiting changes.
You can lock a branch allowing you to have a maintenance window and prevent changes, or to protect a fork so it only receives changes from its upstream repository.
To use this feature in a branch protection rule, enable Lock branch.

So:

How can I lock a github develop branch so that no one can merge PR (even if PR approved) until I unlock the branch?

The documentation does include:

You can enable this setting to apply the restrictions to admins and roles with the "bypass branch protections" permission, too.

Lock/Unlock a github branch


What should I do with "I know I've seen it" syndrome?

Question: I have a question to Drupal Answers I know I have seen it already. I'm almost sure it was on topic and answered, but I can't find it, no matter what. I find close questions, with different technology tags (ie 6 vs 7, form-api vs webform), but not the one I'm sure I've seen.
Maybe I'm mistaken. But if I ask and I'm not mistaken, I'll get punished for duplicates, and that's not what I want; it would be a waste of mine and mods time. But if I don't ask, site will not get possibly interesting question and I will not get my answer. So, I'm kinda stuck.
Comment: @Clive actually no, I didn't. My pal from that particular project worked it out in a meantime so I didn't bother. And it turns out that answer for 6 was valid except some renaming, and I must have a moment of mind blindness ;)
Comment: Did you ask the question by the way? If so could you provide a link? I'm not looking to close it or anything, but I might have seen the post you can't find at some point and be able to dig it up :)
Comment: Food for thought: http://blog.stackoverflow.com/2010/11/dr-strangedupe-or-how-i-learned-to-stop-worrying-and-love-duplication/  Jeff (maybe it was Joel) has another article about this, but I can't find it right now.
Answer: You just need to get rid of the notion that getting a question closed as a duplicate is "punishment".  It is only hygiene, making sure that the answer pool stays pure.
Sometimes, doing a diligent search may fail.  It has happened to me as well. I see no harm in then asking the question, where you start out with a disclaimer similar to this:

This may be a duplicate, since I vaguely recall seeing this before.  However, diligent search has not located the original item, so I will proceed to ask this question.  If somebody know that this is indeed a duplicate, please tell me.

That way, you may either get a new answer (if you mis-remembered), or you enlist the awesome crowdsourcing power of the DA community to locate that elusive duplicate.
Comment: Closing as duplicate doesn't incur any (automatic) downvote penalties. I don't think many people downvote duplicate questions, unless perhaps it's been answered dozens of times and would have been found easily; then they might for a lack of research effort. But that's clearly not the case here. Adding a disclaimer isn't the right thing to do IMO, not in the question anyway. That would be meta-data to the actual question, and users are encouraged to edit out such things. Related question on meta.SO today: http://meta.stackexchange.com/questions/183300 (read the comments & 2nd answer especially)
Comment: @GisleHannemyr I see where you're coming from, but attempting to invoke crowdsourced searches is definitely not what SE is about. Questions need to stand in their own right, and a note saying "I'm sure I've seen this before..." doesn't actually add anything to the question, in fact it distracts from the main content. The purpose of a question body shouldn't be an attempt to encourage others to find a duplicate, rather solely to answer the question as presented. The close/duplicate situation is a separate parallel process, and eventually dups will be closed/merged organically anyway.
Comment: It's hygene, but it also substracts from reputation and gives downvotes. But I guess I'll try anyway, thanks.
Comment: I think the downvoting inpulse should be mitigated by saying up front that you're aware of the possible duplicate, *and* have performed a diligent search.
Comment: I would not call "I vaguely recall seeing this before"
extraneous "fluff" (to quote the meta-answer you link to).  It is information that may help locate a duplicate that may even have an *excellent* answer already.  SE is not *only* about Q&A - it really about locating the best and most relevant answer about a specific topic.  If the route to the best answer is to encourage the community to conduct a crowdsourced search, I think this is an equally valid approach as asking for a new answer.
Answer: Closing a question as duplicate is never a punishment for who asked it; it is rather a way to concentrate the efforts of answering in a single question.
If you searched for the question and you didn't find it, then ask your question. If somebody points out the question has been asked, you can look at that question and see if it is about the same topic you are asking. If it is, you can vote to close your question; if it is not, you can make clear your question is not a duplicate (i.e. differentiate your question from the other one). In the case the solutions proposed for the other question don't work for you, you can point out that. (Something similar to "I have tried what suggested in [link to the other question], but none of the solutions works for you." would work.)
I would avoid adding any disclaimer about a question you think to have seen, for two reasons:

Disclaimers about something that is not related to the problem to solve put at the beginning of a question should be avoided; that is true also for disclaimers like "I am a Drupal newbie." The users who read the question should immediately see the question; that is the reason why hi, hello, or similar words are removed from the questions. Time ago, Jeff Atwood added a script that would remove such words from existing questions.
The disclaimer could potentially have the effect of getting the question down-voted.

As side notes:

Asking a question that is a duplicate of another question is not wasting moderators' time. Moderators don't actively look for duplicates every time a new question is asked. It could happen that you ask a question that duplicates a question already asked from a moderator or a question a moderator just read; in those cases, the question could be closed from the moderator, if the questions are blatantly duplicates.
As long as you ask questions that are on-topic, and you don't have behaviors that are dangerous for the community, you should not be worried about your reputation. If you were worried about your reputation, then you would never ask a question, since a single up-voted answer would not allow you to delete your question, which could be then the target of down-votes. (Contrary, you are always able to delete an answer of yours that receives down-votes, except when it is locked; in the case it is locked, the answer could not get voted too.)


An exception occurred with using LINQ method syntax (LINQ to SQL) in C#

Question: I use Linq to Sql and method syntax of Linq in my code to query from database with all tables. And I met an weird exception today, this is the first time error occurred since I started to use L2S.
There are two columns in database table.
And the column of "Status" is mapping to program with an enumeration type: 1(Free), 2(Loan).
。Database table schema as below.

。Define table class
private string Type;
private byte Status;

。Query code
string _qNote = string.Empty;
string _qStatus = string.Empty;
List<DefineTableClass> _List = _dbObj.Table.Select(_obj => _obj)
                            .Where(_obj =>
                            (string.IsNullOrWhiteSpace(_qNote) || _obj.Note == _qNote)
                            && (string.IsNullOrWhiteSpace(_qStatus) || Convert.ToInt32(_obj.Status) == Convert.ToInt32(_qStatus))
                            ).ToList();

The exception occurred at

Convert.ToInt32(_obj.Status) == Convert.ToInt32(_qStatus)

and I am wondering this line should be passed at

(string.IsNullOrWhiteSpace(_qStatus)

due to _qStatus is Empty and it should not to do the next check.
Comment: The most likely cause is that the `string.IsNullOrWhiteSpace` is not a function that Linq to SQL supports.  Try `string == "" || string == null`
Comment: `Convert.ToInt32(_obj.Status)` may not be supported either.  What you could do is try materializing the result of the Linq to SQL query to a list by calling ToList() and then apply your Select to the resulting list; Linq to Objects supports all of the methods you're trying to call.
Comment: @RobertHarvey I am sure Linq to SQL supports these two functions. Because I have other queries are also using this way to query from database, and it worked.
Comment: Then edit your question to include the *differences* between the queries that work and the queries that don't work.
Answer: Improve your query by preparing parameters outside Queryable lambda:
string _qNote = string.Empty;
string _qStatus = string.Empty;

var query = _dbObj.Table.AsQueryable();

if (!string.IsNullOrWhiteSpace(_qNote))
    query = query.Where(_obj => _obj.Note == _qNote);

if (!string.IsNullOrWhiteSpace(_qStatus))
{
    var byteStatus = Convert.ToByte(_qStatus);
    query = query.Where(_obj => _obj.Status == byteStatus);
}

var _List = query.ToList();

It should produce more effective SQL and may avoid unwanted conversions.
Answer: I found the similar situations with my question.
L2S will check ALL where conditions, so it must to do (string.IsNullOrWhiteSpace(_qStatus) no matter the front check we think it's should be passed cause it's true.
The better way to write L2S might less use casting in the syntax and like @SvyatoslavDanyliv said, preparing parameters outside Queryable lambda can prevent the weird logic question as mine at this time.
Reference:
Why isn't this short circuit is not working in linq to sql query?
Why isn't this short circuit in lambda working?


What pairs of champions make a good kill lane bot?

Question:
Possible Duplicate:
What is the idea of a bot "kill lane"?

I am looking for champions to play a kill lane with my friend for bot lane. I know about some of the standard ones like Jarven and Leona, but I'm looking for more options.
I have seen the previous post on kill lanes, but i am specifically looking for examples of kill lanes. The previous post covered what a kill lane is, with only a few examples.
Answer: Singed/Blitz/Alistar and Graves.
Push/Pull enemy towards Graves, and unleash the fury of Buckshot. If you're running Alistar, have him pop them up, Graves dashes forwards in front of them, and by the time they're past him, it's buckshot time again. Pepper in a few auto-attacks (aided by the Attack Speed steroids on dash), and you'll take down anyone
Another interesting one is Zilean + Twitch. Twitch goes invisible, Zilean puts a bomb on his head, Twitch runs in, bomb goes off, twitch runs out. Enemies can't see/target Twitch, and can't even see the source of damage. Given the damage of time-bombs, and the amazing burst Twitch gets when coming out of stealth, a Twitch running flat Attack Damage runes will destroy all opponents for the first 6 or so levels fairly easily.


How can I safely get closer to the black hole?

Question: In the Sapphire sector way at the top side, there is a black hole and right next to it is a jump field.  However, my ship tends to blow up before getting there (that black hole might have something to do about that).  So how can I safely enter the jump area?
Answer: I tried:

Using high power shields and shield boosters
Passing through with high velocity
Using jumpdrive near it to reach over 10k
Redlight jump when you go through gates

I've finally succeeded by jumping to 79900.-2000.72500 from somewhere near the hole. Half of my shield was damaged, and no damage to fuselage. I jumped to somewhere in Talison.
Comment: nice, when you say high power shields and shield boosters, how high are we talking about?  What type of ship were you using?


How I can put " within an HTML attribute value

Question: I wish to have the following:
Catch me in the rice.

It is obvious that this is not rendered well by the browsers. Please provide me with information of what escape sequence or encoding like " I must use?
Answer: Use " instead.
Comment: That was fast. let me try this.
Answer: Either replace the quotation mark with its corresponding HTML entity — e.g. " or ") — like this:
Catch me in the rice.
Catch me in the rice.

Alternatively you can use single quotes in your HTML in cases where you need double quotes in attribute values:
Catch me in the rice.

Comment: Single quotes will not work when the text he needs has a single quote in it... always use the entity.
Comment: @gms8994 Well of course stuff like `` won't work — I'm pretty sure the OP knows that, seeing as he asked a similar question (``).
Answer: Catch me in the rise.


How can I have an entity loot table that is determined by location?

Question: I've been trying to customize zombie drops depending on which biome it dies. For example, if the zombie dies in plain biome, it drops slime ball. If it dies in river, it drops leather (I choose these items just to test it out). I'm not sure if I'm writing the loot table wrong or minecraft just doesn't support this yet. Here's my loot table:
{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecratf:slime_ball",
          "weight": 1,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 2.0,
                "type": "minecraft:uniform"
              }
            }
          ],
          "conditions": [
            {
              "condition": "minecraft:location_check",
              "predicate": {
                "biome": "minecraft:plains"
              }
            }
          ]
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:leather",
          "weight": 1,
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1.0,
                "max": 2.0,
                "type": "minecraft:uniform"
              }
            }
          ],
          "conditions": [
            {
              "condition": "minecraft:location_check",
              "predicate": {
                "biome": "minecraft:river"
              }
            }
          ]
        }
      ]
    }
  ]
}

Comment: Oh no… "`minecratf`"
Answer: Apparently the only issue is that you wrote "minecratf:slime_ball" instead of "minecraft:slime_ball". I fixed that typo, tried it and the loot table works.
"Ael" in the Minecraft commands Discord group also suggested this tool, which finds that issue: https://sourceblock.net/beta/tools/data-packs/loot-table-evaluator


If $m, n \equiv 1 \pmod p$ and $\frac{m}{n}$ is an integer, does that imply $\frac{m}{n} \equiv 1 \pmod p$?

Question: If $m, n \equiv 1 \pmod p$ and $\frac{m}{n}$ is an integer, does that imply $\frac{m}{n} \equiv 1 \pmod p$?
I'm curious if this is true, I can't really think of any counterexamples. In my case, $p$ is prime, but I'm curious if this holds in general as well.
Answer: Let us write $\frac{m}{n} = k$. Then it follows that $m = kn$ and taking this equation modulo $p$ we see that
$$
1 \equiv m \equiv kn \equiv k \bmod p
$$
by our assumptions $m \equiv n \equiv 1 \bmod p$. This implies that $k \equiv 1 \bmod p$, which was to be shown.
Comment: Excellent, thank you! Will accept as soon as I can


How to work on a laptop with only one monitor and having the laptop closed?

Question: I want to close my laptop and still being able to use it with an external monitor. Tried several settings including disabling energy saving mode when closing the laptop.
Any idea how to do this?
Comment: You must find out what power-manager you are using. There you switch off the suspend on lid closing. Try: "cat /proc/acpi/button/lid/LID/state" or "cat /etc/systemd/logind.conf"
Answer: It would help if you tell us what happens. Does it automatically power off? If so, try going into Settings. This can be found by right clicking on the upper bar. Look for a Power tab and find the settings for Power Saving Options and note that there are separate options for when it is on mains vs on battery. Deselect any that would cause it to turn off when the screen is closed. Also you might go to the Power Mode settings and set them to always optimize performance, although I would not automatically think this to be a problem. I'm not authoritative on this, but may give you something to try. Report back with the results.
Comment: When I close the laptop, the external monitor is getting black. I set the option to not go to power safe mode when closing the laptop. My expectation would be, that the external monitor operates as single monitor. Will try your hints.


How to remove default padding of an Image in Flutter?

Question: As you can see in the screenshot I have some padding in my Images widgets even tho I did not define any. I guess it is the default padding. However to cope with my design I'd like to remove this padding.
Here is the code:
class PackingPlanEntry extends StatelessWidget {
  const PackingPlanEntry({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
          color: Color.fromRGBO(208, 190, 162, 100.0),
          shape: BoxShape.rectangle,
          borderRadius: BorderRadius.all(Radius.circular(5))),
      child: Row(
        children: [
          Image.asset("assets/backpack.jpeg", height: 122, width: 70),
          Image.asset("assets/boots.jpeg", height: 122, width: 70),
          Column(
            children: [
              Text(
                "Norwegen Tour 2022",
                style: TextStyle(
                    color: Colors.black,
                    fontSize: 16,
                    fontFamily: "Roboto",
                    fontWeight: FontWeight.bold),
              ),
              Row(
                children: [
                  Text(
                    "12 Teile gepackt",
                    style: TextStyle(
                        color: Color.fromARGB(400, 0, 0, 0),
                        fontSize: 12),
                  ),
                  Text("3",
                      style: TextStyle(
                          color: Colors.black.withOpacity(0.5))),
                  Image.asset("assets/user.png",
                      color: Colors.black.withOpacity(0.5))
                ],
              )
            ],
          )
        ],
      ),
    );
  }
}

I already tried to add
      padding: EdgeInsets.zero,

but that seems not to change anything at all.
Comment: Basically, `Container` don't have `padding` as default, maybe it cause by your image
Comment: You are right - it's caused by the images. Changed question accordingly
Answer: I think your issues caused by image, so you should add fit to image,
Example:
Image.asset("assets/backpack.jpeg", height: 122, width: 70, fit: BoxFit.fitHeight),
Image.asset("assets/boots.jpeg", height: 122, width: 70, fit: BoxFit.fitHeight),

there are many types of BoxFit, you should consider to choose the right one you need
Answer: try this
Container(
            padding: EdgeInsets.zero,
              decoration: const BoxDecoration(
              color: Color.fromRGBO(208, 190, 162, 100.0),
              shape: BoxShape.rectangle,
              borderRadius: BorderRadius.all(Radius.circular(5))),
              child: ....,
            )

Answer: I realized that having a width to the images kinda added that extra padding. Only having height (which works fine with constant ratio) did work and removed the padding.


Return value from helper asynchronously?

Question: getCurrentPosition() is asynchronous, so how do I return a value from a helper?
Template.pos.helpers({
    'nearestLocation': function() {
        var location = undefined;

        if('geolocation' in navigator) {
            navigator.geolocation.getCurrentPosition(function(position) {

                location = Locations.findOne({
                    geolocation: {
                        $near: {
                            $geometry: {
                                type: 'Point',
                                coordinates:[153.0415850, -27.4477160]
                            },
                            $maxDistance: 500
                        }
                    }
                });

                console.log(location.name);

                return location.name;
            });
        }
    }
});

The find works correctly because the console does output the correct result. Am I missing something I should know about the way Meteor works?
Answer: You can't return a value directly from a function if the value is retrieved asynchronously.  The function returns BEFORE the async value has been retrieved.
The usual way to solve this issue is to pass a callback into the function and then the host function calls the callback and passes it the value when it has been retrieved.
If in the infrastructure you are using, the nearestLocation function is required to be synchronous (e.g. it can't use a callback or return a promise that would later return the value), then you're just kind of out of luck because you can't return an async value from a synchronous interface in Javascript.  It just can't be done.
The only possible work-around I know of is to somehow anticipate what value will be needed long before it is needed so you can retrieve the desired value asynchronous, store it away and then when the synchronous request is made for the value, it can just be returned because it has previously been retrieved.
This requires advanced knowledge of what will be requested and enough time in advance to actually retrieve it before it is needed.
Comment: @IanJones - I don't know Meteor myself, but in searching, it looks like there are some answers that use a `session` and the `render` method [here](http://stackoverflow.com/questions/16632050/meteor-return-asynchronous-function-to-handlebar-template) and [here](http://stackoverflow.com/questions/24743402/how-to-get-an-async-data-in-a-function-with-meteor).  Also a [whole module](https://github.com/hpx7/meteor-async-template-helpers/) about using async in helpers.
Comment: Thanks for your answer! I'm a bit of a nub with JavaScript, but I understand the sync/async incompatibility here. This is in the context of Meteor.js so there's an added layer of magic happening which I wondered might have a solution.
Answer: Slightly nicer way than the callback pattern is to return a promise object from the function, which has a then() method which gets called when resolved, so you can chain your handler for the response onto the request like:
getCurrentPosition().then(function(result) {});

Promises are coming natively in ES6, but you use them today you'll have to either use a transpiler or a library specifically for promises like q, for instance.
Answer: Just use a Session variable or other reactive data source to force the helper to rerun if/when the location is found:
Template.pos.helpers({
  nearestLocation: function() {
    var position = Session.get('position');

    // only bother doing the find if the position is set
    if (position) {
      // use position in the find
      var location = Locations.findOne(...);
      return location.name;
    }
  }
});

Template.post.rendered = function() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      // set the session variable when/if position is found
      Session.set('position', position);
    });
  }
};

Comment: Thanks for answering fully, helps to see an optimised solution.
Comment: I'm happy to be of help. For more examples, also see [this related question](https://stackoverflow.com/questions/22147813/how-to-use-meteor-methods-inside-of-a-template-helper). It has to do with methods, but it's the same idea - async callback from a helper can be offloaded to created/rendered.


Angular(2+) polyfills: Problems with IE - .includes()

Question: After experimenting a lot, I found out, using .includes() in .html template will bug out the application in IE.
e.g. *ngIf="selectedItems.includes(item)
I've enabled everything in polyfills.ts, still, the IE doesn't read my code properly.
For e.g., when reading {{aVariable}} in .html template, it won't display on IE if there's an includes(), oddly, it works if I put a *ngIf="true" in it's html tag like:
{{aVariable}}
When removing all .includes() in the .html template, everything seems to runs fine.
What am I missing, is this possible to solve in polyfills as well?
Comment: which version of IE ?
Comment: @UlrichDohou v11.228.17134.0
Answer: Oddly, after tons of searching, I finally found a solution at github after posting this question.
Adding following lines in Polyfills.ts will solve this issue with includes:
import 'core-js/es6/array';
import 'core-js/es7/array';

Hope this will help other.


Assign value to each indexOf match

Question: I currently have code that searches through a single Google sheet for indexOf a number, and assigns the row number of a match to an variable. Here's an example:
for(i=0;i<values.length; i++){
  itemvalue = values[i][column1-1];
  codevalue = values[i][column2-1];

  if(itemvalue.indexOf("5019")>-1){
    row = i+1; itemcode = 5019; indexes.push(i+1)
  }
}

Unfortunately the sheet contains multiple rows of strings that contain "5019". So I'm looking for a way for indexOf to continue searching and assign a new variable for the row number of each match. So if "5019" was found at row 50,51, and 54, then row,row1,row2 will be assigned to each row number.
Appreciate any help on this, also please let me know if I missed providing any information.
Edit:Thanks to the link provided by daniel, I was able to get all the matching row numbers into an array. But I'm still trying to figure out how to assign a variable to each value in the array so I can get the value of the cells that reside at the rows and add them together.
Comment: Does this work for you? http://stackoverflow.com/questions/20798477/how-to-find-index-of-all-occurrences-of-an-element-in-array
Comment: Use an array and objects. Your objects will have one property, {row: 50} - push the object into the array and then you can read your data by looping through the array and checking what the row values are.
Comment: Would it be possible to see an example of how this would work? I've read on how to create objects and I'm able to get the row numbers I needed into an array.
Answer: I've found the solution I sought for. Here's what I did:
for(i=0;i<values.length; i++){
itemvalue = values[i][column1-1];
codevalue = values[i][column2-1];

if(itemvalue.indexOf("5019")>-1){
  row = i+1; itemcode = 5019; indexes.push(i+1)
}
for(j=k=0;j<indexes.length; j++){
rownumb.push(ss.getRange(indexes[j],qtycol).getValue()); //Get value of the cells using the row numbers from the indexes array
}
for(l=0;l<rownumb.length; l++){
rowtotal += rownumb[l]; //Adds all the values together
}
}

So I made a for loop to get the value of cells in the rows that was in the indexes array, then made a new array called "rownumb" that holds the cell values. I then made another for loop to add all the values in array rownumb together and got exactly what I was looking for.

Assign value to each indexOf match


How to define nodes as arrival points and destination points

Question: This is probably an easy question but I do not get it.
In my model I want to create orders based on real data, in this real data there is a start location , I set those as parameter value of the order agent from the database see pictures below:
Database anylogic
Parameters order agent
Now I want at the source block to let the order arrive at the departement, which is exactly the same name as the string parameter of the order, so I did this:
Source part
But it says, cannot convert from string to Inode, so my question is how do I type the syntax that he converts the string name to the node with exactly the same name, because the departement node also is called Departement1 etc.
Thanks in advance!
Answer: I would have liked to put this answer as a comment, as I'm still a relative beginner at AnyLogic and I'm sure there are more elegant approaches, but due to lack of reputation, here it it:
You can get the String value of the name of an INode object with INode.getName(), as documented here : https://anylogic.help/api/com/anylogic/engine/markup/INode.html#getName()
After which it would only be a matter of creating a creating a list that contains your nodes, creating a function that iterates through that list and fills out a Map with the name/node pair.
You can then use another function  within your agent to assign the corresponding node to a variable inside your agent, and use that to dynamically define their arrival location.
Assuming you've created a Map of name col_nodeNameMatch, you'd then do something like :
for (INode n : col_nodes) {
    if (n.getName().equals(departement)){
         col_nodeNameMatch.put(departement, n);
         break;
    }
}

Followed by the following every time an agent needs to find its arrival node :
v_arrivalNode = col_nodeNameMatch.get(departement);

Thank you Stuart for the much more efficient suggestion of using a Map.
Comment: You'd setup a *map* from node name to the actual node instead of a list like this (which means looping through the whole list each time to find the entry you want). Also, `getName` is very expensive computationally so much better to setup a map once from name to the actual node objects, and then use that to get nodes for names. (Here you are calling `getName` many times unnecessarily.)


allow user to enable/disable network interface without root permission

Question: i would like to allow a user without root permission to enable/disable a network interface from the command line, such as:
ip link set ens18 down

(ubuntu 18.04 with netplan)
i would appreciate any input or help
cheers!
Answer: probably the best way to do this is via proper configuration of sudo. You can specify exact commands that can be run, and you can (if you choose) make it not required to enter a password
You can either use /etc/sudoers or /etc/sudoers.d/network_interface
With content similar to
user1 ALL=(ALL) /usr/bin/ip link set ens18 down

See here: https://www.sudo.ws/man/1.8.15/sudoers.man.html
All the way down at the bottom is an EXAMPLES section, if you don't want to read the whole thing
Comment: Perfect solution for me. i added two lines like the one you suggested (the second with "up" at the end) and i will do this for a whole group instead of a user. Thank you! by the way: i needed to restart the machine so that the effect takes place. is this really needed? when i try to restart the service it says that the unit sudo.service is masked...
Comment: It is not normally required with a standard linux/unix setup. It's a little strange that a reboot was required


Ubuntu doesn't detect webcam

Question: Cheese just doesn't detect the webcam .. nor other software. This is an MSI GT70 2PC. I cannot even find someone having the problem. The webcam even works fine on windows 8.1 .
I also tried adding the user to the video group and I even tried this:
sudo chmod 777 /dev/video*
following this question but ubuntu can't find the directory in the first place!
Answer: Maybe the camera is locked. I own a MSI GS70-2PC-210US and from time to time this happens to me after doing updates.
Try pressing Fn+F6 (or whatever the camera lock/unlock button is located on your keyboard).
Comment: that was the problem. Thanks
Comment: same, bravo. after all the problems i had with the audio drivers where i have to console type alsadriver every time to hear the speakers i was expecting the worst scenario
Comment: Wow, would have never tried that. Thanks for the tip!
Comment: That worked for me too. On my MSI GE66 Raider, it's Fn + F4
Answer: Try going on "additional drivers" (you can search for it on the Ubuntu search engine) and looking for any proprietary drivers for your device. It usually works for me.

Ubuntu doesn't detect webcam


Bathroom fan replacement, non-standard plug

Question: A couple of nights ago, I noticed that my bathroom exhaust had stopped working. It still makes a humming sound but it doesn't spin, so I assumed it's probably the motor.
I removed the motor/fan and then looked for a replacement online. The sticker with the model name has scratched off, although I can see from the cover that it's a Stelpro. Unfortunately, all the potential replacements I have seen connect to a standard power outlet, whereas the one I have has the below connector (Google tells me it's called a Tamiya connector).
Is it possible to buy a replacement, or would I need to replace the whole unit? If it's the latter, is that something that I would be able to do myself? For reference, my electrical experience is limited to installing a couple of dimmer switches.
Comment: And since it's an AC motor, it shouldn't matter which wire is which.  The problem here might be finding a motor whose shaft matches, and swapping the fan from one to the other.
Comment: Looks to be a Stelpro SBF, discontinued. https://www.stelpro.com/en/products/bathroom-exhaust-fan-sbf/

Have you contacted Stelpro to see if they offer a replacement part?
Comment: @huesmann Thanks, I'll try this first
Comment: Do you have access from above, or is there living space above?
Comment: We have an attic, but I don't think there's any floorboards.
Comment: Doesn't matter if there aren't floorboards, you can rig something temporary.  If you can't find a direct replacement for the motor, you can replace the whole unit.  There's bound to be *something* out there close enough in dimensions.
Comment: Stelpro say they have stopped making exhaust fans. I'll try the attic solution when I have the time.
Answer: Why replace it? All that lint is likely the only issue, keeping the motor from turning.

Remove the two Phillips-head screws holding the bearing, noting the order of any washers on the screws and shaft.
Remove the squirrel-cage fan, if the setscrew is not frozen by corrosion.
Clean all surfaces thoroughly with a toothbrush and mild solvent, such as 91% or stronger isopropanol (flammable) and allow to dry thoroughly. One could even use some water, but drying time would be much extended. Be very gentle in cleaning around the motor winding (covered in plastic) and attached wires.
Put just a drop or two of ordinary motor oil (e.g., 5W-30) on the shaft at each end, and on any felt around the two shaft bearings.
Reassemble and check that the fan turns freely.

That bathroom fan should run as well, and last as long, as a new one.
Comment: I'm not so sure. I clean my fans regularly, and they often look like that or worse, and they never actually bind up. There's no real resistance in the motor caused by surface lint.
Comment: I'll try cleaning it and see if that helps.
Comment: I've had one genuinely fail. It happens.


How to downgrade my flutter version when installed with Snap and not manually?

Question: I have upgraded my version of flutter by mistake and I need to go back to the version 1.20.3 because the one I am using now is not stable.
I downloaded flutter using the first option (snap) and not manually, so I dont know how I can downgrade my version to 1.20.3.
Please, someone knows how to do it?
Answer: Use this command
flutter downgrade 1.20.3

Edit:
The downgrade command is deprecated. Use the following method
Switch to the appropriate channel ( stable, master, beta )
flutter channel stable

cd into flutter directory and run the following command
git checkout v3.7.1

then run
flutter doctor

Comment: Showing There is no previously recorded version for channel "stable".
Answer: When using snap, cd to the directory of flutter eg:/home/username/snap/flutter/common/flutter
Use the command flutter sdk-path to find this directory.
Then checkout to the required branch.
For that use git checkout 3.7.12,
Then run flutter doctor so it will build the system.


rebasing DLLs for debug purpose, anyone doing it?

Question: in an article about Windows debugging and the CrashFinder application, John Robbins says: "You should run REBASE.EXE as part of your build process to ensure that it is always done." (Bugslayer, Microsoft Systems Journal, April 1998, http://www.microsoft.com/msj/0498/bugslayer0498.aspx)
I would like to know if the rebasing for debug purpose is worth the trouble.
There is a similar question Is rebasing DLLs (or providing an appropriate default load address) worth the trouble? but it is not related to debug purpose but to speeding up DLLs loading.
Answer: Yes it's still well worth rebasing your DLL so that it doesn't clash with other DLLs in the host process.  I won't list the benefits since you do so in the links in your question!
Comment: Clashing makes less of a difference in newer versions of Windows with ASLR (Address Space Layout Randomization).  If your DLLs are enabled for ASLR, they're going to get relocated at load time even if their preferred address ranges don't overlap with those of other DLLs already loaded into the process's address space.  That's identical to the run-time cost of getting relocated because of a clash.


jQuery URL Parameter hides list items

Question: I'm having a bit of a head-scratcher right now.
I'm trying to filter a list based on a URL Parameter that I pass into my function.
The result I'm trying to solve for is if someone manually changes the URL Parameter to 0 it will display the entire list instead of hiding all the list items.
HTML
<select id="hof-accomp">
  <option value="0">Choose an Award</option>
  <option value="1">Rookie of The Year</option>
  <option value="2">MVP Award</option>
  <option value="3"> DPOY Award</option>
</select>

       1993
       Rookie of The Year

       1999
       MVP Award

       1993
       DPOY Award

jQUERY
// gets and filters the URL parameter
function getURLParams(k){
  var p={};
  location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(s,k,v) {
    p[k]=v
  });
  return k ? p[k] : p
}

const awardParam = getURLParams('AwardID');

function awardFilter(awardParam){
  if(awardParam) {
    // Set the dropdown menu to the award name
    const filter = $('#hof-accomp')
                      .find("option[value='"+ awardParam +"']")
                      .prop("selected",true);

    // Filters inductees by URL Parameter
    $('.awardTitle').each(function() {
      let awardData = $(this).data('award');
      let awards = $(this).parentsUntil('.gallery-wrap');

      filter == 0 ? awards.removeClass('hidden') : awards.addClass('hidden');

      awardData != awardParam ? awards.addClass('hidden') : awards.removeClass('hidden');
    });
  }
}
awardFilter(awardParam);

Comment: if I understand it right you can expand the condition: `awardData != awardParam && awardParam > 0`. That's it, or?
Comment: When I console log the 'filter' it returns an object. So should I test against the URL Parameter instead?
Comment: sure it returns an object (a jquery collection if you want to be exact). You SET the selected property instead of reading it. remove the `,true` at the line where you define the filter variable.
Comment: ok I got it. Sorry: _When I console log the 'filter' it returns an object. So should I test against the URL Parameter instead?_ yes. absolutly yes. `filter` is a jquery collection but you want to text against the filter variable.
Answer: UPDATED jQUERY
What I found would help is to take in the URL Parameter to set the option value.
Then filter the list based on the new selected option
This correction to my function fixed it.
function awardFilter(awardParam){
  if(awardParam) {
  // Set the dropdown menu to the award name
    const awardSelected = $('#hof-accomp').find("option[value='"+ awardParam +"']").prop("selected", true);
    console.log(awardSelected);
    const filter = $('#hof-accomp').val();
    console.log(filter);
  // Filters inductees by URL Parameter
  $('.awardTitle').each(function(){
    let awardData = $(this).data('award');
    let awards = $(this).parentsUntil('.gallery-wrap');

  awardData == awardParam || awardData == filter ? awards.removeClass('hidden') : awards.addClass('hidden');
  });
 }
}

Comment: But this code does something different. In your code above (in question) you're *setting* the option to selected state. now you're reading it. That's a different kind of thing. You can achieve both actions or set the property and use the awardParam in your condition.
Comment: I believe you are correct which begs the question. How would I solve for the original question if I'm trying to _set_ the option to selected instead of reading it?
Answer: your two conditions are wrong. First of all you can combine them. Second: filter == 0 is wrong because that never happens. filter is a jquery collection. You can change your code in a way like this:
function awardFilter(awardParam){
  var awardParam = parseInt(awardParam, 10);
  if(awardParam>-1) {
    // Set the dropdown menu to the award name
    $('#hof-accomp')
        .find("option[value='"+ awardParam +"']")
        .prop("selected",true);

    // Filters inductees by URL Parameter
    $('.awardTitle').each(function() {
      let awardData = $(this).data('award');
      let awards = $(this).parentsUntil('.gallery-wrap');

      awardData != awardParam && awardParam > 0 ? awards.addClass('hidden') : awards.removeClass('hidden');
    });
  }
}
awardFilter(awardParam);

But you can shorten your code. Why iterating and choose for each item by yourself?
function awardFilter(awardParam){
  var awardParam = parseInt(awardParam, 10);
  if(awardParam<0) return;
  // Set the dropdown menu to the award name
  $('#hof-accomp')
      .find("option[value='"+ awardParam +"']")
      .prop("selected",true);

  // Filters inductees by URL Parameter
  $('.gallery-wrap').children('li').addClass('hidden').filter(function(){
      return awardParam==0 || $(this).find('.awardTitle').data('award') == awardParam;
  }).removeClass('hidden');
}
awardFilter(awardParam);

Comment: I like the improvements. By default, the list items don't have the hidden class added on page load.
Comment: If this is the case you can change `if(awardParam<0) return;` to `if(awardParam<1) return;` and remove the `awardParam==0 ||` from the condition
Comment: The gallery-wrap class is the  which I don't want to be hidden if I'm reading your code correctly. Just the individual  's
Comment: @cpt-crunchy if you have any problems feel free to ask. if it's working and it helped you please upvote and select it as the correct answer so I and other users can see that this question is successfully answered.

jQuery URL Parameter hides list items


IE9 HTTPS security is compromised by, ...https! why?

Question: This is simillar to several questions here about getting this message when insert a non https script on a page, such as IE9 HTTPS security is compromised by my Greasemonkey script?
but while testing my code in the modernIE vm for win7+IE9, i get this error for a https page!
it says:
<code>SEC7111: HTTPS security is compromised by https://example.com/script.js
</code>
i already double checked the cert. everything looks good. If i open the same script directly on the address bar they load just fine and there is no complains about the certificate.
Answer: Are you sure that the request for your script is not redirected from https to plain http? This would not matter if you access it directly from the address bar because it is not included in a secure context. But, if included in a secure context it would cause this warning.
Comment: Does the script you include itself tries to load or redirect to other resources? I don't know what you include but especially scripts outside of your control (like advertisements) might behave strange and might change the behavior depending on the browser and how they get included, sometimes to circumvent detection of malware (malvertising).
Comment: Nope. it is not. 1) in any other browser it does not trigger the warning. 2) on the address bar, i can click the pad lock and confirm that i get the correct cert path and "This certificate is OK." in the cert status box. It is all good.
Comment: good point. but no. it does a also valid https request inside. But that was the best lead I had so far so i went to double check the network tab on the F12 tool, and all requests show as http, except one image on the page (totally unrelated to the script flow). though that image renders just fine without any complains... O.o
Comment: btw, the scripts in the warning loads and executes fine. I'm starting to think i should just ignore it...
Answer: turned out to be bad root certs on the test box. apparently all other browsers ship with their own certs and were not affected by this.


TypeError: "this is undefined" When using forEach on member array

Question: I have a class marketData:
export class marketData {
    id: number;
    denomCount: number;
    itemCount: number;
    conversionRates: Array<number> = [];
    conversionRateToLowest: Array<number> = [];
    itemPrices: Array<Array<number>> = [];
}

I would like to define a member function for it, validate(), that checks that the values of the class are set properly. I wrote part of this method to check itemPrices:
this.itemPrices.forEach(function(this, prices){
          if(prices.length != this.itemCount){
              // handle error
          });

However, the above gives me a ERROR TypeError: "this is undefined". I got the exact same error trying to check itemPrices in this manner:
this.itemPrices.forEach(function(prices){
          if(prices.length != this.itemCount){
              // handle error
          });

i.e. without the this in the function parameters.
What is the correct way to access the itemCount member variable?
Answer: Its because of the the way you are using forEach. Use Arrow Functions instead like below. And its recommended that when using typescript classes always use arrow functions else you will keep running into this problem.
this.itemPrices.forEach((prices) =>{
          if(prices.length != this.itemCount){
              // handle error
            }
});

Answer: The value of this in the function is not the same as it is inside the class. You can either use fat arrow function or use bind(this) to bind the function to the class.
this.itemPrices.forEach(function(prices){
          if(prices.length != this.itemCount){
              // handle error
          }).bind(this);

Answer: You can make use of ES6's arrow functions to access this. Anyways, do read this up to udnerstand to context of this when it comes to JavaScript and using them within OOP in JS.
this.itemPrices.forEach((prices: number) => {
  if (prices.length != this.itemCount){
    // handle error
  });
});


Value of $\int\limits_{-\infty}^\infty e^{x^2}\left(\frac{d^n}{dx^n}(e^{-x^2})\right)^2dx$

Question: I need to find the value of this integral : $\int\limits_{-\infty}^\infty e^{x^2}\left(\frac{d^n}{dx^n}(e^{-x^2})\right)^2dx$ .
I tried to integrate by parts $\int\limits_{-\infty}^\infty e^{x^2}\left(\frac{d^{n+1}}{dx^{n+1}}(e^{-x^2})\right)^2dx$  but I'm stuck for the expression of the antiderivative. Any help would be greatly appreciated.
(n is a positive integer)
Comment: Have you tried brute force - taking the derivative (which will be a polynomial times $e^{-x^2}$)  After squaring the integrand will be another polynomial times $e^{-x^2}$, which can be integrated explicitly.
Comment: What is the value of $n$, or are you trying to get a general expression for all values of $n$?
Comment: @JohnOmielan n is a positive integer, so I'm trying to get a general expression
Answer: $\int\limits_{-\infty}^\infty e^{x^2}\left(\frac{d^n}{dx^n}(e^{-x^2})\right)^2dx=
(\frac{d^n}{dy^n}\frac{d^n}{dz^n}\int\limits_{-\infty}^\infty e^{x^2}e^{-(x+y)^2}e^{-(x+z)^2}dx)|_{y=0,z=0}$ $=(\frac{d^n}{dy^n}\frac{d^n}{dz^n}\int\limits_{-\infty}^\infty e^{-(x+y+z)^2}e^{2yz}dx)|_{y=0,z=0}$
$=(\frac{d^n}{dy^n}\frac{d^n}{dz^n}\sqrt{\pi}e^{2yz})|_{y=0,z=0}=2^n n!\sqrt{\pi}$
(modulo mistakes that you will easily repair)
Comment: @MariuszIwaniuk you are right  - aparently I don't know how to differentiate $\exp$ :)


Do you ever need DLC to get the Platinum trophy for a game?

Question: The description of the Platinum trophy for each PS3 game can vary (as with any trophy description). When you're looking at a trophy list and there are trophies for DLC sometimes it is not clear whether the DLC trophies are required to get the Platinum trophy. For example, the Bioshock Platinum trophy description reads "Collected all other Bioshock trophies" which is not clear on whether that includes the DLC trophies.
Are there any games where DLC trophies are required to be able to get the Platinum trophy?
Comment: +1 because i don't know anything about this thing but i'm interested in too.
Answer: No.  When designing trophy sets for PS3 games, one of the requirements is that all of the base trophies must be earnable without DLC.  Sony will not let developers publish games that do not meet this (and many more) requirements.
Comment: Are those requirements listed publicly anywhere, or just gleaned from leaks from developers? I'd be interested to read them. :)   I remember reading that Heavy Rain had to get special permission from Sony to delay the "you got a trophy" popup until the end of the chapter, because the dev felt it broke the immersion for it to pop up during gameplay.
Answer: The updated answer is "It depends if you consider network passes as DLC".
Many recent PS3 games lock their online content behind a "network pass", a small piece of DLC you need to download from the PlayStation Store but can be redeemed for free by using a one-time code included with new copies of the game. If you bought a used game but want to use the online features, you'll need to buy the code separately (usually for around $10).
If the platinum requirements for these games include online trophies, you'll need that piece of DLC, not all games that have a network pass require online play for platinum, though. Examples of games which require a network pass to platinum are Ratchet & Clank All 4 One and Uncharted 3. Sites like PS3Trophies.org usually list if a game's platinum requires an online pass.
One exception worth mentioning: EyePet has a trophy for downloading content off the store, that content could be free content, but if you don't have access to the store through the game (for example if the store is unavailable in your region or the game's region is different than your account's region), you cannot platinum the game.
Comment: I'm going to add to that network qualifier, in the case of a game like Uncharted 2 if for some reason the multi-player match-up server gets pulled, you would no longer be able to get Platinum as it requires you to have completed two on-line matches.
Answer: Another edge case where your definition of "DLC" may change the answer: episodic games like Walking Dead or Life Is Strange. In these games, you have to play through all episodes of the season to get platinum. If you consider episodes 2-5 to be DLC for episode 1, then this would be another case where you need DLC.
Answer: No, you don't, but without dlc, your percentage will be lower. Like you could only have 80% of trophies but still get platinum.
For example, I had bioshock 2, and about 60% of trophies. I hadn't played it online yet, and I hadn't downloaded patches. And when I finished single player,I wanted to test it online, so I had to download all the patches, and it downloaded only dlc trophies, and my percentage lowered to 45%.
Comment: yes, percentage calculation might vary if new trophies are added but you can still have a platinum and not be at 100% completion.


Windows Azure VMs: Connection Timeout to Remote MySQL Database

Question: I'm having a unique problem with Windows Azure that I don't see on other providers. I've been running connections from remote VMs to a MySQL database running on a DigitalOcean VM. I've successfully connected with AWS, Rackspace, Google, and all other providers, but for some reason, Microsoft Azure VMs don't seem to work.
VM OS: Ubuntu 14.04
I'm trying to connect using PyMySQL and SQLAlchemy.
What I've Tried:

The port is open and listening
The user definitely has permission to upload data into the DB (other remote connections with this user all work fine).
I have even tried "ufw disable" for the Firewall on the Windows Azure VM
I've set 3306 as an endpoint on the Azure VM

Despite all my attempts, the connection cannot be established. Is there something I'm missing on the setup?
Comment: Where's the host? Azure VM is the MySQL host? It's not clear if you are trying to connect from workstations to a MySQL in Azure VM or Azure VM is the client accessing a VM with MySQL outside Azure datacenter.
Comment: @BrunoFaria the MySQL host is located on DigitalOcean.
Answer: As Azure VMs disable ICMP and we can use SSH tunnels to allow outside access to internal network resources. However I don't have resource to create a DigitalOcean VM, but I have created 2 Azure VMs in 2 Cloud Services to try to reproduce the issue.
I installed mysql-server in VM.1 and mysql-client in VM.2.
Then I tried to connect MySQL server directly from VM.2, I got message "can't connect to MySQL…".
To work around this issue, I followed this post, created a SSH tunnel in VM.1 which hosted the MySQL server:

Open port 3306, so a remote client can connect to your MySQL Server. Run the following command to open TCP port 3306
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
Now let's check if the port 3306 is open by running this command:
sudo netstat -anltp|grep :3306
Create a SSH tunnel for port 3307
sudo ssh -fNg -L 3307:127.0.0.1:3306 azurevmuser@servername
Create an endpoint for the port 3307 in the dashboard of the VM in Azure management portal. For more details , See how to add endpoint to you Virtual machine. Now your Database host name is <vm_name>.cloudapp.net:3307

Then connect MySQL server from VM.2 using command:
# mysql -h <vm_1_name>.cloudapp.net -P 3307 -u user –pPassword
and it would work fine. Feel free to let us know if we have any misunderstood on your issue.
Comment: Hey Gary, thanks for this information. It seems SSH Tunneling would be a good solution, should've thought of it before... I was just stuck on the idea that I might've missed something to enable a MySQL connection.


How to create my own onChangeComplete function for input type color on React

Question: With react-color https://casesandberg.github.io/react-color/ .
I can use ready-made onChangeComplete function from react-color.
But I wonder how can I create that onChangeComplete by using input type color tag.
I tried onBlur but the color won't change until user clicks or presses tab
On the other hand, using onChange keep firing updates.
Because currently I'm using redux state, so dispatching update continuously when I drag and choose color isn't a good way.
Any ideas how to create onChangeComplete?
Answer: It depends on how you'd like to define a change. To prevent continuous updates every time the mouse moves, you'll probably want to update Redux state only when the mouse stops moving. (This seems to be the behaviour on the page you linked to).
You could use the following JavaScript to detect when the mouse stops moving:
let timer;

window.addEventListener('mousemove', function (e) {
  console.log('Mouse moving');
  clearTimeout(timer);
  timer = setTimeout(() => console.log('Mouse stopped'), 300);
});

Then, try putting the above code inside your ComponentDidMount() method and replace console.log('Mouse stopped') with whatever Redux action you want to dispatch!
300 is the number of milliseconds without movement that will trigger the action, which could be changed depending on how sensitive you want your app to feel.
Lastly, remember to remove the event listener in your ComponentWillUnmount() method.
Comment: Thank for your solution. I will try it. Anyways, I have found another solution which react-color is actually using and it is using debounce. I have posted the answer below for anyone interested in that.
Comment: About your solution, How can we add mousemove event into the popup native color picker ?
Comment: If you're using React class components, you can incorporate the code above into the `ComponentDidMount()` method, then trigger a function to read the colour values at that point and update state.
Answer: Here is the code that how react-color implemented onChangeComplete.
It is hard coded using debounce.
Comment: Hello, I am facing the same issue, can you give some example code on how to solve this? Thank you!


How to implement an efficient map tile engine on Google App Engine?

Question: I am trying to implement a map tile engine on Google App Engine.
The map data is stored in the database, the datastore (big table). The problem is that 20 requests might come in at approximately the same time to draw 20 tiles based upon the same set of rows in the database.
So 20 requests come in, if I write the code to read from the database for each request, then I will be doing 20 read's, which are the same, from the database, one read for each tile image output. Since each read is the same query, it doesn't make sense to do the same query 20 times. In fact, this is very inefficient.
Can anyone suggest a better way to do this?
If I use the memcache, I need to put the data into memcache, but there are 20 requests coming in at the same time for the data, then if I do a nieve implementation then 20 processes will be writing to memcache, since they are all going at the same time in parallel.
I am programming in Google Go version 1 beta on Google App Engine, I refer to the Python doc's here since they are more complete.
References:
Google datastore http://code.google.com/appengine/docs/python/datastore/overview.html
Leaflet JS I am using for showing map tiles http://leaflet.cloudmade.com/

To clarify.
I generate the tile images from data in the database, that is, I query the database for the data (this is not the tile image), then I draw the data into a image and render the image as a JPEG. As GAE is efficient for drawing images on the server side http://blog.golang.org/2011/12/from-zero-to-go-launching-on-google.html
Answer:
Organize tile entities so that you can find them via key instead of querying for them, i.e. using get() instead of query(). If you identify a tile based on several criteria, then create a natural ID by combining the criteria. E.g. if you would find a tile based on vertical and horizontal position inside an image then you'd do: naturalID = imageID + verticalID + horizontalID (you can also add separators for better viewing).
Once you have your own unique IDs you can use it to save the tile in Memcache.
If your tiles are immutable (= once created, their content does not change), than you can also cache them inside instance in a global map.

Edit: removed Objectify reference as I just realized you use python.
Edit2: added point 3.
Answer: I don't know about how Google App Engine does it, but MySQL has a query cache so that if the same query gets asked twice in a row, then it uses the results from the first to answer the second.  Google is smart about things, so hopefully they do that as well.  (You might be able to figure out if they are by timing it.)
One thing you might need to make sure of is that the queries are exactly the same, not just returning the same results.  For example, you don't want query1 to be
   SELECT lat, lng FROM mytable WHERE tileX=1 AND tileY=1
and query2 to be
   SELECT lat, lng FROM mytable WHERE tileX=1 AND tileY=2
I make tiles with gazillions of polygons, and when I did timing and optimization, I found to my surprise that it was faster to return ALL values and weed out the ones I didn't want in PHP than it was to stick in a WHERE clause to the SQL.  I think that partly it was because the WHERE clause was different for every tile so the MySQL server couldn't cache effectively.
Answer: A few things comes to mind:

How do you query for the tiles? you should be able to get the tiles using Key.get() which is way more efficient than query
Try to reduce the number of requests, using levels should reduce the number to around 4 request to retrieve the map.
Comment: I generate the tile images from data in the database, that is, I query the database for the data, then I draw the data into a image and render the image as a JPEG. As GAE is efficient for drawing images on the server side http://blog.golang.org/2011/12/from-zero-to-go-launching-on-google.html
Comment: @Phil I think that PNG will give you better results (quality/compression) for map image data.
Comment: @Phil Also would it be better to download the images client side? This is how all maps services (Google/Bing/Quest) are doing it.
Comment: Thanks Shay, yes I agree. Any other suggestion?


Is crystal report for visual studio 2013 free?

Question: I just need to generate basic reports with random parameters passed from asp.net c# code to the report.
I have searched a lot of pages even lots of people on stackoverflow have different opinions. But I need to clear this for my enterprise level project.
Is SAP Crystal Report for visual studio 2013 developer version free to use at development time as well as at deployment.
I have downloaded this from the following link:
<code>http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_15.exe
</code>
Please help with authentic proves?
Answer: According to the licensing that they have posted, yes it is free. Here is a link to the SAP forums that talks about it. http://scn.sap.com/thread/3462449
Comment: The way I interpret their licensing, I would say that yes it is within the allowed uses for the free license.
Comment: Does it mean that I can **deploy** my **distributed** application with basic crystal reporting for free?
Comment: That is how I interpreted it.  I did see a note somewhere that they have a restriction for server applications that allow for multiple concurrent user connections, but I don't know what your app is and the comment was for an older version of CR.
Comment: My app is a distributed application which will work in an intranet environment. And i dont need any data analysis tools to work with. I just want plain simple reports which I can proceed to print. So based on my such simple requirements, will it be free of cost in a distributed client server environment ?


Possible to create watch face for Apple Watch?

Question: I've googled over the internet, still can't find an official answer.
I can see I can make build glance scenes, but those are "hidden" one swipe away from the user beneath actual watch face.
Are developers allowed to publish watch faces?
Answer: I wanted to write my own watch face too - but for a hobby project, I don't think Apple allow time-centric apps for the Apple Watch on the App store at the moment.  The App I've written works well as a watch face, but doesn't support complications/glances (which you'd get if it was an official watch face).  I've blogged about how to write it here, with some code snippets in Swift: https://musingstudio.com/2016/08/04/how-to-write-a-watch-face-app-for-apple-watch/
Comment: From the [Help Center](http://stackoverflow.com/help/how-to-answer): Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it's there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
Answer: No, it is not possible.  In the Apple WatchKit forums, an Apple evangelist links to this thread for the FAQ on creating a custom watch face.
https://devforums.apple.com/thread/254629?tstart=15
Here is the link to the "official" WatchKit FAQ https://devforums.apple.com/thread/254675?tstart=0
Technically, you could create an app that is a watch, but it wouldn't be a watch face.
Comment: I wonder with the new native app support for Apple Watch if this is going possible or not. http://thenextweb.com/apple/2015/06/08/developers-can-now-build-native-apps-for-the-apple-watch-using-watchkit/ But it still sounds like a "no", except for that "complications" thing which just lets us add some text to existing faces (?)
Comment: No, it is still not possible with watchOS 2.  The ClockKit reference shows you what you can do on the watch face as a third party developer. https://developer.apple.com/library/prerelease/watchos/documentation/ClockKit/Reference/ClockKit_framework/index.html#//apple_ref/doc/uid/TP40016082
Comment: "Technically, you could create an app that is a watch" - I believe Apple will reject it if you do.
Comment: You could make the App look like a watch face. But Apple is likely going to reject it if it looks too much like the main watch face. you can design complications to be added to the existing available watch faces though. to place your app on the main watch face.


Sign In / Registration form

Question: I've seen this topic : Combining Sign in and Registration form
It gives me some answers, but let me show you the issue we're encountering.
We are doing a small app, and we want users to be able to login / register on the same screen. As we want to keep it as simple as it can be, we thought about using this kind of form :

This form could fit well in our case, but some questions:
• is it too simple? Will users take that registration seriously if we don't ask them some email or something else?
• is it too confusing? Are two actions too much for a single form? Should both buttons have the same color? If not, what colors should they be?
Answer:
Isn't it too simple?
Isn't it too confusing?

In the UX field, simplicity is the goal we all are trying to strive for.  However, when design patterns are not common practice, even if simple, will lead to confusion.
The username and password fields are commonly associated with sign in when they are displayed like in your screenshot (i.e. in the header).  The "Register" button, even though it's close to the username and password fields, is NOT associated with them to most user.  To most people, the Register button looks like a link to the registration page.  This disconnect will confuse users when they try to click on the Register button without inputting anything in the username and password field.
The common practice, if you want to consolidate registration and sign in onto one screen is to have a sign in/registration page.  On that page, user will able able to sign in or register:

Input Field Tip is Confusing
One input field should have one purpose but in your mockup, I see the input field tip states "Login/Email".  What does it mean?  Login with email?  Since you have the tip stating "Login/Email", user will certain not think they could also register too.
Answer: Logging in is an action that requires the input of the two fields (user name and password).
Register is not an action but a link that takes you to a different page to enter your data and then sign up.
So, remove the register button from that form because it is a distinctly separate process from logging in.
Optionally, you may also put the entire registration form on the front page if you really want them to register. This is much more friendly and inviting than a red register button. If you do that, make sure that the registration "pane" or "box" is clearly separated from the "login" box.
Comment: Clicking on register button won't send the user to another page : it will register him with the username and password he just set.
Comment: You might want to relay that information to your users so they don't get confused. Most people expect a separate registration form from logging in. What would happen (and how do you show it) if the user types in valid and existing credentials and clicks on register?
Answer: Hmm I would have to say why not make usage of content switching with javascript for the form area?
Basically you could separate content:
Email/Password & Login button in one instance with a URL asking "Not a User?"
 If they're not a user then click said URL swaps the "login" content to "register" content.
 The "register" content will show basically the same content except there won't be a login
 button, instead you'll see a register button. The "Not a user?" message will in turn be changed to "Already a Member?".
Hopefully that made sense, I had the same issue for a registration piece a while back that required the same "minimal" concept.
Comment: This is actually what we've done right now, but we're thinking about making it even more simple, if it's possible.

Sign In / Registration form


How to avoid null key errors in dictionary?

Question: How to avoid error if key is null?
//Getter/setter
public static Dictionary<string, string> Dictionary
{
    get { return Global.dictionary; }
    set { Global.dictionary = value; }
}

UPDATE:
Dictionary.Add("Key1", "Text1");
Dictionary["Key2"] <-error! so what can I write in the GET to avoid error?

Thanks.
regards
Comment: The code does not fit the question... Where is your key?
Answer: Use TryGetValue:
Dictionary<int, string> dict = ...;
string value;

if (dict.TryGetValue(key, out value))
{
    // value found
    return value;
}
else
{
    // value not found, return what you want
}

Comment: This answer is incorrect: `TryGetValue` throws an exception if the key is null.
Comment: @Grozz The question was how to avoid getting an error when a null key is provided for lookup in a dictionary.  Passing a null key to `TryGetValue` will still throw an error, so it doesn't answer the question.  In your answer, if `key` is null, an exception is thrown, so how does this address the original question?  He's trying to avoid the exception.
Comment: +1Use the try method, Don't use the contains method if you want to retrieve the value, it'll be inefficient as you'll effectively do the lookup twice
Comment: @JasonBaley not sure this has anything to do with the answer, `Dictionary` doesn't support null keys. Additional discussion can be found in this thread: https://stackoverflow.com/questions/4632945/dictionary-with-null-key
Comment: @JasonBaley please re-read the whole question carefully, not just the caption
Answer: You can use the Dictionary.ContainsKey method.
So you'd write:
if (myDictionary.ContainsKey("Key2"))
{
    // Do something.
}

The other alternatives are to either wrap the access in a try...catch block or use TryGetValue (see the examples on the MSDN page linked to).
string result = null;
if (dict.TryGetValue("Key2", out result))
{
    // Do something with result
}

The TryGetMethod is more efficient if you want do something with the result as you don't need a second call to get the value (as you would with the ContainsKey method).
(Of course, in both methods you'd replace "Key2" with a variable.)
Comment: I don't mean in a method but in the declaration!
Comment: @eman - I don't understand your question then. Can you update the code to show exactly what you are trying to achieve?
Answer: An extension method:
public static TValue GetValue<TKey, TValue>(this Dictionary<TKey, TValue> dic, TKey key)
{
    TValue result;
    return dic.TryGetValue(key, out result) ?
        result :
        default(TValue);
}

Usage:
var dic = new Dictionary<string, string>
{
   { "key", "value" }
};

string r1 = dic.GetValue("key"); // "value"
string r2 = dic.GetValue("false"); // null

Answer: A key can never be null in a dictionary. A dictionary is a hashtable where by definition you need a non-empty key or the hash function cannot map to the corresponding element.
Comment: how to check if it's null and return an empty string?
Comment: I think that was his question, how to avoid that a `null` gets set as key...though, his code does not quiet fit that assumption.
Comment: In your code you never access the dictionary by key. You simply return a static dictionary. I don't understand what do you mean.
Comment: @Bobby, this can never happen. If you try to use null as a key in a dictionary you will get ArgumentNullException so you can never have a dictionary with null key.
Comment: Yes, I think that was his question, how to avoid that Exception.
Answer: You're returning the wrong thing.  Don't return the dictionary, pass in a key and return the value.
public static string GetValue(string key)
{
    if(Global.dictionary.ContainsKey(key))
    {
        return Global.dictionary[key];
    }

    return ""; // or some other value
}


Which zookeeper nodes should not be deleted?

Question: I already googled this info but found nothing decisive. I want to clear my zookeeper, is it alright if I run rmr on all root nodes?
Thanks
Answer: Feel free to delete every node that your system it not using.
Also, you may want to use ephemeral nodes, that get deleted automatically when the connession with zookeeper server is dropped.


Unity Share Script Android to iOS

Question: Everything works fine on Android but I dont know how to make it work for iOS, Please Help out.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
using System;
using System.Collections.Generic;

public class ShareMenu : MonoBehaviour
{
    private bool isProcessing = false;
    public string AppLinkURL { get; set; }
    private string shareText = "Download This Game";
    private string gameLink = "Download the game on play store at " + "\nhttps://play.google.com/store/apps/details?id=com.CrazyDrivers";
    public void shareImage()
    {
        if (!isProcessing)
            StartCoroutine(ShareScreenshot());
    }

    private IEnumerator ShareScreenshot()
    {
        isProcessing = true;
        yield return new WaitForEndOfFrame();

        string destination = Path.Combine(Application.persistentDataPath, System.DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".png");
        Debug.Log(destination);

        if (!Application.isEditor)
        {
            AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
            AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
            intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
            AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
            intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), shareText + gameLink);
            intentObject.Call<AndroidJavaObject>("setType", "text/plain");
            AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
            currentActivity.Call("startActivity", intentObject);

            isProcessing = false;
        }
    }
}

Can you somehow help me to change this code for ios
to let me share to facebook, twitter, whatsapp. Because on android it works very well. I am newbie to programming.
Comment: What happens when you try to deploy on iOS?
Comment: @SP. It just closes app,and sometimes it freezes
Answer: I think the app crashed because you use AndroidJavaClass on iOS device.
You can try this.
#if !UNITY_EDITOR && UNITY_ANDROID
                AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
                AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
                intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
                AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
                intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), shareText + gameLink);
                intentObject.Call<AndroidJavaObject>("setType", "text/plain");
                AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
                AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
                currentActivity.Call("startActivity", intentObject);

                isProcessing = false;
#elif UNITY_IOS
                //put iOS share code here
#endif

if your app stop crashing(but it will do nothing. because we only allow it to run on android device).Then, you can look for iOS implementation.
For iOS code you may look for more here http://forum.unity3d.com/threads/is-it-really-that-hard-to-share-a-simple-score-on-facebook-and-twitter-natively.231390/
for facebook(only) you should use official Facebook Unity SDK
https://developers.facebook.com/docs/unity/
https://developers.facebook.com/docs/unity/reference/current/FB.FeedShare
Comment: I used share bunch unity , i can now share to facebook ,twitter,etc on IOs and android  , but dont know how to change something there , i want to share game link ,and score . but dont know how

Unity Share Script Android to iOS


Is my new wiring to the code?

Question: I am running 4 new circuits. 6/3 (50A 240V) Romex, 8/3 (40A 240V) Romex, as well as a couple of 12/2s.
Cables start at the far end of the boiler room from a panel, through 1.5" holes of several exposed joists, followed by finished basement (quite wide 3-4 ft) soffit that currently houses lots of other cables and wires, followed by stud space to the upper-level kitchen.
Is this to the code? Is it okay to run 6/3, 8/3, and two 12/2s in a single joist hole bunched together? Is it then okay to just have those wires laying in the soffit, since they are fished through? Just before they leave the basement for the stud space above, they are in close proximity with PEX tubing so want to double-check that as well. And once inside the stud space (they will branch out through holes to the other studs to the final outlet locations), do I need to put some kind of protective plating or conduits or would stapling them to the middle of 2x4 studs suffice?
Comment: In my jurisdiction they would call that bundling and flag it. They normally won't say anything with 2 cables and some areas up to 4 but when there are more than 3 current carrying we have to start derating over 8 current carrying conductors the built in safety in #14, #12
 exceed what is allowed So there can be some issues there even though nipples less than 24" don't have to be derated a long run like in the photo is normally flagged with more than 4 is all the states I have worked.
Comment: Are you talking about the joist holes?
Comment: Yes that many cables through a hole would be two many conductors as the other runs I see 6-3 , 8-3 & 12-2 x2   10 current carrying conductors as I said most jurisdictions would flag this as bundling.
Comment: @edbeal Thanks. If you would like to submit an answer, I'll upvote it.
Answer: In my jurisdiction they would call that bundling and flag it.
They normally won't say anything with 2 cables and some areas up to 4 but when there are more than 3 current carrying we have to start derating
over 8 current carrying conductors the built in safety in #14, #12 &#10 exceed what is allowed.
there can be some issues there even though nipples less than 24" don't have to be derated a long run like in the photo is normally flagged with more than 4 is all the states I have worked in.
I see 6-3 , 8-3 & 12-2 x2 10 current carrying conductors as I said most jurisdictions would flag this as bundling.
Comment: The extra hole would fly without the bundling issue. since it was not flagged On previous Jobs "IF" inspected maybe you could get by. I would add another path if the other jobs were inspected and passed.  I don't think they are supposed to be able to flag old work,  but I have seen inspectors flag old work for the belief it was not to code when built or work done without a permit and not inspected. ( I have suggested that home owners cover work that I did not do that I thought would get flagged as the lines on the right) in the past I have taken photos of existing work to protect my license.
Comment: Note that while some local AHJs and inspectors may frown on NM bundling overall, the NEC itself only squawks about this situation if the conductors are enveloped in insulation, or if the holes are sealed/plugged.  See paragraphs 2 and 3 of NEC 334.80 for details.
Comment: Wouldn't fly in Florida.+1
Comment: @edbeal Well the three bundles on the right were old wiring from 17 years ago. It was not flagged then and during construction. The hole on the left is a new one. So, would you recommend I put another hole and put 6/3+12/2, or should I run 6/3 and 8/3in dedicated holes and have a third one to run any extra 12/2s?
Comment: Ran out of room but 6-3 and 12-2 in 1 hole and the 8-3 and 12-2 in the other  2 holes keeps you from the larger de rate when you get over 9 current carrying conductors or referred to bundling.  Just trying to give you a heads up from someone that has done this and had inspectors in 3 states flag others work. I even started taking photos, with an Polaroid for those that remember them after one home owner had just done some work because of the wire dates the inspector thought I was trying to cheat for 12.$ permit fees. Until he found obvious diy mistakes. FYI

Is my new wiring to the code?


Installing floating floor and keep getting gaps

Question: My sister and I are installing pergo max premier which is a new verison of their floating floor, my sister has installed 2 laminate floors before and this type is a lot thicker with less give and more difficult to work with.
Each peace we really have to pound in place with a hammer and a tapping block, we are running it along a very big room, close to 150 feet in length and we are noticing that once we get to the 4th row the very first row against the floor a few gaps between the pieces are forming.
We have disconnected and redid the floors twice but it seems from us using the hammer and tapping block it's causing gaps in the rows that we have already done and the pieces don't seem to be locking in place like the should even though when we set them they are set as in as much as they can go.
Does anyone have any experience with this happening and how to fix it as we don't want to continue adding new rows when the first few rows gaps keep appearing.
Comment: Do you think that using [installation straps](http://www.jharris.net/Rockshire/Renovation%20Pictures/pergo%20install%201.JPG) would be helpful? I think they were originally made for the glue-together floors, but it could help with whatever is jostling your planks apart.
Answer: I haven't worked with the newer Pergo; the last I installed was in 2007.
However, check the installation basics (from here and here):

Are you installing in the correct direction?  The tongue facing upward should be on the floor and the next piece goes on top of it.
Is the floor flat?
Is the flooring material acclimated to between 65 °F and 72 °F for at least 48 hours?
Are you alternating seams so they are at least 12 inches offset from each row?
Are you not tapping from the sides?
Are you providing 1/2 inch clearance from the walls, pipes, and other fixed objects?  (3/8 is for rooms smaller than 40 feet.)
Are you damaging the tongues or seams?
Are you using T molding across the width of the room?  See the instructions for rooms longer than 40 feet.
Answer: There is nothing that anyone on the internets can help you with.  You have to do more due diligence to each board.  If ONE board isn't tapped in correctly it will throw off everything.  In a room as big as yours that is a huge mess.   I have worked with your exact flooring and all that I can say is completely scrutinize every board.
Also you should not be installing these in rows - hence your problem.  You should install 4-5 rows at a time and work yourself in sections of 10-15 feet.  Then you can see any tapping issues that you have.
A room that big is a TOUGH install.  Missing one out of 50 planks is TOUGH.  Follow my advice with doing more than a row at a time.  The good news is that you are just a little off.  Which means you are probably just missing putting one plank into place - since that will throw everything there after off.  If you had multiple issues in one area you would be way off.


Isomorphism between groups, groups of conics

Question: I have a projective plane: PG$(2, \mathbb{F})$, where char$\mathbb{F}\neq 2$. I have a C conics and an l line. U is a point in C'=C\l. There is an operation on C'. If A,B $\in$ C' and $H_{AB}$ $= AB \cap l$:
$A*B$ =
\begin{cases}
    U,& \text{if } H_{AB}U \text{ is tangent to C at U}\\
    D,              & \text{if} H_{AB}U \cap C = \{D,U\}
\end{cases}
I have to show that (C', $*$) is isomorphic to the additive group of $\mathbb{F}$ if l is a tangent to C,
or to the multiplicative group of $\mathbb{F}$ if l is a secant to C.
So far I proved that (C', $*$) is an Abelian group. To show that these groups are isomorphic, I think I have to find an isomorphism.
I know that $\mathbb{F}^*=\mathbb{F}$\{$0$} is the multiplicative group and it is commutative, and that the additive group is also commutative.
I am not sure how to continue. I believe we can focus on the cases where the conic is a parabola or a hyperbola, but I have yet to find the proof of these 2 statements. I would be grateful if you could help me.
Comment: A similar question was asked months ago, but got only partial answers: https://math.stackexchange.com/questions/3951052/groups-of-conics
Comment: @Intelligentipauca thank you! I think that my question is not even partially answered there, because when I proved that (c',*) is an Abelian group, I had to show that it is associative.
Comment: I'd like to see how you proved associativity.
Answer: First of all, it's easy to prove that $A*U=A$ for any $A\in C'$, hence $U$ is the identity element. Then, let $K$ be the intersection between $l$ ant the tangent to $C$ at $U$: for any $A\in C'$ we can construct $A^{-1}$ as the other intersection of line $AK$ with $C$.
From $K$ a second line tangent to $C$ can be constructed, with tangency point $V$. This line is the same as $l$ if $l$ is tangent to $C$, in which case $V\not\in C'$. But if $l$ is secant to $C$, then $V\in C'$ and $V*V=U$. Hence $V$ plays the role of $-1$ in the multiplicative group.
Comment: Because in the first case there isn't the analogous of $-1$.
Comment: You can choose at will three points on $C$, the images of $0$, $1$ and $\infty$. Choosing as $l$ the line through $0$ and $\infty$ and $U=1$, you set up the multiplicative group, while choosing $l$ as the tangent at $\infty$ and $U=0$, you set up the additive group. With both groups you can construct all rational numbers, is that enough?
Comment: Thank you! I am not sure that I understand why it is isomorphic to the additive group in the first case. (I get the point of the second case, thank you very much for answering!)
Comment: Can I ask you that why is the fact that there is not a '-1' element in the group means that it is isomorphic to the additive group of F (or if there is then to the multiplication group of F)? I mean is it sufficient to prove that? In that case when we just have to decide which is ismorphic to which, it is sufficient. Sorry, but I can not see why this proves that they are isomorphic in general.
Comment: What do you need to prove isomorphism?
Comment: That there exists a bijective homomorphism between the two groups. The $\phi$(identity element of (c',*))=identity element (of(F,+)(or(F, *))). $\phi$(V)=$\phi$(V)$^{-1}$.
Comment: Thank you very much! Yes, I think that is enough.