Non-USA superstars in the NBA seem to be much taller on average than superstars from the USA: What exactly is the reason?

Question: LeBron James suggested that he would like to participate in a USA vs non-USA all-star match, during the 2020 all-star draft. While forming hypothetical teams for such a match I quickly started finding it hard to find superstar players from the USA that could play the position of "center" (usually the tallest players on the team, and usually about 7 feet tall), and I found an overwhelmingly large number of superstars that could play center for the non-USA team.
The notion of a "superstar" is subjective, but most basketball enthusiasts would agree (to the extent that it's possible to agree on a list like this in sports) with Dan Favale's ranking of the top players in the NBA before the 2019-2020 season started. I will summarize the top 12 (since that's how many players are picked for each team in an all-star game) players from the USA and the top 12 players from outside the USA, the positions they usually play (C = center), and their heights:
<code>    Non-USA                                | USA
==========================================================================
1.  Giannis Antetokounmpo (SF)    6'11''   | Steph Curry (PG/SG)    6'3''
2.  Nikola Jokić          (C)     7'0''    | Kawhi Leonard (SF/SG)  6'7''
3.  Joel Embiid           (PF/C)  7'0''    | LeBron James (SF/PF)   6'9''
4.  Rudy Gobert           (C)     7'1''    | James Harden (SG/PG)   6'5''
5.  Ben Simmons           (PG/SF) 6'10''   | Anthony Davis (PF/C)   6'10''
--------------------------------------------------------------------------
6.  Luka Dončić           (PG/SF) 6'7''    | Paul George (PF/SF)    6'8''
7.  Pascal Siakam         (PF)    6'9''    | Damian Lillard (PG)    6'2''
8.  Kristaps Porziņģis    (PF/C)  7'3''    | Karl-Anthony Towns (C) 6'11''
9.  Danilo Gallinari      (SF/PF) 6'10''   | Jimmy Butler (SG/SF)   6'7''
10. Nikola Vucevic        (C)     7'0''    | Kyrie Irving (PG/SG)   6'2''
11. Marc Gasol            (C)     6'11''   | Russell Westbrook (PG) 6'3''
12. Domantas Sabonis      (C/PF)  6'11''   | Blake Griffin (PF/C)   6'9''
--------------------------------------------------------------------------
Average height:                   6'11''   |                        6'6''
==========================================================================
</code>
The  non-USA team would have zero people that are listed as usually playing the position of shooting guard (SG) and would have an extra-ordinarily large number of centres, forcing us to go deeper into the list of top rated NBA players to find enough people to fill the team, which will only cause us to run into more centres like Serge Ibaka (7'0'').
Jamal Murray is technically non-USA, since he's Canadian, but for the purposes of this study I've grouped him with team "America", since recruitment processes within North America differ greatly from those outside of North America (and not only can I do this to Jamal because I'm Canadian, but I also live in the city where Jamal was born ). The same is true for Shai Gilgeous-Alexander (Domantas Sabonis beat them both to all-star selection in 2019-2020 anyway).
It is understood that Trae Young, Kemba Walker, Chris Paul, Bam Adebayo, Jayson Tatum, Kris Middleton, Kyle Lowry, Donavan Mitchell, Brandon Ingram, Devin Booker, Bradley Beal, Draymond Green, Klay Thompson, and many others could have replaced (for example) Blake Griffin in the USA list, but none of them are centres anyway, and neither is Kevin Durant (who was left out of Dan Favele's list due to injury), and since Blake Griffin does in fact play center, replacing him with any of the above all-stars would only make my argument stronger.

What is the reason for this discrepancy? I have come up with some ideas, but they all have unsatisfactory aspects:

"Taller players are generally better at basketball, and the NBA only takes the best (i.e. tallest) international players, whereas we have a bigger pool of North American players from which to choose, so the shorter players have a better chance of making it into the NBA".

The flaw in this argument is that it is not true that taller players are generally better, because 7/10 of the top 10 players in the aforementioned list, are 6'10'' or shorter, and USA's last player Blake Griffin is at rank #17 is 6'9'' whereas everyone after Ben Simmons on team non-USA would not make it to the team USA team here.

"There's 7 billion in the world and only 330 million in USA, and if we need people to be at least 6'10'' to play the position of centre and we have a shortage of tall enough people from USA, we can pick from a bigger pool if we search outside USA".

This might be the real reason for the aforementioned discrepancy, but if the best basketball players are on average 6'6'' then it begs the question of why we haven't recruited more international players at around that height (unless such players at the superstar level don't exist internationally, which I doubt).
Comment: Solid 1st question, nice job. Also shutout to KW area! If I had to guess, it's better(lower risk) to bring over a taller player from overseas than shorter. I'm interested to know how many non US player you listed played college ball in the US and how tall they were when they were offered. It's a bigger risk to bring guys over from overseas as there are less scouts and less knowledge of the players. So if you have equal skills as a shorter player, then you have an advantage. You could always move a taller guy to center if they don't work out in positions you added them
Comment: ^ What I'm saying is kinda like hearing some NFL coaches saying they don't draft offensive linemen, rather transition defensive linemen who don't do well into offense. Offensive linemen have some of the most awkward movements in all football and if they haven't played a different position, it's very difficult to move them to any other position. So if you don't spend a draft on one, you're less likely to waste a pick that doesn't work in any position.
Comment: @alamoot Thanks :) It can't be much of a surprise that there's a few Waterloo programmers on StackExchange, but my parents and my brother's family live there too :)
Answer: Note: here I'll refer to the "world" game; there's no one World game style of course, but there are some things that tend to be more common in non-NBA leagues due to some rule differences and court differences.  It's a generalization of limited value, but it simplifies the answer.
I think that the answer to this would be the difference in the US and World games, in part, and in particular trends in the US game in the last five years or so that have massively changed the job of some players.
Taller is better, certainly, so long as it's not correlated with worse aspects - such as ability to make shots.  Lebron James is, well, Lebron James in part because of his height - at 6'9" he can shoot over the 6'4" players who otherwise have a similar skill set.  He has the abilities of a guard in the body of a power forward, and thus is one of the best players of all time.  Eat a little less veggies as a kid, and 6'6" Lebron James is maybe Paul Pierce good, but not Lebron James good.
That caveat, though, is pretty important: the likelihood of a taller player being as good a shot as a shorter player is not terribly good.  That's not solely because height makes it hard to be good at basketball skills - it can make it harder to be coordinated, but the real problem is there are maybe a hundred people at most over 7' in the US; there are tens of thousands of people who are 6'6" (1/1000 of US men, so maybe as many as 150,000) and even more who are 6'3" (2% of US men, so over a million). Given that of those hundred, only a few will be in their 20s at any one point - maybe a dozen or so? - and it's unsurprising you don't often see a person 7' or taller that is particularly good at basketball skills beyond the height, while you have millions of people vying to be Steph Curry or James Harden.  Of course you find better skilled players at that height!
World players tend to not be as well respected over here - that's slowly changing, but look at how hard it was to get Dirk Nowitzki to be respected here; when he started he was only drafted ninth, despite having a skillset that competed with adults, a nearly Lebron-level ability and at seven feet tall.  This is changing, in no small part thanks to Dirk himself; but it's slow.
One of the reasons world players tend not to be as respected here is that they're thought to be soft - the NBA used to be a far more physical league, and still has that reputation, though it's not truly deserved anymore I don't personally feel.  As such, taller players tend to have an easier time getting over here, because they're more likely to be able to survive the physical game than a smaller player.  Think about the Isaiah Thomas Pistons in the 80s, or the Patrick Ewing Knicks; those were bruising, physical teams.
More importantly, though, the taller World players are also a good fit for the US game right now. The World game has always tended to place a higher value on basketball ability than physical ability; look at players like Dirk, who was 7'0" but had an amazing outside game.  In 2020 that's not shocking or unique, but in 1998 it was not common - Kevin Garnett was the only truly direct comparison, really, over here, and he was unique in his own way.  The fact that the US game has shifted so much recently towards shooting has a direct impact here - even the center needs to shoot; no longer are Garnett and Nowitzki unique, but nearly every team has a center who's happy to shoot the three.  Thus, tall international players are comfortable shooting long distance, and come over here.
I suspect it's also in part that taller international players are more likely to be the stars of their local teams for years - and thus more likely to have a well rounded game; here, a 7' player is almost certainly going to end up on Kentucky or Duke or something and not have to carry the load, unless they're truly special, after high school, and even in high school odds are a player who will end up 7' is going to be on an AAU team with other highly skilled players.  In Croatia, or Germany, or Italy, it's more likely they'll be on a club team for years with somewhat less skill around them - and thus develop ball handling and distance shooting skills of their own.  This is just my supposition, though.
Finally; for more evidence of the NBA game change mattering, look at what this would've been like twenty years ago.  Picked at random, 2002: Starters Kevin Garnett and Tim Duncan  on the West were 6'11" each, plus Dirk Nowitzki and Peja Stojaković; the East had Dikembe Mutumbo, who was born in the Congo but went to college in the US, and two reserves at 6'10", Alonzo Mourning and and Jermaine O'Neal.  Four American (ish), two European, and one African players.  Lots near 7'.  And for whatever reason no Shaq that year!  In fact, only four years before, you'd have had a ton of 7 footers from the US - 1998 had Rik Smits (7'4"!!), Shawn Kemp (6'10"), Jayson Williams (6'9"), Antoine Walker (6'8") on the east alongside Dikembe, and Shaq(7'1"), Garnett(6'11"), David Robinson (7'1"), Tim Duncan (6'11"), Karl Malone (6'9'), Vin Baker (6'11") - the list goes on.  No shortage of tall Americans - but not what you'd expect of the game today, for better or for worse; there's just no place for a big guy who can't hit a shot from anywhere much outside of the restricted area.
One more "guess" - a few major failures, starting with the Bulls' historically disastrous draft and the failure of Greg Oden a few years later, made front offices hesitant to draft big centers - foot problems and other issues seemed to keep cropping up, while 6'6" guys were much safer.  Unfortunately, height and weight are both bad for your feet!  International players have the same issue, but since they come over at a few years older and often fully grown bodies, the scouts can figure out which ones are less likely to get hurt.
Comment: I realize this is a ton of supposition, and I'd rather have something better, but I just can't find anything clearly answering the question with actual evidence.  I'd love to see such an answer, though!
Comment: +1. I need a lot more time to read everything in full substance, but I appreciate the fast answer! I can't remember the last time I saw Sports.SE on the [HNQ list](https://lackadaisical-appeal.glitch.me/status), but early upvoted answers like yours here, [do help](https://meta.stackexchange.com/a/61343/391772)!
Comment: About world player being thought to be "soft", if I recall from Ball in the Family, when the Ball brothers played professionally in Lithuania, it was said that the game is a lot more physical there (?) and I think I've heard commentary about Marc Gasol being used to a more physical game in Europe (Gasol being Spanish). Is it true that Europeans are considered to be soft (unphysical)? Isaiah Thomas and Patrick Ewing days are long over, is it possible that the NBA calls fouls for much less than what would be required for a foul in Europe? Maybe I'm wrong, I just thought it was the other way.


How to make autocomplete search by an entity field instead of by name?

Question: Let's say we have 3 custom entities:

When creating a new operator, I need to autocomplete the license:

By default we can use the autocomplete to find by name. So, we need to type the name to display the related results.
But here I'd like to autocomplete by authority name instead (since a license has no name).
Is it possible? If so, how to do it?
Answer:
Create a new view with the display type "Entity Reference"
Add "Fields", "Filter criteria" and "Sort criteria" like in any other normal view
Under "Format > Settings", select the fields you want to be searchable
Under "Show > Settings", select the fields you want to show as search result
Save the view
Now visit "Structure > Content type > NODETYPE > Manage fields"
Edit your entity reference field, set the "Reference Method" to "Views: filter by an entity reference view"
Select your previously created view
Comment: You need Drupal 8.8.x or a patch for this to work https://www.drupal.org/project/drupal/issues/2174633


What is group manifold of a compact Lie Group?

Question: I searched on google the meaning of a group manifold of a compact lie group but I didn't get the answer.
A paper on arxiv "Background Independent Quantum Gravity:A Status Report- Abhay Ashtekar" on the page no. 25 talks about this.
Can anyone help me?
Comment: Can you perhaps add more context? Maybe some related definition..?
Answer: Take the special unitary group $\operatorname{U}(1)$ for example.
It is a group in that it is a set of elements that satisfy the four axioms of a group. Furthermore it satisfies the axioms that are necessary to make it a Lie Group. From here it is a theorem that: sets with a relation satisfying the axioms for a Lie Group have a natural manifold structure associated with them.
Now let's consider this set's natural manifold structure. Unitary matrices in one dimension have $n^2 = 1$ free parameter. The set of all elements of this group can naturally be given the structure of a circle, the manifold $S^1$. So when we talk about the manifold of a group we are referring to the fact that the elements have a natural manifold structure associated with them, as well as a group structure.
Now referring to the paper you cite, there is a separate thing called an action. This is where the group elements, or points in the group manifold, describe transformations on another space, for example the phase space of a particle. We would colloquially say a 'particle evolving on U(1)'.
Answer: It should be clear that a group manifold of a compact lie group is the compact lie group because lie groups are manifolds .
Comment: Ok, but exactly *what kind* of objects can have "*group manifold*" and exactly what is that?
Comment: I am a physics student not a mathematics.

If it is a compact lie group only, then he would have just written compact lie group instead of writing group manifold of a compact lie group.

The arxiv article given above talks about quantum mechanics on a compact lie group.
Is it the action of compact lie group on group manifold? "I also don't know what is group manifold."


Chatbot restarts conversation on minimizing

Question: I developed my chatbot using c# and bot framework sdk v4. I connected it to my webpage using react js by passing directline token. But now when i Minimize the chat and then maximize it the chat stops the flow and gets restarted. But the old messages are still there. I doesn't need to restart the flow when minimized. My reactjs implementation code is given below.
const store = createStore({}, () => next => action => {
         if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
            if (action.payload.activity.from.role === 'bot') {
               this.setState(() => ({ newMessage: true }));
            }
         }

         return next(action);
      });
this.state = {
         minimized: true,
         newMessage: false,
         side: 'right',
         store,
         styleSet: createStyleSet({
            backgroundColor: 'Transparent'
         }),
         token: null
      };
   }

   async handleFetchToken() {
      if (!this.state.token) {
         const res = <ReactWebChat directLine={ this.directLine } />
         console.log(res)
         // const { token } = await res.json();

         // this.setState(() => ({ token }));
      }
   }

   handleMaximizeButtonClick() {
      this.setState(() => ({
         minimized: false,
         newMessage: false,
      }));
   }

   handleMinimizeButtonClick() {
      this.setState(() => ({
         minimized: true,
         newMessage: false
      }));
   }

inside render
render() {
      const {
         state: { minimized, newMessage, side, store, styleSet, token }
      } = this;

<WebChat
                     className="react-web-chat"
                     // onFetchToken={this.handleFetchToken}
                     store={store}
                     styleSet={styleSet}
                     token={"my_token_here"}
                  />

Please help me in resolving the issue. Thanks in advance.
Comment: I noticed you have `onFetchToken={this.handleFetchToken}` commented out. What happens if you don't comment this out and use it as-is? I suspect that this is the issue as the `WebChat.js` file relies on this function, at least to some degree.
Comment: I get CORS policy issue. So I commented all the fetch token statements
Comment: Where do you obtain the token from? Wherever that is, that is where you need to update the CORS policy to include the URI for the page hosting your web chat. For instance, I run a server locally using restify to generate a token (by calling the `/directline/tokens/generate` API). I use "restify-cors-middleware" to manage CORS locally (more for testing, than anything). If I'm using ngrok to tunnel to ABS, then I update the whitelist found in the DirectLine Channel setting, under "Enhanced Authentication Option".
Comment: Resolve the CORS issue first so you are running the code as it is intended, then let's see if the issue persists.
Comment: Since i am new to this platform i didn't get the idea what you have said. Can you please clarify it. Or if possible can you put that as an answer.
Comment: How can i update cors policy issue?
Comment: Thanks for your comment @Steven. It helped me to resolve the issue.
Answer: Check out this solution I posted explaining how to make a basic local token server. Enabling CORS here only applies if you are running purely local. If you are tunneling via ngrok to Azure Bot Service, then you will need to make changes either on your bot's DirectLine Channel or on the App Service. View this image post for visual reference.


How to create a popup radiobutton scroll view in Android?

Question: Hi i am trying to make an app and i have trouble with this:
 When i press a button i want a small windows to show (not shure if i have to use popup) in     wich i want to have a scrollview full with radiobuttons and to be able to select one of them. During the scrolling i want to be able to see the backround that was before the popup. When selected a radio button the window should be closed. The scroll view should be vertical.
The code ive came up with uses a new activity ... and that hieds the background which i dont want to happen.
One more thing i want to ask is do i have to go through all my radiobuttons using a switch and case or can i combine it with a for loop?
Many tahnks in advance!
Comment: Consider to use spinner instead of your initial approach. I think that with spinner or custom spinner you can achieve all functionalities what you need.
Comment: Try PopupWindow. would be helpful for your requirements.
Answer: Here you will find the answer :)
http://developer.android.com/guide/topics/ui/menus.html
Comment: Hi, we should avoid answers with just a link. Or see how to reference it correctly: http://stackoverflow.com/help/referencing. Anyway, thanks for answer and welcome on SO.


Find all solutions $x^{40} \equiv 2 \pmod {79}$

Question: Find all solutions $x^{40} \equiv 2 \pmod {79}$.
I tried following steps from this question.
So we get:
$$y^{40} \equiv 2 \pmod {79}   \implies   (y^{40})^2=y^{80} \equiv 2 \pmod {79}.$$
Now since $80$ gives remainder $1$ when divided by $\!\!\mod {79}$, then:
$$y^{80} \equiv y^{79} \cdot y\equiv y \pmod {79}.$$
Thus, $x=2$? I did a direct computational of $2^{40} \equiv 2 \pmod {79}$ and it does seem true.
Did I approach this correctly?
Comment: Exhaustive search is one answer.... mainly consider that you can easily compute $x^k$ for large $k$ mod $m$ thanks to the properties of exponents mod $m$....
Comment: Note:  $y^{79}\equiv y \pmod {79}$ by Fermat's Little Theorem/
Comment: z = 2 mod(79) implies z^2 = 2 mod(79) how did you find this ? it should be 4 i think.
Comment: I was following the steps from another post similar to this one.
Comment: For the last step, did you deduce that y^79= 1 mod(79) ? because y^79= y mod(79) and y*y^79= y^2 mod(79).
Answer: Your basic idea is sound, but there are a number of arithmetic errors in your calculation.  A corrected version would be something like:
$$x^{40}\equiv 2 \implies x^{80}\equiv 4\implies x^2\equiv 4\implies x\equiv \pm 2$$
Where every congruence is $\pmod {79}$.
Comment: So the solution would be actually $\pm$ 2? But would my steps still hold or do I have to rewrite everything?
Comment: Yes you got (part of) the correct solution but you did so by making two separate mistakes which cancelled out.  So, yes, you need to rewrite.
Comment: Oh okay I see, but my solution was wrong in the sense that I didn't get the negative 2 right?
Comment: Yes, you said that $x\equiv 2$ where the correct answer is $\pm 2$.  But, really, the more important point is the algebra involved in getting there.  It looks (to me) like just an odd coincidence that the two mistakes happened to conspire to produce part of the correct answer.
Comment: I will check on it, I was doing in a rush, but I will fix it. Thank you very much
Comment: 2 and -2 are just preliminary solutions, the set is larger.
Comment: @Abra001  the solutions are $\pm 2 \pmod {79}$.
Comment: ah ok got it. thanks.


postfix virtual mailbox and forwards

Question: I setup postfix to run with virtual mailbox setup:
virtual_mailbox_domains = domaina.com domainb.com domainc.com
virtual_mailbox_base = /var/mail/virtualhosts
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
virtual_minimum_uid = 500
virtual_uid_maps = static:500
virtual_gid_maps = static:12
virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual:
firstname.lastname@example.com postmaster
firstname.lastname@example.com postmaster
email@example.com postmaster

/etc/postfix/virtual_mailbox
email@example.com domaina.com/first.account
email@example.com domainb.com/second.account
@domainb.com domainb.com/catch-all
@domaina.com domaina.com/catch-all
@domainc.com domainc.com/catch-all

My question is; where should I set aliases for existing user accounts, forwarding to another email address or piping to a local file? For example; I want to set these three:
email@example.com /var/my_app/pipe_a.php
email@example.com /var/my_app/pipe_b.php
firstname.lastname@example.com email@example.com
firstname.lastname@example.com firstname.lastname@example.com

Should I set these in /etc/postfix/virtual or in /etc/postfix/virtual_mailbox file? I couldn't make them working.
Your help is appreciated. Thanks.
Answer: I found that pipes and aliases should be set in the /etc/postfix/virtual file.
Virtual mailbox users can be set under the /etc/postfix/virtual_mailbox file.
Answer: Postfix pipes are configured in main.cf as described in the manual.
Then you set transport_maps to map (some) recipients to transports you defined (for pipeing).
Whereas delivering to virtual users remains configured as usual.

postfix virtual mailbox and forwards


Windows 7 - Remote Desktop - Save Credentials ... It saves the incorrect username

Question: In windows 7, I'm selected the option to allow saving of login credentials.
However, when I login to these remote sites, it tries to put my computer name first followed by the login name.
So let's say my first successful login is:
user_name  password123
when I go back to remote in later, it will be saved as:
computer_name/user_name password123  and this will obviously fail.
Any idea how to fix this?
Thanks
Answer: Put the computer or domain name in when you type in the username.  If you don't specify one, the local computer name will be used.


Django rest-framework Social Oauth2: How to set permission classes per view or method

Question: I'd like to set permission per view or method using Django rest-framework Social Oauth2.
How should I set permission to each view or method?
At first, I've tried to set 'DEFAULT_AUTHENTICATION_CLASSES' in settings.py. But some method doesn't need authentication, I'd like to set AllowAny. So, I've tried to set decorator to the method but it doesn't work.
settings.py
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
        'rest_framework_social_oauth2.authentication.SocialAuthentication',
    ),
}

views.py
@permission_classes([AllowAny, ])
@api_view(['POST'])
def someMethod(request):
    return foo

Answer: I resolved it by myself. Commented out DEFAULT_AUTHENTICATION_CLASSES on settings.py. And imported these Authentification and authentication_classes on views.py.
settings.py

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        # 'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
        # 'rest_framework_social_oauth2.authentication.SocialAuthentication',
    ),
}

