What does it mean to do a "null check" in C or C++?

Question: I have been learning C++ and I am having a hard time understanding null. In particular, the tutorials I have read mention doing a "null check", but I am not sure what that means or why it's necessary.

What exactly is null?
What does it mean to "check for null"?
Do I always need to check for null?

Any code examples would be much appreciated.
Comment: When to: http://programmers.stackexchange.com/questions/186036/when-should-pointers-be-checked-for-null-in-c
Comment: I would advise to get some better tutorials, if all the ones you read talk about null checks without ever explaining them and providing example code...
Answer: In C and C++, pointers are inherently unsafe, that is, when you dereference a pointer, it is your own responsibility to make sure it points somewhere valid; this is part of what "manual memory management" is about (as opposed to the automatic memory management schemes implemented in languages like Java, PHP, or the .NET runtime, which won't allow you to create invalid references without considerable effort).
A common solution that catches many errors is to set all pointers that don't point to anything as NULL (or, in correct C++, 0), and checking for that before accessing the pointer. Specifically, it is common practice to initialize all pointers to NULL (unless you already have something to point them at when you declare them), and set them to NULL when you delete or free() them (unless they go out of scope immediately after that). Example (in C, but also valid C++):
void fill_foo(int* foo) {
    *foo = 23; // this will crash and burn if foo is NULL
}

A better version:
void fill_foo(int* foo) {
    if (!foo) { // this is the NULL check
        printf("This is wrong\n");
        return;
    }
    *foo = 23;
}

Without the null check, passing a NULL pointer into this function will cause a segfault, and there is nothing you can do - the OS will simply kill your process and maybe core-dump or pop up a crash report dialog. With the null check in place, you can perform proper error handling and recover gracefully - correct the problem yourself, abort the current operation, write a log entry, notify the user, whatever is appropriate.
Comment: Don't forget to mention that an even better version of this function should use references instead of pointers, making the NULL check obsolete.
Comment: An assert() would be a better solution here. There's no point trying to "be safe". If NULL was passed in, it's obviously wrong, so why not just crash explicitly to make the programmer fully aware? (And in production, it doesn't matter, because you've *proven* that nobody will call fill_foo() with NULL, right? Really, it's not that hard.)
Comment: This is not what manual memory management is about, and a managed program will blow up too, (or raise an exception at least, just like a native program will in most languages,) if you try to dereference a null reference.
Comment: @MrLister what do you mean, null checks don't work in C++? You just have to initialise the pointer to null when you declare it.
Comment: What I mean is, you must remember to set the pointer to NULL or it won't work. And if you remember, in other words if you *know* that the pointer is NULL, you won't have a need to call fill_foo anyway. fill_foo checks if the pointer has a value, not if the pointer has a *valid* value. In C++, pointers are not guaranteed to be either NULL of have a valid value.
Comment: @MrLister in a very simple application, this may be true. I can think of many more complex situations where you may want to try dereferencing a pointer without knowing whether or not it is valid. if you ensure all pointers are initialised to null in your constructor initialisation and you set its value back to null when destroying the object it references, then you can assume that the point will either have a valid value or NULL.
Comment: @AmbrozBizjak If you're providing a framework instead of an application you can't prove anything, and have to think like the worst programmer
Comment: @TZHX: No, it doesn't auto-initialize *some primitives*. The two are not the same. Oh, and, in C++, it's `nullptr`.
Comment: But this works better in a language that initialises all variables to zero automatically. In C++, when you create a pointer, it can point anywhere, and NULL checks won't work.
Comment: @AmbrozBizjak trying to dereference a pointer may not be the be-all/end-all of the application. it's perfectly reasonable to expect that the "error" may be recoverable. I believe tdammers' example was probably meant to be simplistic to get a point across, as in "this is what null checking looks like in C++".
Comment: @MrLister but you make a good point that people working with C++ should be aware it doesn't auto-initialise values on variables.
Comment: @MrLister I don't think it's too much hassle to remember to initialise your variables.
Comment: @James: same applies for frameworks. Document the interface and put assertions in, and expect the framework users to read the documentation, or at the very least test with a debug build of your framework with assertions enabled. If they don't do either of that, they obviously have no intention of writing reliable code.
Comment: It's only `nullptr` for the lucky few that can use a compiler that supports C++11.  Most of us are still stuck on older compilers.  If you have an older compiler, you are stuck with NULL.
Comment: @MasonWheeler: Manual memory management is about taking care of memory allocation yourself. Knowing which of your pointers point to something valid is a vital part of that. I admit my wording was a bit unfortunate, I'll edit in a second.
Comment: @MrLister: Read the answer again. Even though the examples don't show it, I explicitly recommend initializing all your pointers to NULL.
Answer: The other answers pretty much covered your exact question. A null check is made to be sure that the pointer you received actually points to a valid instance of a type (objects, primitives, etc).
I'm going to add my own piece of advice here, though. Avoid null checks. :) Null checks (and other forms of Defensive Programming) clutter code up, and actually make it more error prone than other error-handling techniques.
My favorite technique when it comes to object pointers is to use the Null Object pattern. That means returning a (pointer - or even better, reference to an) empty array or list instead of null, or returning an empty string ("") instead of null, or even the string "0" (or something equivalent to "nothing" in the context) where you expect it to be parsed to an integer.
As a bonus, here's a little something you might not have known about the null pointer, which was (first formally) implemented by C.A.R. Hoare for the Algol W language in 1965.

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.
Comment: Null Object is even worse than just having a null pointer. If an algorithm X requires data Y which you do not have, then that is a *bug in your program*, which you are simply hiding by pretending that you do.
Comment: It depends on the context, and either way testing for "data presence" beats testing for null in my book. From my experience, if an algorithm works on, say, a list, and the list is empty, then the algorithm simply has nothing to do, and it accomplishes that by just using standard control statements such as for/foreach.
Comment: If the algorithm has nothing to do, then why are you even calling it? And the reason you might have wanted to call it in the first place is *because it does something important*.
Comment: @DeadMG Because programs are about input, and in the real world, unlike homework assignments, input can be irrelevant (e.g. empty). Code still gets called either way. You have two options: either you check for relevance (or emptiness), or you design your algorithms so that they read and work well without explicitly checking for relevance using conditional statements.
Comment: I came here to make almost the same comment, so gave you my vote instead.  However, I would also add that this is representative of a bigger problem of *zombie objects* - anytime you have objects with multi-stage initialisation (or destruction) that are not fully live but not quite dead.  When you see "safe" code in languages without deterministic finalisation that has added checks in every function to see if the object has been disposed, it is this general problem rearing it's head.  You should never if-null, you should work with states that have the objects they need for their lifetime.
Comment: Which also means no Null Object...
Answer: There are a couple of methods, all essentially do the same thing.

int *foo = NULL;  //sometimes set to 0x00 or 0 or 0L instead of NULL

null check (check if the pointer is null), version A

if( foo == NULL)

null check, version B

if( !foo )  //since NULL is defined as 0, !foo will return a value from a null pointer

null check, version C

if( foo == 0 )

Of the three, I prefer to use the first check as it explicitly tells future developers what you were trying to check for AND it makes it clear that you expected foo to be a pointer.
Comment: A note for C++: there is another way `if( foo == nullptr)`. This is better for pointers as it implicitly contains a pointer type (`nullptr` is of type `std::nullptr_t`) and is also more explicit for both function overloading and human readers.
StackOverflow answer about the same: https://stackoverflow.com/a/49145382/9236273
CPP Reference entry for `nullptr`: https://en.cppreference.com/w/cpp/types/NULL
Answer: The null pointer value represents a well-defined "nowhere"; it is an invalid pointer value that is guaranteed to compare unequal to any other pointer value.  Attempting to dereference a null pointer results in undefined behavior, and will usually lead to a runtime error, so you want to make sure a pointer is not NULL before attempting to dereference it.  A number of C and C++ library functions will return a null pointer to indicate an error condition.  For example, the library function malloc will return a null pointer value if it cannot allocate the number of bytes that have been requested, and attempting to access memory through that pointer will (usually) lead to a runtime error:
int *p = malloc(sizeof *p * N);
p[0] = ...; // this will (usually) blow up if malloc returned NULL

So we need to make sure the malloc call succeeded by checking the value of p against NULL:
int *p = malloc(sizeof *p * N);
if (p != NULL) // or just if (p)
  p[0] = ...;

Now, hang on to your socks a minute, this is going to get a bit bumpy.
There is a null pointer value and a null pointer constant, and the two are not necessarily the same.  The null pointer value is whatever value the underlying architecture uses to represent "nowhere".  This value may be 0x00000000, or 0xFFFFFFFF, or 0xDEADBEEF, or something completely different.  Do not assume that the null pointer value is always 0.
The null pointer constant, OTOH, is always a 0-valued integral expression.  As far as your source code is concerned, 0 (or any integral expression that evaluates to 0) represents a null pointer.  Both C and C++ define the NULL macro as the null pointer constant.  When your code is compiled, the null pointer constant will be replaced with the appropriate null pointer value in the generated machine code.
Also, be aware that NULL is only one of many possible invalid pointer values; if you declare an auto pointer variable without explicitly initializing it, such as
int *p;

the value initially stored in the variable is indeterminate, and may not correspond to a valid or accessible memory address.  Unfortunately, there's no (portable) way to tell if a non-NULL pointer value is valid or not before attempting to use it.  So if you're dealing with pointers, it's usually a good idea to explicitly initialize them to NULL when you declare them, and to set them to NULL when they're not actively pointing to anything.
Note that this is more of an issue in C than C++; idiomatic C++ shouldn't use pointers all that much.
Answer: You don't. The only reason to use a pointer in C++ is because you explicitly want the presence of null pointers; else, you can take a reference, which is both semantically easier to use and guarantees non-null.
Comment: I *do* wish people wouldn't say that "references guarantee non-null." They don't. It is as easy to generate a null reference as a null pointer, and they propagate the same way.
Comment: @Stargazer: The question is 100% redundant when you just use the tools the way the language designers and good practice suggest you should.
Comment: @DeadMG, it doesn't matter whether it is redundant. You *didn't answer the question*. I'll say it again: -1.
Comment: @James: 'new' in kernel mode?
Comment: @James: An implementation of C++ which represents the capabilities that a significant majority of C++ coders enjoy. That includes *all* C++03 language features (except `export`) and all C++03 library features *and* TR1 *and* a good chunk of C++11.
Comment: @mjfgates: It is most assuredly guaranteed. Dereferencing a NULL pointer is UB, whereas having one is not, and it is, generally, impossible to gain a NULL reference unless you have already violated your invariants elsewhere, as the most common way to gain a reference is not at all by de-referencing a pointer, and binding it to a variable or temporary guarantees non-NULL.
Comment: The OP also asks about C
Comment: What you're in kernel mode, have no exception handler and need to find out if a 'new' failed?
Comment: @James: Is a completely special case and has no relevance to general C++ advice.
Comment: @DeadMG What, pray tell, is 'general C++'?
Comment: @NemanjaTrifunovic Yes, why not? You can't do it for real-time sure, but there's nothing stopping you otherwise.
Comment: -1. Another C++ idealist chooses to tell the op the correct way to use C++, while at the same time *completely ignoring the question*. How could advice on how to avoid NULL be useful when he doesn't even know what NULL is? Answer the question first. Evangelize correct coding principles after.
Comment: References _promise_ non-null. And null references are undefined behaviour, so a correct program will never have a null reference. But that doesn't mean _your_ program is correct and doesn't run into a null reference. It does mean unfortunately that when you write "if (&ref == NULL)..." the compiler can say that null references are UB, so &ref _cannot_ be NULL (even if it is NULL).
Answer: If you don't check NULL value, specially, if that is a pointer to a struct, you maybe met a security vulnerability - NULL pointer dereference. NULL pointer dereference can be lead to some other serious security vulnerabilities such as buffer overflow, race condition ... that can be allow attacker take control of you computer.
Many software vendor like Microsoft, Oracle, Adobe, Apple ... release software patch to fix these security vulnerabilities. I think you should check NULL value of each pointer :)


How can I set status messages in IRC?

Question: How can I set status messages in IRC? A simple guide for learning IRC would also be helpful.
Answer: You can do something like /away to set yourself as being away. For instance:
/away Not here right now

This will make it appear to others that you are away, and if they PM you, they will get a message somewhat like this:
Menopia is away. Reason: Not here right now

You can also use the /me command to denote doing something. For instance:
/me does something

Will appear to others in the channel/PM as something like:
* Menopia does something

Comment: is there a comment that would just set my status (in my /whois and direct messages) and not spam all channels that I am in? Maybe its diturbing if I change this a lot
Answer: The standard command is /away [your away message]. Then /away again to let people know you're back. I think this is a good start for learning IRC: http://www.mirc.com/ircintro.html

How can I set status messages in IRC?


Have ideas from programming helped us create new mathematical proofs?

Question: Other than trivial ones where computers checked all cases by brute force, have programs led us to find new proofs? Since programming has been it's own field for long, I suppose there must be some transfer knowledge of tricks in it which would assist us to do mathematics with the development of proof assistants.
Comment: Comparing your phrase "trivial ones" with those quite deep computer aided proofs that I'm aware of which worked by case checking, I'm hesitant to suggest an answer. Would you be interested in a situation where the *theory* underlying a computer science topic has applications in mathematics? I'm thinking particularly of applications to group theory of regular languages and finite deterministic automata.
Comment: Well yes! I am actually just beginning this topic, and I am trying to get as much inspiration as possible @LeeMosher
Answer: Because programs are proofs, every proof is a program (I am simplifying a bit). The correspondence is rich and open-ended, and subject to active research.
An example where programming concepts directly contributed to new discoveries in mathematics is classical Krivine realizability, a novel method for creating models of classical set theory, different from forcing. It is based on the idea that programs may witness (realize) mathematical facts. The particular kinds of programs used in Krivine realizability work with stacks and continuations, which are not anything that a "normal" mathematician would be familiar with, but are standard tools used in compilers and programming languages.
Answer: In HoTT there are clearly new proofs (of known theorems) with PL ideas.
The encode-decode method (chapter 8.9) introduced by the HoTT book gives us a novel approach of characterizing the path space of a certain type. It mainly involves in defining the following functions, given a pointed type $(A, a_0)$ and a type family $\text{Code}: A → \mathcal U$:
<code>c0 : Code(a0)
decode : ∀ x : A, Code(x) → || a0 = x ||
...
</code>
In traditional topology, we prove $π_1(S^1) ≃ \mathbb{Z}$ by using a universal covering, while in HoTT we use path induction (aka dependent pattern matching without-K) introduced in Martin-Löf type theory, which is certainly a type theoretic idea.
Comment: Could the downvotes please explain why they think this answer is not helpful?
Comment: Perhaps the answer could be made more complete by explaining the PL origins of the encode-decode method?
Comment: @Trebor: it's difficult to guess that's the grievance from just seeing a "-1". To answer your question, encode-decode is a special case of [reification](https://en.wikipedia.org/wiki/Reification_(computer_science)), which is a programming technique for turning abstract values into concrete ones. But it's a windy road, because the way encode-decode method is used in HoTT can be traced back to old ideas from homotopy theory (my internet sucks at the moment, I can't find the relevant references).
Comment: @PeterLeFanuLumsdaine: that's why I said it was a windy road. I am pretty sure, though, that the computer scientists recognized reification and used the idea to expand the encode-decode method.
Comment: I'm not sure the HoTT encode-decode method is really an example here — as far as I remember from the IAS special year, it originally emerged as a way of handling universal covering spaces that was particularly well-suited to type-theoretic implementation; the connection with reification was observed fairly early, but wasn't a big part of the original inspiration.
Comment: I might agree, I'm not sure I'd seen exactly the encode-decode method before the HoTT book. But here's a devil's advocate argument: You can find, in Agda, situations where $a = b$ is replaced with $\mathsf{T}(a =?\ b)$ where $=?$ is an equality decision procedure, and $\mathsf{T}$ lifts a decision output to its truth value ($⊤$ or $⊥$). This is provably equivalent to equality, but tends to have nicer computational behavior. This essentially involves all the steps of the encode-decode method, just for different motivations. And I'm relatively sure this sort of thing predates HoTT.
Answer: Theorem: The subset of transpositions $\{(i,i+1),\,1\leq i<n\}$ forms a generating family of the set of all permutations on $\{1, ..., n\}$.
Proof: The bubble sort algorithm always terminates.
Twelve years ago, when I was an undergraduate and proving this theorem was an exam question, my algebra teacher was not familiar with the bubble sort algorithm, and I got a zero for this question.
This is one example of many. There are lots of theorems that can be rephrased as "There exists some object...", and a constructive proof consists in writing an algorithm that builds the object, and proving that the algorithm is correct.
Comment: And your answer truly deserves a zero because you did not prove that bubble-sort always terminates, which is **not only just as difficult** as the original question, but also **not enough at all** because you also need to prove that bubble-sort produces the correct output.
Comment: As an answer to that exam question I agree you shouldn't get full credit, but this is a good answer to *this* question.
Comment: This observation also happened to be my 'hey, ain't that neat'-style derivation of that fact concerning $S_n$ (I believe my very first formulation had been more along the lines of 'any finite deck of cards can be sorted, moving their vertical co-ordinates through each others', and without loss of generality assuming there never to be three or more at the same altitude')--kind of reminiscent of 'spaghetti sort' and 'proofs with physical flavor'.
Comment: That bubble sort always terminates is obvious from the structure of the code when implemented as 2 nested `for`s.
Comment: I do agree that the correctness of bubble-sort is rather heavier and a 'sledgehammer' in comparison to the original fact, but if one happens already to know or believe in the former, then I like this method as a redundant or 'backdoor' proof for the latter.
Answer: The hierarchy of formal languages (also known as the Chomsky hierarchy) and their associated recognition automata has found applications in group theory.
In particular the theory of automatic groups, which was introduced by William Thurston and developed in the book "Word processing in groups", is an application of the theory of finite deterministic automata and regular languages; this is the theory that underlies lexical pre-processors of programming language compilers.
The discovery of the theory of automatic groups was, moreover, directly aided by use of the UNIX utility grep, an acronym for "get regular expression", which is one of those lexical pre-processor tools. See this mathoverflow link for a story of that discovery.
Comment: A quibble: this is a hierarchy of *formal languages* or *formal grammars* completely independent of whether they are *programming* languages.
Comment: That's why I wrote my comment under the OP first.
Comment: I added a bit to my post to emphasize a stronger connection to an actual computer program, if that helps.
Comment: I think the answer is fine, because formal languages are a substratum of programming languages, but to call the Chomsky hierachy "a hiearachy of programming languages" is inaccurate. In what sense are, say, regular languages programming languages? I went ahead and edited your answer (which I believe is the norm here, answers are not owned by people). Please revert my edit if you disagree – I am not entering an edit war :-)
Comment: Formal languages is better but I added a phrase to emphasize their associated automata.
Answer: Nothing deep, nothing to do with proof assistants but it does answer the question asked: in my paper
Gergonne's Card Trick, Positional Notation,
and Radix Sort
I use radix sort to explain why Gergonne's classic three pile card trick works.
Answer: The programming idea of speculative execution coupled with backtracking when needed, exhibited in the seminal "D5 paper", grew to a huge industry, the "dynamical methods in algebra". Lots of new proofs in constructive mathematics arose from this industry. Some of these proofs are also interesting from the point of view of classical mathematics (for instance, I'd argue that this is the case for Yengui's proof of Suslin's Lemma).


Can a RDBMS connect to a remote server, execute a select query and copy them into a local table just with SQL commands?

Question: I'm sorry it may sound stupid but I've been wondering about how multiple databases are automated before the virtualization era. Can a DB Adminsitrator make a stored procedure to get data from a remote RDBMS and select them into a local table?
Answer: Sure, in SQL Server at least you can set up a linked server to other SQL Servers, Oracle, MySQL etc. and pull data from them. There are other approaches as well (such as OPENQUERY). An example would be:
SELECT * INTO dbo.localtable FROM OtherServer.database.dbo.TableName;

In Oracle I think the equivalent is database link but I confess that I have never used it.
Answer: In Oracle, you can use a database link object to do it.
CREATE TABLE localtable as (SELECT * FROM remote_table@link_name)
Answer: Linked Server & Openquery suggested by @Aaron is simplest and fastest option for sql server to connect to remote server, but just to present the variety, you can also develop a SSIS package for sql 2005 & above or a DTS package for sql 2000, these are ETL tools of SQL server
Comment: SSIS/DTS seems overkill for a single table here and there.
Comment: indeed, i agree with you about this issue, in the OP its mentioned `I've been wondering about how multiple databases are automated` and `to get data from a remote RDBMS` , so incase @ugurcode wants to know different ways.


what does this means 'error in Version string 'svn3799ppa1~maverick1' version number does not start with digit'?

Question: 'error in Version string 'svn3799ppa1~maverick1' version number does not start with digit'
this message is shown each time during the package installation in gnome3 upgrade. Why this message is coming and will this cause a errors in other programs??
Comment: Is there any more context to go with that error message?  It sounds like it is referring to a package with a weird version number, but without more info it is difficult to say any more.
Comment: this happpens after i upgrade to gnome 3 in ubuntu 11.04(upgraded from 10.10)
Answer: I did a google search for the version number and the only reference I came up with was for a PPA for a program called Handbrake.  Did the part of the error message you didn't include in the question mention that package?
Assuming this is the case, it looks like the packages in this PPA had a weird naming convention.  The owner of the PPA has since changed them slightly such that it shouldn't trigger this error, but it isn't clear that the new packages would be considered newer than the old broken ones.
If that is so, I would suggest removing the handbrake package and seeing if that allows you to install the other updates:
sudo apt-get remove handbrake

If everything upgrades correctly after doing that, you could try installing the package again (which should hopefully give you a version without a broken version number).
Comment: `sudo apt-get install handbrake`
worked for me...


2 switches, 2 circuits, same box

Question: I realize it may have been answered but there are so many nuances I want to be sure: I have one (metal) double-gang box with one outdoor light circuit. I want to add a switch for a completely different outdoor light. The two independent circuits would co-exist in the same box. Is this legal? Should I put a warning note in the box there are two power sources (on different breakers) in the box? The obvious danger is someone switching one breaker and thinking the box is safe.
Answer: I mix multiple circuits in the same box a lot.
I would color the wires for the second circuit differently.
Use gray shrinkwrap or tape on the second circuit's neutrals.   Then use brown or blue shrinkwrap or tape on the second circuit's hots.
If the next guy is dumb enough to mix gray neutrals with white neutrals, well, you can do what you can do, but you  can't fix stupid.
I for one prefer to also use a differnt color for switched-hot (typically red), so mark the switched-hot for circuit 2 with both brown and red.
Answer: You can have multiple in the same box if they are the same gauge wire.
You are probably running 14/2 for your lighting.  If you want to be extra safe about the box then you use a breaker tie in the panel to tie the two breakers for the two circuits together such that if someone flicks one off to work on it, both are flicked off.  This used to be done for kitchen outlet devices - before code changed to 20amp outlets - where each outlet in the device is on a separate circuit.
Comment: Can you cite the NEC rule that requires them to be the same gauge wire?
Comment: I agree there is no requirement for the same gauge wire in a box. Also only a Multi Wire Branch Circuit requires handle ties because they share a neutral. Anyone working on this circuit should be testing first to make sure there is no power on the devices they are working on.
Comment: I just wasn't sure about circuits with different amps in the same box.  There are certainly rules against sharing a line voltage box with low voltage except under some rigid conditions.

2 switches, 2 circuits, same box


Can I change file systems inside of partitions within GParted?

Question: I'm looking to share documents, pictures, etc. between Windows 7 and Ubuntu 12.04.1.  I have an extended primary partition (sda4) that is comprised of a swap partition (sda5) and a "/home" mount point storage partition (sda6).  This sda6 storage partition is a ext4 file system.  As I understand it, in order for Windows 7 to recognize the data, this storage partition needs to be an NTFS format.  Can this ext4 format (sda6) be changed to NTFS using the GParted Partition Editor?  If not, is there another way to make this happen?  Thanks so much in advance.
Answer: For various reasons you should not use ntfs for home partition. What you should do is shrink it to make free space for a new partition that will be NTFS. It will be visible for both systems - Windows and Linux.
Process overview:
- boot to Parted Magic LIVECD / USB
- backup sda6
- resize the sda6 to free some space
- create new NTFS partition
Step by step instructions by yours truly
 how to convert free space to a ntfs partition
Please proceed only after reading the instructions through and through if you're not familiar with partitioning.
Comment: /home has to be ext due to the permission setup Linux uses. NTFS does not understand that. Excellent post:I misread it at first so +1 ;)
Comment: Seeing as how I can only have 4 primary partitions, is this even possible seeing as my /home partition (sda6) is a sub-partition from the extended partition (sda4)?  If it is possible, could I (using GParted), unmount the current /home sub-partition, shrink this and then create a new, effectively a sub-sub partition, in the NTFS format?  Thanks in advance.
Comment: If sda5 and sda6 are inside extended, you're good to go as extended partition can accommodate much more than 4 partitions. GParted is fine but no operation on existing partition can be accomplished without data loss. I'll update my answer in a second...
Comment: @Bucic  What is the best backup program to use for this function inside of Ubuntu?  The size of sda6 (/home) is 99.96GiB, used is 1.90GiB.  Once this small amount is backed up, how much space should I then allocate from sda6 to sda7 (NTFS)?  I had originally intended to have all 100GiB for data storage, but am now uncertain as to how many GiBs I need to leave in the ext4 "/home" sda6....Thanks again for your help and any further thoughts.
Comment: A regular file copy in file manager to a different partition will do. Just remember to turn on 'show hidden files' prior to copy. / I recommend: store data in /home, NTFS just for sharing with windows. In such case: resize /home to 70 GB and use the freed 29 GB for your new NTFS partition. / Please construct your questions on askubuntu so it won't require so many chatting in comments.
Answer: I am pretty sure you can not do this. but there are some options.

