iPad mini will not turn on

Question: I can not get my iPad mini to turn on. I have tried to press the home and power button simultaneously but that doesn't work and when it is attached to the charger I hear the charge ding sound. What went wrong. It worked the night before and I did turn it off like I do every evening.
Answer: Try this sequentially:

Plug this iPad to the charger and leave it there for an hour or two. Should it be depleted of its battery this will recover it.
Plug the iPad to your computer and attempt to enter the DFU mode. If your device shows up in iTunes in recovery mode and if you are willing to lose all data on it, restore with latest version of iOS and you may put it back into service.
If none above worked, pay a visit to Genius Bar and have the Geniuses have a go at it.

iPad mini will not turn on


Nand flash package size

Question: Why nand flash memory comes in "large" package sizes?
Even in TSOP, package is too wide and "big".
Comment: Suggest you be more specific about what is "large" and "big".  Several NAND flash manufacturers make 16Gbit+ capacity components in 9x11mm packages.  "large" and "big" are relative terms.
Answer: Well the obvious answer is people must still be buying them.  What is good for you might not be good for the next guy.  Some people don't want to mess with bgas in assembly.  Maybe they require 100% visual inspection of the joints.  Maybe the engineer does have the space and appreciates that he/she can solder it on or off themselves.
Not every project requires or even should use the highest density smallest parts available.
Answer: High capacity flash chips require a lot of die area to store the memory array, but they don't need a whole lot of pins because they aren't all that fast, hence the standard flash package with the pins the short sides. Using a standard package means the chip can be swapped out without redesigning the board. Modern flash chips may have a high enough density to come in smaller packages as well, but the larger standard packages are probably still used often enough to justify releasing chips those packages.

Nand flash package size


After Server update SP Config Wizard failed to connect SQL Server

Question: After Server update I have run SP Config Wizard and it failed to connect sql server. How to fix this issue? Thanks.
Comment: Can you please mentioned, what issue you are getting.
Comment: unable to create a Service Connection Point in the current Active Directory domain. Verify that the SharePoint container exists in the current domain and that you have rights to write to it.
Microsoft.SharePoint.SPException: The object LDAP://CN=Microsoft SharePoint Products,CN=System,DC=abcdef,DC=com doesn't exist in the directory.
   at Microsoft.SharePoint.Administration.SPServiceConnectionPoint.Ensure(String serviceBindingInformation)
   at Microsoft.SharePoint.PostSetupConfiguration.UpgradeTask.Run()
Answer: If you are an Active Directory administrator, creating a service connection point container will resolve the problem.
If not, you can run this command line:
psconfig -cmd upgrade -inplace v2v -passphrase "Type your Farm Pass Phrase" -wait
Reference:
http://www.sharepointdiary.com/2015/11/psconfig-failed-unable-to-create-a-service-connection-point-in-the-current-active-directory-domain.html


Embedding as a subgroup