views.py

from rest_framework.decorators import authentication_classes
from oauth2_provider.contrib.rest_framework import OAuth2Authentication
from rest_framework_social_oauth2.authentication import SocialAuthentication

class SampleViewSet(viewsets.ViewSet):
    authentication_classes = [OAuth2Authentication, SocialAuthentication]

    def someMethodNeedAuth:
         return foo

@authentication_classes([AllowAny, ])
@api_view(['POST'])
def someMethodAllowAny(request):
    return bar


Combination of 5 cards given a 7 card set

Question: I haven't done a whole lot of maths since uni and cant remember the equation for this. What I want to know:
Given 7 playing cards, how many 5 card combinations are there from this set?
This is a poker maths problem.
e.g. So given the player has [As, Ac] in his/her hole cards, on a board of [3s, 2c, Kc, Js, Qh]
How many 5 card cominations are there? eg As, 3s, 2c, Js, Qh
Answer: In general, you can pick 5 cards out of seven in $\binom{7}{5}$ ways, where $\binom{n}{k}=\frac{n!}{k!(n-k)!}$.
Hope this helps.
Comment: This works out to 21 combinations. Learning a bit about combinations will help you solve other problems of the same type.
Comment: Yes, i forgot to calculate the result...


Wordpress error because .mo files inside WP-Include