You back up the data, and reformat the partition to NTFS, restore the data.
The easy option would be to download and install Ext2Read in Windows. This will allow you to access your ext partitions.

You can find more info about ext here and here. Even thought the software seems to be a bit dated and not supported anymore, it still does get the job done.
Hope this helps.
Afer some more google-fu I found DiskInternals Linux Reader which is to a free option, and looks like it is still be supported.
Comment: ext2read is no longer being actively developed. I found ext2fsd to be very reliable and easier to use, but I note that it's been some time since we had a new release from too.
Comment: I suppose you are right... but if it still works then I think this is a valid answer... I will update it here in a sec though....
Answer:
Can this ext4 format (sda6) be changed to NTFS using the GParted Partition Editor?

No, you can NOT use NTFS for /home since it does not understand permissions.
If you do not have it yet, you need to install ntfsprogs before creating a NTFS disc.

Inside GParted

You can resize /home, put the extra space into a new partition (sda7) and use the new one to make it NTFS. Then symlink your directories in /home/$USER to this new disc.
For the NTFS part:
Click system, click administration, click GParted partition editor. Click the box at the upper-right corner of the GParted window and select the disk you want to partition by clicking its name in the list. Format an existing partition or create a new partition. Format an existing partition by right-clicking the partition in the GParted window, clicking format to and clicking NTFS. Create a new NTFS partition by right-clicking unallocated space, clicking new, clicking the file system box, clicking NTFS and then clicking add. Click the edit menu at the top of the GParted window and click Apply All Operations. Click Apply

