How are artificial intelligence and Natural intelligence compared?

Question: I can remember reading that computer intelligence is heading (or maybe the most powerful ones already have) towards the Natural intelligence of a four-year-old child. But how are the two kinds of intelligence compared?
Answer: You are probably referring to ConceptNet (created by the Massachusetts Institute of Technology under its Artificial Intelligence program).
It's a software system / semantic network containing lots of things computers should know about the world, especially when understanding text written by people.
Researchers from the University of Illinois (research team led by Stellan Ohlsson) did a study on the ConceptNet 4 version of the AI and they discovered that its IQ level is the same as that of a 4-year-old child (somewhat... see below).
The chosen IQ test is known as the Wechsler Preschool and Primary Scale of Intelligence (third edition, WPPSI-III). It's commonly used in schools across the United States and is designed to measure the level of intelligence in five key categories and consists of 14 subtests (picture memory, similarities, object assembly, picture naming...).

The  test  questions  (e.g. "Why do we shake  hands?")  were  translated into ConceptNet 4 inputs using a combination of the simple natural language processing tools that come with ConceptNet together with short Python programs that we wrote. The question answering used a version of ConceptNet based on spectral methods.
The  ConceptNet system  scored  a  WPPSI-III  VIQ  that is  average  for a four-year-old child, but below average for 5 to 7 year-olds
[CUT]
The large variations among subtests and ordinary common sense strongly suggest that the WPPSI-III VIQ results do not show that "ConceptNet  has  the  verbal  abilities  a  four-year-old."
Rather, children's IQ tests offer one objective metric for the evaluation and comparison of AI systems