Question: I had a problem with my previous wordpress installation, actually the problem has been solved, but I still can't find an answer why this problem appears
so long story short, my problem can be solved by removing @include from index.php in the root, the file @include is a .mo extension file, the file is stored hidden in wp-include (random filename like .2e949ed0.mo)
is it malware or something? because after I delete it, the problem is solved immediately.
Answer: Yes, the .mo contains malware and is called from index.php and other random files on a random path and filename, included in a random comment such as :
<code>/*ba725*/

@include ("/home/xxx/public_html/wp-content/xxx/.e5eb56db.mo");

/*ba725*/
</code>
Are you using an original theme? If yes, can you indicate the name and make a list of plugins in use?
Comment: i think i have 2 nulled plugins, the rest of it is original/purchased/free version, thanks for the answer, i just want some answer why deleting those files is resolve my problem.
Comment: It doesn't solve your problem, at best it solves it temporarily since the flaw and some malicious scripts are still present in the nulled plugins you activated. These inclusions may return shortly.


Understanding the weighted cross-entropy method of u-net

Question: I am trying to implement the weight-cross entropy mentioned in unet
paper to counter the class-imbalances. I am not really able to understand how they are exactly implementing the weight-cross entropy.
Quoting the paper-

where $\ell: Ω \to {1,...,K}$ is the true label of each pixel and $w : Ω → \mathbb{R}$
is a weight map that we introduced to give some pixels more importance
in the training.

I have the calculated weighted function w(x) but I am not really able to understand how the modified cross-entropy is being calculated here.
Is it just by passing now the weighted function instead of the labels in regular cross-entropy  or is it by multiplying the weighted function with the output of product of log of target and labels.
Answer: The standard unweighted cross-entropy loss is
$$
\sum_{\mathbf{x} \in \Omega} \log p_{\ell(\mathbf{x})}(\mathbf{x}).
$$
The only difference in the weighted loss $E$ is that you have a set of multiplicative coefficients $w(\mathbf{x})$ that rescale the pointwise log-losses. The overall effect is that some pixels are considered more important to correctly classify.
Comment: Thank You, now this may not be the part of the question and I could post another one if you want but how do you suggest I should incorporate w(x) in the loss. I am trying to do in this way - `loss = weight_map * criterion(output,target)`


Isomorphic subalgebras of $K^n$ are just "permutations" of each other?

Question: Let $K$ be a field$^{[1]}$ and $n$ be a positive integer.
The $K$-vector space $K^n$ endowed with pointwise multiplication is an unital commutative associative $K$-algebra.
Suppose $A$ and $B$ are two unital$^{[2]}$ subalgebras$^{[3]}$ of $K^n$ and that there exists a $K$-algebra isomorphism $\phi : A \to B$.
Is it true that there exists a permutation $\pi : \{1,\ldots,n\} \to \{1,\ldots,n\}$ such that $\phi((a_1, \ldots, a_n)) = (a_{\pi(1)}, \ldots, a_{\pi(n)})$ for each $(a_1, \ldots, a_n) \in A$ ?
If it is not so: Are there some other characterizations of $\phi$ ?
I am stuck on this problem for a while.
Thank you in advance for suggestions or references.
[1] If necessary, you can assume $K = \mathbb C$ but I do not think this is really important.
[2] Since Eric Wofsey and Don L. have found counterexamples in the case of non-unital subalgebras, I required $A$ and $B$ to be unital, i.e., they contain $(1, \ldots, 1)$ where $1$ appears $n$ times.
[3] By "subalgebra" I mean that $A$ is closed respect to sum, product, and scalar multiplication by elements of $K$.
Answer: To answer your first question: no, there are isomorphic subalgebras which are not permutations of one another.  For example, consider the subalgebras generated by $(1,0,0,\ldots,0)$ and $(1,1,1,\ldots,1)$.  They are both isomorphic to $K$, but all permutations of the latter give itself.
Without the unital assumption, I don't know of a nice way to classify the subalgebras, so I don't know of a way to characterize the isomorphisms between them.
Answer: No.  For instance, consider the subalgebras $A=K\times\{0\}$ and $B=\{(x,x):x\in K\}$ of $K^2$.  These are both isomorphic to $K$, but they are not permutations of each other.  If you want a unital counterexample, consider $A=\{(x,x,x,y):x,y\in K\}$ and $B=\{(x,x,y,y):x,y\in K\}$ in $K^4$.
In general, if $A\subseteq K^n$ is a subalgebra, you can define an equivalence relation $\sim$ on $\{1,\dots,n\}$ by saying $i\sim j$ iff $a_i=a_j$ for all $a=(a_1,\dots,a_n)\in A$.  You can also define a subset $S\subseteq\{1,\dots,n\}$ to be set of all $i$ such that $a_i=0$ for all $a\in A$ (note that $S$ is either empty or is one of the equivalence classes of $\sim$).  It is then not hard to prove that in fact $A$ contains all elements $(a_1,\dots,a_n)\in K^n$ such that $a_i=a_j$ whenever $i\sim j$ and $a_i=0$ whenever $i\in S$, so $A$ is completely determined by $\sim$ and $S$.  Note that $A\cong K^m$, where $m$ is the number of equivalence classes of $\{1,\dots,n\}\setminus S$ under $\sim$.  Since every automorphism of $K^m$ comes from a permutation of $\{1,\dots,m\}$, we get that any isomorphism $A\to B$ between two such subalgebras comes from a bijection between the sets of equivalence classes $(\{1,\dots,n\}\setminus S_A)/\sim_A$ and $(\{1,\dots,n\}\setminus S_B)/\sim_B$.
Comment: OK, thanks! Thus the non-unital subalgebras case has a counterexample. Anyway, I am yet interested in the unital case, so I added in my question the hypothesis that $A$ and $B$ are both unital.
Comment: It is easy to modify it to give a unital example (you just need two equivalence relations with the same number of equivalence classes but different sizes of equivalence classes); I have added one.  In the notation of my second paragraph, $A$ is unital iff $S=\emptyset$.


QTextStream doesn't write before QThread::sleep()

Question: It was expected that "hi again" appears on console 5 seconds after "hello world". But actually, the console was empty for 5 seconds and after that I could see both messages. What should I do to have the expected result?
#include <QThread>
#include <QTextStream>

QTextStream qout(stdout);

int main()
{
    qout << "hello world\n";
    QThread::sleep(5);
    qout << "hi again\n";
    return 0;
}

// The "multithreading" tag is there since I found this problem during writing a multithreaded program, and that the solution may be applied to multithreaded applications.
Answer: QTextStream doesn't automatically flush its buffer on a newline character.  The easiest solution here is to use endl, which adds a newline character and calls flush() for you:
qout << "hello world" << endl;
QThread::sleep(5);
qout << "hi again" << endl;

Of course, you could call flush() manually:
qout << "hello world\n";
qout.flush();
QThread::sleep(5);
qout << "hi again\n";
qout.flush();

Depending on your use case, another possibility is to rely on the QTextStream's destructor calling flush().
{
    QTextStream qout(stdout);
    qout << "hello world\n";
}
QThread::sleep(5);
{
    QTextStream qout(stdout);
    qout << "hi again\n";
}

Answer: The problem is not related to multithread. The reason is that your input is being stored in buffered data, which has not been written to stdout yet. In order to force the stream to write its data, please call QTextStream::flush() before sleep() =)
#include <QThread>
#include <QTextStream>

QTextStream qout(stdout);
int main()
{
    qout << "hello world\n";
    qout.flush();

    QThread::sleep(5);
    qout << "hi again\n";
    qout.flush();

    return 0;
}


Regarding performance optimization techniques to be keep while coding

Question: As I was doing a research on  measure elapsed execution time in Java by using System.currentTimeinMillis() on a piece if a code that is shown below but my Query is what other performance techniques we should keep in mind while codeing besides measuring the time , My query is focussed more on performance optimaztion techniques..
    public class MeasureTimeExampleJava {

    public static void main(String args[]) {

        //measuring elapsed time using System.nanoTime
        long startTime = System.nanoTime();
        for(int i=0; i< 1000000; i++){
            Object obj = new Object();
        }
        long elapsedTime = System.nanoTime() - startTime;

        System.out.println("Total execution time to create 1000K objects in Java in millis: "
                + elapsedTime/1000000);

        //measuring elapsed time using Spring StopWatch
        StopWatch watch = new StopWatch();
        watch.start();
        for(int i=0; i< 1000000; i++){
            Object obj = new Object();
        }
        watch.stop();
        System.out.println("Total execution time to create 1000K objects in Java using StopWatch in millis: "
                + watch.getTotalTimeMillis());
    }

}

Output:
Total execution time to create 1000K objects in Java in millis: 18
Total execution time to create 1000K objects in Java using StopWatch in millis: 15

Comment: Did you have a question?
Comment: @HotLicks.. what other performance techniques we should keep in mind while codeing besides measuring the time..?
Comment: (I'm relatively certain that this thread is a duplicate of about 50 others, but I'm too lazy to look up its predecessors.)
Answer: Here are the steps I take when attempting to keep optimization of the code in mind:

Use best practices for architecture / design
Write easy-to-maintain code
Measure the result with a profiler
Go and optimize only parts of the code that the profiler say need attention
Only spend time optimizing things that will affect the actual user of the program