Pointers

You can't format partitions that are mounted and in-use. If the partition is mounted, right-click it and click "Unmount" before formatting it.
Formatting a partition removes all existing data on it. Any data on the partition you format will be lost. So make a backup (and check the backup) before starting.
Answer: You can install ext2fsd for windows and access the data on your ext4 partitions from within windows.  Have a look at the ext2fsd website for downloads and information.


Would an electromagnetic jet engine work?

Question: If the front fan on a gas turbine had a blade, or some of its blades extending into the surrounding housing, where there was a maglev ring of electromagnets, could fuel use be reduced by the engine? While still providing similar levels of thrust? Perhaps at the expense of electricity in the cabin.
Comment: What makes you think this would work?  What principles are you looking to use to improve efficiency?  There's plenty of ways to put together technologies, but the thing which distinguishes the snake oil perpetual motion machines from the elegant solutions to improve fuel efficiency is that the latter is assembled using tried and true principles.
Comment: I don't know if it would work that's why I asked the question, there are many variables on aircraft, this is not perpetual motion, and neither is the Maglev train. This is about whether electromagnets could making a jet engine spin, using power from the axillary power unit on-board an aircraft. Also whether the results would be anywhere near as good as a conventional gas turbine engine.
Comment: Ahh, those details help.  So you are looking at using energy from another engine (i.e. the APU) to spin the compressor blades, so that the jet can use more of its output for useful thrust rather than spinning the compressor?
Comment: @CortAmmon the APU will overheat if it is run too long, as it is buried way in the back. It starts the engines, then they turn it  off.
Comment: Hi Jameson, your post needs to explain how a magnetic system would actually push air backwards, to duplicate what modern engines already ready do with pretty good efficiency. I an 99% sure you will never see commercial aircraft power by electromagnets, possibly it will work  with smaller glider sized aircraft, variations of the [Solar Impulse]( http://www.solarimpulse.com/). Diesel trains do run the system like you describe though, using  a diesel engine that than runs a generator with electric motors  on the wheels, to provide better performance and braking, but it would not work on planes
Comment: I agree, I think on smaller scale projects maybe, and even then, they tend to cut out the middle man and just use propellers, which is most likely that way for a reason; it's simple, possibly more effective and cheaper. However on a large turbofan, it seems impractical. Thanks for all the answers!
Answer: There's a few layers to this question, each with its own answer.  However, fortunately, the answers for each layer are the same: no.  You cannot improve your fuel economy by adding a maglev system to an engine.
The first layer is easy -- conservation of energy.  Any energy that you put into the compressor blades from the maglev system must come from somewhere.  That "somewhere" is another engine, such as the APU.  All you do in this case is rob Peter to pay Paul.  However, it's even worse in this case.  Jet engines are tremendously optimized beasts.  A 1/10th of a percent improvement in fuel economy translates to somewhere around $500 in savings per plane, per flight! I hand waved the distances there... math is based on a 10 hour flight and 36,000 gallons of gas consumed.  You should get the idea for just how much money there is in this business.
What does this mean?  Well, it means that the engines are already optimized to do exactly what they need to do.  Using an APU and bulky maglev system would consume far more energy than it cost to keep the compressors spinning the normal way.  Yes, your main engine may be slightly more efficient, but you more than pay for those enhancements by running a less efficient engine.
Worse, you might not get any benefit at all!  Maglev equipment doesn't exactly come without costs.  It takes space to put that equipment into the engine space, and it brings mass.  You may not be able to use the most ideal materials for compressor blades because they need to have good magnetic properties now... that can decrease efficiency.  You may find that not only does the maglev equipment require a separate power source, but that it actually decreases the efficiency of the engine by applying new requirements to the design!
I hate to use an appeal to authority on Physics.SE, but truthfully, if there was a solution like this, the engineers who pour hundreds of thousands of hours into these devices would probably have found it.  Airplane manufacturing is a multi-billion dollar industry feeding an even more massive air travel industry.  There's a lot of eyes on efficiency of planes.  Lots of sharp eyes.
Comment: Yes that makes sense, which is why I'm here. Common sense shows that this would already have been done, but I couldn't help but check just in case, as I wanted to know the reason. It stands that this is nothing more than using the same amount of energy, to do the same thing, even with a loss of energy in the process of doing that. Thanks for your answer, I wanted this debunked, because it has been annoying me for weeks!
Answer: No is the quick answer

If the front fan on a gas turbine had a blade, or some of its blades extending into the surrounding housing, where there was a maglev ring of electromagnets,

This is an engineering question. The thrust from  a  Rolls-Royce_Trent, for example, is  420 kN and a lot of that comes from the high by pass ratio.  We know exactly how fan blades thrust air backwards and  that fan housing is vital to performance.
It's a double whammy, you take power from the engine core to power the maglev, (if they can provide it), then you block off the very  point of the high pass systems but without giving an explanation for how magnets would have sufficient power to drive enough air to rip off the top layer of a badly maintained runway, which a modern turbine engine is perfectly capable of doing, if the aircraft rotates too quickly on takeoff.
From Power of High Bypass Engines

The airplane was positioned for the run with asphalt extending from close to the wing trailing edges to beyond the empennage. During the high-power part of the run, asphalt lifted from behind the left engine and broke into pieces, sending large fragments into the aft fuselage and outboard horizontal stabilizer.

Or am I misunderstanding you, if I am, my sincere apologies.
Comment: Yes you have understood correctly. I was concerned about the level of torque such a system would produce, and I honestly did have thoughts of it paling in comparison to combusting fuel. However, when there are magnets that can lift up cars, I began to get confused. Thanks for your answer!


How to change the MAC address of pc?

Question: I am currently using ubuntu 13.04 along With windows 7. But I want to change my MAC address of pc. Is there any way to change it.
Answer: In a command line (terminal), run:

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:11:22:33:44:55
sudo ifconfig eth0 up

That's sufficient for the current user's session.  However, in order for the changes to persist, you must also edit /etc/network/interfaces and create or modify an entry for the interface.  For example:
iface eth0 inet dhcp
     hwaddress ether 08:00:00:00:00:01

Source: http://blog.sleeplessbeastie.eu/2013/01/11/how-to-change-the-mac-address-of-an-ethernet-interface/
Comment: you should mention that we should use `sudo` before all those command
Comment: Old post but thanks. For some reason after a power outage my mac address was lost. Was able to get it from a log and set it this way - yah!
Answer: You can install macchanger
sudo apt-get install macchanger
macchanger --mac=01:23:45:67:89:AB eth1

Answer: In Ubuntu you can clone a Mac address in the network settings.
Click on the network icon in the top bar and select Edit connections. Select your current network and hit Edit. In the Ethernet tab you should see your actual device MAC and a field to enter the MAC you want to clone.

How to change the MAC address of pc?


How is energy conserved in spontaneous emission?

Question: I was reading through the section on spontaneous emission in Introduction to Quantum Mechanics (2nd Ed.) by Griffiths. In section 9.2.2 he explained that spontaneous emission is really a stimulated emission except the cause of it is the electrons in the ground state that provide the perturbing radiations to initiate an emission. He commented that due to the ground state energy, there still will be some EM radiation even when it is completely dark and at absolute zero temperature.
I do understand that the Electric field will be present since the electron is a charged particle, but how could radiation be present due to the ground state electron? From my understanding, radiation is caused by acceleration of electron. And the electron in an atom maintains its constant movement since its kinetic energy is conserved. Then since the electron will retain constant velocity (I know this may not be in reality but in terms of energy conservation) and does not accelerate, creating no EM radiation. Also if it were radiating, shouldn't the ground state electrons lose energy?
After a thought I personally came to a conclusion that when an electron moves down the energy level, it's relative distance to the ground state electron decreases so gains some potential which could compensate for the emitted energy that served as the perturbation. But How would the ground state electron radiate energy if for a minuscule amount in time it's total energy would differ from the quantized amount of ground state energy? Also is the conclusion I've come down to a correct way to view this phenomenon?
Comment: Please specify the book and section/page that you refer to.
Comment: It is from "Introduction to Quantum Mechanics Second Edition" by Griffiths pg 351 or section 9.2.2
Answer: You probably misunderstood what Griffiths is saying with regard to spontaneous emission. He says that according to Quantum Electrodynamics there is electromagnetic radiation even in the ground state of the electromagnetic field (in vacuum). And that the perturbation by this ground state electromagnetic field causes the "spontaneous" emission similarly to the stimulated emission. This is not related to the ground state of the electron in the atom.


When can we link to pictures direct, ie. posting [img]http://ubuntuone.com/mypic7YREE555.jpg[/img]?

Question: Would be nice to be able to post images directly rather than a coded web page.
i.e. so we can use pictures in forums, emails, http image etc.
Any idea if this will be implemented?
Comment: The is best discussed on Meta - not here.  When you have enough rep you will be able to post pictures directly into your question or answer.
Answer: On Ask Ubuntu, you need to use the proper markdown for this:
![image description](http://ubuntuone.com/mypic7YREE555.jpg)
Results in the image being embedded.
Comment: Also: `` works too.
Answer: Although the link Ubuntu One provides doesn't end with .jpg you can still use it on the Ubuntu forums as you have described:
[img]http://ubuntuone.com/1bwxP9xWhvm3mvB2t2zkMn[/img]

Answer: You need to have enough reputation to be able to insert a picture in your post: that privilege comes at 10 reputation points. A single upvote on an answer, or two on a question, will bring you to this point; the restriction is solely there to prevent drive-by spammers from posting images.
To insert an image in your post, click the img button in the editor toolbar or press Ctrl+G, then enter a link to the picture on the Web or the location of the picture file on your computer. The image will be uploaded to Stack Exchange's servers, so that it's always available.
Answer: Yes, thats possible.  I tryd it with a html file and Google Chrome.


What notable examples of metamorphic engines are there?

Question: I am doing a research project on metamorphic malware and would like to have access to a metamorphic engine I could demo. Are there any good open-source (or easily obtainable) metamorphic engines I could experiment with for this project?
Comment: Unfortunately, questions of the type "where can I find X?" are off-topic as the lists might be neverending.
Answer: From my point of view you can start with Metasploit and check the encoders that exist there, such as shikata-ga-nai, etc.... There are some articles interested https://www.cs.unm.edu/~crandall/ccsdacoda.pdf and http://lsd.ls.fi.upm.es/papers/2009/srds2009.pdf where you can find very useful references about the topic. Finally if you want to dig on how metamorphic techniques works I definitively you recommend starts with https://github.com/K2/ADMMutate that covers the most interested metaphoric techniques.


Can I safely delete XMP files after creating JPEGs?

Question: If I edit my RAW files in Photoshop, and create JPEG files, can I delete the XMP files which get created?  At this stage, I am not interested in keeping the data of my editing, but I want to make sure that it is not attached in some way to the JPEG I created of my edited photo.
Answer: Sure, if your picture is exported in JPEG, it's safe to do whatever you want on the RAW source. XMP files are just an archived history of the processing stages on the RAW file (settings and parameters used), it has nothing to do with the exported JPEG.
However, I would not recommend to delete the XMP files. First, it's just a few more kilobytes (like a droplet in the ocean of heavy RAW files), and second, your future self might be happy to have them (to keep track of your editing, rework on the file, see how you improved in editing, etc.).
Comment: +1, but of course, the XMP file has "everything to do" with making another future copy of that JPG.  Without the XMP, we're back at the unprocessed raw file. There may be worse things, but keeping the XMP is a mighty good idea.
Comment: Isn't XMP attached as metadata in JPEG?
Comment: XMP are only optionaly attached in the JPEG metadata, and frankly there is no reason to attach them there: it's only penalizing file size with useless metadata that might get removed if you upload the file to a server.


How to bring created date from Cloud page to Data extension in Marketing Cloud Salesforce

Question: I need help with bringing a created date from Cloud page to Data extension when the record is created for the marketing cloud.  When I someone clicks on Submit button on Cloud Page, how we can send the date in Data extension put it under Created date?
Comment: Never mind it is working now.. You have to set in the data extension. Create a new date field then click in "-". This will automatically set today's date when the record is created..
Answer: In the data extension the form is submitted to:

You should set Created Date as a nullable field with type Date.
Set it's default value to "current time"
Once the form gets submitted, time gets set to current time

Do observe it will be in UTC-6 time zone


How to get + metacharacter for sed in Terminal?

Question: It looks like sed that comes with Mac OS 1.7.4 is the original one, without the + metacharacter. Can I get the + metacharacter functionality?
Answer: OS X's implementation of sed uses the "basic" regular expression format by default, which doesn't support +.  From man re_format:
Obsolete (``basic'') regular expressions differ in several respects.  `|'
is an ordinary character and there is no equivalent for its functional-
ity.  `+' and `?' are ordinary characters, and their functionality can be
expressed using bounds (`{1,}' or `{0,1}' respectively).  Also note that
`x+' in modern REs is equivalent to `xx*'.  The delimiters for bounds are
`\{' and `\}', with `{' and `}' by themselves ordinary characters.  The
parentheses for nested subexpressions are `\(' and `\)', with `(' and `)'
by themselves ordinary characters. [...]

So, what can you do?  Well, one possibility is to tell sed to use the modern format with the -E switch.  This may, however, force you to rewrite other parts of your RE to conform (for example, swapping \( ... \) with ( ... )).  Another option is to use one of the suggested alternate forms above.  Here are examples using the various approaches to match "A" followed by one or more "B" or "C", followed by "D":
sed -E 's/A[BC]+D/[match]/'
sed 's/A[BC]\{1,\}D/[match]/'
sed 's/A[BC][BC]*D/[match]/'

Answer: The + is a GNU extension of sed that matches one or more of the preceding expression but the version on OS X is BSD sed.  A version of GNU sed has been ported to OS X on MacPorts.  Otherwise you'll need to try a workaround.
For example, to match one or more digits, you could use [0-9][0-9]* instead of [0-9]+
Comment: You can also use curly brackets in basic regular expressions, but they have to be backslash-escaped: `echo $'aaa\na\nb' | sed -n '/a\{1,\}/p'`


Proving Isomorphic to S3

Question: If you have a group with two elements, $x$ and $y$, which satisfy $x^3 = y^2 = 1$, can you conclude that this group is isomorphic to $S_3$? In general, what are some techniques that you can use to prove something is isomorphic to $S_3$ or $S_n$ (without resorting to Cayley tables)?
Comment: No, you cannot even conclude that the group is finite, or that it is non-abelian.
Comment: See my "Groups  whose  elements  are  of  order  two  or  three",  American   Mathematical  Monthly,  79,  1972, 1007-1010
Answer: You need to say more about the group to define it. The abelian group of order $6$ satisfies the relations you have, and the infinite group of complex numbers of modulus $1$ under multiplication has elements of order 2 and order 3. In general determining what the group is from its relations is a hard task.
In general, to get to defining a group more closely you would need to say that $x$ and $y$ generate the group. And you would also need to say (currently undefined) how they interact with each other, which would pin the group down.
Answer: You cannot conclude. For instance, the product $\mathbb{Z}_2 \times \mathbb{Z}_3 \simeq \mathbb{Z}_6$ satisfies your condition.
There are also infinite groups satisfying it, for instance the free product $$\mathbb{Z}_2 \ast \mathbb{Z}_3 = \langle x, \, y \; | \; x^2=y^3=1 \rangle.$$
In fact, by the universal property of the free product, any group generated by two elements $x$, $y$ satisfying your condition is a quotient of $G=\mathbb{Z}_2 \ast \mathbb{Z}_3$. For example, $$\mathbb{Z}_2 \times \mathbb{Z}_3 \simeq G/N_1,\quad S_3 \simeq G/N_2,$$ where $N_1$ is the normal closure of the subgroup generated by $xyx^{-1}y^{-1}$ and $N_2$ is the normal closure of the subgroup generated by $xyx^{-1}y$.
Answer: If you impose the condition $xy = yx^2$, then you can conclude that. Indeed the elements of this group can all be written has $y^m x^n$, $m = 0,1$, $n=0,1,2$. Then its order is $\le 6$. If it is abelian, then $yx^2 = x^2y$ so $xy = x^2y$ and $x = 1$, which is impossible. The only non-abelian group of order $\le 6$ is $S_3$.
Comment: <code> If you were given the condition that the group containing $x,y$ has order 6, could you also make the conclusion?  Thanks!</code>
Comment: @MessyTiger no, you could have commutativity, in which case your group is $\mathbb Z_2 \oplus \mathbb Z_3$.

Proving Isomorphic to S3


Should a post in a circular concrete form go through the bottom?

Question: I am replacing a fence post that was in a circular 2-ft form.  The old one had rotted where the concrete and post meet at the top - the next one will have the concrete above water level!
But - I noticed that the old post was sticking out of the concrete on the bottom.  I this a bad thing in that water can seep up into the post from below?  Or is it a good thing in that water that does seep through the top can leak out the bottom?
Comment: You have noticed that the rot happens right where the wood comes out of the concrete. That's what you need to protect next time, too.
Comment: Right now I'm moving to putting rive rocks at the bottom of the form.  The post will sit on 2 inches of these, and the concrete will then flow around them, sealing the bottom.
Answer: Concerete around a fence post is to help with lateral stability. It's not being used as a footer, since there isn't a whole lot of weight involved with a fence post.
As such, there's no need for concrete to be below the bottom of the post...in fact, you like don't want that, as you want any water that gets between the concrete and wood to have a place to drain.
What I'd suggest doing is to use gravel at the bottom...tamp it down with the post, set the post vertical, then add a bit more gravel and tamp down to 'set' the post. Then you can apply concrete around that, above the ground and then slope the top away from the post to help shed water.
Depending on your soil type, you may not even need concrete--you could actually just use gravel all the way to the top, tamping as you go.
Comment: I've always considered this to be the 'textbook' way of installing fence posts. The bottom of the post MUST be able to drain, sitting it on gravel is perfect. I usually go straight in with the dry concrete mix on top of the gravel bed. I've seen hundreds of fence posts rotted off as they were sitting in concrete pockets. If a person thinks concrete around the bottom of the post keeps it dry, they'd be mistaken.
Answer: When I did this I painted the bottom of the 4x4 with tar.  I forget the exact product name right now, hardware store helped select it, but it was black and sticky and sealed the wood.  Also we used pressure treated.  Is that your plan, too?
Comment: In olden times the bottom of a fence post would be set into a fire until well burned and charred all around. The charring/tarred wood resisted rot way better than a plain post.
Answer: STOP!!!!  The correct way to prevent rot coming up the post is to set the tube, pour a little bit of concrete to the bottom, lift the tube a few inches allowing the concrete to "mushroom" out around the bottom of the tube, then set the post and pour the rest of your concrete. Do not allow the post to go through the bottom of the concrete. Water will wick up the post and rot it right inside the concrete.  The bottom wants to be fully encased in concrete. Also taper the top of the concrete around the post so no water sits against the post. Simply use a trowel to shape the concrete as it cures into a nice shallow grade/cone so the water runs off.
Comment: But is not concrete also going to wick the moisture? Concrete is as much of a sponge as the wood is. I'd strongly suggest a drainable base (gravel) instead to allow all water to drain.
Comment: @Shirlock- Good call! A lot of people do not do the "mushroom" step. Which helps to keep the post sturdy, plumb and keeps water from wicking up the post.


I have a back pain from sitting. Can I still run?

Question: Before yesterday and yesterday. I sat for long hours and now my back hurts me. However, I have a running schedule I must follow. Can I run ? or running would makes it worse ?
Answer: Generally speaking, back pain that occurs due to sitting is linked to either tight hip flexors, tight thoracic spine or both. The best way to remedy these is by going through some mobility drill during your warm. An example would be doing some thoracic rotations for your tight upper back, and some hip flexor stretches for your tight hips.
I would also adivse you to do some core activation exercises during your warm up. This can be achieveed by doing a 30 second plank.
The reason for this is that when your hips get tight, your core becomes more mobile than it should in order to pick up the slack of the tight hips, so be simply doing the hip stretch you still wont tighten the core, and this can lead to tight hips.
In short, yes you can and should run, but not without going through a good warm up.
For a more in depth explanation on this approach known as the joint by joint approach, click on this link.
Comment: I think stretching is great advice
Comment: Sorry to down vote your answer, but it sounds as if you are diagnosing the cause of his back pain and then prescribing a solution.
Comment: Actually it is pretty much what he had stated himself in the question. He said he was siting a lot and as a result got back pain.
Comment: @used, yes he said he got back pain after 2 days of prolonged sitting if I understand correctly.  He (or she) did not say that he/she has tight hip flexors or a tight thoracic spine. Those are assumptions you made. Whether or not a lot of other people get tight hip flexors and a tight T spine from prolonged sitting is not the point when recommending a specific exercise to someone with a specific pain condition. The thoracic rotation exercise and/or running may aggravate the symptoms depending on the actual dysfunction.  That is why it is in the medical advice realm and off topic imo.
Answer: I would start with stretching as @usedtobefat suggested, then I'd try swimming.  This should help loosen everything up, then hopefully you should be good to run.
I'd try swimming over running as its non weight bearing, and there is no jaring,  so hopefully will be kinder so a sore back.
Don't get caught up in, "it's on the schedule I have to do it".  Listen to your body, and hopefully you'll be back to running in no time.
Answer: My personal experience is that running actually helps a lot to reduce back pain. I've experienced this on multiple occasions, so it's probably not some fluke effect. I suspect that what is going on here is that when you are running, your brain has a large degree of freedom in how it controls the muscles in your back (for balance etc.). While your focus is on where you are heading what pace want to run, the brain is going to implement that by controlling a large number of muscles that you are not consciously aware of. The brain can then take into account the new pain signals from your back and find a workaround way to control the motion of your back. But you may not even consciously feel much back pain when running.
When you are done running, you will notice that your back hurts a lot less, simply because whenever you move, your back muscles are controlled differently now.
Comment: This is a highly personal answer, and most likely only applicable to a small segment of the population. Also, the "theory" on the muscle control from the brain is wild conjecture and a poor understanding of nerve enervation in skeletal muscle.
Comment: That's why I started my answer with "My personal experience is..." and I started to explain my idea why I think this is so by writing "I suspect that what is going on here...". So, I made it very clear that these are my personal ideas. I think it ios debatable that this is "wild speculation", because you do adapt the way you move when in pain and most of that happens subconsciously.
Comment: Adapting a way to move when in pain is ultimately the same thing as compensating to avoid the pain.  As we know compensation leads to injury, so the correct thing would be to not run until the issue is addressed.
Comment: Yes, but we're talking about minor back pain here. In that case it are the normal activities like having to get out of bed in the morning that is going to force you to try to move in a different way anyway. In contrast, running does not strain the back, your back is going to be moved differently but that's not going to transfer any significant loads elsewhere.
Comment: You are very right, even getting out of bed with back pain can force a person into a compensation. If left untreated long enough that too can lead to injury. I really recommend that you look into Grey Cook's work with the FMS.


Degree of a smooth projective variety

Question: Let $i_1:X \hookrightarrow \mathbb{P}^n$ and $i_2:Y \hookrightarrow \mathbb{P}^N$ be two projective schemes.
Let $f:X \to Y$ be a surjective projective morphism between smooth projective varieties over $\mathbb{C}$. Denote by $g$ the composition of $f$ with $i_2$. Under what condition on $g$ can we conclude that the degree of $X$ is equal to the degree of $Y$ in $\mathbb{P}^N$ added to the degree of the generic fiber of $g$?
Comment: @Jana If there is no relation between $f$ and the respective projective embeddings then the question is absolutely ridiculous.
Comment: @Jana would you mind making it more precise then?  Do the embeddings have anything to do with the map $f$?
Comment: What definition of degree are you using for $X$ and $Y$? Have you fixed a choice of embedding into projective space?
Comment: Dear Jana, A projective variety does not come with a fixed projective embedding. Given a projective variety, you only know that such a projective embedding exists, but there is not a canonical choice.
Comment: @Jana: it seems that you don't get the problem with your question, pointed out by the people above (which are right). Let us make it more precise: you want a relation between the degrees of $X$, of $Y$ and of a general fibre. If you compose your map with any other closed embedding of $Y$ into a projective space, you change the degree of $Y$ but not the two others degrees. Hence, asked like this the question has a trivial answer: No relation. So you should probably add something to explain that the degree is related to the morphism.
Comment: Alas, this is not a good situation like orientable/oriented -- many people mean "projectivable" not "projectived" when they say projective variety, and with fairly good reason.
Comment: @Knutson: Could you elaborate a bit.
Comment: @Blanc: Thank you for explaining. The point is I  wanted to know under which conditions does the above relation hold. I understand that there has to be a condition on the morphism. I wanted to know what would be such a reasonable condition. I had tried to find similar result but with not much success. So I have very little idea of what would be the right place to start looking (like which conditions on the morphism would make it work). If you could indicate any direction other than the one mentioned below by Rivin, it would be most welcome.
Comment: @Blanc, Petersen, Schwede: I have edited the question. Does it make sense now?
Answer: Jana, the current formulation of your question is still not right. Everything else fixed one can still choose a different $i_1$ with which one can change the degree of $X$ (if $g$ is finite, this will not change the degree of the general fiber).
To get a sensible formulation you should do this: Indeed, degree of a projective variety is determined by an embedding, but an embedding is determined by the choice of a very ample line bundle. So, one may actually associate the notion of degree with the given very ample line bundle. Then, if you allow rational numbers as degree, then you can even associate a notion of degree to any ample line bundle.
This set-up allows for a formulation of what you want without a problem: Let $f:X\to Y$ be a morphism between projective varieties, $\mathscr L$ a very ample line bundle on $Y$, $\mathscr M$ an $f$-very ample line bundle on $X$ and set $\mathscr N=f^*\mathscr L\otimes \mathscr M$. (Note that it is an easy exercise to prove that $\mathscr N$ is very ample).
Now you can ask if it is true that the degree associated to $\mathscr N$ on $X$ is the sum of the degree associated to $\mathscr L$ on $Y$ and the degree associated to $\mathscr M|_F$ on $F$, the general fiber of $f$.
It turns out that this still has a snowball's chance in hell to be true, but if you asked whether it is true that the degree associated to $\mathscr N$ on $X$ is the product of the degree associated to $\mathscr L$ on $Y$ and the degree associated to $\mathscr M|_F$ on $F$, the general fiber of $f$, then it is a slightly better question.
Let's see what we can say about this. It is easy to see that the degree associated to a line bundle $\mathscr L$ is just $c_1(\mathscr L)^d$ where $d$ is the dimension of the variety. So, all you need to do is to compare the Chern classes of these line bundles. For simplifying the typing let me use divisors:
$L$ will be a divisor for $\mathscr L$,
$M$ will be a divisor for $\mathscr M$,
and $N$ will be a divisor for $\mathscr N$. In fact, let's choose them so $N=f^*L+M$. Further let $n=\dim X$, $d=\dim Y$ and $F$ still the general fiber of $f$, so $\dim F=n-d$.
Let's see the case of $f$ being finite first. So, $n=d$ and $F$ is a finite set of points. The obvious choice for $\mathscr M$ in this case is just $\mathscr O_X$ so we would get something sensible. In other words $N=f^*L$ and we want to compare $N^n$ and $L^n$. It is easy to see that if one represents $L^n$ by as many (general) points, then $N^n=f^*L^n$ is represented by the same number of fibers, each of which consists of $\deg f$ many points. In other words, the degree on $X$ is the degree on $Y$ multiplied by the degree of the map. This is the result Igor was referring to.
Next assume that $n>d$ and we'll see that we cannot expect anything like this.
So we want to compare $N^n$ with $L^d$ and $(M|_F)^{n-d}=M^{n-d}\cdot F$. Since $N=f^*L+M$ we have that
$$
N^n = (f^*L+M)^n = \dots +  {n\choose d} f^*L^d \cdot M^{n-d} + \dots
$$
As before, one may think about $L^d$ as a bunch of points on $Y$ and hence $f^*L^d$ as a bunch of fibers. On each of these fibers the effect of $(\_ )\cdot M^{n-d}$ is the same as restriction, so we get that
$$
f^*L^d \cdot M^{n-d} = (L^d) \cdot ((M|_F)^{n-d})
$$
(the right hand side is a product of numbers!)
So, we get that
$$
\deg X = {n\choose d} \deg Y \cdot \deg F + {\rm more\ terms}
$$
Note that these extra terms are all non-negative by the choice of our line bundles.(Of course, $L^j=0$ for $d>j$, but $M^l$ is not necessarily $0$ for $l>n-d$).
So, on one hand we already get the multiplier $n\choose d$, but more importantly we may also get additional terms that are hard to account for based on just those degrees. These terms come from the fact that while we required that $\mathscr M$ is $f$ very ample we did not require (and we cannot!) that it has absolutely no positivity in the "horizontal" direction. If it does, that will produce more positive terms. So, the best one can hope for is a product formula in case $f$ is finite. Otherwise one could say that there is an estimate that $\deg X\geq \deg Y \cdot \deg F$ and most of the time the inequality is strict.
Comment: @Kovacs: Thank you very very much for your answer. It is very very informative and helpful.
Answer: This seems to be addressed in this paper by Derksen and Kraft, Prop. 8.3
Comment: That only seems to discuss finite morphisms, though.
Comment: @ArtiePrendergast-Smith true, but one has to start somewhere :)
Comment: Igor: Indeed! My previous comment came out more negative than I intended it; I just meant to point out that the Derksen-Kraft result doesn't give a complete solution.
Comment: @Rivin: Thanks for the answer. Do you have a bit more general solution in mind?
Comment: In fact, the result is about finite morphisms given by a linear projection. This is a very precise case, but probably one of the only ones where the result works.

Degree of a smooth projective variety


What is the difference between octaves and harmonics?

Question: my question is about the importance of Octaves vs harmonics? What is the difference between these two concepts?
Comment: What do you mean by importance? Is there a certain application you are interested in or question you are trying to answer?
Comment: We can tell you that an octae is meant to have twice the fundamental frequency, so that it enhances maxima of the fundamental frequency when played in phase, that the ear recognises it as the same note... but as said, it's not clear what you're asking.
Comment: Oh thanks this is what I want to know ( to enhance the maxima )
Comment: But I really cant understand something :(I know the difference between harmonic and octave and both enhance the maxima but why do both concepts exist
Answer: One octave is a factor of two in frequency. The importance of it is when you study sound generated by a string that it pinched at both ends, or a pipe that is open at both ends, the main frequencies it generates will be at its fundamental (lowest) frequency and one octave up (the first harmonic). Higher frequencies that are integer multiples of the fundamental will also be present, but to a lesser extent.
A musical instrument generates the frequencies it does because it has a resonant response to them. So, when produce any of the harmonic frequencies the instrument responds to by some other means, the instrument will vibrate in response. It is in that sense that the sounds are similar.
The other factor to consider is a phenomenon called "beat frequency". Here's a video demonstrating both resonant response and beat frequency. What's happening is that the effects of the wave in air literally add up. Sometimes, when both wave peaks and troughs line up, they produce a louder sound. Other times, when the peaks of one wave are lined up with the troughs of the other, they cancel each other out. Because their frequencies are different, they alternate between the two states, producing a "beating" change from loud to quiet. This happens at a rate fixed by the difference in the two tones, called the "beat frequency".
When the beat frequency is lower than the lower limit of human hearing, it sounds like a modulation in loudness of an audible tone, as in that demo. When it is within the realm of human hearing, the beat frequency will sound like a tone. If you use an audio program, like Audacity, to generate a 250 Hz tone and a 350 Hz one, and play them simultaneously, you'll hear pitch power than either, concentrated at about 100 Hz (the beat frequency). It won't sound like a pure tone, though, it'll have a rougher feel to it. That's not accidental. Human screams and other animal alarm calls are known to oscillate rapidly in loudness, so hearing a moderately high beat frequency triggers unpleasant feelings in us.
Why bring up beat frequencies at all? Well, frequencies that are an octave apart produce a beat frequency at the frequency of the lower frequency tone, making a waveform that doesn't have so much of the rapid volume oscillations. Since such small integer harmonics (or near so) are an unavoidable part of generating any sound, they don't raise alarm bells in our psyche.
Now, what I've said here should not be generalized too much, since we obviously enjoy hearing chords played during a musical performances that should, in this naive picture, produce dissonant beat frequencies.


Differences between Oracle Cloud for Industry vs Oracle Public Cloud?

Question: What are the major differences between Oracle Cloud for Industry and Oracle Public Cloud? I would like to know in what sense does Oracle mean the cloud is public.
Answer: Oracle cloud for industry has multiple cloud solutions( with their product bundles) targeted to specific industries like financial services, Consumer goods etc. Their public cloud is just like any other public cloud which means the platform or infrastructure provided by the cloud will run in oracle's data centers and not on say a company's datacenter which would then become private cloud. In case of a public cloud anyone is eligible to buy computing services and use it. You are only ensured logical separation and not physical hardware level separation.
Answer: OCI predates OPC.
OCI is a SaaS offering from Oracle lines of businesses such as Retail, Health Science, Finance, etc.
OPC on the other hand is general purpose cloud which could be just the VMs (IaaS) or Database/App Server/Fusion Middleware (PaaS) or an ERP product like HCM (SaaS).
OPC is self service - you just sign up for a service and you manage it entirely once you have access.
OCI is managed by Oracle.


How to add dropbox to file selection dialog box

Question: I use dropbox very often and I have it installed in both windows and ubuntu.In windows,a shortcut to the dropbox folder is added automatically to the left panel of file/folder selection dialog box.
Now,how do I add this to ubuntu?I am running 15.04 btw.
Answer: Thanks for asking the question; it made me realize I didn't have dropbox bookmarked on this system.
Open dropbax (the folder in Ubuntu).  In the top right corner you will see what I call the I/O gear.  Below that is another gear.  Hover over it and it will announce itself as "Location options."
Left-clicking on that gear will open a menu.  One of the items will be "Bookmark this location" about 2/3 of the way down.  The keybord shortcut is referenced Ctrl-D.
I should mention that I am using the Gnome desktop with Ubuntu 14.10.


Geometry objects disappear

Question:

In version 3.0 have Christmas lights connected to the leaves of my tree with geometry nodes. In the modifier it says "no group output attributes connected." When I apply the geometry node, my lights disappear. How do I fix this? I would also like to know how I add a second group of objects to the tree to add ornaments, with geometry nodes. Thanks.
Comment: Related: https://youtu.be/VynJrxedBuQ
Answer: One option is to make the instances real by pressing  Ctrl + A > Make instances real.
You need to have your main object (the one that contains the geometry nodes) selected and the mouse needs to be over the viewport.

Edit 1: The "Make instances real" works, but not as in 2.93, so my answer is not 100% correct.
Instead of making the instances like in geometry nodes, now makes instances per vertex.
It's already reported as a bug, but I'm not sure if this is the new intended way to work
Edit 2: According to a repost from a developer (bug report) it's already tracking the way this works (because of the primitives inside GEo-Nodes) but for now, the trick is to click on the checkbox As Instance inside the Object Info node, Before you try to make it real (tried and works).
Comment: I just edited my answer and added an animated gif
Comment: @JustMe I added another edit at the end to make it work correctly
Comment: Can you edit your question and add all the steps and issues with some screenshots so it's easier to see
Comment: Edit your question to add more info and images instead of adding a lot of comments, it's better, specially if someone else wants to add a new answer based on your descriptions. the only way to add an image here is with a hyperlink like imgur
Comment: You just need to select your mesh, put the mouse on top your mesh and press CTRL + A, a menu will show up and at the bottom, you will see "Make instances Real" (As i explained). Make this exercise: Open a new Blend File, add a Sphere, select the Sphere, put the mouse on top of the sphere and press CTRL + A > "Make instances Real". I can't really explain it simplier than that, and i will really tell you with all the respect, that you are not reading what we put, so we could be able to help you. EDIT YOUR MAIN QUESTION WITH MORE INFO AND MORE IMAGES, INSTEAD OF ADDING MORE COMMENTS.
Answer: I assume that you are using collections, (but this probably holds if you are just using simple object for your instance).
I had this problem and I realized that I had moved my collection that I was using as the instances so the Collection info node did not know where the asset was.

So just go into you Collection Info node and choose your assets again. (Or dump the Collection Info node ) and drag in your assets (the instance you want painted over your mesh) and hook it up to the instance on points node.
(Haven't posted here before not sure if the image I have supplied will appear correctly)

Geometry objects disappear


What's difference between 开始 / V+起来?

Question: What is the difference in sentences when we use 开始 and 起来 with action?
Answer: 开始 means "begin" and "start" - 开始(start/begin something), 开始工作/工作开始(start work), 开始考試/考試开始(start the examine).
起来, when used alone, means "stand/get up". It is usually preceded by a verb to demand the "beginning and continuation of the action indicated by the verb" - 動起来(start moving), 跳起来(start jumping/dance), 唱起来(start singing).
Note that the two can be used together with the former as redundant - 开始動起来, 开始跳起来, 开始唱起来.
Comment: Could you please also clarify the difference using the same verb perhaps? Eg 开始工作 vs 工作起来
Comment: 工作起来 is the incorrect phrase to urge people to start work, you should say 开始工作. As mentioned, a verb shall precede the term "起来", not a noun (工作).
Comment: That's not right - 工作 is also a verb. It's true that 开始 can be used with nouns, but the question is about when to use 开始 with verbs. Both 开始 and 起来 are commonly used with verbs. So the difference lies elsewhere.
Comment: 开始唱 and 唱起来 both are correct phases, the difference is that 开始唱 gives the simple order/signal to start singing, 唱起来 demands the participants put extra effort into signing, similar to "singing louder". On the other hand, 唱开始, and 起来唱 both phrases are wrong. I think from here you can figure it out.
Comment: That's right, I agree. Thank you for clarifying that.

What's difference between 开始 / V+起来？


What is Credential forwarding attack?

Question: What is credential forwarding attack? Does this happen only when the client connects to two servers with same credentials?
Comment: Do you have link where you heard the reference?
Comment: @NeilSmithline In FAQ section of https://technet.microsoft.com/en-us/library/security/974926.aspx
Comment: The Microsoft description suggests that they're talking about an attack more commonly called pass-the-hash - not sure why they used a strange name though...
Answer: Generally, and from what I've personally encountered in the wild / in my job, a "Credential Forwarding Attack" is form of attack that occurs when an end user attempts to connect to a legitimate service / website, but instead connects to a site owned by an attacker. The user then enters their valid credentials into the fake website, which is then both stored by the attack for future impersonation of the end user, and then "forwarded" to the real website so that the end user is able to access the website so as to not raise suspicion from the end user.
For example, say I own www.bankofammerica.com (note the typo), and I send you some phishing email asking you to review potentially unwanted purchases from your account. You click on my legitimate looking link, enter your info into my fraudulent "Bank of America" homepage and login panel, while my sites scripting forwards that info into a real BoA login in the background. Now you click "login" and I get your online banking creds, and you get forwarded to the real Bank Of America page, none the wiser.

What is Credential forwarding attack?


Would it actually be bribery for Congress to "bribe" the President?

Question: Congress could "bribe" the President to sign a bill by including a Presidential pay raise in it, although the raise would not take effect until after an election (i.e. only works in the president's first term and only if (s)he is reelected). Legally, would that be bribery?
Comment: Even if it were, which is patently absurd, the Speech and Debate Clause would mean that no member of Congress could be punished for it.
Comment: @NateEldredge good point about the Speech and Debate Clause, but why would it be patently absurd for it to be illegal to use monetary incentives to influence a government official's decisions? The only difference here is that it's another part of the government doing it using taxpayer money, which arguably makes it even more unethical than "normal" bribery.
Comment: It seems to be routine that Presidential salary increases are included in a larger appropriations bill.  Check the citations listed for [3 USC 102](https://www.law.cornell.edu/uscode/text/3/102).
Comment: Oh, and not only could Congress not be punished for offering the "bribe", the President also could not be punished for accepting it.  Unless Congress is going to impeach the President for accepting a "bribe" which they themselves offered?  The absurdities are piling up.
Comment: I'm not sure how to actually answer this question except to say "this is obviously not the intent of the bribery statute".  If it had ever been tested, i.e. if the Justice Department had tried to prosecute the President, or all of Congress, for such a "bribe", or if Congress had impeached a President on that basis, I assure you that you would have heard about it.  So I presume that no court has ever needed to spend time considering this argument, and most likely they never will.
Answer:
Legally, would that be bribery?

No. It is not conditioned on that individual engaging in conduct to perform the office any differently, and Congress is expressly authorized to do so by law.
Equally important, Congress can't be guilty collectively of a crime, and individual members of Congress are absolutely immune from civil and criminal liability for their official actions under the Speech and Debate Clause of the U.S. Constitution.


Android SharedPreferences

Question: I have 3 webviews in my search engine app.When the user enters his query, by default he gets Google results, followed by yahoo and Ask buttons at the bottom, on clicking either of them, he gets results for that query from those sites. Now I want to give the user the privilege to change the default result site. I have created 3 radiobuttons. Upon confirmation, say he chooses Yahoo, how can i set it as Yahoo till the next time he changes it to some other site,
Answer: Accessing data from SharedPreferences:
SharedPreferences sharedPref = getSharedPreferences("FileName",MODE_PRIVATE);
String webViewChoice = sharedPref.getString("userChoice","null");

if no choice was saved (in the case when the application is running for the first time), you'll get "null" in webViewChoice.
use this condition as you wish
Saving data in SharedPreferences:
SharedPreferences sharedPref = getSharedPreferences("FileName",MODE_PRIVATE);
SharedPreferences.Editor prefEditor = sharedPref.edit();
prefEditor.putString("userChoice",usersChoice);
prefEditor.commit();

I hope it helps.
Answer: Save the user's preference as default-engine=google by default in a shared preferences file.
On app loading, read the file and set the default engine during the app runtime. When user chooses a different engine as default, then update the preferences file.
Hope this helps.

Android SharedPreferences


What function does this device perform better than a flat, horizontal bench?

Question: I am curious to understand the engineering and design principles behind this device, which I will refer to as the half-assed rest, because it seems to be an inferior design of a normal chair or bench. It seems to be designed explicitly to be hostile to the homeless by being designed this way, but perhaps I'm wrong in my assumptions about its intended function.
Answer: You are unfortunately most likely correct, and your description even grazed right by the official terminology for such things: hostile design/architecture.
As other answers have mentioned, such a design has some benefits. However, given that hostile architecture is a formal policy in many cities, I'd wager these benefits are more of a post-hoc rationalization, with the actual intent being to discourage their use by homeless people.
Comment: @SolarMike yeah, I've seen those. What I meant is merely that the thought process in designing these "perches" was probably "ok, we need a bench here. But we don't want homeless people sleeping on it, so it can't be a bench. Hmmmm... well, there's these perches people can lean on and we can say we chose them because they're better for your posture!"
Comment: "post hoc" no, there was a design of work stool that had the same butt support with a matching angled knee rest popular some 10 or 15 years ago. usually had caster wheels and I want to find another ...
Comment: The design concept is much older than 10-15 years: it occurs in the 17th-century chapel at [Littlecote House](https://en.m.wikipedia.org/wiki/Littlecote_House), where its purpose is [said](https://pennypost.org.uk/2018/08/quick-tour-littlecote-house/) to have been to prevent members of the congregation from falling asleep during sermons.
Comment: Could one perhaps say that all three examples have in common that they're attempts to use a kludge at the conceptual design or embodiment design stage to work around a specification that is not a valid operationalization of the desired outcomes - since (what I hope are) the desired outcomes would be better served by designing decent, affordable, quick-to-build, planning-and-building-regulation-compliant homes, more stimulating sermons, and an organizational structure that gives @SolarMike a more humane workload?
Answer: Sometimes concerns such as discouraging use of the bench for purposes such as loitering or being taken over by homeless guide the design.
Also it is hard to leave a possible hazardous package on the bench covered by a rag. And if they are left somewhere on the ground it will catch the eye.
This is an efficient way of temporary comfort for a passenger till their ride arrives.
Unfortunately in many metropolitan areas the problem of homeless people is spilling over into parks, parking lots, sidewalks.


How to rollback a specific directory in ZFS snapshot?

Question: Is it possible to rollback to a certain directory within a snapshot? For example, given the snapshot tank/home@snapshot_week_01 can I rollback to something like tank/home/louis@snapshot_week_01 without rolling back all of the other files directories within tank/home?
Answer: In this case I would go to /tank/home/.zfs/snapshot/snapshot_week_01 and pull out the data you need.
See Displaying and Accessing ZFS Snapshots on Oracle's website for details.
Answer: To answer the question "Is it possible", the answer is no. ZFS snapshots have no concept of files, folders, or anything else, it is a block level snapshot of the entire filesystem.
You can however browse a snapshot and access individual files, as indicated in duenni's answer, or you can clone a snapshot giving you a second copy of the filesystem without rolling back the first.
Answer: The answer to the question as asked is no; snapshots are per file system and you can only operate on the whole file system when working with the snapshot. So if you roll back to a previous snapshot, that affects the entire file system.
The way to restore specific files or directories from a ZFS snapshot is to navigate into the snapshot directory and then copy the files out of the snapshot, using something like cp -av snapshotfile /home/louis/myfile.
Comment: Many thanks! I didn't really understand duenni's answer until reading yours and @dasdfdsaq's. But looks like yours was a tiny bit later!
Comment: @Louis You're welcome; I'm glad I was able to help. (And while it's certainly your choice which answer to accept, you shouldn't feel pressured into accepting the answer that came first. Instead, you should accept the one that *you* found most helpful *to you*.)
Comment: P.S. With a properly configured Samba setup on top of ZFS on Linux, you can also right click on a folder from a Windows client and use the "Previous versions" functionality
Comment: I have come accustomed to using `rsync -a` for this use case. If only a few files in a directory have changed since the snapshot, this prevents from copying more data than necessary. Deleting and re-creating a file with the same content will allocate additional storage.


chromecast worked well for a few days, but now buffers constantly

Question: I received my chromecast and it worked well for a couple of days. I watched full length films on Netflix and rocked out for hours on G music. Then suddenly, it started buffering every few seconds. I've tried resetting to factory defaults, but no luck. This leads me to believe that the issue it's in the router/chromecast communications or the chromecast hardware failed. I still have connectivity since it will try to play the movie or song, but stops often. I also have enough bandwidth since my phone handles it no problem. How can I debug the issue? Are there any suggestions for setting my home router?
Comment: I don't know what you mean by a different browser? To be clear this is for the chromecast device, not the chrome browser. My phone can stream without issue using the same wifi network the chromecast is on.
Answer: The issue was with WiFi conflicts in an urban setting.
The biggest difference in bandwidth came with disabling N on my router and forcing it to stick to B/G. From my reading this helps since N attempts to grab 2 channels worth of bandwidth, fails, then tries a single one. With over 100 networks in the area, it probably never got 2 channels for N and constantly rolled back to G equivalent anyway, but only after failing.


Entity Framework 4 usage with Oracle Db

Question: Are there any known issues of EF usage with Oracle database? Are there any key points I should  specially pay attention? Share your toughts and experience please?
Answer: Devart dotConnect for Oracle allows you a direct access to the Oracle database without Oracle client installation.
Answer: You will need to use a 3rd party EF provider to talk to Oracle, this may cost money.
All of the EF examples asume you are using Sql Server
Answer: Most EF implementations for Oracle require the deployment of the Oracle client in order to use some or all of the available features. Look for an implementation that is 100% managed for support of all features in order to avoid the performance bottlenecks, memory leaks, and deployment headaches this type of implementation can cause.

Entity Framework 4 usage with Oracle Db


Reading recommendations for target tracking?

Question: I'm a software engineer working on Deep Learning, but mostly for NLP. I have a Raspberry Pi 3 and some cameras and wanted to play around a bit with target tracking (implementing models from scratch in TensorFlow, not using OpenCV or similar), i.e. actually understand the techniques. What are currently the most important papers in this area? I was unable to find any good reading list for this topic and there are enough papers that starting out it's hard to know which techniques to focus on.
Comment: SISR (sequential importance sampling resampling) technique may be a good starting point. You can check this one: "A Tutorial on Particle Filters for Online Nonlinear/Non-Gaussian Bayesian Tracking". (2002 paper, quite old now).
Answer: Start with the best.
The results of the ILSVRC 2017 competition were released yesterday (July 17, 2017).  The winner in the two tracking categories, Task 3c (Object detection/tracking from video with provided training data) and Task 3d (Object detection/tracking from video with additional training data), was this team:
Jiankang Deng(1), Yuxiang Zhou(1), Baosheng Yu(2), Zhe Chen(2), Stefanos Zafeiriou(1), Dacheng Tao(2), (1)Imperial College London, (2)University of Sydney
Here are their publications, source code, and a presentation:
[1] Deep Feature Flow for Video Recognition
Xizhou Zhu, Yuwen Xiong, Jifeng Dai, Lu Yuan, and Yichen Wei, IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
[2] Flow-Guided Feature Aggregation for Video Object Detection, Xizhou Zhu, Yujie Wang, Jifeng Dai, Lu Yuan, and Yichen Wei. Arxiv tech report, 2017.
Presentation
https://www.youtube.com/watch?v=J0rMHE6ehGw
Source Code
https://github.com/msracver/Deep-Feature-Flow
The code has the following prerequisites:

Python 3.2.0+
Microsoft's MXNet
Cython
OpenCV (Python bindings)

Their code requires a GPU with at least 6GB of memory.
Another option is ROLO.  The author is Guanghan Ning and he uses You Only Look Once (YOLO) for detection and uses TensorFlow to implement LSTMs for tracking.
His published a paper:
Spatially Supervised Recurrent Convolutional Neural Networks for Visual Object Tracking, IEEE International Symposium on Circuits and Systems, 2017
His code is here: https://github.com/Guanghan/ROLO
Project page: http://guanghan.info/projects/ROLO/
Prerequisites:

Python 2.7 or 3.3+
TensorFlow
Scipy
OpenCV (Python bindings)

Some videos of his work:

ROLO example on unseen sequence: Surfer
ROLO example on unseen sequence: Boy
ROLO example on unseen sequence: Jumping


Why don't professional lawn scarifiers have moss removal tools?

Question: Why is it that professional lawn scarifiers don't have these moss removal tools?:

The cheap ones have, but the expensive petrol powered Stihl and AL-KO doesn't. Husqvarna doesn't have a petrol driven to compare with.
Answer: The Stihl you linked to claims to remove moss; it appears to have 6 settings to raise or lower the scarification, so it's  possible that one  or two of those settings is better at removing moss, but this is a question for the manufacturer really. The AL-KO does not mention moss removal, and again, whether it's intended to remove moss or not is a question for the manufacturer.
In my experience, mechanical scarifiers do scrape off moss as well, provided the lawn has been cut beforehand.
Comment: I decided to contact AL-KO and posted it.
Answer: I decided to contact AL-KO and they told me, that the moss removal tool is for lite removal that is not ment to even touch the ground and hence the weed roots are not removed.
Scarification is the prober way and professionals only do that.
As a side note, they mentioned the cut level should always be at number 1 or 2. It is only set higher (deeper) when the blades are worn down.