Question: Suppose I am given two finite groups $G$ and $H$ (not too large: let's say their orders are around $10000$ and $100$ respectively, and the order of $H$ divides the order of $G$).  These may be represented as groups of permutations with known, fairly small, sets of generators.  I would like to find, if possible, a subgroup of $G$ isomorphic to $H$.  And if this is not possible, I'd like to find a subgroup $K$ of $G$ with a homomorphism of $H$ onto $K$ having as small a kernel as possible.
How could I go about this?
Comment: @AlexanderGruber If I'm reading your idea correctly, this might miss some subgroups $K$ in the case that $G$ contains no isomorphic copy of $H$.  Could there not be a homomorphic image $K$ of $H$ in $G$ that is not contained in any subgroup of $G$ whose order is $\mid H\mid$?  I don't immediately see any reason this could not happen.  If I'm right, then you'd need to actually survey the subgroups of $G$ whose order divides the order of $H$, or whose order is equal to the order of some quotient of $H$, if those could be pre-computed. (Probably worthwhile for groups of order around $100$.)
Comment: @James Ah, absolutely, you are right.  I will leave my old comment up so others can avoid this error.
Comment: This is probably an unsatisfying answer, but my first instinct would be to compute a list of conjugate representatives of subgroups of $G$ which have order $|H|$.  Then, one by one, build homomorphisms from $H$ to each representative, while keeping track of the smallest kernel so far (and breaking if any kernel is trivial).  Of course, as soon as your smallest so far kernel's order got small enough (prime order for the smallest appropriate prime, for example) you could start checking only for isomorphisms.
Answer: There are several ways you could attempt this, and finding the most efficient method for the types of groups you are interested in might require some experimentation. One way would be to start by finding all (conjugacy classes of) subgroups of $G$ of order dividing $|H|$ and then test them in decreasing order of size for being quotients of $H$.
My inclination would be to try first the simple-minded method of just computing all homomorphisms form $H$ to $G$. I tried that in Magma with a couple fo groups and it worked very quickly. There is a Magma function ${\mathtt {Homomorphisms}}$, which computes the homomorphisms from a finitely presented group to a finite group, up to conjugacy of the image. It finds surjective homomorphisms by default, but there is an option to turn that off. Here is a randomish example with $G$ a simple group of order $20160$ and $H$ a group of order $120$.
I am sure you can do a similar computation in GAP, but I am slightly less familiar with the relevant functions, so I expect someone else could help you with that. Or you could write to the GAP forum mailing list.
> G:=PSL(3,4);
> H:=SmallGroup(120,30);
> H:=FPGroup(H);
> time homs:=Homomorphisms(H,G:Surjective:=false);
   Time: 0.220
> [ Order(Kernel(h)) : h in homs ];
  [ 120, 60, 60, 20, 60, 30, 30, 30, 30, 30, 30, 30, 30, 12, 12, 15, 15,
    15, 15, 15, 15 ]

So in this example, computing the homomorphisms took $0.220$ seconds, and the smallest kernels have order $12$.
Here is another example with the same $G$:
> H:=SmallGroup(120,5);
> H:=FPGroup(H);
> time homs:=Homomorphisms(H,G:Surjective:=false);
  Time: 0.040
> [ Order(Kernel(h)) : h in homs ];
  [ 120, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]

The group $H$ there was ${\rm SL}(2,5)$ and it has found homomorphisms to $A_5$.
In fact I see now that $G$ has no subgroups of order $120$, so perhaps this was a bad choice!
Added later: I have experimented some more, and I see now that the approach above is too naive and works very badly for some types of groups $G$. I tried
>   G:=DirectProduct(SmallGroup(100,2),SmallGroup(100,5));
>   H:=SmallGroup(100,4);

and the homomorphism computation did not finish in ten minutes. However, the alternative approach of first finding the subgroups of $G$ of order dividing $|H|$ worked fine. Here is how I did that.
> S := [s`subgroup : s in Subgroups(G : OrderDividing := Order(H)) ];
> S := Reverse(S);
> H:=FPGroup(H);
> for s in S do
    homs := Homomorphisms(H,s);
    if #homs ne 0 then "Found homomorphism, kernel size", #Kernel(homs[1]);
      break;
  end if; end for;
Found homomorphism, kernel size 25

Answer: To complement Derek's answer with an example in GAP, the first three blocks of commands from above look almost identical. Note that H is taken in the polycyclic representation (if one need an fp-group, in GAP the command would be Image(IsomorphismFrGroup(H):
gap> G:=PSL(3,4);
Group([ (3,4,5)(7,9,8)(10,14,18)(11,17,20)(12,15,21)(13,16,19), (1,2,6,7,11,3,
10)(4,14,8,15,16,20,13)(5,18,9,19,21,17,12) ])
gap> H:=SmallGroup(120,30);
<pc group of size 120 with 5 generators>
gap> homs:=AllHomomorphismClasses(H,G);; time;
235
gap> List(homs, h -> Order(Kernel(h)));
[ 120, 60, 60, 15, 15, 15, 30, 30, 30, 60, 30, 30, 15, 15, 15, 30, 30, 30, 12,
  12, 20 ]

Next, one could use GAP function AllHomomorphism, but it may be more efficient to use AllHomomorphismClasses which will returns representatives of all homomorphisms from $H$ to $G$ up to $H$-conjugacy:
gap> H:=SmallGroup(120,5);
Group([ (1,2,4,8)(3,6,9,5)(7,12,13,17)(10,14,11,15)(16,20,21,24)
(18,22,19,23), (1,3,7)(2,5,10)(4,9,13)(6,11,8)(12,16,20)(14,18,22)(15,19,23)
(17,21,24) ])
gap> homs:=AllHomomorphismClasses(H,G);; time;
97
gap> List(homs, h -> Order(Kernel(h)));
[ 120, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]

The Small Groups Library is included in both GAP and MAGMA. It's crucial that not only the syntax is similar, if not identical, but the numbering is the same:
gap> G:=DirectProduct(SmallGroup(100,2),SmallGroup(100,5));
<pc group of size 10000 with 8 generators>
gap> H:=SmallGroup(100,4);
<pc group of size 100 with 4 generators>

For the last part, one could use LatticeByCyclicExtension to give the upper bound on the order of the subgroup, or use SubgroupsSolvableGroup with several kinds of SizeConsiderFunctions. If I will just use SubgroupsSolvableGroup without any constraints, it takes me 40 seconds to run through all representatives of conjugacy classes of subgroups of $G$ and all classes of homomorphisms to find all possible kernel sizes (time is the CPU time of the last command in milliseconds):
gap> S:=SubgroupsSolvableGroup(G);;
gap> S:=Reversed(S);;
gap> kernelsizes:=[];
[  ]
gap> for s in S do
>     homs := AllHomomorphismClasses(H,s);
>     for h in homs do
>       AddSet( kernelsizes, Size( Kernel( h ) ) );
>     od;
> od; time;
39546
gap> kernelsizes;
[ 25, 50, 100 ]

Now an alternative approach which uses LatticeByCyclicExtension and looks only for the subgroups of order dividing 100:
gap> l:=LatticeByCyclicExtension( G,
> function(G) return Size(G) in DivisorsInt((Size(H))); end);
<subgroup lattice of <pc group of size 10000 with 8 generators>, 722 classes,
722 subgroups, restricted under further condition l!.func>
gap> classes:=ConjugacyClassesSubgroups(l);;
gap> S:=List(classes,Representative);;
gap> Set(List(S,Size));
[ 1, 2, 4, 5, 10, 20, 25, 50, 100 ]
gap> S:=Reversed(S);;
gap> for s in S do
>     homs := AllHomomorphismClasses(H,s);
>     phi := First( homs, h -> Size(Kernel(h)) = 25 );
>     if phi <> fail then
>         Print("Found homomorphism, kernel size 25 :\n", phi, "\n");
>         break;
>     fi;
> od;time;
Found homomorphism, kernel size 25 :
Pcgs([ f1, f2, f3, f4 ]) -> [ f3*f5, f3*f6, <identity> of ...,
  <identity> of ... ]
31

Thus, we found the first of such homomorphisms immediately. Indeed, we have
gap> phi;
[ f1, f2, f3, f4 ] -> [ f3*f5, f3*f6, <identity> of ..., <identity> of ... ]
gap> Size(Kernel(phi));
25

Comment: Excellent!  I already accepted Derek's answer, but I ended up using GAP (because it's free) rather than Magma.
Comment: @RobertIsrael - Great, thanks!

Embedding as a subgroup


How to write a copyconstructor for a class which has HANDLE as a member in win32 c++ application?

Question: I have a HANDLE as member in my class say it is file handle got using win32 api , how do i handle it in copy constructor, does my class take responsibility of taking care of releasing it?
Answer: You're having this problem because you're trying to define a copy constructor for a class that contains an abstract resource (as opposed to a value). You'll have to decide what behavior you actually want from your copy constructor. Perhaps you don't even want the class to be copy-constructible in the first place.
For example, consider you class encapulates an opened read-only file. Then, it would make sense for the copy constructor to call DuplicateHandle (as suggested by Matt), and for the destructor to call CloseHandle. There will be no interference between an original instance and a copied instance, since you won't be writing the file.
On the other hand, if the class represents a temporary file, a different semantic may be desired - perhaps it would be useful for the copy constructor to copy the entire file, so that a copy of your class will not interfere with the original. Or maybe this behavior feels too implicit, and you decide the class won't have a copy constructor, instead you'll have to explicitly use a copy method.
So, unless you explain what exactly you're doing, and the manner in which you intend to use the class, there is no "right" answer.
Answer: You can use Windows API DuplicateHandle in the copy constructor if you want the handle to be copied, in this case, you call Closehandle if no longer using the handle.
Answer: DuplicateHandle probably makes the most sense here as others have suggested but since a HANDLE is basically a pointer you could also use a std::shared_ptr (or it's boost counterpart) with CloseHandle as the deleter. Then the handle can be copied around as much as you like and will be automatically closed when the last instance of your class is destroyed.
Just beware that the handle is shared so if you modify any of its associated state you change it for all you instances referencing that handle. If that's an issue I would duplicate it or disallow copying entirely.


What's the best graph database to start with?

Question: I'm planning on switching from RDBMS to Graph database, can anyone recommend what's the best tool for beginners?
Comment: Can you define "best"? What are you looking for exactly?
Answer: I wouldn't know what the "best" tool (Graph DB) for beginners is. They all have a certain complexity and learning curve - it's in the nature of graphs.
I have worked professionally with a few I would suggest you start with Neo4j. This is based on the extensive documentation and learning resources available for beginners. Besides, it ranks highest of all graph DBs on DB-Engines, so your newly learned Neo4j skills will not be wasted. You can download a free version for learning/practicing.
As an alternative, you could also look at ArangoDB. It is also well documented, and even includes a free certificate.
Whereas Neo4j is a pure Graph DB, ArangoDB is multi-mode and besides Graph also includes Document, Full-Text Search, Key/Value, and ML database functionality. ArangoDB has a free community version, too.


Asking about chapter's length

Question: Is it okay if a short story's chapter's length is 450 words? If so, could you also have a chapter with 1000 or more words in the same story?
Answer: Well, a short story should be around 1,000 - 10,000 words total. Also, short stories usually don't have chapters.
I will use some basic math to answer your question:
If you find it necessary to add chapters, and you stick with the chapter length of 450 words, you could have no more than 22 chapters (assuming every chapter is exactly 450 words and you are trying to get a maximum word count for short stories of 10,000 words).
One example of a novel is Harry Potter and the Sorcerer's Stone. Harry Potter and the Sorcerer's Stone had 17 chapters, totaling a  word count of 77,508 words. This would be on average 4559 words per chapter. So, if you stuck with around 22 chapters then you would technically have had more chapters than the Harry Potter example - but almost 4,000 fewer words per chapter.
It is true that the Harry Potter example is a novel, and you're writing a short story, but it doesn't matter. Why would you have more chapters with way fewer words each than a novel? Considering this, as I said before, I would personally stick with few or no chapters.
Here are some links to support what I stated above and to provide further readings on this subject:
Masterclass Wordcount Guide
Reedsy Blog: Chapter Length Matters
Answer: Yes! Personally I think you as the writer should know when a chapter is long enough. You have your reasons for their lengths and that's what needs be most important for a writer, that you have your reasons for the length. Someone will understand it.
Answer: You can do anything as a writer, if you do it well enough. With that said:

Short stories are not typically divided into chapters.
450 words would be extremely short for a chapter.
If you do have chapters, it's best to have them be of similar lengths.

So IN GENERAL I would recommend against this. But again, that's only playing the averages. I've seen writers do a good job with short stories divided into chapters, very short chapters, and chapters of inconsistent length. So the real question is --do you have a strong reason to do this, and can you do it well?
Comment: Yes...I have to divide it into chapters, plus, I want to submit it in Wattpad and it obliges you to divide the story. Anyway, thanks
Answer: Yes.
A chapter should have a point with no excess baggage going down a rabbit hole.
Some scenes need more description than others.
That said, most short stories do not have chapters at all.

Asking about chapter's length


Is there a way to disable post meta caching for development?

Question: I find that the post caching system is very inconvenient while I am developing plugins. I can't waste time waiting for the correct value of certain post meta to be displayed.  Is there any way to disable the post meta caching system completely or to at least change the amount of time between data refreshes?
Answer: There's no caching system in WordPress core that would cause the issues you're having.
The post meta cache (WP_Object_Cache) is not persistent. Its purpose is to ensure that meta data is only loaded once per page, not every time get_post_meta(), for example, is used, but it does not cache those queries across page loads. Therefore refreshing would be all that's required to get the new data. If post meta isn't updating immediately it would be because you're running a caching plugin of some kind, like W3, Redis, APC, Memcached. So the solution there would be to disable the plugin.
If you're not running any of those your host might be doing something on their end. In that case you'd need to talk to them.


Task list issue, how do I solve it?

Question: I've got an issue where all my SharePoint task lists have stopped sending automatic email notifications whenever a person is added to it. Why is this happening and how do i solve it?
Answer: Troubleshoot as following:

Investigate the user's permissions for the list, for the library, or for the task list. Make sure that the user account has at least Read permissions on the object. If these permissions aren't present, direct the user to the site administrator to have these permissions corrected.
If these permissions are present, create a new alert on a test library or on a test list. Perform an action to generate the alert. Then, wait 15 minutes. If the alert isn't received, collect the following information, and then contact Microsoft Office 365 technical support.
If the new alert is received but existing alerts aren't received, delete and then re-create all the user's alerts on the site.
If all alerts from multiple files or libraries are not delivered, visit the Service Health Dashboard from the Microsoft 365 admin center, Health, Service health to check for any advisories/incidents that may be occurring with SharePoint or Exchange. The issue could be with the SharePoint alert capability or delays in emails through Exchange. It will also be important to note whether other email is being delivered, and if not, the issue is likely with Exchange delays.

More information check the article: Users don't receive SharePoint Online alert notifications
Comment: Thanks, but i just disabled the notification setting of the list and then enabled it again, and it all started to work.
Comment: Thanks for sharing your solution with us.

Task list issue, how do I solve it?


Best way to assign simple product to configurable

Question: I have 15k simple products with custom options, is there any way to convert it in to configurable products?
Answer: I rembember that there was a module on a client's installation to convert the type of products but it was not really bugproof.
If you mean to convert each product into configurable, you will most probably have to do it through a custom script that will loop products to change the type with SQL queries. But, I think, you'd better create your configurable products and then attach the simple ones to them. It can be done automatically but it is difficult to tell how without a clear idea of the database.
Comment: Hi, I still wait for other answers
Comment: well, +1 from me :) thank you for sharing your knowledge for others
Answer: I had to do the same a year ago. I searched a lot as unfortunately, there is no way to do it by default. I'm not good in coding, so were looking over the web for alternative. I have found this video with a tool that converts simple into configurable and custom options dropdowns into attributes and associated products in drop-downs.
I had only 20 products with 2-3 options in each and they offered to do it as one-time service for $349, instead of buying whole application. If you have less goods, you can manually re-create them.


Indistinguishability Obfuscation : What are it's consequences on crypto?

Question: I was reading about the construction of IO using MIFE and compact FE . I am just curious to know what are the consequences if there exists an IO.
Comment: I think this question is too broad to answer, and answers would be based heavily on opinions because "consequences in general" is all but specific.
Comment: But I can't find any answer in wiki nor in Crypto.SE. I understand it's consequences on FE but what are there any crypto results that are solely based on IO?
Comment: **What research have you done?** I'm asking because sharing research efforts helps everyone! Tell us what research you did, what you found, and why it didn't meet your needs. That shows users you took time trying to help yourself, it saves us from reiterating obvious answers, and (most important) it helps you to get more relevant on-point answers. In case of doubt, you can start by searching this site for related Q&As that might shed light on your question. At worst it will help you frame [*"a better question"*](http://crypto.stackexchange.com/help/how-to-ask); at best it might even answer it.
Answer: Indistinguishability Obfuscation (iO) is a quite powerful tool, but its implications alone are really hard to tackle - as so often, the combination of different primitives enables us to do new and exciting things.
But before going into details, I am not sure if this is clear to you:

If you can use an algorithm $A$ (in your question that would be compact functional encryption) to get some interesting property $P$ (this would be the construction of iO), then this has no consequences for $A$ itself besides the obvious - that you can use $A$ to get property $B$.
Even if $P=NP$ is true, then iO would still exist. But it is also known, that public key cryptography and oneway functions would not exist. Generally speaking, $P=NP$ would be a nightmare for cryptography, because we would loose almost all of our building blocks. However, any construction/property from iO alone would still have to hold in a world where $P=NP$ - and the meaning of "security" is severely restricted there (or phrased differently: a lot of our current definitions would be invalid).

Regarding the general construction of IO in general, I suggest reading Survey on Cryptographic Obfuscation (2015, Horváth), which gives a decent overview. But here is a problem with iO:
The elephant in the room - Multilinear Maps:
The first construction by Garg et.al.in 2013 based ona primitive called multilinear maps - with a nice definition of their security. From that they build iO, but there was a problem: Multilinear maps in the way they defined them did not exist - and as far as a I know we only have constructions for limited versions of multilinear maps. So while their construction of iO is actually secure, we don't know if their assumptions actually hold for any construction.
In Obfuscation without the Vulnerabilities of Multilinear Maps (2016, Garg et.al.) this issue is adressed quite elaborately and proposes iO with multilinear maps without the known vulnerabilities. There are also other constructions of iO out there, but there are still open questions.
As for the current state of research: The topic is still relatively new and it is not fully explored. With iO we can achieve interesting constructions, for example deniable encryption, functional encryption, non-interactive zero knowledge arguments, etc. But all of those require some other assumption (which would be invalid in a world with $P=NP$) and build upon constructions with those. And as far as I know we don't have a construction which just uses standard assumptions.
The only way to get to know all the current research is by reading all related publications on the major conferences, I don't think there is any shortcut.
Answer: I think this is a very huge question. IO has been proved that it is a very strong tool in cryptography in constructing various cryptographic primitives, such as two-round secure computation, deniable encryption, universal samplers and so on. Also, researchers are still exploring its applications. I think currently the more intriguing problem is how to build IO from standard assumptions.


When should I create a new branch?

Question: I am starting a new project, and to experiment a little bit with the technologies used in the project (hello world examples...) I want to create something like a "playground" branch. Is it common to create a new branch "playground" or should I just create a folder named "playground" in the master branch?
Answer: You should create a new branch when you're doing development work that is somewhat experimental in nature.  So in your scenario definitely create a new branch and not a folder within master.  If you created your sandbox work as a directory in the master, it's going to reside there until you remove it using git.  Having dead code sitting in the master branch is not ideal by any means, since it can confuse other developers and may just sit there rotting for the lifetime of the application.
If your team were to experience a bug, you wouldn't want them to waste time exploring the experimental work to determine if the bug existed within that directory.  Creating a new branch allows you to isolate your changes from the master branch.  If your experimentation goes well you always have the option to merge your changes into the master branch.  If things don't go so well you can always discard the branch or keep it within your local repository.
Comment: "You should create a new branch ... " always, period.
Comment: Imagine my project is totally broken and now, I decide to rewrite the project entirely but all developments and improvements have to be in the same repo. Is It common to create a new branch (named like "re-creation") and then merge it to the main branch? If it's not, do you have any other suggestions about that scenario?
Answer: Branches have many uses, and it depends a bit on your workflow. Two commonly used workflows are:

github flow
gitflow

Both use so called topic branches to build new features in, which get merged back once ready / accepted.
Github flow is fairly simple, and is obviously what github uses. Gitflow is a bit more complex, and is more suited when you need to support several versions of an app, where hotfixes can be applied.
In the end, it's a matter of preference what kind of workflow you use, but because creating branches is very cheap in git, it doesn't really matter how many branches you create (and eventually, delete again).
Answer: You should consider creating new branches and work on them in these cases:-

When you want to work/test out something in a sandbox environment.
It is good practice to keep your commits short in nature So frequent commits from you might disturb others' development area So its better to complete your work on a branch and then later merge your branch into main branch. [Tip] Remember to keep your branch in sync with main branch by merging main branch into your branch frequently. So at later point of time, you don't have a lot of stuff to merge by hand.
You want to solve a bug. Its better to solve it on other branch and merge it later.
If your commit goes wrong/broke your build, the production build is not affected. So I prefer to use atleast two branches dev branch and prod branch. When everything is fully tested, merge your dev branch to production branch.
Answer: You should defiantly learn by experimenting but in a playground repo.
A playground directory in a repo will be  will less benefit.
Have a play, make some mistakes learn some things - delete it a few times and go wild.
e.g.
<code>$ mkdir playground
$ git init
$ touch hello-world
$ git add hello-world
$ git commit -m "my first commit"
$ git branch goodbye
$ git checkout goodbye
$ echo "goodbye" | cat >>hello-world
$ git status
$ git add hello-world
$ git commit -m "goodbye commit"
$ git merge master
</code>
I'd also reccomend grabbing a fork of an active project in the language of your choice from GitHub and give a go with merging, rebasing etc there with real code.
Answer: The common way is to use the master branch as live branch. Then you make new branches from the master and work on them (feature branches). After you have finished your work you merge the changes back to your master.
You can build new remote branches like a dev branch and merge your changes to this branch when you want only a preview. There are some methods but there are a lot of informations on google.
Branching and merging
Git branching model

When should I create a new branch?


How data movement from large register to small register works in VHDL?

Question: I went through a VHDL sample code for memory management. In that data from a 32 bit register was directly moved into a 8 bit register. My doubt it is how this data movement can happen? Is there is any default condition for VHDL for such data transfer?
Comment: The question is not entirely clear. In general, VHDL is not big on things happening by "default conditions" and very big on stating exactly what you want to happen.
Answer: The default behavior is to match up the bit indices, so if you have
signal reg32 : bit_vector(31 downto 0);
signal reg8 : bit_vector(7 downto 0);

reg8 <= reg32;

it is equivalanet to
reg8(7 downto 0) <= reg32(7 downto 0);

However, any decent VHDL compiler should give you at least a warning about the width mismatch.
Comment: IIRC, assignments between slices of different sizes are not legal, so the code would be in error (not simply a warning). Also, I believe the correct behavior would be for the VHDL tool to *ignore* the indices, and make the assignments between elements in left-to-right order. Would you confirm it?


How do I remove Elder Scroll: Dragon from my inventory?

Question: I recently completed the main storyline. Now that I've used the dragon elder scroll, I don't think I need it. However, the game says it's still a quest item and I can't drop it, stash it in one of my 20 unused storage compartments (thanks, Hearthfire!), or sell it to a vendor (I don't think it has any value, though). I have all 3 DLC add-ons, and I'm assuming that either it's a bug, or it's part of either Dawnguard or a side quest in Dragonborn (I've already killed Miraak).
Comment: It's not a bug, it's intended. Aequitas already gave an answer, personally, i removed it from my inventory and spawned it back into the world so i could decorate my house with it.^^
Answer: You can sell it to Urag gro-Shub at the College of Winterhold for 2,000 Gold.

Alternatively you can use the RemoveItem command;
Usage:
player.removeitem <ItemID> <#>

Description:
Remove an item from the inventory.

The item id for Elder Scroll: Dragon is: 0002D513 or XX0126DC in DawnGuard
Comment: isn't there one guy at fort dawnguard who also wants to buy the elder scrolls? or does he only want to buy the elder scroll: sun? not sure...
Comment: @WayneEra, The Moth priest, who resides at whichever castle you've joined forces with, will buy the Sun & Blood scrolls when you're done with the that quest line.  Folks who prematurely sell the Dragon scroll to the Orc Librarian before the end of the Dawngard quest-line will find they need to purchase it back for a significant markup.


Why are there .htaccess and php files in ./sites/default/php/twig

Question: Just wondering, it may be related to cache settings, but why are there lots of php and .htaccess files in the public:// dir?
Answer: The PHP files are compiled Twig templates and the .htaccess file protects them from public access. You can switch off the caching of compiled twig templates by setting this service parameter to FALSE.
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: true

You find this in sites/default/default.services.yml, which you have to rename to sites/default/services.yml to activate it.
Comment: i am using drupal as headless. So twig cached should be enabled or disable. I am getting continues  Warning: file_put_contents(sites/default/files/php/twig/5ec7c76bcb94c_menu.html.twig_ms5R93s-wUkYaDlrCxbz7FVzS/.htaccess): failed to open stream:. Can you help
Comment: development.services.yml:
parameters:
  twig.config:
    cache: false


What is the degree of a real closure of an ordered field?

Question: Given a subfield $F$ of $\Bbb R$, let the real-closure of $F$ be the smallest subfield of $\Bbb R$ which is real-closed and extends $F$. Since the theory of real-closed fields is complete, this is in fact equivalent to the elementary submodel of $\Bbb R$ generated by $F$.
And in fact if $K$ is the real-closure of $F$, then $K$ is an algebraic extension of $F$, since we only need to add roots for polynomials. Recall that one of the characterizations of real-closed fields is that $[\bar K:K]=2$, and therefore $[K:F]$ is either $1$ or infinite, otherwise $\bar K=\bar F$ is a finite degree extension of $F$ which is not $2$.
So, as a set theorist I am not satisfied by "infinite", of course. So I want to know what sort of infinities can be obtained.

The real closure of a countable field is a countable field, so it has to have degree $\aleph_0$. And in general, if $K$ is the real-closure of $F$, then $|K|=|F|$.

If $B$ is a transcendence basis for $\Bbb R$ over $\Bbb Q$, and $B'\subseteq B$, then the real-closure of $\Bbb Q(B')$ has degree $|B'|\cdot\aleph_0$, since for each $b\in B'$ we need to add countably many roots, but the cardinality of the real-closure equals to that of the field. In particular, it follows that the degree can be any infinite cardinal between $\aleph_0$ and $2^{\aleph_0}$ (including these two cases, of course).

Question I. Can $\Bbb R$ be the real-closure of a [proper] subfield $F$, such that $[\Bbb R:F]=\aleph_0$, or generally less than $2^{\aleph_0}$?

More specifically, consider $B$ a transcendence basis for $\Bbb R$ over $\Bbb Q$, without loss of generality $\pi\in B$. Consider $F_0=\Bbb Q(B\setminus\{\pi\})$ and $K$ the real-closure of $F_0$. Let $F=K(\pi)$, then $\Bbb R$ is the real-closure of $F$, since $B\subseteq F$. What is $[\Bbb R:F]$?

Question II. We can define real-closure for arbitrary ordered fields, not just subfields of $\Bbb R$, and it is unique up to isomorphism (since adding $\sqrt{-1}$ generates the algebraic closure).
Given an ordered field $F$, and its real-closure $K$, how can we determine $[K:F]$ from the properties of $F$?
Answer: Proposition 5 in https://arxiv.org/abs/2007.13550 (and the preceding paragraph) answers Question I.
There exists a proper subfield $F$ over which $\mathbb{R}$ is algebraic, such that $[\mathbb{R} : F] = \aleph_0$.


Intuitive argument for symmetry of Lorentz boosts

Question: The Lorentz boosts are represented by symmetric $4\times4$ matrices. Though the most general Lorentz transformations has no obvious symmetry property, can the symmetry (under transpose) of the Lorentz boost matrices be understood intuitively? Like, from considerations of principle of relativity (that the inverse transformation can be obtained by the transformation $v\leftrightarrow-v$).
Comment: The 3+1-Lorentz  boosts come from the 1+1-Lorentz  boosts by a similarity transformation, more exactly by a pure rotation in space. This similarity preserves the symmetry. So, we must think intuitively why the 1+1-Lorentz  boosts are symmetric.
Comment: Kind of relevant, in that I discuss the symmetry &  linearity of the Lorentz transformations: https://physics.stackexchange.com/a/562271/123208
Answer: I don't think that may be there exists any intuitive argument for the symmetry of Lorentz boosts. But at least I try to think as follows.
First consider the 1+1-Lorentz boost $\mathbb{L}_{_{2\times2}}$
\begin{equation}
\mathbf{X}'\boldsymbol{=}
\begin{bmatrix}
x'\vphantom{\dfrac{a}{b}}\\
ct'\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\boldsymbol{=}
\begin{bmatrix}
L_{11} & L_{14}\vphantom{\dfrac{a}{b}}\\
L_{41} & L_{44}\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\begin{bmatrix}
x\vphantom{\dfrac{a}{b}}\\
ct\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\boldsymbol{=}
\mathbb{L}_{_{2\times2}}
\mathbf{X}
\tag{01}\label{01}
\end{equation}
Since special relativity unifies space and time in an entity, an argument would be that the Lorentz boost \eqref{01} must be symmetric under exchange of $x$ and $ct$. So applying the matrix
\begin{equation}
\sigma_1\boldsymbol{=}
\begin{bmatrix}
\:\:0 & 1\:\:\vphantom{\dfrac{a}{b}}\\
\:\:1 & 0\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}\,,\qquad  \sigma^2_1\boldsymbol{=}\rm I
\tag{02}\label{02}
\end{equation}
on equation \eqref{01} we have
\begin{equation}
\begin{bmatrix}
ct'\vphantom{\dfrac{a}{b}}\\
x'\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\boldsymbol{=}
\begin{bmatrix}
\:\:0 & 1\:\:\vphantom{\dfrac{a}{b}}\\
\:\:1 & 0\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\begin{bmatrix}
x'\vphantom{\dfrac{a}{b}}\\
ct'\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\boldsymbol{=}
\overbrace{
\begin{bmatrix}
\:\:0 & 1\:\:\vphantom{\dfrac{a}{b}}\\
\:\:1 & 0\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\begin{bmatrix}
L_{11} & L_{14}\vphantom{\dfrac{a}{b}}\\
L_{41} & L_{44}\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\begin{bmatrix}
\:\:0 & 1\:\:\vphantom{\dfrac{a}{b}}\\
\:\:1 & 0\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}}^{\sigma_1 \mathbb{L}_{_{2\times2}}\sigma_1}
\begin{bmatrix}
ct\vphantom{\dfrac{a}{b}}\\
x\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\tag{03}\label{03}
\end{equation}
So we must have $\sigma_1 \mathbb{L}_{_{2\times2}}\sigma_1\boldsymbol{=}\mathbb{L}_{_{2\times2}}$ or
\begin{equation}
\sigma_1 \mathbb{L}_{_{2\times2}}\boldsymbol{=}\mathbb{L}_{_{2\times2}}\sigma_1
\tag{04}\label{04}
\end{equation}
The Lorentz boost matrix $\mathbb{L}_{_{2\times2}}$ must commute with the $\sigma_1 $ matrix (that the latter is a Pauli matrix is irrelevant here)
\begin{equation}
\begin{bmatrix}
L_{41} & L_{44}\vphantom{\dfrac{a}{b}}\\
L_{11} & L_{14}\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\boldsymbol{=}
\begin{bmatrix}
L_{14} & L_{11}\vphantom{\dfrac{a}{b}}\\
L_{44} & L_{41}\vphantom{\dfrac{a}{b}}
\end{bmatrix}
\tag{05}\label{05}
\end{equation}
From above equation
\begin{equation}
L_{14}\boldsymbol{=}L_{41} \quad \text{and} \quad L_{11}\boldsymbol{=}L_{44}
\tag{06}\label{06}
\end{equation}
So the matrix $\mathbb{L}_{_{2\times2}}$ must be symmetric with equal elements on the diagonal. Setting
\begin{equation}
\!\!\!\!\!\!L_{11}\boldsymbol{=}L_{44}\boldsymbol{=}\xi\ge 1 \:\:\texttt{(orthochronus)}     \:\text{and} \: L_{14}\boldsymbol{=}L_{41}\boldsymbol{=}\eta\stackrel{\det \mathbb{L}_{_{2\times2}}\boldsymbol{=+}1}{\boldsymbol{=\!=\!=\!=\!=\!=}}\boldsymbol{}\pm\sqrt{\xi^2-1}
\tag{07}\label{07}
\end{equation}
we have
\begin{equation}
\mathbb{L}_{_{2\times2}}\boldsymbol{=}
\begin{bmatrix}
\:\:\xi & \eta\:\:\vphantom{\dfrac{a}{b}}\\
\:\:\eta & \xi\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}\,, \qquad  \eta\boldsymbol{=}\pm\sqrt{\xi^2-1}
\tag{08}\label{08}
\end{equation}
Given that $y'\boldsymbol{=}y,z'\boldsymbol{=}z $  the corresponding $4\times4$ matrix is
\begin{equation}
\mathbb{L}_{_{4\times4}}\boldsymbol{=}
\begin{bmatrix}
\:\:\xi & \:\:0\:\:& \:\:0\:\:& \eta\:\:\vphantom{\dfrac{a}{b}}\\
\:\:0 & \:\:1\:\:& \:\:0\:\:& 0\:\:\vphantom{\dfrac{a}{b}}\\
\:\:0 & \:\:0\:\:& \:\:1\:\:& 0\:\:\vphantom{\dfrac{a}{b}}\\
\:\:\eta & \:\:0\:\:& \:\:0\:\:& \xi\:\:\vphantom{\dfrac{a}{b}}
\end{bmatrix}\,, \qquad  \eta\boldsymbol{=}\pm\sqrt{\xi^2-1}
\tag{09}\label{09}
\end{equation}
By a pure rotation in space we end up with a symmetric matrix for the Lorentz boost. To see how take a look in SECTION B of my answer as "user82794" here
Two sets of coordinates each in frames O and O′ (Lorentz transformation).
Comment: @Faber Bosch : Your are absolutely right. I'm afraid that I bring an a posteriori result through the back door. That's why I think that  there does not exist any intuitive argument for the symmetry of Lorentz boosts.
Comment: This is rather nice! I like the answer. But two comments: 1. "Since special relativity unifies space and time in an entity, an argument would be that the Lorentz boost" see, you're arguing from conclusion! That the special theory of relativity unifies space and time is concluded from Lorentz transformation itself. So a bit circular. But I think I may be able to motivate this physically. So that's all good. 2. The determinant has to be positive if the time intervals in the transformed coordinates has to be positive.
Answer: Here is one way of understanding the group of Lorentz transformations: It is comprised of essentially two types of transformations, rotations in 3 dimensions and boosts. Hopefully rotations are familiar, so I will focus on understanding boosts. Specifically, I will talk about the boosts in the $x$-direction because a boost in any other direction can be constructed by first rotating the direction we want to boost along to point in the $x$-direction, apply a boost along the $x$-direction, and then rotate back.
With these things in mind, Lorentz boosts are the unique transformations $L(v)$ which satisfy the requirements to form a group, and two other conditions:
a) Boosting by zero does nothing: $L(0)=I$
b) Boosting by $-v$ is the same as the inverse boost: $L^{-1}(v)=L(-v)$
c) Associativity (follows automatically from dealing with matrices)
d) Closure: For any two velocities $u,v$ there exists some other velocity $w$ (we don't make any claims on what it should look like) such that $L(u)L(v)=L(w)$
e) Boosting by $v$ from stationary should make us move with velocity $v$: $L(v)\left(\begin{array}{c}t\\0\end{array}\right)=\left(\begin{array}{c}t^\prime\\ vt^\prime\end{array}\right)$ for some $t^\prime$ (again, no claims on what it should be).
f) The final condition is equivalent to the following: Suppose $P$ is the parity matrix, meaning it negates all the spatial directions. Then we should have
$$
PL(v)\left(\begin{array}{c}t\\0\end{array}\right)=L(-v)P\left(\begin{array}{c}t\\0\end{array}\right)=L(-v)\left(\begin{array}{c}t\\0\end{array}\right).
$$
In other words, applying a boost to a stationary frame and then applying parity should be the same as just applying a boost in the opposite direction.
With these conditions, the generic form of a boost along the $x$-direction is completely fixed except for a free constant, which is equivalent to the speed of light (and taking this constant to infinity gives back Galilean boosts too!).
The requirements are stated somewhat differently, but the steps to actually compute the Lorentz boost from the above data can be found here.
Comment: This is a fair point, though the example of boosts along other directions requires us to be in more than one spatial dimension. So long as the initial arguments in my answer are accepted, we have restricted to a 1+1 dimensional case. Here I think we can argue as follows: suppose there are 3 frames A, B, C. If boosts in 1+1 were not closed, then B's observation that C and A are both inertial would not imply A observes C to be inertial. This consequence seems rather strange to me, but perhaps you have another perspective.
Comment: There are two things I don't like about this. 1) Closure of the Lorentz transformations under multiplication is a big assumption and I do not see whether it can be argued from principle of relativity alone. 2) Likewise the wikipedia link that you've shared shows explicitly that the principle of relativity implies $\det{\Lambda}=+1$ (see the equation $\gamma^2+v\delta\gamma=1$), so I don't see how the thing about parity, which has negative determinant, could be concluded from principle of relativity unless it is assumed.
Comment: Moreover, I was not actually asking for a derivation of the Lorentz boosts. My question is whether the transpose symmetry can be invoked from the first principles.
Comment: @FaberBosch Closure under multiplication is equivalent to the statement that boosting and then boosting again is no different than boosting once by some amount (we do not assume what this amount is a priori). Personally, I find this to be a very natural assumption, but this is not the only derivation. The parity requirement is indeed an additional assumption, but note it is only a statement about the action on a single vector, so there is no contradiction coming from the determinants. Finally, I think I have to ask you to clarify what "transpose symmetry" is then. Boosts are not symmetric.
Comment: "Closure under multiplication is equivalent to the statement that boosting and then boosting again is no different than boosting once by some amount (we do not assume what this amount is a priori)" I understand what closure is and it is not at all an obvious or simple assumption to make. For example, boost along two different directions are not closed. What makes you think that it would be closed if the boosts are in the same direction? (If not hindsight) The reason is not at all obvious. One must either provide solid intuitive reasoning for closure or assume it. The matter is not trivial.
Comment: Ok! But then the claim is that all the inertial frames are only connected by boosts. What if boosts are not closed, that is $A\rightarrow B\rightarrow C\not\equiv A\rightarrow C$ (arrow means boosts), but the transformation between $A$ and $C$ are still linear (meaning inertial). If one defines inertial to mean only boosts, then even translations will not preserve inertiallity. If that makes sense, I don't know.
Comment: I will have to think on this more, but certainly this is not the case in the low velocity limit. Given that additional piece of input data, there may be some continuity argument which extends "inertial frame" (meaning moving with constant relative velocity) to being an equivalence relation at arbitrary boost parameter. Perhaps this may feel like a cop out of you're looking to avoid as much experimental input as possible, but perhaps not. Nonetheless, it feels like failure of transitivity should lead to a contradiction in some way. Certainly closure follows if we involve the invariant interval.
Answer: As Frobenius says in a comment, drop to the 1+1-D case. One dimension of time $w=ct$, one dimension of space $x$.
Then you want to preserve the velocity of light and this means $\hat w\pm \hat x$ are eigenvectors of the Lorentz transform: orthogonal (in the Euclidean sense) eigenvectors with real eigenvalues. So it's Hermitian but it's real: so it's symmetric. Gives you the hint that it's not symmetric if you choose, say, $w=2ct$. But had you chosen $w=2ct$ the resulting matrix would still obey the inversion principle $L(v)L(-v)=I$ so that cannot be sufficient.
Now, that's kind of cheesy, you could say it needs to be "symmetrizable" in some sense, so let me give more substantial examples. First, the 2x2 rotation matrix by angle $\theta=\tan^{-1}(v/c)$ satisfies $R_\theta R_{-\theta}=I$, but $R_\theta$ is not symmetric. Second, the Galilean transformation matrix satisfies $G(v)G(-v)=I$ but it's not symmetric.
Looking at Richard Myers' answer these appear to satisfy in addition all axioms (a)-(f) and he gives a hint that the second example corresponds to an infinite speed of light, so it seems plausible that the first example is instead something like an imaginary speed of light?
Answer: The transformation matrix of the four-vectors in RR is:
$$
\Lambda^\mu_{\phantom{\mu}\nu} =
\pmatrix{ \gamma  &  -{\gamma \over c} \bf{v}  \cr
  -\gamma {\bf{v} \over c}   &  \bf{L}  \cr } =
\pmatrix{
  \gamma & {\gamma\over c}v_1 & {\gamma\over c}v_2 & {\gamma\over c}v_3  \cr
-{\gamma\over c}v_1 & 1+(\gamma-1){v_1^2\over v^2}  &   (\gamma-1){v_2v_1\over v^2} & (\gamma-1){v_3v_1\over v^2} \cr
-{\gamma\over c}v_2 &   (\gamma-1){v_1v_2\over v^2} & 1+(\gamma-1){v_2^2\over v^2}  & (\gamma-1){v_3v_2\over v^2} \cr
-{\gamma\over c}v_3 &   (\gamma-1){v_1v_3\over v^2} &   (\gamma-1){v_2v_3\over v^3} &1+(\gamma-1){v_3^2\over v^2} \cr }
$$
$\bf{L}$ is a space operator having eigenvectors $\parallel\bf{v}$ belonging to the eigenvalue $\gamma(v)$
and eigenvectors $\perp\bf{v}$ belonging to the eigenvalue $1$.
The symmetry of $\Lambda^\mu_{\phantom{\mu}\nu}$ depends on the symmetry $ (x\leftrightarrow ct)$
of the standard Lorentz transformations:
$$ {R^\mu}' = \Lambda^\mu_{\phantom{\mu}\nu} \, R^\nu \qquad\qquad
\pmatrix{ct' \cr x' \cr y' \cr z' \cr} =
\pmatrix{
\gamma & -{\gamma\over c}v & 0 & 0 \cr
 -{\gamma\over c}v & \gamma & 0 & 0 \cr
 0 & 0 & 1 & 0 \cr
 0 & 0 & 0 & 1 \cr }
\pmatrix{ct \cr x \cr y \cr z \cr}
$$
To understand this symmetry it's appropriate to derive the above result
with a method due (I believe) to Ignatowsky (1910).
It's easy to see that, to safeguard the concept of inertial reference system, the coordinate
transformation formulae must be pre-formatted (with one indeterminate parameter $\gamma$) as follows:
$$
\eqalign{
& x' = \gamma (x - vt) \cr
& y' = y  \cr
& z' = z  \cr
& t' = \gamma \left[t-\left(1 - 1/\gamma^2 \right){x\over v} \right] \cr
}
$$
The only relevant assumption needed to obtain this result is that the inverse transformations
are gained by changing the sign of time, ie by changing the sign of the  relative speed
of the refernce systems $(\bf{v} \leftrightarrow \bf{-v})$.
Consistently the velocity transformation formula results
$$ u' = {u -v\over 1 - \left(1-{1\over \gamma^2} \right){u\over v}} $$
Such formulas are independent of any principle of relativity.
For $\gamma = 1$ they provide Galileo's transformations.
Let us now ask ourselves if there can exist a velocity $c$ invariant, that is
having the same value in all inertial reference systems:
$\forall v: u' = u =c$.
For $u'=u=c$ that implies:
$$ 1-{1\over \gamma^2} = {v^2 \over c^2} $$
If $\gamma > 1$ this relationship gives us a positive real value for $c$.
In this way we obtain the Lorentz transformations in standard configuration,
which have the required symmetry $ (x \leftrightarrow ct)$.
Conclusion: if and only if we admit the existence of an invariant velocity
the transformation matrices are symmetrical.
Therefore the symmetry of the matrix $\Lambda^\mu_{\phantom{\mu}\nu} $ can be seen as an expression
of the postulate of constancy of the speed of light.


How to control 6v micro solenoid from arduino

Question: I want to control this solenoid from Arduino, but I am confused which transistors, resistors and diodes to choose. I have seen a lot of tutorials about controlling solenoid from Arduino, but all of them are for 12 volt solenoid or are using some relays which I don't want to use. I will be using 6 of these solenoids for my project.
Answer: Most of 12V solenoid tutorials would work here too, if you use just 6V instead of 12V. Post here links to some 12V tutorial, I will look at that and say you, if they are easy to adjust and how.
Or as last resort - your selenoid is rated 6V/0.35A - that is 17.14 Ohm, you can buy power resistor 17-20 Ohm with minimal of 7 Watt (can be much more Watt, no problem - probably big ceramic one) and just connet it in serie with your solenoid and then follow ANY 12V solenoid tutorial verbatim (with this combination in place for 12V solenoid - as it is de-facto 12V / 0.35A solenoid together)
Comment: this is one tutorial: http://www.instructables.com/id/Controlling-solenoids-with-arduino/  , i already have got 2n2222 npn transistor, 1kohm resistor, .1micro farad capacitor and 1n4001 diode, can i use them. i was using them for 3 volt vibration motor before this.
Comment: If it worked for your 3V motor and should work for 12V solenoid (as in tutorial), it would work for 6V solenoid too, just use 6V power sourse for the solenoid. As per datasheet of 2N2222 it should be able take 0.8A max, your soleonid wants only 0.35A, so it is OK too. If you are to use 6 solenoids, you will need 6 transistors, 6 diodes, 6 resistors (one set for each solenoid) regardless if you want to drive them with one pin or 6 different pins. Also your 6V power source should be able deliver 6x0.35A=2.1A minimal (rather more, does not hurt to NOT go extreme).
Comment: You can use one common 6V source of 2.1A or 6 independent sources per 0.35A (one per solenoid), as you wish. (If it works, please select this as an answer and upvote it)


Databases and Java

Question: I am starting out writing java code and interacting with databases for my "nextbigthing" project. Can someone direct me towards the best way to deal with adding/updating tables/records to databases? Here is my problem. There is too much repitition when it comes to DB code in java. I have to create the tables first (I use mysql). I then create classes in Java for each table. Then I create a AddRow, DeleteRow, UpdateRow and Search* depending on my need. For every table, every need creating this huge ass sql statement and the classes all seems like a huge waste of my time. There has to be a better, easier, more efficient way of doing things. Is there something out there that I do not know that will let me just tell Java what the table is and it automatically generate the queries and execute them for me? Its simple SQL that can be auto generated if it knows the column names and DB table inter dependencies. Seems like a very reasonable thing to have.
Answer: Check out Hibernate - a standard Java ORM solution.
Answer: User hibernate for mapping your classes to Database.
Set its hbm2ddl.auto to update to avoid writing DDL yourself.  But note that this is not the most optimal way to take it to production.
Comment: Thanks. I will check out Hibernate. But it looks like it will take a couple of days at least to use it.

Also what are the production time issues you are referring to? What is the optimal way. If I am learning new I might as well learn something that is the optimal way for production.
Comment: The production issue I think he is referring to is that you probably don't want hibernate to automatically update the schema of your production database.
Answer: Consider using Hibernate:
https://www.hibernate.org/
It can create java classes with regular CRUD methods from existing database schema.
Answer: Of course there is a much better way !
You really want to learn some bits of Java EE, and in particular JPA for database access.
For a complete crash course on Java EE, check out the Sun the Java EE 5 tutorial.
http://java.sun.com/javaee/5/docs/tutorial/doc/
Part 4 - Enterprise Beans
Part 5 - Persistence (JPA)
Then you want to try Hibernate (for instance) which has an implementation of JPA.
This is for Java 5 or later.
If you are still in Java 2, you might want to try Hibernate or iBatis.
Answer: You can also try iBatis, if you want control over SQL. Else JPA is good.
You can also try using Seam Framework. It has good reverse-engineering tools.
Answer: There is also torque (http://db.apache.org/torque/) which I personally prefer because it's simpler, and does exactly what I need.
With torque I can define a database with mysql(Well I use Postgresql, but Mysql is supported too) and Torque can then query the database and then generate java classes for each table in the database. With Torque you can then query the database and get back Java objects of the correct type.
It supports where clauses (Either with a Criteria object or you can write the sql yourself) and joins.
It also support foreign keys, so if you got a User table and a House table, where a user can own 0 or more houses, there will be a getHouses() method on the user object which will give you the list of House objects the user own.
To get a first look at the kind of code you can write, take a look at
http://db.apache.org/torque/releases/torque-3.3/tutorial/step5.html which contains examples which show how to load/save/query data with torque. (All the classes used in this example are auto-generated based on the database definition).
Answer: Or, if Hibernate is too much, try Spring JDBC.  It eliminates a lot of boilerplate code for you.
iBatis is another good choice, intermediate between Spring JDBC and Hibernate.
Answer: It's just a matter of using the right tools. Use an IDE with tools to autogenerate the one and other.
If you're using Eclipse for Java EE and decide to head to JPA, then I can recommend to take benefit of the builtin Dali plugin. There's a nice PDF tutorial out at Eclipse.org.
If you're using Eclipse for Java EE and decide to head to "good ol" Hibernate, then I can recommend to take benefit of the Hibernatetools plugin. There's good reference guide out at Hibernate.org.
Both tools are capable of reverse-engineering from a SQL table to fullworthy Javabeans/entities and/or mapping files. It really takes most of boilerplate pains away. The DAO pattern is slightly superflous when grabbing JPA. In case of Hibernate you can consider to use a Generic DAO.

Databases and Java


About the Definition of Preserving Inner Products $ (T \alpha|T \beta)=(\alpha|\beta) $

Question:
In the above definition, when it says $ (T \alpha|T \beta)=(\alpha|\beta) $, the inner product $(|)$ acting on $W$ is the same as acting on $V$? Or not necessarily? The book uses the same notation, so I had this question.
Comment: Not necessarily the same.
Comment: What would that even mean were $V$ and $W$ not the same?
Answer: The inner product defined on $V$ may not be the same as the inner product defined on $W$, but given your $\alpha$ and $\beta$ in $V$, $(\alpha|\beta)$ is a just a number. $T$ preserves inner products if evaluating $(T\alpha|T\beta)$ gets you the same number as before.
Answer: It sounds like you could an example. Take $V = \Bbb{R}^2$, with $(x \mid y)_V = x \cdot y$, the dot product, and $W = P_1(\Bbb{R})$, the space of real polynomials of degree at most $1$, equipped with the inner product
$$(p \mid q)_W = \int_{-1}^1 f(x)g(x) \; \mathrm{d}x.$$
Define $T : V \to W$ by
$$T(a, b) = x \mapsto \frac{a}{\sqrt{2}} + \frac{\sqrt{3}b}{\sqrt{2}} x.$$
Then
\begin{align*}
(T(a, b) \mid T(c, d))_W &= \left(\left.\frac{a}{\sqrt{2}} + \frac{\sqrt{3}b}{\sqrt{2}} x \; \right| \; \frac{c}{\sqrt{2}} + \frac{\sqrt{3}d}{\sqrt{2}} x\right) \\
&= \int_{-1}^1 \left(\frac{a}{\sqrt{2}} + \frac{\sqrt{3}b}{\sqrt{2}} x\right)\left(\frac{c}{\sqrt{2}} + \frac{\sqrt{3}d}{\sqrt{2}} x\right) \; \mathrm{d}x \\
&= \left[\frac{ac}{2}x + \frac{1}{2}\left(\frac{\sqrt{3}b}{2} + \frac{\sqrt{3}d}{2}\right)x^2 + \frac{1}{2}bdx^3\right]_{x=-1}^{x=1} \\
&= ac + bd = ((a, b) \mid (c, d))_V
\end{align*}
That is, $T$ preserves inner products.

Of course, in the above example, I've really side-stepped your issue by differentiating between the two inner products $(\cdot \mid \cdot)_V$ and $( \cdot \mid \cdot)_W$. It is unfortunately common for different inner products on different spaces to have the same notation. You'd be expected to know which inner product to use from context.
For example, if I write (given the above example) $((1, 1) \mid (0, 2))$, I'm clearly talking about the dot product, and hence the number $2$. On the other hand, if I write $(1 + x, x - 4)$, I'm obviously using the inner product on $W$, which results in $-\frac{22}{3}$.


Ubuntu won't shut down!

Question: I am using asus k40IE laptop and want to install Ubuntu 16.04 or newer versions.The laptop is quite old. But Ubuntu won't shut down (hants at showing ubuntu logo) at all. Shutdown also gets stuck with 18.04 and 18.10. Only Ubuntu 14. Only no issue when I am using 14.04. When I enable nvidia graphics, pc would shut down but won't get past login screen each time I try to login.
I really want to enjoy newer Ubuntu versions. Is there any solve...
Comment: The last line of /var/log/syslog when you brute-force off the system should give you a hint of what it was doing at that time, often running one of the scripts in `/etc/rc0.d`
Answer: I have the same issue on my Dell 1501.  I had no problem in shutdown/poweroff/reboot on i386 Kubuntu 14.04.   I could not shutdown/poweroff/reboot it on AMD64 Kubuntu 18.04.1 LTS any more.
Adding boot options do not work.
To work around it, I use the old kernel.  I downloaded and installed the 4.4.0-141 image manually.
root@dell1501:~# dpkg -l linux* | grep -v none
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
||/ Name                                   Version              Architecture Description
+++-======================================-====================-============-===============================================================
ii  linux-base                             4.5ubuntu1           all          Linux image base package
ii  linux-firmware                         1.173.2              all          Firmware for Linux kernel drivers
ii  linux-generic                          126.96.36.199.44         amd64        Complete Generic Linux kernel and headers
ii  linux-headers-4.15.0-42                4.15.0-42.45         all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-42-generic        4.15.0-42.45         amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-141                4.4.0-141.167        all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-141-generic        4.4.0-141.167        amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-generic                  220.127.116.11.44         amd64        Generic Linux kernel headers
ii  linux-image-4.15.0-42-generic          4.15.0-42.45         amd64        Signed kernel image generic
ii  linux-image-4.4.0-141-generic          4.4.0-141.167        amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-141-generic    4.4.0-141.167        amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-generic                    184.108.40.206.44         amd64        Generic Linux kernel image
ii  linux-libc-dev:amd64                   4.15.0-42.45         amd64        Linux Kernel Headers for development
ii  linux-modules-4.15.0-42-generic        4.15.0-42.45         amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-modules-extra-4.15.0-42-generic  4.15.0-42.45         amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
ii  linux-sound-base                       1.0.25+dfsg-0ubuntu5 all          base package for ALSA and OSS sound systems

I kept the new kernel around just in case we need it.  To trick grub to use the older kernel as default, I hard linked the older vmlinuz and initrd.img to a new version say 9.1.1.
Now my Dell 1501 boots up on the 4.4.0 kernel to work around the issue.
uname -a
Linux dell1501 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

If ubuntu has a fix, please wake me up.
Thanks.
Comment: Can we see how you install the kernel?

Ubuntu won't shut down!


Future methods do not support parameter type of Exception

Question: I'm stuck at this error "Future methods do not support parameter type of Exception". Is there any workaround for this error?
Comment: Serialize to JSON and pass the String.
Comment: @JesseMilburn Exceptions are not serializable.
Answer: As @DavidReed mentions, future methods can only support primitive types and collections of primitive types. If you want to still pass in Exception classes or more complicated classes, use Queueable instead, which behaves almost exactly like future methods, but supports more complicated data types.
Answer: This is part and parcel of the standard limitations on future methods:

The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types. Methods with the future annotation cannot take sObjects or objects as arguments.

You can pass an exception's message (e.getMessage()) to a future method, because it's a String, and String is a primitive type in Apex. Exceptions are not; they're objects. They also cannot be serialized to JSON, so you're stuck passing the exception's attributes to your future method.


What are the different diodes for an H-bridge?

Question: I am designing an H-bridge and I am wondering about the diodes I should use in my circuit. The first one is the one at the input of the MOSFET driver supply, I guess it must be a schottky that can resist to 12V and a low current, then I would say the same thing for the diode in parallel of the gate resistor, tell me if I'm wrong. On the other hand it is for the diodes at the terminals of MOSFETS where I have a little difficulty to define the characteristics, should I use a schottky? Knowing that it is for a DC motor 24V and 4A I think I will choose a diode 50V and minimum 8A.
Comment: Add a schematic
Comment: Sorry, I thought my schematic had been put
Comment: Which diodes are you talking about? D3, D4, D8, D9 are not necessary.
Comment: I'm talking about D2, D7 and D3, D4, D8, D9 and D5, D6, D10, D11. I thought that D3, D4, D8, D9 allowed to discharge more quickly the MOSFETS
Answer: Almost none of the diodes are useful:
D5, D6, D10, D11 are in parallel with the MOSFET intrinsic body diodes[1], which very likely have lower voltage drop, therefore the diodes never carry current.  They are also shown as a slow-recovery type (1N4007), which will interfere with the operation of a PWM system, if they should carry significant current (greatly increasing switching loss, and perhaps skewing timing).  Since they won't carry current here, that doesn't matter, and they're just dead weight -- a couple pF extra capacitance loading the circuit.
Curiously, there is some rationale for placing them, in this case.  The IRLL3303PbF specifies its body diode with maximum 1.3Vf at 4.6A.  Now, this is a higher current than the 1N4007 is tested at (1A), but it's highly unlikely that going from 4.6A down to 1A would lower Vf by more than 130mV.  In any case, the 1N4007 is rated 1.0V maximum (at 1A), which seems to be an improvement.
However, I suspect the 1.3V figure is just wildly pessimistic, not so much a worst-case statistical value as a guard band to avoid having to, say, test any parts to it, or to have to discard any parts that fail a more meaningful limit.  Case in point, notice the typical data in Fig. 7 gives 1.0V at a whopping 14A, and less than 0.8V at 1A.  Now, I'm not saying it's impossible for the Vf to be as high as 1.3V (at rated current), I can't know that from these data alone -- but it seems pretty damn unlikely that it ever would be.  Typically, diode Vf (for general diodes, I mean) varies within maybe 100mV of the typical value, not several hundred.  I would be inclined to disregard this particular parameter.
D3, D4, D8, D9 are in parallel with gate resistors that are already quite small.  The IR2104 has a fairly weak output: +130/-270mA.  When the driver is working as hard as possible, it only develops a 4.05V drop across the 15 ohm gate resistor.  This is more than a diode Vf, so the diodes will conduct -- but this has only very minor impact on turn-off time.  Effectively, the gate driver has an internal resistance around 60 ohms, so connecting an additional 15 in series with it -- or a diode (of about 3 ohms at peak current) in parallel with that resistor -- has a tiny effect.  Basically the diode acts to reduce turn-off time from 255 to 214ns.
The gate resistors here are more likely serving to dampen possible oscillations as the transistors turn on/off, and for that, some tens of ohms is fine (which we have here).
If different rise/fall speed is desired, a larger gate resistor should be used (more than 50 ohms would have noticeable effect with this driver, or a more powerful driver can be used), and then the parallel diode will have useful effect.  At the low load currents in this circuit (at most an ampere or two?), it seems doubtful that any special consideration is needed.
Diodes that are not optional, are D2 and D7!  And these are chosen appropriately: an ultrafast diode to supply bootstrap power to the high side gate drivers.
Unrelated circuit critique: the loop between LO, MOSFET, and COM / GND should be made very short.  Apparently there is a shunt resistor connection in this path, possibly a wired connection even.  If this is the case, I would strongly recommend adding bypass capacitors between low-side source and GND, so that high-frequency switching currents don't have to flow through that wired path.  Conversely, the supply/drain side should be -- and is (R22 in series, C22 providing bypass after it).
Huh, the 10k pulldowns are also specified as "0.1%".  Even 10% would suffice, of course.
I suppose the inductors are quite small for the current and switching speed as well, but maybe V_MOT is actually 5V or something, and relatively high dI/dt is acceptable, I don't know.  It's not that the inverter is very slow or anything anyway, it should be able to run about 100kHz well enough.  Larger inductors can be used to lower the switching frequency, improving efficiency.

[1] Neat fact: these are shown in two places already.  The arrow in the middle of the symbol means the substrate connection, which is tied to source, thus hard-wiring a PN diode from source to drain.  (The three thick lines in a row, in the middle of the symbol, represent drain, channel/substrate, and source elements.  They would be shown joined (a single line) if depletion mode; this is an enhancement mode MOSFET.)  For some reason, this fact was rarely taught even 2-3 decades ago, leading many to draw an explicit diode from source to drain as reminder.  Curiously, this symbology has also been forgotten, leading users still to place extra diodes in parallel...
Answer: D3, D4, D8, D9 are not really useful, the gate resistor is to reduce the rush current caused by the MOSFET gate into the IR2104 and these diodes allows to have a faster gate capacitance discharge when the gate is pulled down, probably for faster switching on the negative edge.
The type is just normal diodes, with a reverse voltage that is higher than the gate drive voltage. They can be quite small and handle 1-2A and being fast-switching type.

D5, D6, D10, D11 are flywheel diode that avoid the MOSFETs to be destroyed by inductive loads.
These diodes are also normal diodes, but needs to be able to handle higher current. You want fast switching diodes. For the current, it really depends on the inductance of the load, but if you want to be safe, ~20A range should be safe as long as you are not driving a massive motor.
Their reverse voltage should be higher than your rail voltage (V_Mot).

D2, D7 are for the IR2104 to generate the high side gate drive voltage, seems like a capacitor charge-pump design.
Comment: D3/4/8/9 might be required to have sufficient dead time. They turn off the one FET fast while the other comes on slowly. Without them there might be shoot trough. (Depends on the components and values involved, one would have to test).
Comment: Can you elaborate on why you think D3/4/8/9 are not useful? You state they are not useful, and then proceed to explain why they are useful...
Comment: For D2 and D7 what are the required characteristics ?
Comment: @Kolia D2 and D7 need to be able to block at least V_MOT - 12V and able to handle the switching frequency. They are called "bootstrap diode".
Answer: The resistor R25, R16, R18, R19 are used to "allow" the fast switching of power MOS-FET. But the "doing" is not the same when switching ON or switching OFF. This is the reason of these diodes D3/4/8/9, some times with another serial resistance. If time switching is not important, these can be omitted. For some reasons of symetry, there are also used when you are paralleling devices. You can also add a capacitor between gate and source if you want "identical MosFet parts". This is ok when they are "part" of the same "lot" of components if ... packaged together.


How do I find the path of a file on another computer on my network?

Question: I would like to access files from another computer on the same network in the Terminal. But I am not sure of the path to those files. How do I find it?
Answer: It would depend on how you want to access the file. Here's what I do:

Initiate the connection to the remote computer (I do it via Finder -> Go -> Connect to Server [or Command+K]) but you can also do via terminal using the mount command
Connect to the shared folder/volume available to your user
When connecting to those in Terminal, you would now use the path /Volumes/[name of folder]/[rest_of_path_here] to access them.

For example, if you connected to a folder called Stuff with a subfolder called Things, and ultimately file jackpot.txt on ip 10.10.1.5, first connect via smb to the server (10.10.1.5), choose the folder Stuff, and then reference that path in Terminal as /Volumes/Stuff/Things/jackpot.txt
EDIT: You can also run a Find command (Command + F) inside of Finder while you are connected to the share if you still don't know where the file is. Do the following:

Open Finder, connect to the server/volume (Steps 1+2 above)
Run Command+F to Find, enter your search term
Above the Finder section where files display, switch the search to "Shared" - this will run the search against connected volumes
Locate the file you want, and then drag+drop it into an open Terminal window
The path will be shown in Terminal
Comment: Thanks. Dragging the file to terminal is as easy as it gets.
Comment: @gdaniel Very true :) Figured I'd help also fill in the cracks in case the file was just completely unknown in its location!
Answer: In addition to drag and drop, you can right click on any Finder window, select "Customize Toolbar," and add the "Path" drop-down button.
It won't show a path you can copy-paste like in Windows, but it will give a better idea of the path to a folder you're in.


How to find error from the return of function call?

Question: The code is based on ethers.js. meBid is a function in a contract which places bid for user. Here is the function declaration in contract:
function meBid(address _bidItemAddress) external noBidder notComplete notDelisted returns (bool) { ....}

Here is how the function is called in React Native app with ethers:
import { ContractFactory, ethers } from "ethers";
let chres = await postContract.meBid(_trade.deployed_address);  //postContract is the contract and is valid
postContract.on("_meBid", async () => {
  //handle event after bid success.
})

Here is the return value of chres:
LOG  chainres :  {"chainId": 2018, "confirmations": 0, "data": "0x3ab0a29a00000000000000000000000089e10fa7794ac05ac820e9b0b68d4107f6509", "from": "0x882C5329a8fFe6570839eafF91e40cc5473063e0", "gasLimit": {"hex": "0x667b", "type": "BigNumber"}, "gasPrice": {"hex": "0x00", "type": "BigNumber"}, "hash": "0x8b4d1f1244e99859fcb1136b34f60413e9fe0d708f9c654a0072dbcefe3d7", "nonce": 122, "r": "0x2226e1b203e0b8902d064e8212d272fe8ee2894d6d86b45b7dd5c04cd663aa", "s": "0x4297e6a1004a20563a1de85a7a8db48e2ce12bd4b5fe247d124df4556509d0", "to": "0xadB0e387B5C600e4e01F4574A2116cD3df0fB", "type": null, "v": 4071, "value": {"hex": "0x00", "type": "BigNumber"}, "wait": [Function anonymous]}

But the _meBid event never called which means the function call to meBid didn't go through well. I check the Besu server log and didn't find any error on chain. The only thing I have is the value of chres. How to pin point the error here?
Answer: You are setting the listener for the event "_meBid" after awaiting the call to be mined. In order to listen for it setup the listener beforehand.
//postContract is the contract and is valid
postContract.on("_meBid", async () => {
  //handle event after bid success.
})
let chres = await postContract.meBid(_trade.deployed_address);

Another options is to search the transaction receipt for the event.
let chres = await postContract.meBid(_trade.deployed_address);

// Search in chres for the event


Is it appropriate to ask to check exercises from Dragon Book here?

Question: I am studying the Dragon Book about compilers and it has exercises which I try to solve. Unfortunately, there is no-one nearby who could check my solutions. Is it appropriate to post my solutions here asking someone experienced to check them?
Some of the exercises do not require writing code (like this):

Exercise 2.2.1:
Consider the context-free grammar S -> S S + | S S * | a
a) Show how the string aa+a* can be generated by this grammar.
b) Construct a parse tree for this string.
c) What language does this grammar generate? Justify your answer.

Example of the answer

a) Show how the string aa+a* can be generated by this grammar.

Let S1 = a according to the 3-rd production.
From the 1-st production we get: S2 -> S1 S1 + => S2 = aa+
From the 2-nd production: S3 -> S2 S1 * => S3 = aa+a*

We got the required string S3 using the rules of the grammar.
I asked the same question at https://softwareengineering.meta.stackexchange.com/questions/9573/is-it-appropriate-to-ask-to-check-exercises-from-dragon-book-here and was sent here.
Answer: In general, requests to verify solutions are discouraged, as the answers will not be able to say much more than yes or no, which won't help you or future visitors. The process of feedback to an exercise solution requires some back and forth, which is not suitable to this platform. See also here and here for more information.
That said, the material of the book certainly is on-topic here, so if the reason you're uncertain whether your solution is correct depends on a specific conceptual issue you're uncertain about, then you can ask about that, instead.


accessing bitlocker volumes in redhat linux

Question: I have a laptop running windows 7 ultimate. I have encrypted my drives using bitlocker. Now I have also installed redhat linux 6.0 along with windows. But my encrypted drives are not visible in linux. Hence I need urgent help?
Comment: other option boot back into windows transport the then unencrypted data to a linux friendly encryption solution i.e. LUKS which with some tweaking DOES work on windows too
Answer: The only way to open BitLocker volumes directly from Linux (that I'm aware of) is dislocker, an open source FUSE driver for Linux and OS X. It's designed more for data recovery than for day-to-day usage; I'm not sure if it supports write at all, and it certainly can't decrypt from the TPM (because the Linux boot process is different from the Windows one, so the counter used in the TPM for BitLocker will be different) so if you use a TPM you'll need to provide the BitLocker recovery key every time you want to access the encrypted volume from Linux.
Previous question on this subject, with step-by-step:
How to access a BitLocker-encrypted drive in Linux?
Dislocker source code: https://github.com/Aorimn/dislocker
Dislocker official site: http://www.hsc.fr/ressources/outils/dislocker/


How do I update the sort field value dynamicaly?

Question: I have a requirement to list events via view, but these events are categorized as past, ongoing and upcoming events. View results should show ongoing first, then upcoming and past events in the same view. I have used a computed(integer) field to set the value for each category. While creating a node based on start/end date I am setting this field value to 1(ongoing),2(upcoming), and 3(past). In the views, I am sorting the events based on this numeric field Ascending. It works fine, but issues arise when upcoming events become ongoing, then this computed field value is not updated to show as ongoing. How do I update this field value before this view is rendered?
Comment: Are you asking how to update a field on multiple nodes programmatically? There exist on this site answers for that. Or, are you asking if there is a better way to implement this feature?
Comment: Computed fields are usually updated on node save.  Does an upcoming event become ongoing without the relevant node being saved?
Comment: Hi @PatrickKenny upcoming will become ongoing based on the start date provided in the node. but when that node is shown in the events list from view then that computed flag should be updated.
Comment: Hi @cilefen I'm asking if is there any way to update the node field while processing the view and rendering but it should be before sorting. Because sorting will be based on that dynamic field. Or if saving node while processing view will put more load on views then is there any way to update just query result which will feed to views
Answer: You cannot (or at least, really should not) force nodes to be re-saved before accessing a view.  Such an approach is very inefficient.
The issue here is that you have a computed field that does a calculation based on a date and the current time.  If the date is in the future, the field has one value, and if the date is in the past, the field has another value.  Using a computed field here is not a good approach because as time passes, you have to re-save the nodes to ensure they have correct values.
One (inefficient) way to update the computed fields would be to batch re-save your nodes in cron.
A similar approach would be to use the Job Scheduler module to set up jobs to periodically resave the nodes.
However, I don't think saving a computed value is the right approach if it may have to be recomputed when a user accesses a node or a view.  If you need to compute a value on the fly, then don't store it in a computed field.
Instead, do the computing when you process the view.  To do this, you can write a custom Views sort plugin.  You can move the computed field logic to this plugin and then sort based on the date field (instead of the computed field).


Given two algebraic conjugates $\alpha,\beta$ and their minimal polynomial, find a polynomial that vanishes at $\alpha\beta$ in a efficient way

Question: Inspired by this question, I was wondering about the following problem.

$\alpha,\beta,\gamma,\ldots$ are the roots of an irreducible
  polynomial over $\mathbb{Q}$. How to compute the coefficients of $$
 (x-\alpha\beta)(x-\alpha\gamma)\cdot \ldots\cdot (x-\beta\gamma)\cdot\ldots, $$ i.e. the candidate minimal polynomial
  of $\alpha\beta$, in the most efficient way?

My approach is based on a simple lemma and a general fact. If $p_m$ is the power sum $\alpha^m+\beta^m+\gamma^m+\ldots$ and $e_i$ is the $i$-th elementary symmetric polynomial, the identity
$$ \exp\left(-\sum_{m\geq 1}\frac{p_m}{m}x^m\right) = \sum_{r\geq 0}(-1)^r e_r\,x^r$$
gives a way to compute $p_1,p_2,p_3,\ldots$ from $e_1,e_2,e_3,\ldots$ through the Taylor series of a logarithm ($\text{LOG}$) as well as $e_1,e_2,e_3,\ldots$ from $p_1,p_2,p_3,\ldots$ through the Taylor series of an exponential ($\text{EXP}$). Moreover, the characteristic polynomial of the sequence $\{p_k\}_{k\geq 0}$ is exactly the minimal polynomial of $\alpha$, hence we may compute $p_{n+1},p_{n+2},\ldots,p_{n+m}$ from $p_1,p_2,\ldots,p_n$ with a simple recursive approach (I will call this procedure $\text{CH}$, from Cayley-Hamilton). $\text{L}$ will be my previously mentioned lemma, i.e.
$$ p_k(\alpha\beta,\alpha\gamma,\ldots) = \frac{1}{2}\left(p_k^2-p_{2k}\right).$$
Now my algorithm goes as follows:
(1). $$ e_i(\alpha,\beta,\gamma,\ldots)_{i\leq n}\quad\xrightarrow{\text{LOG}}\quad p_i(\alpha,\beta,\gamma,\ldots)_{i\leq n}$$
 (2). $$ p_i(\alpha,\beta,\gamma,\ldots)_{i\leq n}\quad\xrightarrow{\text{CH}}\quad p_i(\alpha,\beta,\gamma,\ldots)_{i\leq n(n-1)}$$
 (3). $$ p_i(\alpha,\beta,\gamma,\ldots)_{i\leq n(n-1)}\quad\xrightarrow{\text{L}}\quad p_i(\alpha\beta,\alpha\gamma,\ldots)_{i\leq \binom{n}{2}}$$
 (4). $$ p_i(\alpha\beta,\alpha\gamma,\ldots)_{i\leq \binom{n}{2}}\quad\xrightarrow{\text{EXP}}\quad e_i(\alpha\beta,\alpha\gamma,\ldots)_{i\leq \binom{n}{2}}.$$
Answer: I don't see that the assumption that $\alpha$ and $\beta$ are roots of the same polynomial is particularly helpful. Suppose they have minimal polynomials $f(\alpha), g(\beta)$. Write down the companion matrices of these polynomials, then the Kronecker product of these matrices, then compute the characteristic polynomial of the Kronecker product. This polynomial isn't guaranteed to be irreducible, but from here you can factor it.
Comment: (+1) interesting approach, but I am not sure that computing a characteristic polynomial of a huge (even if sparse) matrix is more efficient than my approach :/


What age should I start my son in music lessons?

Question: My almost four-year old son has shown a big interest in music, specifically the violin.  When he was two, we went to see The Concert Truck, and he absolutely loved it.  After we got home, he kept talking about it - we showed him some YouTube videos of violinists, and he immediately picked up his toy ukulele, stuck it under his chin, and pretended to play violin with a plastic straw for a bow, haha.  So now that he's almost four, should I start looking for a Suzuki teacher?  Or should I wait another year or two?
Comment: Remember ear plugs, preferably custom or music ones which are much more comfortable and sound much better. I don't know about the acoustics of children violins, but adult sized violins are very loud. Hearing damage loud. Mine measures 80dB even from a few feet away with a properly bowed note. I started much older when in high school and it was uncomfortable enough that I got one earplug for the ear next to the violin. I didn't actually measure how loud it was until 20 years later and if I had known how loud it was I would have just had earplugs in both ears.
Comment: Why dont you ask this question on the music SE?
Answer: No, four years old is not too young to start violin. A few things to keep in mind:

Finding the right teacher, one with experience teaching young kids and making music fun, is critical. The right teacher can set your child up for a lifetime of making--and loving--music. The wrong teacher can extinguish the joy of music in a child, and it may never be recovered. Read reviews, talk to other people, ask for recommendations at music stores, attend recitals.
Young children can be fickle, so don't be distraught if a passion for playing violin turns into a passion for playing something else. The point is he's interested in music, which is a real blessing. Don't let him change instruments on a whim, nor should you lock him into an instrument that he truly doesn't want to play anymore.
One of the best instruments for unlocking an understanding all music (not just playing an instrument) is the piano. Our kids picked one instrument that they wanted to play (we had seven kids playing fiddle/violin, cello, viola, mandolin, guitar), and we put them in piano lessons as well. The latter really helped them with their grasp of music theory. You may want to consider adding piano lessons after he's proven that his passion for music isn't a short-term infatuation.
Fractional size children's violins (1/16th, 1/8th, etc.) from a typical rental pool are notoriously bad in quality. Make sure to have your son's teacher check the instrument out to make sure it plays easily and stays in tune. Learning to play any violin is tricky; learning on a junky VSO (violin-shaped object) is a real chore. A bad instrument will also assault your ears with a thin, pinched tone. Those smaller instruments never sound full and rich, but nor should they sound like a hornet in a garden hose.
Comment: The advice to make sure the instrument is playable is spot on, not just for violin.  A "beginner's guitar" may be unplayable by the beginner, or by anyone, due to for example a very high and stiff action.
Answer: Suzuki is very much appropriate for four years old - in fact that's later than many start (3).
The main thing is to decide ahead of time what your goals are here.  Is it to enable him? Or to teach him skills?  The approach to how to encourage practice and how to handle down times when he's not as interested will matter here.
Ideally, this would be driven by his own interest, and practice would happen organically. But in the real world, that's not always going to happen - practice is something you'll have to teach. Decide how you're going to approach that as early as possible, so you don't end up in a situation where he dislikes violin because you're making him practice against his will.
Answer: Depends on your individual child. Typically the answer by Kurt above is accurate. Absolutely find a teacher that specializes in working with young children. Get references & visit one of the teachers sessions at least. If you can drop in unannounced at a group instruction or getting ready for a recital etc. this will give you a better idea if that instructor is right for your child. If your kiddo is beyond their years you may want to choose a more serious instructor. But if your child is interested in music and indicates they want to try something new (say violin in above case), then fun is the way to go. Rent a mini violin fit for your child  first. Do not purchase every instrument your child shows interest in (unless you have money to do so). Most music stores have rental programs. The teacher should teach to make learning the instrument fun, interesting and begin with the basics. It's so much harder to unlearn bad habits. Make sure the teacher is certified and knows the instrument and teaching young children really well. Sounds like in your case your kid wants to learn violin. Learning an instrument takes discipline, time, practice (a lot). All this can be taught in a way that isn't droll. You don't want your child stressed out when only 4-6 years old (or later really). Trying new things should be fun and rewarding. I'm a certified parenting educator and a musician. I've had terrible piano teachers and wonderful ones. Same goes for choir, voice lessons etc. The teachers I remember and learned from the most were the kindest, rewarding and calming way about them. Conversely, I also remember the terrible piano and voice teachers. They acted as if I was going to conduct a major orchestra in a months time.
You know your child best. You'll find the right fit and style of teaching that works best for your child. Ask friends, neighbors or daycare parents if they have recommendations. Word of mouth really helps and is usually right. Good luck and make sure your kid has fun!


Confusion regarding the quasi neutrality approximation for PN Junction analysis

Question: Why are they called quasi neutral and not exactly neutral? What happens which make them that? In the analysis we have done to derive the I-V characteristics , we always maintained neutrality where excess electron concentration=excess hole concentration in any of the quasi neutral region.
Answer: A region with charge neutrality cannot be a source of electric field. The electric field occurring in the junction is due to the fact that the region is not neutral in charge.
Answer: The concept of quasi neutrality as opposed to perfect neutrality comes from the fact the in a real PN junction, the space charge doesn't abruptly stop outside of the depletion region especially for lightly doped junctions. As the next best approximation to the abrupt junction in which bulk is neutral, in the graded junction there is appreciable space charge on either side of the graded junction. Thus calling the p and n sides neutral isn't completely correct.
Why does it make a difference? Well, the presence of space charge governs the junction field and thereby everything else. So there is an effect on the accuracy of calculations.
You may find Section 5.6.4, Solid State Electronic Devices by Streetman & Banerjee helpful in this regard.
Answer: To my understanding, this terminology is used to stress the fact that, although the medium is composed of charged particles, charge separation is only seen in small scales.
In larger scales, the medium appears neutral, due to collective effects that tend to cancel out any non-zero concentration of positive or negative charge, "shielding" (or "screening") them from the outside world.
The characteristic length of "shielding" depends on the temperature and the density of the carriers. It is dubbed Debye length by the plasma physicists or Thomas–Fermi screening length by the solid state physicicists.


Lost svn directory some time ago.. how do I find out which revision has it?

Question: I lost an svn directory some time ago, but don't know which revision has it? I looked at the log, but I'm guessing it is one of the times there is no comment ;)
Answer: Not sure what your platform is, but with TortoiseSVN you can filter revisions by author, comment, and path.
Right-click your working folder, select TortoiseSVN/Show Log, then type the name of your folder in the search box at the top right. It will limit the revisions in the list to ones that match. The top revision in that list will likely be the last that contained a reference to your folder (where it was deleted).
You might need to click the Show All button at the bottom, as it only shows the last 100 revisions by default.
Answer: Depending on your svn server you could try to figure out which was the last conntection to the server. You should then look which revision was current at that time.
Answer: I wonder if you could write a small script to use the command line svn to try something along the lines of:

For each revision x in a range
Switch to revision x
Compare directory against your working copy
If they match, stop

This would be something to try if someone who knows SVN inside-and-out doesn't come up with a way to quickly do a binary search and compare.
Answer: You can check entire log with verbose switch on and grep the directory you are looking for together with delete flag and grep revision numbers as well:
svn log -v | grep -i -e "   D /path/to/folder" -e "^r[0-9]" | more

Second option is to check the log (with or without verbose switch) on the file itelf by "guessing" revision numbers, for example
svn log svn://repository/deleted/directory -r1337 -v --limit 1

Neither of above are nice approaches, but they will do the trick.


I did a oil change but forgot to drain the pan and now I have oil leaking through air intake

Question: It's blowing out thick white smoke and rattling pretty hard, I have motor oil coming out of my air intake and I can't put the air conditioning on cause it just shut the car off. I don't know what to do! And I need it for work. It's a 2003 Acura TL 3.2 v6 engine
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: Sorry you're having such a hard time. This should be pretty simple. Just drain the oil. Fill it back to the recommended level and then run it. You'll have some slight after effects, but it should be fine. It isn't good to run your engine with extra oil (especially not double the amount). It can cause damage to an extent, but I doubt there's any serious damage. The best you can do is just drain all the oil (get a big pan) and then replace with the recommended amount.
Comment: You could just be burning off oil that has got into your air intake etc.  However, you could also have caused damage to your pistons, con rods, or piston rings due to the pistons hitting against the overfilled oil in the sump.
Comment: Appreciate it, also I drained everything and put new oil but for some reason it's still doing it, not coming out of the air intake but like blowing white smoke and rattling pretty hard. I feel it might be the gasket or pcv maybe? I just really hope it's nothing serious, it's not over heating either and the coolant is still at the same place.
Comment: @GenovanniNoble - Agree with HandyHowie here ... if you now have the recommended amount of oil in the engine, the best you can do is to run your vehicle a bit to see if it settles out some. If it doesn't, you may have caused permanent engine damage. If it does settle down, you should be in okay shape.


Image Texture Resizing

Question: I recently modeled a book, I wanted to start playing around with some textures to see what fits best. When doing so I noticed I wanted the leather bumps to look smaller and I couldn't make the UV any bigger to fit the image. Is there a way of doing this? Or is it the image I'm using?
Answer: If it is a tileable texture, then you can scale the uv outside the image boundary to greatly reduce the size of the individual details. If you then want to map decals or something else to the same surface, you can use another UV unwrap to get that mapping.
Answer: You can also change the size of the UV Map by changing the scale with a "Mapping" Node in the Shader-Editor.

This is a bit more elegant than just scaling up the UV-Map imo, it keeps the UV's a bit more tidy. It also allows to bake your texture later. With UV's scaled up and out of bounds of your image, you later can't bake parts that don't cover the image.

Image Texture Resizing