My profiler will show me various areas of interest

CPU hotspots
Excessive memory use (can manifest in heavy GC and/or heavy swapping)
Excessive IO (disk, network)
Answer: I'd say that you should care about lots of other things, all of which should be accessible via a tool like Visual VM:

CPU
All generations of heap
Threads running and their states
Objects being created and disposed of
Garbage collection cycles
Network traffic
Resource allocation and cleanup

Micro tests like this are rarely helpful.  The JVM uses runtime statistics to optimize performance, so "burn in" can be an issue.
Answer: The number one rule of optimization is DON'T.  Unless you know very precisely what you're doing, you'll optimize the wrong things, miss the right things, make performance worse, and destroy reliability and readability.
Concentrate on writing well-structured, well-documented, compact code.  If optimization is needed later it will be much easier to accomplish.
(And be aware that measuring the performance of new Object() in Java is a fools errand.  The garbage collector is the 800 pound gorilla in the room, so all your measurements will be useless.)
Answer: You are testing two different ways of measuring elapsed time. Your test is flawed as you're running both tests in the same JVM execution. This runs the risk of the first test warming up caches and impact the second test. The correct way is to run each test in its own JVM execution.


Ajuste de cor do texto em temas diferentes

Question: Trabalho na manutenção de um sistema que só podia ser exibido com o fundo branco, e recentemente adotamos a possibilidade de o usuário escolher o fundo escuro.
Alguns campos de texto são guardados com formatação no banco de dados, sendo assim caso a cor do texto formatado seja preto a exibição fica comprometida.
Há alguma forma de melhorar a exibição desses textos formatados com cor preta no fundo escuro?
Procuro alguma biblioteca javascript ou compatível com asp.net para fazer a adequação das cores.
Edit
Segue um exemplo de como os dados são salvos no banco:

Todo e qualquer retrabalho é desnecessário e causa perda
 de tempo, vê-se logo ao analisar a palavra. Com foco em evitar o retrabalho e
 perda de tempo, foi criada a API . Tendo em sua primeira versão a
 finalidade de disponibilizar a lista de produtos cadastrada em nosso ERP, bem
 como, a possibilidade de inserir através de serviço, pedidos no já mencionado
 ERP.

            Este
 documento especifica alguns dos principais requisitos da API .
 Sua criação se deu para auxiliar desenvolvedores, fornecendo as informações
 necessárias para a implementação de uma integração coerente e prática.

            As
 demais seções apresentam as especificações da API e estão organizadas da
 seguinte forma:

·
 Seção 2 –
 Classes para a comunicação: Descreve o formato das classes de comunicação
 bem como as tipagens e obrigatoriedades de seus atributos.

 Seção
 3 – Serviços disponíveis: Descreve
 os serviços disponíveis na versão corrente da API  bem como um
 exemplo passo
Comment: Cores, tamanhos de fonte, entre outros, se trata com `CSS`
Comment: Poderia colocar na pergunta alguns exemplos da formatação que vem do banco para uma melhor análise.
Comment: @sam inseri um exemplo que peguei direto do banco
Comment: @Pilati acabei de editar minha resposta vale a pena tu dar uma executada e analisada no meu código e tentar adaptar para o seu.
Answer: Você pode fazer a mudança das cores/fontes das letras por css.
No seu código js, quando o usuário chamar a função que troca a cor do fundo, serão executados os comandos para a mudança do tema, nessa mesma função coloque comandos css para fazer a troca da cor das letras.
Ou caso não queira fazer isso, pode mudar a cor padrão da fonte para um cinza, que combinaria com o preto e o branco, dando destaque em ambos!
Abraço, qualquer duvida estou a disposição!
Comment: Colocar uma cor intermediária não seria uma opção, posso colocar um cinza, mas e se o texto for cinza? apenas altero a cor do problema
Comment: Ah sim, entendi! Você está utilizando o bootstrap ou algo para te auxiliar com o design da pagina? pode fazer a alteração com código in-line por JS... Seria interessante ter algum código que coloque automaticamente uma cor que de contraste com o fundo. De uma procurada no google, provavelmente já fizeram algo parecido!
Answer: RESPOSTA EDITADA
Bem acredito que a maioria das coisas visuais que você esteja enfrentando possam ser resolvidas com CSS e alguns tratamentos.
Por exemplo quando o usuário mudar para o BackGround escuro chamar alguma class que mudasse a formatação dos inputs de dados, dentro dessa class (no CSS) todos elementos devem ter o
!important

pois esse comando vai ignorar regras antigas e executar por cima delas por exemplo meu código tem comando de Style inline no HTML e meu CSS tem o !important olhe o resultado:

    function changeclass() {

    var NAME = document.getElementById("change")

    NAME.classList.toggle('bgEscuro');

    }
    .bgEscuro {
        background-color: black !important;
        color: grey !important;
    }

Hello World!

    <button type="button" onClick="changeclass()">Click Me!</button>

https://docs.microsoft.com/en-us/aspnet/web-forms/videos/how-do-i/how-do-i-customize-my-site-with-profiles-and-themes
https://www.w3schools.com/css/css_background.asp
https://stackoverflow.com/questions/16813220/how-can-i-override-inline-styles-with-external-css
Comment: Não consigo alterar por css porque as cores estão como estilo inline, que tem maior prioridade do que definidos em classes CSS
Comment: e não há uma função javascript que troca a cor, a folha de estilo inteira é alterada para a que contém o tema correspondente
Comment: Bem eu acredito que você possa colocar assim no CSS então .bgEscuro {
    background-color: black !important;
    color: grey !important;
}

Colocando o !important ele ignora todo e qualquer outro código mesmo que inline e executa com prioridade o codigo com !important
Comment: Vou editar minha resposta colocando style inline e o css com !important para você ver
Comment: @Pilati resposta editada pode conferir agora


How CNN reduces number of feature maps/ number of classes?

Question: How does the CNN reduce numbers of feature maps or shall we say classes?  I have looked into some literature where they have this in their methodology:
Encoding part:

Convolve using ReLU x 2feature
Convolve using ReLU
Max pooling. Reduce image size by a factor of two. Repeated for about 5 times

Decoding part:

Upscaling. Increase image size by two
Convolve using ReLU. Reduce number of feature maps by four.
Convolve using ReLU. Reduce the number of feature map or number of classes. From a certain amount down to three.