(From Measuring an Artificial Intelligence System's Performance on a Verbal IQ Te st For Young Children - Stellan Ohlsson, Robert H. Sloan, György Turán, Aaron Urasky)
Comment: Counterintuitively the tests are also the measure of communication skills, tests for IQ for those who cannot read exists, but those "easier" for human are currently too hard for computers. If anyone really want all the details I am available on chat or I can give answer (but I am afraid it is kinda boring and longish explaination).
Comment: The article I read also mentioned the number of operations per second in connection the measure of intelligence. Wich is much bigger than the in the brain of a four-year-old child (and, for that matter, a grown-up person, if you can speak about the number of operations in the brain).
Comment: I like your answer, but I would like to add something. IQ tests are rarely measuring "intelligence", they exist to measure standarized (per age range) wisdom (knowledge), and were invented to tell apart children with learning difficulties, and serving solely one purpose - attemptimg test for fun is kinda pointless. Moreover there are strict rules to repeat test - cooldown time is needed, which is (probably not intentionally) not obeyed by NN creators. "Real" tests or rather meaningful measures of ability to learn were (to my best knowledge, and Google search) not used for NN up to today.
Comment: @EvilJS Your comments are a very suitable integration and the topic is very interesting. I'm looking forward to reading more.


convergence of geometric mean/harmonic mean

Question: Does any one know papers regarding the convergence of geometric mean or harmonic mean in probability, parallel to central limit theorem?
Comment: Please note that the various forms of the [CLT](https://en.wikipedia.org/wiki/Central_limit_theorem) are about convergence of standardized sample means in *distribution*. The fact that you mention convergence in probability makes me wonder if you aren't instead asking about convergence like the *weak law of large numbers*, which is about $\bar{X}_n \xrightarrow{P}\mu$
Comment: I think this is on-topic here, it's really a reference request so I have added the tag.
Comment: This is clearly on-topic here! probability is a basic part of mathematical statistics!
Comment: I flagged this question as off-topic http://stats.stackexchange.com/help/dont-ask
Comment: Okay, sorry if I screwed up with the flag. I thought asking for paper suggestions was off topic regardless of the desired content of the paper. If the question had been directly asking for help making an argument or proof (which is what Glen_b's answer provides instead of paper recommendations), I wouldn't have flagged.
Answer: If you're really after something like the weak law of large numbers, note that for positive random variables the log of the geometric mean is arithmetic mean of the logs.
Let $\tilde{X}_n = \left(\prod_{i=1}^n X_i\right)^{1/n}$ for $X_i>0$; and let $Y_i=\log(X_i)$. Then $\bar{Y}_n \xrightarrow{P}\mu_Y$ by the WLLN. Now you can write the $\epsilon_Y$ in terms of the $\epsilon_X$ (or more specifically, if you look at the $\epsilon-\delta$ argument at the link, relate both the $\epsilon$s and the $\delta$s) to demonstrate that there will also be convergence in probability of $\tilde{X}_n$ to $\exp(\mu_Y)$.
A similar argument could be made for the harmonic mean for positive variables.
[I realize you're after references, not arguments, but the arguments appear to be straightforward so you might not easily find a reference outside a textbook exercise]


What's a good methodology for a small 2-person project?

Question: Hello
What's a good methodology for a small 2-person project? Ranges from 20-40hr.
It's mostly small websites. I want to approach it as a developer, but Agile and other methodologies seems too large scale for what I'm after.
Thanks
Answer: There is no perfect methodology which fits every team per se - any good method worth its salt will acknowledge that it needs to be tailored to every team's and project's specific situation and needs.
So just

pick what seems useful to you from Agile (or whatever) methodologies,
start using it,
see how it works for you, and
improve it as you go.

For such small scale project, you may not need a lot of planning indeed. However, I reckon you still need to (among others)

manage requirements,
estimate tasks,
track progress, and
verify that requirements are fulfilled.

These are at least some of the things that IMHO even the simplest development process should be able to deal with on some level. Of course, if both of you are experienced in the domain(s), know very well what you are doing, and have no need to communicate closely with management, sponsors etc., you may be happy with a bare minimal process which lets you "just do it". Otherwise, the less of these conditions are true, the more process you probably need.
Comment: Additional suggestion: Identifying requirements as Use Cases can really help you separate and order your work tasks. Especially with only a couple of people, it can really help in creating a small iteration plan.
Answer: I agree with @Péter Török pick one and massage it.
However if I were to suggest one to massage I would pick something from the aglie world as it naturally has smaller chunks of work which might match better to a 20-40hr work week as opposed to a waterfall type methodology which requires longer periods of constant development to achieve formal progress.
TDD might also be a good implementation supplement, esp if your 20-40hr is actually just multiple sets of 2-4 hours a day with a push on the weekend. It can really help to foster progress ( and remind you what you were working on... the test that currently break )
Answer: I'm using the Lean methodology for my one woman final year project at uni; specifically the seven Lean principles as identified by Tom and Mary Poppendieck in Lean Software Development: An Agile Toolkit for Software Development Managers (2003)

Eliminate waste
Build quality in
Create knowledge
Defer commitment
Deliver fast
Respect people
Optimise the whole

From my reading around the subject, the Lean approach to project management and software engineering is sometimes confused with the Agile approach but where Agile methodology is aimed primarily at a workflow which adapts quickly to change, Lean takes this further by eliminating non-value added steps within the process and focuses on an even more streamlined iterative process (feel free to disagree with my understanding of Lean and Agile methodology here)
suggested helpful reading:
Hibbs, Curt, Steve Jewett, and Mike Sullivan. (2009). The art of lean software development; A practical and incremental approach. O'Reilly media
Answer: Here are a couple of options:

Pair programming seems to work really well in these situations. Having gone through multiple projects with a project partner, its hard to communicate what you have done after you just finished a overnighter but is important when the other person is planning to sync to your changes in the morning. You might want to try TDD along with Pair programming.
Delineate the project in multiple (relatively) independent modules and code away. Work together while doing integration to avoid one person throwing the half of the other's code away :)
Ofcourse, agile methods like scrum still work well in this setting.
Comment: I would nix Scrum. You don't have enough people to carry out all of the roles. The roles in Scrum just don't break down if you have fewer than 5 or 6 people.


How can I use emacs instead of Ubuntu SDK to write Ubuntu Touch Apps?

Question: I want to use emacs and console tools instead of Ubuntu SDK to edit and debug my projects.
Where can I learn about doing that?
Comment: I'd suggest installing the SDK, and looking carefully at what it does. Nothing precludes your using the one true editor on files that you then let the SDK build. Or, you could enter the wonderful wonderful world of emacs customization through writing Lisp programs, or hope some other Ubuntu Touch developer has.
Answer: You certainly can! The SDK is meant to make it a bit easier, but nothing prevents you from doing it yourself (and perhaps making it a step in your CI environment). Michael Zanetti wrote up a blog post about it here.


How to turn off autocomplete for filenames in Windows 7?

Question: When you save a file and you start entering in text in the save dialog box, a drop down list of files that begin with the letters you have typed appear. How do you stop the list from appearing?
Answer: The key for this rests in a registry setting.
To stop this behavior, just open your registry editor and goto:
HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > AutoComplete
Inside that key are two values that need to be changed: "Append Completion" and "AutoSuggest".
Set both of those to "No" and you should be all set.
Comment: I don't have either of those keys. Is it safe to create them? What type are they? I'm on Windows 7 Pro SP 1.


Cannot access a disposed object

Question: i'm facing a issue while testing the DAL Library which uses LINQ to SQL
Method that is being Tested as below (a simple one):
public List<tblAccount> GetAccountsByCustomer(tblCustomer customer)
{
    using (OnlineBankingDataClassesDataContext dbcntx = new OnlineBankingDataClassesDataContext())
    {
        var accounts = dbcntx.tblAccounts.Where(p => p.tblCustomer.ID.CompareTo(customer.ID)==0);
        return accounts.ToList<tblAccount>();
    }
}

Test code is as below:
static tblCustomer GetTopOneCustomer()
{
    OnlineBankingDataClassesDataContext dbcntx = new OnlineBankingDataClassesDataContext();
    var customers = dbcntx.tblCustomers.Take(1);
    return customers.Single<tblCustomer>();
}

public static void Should_List_All_Account_By_Customer()
{

    tblCustomer customer = GetTopOneCustomer();

    DataController dc = new DataController();
    List<tblAccount> accounts=dc.GetAccountsByCustomer(customer);
    foreach (tblAccount account in accounts)
    {
        string accountdetails=string.Format("Account ID:{0} \n Account Type:{1} \n Balance:{2} \n BranchName:{3} \n AccountNumber:{4}",
                        account.ID.ToString(), account.tblAccountType.Name,
                        account.Balance.ToString(),
                        account.tblBranch.Name, account.Number);

        Console.WriteLine(accountdetails);

    }
}

I'm getting an error "Cannot access a disposed object." when accessing associated object like in this case, I'm using account.tblAccountType.Name. I know it has something to do with DataContext. How shall I get this code working.
Answer: dbcntx is a disposable object. The Garbage Collector can come along at any time after GetTopOneCustomer() has been called and dispose of it. Which is what looks like is happening.
Try changing GetTopOneCustomer() to:
static tblCustomer GetTopOneCustomer(OnlineBankingDataClassesDataContext dataContext)
{
    //Stuff
}

Then inside Should_List_All_Account_By_Customer() change it like so:
using (OnlineBankingDataClassesDataContext dataContext = new OnlineBankingDataClassesDataContext())
{
    tblCustomer customer = GetTopOneCustomer(dataContext);
    //More Stuff
}

This way you control the lifetime of the dataContext.
Comment: I normally wrap them in a class, so as the class is active your database connection will be active.
Comment: @DaveShaw The problem is that related objects are being accessed in entities after the dbcntx DataContext has been disposed. The GetTopOneCustomer shouldn't cause any problems at all.
Answer: Since the the DataContext is in a using statement, using (OnlineBankingDataClassesDataContext dbcntx = new OnlineBankingDataClassesDataContext())
 Disposed will be called on it as soon as the context goes out of scope. This results in all entities beeing detached and all actions on the entity that requires a DataContext will fail.
This is what happens when account.Balance.ToString() is called.
One way to solve this is by creating a new context and use context.Attach(entity).
Comment: where is the using statement the `DataContext` is in?
Comment: Ah, did not scroll up enough.

Cannot access a disposed object


Model accuracy without over fitting data

Question: I was going through machine learning topics and came across term "Over-fitting of data", So question i want to ask, is it possible for any model to have 100% accuracy without over-fitting the data ?
Comment: Yes, it is possible.
Answer: Yes, it is not only possible but happens when 1) the number of parameters equals the sample size, and 2) a real solution is possible otherwise $n$-tuple complex solutions are the result (and assuming that we know how to find those complex solutions, which is not for the faint hearted). Other scenarios of exact solutions occur when the data is exact, i.e, noiseless, and we are regressing with the exact same model as our data obeys.


Does my furnace and water heater need a shut off switch

Question: I notice my furnace and electric water heater have switches. Why do they have a switch, is it for convenience or are they required by code. Each of these are on a dedicated breaker and the breaker panel is only 15 feet away. The switch just seems like another thing that can fail.
Comment: A switch has a vanishingly small probability of failure, especially one that is infrequently used. Almost certainly the switches are required by code and they are convenient.
Comment: I can't see it being all that useful for a water heater, but a switch on a furnace can be very handy when doing maintenance/repairs, even if the breaker isn't very far away.
Comment: Is the panel within sight from the furnace and water heater?
Comment: No they are not within sight, both in basement but in separate rooms.  The furnace was recently replaced and it has a switch. The water heater will be replaced soon and I'd like to get rid of that switch.
Comment: Call your local electrical inspection office and find out whether they require a switch for the hot water heater. If they don't require one, then you can take it out, but if they do require one and you have removed it, then you could be liable to replace it in the event of a sale of the property or  have legal liability in the event of a shock accident.
Answer: NEC Articles 110.25, 422.31, 422.33, 422.34 and 430.102(A) provide requirements for disconnects used to protect those who might need to service equipment. Basically it requires the following.

It must be with in line of site and less than 50' from the equipment.
The disconnect means must be able to be lockable for hardwired or plug and cord.
Many AHJ have also require the access to the disconnect to be in an unencumbered path from the equipment.

Also as mentioned by Jim Stewart, it is there for safety's sake and it is rare these devices go bad.
Hope this helps.
Comment: I found this in our my towns code so you are correct. "Each furnace, heat pump, water heater, air conditioning unit and similar equipment shall be
provided with dedicated branch circuits. A disconnecting means shall be provided on or immediately near the equipment."


Cartoon - boy traps monsters into balls on a magical bracelet

Question: As a kid, I used to watch this cartoon show about a boy who captured monsters like giant spiders and put them in these tiny balls, and then summoned them using some kind of magical bracelet. He'd battle with his friends using these monsters. It sounds like Pokemon but it isn't. I don't know what it's called and it would mean the world to me if anyone can find it.
Comment: Might it be "Yo-Kai Watch"? I don't know anime well, but it sort of fits the description.
Comment: A more precise time reference (in the 90s? 2000-something? three months ago?) could really help finding the right cartoon amid all the existing ones.
Comment: it was back in 2008-10 on this arabic channel mbc3
Comment: Have you seen [this question](https://scifi.stackexchange.com/q/162103/66252) ?
Answer: This could be the animated series Spider Riders, a Canadian-Japanese co-production which first aired in 2006. The protagonist of this series is a boy who finds his way into a hollow earth type secret world. A mysterious bracelet called a "Manacle" attaches itself to his wrist:

For those who are able to use them, these Manacles allow a person to summon and control a "Battle Spider":

According to Wikipedia, this series aired on MBC 3, as mentioned in your comment.
Comment: Yes this is it! Thank you so much!
Answer: This may be one of the Bakugan series, which aired from 2007 through 2012. I can't confirm whether it was aired on MBC 3, but there are clips of an Arabic dub available online.
In Bakugan, monsters are stored in small balls:

There are several Bakugan monsters which look like four-, six-, or eight-legged spider-creatures:

Throughout the series, there are a variety of bracelet-like devices used by the heroes and their opponents to monitor and control their Bakugan battles:
Answer: I am certain It's called Spider riders about a boy who get transported to another would and he help them battle evil on a battle spider
Comment: Welcome to SciFi.SE! I'm afraid I don't see how this adds anything to the accepted answer from 2 1/2 months ago.
Comment: @F1Krazy an answer doesn't _need_ to provide anything different to previous answers, although it'll usually be accused of copying etc. if it does.


bluetoothd 100% CPU + can't turn off Bluetooth:

Question: My bluetoothd process is hitting 100% CPU on my 2013 MacBook Pro.
I have no bluetooth devices. When I click turn bluetooth off nothing happens. All of the options in option-click and shift-option-click don't change anything.
I reset smc, pram, tried to turn off sniff mode in bt explorer but clicking link policy does nothing.
Answer: Do you have Android File Transfer installed by any chance? I had a very similar problem about a year ago with my Macbook Pro 2015 after upgrading to High Sierra. Even when it isn't visibly running there is still a background agent running that interferes with bluetooth, try removing it and killing any related processes in activity monitor to see if that solves the issue.
Hopefully removing Android File Transfer will fix the issue for you, but it only worked for me after I reinstalled the version of macOS my mac came with through internet recovery and then upgrading up to High Sierra again. Reinstalling High Sierra alone never fixed the problem. This is only speculation but my best explanation as to why this fixed the issue is that some firmware upgrade that was supposed to happen between OS upgrades failed, and in upgrading from the older macOS to newer macOS provided the option for that upgrade to happen properly.
Answer: after a couple of days and reboots, trying everything, it stopped


Convergence of Series of a.e. finite measurable functions

Question: Let $(f_n)_{n\geq1}$ be a sequence of measurable almost everywhere finite real-valued functions on $(X,M,\mu)$, where $µ$ is a $σ$-finite measure. Prove that there exist constants $c_n > 0$ such that the series $\sum c_nf_n(x)$ converges for $\mu$-a.e. $x\in X$
Comment: For the bounded case you can just take $c_n = 2^{-n}\|f_n\|_{\infty}$. For the finite case the only approach I have in mind involves the Borel Cantelli lemma.
Comment: when you say "a.e. finite", do you mean "a.e. bounded"?
Comment: @Giovanni: Probably not, the problem with "bounded" instead of "finite" is very easy, whereas this version is actually a nice challenging problem for an introductory measure theory class.
Comment: How is the "bounded" case easy? Hints please?
Comment: I was thinking along the lines of Borel Cantelli too. If I first assume $\mu$ to be finite I can show the existence of such $c_n$ but I am stuck where I have to go from $\mu$ finite to $\sigma$-finte
Comment: @Giovanni I was looking at this problem too. Could you give a small hint as to how to proceed using BC?
Answer: Hint: Because $\mu$ is $\sigma$-finite, there is a strictly positive measurable function $g$ such that $\int g\,d\mu\le 1$.  Now choose constants $c_n>0$ so small that $\int \left[1-\exp(-c_n|f_n|)\right]g\,d\mu\le 2^{-n}$ for $n=1,2,\ldots$. The series $\sum_n c_n f_n(x)$ converges absolutely for $\mu$-a.e $x$.
Fix $n$. To see that $c_n$ exists, notice that $\lim_{c\to 0+}\int \left[1-\exp(-c|f_n|)\right]g\,d\mu=0$ by Monotone Convergence (the integrand $[1-\exp(-c|f_n|)g$ decreases to $0$ as $c$ decreases to $0$, and $\int \left[1-\exp(-|f_n|)\right]g\,d\mu\le\int g\,d\mu<\infty$).
Because $\int \left[1-\exp(-c_n|f_n|)\right]g\,d\mu\le 2^{-n}$ for each $n$ we have
$$
\int\sum_n \left[1-\exp(-c_n|f_n|)\right]g\,d\mu=\sum_n\int \left[1-\exp(-c_n|f_n|)\right]g\,d\mu<\infty,
$$
which means that
$$
\sum_n \left[1-\exp(-c_n|f_n|)\right]<\infty
$$
$\mu$-a.e. (because $g>0$). Let $G$ be the subset of $X$ where this series converges. Notce that if $x\in G$ then  $\lim_nc_n|f_n(x)|=0$; therefore  there exists $N(x)$ with $\mu(\{x\in G: N(x)=\infty\})=0$ such that $c_n|f_n(x)|\le 1$ for all $n\ge N(x)$. For $x\in G\cap\{N<\infty\}$ we have
$$
\eqalign{
\infty&>\sum_n \left[1-\exp(-c_n|f_n(x)|)\right]\ge\sum_{n=N(x)}^\infty \left[1-\exp(-c_n|f_n(x)|)\right]\cr
&\ge \sum_{n=N(x)}^\infty (1-e^{-1})c_n|f_n(x)|,\cr
}
$$
because $1-e^{-x}\ge (1-e^{-1})x$ for $0\le x\le 1$. Thus $\sum_{n=N(x)}^\infty c_n|f_n(x)|<\infty$ for all $x\in G\cap\{N<\infty\}$, which guarantees that $\sum_nc_n|f_n|<\infty$, $\mu$-a.e.
Comment: I'd be happy to give a +1 if you could elaborate on how these constants give convergence, and why they exist
Comment: Details now added to my answer.
Comment: Much Appreciated


Why don't languages raise errors on integer overflow by default?

Question: In several modern programming languages (including C++, Java, and C#), the language allows integer overflow to occur at runtime without raising any kind of error condition.
For example, consider this (contrived) C# method, which does not account for the possibility of overflow/underflow.  (For brevity, the method also doesn't handle the case where the specified list is a null reference.)
//Returns the sum of the values in the specified list.
private static int sumList(List<int> list)
{
    int sum = 0;
    foreach (int listItem in list)
    {
        sum += listItem;
    }
    return sum;
}

If this method is called as follows:
List<int> list = new List<int>();
list.Add(2000000000);
list.Add(2000000000);
int sum = sumList(list);

An overflow will occur in the sumList() method (because the int type in C# is a 32-bit signed integer, and the sum of the values in the list exceeds the value of the maximum 32-bit signed integer). The sum variable will have a value of -294967296 (not a value of 4000000000); this most likely is not what the (hypothetical) developer of the sumList method intended.
Obviously, there are various techniques that can be used by developers to avoid the possibility of integer overflow, such as using a type like Java's BigInteger, or the checked keyword and /checked compiler switch in C#.
However, the question that I'm interested in is why these languages were designed to by default allow integer overflows to happen in the first place, instead of, for example, raising an exception when an operation is performed at runtime that would result in an overflow.  It seems like such behavior would help avoid bugs in cases where a developer neglects to account for the possibility of overflow when writing code that performs an arithmetic operation that could result in overflow.  (These languages could have included something like an "unchecked" keyword that could designate a block where integer overflow is permitted to occur without an exception being raised, in those cases where that behavior is explicitly intended by the developer; C# actually does have this.)
Does the answer simply boil down to performance -- the language designers didn't want their respective languages to default to having "slow" arithmetic integer operations where the runtime would need to do extra work to check whether an overflow occurred, on every applicable arithmetic operation -- and this performance consideration outweighed the value of avoiding "silent" failures in the case that an inadvertent overflow occurs?
Are there other reasons for this language design decision as well, other than performance considerations?
Comment: Example shouldn't include irrelevant things like function, list and loops. Just 2 integer constants added together can be enough.
Answer: In C#, it was a question of performance.  Specifically, out-of-box benchmarking.
When C# was new, Microsoft was hoping a lot of C++ developers would switch to it.  They knew that many C++ folks thought of C++ as being fast, especially faster than languages that "wasted" time on automatic memory management and the like.
Both potential adopters and magazine reviewers are likely to get a copy of the new C#, install it, build a trivial app that no one would ever write in the real world, run it in a tight loop, and measure how long it took.  Then they'd make a decision for their company or publish an article based on that result.
The fact that their test showed C# to be slower than natively compiled C++ is the kind of thing that would turn people off C# quickly.  The fact that your C# app is going to catch overflow/underflow automatically is the kind of thing that they might miss.  So, it's off by default.
I think it's obvious that 99% of the time we want /checked to be on.  It's an unfortunate compromise.
Comment: Remember that C# is 12 years old now. Back then, many programmers believed "C++ is fast, Java is slow, C# is like Java". Today, I think, most programmers see time-to-market and managing complexity as having a bigger impact on business success that tight-loop-optimization.
Comment: How much would integer overflow checking have affected any realistic benchmarks?  It seems to me there are many other things in C# which are much worse (e.g. given a field `readonly rect foo;`, a statement like `DoSomething(foo.X, foo.Y`);` requires making a copy of `foo`, calling its `X` accessor method, making another copy of `foo`, and calling its `Y` accessor method.  Pretty massive overhead--enough to make integer-overflow checking seem pretty trivial by comparison.
Comment: @supercat: In most real world code, turning on `/checked` by default would not be measurably slower, and would catch a certain class of important bugs.  However, as I said in my answer, one of the first things an early reviewer of C# might do is test the performance of integer arithmetic in a tight loop.
Comment: Was the reason perf though? I personally find myself often relying on the behaviour (i.e. unchecked by default), e.g. sequence counters I expect to loop or database does not have type for unsigned value but it is unsigned so casting just works...
Answer: I think performance is a pretty good reason.  If you consider every instruction in a typical program that increments an integer, and if instead of the simple op to add 1, it had to check every time if adding 1 would overflow the type, then the cost in extra cycles would be pretty severe.
Comment: Doesn't the CPU give you a flag back when the operation overflowed? (Of course, checking that flag also takes time).
Comment: @Thilo there are CPUs without any flags like MIPS. Even doing simple big int operations on them is a slight pain
Answer: You work under the assumption that integer overflow is always undesired behavior.
Sometimes integer overflow is desired behavior. One example I've seen is representation of an absolute heading value as a fixed point number. Given an unsigned int, 0 is 0 or 360 degrees and the max 32 bit unsigned integer (0xffffffff) is the biggest value just below 360 degrees.
int main()
{
    uint32_t shipsHeadingInDegrees= 0;

    // Rotate by a bunch of degrees
    shipsHeadingInDegrees += 0x80000000; // 180 degrees
    shipsHeadingInDegrees += 0x80000000; // another 180 degrees, overflows
    shipsHeadingInDegrees += 0x80000000; // another 180 degrees

    // Ships heading now will be 180 degrees
    cout << "Ships Heading Is" << (double(shipsHeadingInDegrees) / double(0xffffffff)) * 360.0 << std::endl;

}

There are probably other situations where overflow is acceptable, similar to this example.
Comment: There are probably many more instances where integer overflow yields wrong results then when it yeilds the correct result.  In fact, the only time it actually generates correct results are when it's the expected behaviour, and it is actually being used as a feature, such as in your example.
Comment: @Dan: Note that the code uses uint32_t. That is guaranteed to be 32bit (hence the name :-) ). So the author *did* think of that point.
Comment: @sleske: If you check the edits, you'll see that Doug's original post used "unsigned int"...hence my comment.
Perhaps my comment caused him to correct his code...
Comment: Not to mention the inherent hazard of relying on a platform-specific low-level detail like this. What happens if this is recompiled on a 64-bit platform? Eek.
Comment: @Kibbee I'd be willing to venture that in the case where integer overflow can lead to error, it's more an indicator that you haven't done proper range checking than a failure of the programming language.  In the cases where it's not expected, your code should check for it.
Comment: I find myself wanting wrapping more often then not, e.g. sequence counters I expect to loop (so can just increment them), database does not have unsigned type so casting just works, e.g. can store: (long)ulong.MaxValue and get it again with (ulong)row[I].
Comment: While there are places where it's useful for have a type which behaves as a discrete algebraic field with specific wrapping behavior, I would posit that it would be more useful to have a type `Int32` which is checked, and a type `WrappingInt32` which is not (likewise for other sizes).  Code could then easily obtain the proper in each circumstance.
Comment: Another example of the integer overflow as a desired behavior is subtraction, i.e. addition of a positive number with the negative number of the same absolute value (so that their sum is 0).
Comment: Many languages have basic modural arithmetic. 99.9% of people don't need it. 99.9% of people want to count things.
Comment: Modular arithmetic has it's own notation (not `%`) and shouldn't happen without users explicitly asking for it.
Answer: C/C++ never mandate trap behaviour. Even the obvious division by 0 is undefined behaviour in C++, not a specified kind of trap.
The C language doesn't have any concept of trapping, unless you count signals.
C++ has a design principle that it doesn't introduce overhead not present in C unless you ask for it. So Stroustrup would not have wanted to mandate that integers behave in a way which requires any explicit checking.
Some early compilers, and lightweight implementations for restricted hardware, don't support exceptions at all, and exceptions can often be disabled with compiler options. Mandating exceptions for language built-ins would be problematic.
Even if C++ had made integers checked, 99% of programmers in the early days would have turned if off for the performance boost...
Answer: Because checking for overflow takes time.  Each primitive mathematical operation, which normally translates into a single assembly instruction would have to include a check for overflow, resulting in multiple assembly instructions, potentially resulting in a program that is several times slower.
Answer: It is likely 99% performance.  On x86 would have to check the overflow flag on every operation which would be a huge performance hit.
The other 1% would cover those cases where people are doing fancy bit manipulations or being 'imprecise' in mixing signed and unsigned operations and want the overflow semantics.
Answer: Backwards compatibility is a big one.  With C, it was assumed that you were paying enough attention to the size of your datatypes that if an over/underflow occurred, that that was what you wanted.  Then with C++, C# and Java, very little changed with how the "built-in" data types worked.
Answer: If integer overflow is defined as immediately raising a signal, throwing an exception, or otherwise deflecting program execution, then any computations which might overflow will need to be performed in the specified sequence.  Even on platforms where integer overflow checking wouldn't cost anything directly, the requirement that integer overflow be trapped at exactly the right point in a program's execution sequence would severely impede many useful optimizations.
If a language were to specify that integer overflows would instead set a latching error flag, were to limit how actions on that flag within a function could affect its value within calling code, and were to provide that the flag need not be set in circumstances where an overflow could not result in erroneous output or behavior, then compilers could generate more efficient code than any kind of manual overflow-checking programmers could use.  As a simple example, if one had a function in C that would multiply two numbers and return a result, setting an error flag in case of overflow, a compiler would be required to perform the multiplication whether or not the caller would ever use the result.  In a language with looser rules like I described, however, a compiler that determined that nothing ever uses the result of the multiply could infer that overflow could not affect a program's output, and skip the multiply altogether.
From a practical standpoint, most programs don't care about precisely when overflows occur, so much as they need to guarantee that they don't produce erroneous results as a consequence of overflow.  Unfortunately, programming languages' integer-overflow-detection semantics have not caught up with what would be necessary to let compilers produce efficient code.
Answer: Job security for K&R, Stroustrup, authors of compilers and libraries and all users of C, C++, Java, JS. Industry of static analysis, books, very long courses, consulting. I can easily miss many others.
Maclisp had arbitrary precision arithmetic and rational numbers around 1970-1971... Why in LISP , there is no limitation for number?
Comment: How does this answer the initial question?
Answer: My understanding of why errors would not be raised by default at runtime boils down to the legacy of desiring to create programming languages with ACID-like behavior.  Specifically, the tenet that anything that you code it to do (or don't code), it will do (or not do).  If you didn't code some error handler, then the machine will "assume" by virtue of no error handler, that you really want to do the ridiculous, crash-prone thing you're telling it to do.
(ACID reference: http://en.wikipedia.org/wiki/ACID)
Comment: I don't see any connection between ACID properties and what you are describing.  Please explain the connection ...


Change Firefox 4 UI to Firefox 3 UI?

Question: Any quick way to change Firefox 4 UI to the old Firefox UI? I am on Windows, and I just can't live with the new Firefox GUI layout.
Answer: Right click Menu bar -> put a check against Menu bar
Before ->

After doing the change
Comment: Note that you can also put the tabs below the location bar again. Right-click the menu bar and uncheck *Tabs on top*. This (re-)enables features such as double-clicking the tab bar to open a new tab or F6 to get the focus into the location bar.
Comment: sweet @Sathya! nice and simple... +1
Comment: Couldn't be any easier :) Thank you so much!  Also just wanted to add that in Customize Toolbar window I switched to Icons and Text to make the Reload and Stop buttons bit larger if anyone needs that.
Answer: I'd recommend the Lifehacker article on this. Mine certainly easier to use after implementing some of their tips.

Change Firefox 4 UI to Firefox 3 UI?


A limit involving Riemann zeta function $\zeta(s)$

Question: I am reading Apostol's "Introduction to Analytic Number Theory". In Chapter 3, he defines Riemann Zeta Function, $\zeta(s)$, by the equation
\begin{equation}
\zeta(s) =
\sum_{n = 1}^{\infty} \frac{1}{n^s} \quad \text{if } s > 1,
\end{equation}
and by the equation
\begin{equation}
\zeta(s) = \lim_{x \to \infty} \left( \sum_{n \leq x} \frac{1}{n^s} - \frac{x^{1 - s}}{1 -s} \right) \quad \text{if } 0 < s < 1.
\end{equation}
Then he derives the following asymptotic formulas.
\begin{equation} \label{harmonic_partial_sums}
\sum_{n \leq x} \frac{1}{n} = \log x  + C + O\left(\frac{1}{x}\right),
\end{equation}
\begin{equation} \label{1/ns partial sums}
\sum_{n \leq x} \frac{1}{n^s} = \zeta(s) + \frac{x^{1 - s}}{1 - s} + O(x^{-s}),
\end{equation}
where $C$ is the Euler-Mascheroni constant. Looking at these formulas, one might suspect (naively) that
\begin{equation}
\lim_{s \to 1} \left( \zeta(s) + \frac{x^{1 - s}}{1 -s} \right) = \log x  + C.
\end{equation}
I tried to prove this by going back to the Abel summation formula but came across the integral
\begin{equation}
\int_{x}^{\infty} \frac{\{t\}}{t^{s+1}} \, dt
\end{equation}
whose limit does not exist as $s$ approaches $1$. I would highly appreciate if I could know whether the limit exists and if it exists what's its value.
Comment: The limit actually exists when $s\to1$ from the right.
Answer: The Riemann zeta function has a simple pole at $s=1$, with residue $1$. If you take $x\gt0$ a real number, as I think you are, then: $$\begin{align}\lim_{s\to1}(\zeta(s)+x^{1-s}(1-s)^{-1})&=\lim_{s\to1}\left[\frac{x^{1-s}-1}{1-s}+\underset{\longrightarrow\gamma}{\underbrace{(\zeta(s)-(s-1)^{-1})}}\right]\\&\overset{L.H}=\gamma+\lim_{s\to1}\frac{(-\ln x)x^{1-s}}{-1}\\&=\ln(x)+\gamma\end{align}$$
As you expected, where the constant $C$ is the $\gamma$ the Euler-Mascheroni constant, or the first Stieltjes constant.
To see where these constants are coming from, I will reference for you an answer someone gave me a few months ago, here. No complex analysis is involved, really - you should only understand that "analytic continuation is unique" to understand why Conrad's zeta is the same as your zeta.

$$\gamma=\lim_{n\to\infty}\left[-\ln n+\sum_{m=1}^n\frac{1}{m}\right]$$
Comment: Is there any elementary method to show the limit $\lim_{s \to 1} (\zeta(s) - (s-1)^{-1}) = \gamma$.
Comment: @MuhammadAtifZaheer Please see the answer I linked, it is as elementary as it could reasonably get. The thing is about the zeta function, there are a gazillion different representations, all equivalent on various different domains... sometimes other representations, like Conrad's, are more useful than Apostol's
Comment: @MuhammadAtifZaheer The main problem with *what*?
Comment: I think the main problem is with interchanging the following limits: $\lim_{s \to 1} \lim_{x \to \infty} \sum_{n \leq x} \frac{1}{n^s} + \frac{x^{1-s} - 1}{s - 1} = \lim_{x \to \infty} \lim_{s \to 1} \sum_{n \leq x} \frac{1}{n^s} + \frac{x^{1-s} - 1}{s - 1}$.
Comment: The left hand side is $\lim_{s \to 1} \left \{ \zeta(s) - \frac{1}{s - 1} \right \}$ and the right hand side is $\gamma$.
Comment: @MuhammadAtifZaheer Agreed.


Why won't Minecraft let me log in with my Mojang account?

Question: When I try to login with my Mojang account it says "Login Failed". Why does it do that?
Comment: Is Minecraft listed as one of your games under "My Games" when you login to your Mojang account at http://account.mojang.com?
Comment: @Danny I think because it's only this one person having problems, is the (inaccurate) reasoning. Really, this needs closing as NARQ because the user appears to have done a drive-by ask and hasn't provided enough info to make it a real, solvable problem.
Comment: It does that because, clearly, your login failed.
Comment: Not sure why this is being closed as "too localized," this is not localized at all...
Answer: Did you buy a legitimate copy or are you using a cracked version? This is a known issue with cracked copies of Minecraft.
If this is not your problem then there really aren't many other reasons.

The login servers could be down.
You're typing something wrong, recover your password just in case.

If these aren't the problem, then email Mojang.  Also, check this site for info on if the servers are up: http://xpaw.ru/mcstatus/.
Comment: "issue" for cracked copies.
Answer: This can happen quite often, and it ofter works for me to go to minecraft.net while logging in. This may only work with Tekkit, and check your internet connection works.
Answer: Remember when you use a Mojang account that you must use your e-mail and not the username you used to use for your account originally when logging in with the client.


Examples of when to use a cross join?

Question: In SQL can anyone give me some good examples of when you would use a cross join?
Duplicate Questions

What are the uses for Cross Join?
sql cross join - what use has anyone found for it?
Answer: Option 1: it can be used for easlity generation a big amount of data (for example for testing purposes).
Answer: I've used exactly one in my career in anger, as a technique for rapidly matching many-to-many relationships. The problem was being able to search out relationship between two classes of groups from either side.
There's any number of ways to solve that programatically but since we had billions of possibilities it turned out matching arrays of simple string keys with a cross join was orders of magnitude faster than anything else.
Answer: Actually, I'm trying to figure out the best way to use a CROSS JOIN in MS Access 2003 as we speak.
Basically, We have a database with Customers, Service Plans (yearly plans detailing the amounts of money allocated to each of several service allocations), Allocations (specific pots of money within a service plan), Service Codes (each allocation has a service code), Expense Records, Support Providers.
I'm trying to figure out how many monthly services each of our providers has been paid for in the last 6 mos, including those who've been paid NOTHING (0 expenses) in the last 6 mos. But regular join queries only give COUNTs of ACTUAL expenses, but don't give zeroes for service codes in which no expenses were logged. Thus I want to get the cross-product of all Support Providers with all Service Codes, such that each provider has one record for each service code possible in the database and thus each service will either have a Total or a 0 in it.
Hope that helps.
Still trying to figure out the best way to do that in Access, which seem to not have the best support for such things. Just not quite sure on the syntax when combining with other tables using regular joins...

Examples of when to use a cross join?


What is the history of the oh-so-common English phrase, "come on!"?

Question: I haven't any idea of whence the phrase come on could have originated. There seems to be little purely denotative sense that can be made of the phrase. What were the circumstances under which it was first coined, and what is the back-story to this interesting phrase  (which I'm sure has some involved history)?
Comment: I find the most interesting use of this phrase to be in relation to sport, motivation, or both. Whether used towards oneself or someone else, it seems as if the intention or feeling behind the term is twofold: both one of celebration and motivation. When a football team scores a goal or even concludes an effective passage of play; when a tennis player wins a particularly good or important point; at the start of a match or game or part of a game when the crowd wish to spur their team or player on to success. I think what is also so fascinating about the phrase is that it could possibly be the o
Comment: Ah! Such am I the girl that I thought the question was referring to 'come on' as the description for when a guy is intensely interested in a girl and attempts to 'come on' to her, or conversely when a girl gives a guy the 'come on' in the manner of flirting or indicating her willingness to continue with his approach.
Answer: This appears to be merely the latest in a long chain of expressions with both come and go. OED 1 finds, s.v. Come,

"33.b. As a call or appeal to a person to bethink himself, implying impatience, remonstrance, or, more usually, mild protest or deprecation on the speaker's part. Often emphasized by repetition, or by the addition of such words as now, then, but."

—to which we may in the 20th century add on. The earliest citation is dated 1340. Go, go up, go on have similar uses.
Comment: 'Wait on' (= wait, tarry) is used by Australian batsmen, while barmen were also once said to 'wait on' [no object].
Answer: Coverage of 'come on' in idiom dictionaries
Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013) has this entry for "come on":

come on 1. Move forward, progress, develop. For example, We stopped as soon as darkness came on. {Early 1600s} 2. Hurry up, as in Come on now, it's getting late. This imperative to urge someone forward has been used since about 1450. 3. Also, come upon. Meet or find unexpectedly, as in We came on him while walking down the street, or I came upon an old friend in the bookstore today. {Second half of the 1700s} 4. Make a stage entrance, as in After the next cue she comes on from the right. {Early 1800s} 5. Please oblige me, as in Come on, that's no excuse foe leaving, or Come on you'll really like this restaurant. {Colloquial; first half of 1900s} 6. Convey a specific personal image, as in He comes on like a go-getter, but he's really rather timid. 7. Also, come on strong. Behave or speak in an aggressive way, as in Take it easy; you're coming on awfully strong. {c. 1940} 8. Also, come on to. Make sexual advances, as in She reported her boss for coming on to her. This usage probably was derived from the earlier use of the noun come-on for a sexual advance. {Slang; 1950s}

Absent from this array of meanings is anything that explicitly conveys the sense of sharp objection—in effect, "stop what you are saying or doing!" The closest Ammer's options come to this is some combination of definition 2 ("Hurry up") and definition 5 "Please oblige me"). But I think the sense of "Come on!" as an imperative can be quite distinct from those two meanings.
Cambridge Dictionary of American Idioms (2003) offers yet another idiomatic meaning of the expression:

come on esp. spoken tell the truth | Oh, come on – you have no idea who stole your credit cards.

This is much closer to the meaning noted above that Ammer omits—but unfortunately, Cambridge doesn't provide an origin date for this sense of the expression. As a way of expressing impatience or dismissiveness, it is quite similar to the phrase "come off it," which Ammer does cover:

come off it Stop acting or speaking foolishly or pretentiously, as in Oh come off it! you're no smarter than they are. This term, often used as an imperative, dates from the late 1800s, when it was usually put simply as come off.

Evidently, come on in this sense is primarily a U.S. idiom. In any event, I don't find any mention of it in any dictionaries of British English idioms.

Early examples of 'come on' as an imperative
As for its origin, I suspect that "come on!" in the sense of "stop it!" arose from earlier use of "come on!" as a challenge to literally come forward to engage in a physical fight, which may itself be an offshoot of "come on" in the sense of "come along (with us)." Instances of "come on!" as an imperative way of urging someone to fight go back quite far in U.S. sources. For example, from "Attack on Rice's Fort," in the [Lawrenceburg] Indiana Palladium (April 8, 1825):

In the intervals of the firing, the Indians frequently called out to the people of the fort, "Give up, give up, too many Indian, Indian too big—no kill." They were answered with defiance "Come on, you cowards ; we are ready for you. Show us your yellow hides and we will make holes in them for you."

From "Gen Picton," in the [Alexandria, Virginia] Phenix Gazette (June 6, 1827):

Picton, drawing himself up and putting his arms a-kimbo, then said, 'You may tell Lord Wellington from me, Sir, that the third division under my command, shall in less than ten minutes attack the bridge and carry it, and the fourth and sixth divisions may support, if they choose!' Upon this the gallant general mounted his horse, and putting himself at the head of his troops, waved his hat and led them on to the charge, with the bland compellations of 'Come on, you rascals! come on ye fighting villains!' The bridge carried in a few minutes.

And from "Coxes' Adventures on the Columbia River," in the [Springfield, Illinois] Sangamo Journal (June 7, 1832):

One day as we were sitting down to dinner, one of our men, followed by a native, rushed into the dining-room, and requested we would instantly repair to the village to prevent bloodshed, as Mr. M'Donald was about to fight a duel with one of the chiefs. We ran to the scene of action, and I found our friend surrounded by a number of Indians all of whom kept at a respectful distance. He had his fowling-piece, which he changed from one hand to the other, and appeared violently chafed. The chief stood about twenty yards from him, and the following colloquy took place between them, which for the information of my unlearned readers I shall translate.
M'D.—"Come on, now, you rascal! you toad! you dog! Will you fight?
Indian.—I will:—but you're are a foolish man. A chief should not be passionate. I always thought the white chiefs were wise men.

An example of "come on" used figuratively in the sense of "stop it" appears in "A Chicago Romance," in the Wheeling [West Virginia] Daily Intelligencer (September 27, 1897):

"Th blow nearly killed father," went on the the girl in the yellow cheese-cloth [Marie]. "I mean the blow of the [traveling performance] company's busting. There we was, sixty miles form a glass of beer, in central Iowa, and strapped till we didn't know the look of money. Even the change of the seasons would have been welcome. But the worst with my friend here"—and she pointed once more to the genial neck-stretcher [Annabel Lee, a contortionist]—"was her infatuation for the living skeleton."
"Oh, come on, now, Marie, and shut your face," cried Annabel Lee, in her most sprightly fashion.

And similarly, from "Professor Caruthers' Thanksgiving Turkey," in the [Bloomington, Illinois] Weekly Pantagraph (November 29, 1901):

"Le's see," began Jeff, reflectively, staring up at the leaves while he counted on his fingers. "Accordin' to the old man we are thankful for manifold mercies and blessings; for being preserved through the trials and vicissitudes of another year; for health an' clothes an' food—he calls food—an'—
"Oh, come on now," Interrupted Oran. "This is no prayer meetin'. Say, what have we got to be thankful for? Nothin'—not a doggone thing, you know we haven't. Just what Sally an' me 've been workin' on. We believe 'at when Thanksgiving comes a man ought to be thankful, an' if he hasn't got anything to be thankful for, he ought to get out right quick and do somp'n to make him so. See here, then, here's the scheme."
Answer: My reading is that when you say "come on" you are urging someone or something to finish acting absurdly and start being sensible. So "come on!" in the sense of an exclamation is from the literal sense of "come on" as "move forward!".
Comment: Please add facts, references, or specific expertise which verify your answer.
Answer: It's another way to say "Turn on," but in a more personal and direct sense, implying one requires mental state adjustment.
Comment: I don't believe this is the case at all. "Turn on" does not mean the same as "come on!".


Orientability of Stiefel manifold $V_2(\mathbb R^4)$

Question: What is an easy proof of orientability of Stiefel manifold $V_2(\mathbb{R}^4)$ (pairs of orthonormal vectors from $\mathbb{R}^4$ - subset of $\mathbb{R}^8$)? All  proofs I found deal with Lie groups and other complicated for me stuff. I suppose that there is an easy proof because task was given to me by my teacher in university, and our differential geometry course doesn't include Lie groups.
Answer: Finally, I solved this problem.

Lemma Let $f_1(x_1, \dots, x_n), \dots, f_k(x_1, \dots, x_n)$ be real functions; smooth manifold $M$ is solution set of system {$f_1(x_1, \dots, x_n) = c_1, \dots, f_k(x_1, \dots, x_n) = c_k$}  and $\mathrm{grad} f_1, \dots, \mathrm{grad} f_k$ are linearly independent in every point of $M$. Then $M$ is orientable.
Firstly, let's give alternative definition of orientability:
Smooth manifold M is orientable if and only if  $\;\forall$ loop $L(t)$ (continuous $L: [0; 1] \to M$ such that L(0) = L(1)) every continuous frame $F(t)$ of tangent space of $L(t)$ orientation of $F(0)$ is equal to orientation of $F(1)$ in tangent space of $L(0) = L(1)$.
Proof by contradiction. Exist $L$, $F$ such that $F(0)$ and $F(1)$ are not equally oriented. Let us consider matrix $Z(t)$ with rows: gradients $\mathrm{grad} f_1, \dots, \mathrm{grad} f_k$ in $L(t)$ and vectors of $F(t)$. Scalar product of $\mathrm{grad} f_i$ and $v_j$ from $F(t)$ is equal to $(f_i(w_j(0)))'$, where $w_j$ is coordinate line corresponding to $v_j$. $w_j(q) \in M \Rightarrow (f_i(w_j(0)))' = (c_i)' = 0 \Rightarrow $ scalar product is equal to 0. Therefore, for all $t$ all rows in $Z(t)$ are linearly independent, and $|Z(t)| \neq 0$.
Let's look on $Z(t)$ from the other side. It's gradient part is the same when $t = 0$ and $t = 1$, because gradient part depends only on point on manifold, and we have $L(0) = L(1)$. $F(0)$ and $F(1)$ have different orientations. Hence rows of $Z(0)$ and rows of $Z(1)$ are not equally oriented in $\mathbb{R}^n$. This means that, without loss of generality, that $|Z(0)| > 0$ and $|Z(1)| < 0$. $|Z|$ is continuous because of gradients and $F$ are continuous. Using these facts , we deduce existence of $\theta \in [0; 1] : |Z(\theta)| = 0$.
Contradiction.

Orientability of Stiefel's manifolds can be easily deduced from lemma, because Stiefel manifold can be represented as solution set of
$x_1^2 + x_2^2 + x_3^2 + x_4^2 = 1;$
$x_5^2 + x_6^2 + x_7^2 + x_8^2 = 1;$
$x_1 x_5 + x_2 x_6 + x_3 x_7 + x_4 x_8 = 0;$
One can compute gradients and see that lemma conditions take place.
More generally, this lemma can be applied to any Stiefel manifold.


How is the planform geometry of a helicoptor rotor designed?

Question: Rotor planform specially the tip is designed differently for different helicopter rotor. How the shapes are determined? For example I added 2 photos. How the dimensions of the tip or root of these rotors were determined?
Answer: First of all, a basic description of the aerodynamic environment encountered by the blades.
The airflow velocity $V$ seen by a rotating wing is the sum of:

the speed due to the rotation around the hub $=\omega R$;
the speed due to the forward velocity of the helicopter $=V_f$.

Those two speeds:

sum up when the blade in its rotation around the hub is rotating forward i.e. from the tailboom toward the nose and it's $V=\omega R + V_f$; at high forward speed, this sum can reach transonic value;
subtract  when the blade in its rotation around the hub is rotating backward i.e. from the nose toward the tailboom and it's $V=\omega R - V_f$; at high forward speed, this difference can reach very low subsonic speeds (it actually becomes negative on some 40% of the blade span toward the hub).

The following picture from this paper shows this effect (higher speeds on the right/advancing blade and lower speeds on the left/retracting blade):

That means that the velocity seen by blade continuosly changes from a maximum (the sum at point 1.) to a minimum (the difference at point 2.) during each revolution. In particular, the tip is the part of the blade experiencing the highest changes in speed and therefore the highest aerodynamic load.
There's a third aerodynamic aspect that is also important for  the design of the blade tip:

each blade leaves a wake behind it; this wake is stronger where the bladewise change of lift is stronger and this happens towards the tip; as seen (previous point 1.) toward the tips lift can be very high but then it suddenly goes to zero where the blade ends; this sudden change in lift leaves a very strong vortex behind, which is called tip vortex; now, when a blade bumps (literally) into the tip vortex released by the previous blade, the airflow is locally strongly perturbed (this is the source of the typical "flap-flap-flap" noise of slowly descending helicopters). The following picture from this paper shows two tip-vortices (number 3) shed by two blades:

So, now that we know the three main aerodynamic conditions the blade (and especially its tip) must undergo in its flight, we can try to figure it out how it should look like. Due to the previous point:

$\rightarrow$ the blade tip should be thin, with a short chord, with a leading edge swept back and a tapered planform, basically just like the wing of a jetliner; all this in order to diminish and/or retard the rise of drag due to transonic effects (wave drag);
$\rightarrow$ the blade tip should be thick, with a long chord and no particular need of being swept or tapered; actually if we want to be fancy to comply with this point we could use a delta planform for the tip: delta wing are known to generate quite a lot of lift at high AoA and low speeds, exactly the aerodynamic environment of 2.;
$\rightarrow$ the blade tip should be curved down (anhedral) so that the tip vortex is shed into the wake in a lower position than the following blade and therefore doesn't hit it directly.

Well, blade's design is driven by some quite conflicting requirements.
To all of this we must obviously add the centrifugal force stretching the blade: a blade of a typical EMS helicopter resists a centrifugal force of some 40kN (4000kg, 9000 pounds). To resist that force you need a structure which is as much as possible aligned to this centrifugal force i.e. you just want a perfectly straight and rectangular blade. Yet another conflicting requirement.
I let you figure out which requirement took over in the design of the blades in your picture.


What type of permissions do you need to assign to a AD user to be local administrator on Windows 7

Question: What type of permissions and/or roles do you need to assign to a Active Directory (Windows Server 2008 R2) user to be local administrator on Windows 7?
Comment: Are you trying to grant local admin rights for a specific user to all computers in the domain or just a single computer?
Comment: Yes... grant local admin rights for a specific users to all computers in domain and/or enterprise.
Comment: OK, in that case my answer is not valid.  You might want to edit your question to clarify this for any future visitors so they don't have to troll through comments.
Answer: You can do this across a domain in three different ways.

Group Policy Preferences can be used to add domain users to local groups.
Group Policy Restricted Groups.
A startup script that runs net localgroup administrators /add userNameGoesHere

None of these options require adding the user in question to a built-in Active Directory group.
Comment: @RonRatzlaff Pretty sure you can get those GPPs on 2003 too now btw.  Just requires a [client and domain software update](http://www.microsoft.com/en-us/download/details.aspx?id=6955).
Comment: You basically do what MDMarra stated. I'm assuming your running Microsoft Server 2008 on your domain controller and not Server 2003. If you're running 2008, then go with Group Policy Preferences (GPP) which was the first option MDMarra pointed out, if 2003, then go with options 2 or 3, but I prefer option 2 if it is a 2003 server. The best method of course is GPP as was pointed out in option 1 using Item Level Targeting to identify the specific group you want.
Answer: This is a pretty common action for a computer by computer basis.  There are tons of tutorials online about how to do this.
In general you do the following:

Edit the local groups (like the tutorial I linked to above describes)
Open the control panel in Windows and open the Users tool to add a user to the administrators group (screenshot below)
Comment: That's adding it on an individual level.   I want to be doing this through AD and not have to modify 100+ desktop individually.
Comment: Yes, update your question to be more specific next time.


Acces to campaigns in Standard Platform User Profile

Question: We have a user with "Salesforce Platform" license. How can we give campaigns access to "Standard Platform User" Profile user.
Answer: Salesforce platform license does not allow to have access of Campaign object.

Designed for users who need access to custom apps but not to standard
  CRM functionality. Users with this user license are entitled to use
  custom apps developed in your organization or installed from
  Salesforce AppExchange. In addition, they are entitled to use core
  platform functionality such as accounts, contacts, reports,
  dashboards, documents, and custom tabs. These users are not entitled
  to some user permissions and standard apps, including report
  subscriptions and standard tabs and objects such as forecasts, leads,
  campaigns, and opportunities.

Resource
Answer: Access to Campaigns is granted per user, not by profiles, via the Marketing User licence. This license is a kind of Feature Licenses which you can see in the Company Information section for your org. To add a user to this licenese in Salesforce (Classic) go to Setup > Manage Users > Users, then click on the user you want to grant a Marketing User license to.
Unfortunately, Salesforce does not provide access to Marketing License for users with user license "Salesforce Platform".


What is the experience cost of learning a ritual?

Question: As in the title. The game in question is Vampire: the Masquerade 20th Anniversary edition. For some reason I cannot find it anywhere in the book.
Answer: Rituals cost no XP to learn.
Ref page 212, middle of the right column, VTM 20AE corebook:

Additional rituals are learned separately, as part of a story; players need not pay experience points for their characters to learn rituals up to the level equal to their overall rating in Thaumaturgy, though they must find someone to teach the rituals in question.
Comment: There are optional rules for buying rituals with XP. At least in Revised Edition, and I think in V20. I just don't remember in what books.
Comment: Could not find the book but I think it was 1 xp per ritual level. You should give for free the rituals the characters achieve in the story, but using xp could be a good system to acquire  rituals during the interludes.
Comment: My players get to pick one ritual when they buy a new dot in the discipline, not in paths. Others through role playing or at 2xp per dot. This works well for us.
Answer: There is no experience cost.
"You learn the ritual from someone who already knows it or a book/scroll. This can take anywhere from a few nights to months or even years."
Source: VTM 20 ed book. Pg. 230 Top left hand corner start.
Since no xp cost is mentioned, it is able to be assumed that the cost is inherent in the cost of your Thaumaturgy or Necromancy.


Permissioned Contract Interactions

Question: I want users to mint NFTs on my ERC1155 contract
but I don't want to pay the gas fees
but I only want them to mint if I allow them
so I was thinking maybe I would sign a transactinon on the backend, and let the frontend user execute this transaction? I'd probably need a nonce to stop replay?
idk if this makes sense?
Answer: If you are OK with a pre-defined set of whitelisted addresses and how many times each should be able to mint, you can do this in constant amount of additional gas.
There's a ton of ways you can achieve an off-chain whitelist.
The typical way I've seen involves generating a Merkle tree of all whitelisted addresses off-chain and committing its root to the chain (usually embedded directly in the contract's code). Then you could publish the Merkle tree and have the users supply a Merkle proof (that their address is included in the Merkle tree described by the Merkle root committed to the chain) when they try to mint. Your contract would validate that the Merkle proof is valid, OpenZeppelin has an implementation of Merkle proof validation you could use.
This way, you only need to commit a small amount of data to the chain (the Merkle root) but you can whitelist as many addresses as your heart desires in your Merkle tree!
Generating the Merkle proof probably isn't a simple task for the layman, so projects would typically integrate the proof generation into the minting interface.
End-to-end your process might look something like this:

Generate a Merkle tree merkle_tree from a set of whitelisted addresses whitelisted_addresses = {address_1, address_2, ...}.
Compute the Merkle root of merkle_tree, call it merkle_root.
Commit merkle_root to Ethereum, probably by hard-coding it in your contract so you can reference it easily.
Introduce a new (or modify your existing) mint function to also take in a merkle_proof.
In your mint function verify that merkle_proof is a valid proof of inclusion of the message sender's address in merkle_tree, hence verifying that this address is a whitelisted address. merkle_root is already in your contract, so you can do this verification. Reject if it isn't valid.
In your minting front-end, pull the user's address and check if it is a whitelisted address (this can be done in whatever way you want). If it is, then compute a Merkle proof of inclusion of this user's address in merkle_tree, say merkle_proof. When a user mints, send merkle_proof to your contract with the mint.

Edit: if you don't have a pre-defined set of whitelisted addresses  or you don't know how many times each should be able to mint.
This would cost additional gas per mint, but you don't need to pay that cost up-front.
One idea would be to have your contract expect a signed message containing a nonce (and whatever information you want) with the mint. Your contract would verify the signature and check that the nonce has not been used before. If everything checks out, then you mark the nonce as used (and modify whatever other state you need to modify) and mint the token.
You can optimize the gas usage for the caller in a number of ways here, depending on your usage. In some cases (e.g. if you don't care about the signatures being independent of the message caller) you can drop the nonce and instead just track that addresses aren't minting more than some set number that you signed (i.e. sign (address, maxToMint) instead of (nonce, )).
An implementation of the nonce-based approach would look something like the following:

Store the public key (or address) of the signer on the contract, call it signer_address.
Modify your mint function to take in a nonce and a signature.
Have your mint function verify that signature is a valid signature of nonce by signer_address (OpenZeppelin has implementations that help you do this).
If it is valid, check that nonce has not been used before (i.e. by querying a mapping or otherwise).
If the nonce has not been used before, you know that this is a nonce that has been generated by you and it hasn't been used so you can mint.
To allow a user to mint, you'd give them the nonce and the signed message. They would forward that to the contract (you can embed this into the UI).

Here's a blog post that talks about this a bit more: https://medium.com/@PhABC/off-chain-whitelist-with-on-chain-verification-for-ethereum-smart-contracts-1563ca4b8f11
Comment: Hi Ziyad, thanks for the answer. I'm not sure this is quite what I was looking to do; it seems this involves whitelisting a set of addresses in advanced, to mint in the futuer. I'm wanting to whitelist individual (one-off) mints, for a particular address - they then won't be able to do any more, unless they get another signature from me.
Comment: In essence, I'd like to hand over a signed transaction from my backend to the public allowing them to be played by the frontend - but not _replayed_. The goal being to delegate the gas fees to the frontend - rather than paying them myself, for everyone, on the backend
Comment: Ah I see! I edited my answer. I thought you were trying to not incur this gas fee totally, not just to offload it.
Comment: `One idea would be to have your contract expect a signed message containing a nonce (and whatever information you want) with the mint. Your contract would verify the signature and check that the nonce has not been used before. If everything checks out, then you mark the nonce as used (and modify whatever other state you need to modify) and mint the token.` this is just what I was thinking - I just wanted to check whether the idea was dumb / whether there were better ways to do it - for example I realised that I'd have to store the nonce within the contract, to verify its not been used later
Comment: I was thinking I could make the signature independent of the caller (address) as I don't really care who actually makes the request, just that the request is made by someone else who is willing to pay the gas fee - I.e. someone who wants to mint their work, and is willing to pay a gas fee to do so

Permissioned Contract Interactions


Maintaining custom patches on third party code

Question: I'm building a web application that uses a third party JavaScript library (TinyMCE).
My application has some specific needs which require me to patch the library in a few places. The patches are easy (less than a dozen lines), but since they are specific to our use case and not bugs.
I'd like to be able to update when new versions of the library itself are released, which would overwrite our changes in our Git repository.
I need a way to ensure our patches are always applied before pushing the updated library to a production server. Since the changes are very small, it wouldn't be an issue to apply them manually.
How can I ensure my patches to third party code are applied in our repository when updating the third party code?
Answer: Create a repository for tracking the third-party code, and put your patches in a separate branch. When you need the latest release fetch the changes and rebase your branch.
For example:
$ git clone --origin github https://github.com/tinymce/tinymce.git
$ cd tinymce/
$ git remote add origin email@example.com:tinymce

Then make your patches and push to your repository:
$ git commit -m "my patches to tinymce"
$ git push --set-upstream origin master

At this point your repository looks like this:
(0) --- (1) --- ... (n) --- (X)
                             |
                           master

Where X is your patch.
Now set a branch to fetch new revisions from the github remote:
$ git branch tinymce_import github/master
$ git checkout tinymce_import
$ git pull --ff-only

So your repository becomes like this (git branch is smart enough to use as the origin the last revision in the github remote):
                           master
                             |
                     +----- (X)
                     |
(0) --- (1) --- ... (n) --- (n+1) --- ... (n+m)
                                            |
                                      tinymce_import

At last rebase your master branch on tinymce_import:
$ git checkout master
$ git rebase tinymce_import

                                                  master
                                                    |
                                            +----- (X)
                                            |
(0) --- (1) --- ... (n) --- (n+1) --- ... (n+m)
                                            |
                                      tinymce_import

Answer: If you storing TinyMCE in a Git repo, then you could use a Git post-commit-hook to perform the patches after you get a new version of TinyMCE (then commit those patches).
The workflow would be something like:
[get new version of TinyMCE]
["git commit -a" to update all tracked files]
[post-commit-hook patches TinyMCE]
["git commit -a" to pick up all of the changes from the patches]


How to get 5 from the numbers {6, 7, 8, 9} using only addition, subtraction, division, and multiplication.

Question: Is there a way you can get the number 5 from the numbers 6, 7, 8, and 9 using only addition, subtraction, multiplacation, and division, without combining two numbers e.g. using the 6 and 7 to create 67. Exponents, factorials, and trig functions are not allowed. If there is no way to do this, is there a way to prove that it is impossible? Thanks if you answer.
Comment: Clearly nonunique.
Answer: $$\frac{8\times9}{6}-7$$
That seems about right!
Answer: $===================(7+8)/(9-6)$.
Answer: The code in my answer to your other question gives one more solution (after curating the output by hand)
<code>7*(8-6)-9=5 (Bruno's solution)
(7+8)/(9-6)=5.0 (Oscar's solution)
8-6/(9-7)=5.0
8/6*9-7=5.0 (Zach's solution)
</code>
Comment: @Sudix You may indeed see the code, its in the linked answer (you just need to change the 6 to a 5 (also I think you don't lose any solutions to floating point errors))
Comment: (PS because the code performs an exhaustive search, this is all the solutions)
Comment: Did you write the cases manually, or did you iterate over a list of functions? In second case, could I see the code?
Comment: @Sudix (and remove the break points)
Answer: here is one other way to do it:
$$
(8-6)\cdot 7 - 9 = 5
$$
Comment: @TheCount $(8-6)\cdot 7 - 9 = 2\cdot 7 - 9 = 14 - 9 = 5$. How this does not provide an answer? It's a direct answer since it's an elementary math problem. Do I need to explain more than the expression I wrote?
Comment: FYI, that comment is a formatted thing that happens automatically by clicking. I probably did it by mistake, since this is definitely an answer to the question. Will delete.
Comment: @TheCount Oh, no problem mate. Thanks!


Can PostgresSQL cluster have synchronus and asyncronus standbys at the same time for the same dbs?

Question: In this question, Write concern in PostgreSQL Laurenz Albe explained how to control the set of standby servers when data is committed to PostgresSQL, and that gave birth to another question. What if I want to have N standbys, and want to have synchronous replication enabled for some M subset of N, is that possible? A use case could be a cold backup. I don't care of data inconsistency for N-M subset, I just need to have that on M subset of N standbys.
Answer: Yes,
There is a setting for this which is called synchronous_standby_names.
You can give expression like ANY 3 (r1, r2, r3, r4) which says "proceed commit as soon as at least any three standbys reply"
If you want to specify exact replication name just name them like r1,r4.
Here is sample usage;
ALTER SYSTEM SET synchronous_standby_names TO 'ANY 3 (r1, r2, r3, r4)';
SELECT pg_reload_conf();

Note: The standby names (which are r1,r2..) are defined by application_name option of standby's primary_conninfo setting value.


Can't compile React component from builder format via Mitosis

Question: I've installed Mitosis on my Node.js project, create the directory build for output files and create the input file component.jsx with the code from the link https://github.com/builderio/mitosis#at-a-glance
If I run the command
mitosis compile -t react --out=build/myCustomName.js component.jsx

everything works fine.
But when I paste the JSX code into the left column of their live compiler by the link https://mitosis.builder.io, compile it to JSON, then copy-paste the output JSON code into the file component.json and run the command
mitosis compile -t react -f builder --out=build/myCustomName.js component.json

I receive the file myCustomName.js with the following code only
import { useContext } from "react";

export default function MyComponent(props) {
  return <></>;
}

Why? And how to resolve the issue?
ps. as I understand input format builder means their JSON, right?
Answer: Ok, now I see that the input format builder is also JSON, but it's not the same than JSON output format at the mitosis.builder.io. The issue is resolved.


How to determine sign of voltage with a current source in series

Question:
Current flows in the same direction (or CCW) for both circuit A and B. In respect to ground, circuit B is just a rotation of circuit A along the same path - these two circuits (A and B) should be entirely identical, regardless of the rotation positions of these elements. Why is there a change of sign in voltage (i.e. +12V for B and -12V for A)?

Circuit C is a flip of circuit A. Current in A and C flows in the opposite direction - CCW for A, and CW for C. Their signs of voltage should flip as well. Why is that is the simulation I get the same voltage sign (-12V) for both nodes (A and C)?
Comment: A and C are identical circuits .. A and B are not
Comment: Does the arrow point at the top of the resistor or the bottom, in each cct?
Answer:
Why is there a change of sign in voltage (i.e. +12V for B and -12V for
A)?

Not quite. What you should get when you rotated the circuit was this: -

And now, both nodes will have the same polarity voltage.
So, if you actually did reposition the GND node to where you show it in your original picture, the voltage polarity would reverse. But that ain't a simple rotation!
Comment: Think about the resistor and what voltage it has to have on its upper terminal in your left diagram when 12 amps is being pulled from it. The resistor has to drop 12 volts (of course) and, because the resistor is grounded on the other terminal, the upper terminal has to be at -12 volts to satisfy the implied current direction.
Comment: So whenever the current source arrow points to ground, voltage or current is negative. Is that the proper way to see it?
Comment: *So whenever the current source arrow points to ground, voltage or current is negative.* - not as a rule but, in your circuit yes. I mean; if the resistor's top terminal were fed from a 19 volt DC supply (for example) and the current source dragged 12 amps to ground from the bottom terminal of the resistor, that bottom terminal has to be at +7 volts relative to ground. That's ohm's law. It prevails.


Sharepoint 2016 and Dynamics CRM 2016 - Creating sites rather than folder in doc library

Question: I'm hoping someone can help me out. We're using Dynamics CRM 2016 and Sharepoint 2016. Both the latest versions. We've done an integration between the two and realised that the integration doesn't work as we'd hoped. In CRM, we have a custom entity called 'Projects'. We would like each Project to have its' own Site in Sharepoint with its own document library to store relevant project documents. However the integration only seems to create a folder within an existing site and document library. Does anyone know a way to achieve this? Is there anything out there already?
Thanks in advance
Comment: We had the same issue... but my CRM/SP knowledge is rusted (and not 2016) I recall we created the Sites by hand and set the Link in CRM
Answer: My suggestion to this would be some custom coding or powershell.. so everytime you have a new Project entity created in CRM, you will run the script it will go & create a sharepoint site for the specified custom template you have.
Just to clarify.. powershell can call web services so you will call the CRM & Sharepoint API to perform your site creation...
Just a suggestion hope it helps.. Could you also share the integration tool u are using..


Why are index funds not always the optimal strategy for investing?

Question: I heard a claim that it is always the best strategy to invest money to the index fund. Why is the mistake in that sentence? Because I don't understand why there are investment advisers if we already know the best strategy. Are there scientific publications to show that the claim does not hold in every case for someone who claims that?
Comment: Does this answer your question? [Are Index Funds really as good as "experts" claim?](https://money.stackexchange.com/questions/85597/are-index-funds-really-as-good-as-experts-claim)
Comment: Yes. I was just wondering if there are academic papers to show why index funds are the best. I mean, there can be so many different strategies to invest so I'm just interested to see the reasoning or mathematical models behind the claim.
Answer: The data here is quite clear:
For example: https://www.nerdwallet.com/article/investing/index-funds-vs-mutual-funds

History has shown that it's extremely difficult to beat passive market returns (a.k.a. indexes) year in and year out. In fact, for the 15 years ending in December 2016, more than 90% of U.S. large-cap, mid-cap and small-cap funds helmed by managers did worse than the S&P 500, according to S&P Dow Indices data.

For most investors a few well diversified index funds are the best choice.

Because I don't understand why there are investment advisers if we already know the best strategy.

Because there is a lot of money to made. This is a multi billion dollar industry with gobs of money to spend on marketing and lobbying. For example, many 401k plans don't offer index funds. There is no reason for this other than the benefits consultants and plan managers are lobbied heavily to push managed funds.
The following approach is sufficient for most investors

Invest in broadly diversified index funds
Adjust your bond/stock ratio depending on goals (usually retirement age).
Once a year re-balance. i.e. make sure you don't have to much money in a single investment. In many case this is just a check with no actions needed.

Some people may have difficulties doing this themselves, so a financial advisor or a "target fund" can be helpful. You just have to be aware that you pay a hefty premium for this assistance.


External interrupt on atmega328p

Question: I want to connect 4 push buttons using interrupts on all of them, with my atmega328p, but when I read the datasheet, I found that the atmega328p has only 2 external interrupts (INT0 and INT1). Are there any solutions?
Answer: All pins can trigger interrupts when change state (high to low or low to high). Only INT0 and INT1 can be configured to trigger interrupts when there is a low level on the pins (this is not the same as changing state), and will trigger continuously until the input is no longer low. INT0 and INT1 can also be configured to to trigger on any change, or only rising or only falling edges.
The pins are grouped into three pin change interrupt vectors, so one of those interrupts will trigger if any pin on that vector changes state, and has interrupts enabled.
Comment: Thank you sir, but I found in some forums that it is not advisable to use a push button on the Pin Change Interrupt of the microcontroller.
Comment: @YassineKardid -- mostly for debouncing reasons...
Comment: @YassineKardid If power consumption is a concern, you should absolutely use interrupts, and debounce after it triggers. Alternatively, use a 32.768kHz crystal to wake it up from power-save mode, or use the WDT to wake it from power-down mode (the WDT has shit tolerance, so don't use it for accurate measurements).
Comment: Huh, there's also a standby mode. I've never really looked at that one. You won't get the most savings possible, but you don't need external parts either, and it doesn't look like you'll need interrupts.
Comment: I'll do some research on that.
Answer: The obvious: Connect two buttons to one interrupt and use a different pin and code to figure out which one was actually pressed in the Interrupt Handler.
That's pretty standard procedure in hardware design.
Also, note that humans are incredibly slow compared to microcontrollers. It's usually totally unnecessary to use an interrupt line for something like a button unless it's for waking up from extreme deep sleep modes (which the ATMega 328 doesn't have, as far as I know).
So, unless you really need to have high-speed interrupts, it's usually not desirable to use interrupt pins for button IO – buttons ring, and that means that pressing the button once will trigger a whole torrent of interrupts, of which you only want the first one.
Instead, simply loop your code, and occasionally check your IO pins.
Comment: @YassineKardid are you deactivating the complete GSM module while you sleep? Otherwise, the power saving in your ATMega will be negligible compared to what the GSM module needs.
Comment: Thank you sir, I use the four push buttons to send specific messages using a GSM module linked to my microcontroller, so to mimimize the energy consumption of my system, I thought to use the interrupts to leave the Microcontroller in the sleep mode
Comment: hi uhours, the 0.1µA mode is not "deep sleep" by my (admittedly high) standards, because it's not that much lower than the other sleep states from which you'd want to wake up by a button press. It's still correct what you say, the ATMega328 does have sleep states from which you can wake up through an interrupt.
Comment: Your answer is very helpful . My GSM module remains in sleep mode so long as it does not ask to send a message.
Comment: If I connect two push buttons to an external interrupt, when the interrupt is triggered I can't identify which button is pressed, because it is already released.
Comment: ha, you're underestimating the speed of your microcontroller. It takes maybe 10 ms to really quickly press and releas a button (you won't manage to do that with small push buttons, you'll be much slower). In 10 ms, your MCU can wake up, ramp up its oscillator and have done about a million instructions, without batting an eye.
Comment: OK sir, it's very interesting, I really appreciate your help.

External interrupt on atmega328p


Lost/Stolen Samsung S4 Mini blocked be tracked?

Question: recently lost samsung s4 mini, which had sim and phone blocked. Tried to remote lock it using Androis manager, but said device was offline. Does this mean that they can get at my data even though I put that lock on?
Comment: Can you give a few more details on what "that lock" is? Unless the device was encrypted, there are always ways to get to the data once one has obtained *physical* access to the device.
Answer: If this is installed then you can locate it .Go to google.com/android/devicemanager and see if your phone is picked up. Outside of that, reporting it stolen to the carrier and police is your next bet if you didn't install any software with remote capabilities. For more derails you can also refer Samsung India site.


How many different necklaces can be make from 5 red beads and 4 green beads?

Question: I found a similar problem and I studied the solution. But I still can not understand the solution exactly.

let S={necklaces of length 9 with 5 red and 4 green beads}.
 So, $\left| S \right| =\frac { 9! }{ 5!4! } $
 The group of symmetries, $ G={ D }_{ 9 }$.
 $ \left| G \right| =\left| { D }_{ 9 } \right| =18$
 Now, by the Burnside lemma, required answer is $$\frac { 1 }{ \left| G \right|  } \times \sum _{ g\in G }^{  }{ fix(g) } $$
This part is understandable.
I will ask you for help from now on, please.
Comment: So what is your question then?
Comment: With rotation but not turning over, I suspect there are $14$ necklaces with $5$ red and $4$ green: one with $4$ greens together, four with $3+1$ greens, two with $2+2$ greens, six with $2+1+1$ greens, and one with $1+1+1+1$ green.  Allowing turning over as well as rotation, I think this becomes $10$ necklaces/bracelets (one, two, two, four, one of those types respectively)
Answer: To do away with the problem of equivalence under rotation, fix one of the beads in its place, turning the problem into arranging others to its right, as on a shelf. However, I have a little doubt about what two necklaces are defined to be equivalent in your question.


How should one go about choosing a default TCP/IP port for a new service?

Question: When developing an app that will listen on a TCP/IP port, how should one go about selecting a default port?  Assume that this app will be installed on many computers, and that avoiding port conflicts is desired.
Comment: This is better answered here: http://stackoverflow.com/questions/10476987/best-tcp-port-number-range-for-internal-applications
Answer: Go here and pick a port with the description Unassigned
Comment: You're suggesting he chooses a port under 100?
Comment: Which one should I pick?
Comment: If all developers go by that logic it would mean that all new services gather around the few unassigned ports.
What would the probability be that a service is running on an assigned port vs an unassigned port. (Sorry if I'm not exposing some trade secret :)
Comment: If you are looking for a port to use on an internal network then please consider this answer on a similar question: https://stackoverflow.com/questions/218839/assigning-tcp-ip-ports-for-in-house-application-use/38141340#38141340
Answer: First step: look at IANA listing :
There you will see at the tail of the list
"The Dynamic and/or Private Ports are those from 49152 through 65535"
so those would be your better bets, but once you pick one you could always google on it to see if there is a popular enough app that has already "claimed" it
Comment: But wouldn't using a dynamic port leave me open to intermittent (although rare) port conflicts?  Perhaps it is safer to use a port in the registered range that is unassigned or assigned to an obscure app.
Comment: Regarding the dynamic range, I think the "conflict" question may have been asking whether, if an OS is using that range for ephemeral ports (as it should), would that run into a conflict with the port you chose if the OS randomly decides to use that port for e.g. some outbound connection. (Random use of this range is what ephemeral ports are for, as I understand it.) See this other [question](http://stackoverflow.com/questions/10476987/best-tcp-port-number-range-for-internal-applications) which states the concern in more detail.
Comment: unless you explicitly register your port choice with IANA, you run the same conflict odds using an "UNASSIGNED" I would think. Actually since there are many unassigned's in the low end, those probably would be more likely IMHO
Comment: Just don't make the mistake of assuming your app needs an IANA assigned port because you think your app will explode in usage before it actually does. :)
Comment: Always start with the unassigned range, with the option of a user/admin configurable port to deal with possible conflicts. ONLY if your application reaches broad use (think BitTorrent, or some other large usage) should you really consider applying for an assigned port. Otherwise stay out of the assigned range. If this is for something strictly internal/personal then simply document the ports in use by various services and you should be fine so long as people can look them up somewhere online. Think of the private/dynamic range similar to non-routable IPs - they perfect for small/private use.
Comment: The dynamic range is a bad idea. We used one port in that range and have had dns.exe conflict too many times.
Answer: If by widely-used, you mean you want to protect against other people using it in the future, you can apply to have it marked as reserved for your app by IANA here
Answer: The most comprehensive list of official IANA port numbers and non-official port numbers I know is nmap-services.
Answer: As others mention, check IANA.
Then check your local systems /etc/services to see if there are some custom ports already in use.
And please, don't hardcode it. Make sure it's configurable, someway, somehow -- if for no other reason that you want to be able to have multiple developers using their own localized builds at the same time.
Answer: You probably want to avoid using any ports from this list (Wikipedia).
I would just pick one, and once the app is used by the masses, the port number will become recognized and included in such lists.
Answer: Choosing an unassigned one from the IANA list is usually sufficient, but if you are talking about a commercially-released product, you really should apply to the IANA to get one assigned to you. Note that the process of doing this is simple but slow; the last time I applied for one, it took a year.
Answer: If this is for an application that you expect to be used widely, then register a number
here so no-one else uses it.
Otherwise, just pick an unused one randomly.
The problem with using one in the dynamic range is that it may not be available because it may be being used for a dynamic port number.
Answer: Well, you can reference some commonly used port numbers here and try not to use anyone else's.
If by "open to the public at large" you mean you're opening ports on your own systems, I'd have a chat with your system administrators about which ports they feel comfortable with doing that with.
Answer: Choose a number that is not very common
Answer: Choose a default port that doesn't interfere with the most common daemons and servers. Also make sure that the port number isn't listed as an attack vector for some virus -- some companies have strict policies where they block such ports no matter what. Last but not least, make sure the port number is configurable.
Answer: Use iana list. Download the csv file from :
https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv
and use this shell script for searching for unregistred ports:
for port in {N..M}; do if ! grep -q $port service-names-port-numbers.csv; then echo $port;fi; done;

and put 2 numbers instead of N and M.