My question is about number 6.
Comment: What exactly is the question?
Answer: Convolution layer convolves its inputs with kernels. In simple 2D case, each kernel has shape <code>(kernel_width, kernel_height, n_inputs)</code>, and convolution produces a feature map that represents how strongly the kernel responds to the inputs.
For each kernel in the convolution layer one feature map gets generated. If you have 128 features in a hidden layer and you pass this into a convolution layer with 64 kernels, output will have 64 features.
Usual architecture of convolutional autoencoders and image segmentation networks performs first encoding, where spatial resolution decreases and number of features increases—aggregating local information from pixels to global information about the whole image—followed by decoding where this process is reversed.
Comment: What happens to the remaining 64 from 128 features in the hidden layer if it passes with convolutional layer with 64 kernels? Will this occur in decoding layer side?  BTW very thankful to you Sir Jan Kukacka
Comment: As said in the first paragraph, each of the 64 kernels looks at **all of the 128 input features**. They are all used by all kernels. Number of outputs depends only on the number of kernels.
Comment: Also, have a look at this [answer](https://stats.stackexchange.com/a/365337/163572)
Comment: If this answered your question, don't forget to mark the answer as accepted


Finding a string and remove all contents between two delimiters

Question: I have searched and I don't know what I'm doing wrong but I can't find an answer to this question.
I have a file with all text stored as a single line. I am needing to find a pattern and remove all the text before and after that text until delimiters.
Ex. File
<code>{"something":false,"more":"123","moresamerecord":"otherstuff"},{"something":false,"more":"abc","moresamerecord":"otherstuff"},{"something2":false,"more":"def","moresamerecord":"otherstuff"},{"something2":false,"more":"456","moresamerecord":"otherstuff"},
</code>
Keep in mind this is a single line with multiple records. I'm trying to find "abc" and remove everything between the previous and next record.
Expected outcome should be this.
<code>{"something":false,"more":"123","moresamerecord":"otherstuff"},{"something2":false,"more":"def","moresamerecord":"otherstuff"},{"something2":false,"more":"456","moresamerecord":"otherstuff"},
</code>
I have been trying and unable to figure this out, any help would be appreciated.
Comment: Use codeblocks and add the expected output to your question. `[` and `]` don't appear anywhere in the text.
Answer: In principle something like

format into lines, by sed
delete whole lines, by using grep
format back into stream, by perl

cat xyz | sed 's/},{/\n/' | grep -v 'abc' | perl -ape's/\n/},{/'
with brackets {} still need to be escaped ?


Publishing Chrome Extension directly from Github

Question: I have my chrome extension (the one's I authored) hosted on Google Chrome store. I did create a developer account (5$ one).
I'd like to link my chrome extension to it's github repository and automatically update it every-time I update the code instead of manually zipping it and uploading the zip file. Is there a way to do that? I couldn't find anything here https://developer.chrome.com/docs/webstore/publish/
There is a self hosting section but I don't think that helps with what I'm trying to. Has anyone figured out an automatic deployment from github to chrome store?
Comment: https://developer.chrome.com/docs/webstore/using_webstore_api/
Answer: You can consider using a GitHub Action, like for instance Chrome Extension upload & publish
That way, the zip/upload process will be automated.
Example:
uses: Klemensas/chrome-extension-upload-action@$VERSION
with:
  refresh-token: 'xxxxxxxxxxxxxxxxxxxxxx'
  client-id: 'xxxxxxxxxxxxx'
  client-secret: ${{ secrets.CHROME_EXTENSION_SECRET }}
  file-name: './extension.zip'
  app-id: 'xzc12xzc21cx23'
  publish: true

As commented by wOxxOm, make sure to set the client-secret value as a GitHub Secret, as shown here.
In the example above, I reference a secret named 'CHROME_EXTENSION_SECRET' that you must define first in your GitHub repository which has the sources of your extension:
${{ secrets.CHROME_EXTENSION_SECRET }}

Comment: @wOxxOm Good point. I have edited the answer to clearly reference a secret in the parameters of that GitHub Action.


Any (n-1) vectors from system X are linearly independent $\nRightarrow$ X is linearly independent

Question: Let X denote system of n vectors from $\mathbb{R}^n$. Any (n-1) vectors from X are linearly independent.
Claim: the system X is linearly independent.
I need a counterexample, because the claim should be false (I have answers, but not solutions). But I have difficulties in constructing it.
Take (n-1) linearly independent vectors. To make the whole system linearly dependent, we clearly need to add some linear combination of (n-1) vectors. But then, drop the any vector from initial (n-1) vectors and consider what is left. Clearly, we have linearly dependent (n-1) vectors which contradicts to the premise.
So, either my reasoning is flawed, or the claim is true.
Comment: Here's a counterexample for $n=2$. :) Take the two vectors $(1,1)$ and $(2,2)$.
Comment: Teh flaw is in "Clearly, we have linearly dependent (n-1) vectors". Think about the "clearly" ;)
Comment: "To make the whole system linearly dependent, we clearly need to add some linear combination of (n-1) vectors" - of n vectors not n-1 vectors
Answer: Take the vectors $(1,1,0)$, $(1,0,0)$ and $(0,1,0)$ of $\mathbb R^3$.
Comment: Wow, could please explain, what went wrong in my solution?
Comment: @Mirak: I'am sorry, but I do not understand you argumentation very well. But its wrong to suggest, that to make the (n-1) linearly independent system a basis you need to add a linear combination of those (n-1) vectors. In fact with no addition of a linear combination of the (n-1) vectors you will get a basis in the end...
Answer: Take $n-1$ linear independent vectors $v_1\dots v_{n-1}$. Set $v_n=\sum_{i=1}^{n-1} v_i$. Then $X=\{v_1\dots v_n\}$ fulfills the assumptions: $X$ is linear dependent, but any $n-1$ vectors are linearly independent.
To see this, let me prove that $v_2\dots v_{n}$ are linearly independent:
Then $\sum_{i=2}^{n}\lambda_iv_i=0$ implies
$$
\sum_{i=2}^{n-1} (\lambda_i+\lambda_n) v_i + \lambda_nv_1=0.
$$
Now the vectors $v_1\dots v_n$ are linearly independent, then $\lambda_n=0$, and $\lambda_i=0$, $i=2\dots n-1$ follows.


Audio continues playing on Phonegap when receiving a call

Question: I'm creating a Radio App, which works fine on iOS using HTML5.
To do it on Android I need to use Phonegap Media resource.
I'm able to play the streaming and MP3s files, even in background/suspended mode, but when I receive a call the audio continues playing. This is a big problem.
Shouldn't Android shut down the audio on a call? (call = priority on iOS).
I'm using the online build for Phonegap (http://build.phonegap.com) so, I cannot use any Java external plugin for Phonegap (like https://github.com/devgeeks/PhoneListener).
There is some Phonegap events (startcallbutton/endcallbutton), but not supported for Android (I really dont know why).
Anybody has a solution? Tanks!
Comment: Any update for Phonegap/Cordova 3.0/3.1 ?
Answer: You should add the READ_PHONE_STATE permission in your AndroidManifest.xml file, if its not there already, otherwise the app won't know if you are receiving a call or not. You will also need an addEventListener for an onPause and onResume method to tell the stream to pause and play when you get a call and when you hang up, respectively.


Error: "spawn dot ENOENT" when open side preview, but i've already installed Graphviz(dot)

Question: enter image description here
i followed a tutorial of visualizing a decision tree, i opened a DOT file in VSCODE and installed graphviz extension(by stephanvs),then opened the side preview,
it should display a picture of the decision tree, but the error"spawn dot ENOENT" appeared.
p.s. i can't find the graphviz extension by "João Pinto"
Answer: You installed "graphviz extension", but you probably did not install Graphviz itself.
Assuming you are using Windows, in a cmd or powershell window type dot -V.  If you get 'dot' is not recognized ..., that is a strong hint.
Go here: https://www.graphviz.org/download/#windows and download and install the 32-bit EXE ofor the latest version.
Then repeat the dot -V test.


How to link two checklistbox items?

Question: I'm using checklistboxes to display the FieldNames associated with a table (another checklistbox ). Multiple checklistboxes are generated dynamically and on checking any of the items from this fires an event 'OnCheckListBoxItemCheck' . Here the current item checked is obtained from the object 'sender'. The doubt is, how can i associate the item checked from the dynamic checklistbox and the item checked from the clbtables? Please Help...
<code> private void clbTables_ItemCheck(object sender, ItemCheckEventArgs e)
    {

        int indexofselectedtable;
        indexofselectedtable = Convert.ToInt32(clbTables.SelectedIndex);
        Metadata metadataobj = new Metadata(dbProperties);
        List<string> ColumnNames = new List<string>();
        ColumnNames = metadataobj.GetColumns(clbTables.Items[indexofselectedtable].ToString());
        chklistcolumns = new CheckedListBox();

      //Adds to the Checked ListBox
        for (int j = 0; j < ColumnNames.Count; j++)
        {

            chklistcolumns.Items.Add(ColumnNames.ElementAt(j).ToString());
        }

        this.Controls.Add(chklistcolumns);
        //To fire event for a dynamically generated column checklistboxes
        chklistcolumns.ItemCheck += new ItemCheckEventHandler(OnCheckListBoxItemCheck);
    }
 private void OnCheckListBoxItemCheck(object sender, ItemCheckEventArgs args)
    {
            Columns columnobj = new Columns();
            columnobj.ColumnName = this.chklistcolumns.SelectedItem.ToString();
            columnobj.TableName = this.clbTables.SelectedItem.ToString();
            selectedColumnsList.Add(columnobj);

    }
</code>
Comment: And what happens when multiple checkboxes in one list are checked?
Comment: Works fine for multiple checkboxes in one list as i'm using this.chklistcolumns ...How to recognize the columnname of the object that fires the event? I renames the chklistcolumns with the selecteditem of a table. Is there a way to get that from the object sender?
Comment: `Control cnt = ((CheckBox)sender).Parent` ?
Comment: @achilleterzo ((CheckBox)sender).Parent returning the Form name. My 'sender' object is an item from the CheckedListBox.
Comment: I did not understand your question. What exactly are you trying to do and which part of it does not work? In the long piece of code that you posted, please show where exactly the problem lies, and maybe even write some pseudo-code to show what you would like it to do.
Comment: From the above code I'm naming dynamically generated checkedlistboxes with the checkeditem of clbTables. On checking any of the items(i.e. the column names) from the dynamic chklistcolumns,an itemcheckevent is fired an within this i need to get the name of the chklistcolumns.

            Control parentTable = ((CheckedListBox)sender).Parent; is returning only the Form Name... and  this.chklistcolumns.Name;  returns the name of the checkedlistbox object created recently not the one that fired the event.
Comment: @NewBie is strange, if the checkbox is part of another element, it must return his parent element, i tested it and returned "System.Windows.Controls.DockPanel" type as his parent.
Comment: @achilleterzo  As i'm not using any panel, its returning the Form name not the checkedlistbox name. How can that be returned?
Comment: Oh, maybe i'm starting to understand your request... the sender is the checkedListBox, you let adding the checkbox using .add("item");
checkedLIstBox.parent then is the form... My solution under...
Answer: This is maybe what you want?
<code>checkedListBox1.Items.Add("test");
checkedListBox1.ItemCheck += new ItemCheckEventHandler(checkedListBox1_ItemCheck);

....

void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
    Console.WriteLine(((CheckedListBox)sender).Name + " is the father of item nr: " + e.Index);
    Console.WriteLine("The value of element nr " + e.Index + " is " + ((CheckedListBox)sender).Items[e.Index].ToString());
}
</code>

How to link two checklistbox items?


InnerJoin no CodeIgniter

Question: Estou trabalhando em um código e preciso fazer uma associação, aonde tenho que contar a quantidade de votação em um vídeo. O problema é que são 2 tabelas a de videos e votacoes . Em videos fica os vídeos cadastrados, e lá tem o id do vídeo e o link. Em votacoes tem o id_video e quem votou. Estou usando CodeIgniter para fazer a consulta e listar os vídeos:
Controller:
class Promocao extends CI_Controller {
    public function __construct() {
        parent::__construct();
        $this->load->model('miss_model', 'miss');
    }

    public function votacao($id = NULL) {

/* Pega os vídeos */
        $data['videos'] = $this->miss->find_all('id', 'desc');
        $data['titulo'] = 'Votação - TOP CLASS VIP';
        $this->load->view('votacao', $data);

    }
}

View:
<?php if (count($videos)):foreach ($videos as $row):?>

        <video width="240" height="240" controls>
            <source src="<?php echo base_url('assets/videos/miss/' . $row['video'])?>" type="video/mp4">
            <source src="<?php echo base_url('assets/videos/miss/' . $row['video'])?>" type="video/ogg">
            Your browser does not support the video tag.
        </video>

        <?php echo anchor('promocao/votacao/' . $row['id'], 'VOTAR', 'class="btn btn-success"');?>

<?php endforeach;?>
<?php else:?>

SEM VÍDEOS

<?php endif;?>

No view eu preciso colocar assim 30 votos por exemplo, ou seja, exibir a quantidade de votos obtidos de cada vídeo. O problema é que não sei como relacionar as duas tabelas pela id do vídeo e id_video da outra tabela.
Comment: Veja o [manual como usar join](https://ellislab.com/codeigniter/user-guide/database/active_record.html).
Comment: Desculpe, é **view** irei arrumar.
Answer: Bom, para fazer join no CI é assim:
dentro da model que herda a model do CI

public function listaVideos()
{
   return $this->db->select("videos.*, votacoes.voto")
               ->join("votacoes", "votacoes.id_video=videos.id")
               ->get("videos")->result();
}

é mais ou menos isso
uma referencia boa também é a própria documentação:
https://ellislab.com/codeigniter/user-guide/database/active_record.html#select

InnerJoin no CodeIgniter


VMware deploy OVF template causes vApps error

Question: I have a VMware vSphere essentials license, which includes one license for vCenter Operations Manager Foundation.  When I try to deploy the OVF template of  vCenter Operations Manager Foundation, I get the error:

The OVF package requires support for vApps with multiple VMs."
  "Details: Line 68: Unsupported element 'VirtualSystemCollection'

Here's a screenshot of this error:

The exact filename is VMware-vcops-188.8.131.52-2532416-vapp.ova.
I cannot create a new vApp in the File > New menu, most likely because my license does not support vApps.
How can I deploy this OVF template with my license?
EDIT:
So I'm being told in the first comment I should not seek to install the vCenter Operations Manager and only install the vCenter Server.  Why did they specifically list the Operations Center under the Essentials Kit and link to it?
Screenshot from the website:
Comment: You don't want to the operations manager, you want the following.  https://my.vmware.com/web/vmware/details?downloadGroup=VCL-VSP510-VC-510B-EN&productId=284&rPId=3573
Comment: Ok, so ignore the *vCenter Operations Manager Foundation* link on the **vSphere Essentials Kit Details** page then?  I put a new screenshot in the question.
Answer: I ended up just installing from the .iso file and abandoning the OVF package.  There are a few tutorials on how to do this.  Some are posted here:
https://www.virtuallyboring.com/vcenter-server-appliance-6-0-a-fresh-install/
http://www.virtxpert.com/installing-vmware-vcenter-server-appliance-6-0-vcsa/
http://www.vladan.fr/install-vmware-vcsa-6-0/


SVM and cross validation with a minimum finding algorithm

Question: Just a simple question on parameter selection for SVMs. If I use a minimum finding algorithm to find the optimal parameters for a set of data, how do I "average" the parameters over a set of cross validation runs to come up with the best parameters for my test set run? When doing X-fold cross validation, I can see simply averaging the fit of the model for each parameters set, but not sure how to do it with a minimum finding algo.
Thanks
Answer: It is best to think of cross-validation as giving you a performance estimate for a model fitting procedure, which includes selection of the hyper-parameters, in which case the best thing to do would be to use the same procedure to fit an SVM and tune the hyperparameters to the whole training set and use that to make the test predictions.
Comment: Hey sorry didn't quite understand your answer. In my cross validation, i split my train set into train/test sets, and then run either a grid search of min finding algo on a train set, and optimize parameters according to the test set. in grid search, i can average the fit over the cross validated parameters, but can't in min finding algo. when trying to predict a new test set, i can't optimize on the new test set and optimizing on the whole train set would just overfit the training data. i probably misunderstood your answer though.


Monomorphisms, unclear basic property, Functor

Question: Suppose that for morphisms in a category it holds that
$f\circ u=v\circ f'$ and $g\circ u=v\circ g'$ and that for a functor
$F$, $Fv$ is a monomorphism. Suppose that $Ff'$ and $Fg'$ are distinct.
WHY it follows that $Ff$ and $Fg$ are distinct?
Comment: It doesn't. You are probably missing some assumptions or misstated what you want to ask.
Comment: Please see page 7 [here](https://arxiv.org/pdf/1404.2528.pdf). The end of the first paragraph.
Comment: And that includes many additional assumptions, most directly that $Ff'\neq Fg'$ and $F$ is faithful, plus additional assumptions on the categories.
Comment: OK. And assuming that, how this follows?
Answer: What you missed is that $Ff'$ and $Fg'$ are also assumed distinct. Thus the mono property of $Fv$ implies $FfFu=FvFf'\neq FvFg'=FgFu$. Thus we must have $Ff\neq Fg$.


NFS drops out when .bat script is run

Question: I have a .bat script that runs from a Windows 7 machine. Part of the script is to use plink to ssh into a Red Hat machine and run a couple commands. I have about 4 or 5 plink commands within the script. For example:
plink -pw password -ssh username@host "tar -czplf /archive/mounted_folder/test.tar /archive/folder_to_tar"

where mounted_folder is a mounted NFS share, which is located on a server running Windows Server 2008 R2.
I noticed that if the system hasn't been touched in over a day and then the script is run, the mounted folders on the Red Hat machine dropout and become unusable. If you reset the Red Hat machine, the folders are properly mounted again, and if you run the script again, it works as expected -- nothing is dropped.
What exactly could be causing this problem?
Edit:
If I try to remount the folder directly after it drops out using
mount -a

the mounts still are unusable, even though no error is produced. I've found that a reboot is the only way to get them remounted
Comment: How is `mounted_folder` mounted and with what options? Is it in `/etc/fstab` or is it automounted? Let's see the line from `/etc/fstab`.
Comment: I'm mounting it in `/etc/fstab`. Here is what the mount looks like `server:/win_archive/folder_to_mount /archive/mounted_folder nfs defaults 1 2`
Comment: Try `mount -av` to get more information? Any thing in `/var/log/messages`?
Answer: I don't know if this is part of the problem or not, but mounted file systems don't need fsck or dump.

The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

For a mounted filesystem, you should use the mount option _netdev.  This tells the system that it needs to be mounted after the network is brought online. Otherwise, it might not mount at boot.
server:/win_archive/folder_to_mount /archive/mounted_folder nfs _netdev 0 0

Comment: This isn't the greatest answer since it might not be directly related to the problem, but it was way too much to leave as a comment.
Comment: I'll change my `fstab` as you mentioned, but I don't think this has much to do with the problem. The folders are mounted fine before the script is run. Isn't the `fstab` only ever looked at during boot or when you do a `mount -a`?

NFS drops out when .bat script is run


How to encypt my stored procedure so that no one see

Question: Mostly PLSQL developer build a stored procedure so anyone can see the stored procedure so now I want to make it encrypt how its possible.
Now in our company most of them can see the stored procedure and make some changes.
My main intention is security purpose.
Please help.
Comment: https://community.oracle.com/thread/949248?tstart=0
Comment: Possible duplicate of [Encryption inside oracle](http://stackoverflow.com/q/1859565/266304); but being able to see the source code and being able to modify it are very different things. Which are you really worried about?
Answer: I am afraid it's not really possible - at least I don't know the easy way for that. You can use wrap utility but when your user is smart enough then the
UnwrapIt is even there online.
BTW. Th wrapping has some side effects - performance degradation..


How to prevent access to a page but allow query

Question: I have a page defined by Views module.
(for example: http://namedomainnn.com/cvstaff)
However, I want user only allow to access using query command)
(for example: http://namedomainnn.com/cvstaff?name=user1)
How can I prevent any users to access without query.
Comment: Check query parameters present in URL(http://namedomainnn.com/cvstaff?name=user1) while accessing you page.
Use $_GET['name']. If it empty show access denied.
Answer: Simply check that your URL parameter exists and it's not empty before loading your view:
<code>/**
 * Implements hook_views_pre_view().
 */
function MY_MODULE_views_pre_view(&$view, &$display_id, &$args) {
  if ($view->name == 'MY_VIEW_NAME') {
    // If your URL parameter doesn't exist or it's empty, deny access.
    if (!isset($_GET['name']) || empty($_GET['name'])) {
      drupal_access_denied();
      exit();
    }
  }
}
</code>
So, accessing:
http://example.com/cvstaff?name=user will work.
http://example.com/cvstaff will show an Access Denied page.
Comment: I never write module and I should get the access to the server. Please let me know if this is correct: (a) create a folder "my_module_views_pre_view" in sites\all\modules  (b) and create a file  "my_module_views_pre_view.module" in that folder (c) copy the codes into the .module file, in the beginning of the file starts add php tag <?php


Best approach: HTTP POST (multi-part) from Android to GAE

Question: I would like to capture an image from the camera on Android, and send it to Google App Engine, which will store the image in the blob store. Sounds simple enough, and I can get the multi-part POST to GAE happening, but storing to the Blob store requires the servlet return an HTTP redirect (302). So, I need a connection that can follow redirects after doing an HTTP POST. Here is the code I WISH would work:
public static String sendPhoto(String myUrl, byte[] imageData) {
    HttpURLConnection connection = null;
    DataOutputStream outputStream = null;
    String pathToOurFile = "/data/file_to_send.jpg";
    String urlServer = myUrl;
    String lineEnd = "\r\n";
    String twoHyphens = "--";
    String boundary = "*****";
    // Please follow redirects
    HttpURLConnection.setFollowRedirects(true);
    BufferedReader rd = null;
    StringBuilder sb = null;
    String line = null;
    try {
        URL url = new URL(urlServer);
        connection = (HttpURLConnection) url.openConnection();
        // Allow Inputs & Outputs
        connection.setDoInput(true);
        connection.setDoOutput(true);
        connection.setUseCaches(false);
        // I really want you to follow redirects
        connection.setInstanceFollowRedirects(true);
        connection.setConnectTimeout(10000); // 10 sec
        connection.setReadTimeout(10000); // 10 sec
        // Enable POST method
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Connection", "Keep-Alive");
        connection.setRequestProperty("Content-Type",
            "multipart/form-data;boundary=" + boundary);
        connection.connect();
        outputStream = new DataOutputStream(connection.getOutputStream());
        outputStream.writeBytes(twoHyphens + boundary + lineEnd);
        outputStream
                .writeBytes("Content-Disposition: form-data; name="
                    + "\"file1\";filename=\""
                    + pathToOurFile + "\"" + lineEnd);
        outputStream.writeBytes(lineEnd);
        outputStream.write(imageData);
        outputStream.writeBytes(lineEnd);
        outputStream.writeBytes(twoHyphens + boundary + twoHyphens
            + lineEnd);
        outputStream.flush();
        outputStream.close();
        rd = new BufferedReader(new InputStreamReader(
                connection.getInputStream()));
        sb = new StringBuilder();
        while ((line = rd.readLine()) != null) {
            sb.append(line + '\n');
        }
        Log.i("Response: ", sb.toString());
        // Responses from the server (code and message)
        int serverResponseCode = connection.getResponseCode();
        String serverResponseMessage = connection.getResponseMessage();
        Log.i("Response: serverResponseCode:",
            String.valueOf(serverResponseCode));
        Log.i("Response: serverResponseMessage:", serverResponseMessage);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

As much as I try, this code will not follow redirects. The input steam is always empty, and the response is always 302. The image is uploaded nicely though. If someone could tell me what I can do to make it follow the redirect so I can read the response, I would really appreciate it.
Alternatively, if there is a better approach, I would love to hear it. I know there are libraries out there like Apache HTTP Client, but it requires so many dependencies that is seems like too much bloat for a simple task.
Thanks
Comment: Do you actually need to follow the redirect? If you only need to know that the image was uploaded successfully, you can simply check that the correct redirect was returned.
Comment: Yes I do need to follow the redirect. You see, when the image is uploaded to the Blobstore, an ID is generated. In order to reference the image, you need to record that ID somewhere, which happens in the Servlet that is hit because of the redirect.
Answer: A few months ago I was trying to do the exact same thing!
Basically, don't use HttpURLConnection. Instead, use HttpClient and HttpGet in the org.apache.http package which are part of the Android SDK.
Unfortunately I don't have my source code to provide an example, but hopefully that'll set you in the right direction.
Comment: Yeah I am sure this is a solved problem... and your approach is the one I have taken, with the addition of `MultipartEntity`. Still, I have no idea why the code above does not work.
Answer: not sure what went wrong, but you can follow redirect yourself. take the Location header out and make a new connection to it.


Notation for Legendre symbol over polynomial rings

Question: Hopefully this is a simple question to answer. I am wondering if there is any standard notation for something equivalent to the Legendre symbol, but over polynomial rings. That is, if we have a prime $q$, is there a standard notation to indicate whether some $f \in \mathbb{F}_q[x]$ is a square or not?
Answer: Yes, we have an analogy of $\Bbb Z$ with $\Bbb F_p[X]$, and we can also look at quadratic reciprocity in $\Bbb F_p[X]$ via Euler's criterion.
The details can be found in Lemmermayer, section $12.2$:
If $P$ is an irreducible polynomial over $\Bbb F_p$ with $p$ odd, and $NP=p^{{\rm deg}(P)}$, then $f^{NP−1}\equiv 1\bmod P$, hence
$$
0=f^{NP−1}-1=(f^{\frac{NP−1}{2}}-1)(f^{\frac{NP−1}{2}}+1)
$$
Since $P$ is prime we conclude that $f^{\frac{NP−1}{2}}\equiv \pm 1 \bmod p$.
Now define the Legendre symbol by
$$
\left( \frac{f}{P}\right):=f^{\frac{NP−1}{2}}\bmod P.
$$
And indeed we have $\left( \frac{f}{P}\right)=1$ if
$f\equiv g^2\bmod P$ is a square modulo $P$.


Apache 500 on parallels plesk + mod_jk: Could not find a worker for worker name

Question: For a long time I had 3 Java web apps running on box with Parallels Plesk panel. Everything was fine until yesterday.
Without any reason I started to get 500 on all apps running throe mod_jk - php apps are fine.
I tuned log level to debug for both apache and mod_jk - nothing beside this in mod_jk log is suspicious:
[Wed Jan 25 19:57:49 2012][5147:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (449): Attempting to map URI '/' from 2 maps
[Wed Jan 25 19:57:49 2012][5147:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (461): Attempting to map context URI '/*'
[Wed Jan 25 19:57:49 2012][5147:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (475): Found a wildchar match seomanagonode -> /*
[Wed Jan 25 19:57:49 2012][5147:0000] [debug] jk_handler::mod_jk.c (1839): Into handler jakarta-servlet worker=seomanagonode r->proxyreq=0
[Wed Jan 25 19:57:49 2012][5147:0000] [debug] wc_get_worker_for_name::jk_worker.c (111): did not find a worker seomanagonode
[Wed Jan 25 19:57:49 2012][5147:0000] [info]  jk_handler::mod_jk.c (1993): Could not find a worker for worker name=seomanagonode

and in access log I found:
184.108.40.206 - - [25/Jan/2012:08:45:58 +0100] "GET / HTTP/1.1" 500 806 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1"

I am running:

Plesk 9.5.4
Apache 2.2
Tomcat 6.x

worker configuration is as follows:
# seomanago.pl
worker.seomanagonode.port=8009
worker.seomanagonode.host=seomanago.pl
worker.seomanagonode.type=ajp13
worker.seomanagonode.ping_mode=A
worker.seomanagonode.socket_timeout=60
worker.seomanagonode.prepost_timeout=10000
worker.seomanagonode.connect_timeout=10000
worker.seomanagonode.connection_pool_size=200
worker.seomanagonode.connection_pool_timeout=300
worker.seomanagonode.retries=20

Any ideas? I hate Plesk - but it was not my choice - I just need to survive with it until we will be able to move to other hosting provider.
In Tomcat I see line indicating JK startup:
INFO: JK: ajp13 listening on /220.127.116.11:8009

In mod_jk.log there is information about creating worker:
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] build_worker_map::jk_worker.c (236): creating worker seomanagonode
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] wc_create_worker::jk_worker.c (141): about to create instance seomanagonode of ajp13
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] wc_create_worker::jk_worker.c (154): about to validate and init seomanagonode
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_validate::jk_ajp_common.c (1806): worker seomanagonode contact is 'seomanago.pl:8009'
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1895): setting socket keepalive to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1934): setting socket timeout to 60
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1938): setting socket buffer size to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1942): setting connection recycle timeout to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1946): setting cache timeout to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1950): setting connect timeout to 10000
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1954): setting reply timeout to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1958): setting prepost timeout to 10000
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1962): setting recovery opts to 0
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_init::jk_ajp_common.c (1966): setting number of retries to 20
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] ajp_create_endpoint_cache::jk_ajp_common.c (1843): setting connection cache size to 200
[Wed Jan 25 18:45:52 2012][12306:0000] [debug] build_worker_map::jk_worker.c (248): removing old seomanagonode worker

Any ideas where to look for more info on such thing?
Comment: Most bizarre Plesk behavior I saw so far - and I saw a lot of those :)

Although one of domains hosted on this box is valid until 2013 Plesk suspended it... and after this all workers stopped to work. Removing worker responsible for app on this domain solved problem...

I am not even trying to find-out why...

So in case you will spend 12 hours on same problem - check first if you have some domains suspended.

I will answer my question in 8 hours or so :)
Answer: Most bizarre Plesk behavior I saw so far - and I saw a lot of those :)
Although one of domains hosted on this box is valid until 2013 Plesk suspended it... and after this all workers stopped to work. Removing worker responsible for app on this domain solved problem...
I am not even trying to find-out why...
So in case you will spend 12 hours on same problem - check first if you have some domains suspended.


which number corresponds to the right endpoint of line segment [0,1)?

Question: I hold two basic opinion that
(1) Every line segment has two endpoints.
(2) The endpoint of a line segment is part of it.
So as for the line segment corresponding to [0,1],  if we remove its right endpoint,  which number corresponds to the right endpoint of the new line segment?  I don't think the number is still 1,  because we have already removed the point corresponding to 1,  thus created this new line segment, the point 1 is not part of the new line segment, so according to my opinion (2), I don't think the number is 1.

Update: A bounded continuous segment in a line is my definition of "line segment"

Update: I think I solved my question , see answer below
Comment: What is your definition of "line segment"?  I would say that $[0,1)$ isn't a line segment at all.
Comment: Well then what do you mean by "segment"?
Comment: Now.... you might be tempted to say that after removing $1$, there is still going to be some "largest" number *in* the interval... that it would be something like $0.999\dots$, however recall that $0.999\dots$ *is identically equal to $1$*.  With that in mind, any proposed maximum $m$ which is strictly less than $1$ we can show could not be the maximum since looking at the average, $\frac{m+1}{2}$, this will be strictly greater than $m$ and strictly less than $1$ and hence a number larger than $m$ in the interval contradicting that $m$ could have been the maximum in the first place..
Comment: The right end point is still $1$ and it is a half-open line segment. A line segment may not contain its end points -- it only needs to contain all points between them. Read [here](https://en.m.wikipedia.org/wiki/Line_segment#:~:text=In%20geometry%2C%20a%20line%20segment,exactly%20one%20of%20the%20endpoints.)
Comment: The interval $[0,1]$ has an infimum $0$ which happens to also be a minimum and also a supremum $1$ which also happens to be a maximum.  The half-open interval $[0,1)$ has an infimum $0$ which happens to also be a minimum and also a supremum $1$ which is *not* a maximum since it is not included in the half-open interval.  The half-open interval $[0,1)$ *does not have* a maximum.  "*(2) The end-point of a line segment is part of it*"  However you make your definitions you are using rigorous, this statement will likely be false.
Comment: The question is tagged with real-analysis, which implies that we deny the existence of such numbers.
Comment: You don't get to hold opinions about matters of fact.  If you consider $[0,1)$ to be a line segment, then (2) is simply false.  If you want to have a definition of "line segment" where (1) and (2) both hold, then you can only take CLOSED intervals to be line segments, but not open or half open intervals.  You need to look at what your definitions are, NOT what you would like them to be, before forming opinions about what they imply.  If you want a definition to imply something that it doesn't, then you either have to give up the definition or give up the implication.
Comment: As Eric Wofsey said, the set is not a line segment by any normal definition of a line segment
Comment: @EricWofsey a bounded continuous segment in a line is my definition of "line segment"
Comment: For a *closed* (*real*) interval (*in the usual topology*), the infimum will indeed necessarily be included in the interval.  Similarly for the supremum and these will be the minimum and maximum of the closed interval respectively.  For any other type of  bounded interval however, the infimum/supremum does *not* need to be included in the interval.  They will still exist, but won't necessarily be included, and as a result the minimum/maximum need not exist as is shown by your example of $[0,1)$ not having a maximum.
Comment: This may involve [surreal numbers](https://www.researchgate.net/publication/310797738_Some_Mathematical_and_Physical_Remarks_on_Surreal_Numbers) as the end point may be closer to $1$ than any possible real number.
Answer: Your opinions (1) and (2) are inconsistent with your (implied) opinion (3), that $[0,1)$ is a line segment. If you truly believe all three of these statements, then it follows, as night follows day, that you believe that $2+2=7$, that the Moon is made of green cheese, and that you are the Pope. I would recommend that you carefully consider your three beliefs, and see which one(s) you are really committed to, and which one(s) you are willing to abandon, in the interests of not being in a state of self-contradiction.
Answer: Your second "basic opinion" is simply untrue. The number is $1$.
Answer: First , it is helpful to  inform me to check whether [0,1) has a right endpoint after removing .
Second , just as @ShubhamJohri informed that

A line segment may not contain its end points -- it only needs to
contain all points between them. Read here

so I misunderstood the definition of a line segment.
Answer: There strictly speaking is no endpoint of a line_segment or ray at an open boundary. That said, the real number corresponding to an end of a line_segment defined by and terminating at a finite value {be it [included or excluded)} is simply that number, i.e. 1.


How to check if a number is present in the series $1, 7, 25, 63, 129, 231...$?

Question: How to check if a number is present in the series $1, 7, 25, 63, 129, 231...$?
The nth term of the series is $(2  n + 1) (2n^2 + 2 n + 3) / 3$.
if $N = 7$, then it is present in the series.
Comment: I don't know exactly what sort of answer you *expect* to be getting... you could expand this out as a cubic and solve the cubic and check to see if the solution is an integer.  If it is, then the number is present in the series.  It will be [quite ugly though](https://www.wolframalpha.com/input/?i=solve+for+x+y%3D%282x%2B1%29%282x%5E2%2B2x%2B3%29%2F3).
Comment: reminds me of [how to check if a number is Fibonacci](https://math.stackexchange.com/questions/9999/checking-if-a-number-is-a-fibonacci-or-not)
Answer: Suppose we seek an $n$ solving $O_n=N$, with $n$th centered octahedral number$$O_n:=\frac13(2n+1)(2n^2+2n+3)\in(\tfrac16(2n)^3,\,\tfrac16(2n+1)^3).$$Since $(2n)^3\le6N\le(2n+1)^3$, there's at most one candidate $n$ to check.
Answer: This is the sequence A001845 giving the centered octahedral numbers (crystal ball sequence for cubic lattice). For smaller numbers you can simply check the given list there.
Of course, with a formula at hand, you can simply
solve the equation
$$
(2n+1)(2n^2+2n+3)/3=k
$$
for $n$ and see if it has an integral solution. For example, take $k=20$. The formula shows that we need $n<2$. But for $n=0,1$ it is false. So first, estimate $n$, and then check for those $n$.
Comment: Surely the OP is looking for a way other than cross referencing a table...
Comment: I didn't expected this type of answer.I wanted a formula instead.
Answer: $$6N=8n^3+12n^2+16n+6\\=(2n+1)^3+5(2n+1)$$
Let $$M =round\left(\sqrt[3]{6N-5\sqrt[3]{6N}}\right)$$
If $6N-5M=M^3$, and $M$ is odd, then I think $N$ is in the sequence.


I want query for show Table Result and Use MySQL query only

Question: TABLE  A
ID   |   NAME
-----+-------
n1   |   BLACK
n2   |   WHITE
n3   |   RED
n4   |   GREEN

TABLE  B
ID |   A_ID  |   BLABLA      |    TIME
---+---------+---------------+--------
1  |   n1    |    X          | sometime
2  |   n1    |    X          | sometime
3  |   n1    |    X          | sometime
4  |   n1    |    Y          | sometime
5  |   n1    |    Z          | sometime
6  |   n2    |    Y          | sometime
7  |   n2    |    Y          | sometime
8  |   n2    |    Y          | sometime
9  |   n3    |    X          | sometime
10 |   n3    |    Z          | sometime
11 |   n3    |    Z          | sometime
12 |   n3    |    Z          | sometime

My Question
I want query for show Table Result and Use MySQL query only.
TABLE RESULT
NAME       |     X    |    Y    |    Z
-----------+----------+---------+-----
BLACK      |    3     |     1   |    0
WHITE      |    0     |     3   |    0
RED        |    1     |     0   |    3
GREEN      |    0     |     0   |    0

Comment: is it fixed that you would have only X, Y, Z as values (or columns in the result table)
Answer: SELECT
  a.name
  , sum(CASE WHEN b.blabla LIKE 'X' THEN 1 ELSE 0 END) AS X
  , sum(CASE WHEN b.blabla LIKE 'Y' THEN 1 ELSE 0 END) AS Y
  , sum(CASE WHEN b.blabla LIKE 'Z' THEN 1 ELSE 0 END) AS Z
FROM tablea a
INNER JOIN tableb b ON (a.id = b.a_id)
GROUP BY a.name

I use like instead of =, because like is always case-insensitive and = is not.
If blabla is an enum, then I recommend using =.


Is 8/4 time signature a thing?

Question: I'm refering to Cross Examination Moderato 2001 by Masakazu Sugimori and Minecraft by C418. Let's assume the beat unit is transcribed by a quarter note.
For the first piece, it sounds like eighth notes grouped in 3+3+2, but doubled. That makes a 3+3+3+3+2+2, so the 3s would be dotted quarter notes and the 2s would be regular quarter notes. That makes 8 quarter notes in total.
For the second piece, it sounds like quarter notes grouped in 3+3+2. That's like eighth notes grouped in 3+3+2, but half the pace. That also makes 8 quarter notes in total.
Why I'm confused is, firstly because, I've never seen a sheet music that states a time signature as 8/4. Secondly because, I don't know how long a motif is in these pieces, 1 or 2 measures. Is 8/4 a legit transcription for these pieces? If so, is there other pieces that is in 8/4?
Comment: This rhythm 333322 is usually notated in 4/4 when the bass line walks in steps pf quarter notes. (I've played that famous Glenn Miller number in 1968 in military service, but I don't remember the title. Further I've not encounter 8/4 yet, maybe 4/2, may depend from the sub-values of smaller notes....
Comment: @Albrecht Hügli A String of Pearls. Nice arrangement.
Comment: @Old Brixtonian: https://youtu.be/jg2vtWezWbw that's it! Thank you so much!
Comment: It's a thing, in that the maths checks out and you can write music in that way. It is, however, unusual. All I can say is to try writing part of it out and then playing it from the sheet. Which do you find easiest to read? - Also, is the whole piece using this accenting? If it's an occasional change to the phrasing, consider keeping the time signature the same and have an accent which isn't at the start of the bar.
Comment: 332 rhythm is extremely common. Related https://music.stackexchange.com/questions/109408/best-way-to-notate-332-syncopated-rhythm
Answer: With irregular timings, there's two ways (at least!) to write them out, so they're easily playable. One is to work out where the pattern repeats, and make that length one bar. So with something like 123 123 12, it's pretty straightforward to call it 8, if that pattern continues. If it doesn't, it's hardly a pattern!
The other way is to write out (using my example) two bars of 3, then a bar of 2, two bars of 3, then a bar of two. Starts getting tedious.
Another way would be to put it into whatever comes close, and use accents. But that's awkward because each first beat of the bar would naturally have its own accent, naturally. So, not the best of three.
I used to work with a Greek band, and we had more interesting time signatures like 13/4. 123 123 123 1234 was one pattern. Better written out as 13/4, though.
In fact, one could have any number over the 4 (or 8) - 5/4 and 7/4 are ones we come across regularly. And generally speaking, any time signature is divisible into 2s, 3s and sometimes 4s. 7/4 might be, for example, 12 12 123.
One other thought - when these odd ones are written onto sheet music, the better writers will group notes like quavers into their own little 'joined up' bits, like 6/8 should be two lots of 3 quavers.
Comment: I feel like I have also seen a convention like the "two bars of 3, then a bar of 2" which has dotted barlines within the pattern, and solid barlines at the end of each pattern. I really can't remember where though.
Comment: @SteveBennett - you probably have, but it gets tedious when trying to read it. And, it will depend, as I said, as to where and how much the emphases are needed.
Answer: There's a modern convention to notate bars that add up to 4/4 but have irregular 8th groupings as 8/8.   Using the same logic I would notate this in 16/8.
Using 8ths rather than quarters as the unit has the advantage of making it easy to show beat groups by beaming.  Some composers would state the groupings (as in my example).  I'd consider this implicit in the notation, therefore unnecessary.
Answer: I think a lot of it is how you feel the pulse of the music and in what tempo. For the first tune, if you feel it in bars of 4/4 at around 126bpm, the repeated melody is in 8th notes and the motif is 4 bars long. However, if you feel it bars of 4/4 at half that tempo, the motif is 2 bars long and the repeated melody is in 16th notes. I have never seen 8/4 written out before and for a piece of music like the first one you posted, it would be easier to read as an 8th note melody, so why not break it up that way.
That being said, if you want to think of it as 1 bar containing 8 quarter notes, then go ahead, especially if it makes it easier to read.
Answer: I'm with @meganoob on the first piece, it sounds like a 4 bar motif with a syncopated 2 bar 8th note rhythmic pattern in 4/4 time.
As for the second slower piece, this I hear as 3+2+3, not 3+3+2. The notes of the basic pattern fall on 1,3,4,6 so the last note on beat 6 is a 3 count.
I hear this as 8th notes in slow 4/4, about 53bpm. You could also could write it out as 8/8 grouped as 3+2+3. As mentioned in other answers and comments 8/4 is very unusual, I don't recall ever seeing it. It's better to go with an 8th note pulse.
Answer: It is quite common practice to note groupings in the time signature, like 2+2+3 over 8 instead of 7 over 8.
Comment: If this were elaborated upon, it would make a nice answer.

Is 8/4 time signature a thing?


How to remove PAGE SUM in Views Calc?

Question: How can I remove the Page SUM row in my Views Calc?
I have upgraded Views Calc module to its latest version.
Comment: After doing some trial and error, I have solved my problem.

You can remove the Page SUM in the Views Calc table by using CSS.

`td.view-subfooter{
display: none;
}`
Answer: You can achieve this in two ways
1) Add following style in your CSS
tr.view-subfooter-number{ display: none; }

OR
2) Go to  views-calc-table.tpl.php file under views_calc module directory and find the following code (PAGE SUM row code)

    <?php foreach ($row as $field => $content): ?>
      <td class="view-subfooter views-field views-field-<?php print $fields[$field]; ?>  <?php print $options['info'][$field]['align'] ?>">
        <?php print $content; ?>

    <?php endforeach; ?>

You can comment/remove the above code to hide 'PAGE SUM' row at view output.
Comment: 2) if you are going to edit a .tpl.php, best to copy it to your theme folder first ! that way you are overriding it and you still have the original.
Answer: As the page sum is used with the pager, therefore it should really only appear when using a pager so:
copy the views-calc-table.tpl.php to your theme folder and edit the footer part to :

<?php if ($view->query->pager->plugin_name != 'none' ): ?>

  <?php foreach ($sub_totals as $type => $row): ?>

      <?php foreach ($row as $field => $content): ?>
        <td class="view-subfooter views-field views-field-<?php print $fields[$field]; ?>  <?php print $options['info'][$field]['align'] ?>">
          <?php print $content; ?>

      <?php endforeach; ?>

  <?php endforeach; ?>

<? endif; ?>

  <?php foreach ($totals as $type => $row): ?>

      <?php foreach ($row as $field => $content): ?>
        <td class="view-footer views-field views-field-<?php print $fields[$field]; ?>  <?php print $options['info'][$field]['align'] ?>">
          <?php print $content; ?>

      <?php endforeach; ?>

  <?php endforeach; ?>

the line if ($view->query->pager->plugin_name != 'none' ): means that it shows the page sum row only the views uses one of the pager plugins.
This way you are not relying on CSS and you can still use the page sum row when using a pager.

How to remove PAGE SUM in Views Calc?


Given the equation $P(x) = x^4 + bx^2 + c$ and the points $(3,25)$ and $(1,9).$ How to find $b$ and $c$ such that it passes through the points?

Question: By using Desmos I've found that the values of $\;b = -8\;$ and $\;c = 16,\;$ but that doesn't really help me understand how to get those numbers.
Answer and why I got it wrong:
I've evaluated:
$ 9 = 1^4 + b\cdot1^2 + c \implies b = 8 - c \implies c = 8 - b$
and
$ 25 = 3^4 + b\cdot3^2 + c \implies c = -56 - 9b $
The part which I forgot to do was to substitute the equations into each other and not the original equation.  KM101 provides a more complete breakdown.
$ c = -56 - 9(8 - c) \implies c = 16$
$ -9b - 56 = 8 - b \implies b = -8$
Comment: Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
Comment: Two unknowns, two equations!
Answer: Notice that $P(u)-P(v)=u^4-v^4+b(u^2-v^2)$.  From $25-9=81-1+b(9-1)$  you'll find $b=-8$. Now exploit $P(1)=9$, that is $1-8+c=9$ to find $c=16$.
Answer: Substitute the $(x,y)$ pairs in to get a system of linear equations, which may be easily solved:
$$1^4+1^2b+c=9\qquad3^4+3^2b+c=25$$
$$b+c=8\qquad 9b+c=-56$$
Answer: Hint:
$$25=3^4+b3^2+c \implies 9b+c=-56$$
$$9=1^4+b1^2+c \implies b+c=8$$
Answer: Here's our function.
$$f(x) = x^4+bx^2+c$$
We're given two points.
$$A: (1, 9)$$
$$B: (3, 25)$$
For point $A$,  substitute $x$ and $y$ with $1$ and $9$, respectively. $$9 = 1^4+b(1)^2+c$$
$$9 = 1+b+c \implies \boxed{b+c = 8}$$
For point $B$, substitute $x$ and $y$ with $3$ and $25$, respectively.
$$25 = 3^4+b(3)^2+c$$
$$25 = 81+9b+c \implies \boxed{9b+c = -56}$$
Now, use elimination to solve for $b$ and $c$.
$$9b+c-(b+c)= -56-8$$
$$9b+c-b-c = -56-9 \implies 8b = -64$$
$$\boxed{b = -8}$$
Now, plug in $b = -8$ in either of the two equations to get $c$.
$$9(-8)+c = -56$$
$$-72+c = -56 \implies \boxed{c = 16}$$
So, the final quartic equation containing these two points is $f(x) = x^4-8x^2+16$.


Lisp merging pattern

Question: I am quite new in lisp, so maybe it is a stupid question. But I would like to merge two lists (s1, s2) according to a given pattern - list S3 of boolean (t nil....). If true use the element from S2, if false use the element as it is.  So the final should look like for
s1 (1 2 3 2 2 4) and s2 (8 9 5 6 8 9) and S3 (nil t nil t t nil) => (1 8 3 9 5 4)
Thank you very much!
R.
Answer: Lisp is a family of languages. If you mean Common Lisp, here is a possible two-lines solution:
<code>CL-USER> (defun merge-3 (s1 s2 s3)
           (loop for x in s1 if (pop s3) collect (pop s2) else collect x))
MERGE-3
CL-USER> (merge-3 '(1 2 3 2 2 4) '(8 9 5 6 8 9) '(nil t nil t t nil))
(1 8 3 9 5 4)
</code>

Lisp merging pattern