Negative work leading us to negative energy

Question: We know that energy is the ability to do work and we know that the work can be negative as cos theta of the angle in which force is applied can be negative. Moreover we take the units of work and energy as equal. So can we say that there exists negative energy. Tell me if my consideration is wrong.
Answer: To put this simply, the work-energy theorem states that

The work performed by a force $\mathbf F$ over a distance $\Delta \mathbf r$, $W=\mathbf F\cdot\Delta \mathbf r$, is equal to the change in kinetic energy $\Delta E_\mathrm{kin}$ of the relevant object.

If the inner product $\mathbf F\cdot\Delta \mathbf r$ is negative, the force is acting in the opposite direction of the object's velocity $\mathbf v=\Delta \mathbf r/\Delta t$, the change in kinetic energy $\Delta E_\mathrm{kin}$ is negative, and the object's kinetic energy decreases. This is colloquially known as "braking".
Comment: Thanks for sharing this theorem. I was not about this theorem and didn't now it was change in displacement which even if is negative makes the energy less and not negative. Now I understood and thanks once again to end my confusion.
Answer: No, we can't. I assume that you are talking about a moving object and therefore kinetic energy. You Can apply a resistive force, therefore slowing the object and reducing its energy. But as soon as the object reaches zero energy (read: kinetic energy), the body will be at rest. If you continue to apply the same force, from Newton's 2nd principle, the body will accelerate in the same direction of the Force thus leasing to a value
$\cos\theta=\cos0=1$
The work will be now positive and the energy will increase.
Comment: But what about negative work ? While doing a negative work the energy is what : Negative or Positive? That's what I'm asking.
Comment: @AbhinavDhawan The energy of *what* exactly?


edit a program on IBM Q experience

Question: Can I edit a program with python numpy and scipy and of course qiskit in the IBM Q experience, using code? (I am not interested in drugging gates) and I can't find the way to edit my own program
Answer: You can't edit using python in the circuit composer. You can edit the OpenQASM which can be found on the left-hand side of the composer.
If you would like to use Qiskit, this is also available through the Q Experience, you need to click on the Jupyter Notebooks. Here you can create circuits of your own, or modify the given examples.

edit a program on IBM Q experience


Upgrading centOS 6.6 to 7

Question: I have recently upgraded centOS 6.6 to 7. It seemingly boots up, but it can not open the log in page, Actually the systems is frozen here. Does anybody have similar experience? If so, it would be great to help with this.
Comment: What procedure/document did you use to do the upgrade? Did You follow said document exactly?
Do You have access to the console? What do you see in the logs when in single-user mode?
Comment: I followed some typical procedure like this one: http://abi.io/blogs/in-place-upgrade-centos-6-5-to-7-0-using-preupg.html , Honestly, I have read that there are some risks to upgrade centOS 6 to 7, but I tried and it seems I messed up.
Comment: I only have access to UEFI and GNU GRUB, As a single user I faced with ''welcome to rescue mode! tyoe'' , I am needed to type the root password and finally three lines appear, the last one is: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link become ready
Answer: Had the same problem driving me nuts!
It just takes forever to show the login prompt. On my VM it took around 25 minutes!
The problem for me was on the audit package installed.

Problem #1 : yum not working - could not find libsasl2.so.2
The upgrade process resulted in me having /usr/lib64/libsasl2.so.3 . just create a symlink in /usr/lib64 named libsasl2.so.2 pointing to /usr/lib64/libsasl2.so.3 via:
ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2
Problem #2 : yum was working again but could not complete most operations. Had to remove
mod-perl-2.0.4-11.el6_5.x65_86. Please note that this may not apply to you.
Problem #3 : Delay during boot. removed audit package ( yum erase audit ) updated glibc package (yum update glibc ) and then update the system ( yum update ).

I rebooted and the system was up in less than 20 seconds!
Answer: While the symlink will work, I don't believe it's the complete solution.  I'm not sure this solution is either.  I had similar symptoms as above.  Important programs like Python and sshd were linked with libsasl2.so.2, which is a el6 package.
It seems that in  my case some of the post install scripts did not run correctly.  I started the rescue system, and as root in the /root/preupgrade/postupgrade.d/pkgdowngrades, run the fixpkgdowngrades.sh script.  This fixes all the references to libsasl2.so.2, correcting them to libsasl2.so.3.  I then removed the libsasl2.so.2 symlink.
I also cd'ed into each of the other directories in /root/preupgrade/postupgrade.d and ran the scripts therein.  The /root/preupgrade/postupgrade.d/clean_centos6_pkgs/postupgrade_cleanup.sh will need to be fixed near the bottom where it exits if not called with --cleanup.
Comment: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](http://unix.stackexchange.com/questions/ask). You can also [add a bounty](http://unix.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question once you have enough [reputation](http://unix.stackexchange.com/help/whats-reputation).
Comment: I was addressing the libsasl2.so.2 library issue.  This was one of the most relevant searches, and sshd wont start without this kludge..  I was trying to assist others. with similar issues
Answer: I would use a Live CD to bypass the login page. Then, I would use an external hard drive to transfer your important data to. Once all of the essentials are backed up, I would reinstall your OS and transfer your data back to your computer.
While you are logged into your computer with a Live CD, I would take the opportunity to review your log files to learn what transpired before this happened so that you learn how to prevent this from happening again.

Upgrading centOS 6.6 to 7


Economic theory / papers on sovereign debt?

Question: I am an undergraduate student who does some research on sovereign debt and its sustainability.
Which papers are essential to understand how sovereign debt works and which implication it has for the economic policy of the country?
Answer: Carmen Reinhart from Harvard Kennedy School works extensively on these questions. She has a recent paper forthcoming  in the Journal of the European Economic Association, 2016, entitled "Sovereign Debt Relief and its Aftermath" with Christoph Trebesch. They study sovereign debt relief in a long-term perspective, using two distinct samples: 1920-1939, and 1978-2010. They published a short Vox-CEPR column on this research.
In their book, with Kenneth Rogoff, "This time is different" they address this question. They have also other interesting and good papers:

Reinhart, Carmen, and Kenneth Rogoff. "Dealing with Debt." Journal of International Economics 96 (July 2015): S43-S55.
Reinhart, Carmen, and Kenneth Rogoff. "Financial and Sovereign Debt
Crises: Some Lessons Learned and Those Forgotten." Financial Crises:
Causes, Consequences, and Policy Responses. Ed. Stijn Claessens, M.
Ayhan Kose, Luc Laeven, and Fabian Valencia. International Monetary
Fund, 2014.

Check also:

Reinhart, Carmen M., and M. Belen Sbrancia. "The Liquidation of
Government Debt." Economic Policy 30.82 (March 2015): 291-333.
Answer: I don't know a great deal about this area. But in terms of the European Sovereign Debt Crisis, you might wish to review Philip Lanes research on the topic. I'm sure there are others too, maybe his co-authors on papers etc, you could look at their papers too. For example, there is one in the Journal of Economic Perspectives in 2012 called "The European Sovereign Debt Crisis". It's a nice one to read, at least I thought so anyway!
Comment: you may want to improve your answer by giving the exact citations
Answer: A lot of the current work done about debt sustainability analysis uses fiscal policy reaction functions in different ways.
Interesting papers on this subject are:

[Bohn2005] Bohn, H. (2005). The Sustainability of Fiscal Policy in the United States.
[Medeiros2012] Medeiros, J. (2012). Stochastic debt simulation using VAR models and a a panel fiscal reaction function: results for a selected number of
countries. European Economy. Economic Papers, July 2012(459).
[Ghosh et al.2013] Ghosh, A. R., Kim, J. I., Mendoza, E. G., Ostry, J. D., and
Qureshi, M. S. (2013). Fiscal Fatigue, Fiscal Space and Debt Sustainability
in Advanced Economies. The Economic Journal, 123:4–30.

The first and the third one use fiscal reaction functions explicitely. The middle one used this reaction function to similate how debt could evolve over time.


On what particular thing does the brightness of a light-bulb depend? Current, or power, or voltage?

Question: Actually, I wanted to find out what causes a bulb to blow.
Wait, I know that if there is air leakage it will cause the bulb to burn right after  oxygen enters. I believe that the other reason behind bulbs blowing is the same as the reason causing the bulb to glow brighter (if I am wrong, please correct me). I used to think that current is the reason why bulbs blow, but I saw on the National Geographic TV show Genius that Einstein removed some straps of coil (on a transformer) causing the voltage to decrease and the current to increase and thus he fixes the problem of bulbs blowing. So, in this sense, voltage is responsible for bulbs   blowing, which is against my understanding, since I believe it should be the current.
Comment: Possible duplicate of [Why does bulbs blow?](https://physics.stackexchange.com/questions/410389/why-does-bulbs-blow) .  Perhaps you should delete one or the other question.
Comment: The correspondence between the title and the description still isn't clear.
Answer: These qualities are interdependent due to Ohm's law.
Why does a filament bulb blow?
When current flows through the filament, it heats up and this heat is also dissipated. There is a maximum temperature the filament is about to endure. If the rate of dissipation of heat catches up the heat produced well before the bulb attains that temperature, it glows, otherwise the filament splits.
The heat produced per unit time is $P =IV = I^2R = V^2/R$, which is the instantaneous power produced by the bulb.
There is a maximum power specified by the manufacturer, and whenever the above-specified quantity $P$ exceeds that (either due to increase in voltage or current, actually increase in voltage will proportionally increase the current due to Ohm's law, assuming that the Resistance remains almost constant), the bulb will produce more heat than it can sustain, and the filament will melt and split.
Comment: Awesome and concise, +1. But I wouldn't say "blow up", because an image of a violent explosion comes to mind, even though it's a common phrase. Perhaps you cold say 'the filament splits'? Also, it would be great if you could include a discussion of CFL bulbs.
Comment: Voltage and current are **not** proportional in light bulbs.
Answer: There are two ways to interpret the question what causes a bulb to blow.

The bulb is new and in good condition but it is connected to an inappropriate power supply.
The bulb is connected to an appropriate power source but it does not last for ever.

For 1, Archisman has given you the answer but I will expand a little.  Suppose that the bulb is designed for the US $110V$ supply and should consume $110W$.  The rules that Archisman gives implies that the current needs to be $1A$ and hence the resistance needs to be $110\Omega$.  The designer needs to choose the length and diameter to give the correct resistance and that it will stabilise at a suitable temperature when it dissipates that power.  Now suppose that the bulb is taken to another country and connected to a $220V$ supply.  It will start to draw $2A$ instead of $1A$ and hence consume $440W$ rather than $110W$.  Note that doubling the voltage has quadrupled the power and not just doubled it (since the current also doubled).  It is unlikely that a filament designed for $110W$ could handle $440W$.  It will probably very quickly vaporise.
For 2, even if the bulb is used within its design parameters, the filament will gradually vaporise and thin.  Eventually, it will break.
Comment: Since an answer was already given for 1, there is a greater need to expand on 2.


My question disappeared and my rep went 100 points down without any information/notification given to me, even post deletion. Why?

Question: I had recently asked a question about authenticity/information about a scientific research abstracts database called inexsy (www.inexsy.com) (They call it information exchange system on their site). I had asked this question a few days back and just a couple of hours ago some new user ( I dont recall his username) posting irrelavant comments and answers and by the time I saw, he was rude to a user (Scaahu)(I dont know if he is a moderator). There was a close vote and a downvote that happened in between the exchange between these users. After a an hour or so I came back to this site to see my question disappear and a -100 to my reputation, all without any information/nortification from anyone. I just saw Rep go down and when I searched the question it was not there. I'd like to know what happened and why my rep was -100 and question deleted with no information given to me, even post deletion. I do not have the link to the question. Appreciate some information.
Answer: The question was flagged as spam by two users. I reviewed the flags and agreed that it looked spammy, and deleted it as such. A post deleted as spam causes a penalty of 100 reputation points.
I apologize if I have misinterpreted your post but, probably, from the way it was formulated, it would have attracted other spam flags anyway. I'll ask the SE staff to clear the spam flag so that you can recovery the reputation, but please don't repost that question, even in a different form: it would be closed as a shopping question.
Comment: Thanks for the reply Massimo. It clears the air. Otherwise I was wondering what would have happened.


Limit number of emails sent to user (max email policy / frequency capping)

Question: I'm wondering if there is a way in ExactTarget/Salesforce Marketing Cloud to limit the number of emails sent to a user in a specific period of time. For example, I would like to send no more than 3 emails to a subscriber in one week and no more than 1 each day.
Answer: Currently there is no frequency capping feature available out of the box. One way to do this is writing the email sends to a data extension and using this information as filter criteria for your email audiences for example.
Answer: Use this query to output to a DE with the 3 fields at the top.
SELECT
    DISTINCT EmailAddress as [Email Address], s.SubscriberKey, GETUTCDATE() as [Date Added]
from
    (select
        SubscriberKey, count(1) as cnt
    from
        _sent with(nolock)
    where
         dateadd(wK,3,EventDate) > DATEADD(dd, DATEDIFF(dd,0,getUTCdate()), 0)

    group by
        SubscriberKey
    Having
        count(1) >= 2
    ) x  INNER JOIN
    _Subscribers s with(nolock)
        On x.SubscriberKey = s.SubscriberKey

then use this ampscript (or ContentAreaByname point to this) at the top of your email to lookup the DE at send time
%%[ /* Suppression Lookup */ SET @FC_Row = LookupRows("Suppression_FrequencyCap_Email","SubscriberKey", _SubscriberKey) IF rowCount(@FC_Row) > 0 THEN RaiseError("Do not send to subscriber ñ Frequency Capping applied.", true) ENDIF]%%

Comment: it cut my code, here's the top half
SELECT
 DISTINCT EmailAddress as [Email Address], s.SubscriberKey, GETUTCDATE() as [Date Added]
from
 (select
  SubscriberKey, count(1) as cnt
 from
  _sent with(nolock)
 where
   dateadd(wK,3,EventDate) > DATEADD(dd, DATEDIFF(dd,0,getUTCdate()), 0)
Comment: Make sure to use the `{}` code format button in the editor or indent your entire code block by four spaces. That way your formatting won't be mangled.
Answer: Since this has been posted, Salesforce introduced the Auto Suppression "Lists".  While they're not target-able by Query Activity out of the box, you can make that connection via API and utilize one or more queries to maintain a suppression audience.
The benefit of using Auto Suppression is that you do not need to use Exclusion Scripts in every send definition.
I've outlined a solution here in this Github repo: https://github.com/wvpv/sfmc-frequency-suppression
Here's the Send query from that solution:
select
  a.subscriberid
, a.subscriberkey
, count(*) as SendCount
from _Sent a
inner join _Job j on j.jobid = a.jobid
where 1=1
and j.sendClassificationType = 'Default Commercial'
and j.TestEmailAddr is null
and j.Category != 'Test Send Emails'
and j.EmailSubject not Like '%test%'
and a.eventDate >= convert(date, getDate()-7)
group by
a.subscriberid
, a.subscriberkey
having count(*) > 0
/* name: Subscriber_Activity_Summary_Sends */
/* description: aggregates sends by subscriber in the past 7 days */
/* target: Subscriber_Activity_Summary */
/* action: overwrite */


Replacing a GCFI plug on my fan

Question: I have an indoor/outdoor fan that has a GCFI reset plug at the end of the power cord that has tripped and will not reset.  Can you tell me the proper method to replace it?  I have extremely limited experience in electronic repair and would need some pretty detailed advise if possible...any help would really be appreciated!
Comment: I take it you are talking about a GFCI that's part of the cord to the fan, no?
Comment: I replaced one in a space heater with a regular plug ; However it was always plugged int a GFI receptacle
Answer: If I understand correctly, you have a GFCI device on the end of a power cord attached to a fan - i.e., the GFCI was provided with the appliance and is not built in to the building. Assuming that is the case, there are two possibilities:

Failure of the GFCI
A ground fault in the device

If the GFCI has failed - and they can fail - then replacement makes sense. However, I think more likely is that there is a ground fault somewhere in the fan. A ground fault could include wiring (e.g., starting with cracks in the cord insulation), motor damage, switch damage, etc. I know of only two ways to get a 100% definite diagnosis:

Replace the GFCI. If the fan works, the problem was the GFCI. If the fan doesn't work, the problem is the fan - in which case toss the whole thing (and in which case you have just wasted a new GFCI module).
Replace the GFCI with a temporary regular plug. Plug the fan in to a GFCI-protected receptacle (e.g., kitchen or bathroom that has been updated to include GFCI) and see if it works. If the GFCI receptacle (or breaker) trips immediately then the problem is the fan - in which case toss the whole thing. If the GFCI does not trip and the fan works, then you should replace the temporary plug with a GFCI module.

I suspect an indoor/outdoor fan has a GFCI included because typical use may include outdoors, in the rain, plugged into a grandfathered non-GFCI-protected receptacle. So bypassing the GFCI protection, except for a very temporary testing procedure, is not a good idea.
Answer: Check laws in your area and any other appropriate entities(landlord, etc.) to make sure you're allowed to repair this yourself.
Check if a breaker is tripped.  Test the fan on another GFCI plug and see if it trips.  If the fan is good and the plug is definitely getting the correct voltage and therefore is faulty, power down the circuit at the panel, confirm there is no voltage by metering line and identified conductor voltage to ground, remove the cover plate and if the plug has screws on the side, check both sides with a Non Contact Voltage Tester.
Upon confirming there is no voltage, undo the mounting screws at the top and bottom of the plug and carefully pull it out without stressing the wires or cutting them on any sharps.  If existing wiring is aluminum, come back here and say so for further instructions.
Use the NCVT to check every wire in the box.  Meter neutral voltage to ground.  Undo the existing connections to the old GFCI plug (if it was connected with push in method, rather than cutting the wires off, you can find a release slot on the side or back of many plugs, and if that doesn't work or you don't have a suitable pokey, firmly grip one wire at a time, firmly grip the plug and pull while rotating it back and forth 45-60 degrees to release the wires.  Check the original stripping to make sure the original installer did not gouge or ring the copper.  If the copper is damaged in this way, cut it back and re strip it.  Avoid shortening wires when not necessary.  Check the strip guage on the new plug and if necessary adjust the length of bared copper.  Pre fold the wires back into the box without damaging them, so that when you reattach them to the plug and push the plug into the box they won't pinch or experience undue pressure.
Terminate the wires on the plug, ground first to green screw, then identified to white/silver screw, then line to brass screw. If the original GFCI was protecting additional plugs, take the sticker off the additional load screws and attach those wires, white first, then black.  How best to terminate will depend on the attachment method of the new plug.  If you decide to use push in connections, be sure to do up the screws on the side of the plug so they aren't sticking out loose to cause a short.
While it is still extended from the box, remove the mounting screws if they have retainers, wrap it with 2-3 wraps of 300V electrical tape to insulate the screws.
Turn on the breaker and go back to attempt to test, reset, test, reset the plug.  Use a plug tester with GFCI function to test it once more and reset.
Power the breaker back off, and fold the wires in a sensible way as you push the plug back into the box so as not to stress them.  When you have the plug all the way back to the finished surface, you can let it relax back out an inch, and replace the mounting screws and retainers.  If installing on an uneven surface, bend the "ears" of the mounting strap to ensure the plug is perpendicular to the mounting surface and at a sensible depth(you can dry fit the cover plate several times as you do up the mounting screws to achieve ideal perpendicularity and depth.).  Do up the mounting screws and reinstall the cover plate.  Turn the breaker back on.  Test with the fan.
Comment: It sounds like a GFCI-built-into-the-plug setup, so part of the appliance and thus repairable...
Comment: @ThreePhaseEel yeah I suspect either box and plug on whip, wall or surface mounted or recessed GFCI might be the case from the description(if OP meant "that the cord is plugged in to" by "at the end of the power cord".  Really not clear. In many areas you can change out devices as well, but I figured include every step and hopefully OP executes a safe, legal and sound repair.

Replacing a GCFI plug on my fan


Book about a soldier, who is a "?"th generation clone, who must recover the memories of his previous incarnation(s)

Question: I remember reading a review of this book around 2000, though I do not know when it was actually written. I believe that the soldier was killed during an investigation of some sort. His clone is sent as a replacement to find out what transpired.
Comment: Are you sure it was a soldier? It reminds me of http://en.wikipedia.org/wiki/The_World_of_Null-A, which is an old small series of books.
Comment: This sounds pretty cool. I'm not 100% sure it was a soldier but pretty sure... and I don't think the book was quite so old.  I think part of the mystery was recovering old memories or finding out how his clones died.
Answer: It could be Duncan Idaho in the Dune series (Dune Messiah and/or God Emperor of Dune). Frankly I can't recall the specifics, but I seem to recall that in at least one of them, the new Idaho clones had to undergo a certain trauma or imprinting in order to regain their past-life memories.
This played a role in several of the books including Heretics of Dune and Chapterhouse: Dune. IIRC, there was also a ghola of a commander Teg.
The clones were called "gholas."
Answer: It reminds me of #2 in Mike Resnick's The Widowmaker series - Widowmaker Reborn:
http://www.amazon.com/dp/0553571613
also Walter Jon Williams' "Voice of the Whirlwind" might fit even better
http://en.wikipedia.org/wiki/Voice_of_the_Whirlwind
Comment: This might be it but I'm still not certain. Regardless, it sounds interesting and I'm going to check it out. Thanks!
Comment: I remembered a better fit so I edited the answer. I hope you enjoy the Widowmaker series :)
Answer: This sounds a lot like Today We Choose Faces by Roger Zelazny. Protagonist is an assassin who uses cloning and memory transplants in an attempt to guide humanity. The final clone ends up having to pull up the memories of the the very first instance, Angelo di Negri.


Primes having 2 as a primitive root

Question: Let $p$ a prime and $a$ a quadratic residue of $p$. If there exists some positive integer $y$ satisfying $a\equiv2^y \pmod{p}$, prove or disprove that $2$ is a primitive root of $p$.
My progress is that if 2 is not a primitive root then the set $\{2^0, 2^1, ..., 2^\frac{p-1}{2}\}$ is exactly the set of quadratic residues. Also $ord_p(2)=\frac{p-1}{2}$ or $p-1$.
Comment: Unfortunately, your two assertions are not true in general: take $p=31$ for example.
Answer: As the comments point out whether $2$ is a primitive root of $p$ depends on $p$, $a$ and $y$, this answer is trying to figure out WHEN $2$ is a primitive root of $p$.
As $$a\equiv 2^y \pmod{p},$$
where $a$ is a quadratic residue of $p$ and $p$ is a prime number, it is clear that

Proposition 1: $2$ is NOT a primitive root of $p$ if $p=2$ or $y=1$.

In the following, assume that $p>2$ is an odd prime number and $2\le y \le p-2$. We assert that

Proposition: $2$ is NOT a primitive root of $p>2$ if $y$ is odd.

Proof: Let $g$ be a primitive root of $p$. Then there exist integers $1\le k \le p-1,0\le s\le \frac{p-1}{2}$ such that
$$2=g^k,a=g^{2s}.$$
Then it follows from $a=2^y$ that $g^{2s}=g^{ky}$. Note that the order of $g$ is $p-1$. So we have $$ky\equiv 2s \pmod{p-1}.$$
Since $2s$ and $p-1$ are even, $ky$ must be even too. If $y$ is odd, then $k$ must be even, i.e., $2\mid k$. Then
$$\mathrm{Ord}(2)=\frac{p-1}{\gcd(p-1,k)}=\frac{p-1}{2}\cdot \frac{1}{\gcd(\frac{p-1}{2},\frac{k}{2})}\le \frac{p-1}{2}.$$
Therefore, $2$ can be a primitive root of $p$. QED.
However, it is not a sufficient condition. After observing the result of the magma script below, a conjecture is obtained.

Conjecture 1: $2$ is a primitive root of $p$ if $y$ is even and
  $P(p)$, where $P(p)$ is a proposition of $p$ only.

We know whether $2$ is a primitive root of $p$ is completely determinated by $p$. But so far as we know, it is hard to give a YES or NO when only given $p$. So The proposition $P$ in Conjecture 1 is expected to be much more simple.
<code>gp:={}; bp:={};
for p in [i: i in [3..200] | IsPrime(i)] do
base:=ResidueClassRing(p);
g:=PrimitiveRoot(p);
for y in [1..p-2] do
for s in [0..((p-1) div 2)] do
a:=g^(2*s);
if a eq (base!2)^y then
    flag:=IsPrimitive(base!2);
    if flag and not (y mod 2 eq 0) then
        print "bad1:", p,y,s,Order(base!2);
    end if;
    if flag and (y mod 2 eq 0) then
      gp join:= {p};
    end if;
    if not flag and (y mod 2 eq 0) then
      bp join:= {p};
    end if;
end if;

end for;
end for;
end for;

print bp meet gp;
</code>

Primes having 2 as a primitive root


Clique in P when the input graph's connected components have at most $3\log|V|$ vertices?

Question: What's the time complexity of the clique problem for input graphs where each connected component has size at most $3\log|V|$? Is it in P?
Comment: Yes it is in P for any constant $c$.  What you are basically saying is that your graph has logarithmic size of the input, and then we allow (single) exponential time in the size of the actual data we use, which turns out polynomial in $n$.  For any $c$, we have that $2^{O(c \log n)} = n^{O(1)}$.
Answer: Indeed, it is:
Consider the input $G,k$. First, it is easy to verify that the sizes of the connected components are as required.
Now, if $k>3\log |V|$, then clearly there is no clique of size at least $k$.
Otherwise, we can find the maximal clique in each component by considering all the subsets of the component.
For a component of size $3\log |V|$, there are $2^{3\log |V|}=|V|^3$ possible subsets of vertices. Once we identified the maximal clique in each component, we can compare this size to $k$, and return the answer.


How can I disable 'issues by email' on github.com?

Question: I'm not quite sure what the feature is called — I can't find any references to it, which is part of the problem — but GitHub Issues allow response by email, which is then added as a comment on the Issue. I'd like to disable that because it adds too much noise to comments.
Comment: So you want to disable all email replies to issues on a repo you own?
Comment: @ZachSaucier yes, specifically the "email gets converted into an issue comment" part of it.
Answer: This is currently impossible to disable. There is currently a dear-github post about it, but GitHub has yet to respond. There is no mention of an ability to disable this "feature" in the release notes nor anywhere else that I could find.
I'd recommend putting something in your README about not using email replies, messaging any users who are particularly bad about replying to the emails, and editing issues to fix any problems when it does happen.


Compressed air cans vs regular compressed air

Question: I have recently learned that when spraying a can of compressed air (the ones you buy in the store) it is very cold and will freeze things especially if you hold it upside down. I know that these air cans don't contain regular air, so my question is can i achieve the same freezing effect using regular atmospheric air? And if so how do i do it?
Comment: Hi Victor. See my answer to [Why does deodorant always feel cold?](http://physics.stackexchange.com/q/78687/). The cooling is mainly due to the evaporation of the solvent. Just using air won't give you very much cooling because the heat absorbed by expanding air is far smaller than the heat absorbed by the latent heat of vaporisation of the solvent.
Comment: You have to pressurise and compress the air.
Answer: Very likely the gas in the can is not air at all but rather some non-flammable hydrocarbon gas that's environmentally safe by today's standards. Freon was once used, but that's no longer considered safe for the ozone layer. I believe this to be so because of the comment you made - that there is a difference when the can is inverted.
For the typical aerosol can with seams I do not believe you can compress air to a high enough pressure to get a freezing temperature upon expansion of the gas through a the typical aerosol can size valve. In comparison I do know however that SCUBA tanks can create freezing temperatures at the valve upon release of the air compressed within. SCUBA tank pressures range from 2000 to 3000 psig, much higher than the typical aerosol can is able to withstand. And the cooling effect for a SCUBA tank is independent of whether the tank is upright or inverted. I know this from experience.
Very likely the gas in your can is a hydrocarbon.
When you shake the can do you hear or 'feel' resistance of a of what might be a liquid within?
When you invert the can and spray it do you see a 'mist' or liquid being ejected?
What do the contents labeling say?
Comment: Thank you for this answer. I found out that the reason it freezes is because the gas is compressed liguid which very rapidly becomes gas when sprayed.


Is every manifold sigma-compact?

Question: Thanks for reading my post. Here is my question. I want to know if every surface is hemicompact, i.e., there is a compact exhaustion. I think that question could be asked for every manifold. I know that every locally compact and sigma compact space is hemicompact. Any manifold is locally compact, and second countable, so I wonder if these imply that the countable basis could be choosen in such way that every open subset in the basis is precompact, and therefore sigma compact. Thanks in advance for your answer.
Comment: There is a basis formed by standardly embedded balls.
Comment: Every metrizable manifold is $\sigma$-compact, and your definition of *manifold* implies metrizability. The [long line](http://en.wikipedia.org/wiki/Long_line_%28topology%29) is a non-metrizable manifold that is not $\sigma$-compact.
Answer: Yes.
Every topological manifold has a countable basis of precompact coordinate balls. By taking the closure of these coordinate balls, the manifold can be shown to equal the union of countably many compact sets.
You may refer to the answer to another question.
Locally Euclidean Hausdorff topological space is topological manifold iff $\sigma$-compact.
Answer: Really just a remark but an uncountable disjoint union of circles is locally-Euclidean, Hausdorff and not $\sigma$-compact. Any compact subset intersects at most finitely many circles so a countable union intersects at most countably many circles.
Comment: Your example is not second countable, so it doesn't match the definition of a manifold used by math_failure.

Is every manifold sigma-compact?


clear(1) after detach in GNU screen

Question: I run irssi in screen and I want screen to automatically blank the terminal (scrollback) after detach.  I found out that screen has a command called "blanker" that can clear the screen, but I don't see a way to do it automatically after detach (whether remote or via C-a d).
Answer: When you run screen, it sends (among other things) the strings defined in the terminal description for starting/stopping full-screen operation.  These are ti and te (in termcap), smcup and rmcup (in terminfo).

When you start screen, or attach to a session, it sends ti (smcup).
When you stop screen, or detail from a session, it sends te (rmcup).

Depending on the terminal description, they may be used to switch xterm (and similar terminals) to/from the alternate screen.  For most terminals, switching back to the normal screen from the alternate screen makes it seem as if the full-screen application had been cleared from the screen.  (With xterm, you can switch back and forth using menus: the data is still there until it is cleared).
You could force screen to always use the alternate screen by

specifying a particular value for the term option, or
using the termcap/terminfo tweaks to modify the ti/te (smcup/rmcup) settings

Either way has drawbacks (because you might run screen on a different terminal type), but the latter is more likely to work since it does not interfere with the ability to use special keys (cursor- and function-keys).
If you prefer screen to use the alternate screen of the xterm-like terminal, you could add to your .screenrc file
termcapinfo xterm*|rxvt*  te=\E[?1049l:ti=\E[?1049h:

If you would rather not use the alternate screen, you could redefine te to clear the screen:
termcapinfo xterm*|rxvt*  te=\E[H\E[2J:ti=\E[H\E[2J:

Further reading:

16.3 The termcap command (GNU screen manual)
Why doesn't the screen clear when running vi? (xterm FAQ)
Answer: Had the same problem with urxvt. Found the fix here:
in .Xdefaults:
urxvt*termName: rxvt-256color

in .screenrc
term rxvt-256color

clear(1) after detach in GNU screen


What will affect the value of Young's modulus?

Question: What will affect the value of Young modulus? Is it a constant for every material no matter how you change the length or area?
Comment: Does this answer your question? [What factors affect the Young's modulus of elasticity?](https://physics.stackexchange.com/q/247785/)
Answer: Yes, but only under certain conditions like small stresses and strains and within the elastic limits of the material. Real world materials are isotropic meaning that they will have different characteristics in different orientations. Youngs Modulus is also a derivation from Hookes law, which most materials will obey under small stresses and strains, but will often become non elastic under big stresses or strains, including affects like atomic slippage and breaking. Temperature can change the characteristics of a material, and volume of the material can introduce physical defects like cracking that can break the elastic behavior too. Youngs Modulus is the ratio between stess and strain for elastic materials only.
Comment: Real world materials are _sometimes_ isotopic. Any good mechanical engineer will be able to tell you the impacts on mechanical properties of, say, a rolling mill (which leaves the material in an anisotropic strain state).


Particular function communication complexity computation

Question: Consider a boolean function $f:\{0,1\}^n\rightarrow\{0,1\}$. If $f$ satisfies $f(\bar{0})=0$ where $\bar{0}$ is vector of $0$, $f(x)=1$ with every $0/1$ vector of hamming weight $1$, then communication complexity of function is $\Omega(n)$. This is claim $4.23$ in Jukna's book. If $f$ satisfies $f(\bar{0})=0$ where $\bar{0}$ is vector of $0$, $f(x)=1$ with atleast $r$ number of $n$ of $0/1$ vectors $x$ each of Hamming weight $1$, then is communication complexity of function $\Omega(r)$? Could this possibly have truth?
Answer: There is a cheap lower bound of $\Omega(r)$ obtained by reduction. Suppose for simplicity that the $r$ dIstinguished coordinates are the first $r$. Let $g(x_1,\ldots,x_r) = f(x_1,\ldots,x_r,0,\ldots,0)$. Your condition on $f$ implies that $g$ satisfies Jukna's condition on $g$, so $g$ has communication complexity $\Omega(r)$. Any protocol for $f$ also works for $g$, so we get a lower bound of $\Omega(r)$ for $f$.
Comment: Updated my answer, though I'm sure you could work out the details yourself. Working out things yourself is important to obtain a real understanding, let alone the ability to do research.
Comment: Thank you. I am sorry $f(\underbrace{0,\dots,0}_{r\text{ times}},\dots,\underbrace{1,\dots,1}_{r\text{ times}},\dots,\underbrace{0,\dots,0}_{r\text{ times}})$ where each sequence of $0/1$ is $r$ in length will have no guarantee to be $1$ since $(\underbrace{0,\dots,0}_{r\text{ times}},\dots,\underbrace{1,\dots,1}_{r\text{ times}},\dots,\underbrace{0,\dots,0}_{r\text{ times}})$ does not have Hamming weight $1$. Am I missing something?
Comment: It is $g$ that satisfies the Hamming weight 1 condition.
Comment: I understand that input to $g$ is of Hamming weight $1$. However, you are expanding input aritifically by repeating $0$s/$1$s. $f$ satisfies $f(x)=1$ when $|x|_{HAMM}=1$ with atmost $r<n$ such $x$ vectors. Expanded input to $f$ is no longer hamming weight $1$.
Comment: Ah, now I understand your question. A similar reduction would work for your actual question. Pick the $r$ good coordinates and fix the rest to zero. Then you get an $\Omega(r)$ lower bound.
Comment: COuld you please write it down? This is what I am missing.


When a recipe asks for 1 cup of sugar, should I assume powdered or tiny crystals form?

Question: When a recipe asks (without clearly specifying) for 1 cup of sugar, should I assume powdered or tiny crystals form?
Answer: "Sugar" without any other description refers to granulated sugar. Granulated means crystals somewhat larger than the crystals in caster sugar, which is another commonly used crystal sugar in the UK. In other countries these smaller crystals may also be called superfine sugar or baking sugar. You can generally use granulated or caster/baking/superfine sugar interchangeably, but the volumetric measurement (spoons or cups) will be slightly different since granulated sugar is coarser than caster sugar. You might find this Sugar Conversion Tool helpful.
If the recipe wants you to use the powdered form of sugar, it will specify powdered, confectioners or icing sugar, which are all the same thing.
Comment: FYI, Caster sugar is only commonly used in_baking_,  in the UK. Recipes would specify caster sugar if required, otherwise I would assume 'sugar' to mean granulated as well.
Comment: @ElendilTheTall OH! Thank you. I'll edit accordingly.
Answer: It asks you to use white crystal sugar.

If you needed powdered sugar, it would use one of the following words: powdered sugar, confectioner's sugar or icing sugar.
Some supermarkets sell "baking sugar" which is still in crystals, they are somewhat smaller, so they dissolve faster. Most recipes don't need this kind of thing, it is required to make your almost perfect cake one percent more fluffy, but an eater has to be pretty perfectionistic to notice the difference. Also, it only works with recipes which measure by weight. In almost all cases, you are better off to buy the plainest sugar you can find.


To find unique positive integer n for which $S_n$ is integer

Question: For a positive integer $n$,  let $S_n$ denote the minimum value of the sum $$\sum_{k=1}^n \sqrt{(2k-1)^2+(a_k)^2}$$ where $a_1,a_2,a_3,....,a_n$ are positive real numbers whose sum is $17$. If there exist a unique positive integer $n$ for which $S_n$ is also an integer.
I got the answer as $12$ using some basic arithmetic but I want to know whether there are any other methods to solve like the Cauchy Schwartz Inequality, or the AM-GM inequality.  Thanks in advance
Answer: You can use a form of Minkowski's Inequality, namely:
$$\sum_{i=1}^n{\sqrt{a_{i}^2 + b_{i}^2}} \ge \sqrt{(\sum_{i=1}^{n}a_i)^2 + (\sum_{i=1}^{n}b_i)^2}$$
Also you can note $\sum_{i=1}^{n} (2i-1) = n^2$ and that should get you there.
This and other solutions are presented here
Answer: Consider $n$ right triangles joined at their vertices, with bases $a_1,a_2,\ldots,a_n$ and heights $1,3,\ldots, 2n - 1$. The sum of their hypotenuses is the value of $S_n$. The minimum value of $S_n$, then, is the length of the straight line connecting the bottom vertex of the first right triangle and the top vertex of the last right triangle, so
$$S_n \ge \sqrt {\left(\sum_{k = 1}^n (2k - 1)\right)^2 + \left(\sum_{k = 1}^n a_k\right)^2}. $$Since the sum of the first $n$ odd integers is $n^2$ and the sum of $a_1,a_2,\ldots,a_n$ is 17, we get $$S_n \ge \sqrt {17^2 + n^4}.$$If this is integer, we can write $17^2 + n^4 = m^2$, for an integer $m$. Thus, $(m - n^2)(m + n^2) = 289\cdot 1 = 17\cdot 17 = 1\cdot 289.$ The only possible value, then, for $m$ is $145$, in which case $n^2 = 144$


What is the 2's complement answer of 16.5?

Question: According to this post it is saying Two's complement is only for integers, but in Wolframalpha is is saying the Two's complement of 16.5 is 0010000.1, how?
Comment: There are different names for one and the same thing. And there are different things going by the same name. Welcome, stranger. We call the prominent centre of attraction "earth". Gravity is a misconception: earth sucks.
Answer: It seems that WolframAlpha is using fixed-point representation. In effect, it is doubling your number and then representing it as two's-complement.
In more detail, WolframAlpha is guessing that you are interested in fixed-point representations of the form
$$
xxxxxxx.x
$$
in binary, that is, 8 bits in total, with the "decimal" point at the fixed position between the 7th and 8th bits. Using two's complement, you can represent all numbers from $-64$ (represented as $1000000.0$) to $+63.5$ (represented as $0111111.1$).


deleting contacts in watsapp

Question: If I've deleted a contact from my phone, but they still show in watsapp is this because they haven't deleted me from their phonebook? Also, if messages deliver but are not read, does this mean your blocked? Or is it more likely read receipts are off or your 'muted'? I cant understand how calls are blocked but watsapp messages deliver? Thanks
Answer: The contact which you deleted from Contacts list might still appear on Whatsapp, if the Contacts list of Whatsapp isn't refreshed. However, on newer versions of Whatsapp, this happens instantly. And no, it has nothing to do with your number being saved on their Contacts list.
Coming to the scenario related to blocking, once you block a contact on Whatsapp, the message is sent from their phone but not delivered to you, in which case they get a single tick, this however stays the same even after you unblock them, i.e. you still wouldn't get their message. This is so because the message sent by them is stored on Whatsapp servers rather than being delivered to you because they were blocked. With calls too, the person who is blocked cannot get their call through to you if they are blocked.
I would like to suggest you to first search for information already present on Google before posting a question.

deleting contacts in watsapp


Am I able to carry on a small Swiss army knife?

Question: I usually carry around a small Swiss army kit my set of keys which contains a small knife inside the slot which is about 1 inch in height and very thin (see link for better picture, and it is described as a blade, not a knife in the picture)
https://www.swissarmy.com/us/en/Products/Swiss-Army-Knives/Small-Pocket-Knives/Classic-SD/p/0.6223
One day when I was going through TSA airport security, I forgot to take off the kit and leave it at home. To my surprise I was able to get through without a problem, or anyone asking me questions. When looking at the TSA prohibited items (link below for reference) it looks like I am not able to bring it onto the plane.
https://www.tsa.gov/travel/security-screening/prohibited-items
Question: Was the Swiss kit with the knife overlooked by the TSA? If not, is it an allowed carry on item?
Comment: Mine was taken away from me on spot at Heathrow. However there was no weird looks which suggests they are familiar with many people making the same mistake. I think carrying a Swiss army knife is not the same as carrying a knife.
Comment: I've carried the same thing (a victrinox key ring knife) on numerous flights. I've never presented it to anybody, but my bag has been examined lotsof time and it was never commented on.
Answer: Here's what the TSA website says for "small swiss army knife":

Check Only
In general, you are prohibited from traveling with sharp objects in
  your carry-on baggage; please pack these items in your checked
  baggage. Scissors with blades smaller than 4 inches, small needles
  carried for special medical needs, and other sharp objects that do not
  contain a blade may be placed in carry-on baggage.
Any sharp objects placed in carry-on or checked baggage should be
  properly sheathed or securely wrapped to prevent injury to TSOs and
  baggage handlers.
Even if an item is generally permitted, it may be subject to
  additional screening or not allowed through the checkpoint if it
  triggers an alarm during the screening process, appears to have been
  tampered with, or poses other security concerns. The final decision
  rests with TSA on whether to allow any items on the plane.

If it has a knife, it is not an allowed carry-on item. It is likely they either didn't notice or didn't care. The TSA does not have a stunning track record when it comes to detecting dangerous prohibited items.
The TSA a few years ago did briefly propose allowing small knives, claiming that the new policy would allow them to better focus on bigger threats, but dropped the plan after serious opposition by pilots, cabin crew, and members of Congress.
Comment: Small knives are allowed again in Europe, so in this case the rules do differ.
Comment: @Willeke Really? I came across this question when I was searching for the exact same thing for European airlines. And their websites say no": https://www.eurowings.com/en/information/services/help/questions/what-items-may-not-be-carried-in-hand-luggage.html At least it doesn't necessarily apply to all airlines, it seems.
Comment: @Willeke if they did allow you to carry a knife of any sort onto a plane at Bristol then security is breaking the law. It's allowable in hold luggage .https://www.gov.uk/hand-luggage-restrictions/personal-items
Comment: @Willeke. My wife was refused to take a swiss-army knive on board flying from Lisbon to the Netherlands (within EU!), so don't count on it. They were kind enough to show us a way to mail it home for a few euros.
Comment: Yeah that is what I figured, especially since it was the TSA
Comment: @JIXiang, it can be that the site has not been updated, but it is not airlines that make the rules. The security at the airports do allow small knives, for Bristol airport they mention 6 cm. And my small swiss army knife has been measured several times and been allowed on flights.
Comment: @Sarriesfan That site does not mention knives with blades shorter than 6 cm, they do mention blades over 6 cm and that they need to go into hold luggage. As my knife has been measured several times and was allowedd through, I am pretty sure that European law/airport security rules allow them again. (And I have been told that as well.)
Comment: @Willeke Schiphol also lists as not permitted [on their website](https://www.schiphol.nl/en/page/prepare-your-bags-for-travel/): *Objects with a sharp tip or edge that may cause serious injury*. They also mention 6cm, but not in relation to knives: *Small scissors, nail files or tweezers may be taken on-board if the sharp part is no longer than 6-cm.*


Seed/key algorithm security

Question: Currently I'm working on implementing a seed/key algorithm to limit access to a tool for authorized users. My understanding of the algorithm is that its strength is derived from the seed itself. However the majority of articles say "The basic idea is that the server provides a seed -- a short string of byte values -- and the client is required to transform that seed into a key using a secret algorithm." If the algorithm's security is based on the seed, why is it "a short string of byte values" instead of the longest possible string of byte values?
Comment: As it stands it is unclear what kind of algorithm or protocol you're trying to implement. And using a "secret algorithm" goes against Kerckhoff's principles. So please add information about what scheme you are trying for. Names, articles, anything.
Comment: A seed initializes a PRNG; it is not the key, so seed length doesn't inherently impact the security of the key material provided you have a strong PRNG and key algorithm.
Comment: I see my misunderstanding now. So then a public seed wouldn't necessarily undermine the security of the algorithm either?
Comment: What do you mean by "public seed?" A seed value, by definition, will generally result in a deterministic result. As a rule of thumb, and lacking any knowledge of how you're transforming the seed, you shouldn't make your seed value public if you want your generated hash or key to be unique.
Comment: @MaartenBodewes To be honest, I'm only beginning my research so I don't have any examples yet. Thank you for referring me to Kerckhoff's principles I was unaware of them. Could you clarify for me how an algorithm and seed could be public yet the key remains a secret (not reproducible)?
Comment: Depends what you mean with seed. Seed is generally used as input for a random number generator. Of course, if a random number generator is used to generate a random stream, then the seed should be secret itself. Seed is also sometimes used as input for a key derivation function. In that case the same principle holds. I don't understand what scheme you're trying to describe, but as it stands it doesn't look very secure. I guess you need more information to come up with a system. We cannot do that for you as the requirements / threat factors and current system are unclear to us.
Answer: "Short" and "long" are relative terms.  If I secretly make 128 coin flips and write down the results, that sounds like a lot of coin flips, doesn't it? There's $2^{128} > 10^{38}$ combinations I could get, a number bigger than 1 with 38 zeroes after it, so you have no hope of guessing what results I got.
Yet that unguessable result fits in $128 ÷ 8 = 16$ bytes, which almost everybody would call short byte string.  That is, it's short if you're trying to store it in a computer, but impossibly long if it was picked at random and you're a bad guy trying to guess it.
Modern symmetric cryptographic algorithms come in 128-bit and 256-bit strength, whose keys fit in 16 and 32 bytes respectively, and there's no need for their keys to be any longer.  Many public key algorithms do use longer keys (for technical reasons) but even there we're talking about kilobytes at most for popular ones.

Seed/key algorithm security


What is the difference between work function and the ionization energy?

Question: So for a hydrogen atom, an electron at n=1 would require 13.6eV of energy to be excited to the infinite energy level, so thats ionization. Is the work function the energy to overcome the attraction between the ionized electron and the nucleus?
Comment: From Review : If you are not satisfied with the current answers or those in the cited question, and wish this question to be reopened, please explain why these answers fail to answer your question.
Answer: When were talking about the work function, we're usually referring to the surface of a metal, say, Sodium! So the work function would be the minimum energy required to remove an electron from the surface of Sodium. This minimum energy is the energy required for just removing an electron. The electron emitted has 0 kinetic energy.
Think of it this way. This is the energy required by an electron to escape the metal lattice. Whenever atoms of an element combine to form a compound (or lattice), the properties of their electrons is different from what it is in the element's individual atom. The electron in a sodium atom is its own, while in a sodium metal lattice, the electron isn't its own anymore. It is attracted by the other atoms and also repelled by the electrons of the other atoms. In other words its energy changes. That's why the ionisation energy is different from the work function of a metal.
The difference between work function and ionisation energy lies in their definition.
Ionisation energy is the energy required to remove an electron (first ionisation energy is the energy required to remove the outermost electron, second ionisation energy is the energy is the energy required to remove the next and so on so forth) from an isolated, gaseous atom of an element.
The difference is one concerns the surface of the substance while the other concerns an atom of the substance in the gaseous phase.
Comment: Ahhh this makes much more sense, so the work function for sodium let say is still taking an electron from a lower energy to that outside of the metal ? Or is it just the surface electrons at the outermost layer?
Comment: @Zefty It (work function) is the energy to remove an electron from the lattice. The electrons in the lattice are those from metallic bonding (usually the outer electrons). Does that clear your doubt?
Comment: ok and ionization energy is to remove the electron from an isolated atom? while work function is the electrons in metallic bonding
Comment: If asked in an exam you should be saying that work function is the energy required to remove (or free) an electron from the surface of a metal. While Ionisation energy is the energy required to remove an electron (which electron we're removing depends actually ) from an isolated **gaseous** atom. Clear now?
Answer: The work function energy is the minimum energy that an electron need to escape from inside the surface of solid to outside the surface of a solid, the solid being made up of many atoms .
The ionisation energy is the energy that an electron (usually the most loosely bound) needs to escape from the (one) atom completely.
Comment: But isnt removing the electron from the surface to outside of the surface kinda completely removing the electron?
Comment: But it is not removing it from an individual atom. In a metal there are free (not bound to a particular atom) electrons.
Answer: Generally the work function is defined for a crystalline solid with a band structure, like a metal. The work function is the energy required to extract an electron from the conduction band to the vacuum.
The ionization energy is the energy required to extract an electron from a neutral atom in a gas. As you can see the two concepts are similar but in a different context.
Comment: Sorry but you lost me at conduction band. I forgot to say im learning high school physics


Git merge feature branch WITHOUT any commit history

Question: say I create a new feature branch and make bunch of commits to the feature branch. My colleague also makes some commit so the master branch. How do I merge my change onto the master branch but master branch show one single commit? I have tried merging, all commits show up and it shows that I branch out. I've tried rebasing, which doesn't show me branching out but still shows all my commits. Thanks in advance for your help.
Answer: Use git merge --squash (which forces you to also use git commit afterward).
Description
In Git, the commits are the history.  You can't add commits without adding history, because these are the same thing.  What you want, then, is to make a single commit that is not a merge commit that produces the same result as if you had made an actual merge commit.
There are multiple ways to do this, but the simplest one is to use git merge --squash.  This command performs what I call the "verb part", to merge—to perform the action of merging—but instead of making a merge commit, which is the adjective or noun part of a typical git merge, it makes an ordinary, non-merge commit.
More precisely, it skips the final commit, forcing you to do it yourself, using git commit.  The final commit, which you must make yourself like this, is an ordinary non-merge commit.  If we draw the commits the way I like to, we start with this:
...--o--o--o   <-- mainline
      \
       o--o--o   <-- yourbranch

If you make a normal everyday merge using git checkout mainline; git merge yourbranch, the result is:
...--o--o--o---M   <-- mainline
      \       /
       o--o--o   <-- yourbranch

which is why your three commits are now added to the main-line branch: commit M, the new merge, has two parents, one of which is the original main-line and the other being your own branch.  (Your three commits are now on both branches.)
If we use git merge --squash, however, we get this instead:
...--o--o--o---S   <-- mainline
      \
       o--o--o   <-- yourbranch

The contents associated with new commit S are exactly the same as the contents you would get by making commit M, but new commit S has only a single parent, so it does not associate your three commits into the main-line branch.  You are now free to delete your branch in the future.  When you do this, your three commits become impossible to find, and relatively soon, Git actually removes them entirely.1
Note that your branch does not go away on its own.  The name yourbranch here keeps your original three commits alive.  However, if you do more work on your branch, that's not very useful: once you've squash-merged (and committed), you should generally consider your branch "dead", and remove it once your squash-merge-commit S is reasonably solid.  You might want to retain it for a while, though, in case S turns out to be bad and you or your group choose to revert S: in this case, you can fix up your own branch, and then re-do the git merge --squash later, using the updated version of yourbranch.

1Normally, Git tries hard to make sure that apparently-deleted commits stick around for at least a month or so.  However, if you delete the branch name itself, the branch's reflog, which is one of the things that keeps the commits around, goes away as well.  You now rely on your HEAD reflog.  If you had the commits checked out in this repository, that will also keep the commits around for a month or so, but if not, it won't.
Answer:
How do I merge my change onto the master branch but master branch show one single commit?

This is somewhat ambiguous.
A normal merge does add a single new commit, but that new commits incorporates all the commits from the "other" branch into "this" branch's history - they all become "reachable" from this branch - so the default output of commands like git log shows all of those commits, as you've observed.
If the only requirement is to see the history without seeing the individual commits from the "other" branch, the simplest solution is to say
git log --first-parent

This allows you to condense the view of history without actually discarding any information.  It can be useful if there might be a case down the road where you want the more fine-grained history of how the branch evolved - such as tracking down a bug.  It also makes sure that if you do more work on the "other" branch, you're still able to merge those additional changes without a lot of unnecessary hassle.
In particular, the information that's retained could be particularly important if the "other" branch has been shared with other developers - which is the most common assumption if you've ever pushed the "other" branch.
But sometimes the individual commits are entirely useless from a historical standpoint, and the intent is to discard them entirely (along with the branch that comprises them).  For example, maybe you commit regularly, no matter what state your code is in, inserting and removing debugging code as you go, storing states that don't build and pass tests, etc.  There are reasons such a workflow might be used, and in that case, a squash merge (or an interactive rebase in which you squash individual commits) can be desirable to produce a "clean" history.
You can try to "have your cake and eat it to", but using a --squash merge to create a simplified history while still keeping the original branch around for a fine-grained history.  But git will in that case lose track of the relationship between the histories, and this can easily lead to far more trouble than it's worth.
In the end it depends on the workflow you (and your team, if applicable) settle on.  Just be aware of what you're doing and why, because on the surface it appears that you might be asking for a sledgehammer solution to a penny nail problem, and if so you should be aware of the collateral damage.


Blender model adds extra materials when imported to Unity

Question: My model is made up of a few other models I made before, I combined them using Ctrl + J, in Blender it tells me I have 1 Material, but once I import it into Unity It gives me extra Materials from those models I joined together.
How do I keep it as 1 Material when I import it into Unity?
Comment: Please give an example picture
Answer: Without files hard to say for sure, but my guess would be that this is because of blender's way of storing a set of polygon texture references separate from materials and in some cases also exporting that. This happens usually when you select texture in uv view while having faces selected; blender links the texture to only selected faces.
There's (at least) two ways to fix this:

Blender way: select your object, while in edit mode hit A to select everything, go to uv view and select everything there as well. Then at bottom of the view select texture. (this way every face has the same texture and as result there should be only one material named after texture you selected)
Unity way: I prefer this way and am pretty sure this would be the better for your situation as well: in unity, open model import settings, find second last item Material Naming and set it to From Model's Material. This way should make sure no other than explicitly created materials are imported.
Comment: I've tried the Unity way and it's still Screwed up. I'll take a look at the Blender way and see if that helps.
Comment: What is "polygon texture references"? From your description looks like you mean way of assigning textures which works based on face textures, only ones selected get the texture. Note that this works that way only in Blender Internal. Also there isn't UV view, most likely you mean UV Image editor window.


Sum of energy for 2 solids in rotation

Question: I would like to compute the sum of energy of the following case:

Two solids are turning (disks). Yellow solid is turning at $w_1$ radians per second around its center of gravity and blue solid is turning at $w_2$ radians per second around its center of gravity (red point). Yellow solid is forced to be outside radius due to centrifugal forces. Yellow solid has no axis of rotation. Grey solid force yellow solid to turn at $w_2$ around red point too. Greys walls are building for have a torque from yellow solid to grey solid, even this torque exist just one moment. Blue solid and grey solid are glue together and grey solid has no mass. The yellow solid has a mass $M$ and a radius $r$. Inertia of yellow solid around its center of gravity is $I_1$. Inertia of blue solid around its center of gravity is $I_2$. Force $F_1$ must be different in value than $F_2$.
$\text{Energy of blue disk} = \frac12 \, I_2 \, {w_2}^2$
$\text{Energy of yellow disk around red point} = \frac12 M (w_2\,d)^2 $
$\text{Energy of yellow disk around its center of gravity} = \frac12 I_1\,(w_2+w_1)^2 $
So the sum of energy is:
$E = \frac12 I_2 \, {w_2}^2 + \frac12 \, M \, (w_2 \, d)^2 + \frac12 I_1 (w_2+w_1)^2 + \text{energy from friction}$
Like that it's seems the sum of energy is not constant. Because $\frac12Md^2 >> \frac12I_1$ and without take in account the energy from friction. If $w_1$ decrease $w_2$ increase. The second of Newton says $T=I\alpha$, new $w_1$ give $w_1=w_1+\alpha t$ and new $w_2$ give $w_2=w_2+\alpha t$, it's linear. But the formula of energy is a square function. When yellow disk lost $w_1$ it win $w_2$.
So, how can I do for compute the sum of energy exactly, please ?
I don't know if it's visible but $F_1$ in the last image goes to the center of rotation of the blue disk. It's important to notice that forces can be like that:

If forces goes to center of rotation of blue disk, there is no torque on it, so no work too. In the contrary, torque on yellow disk can change the energy of yellow disk. For the same work from friction I think. So, maybe these forces can't exist like that, so why ?
Comment: The energy from friction?
Comment: Friction _always_ removes energy.
Answer: There are a couple things missing.

The normal forces corresponding to the friction forces $F_1$ and $F_2$. Specifically $F_1$ as the velocity is not perpendicular to the force, so it can be used to do work transferring energy from one disk to the other.
Conservation of angular momentum about the red dot. This can be used to figure out the final angular velocity
It looks like you are using $\alpha$ for both the angular acceleration of the blue disk and the angular acceleration of the yellow disk, even though they are not equal. The same applies for the torque.

Sum of energy for 2 solids in rotation


BigQuery API vs BigQuery Tools

Question: I am  looking at extracting data from BigQuery and I have found out that it can be extracted using API or tools. Does any one know the advantage of using API over tools?
One of the things I can think of API advantage is that, with API data extraction can be scheduled for fixed time intervals.Are there any other advantage of using API's?
Basically I want to know when to use API vs tools.
Answer: To state it explicitly, the BigQuery tools including the BQ CLI, the Web UI, and even third party tools are leveraging the BigQuery API to enable whatever functionality they expose.  Google also provides client libraries for many popular programming languages that make working with the API more straightforward.
Your question then becomes whether your particular needs are best served by using one of these tools or building your own integration with the API.  If you're simply loading data into tables once an hour, perhaps a local cron job that calls the BQ CLI tool is sufficient.  If you're streaming some kind of event record into a table as they happen, the API route may be more appropriate as you're integrating more deeply into your own software stack.

BigQuery API vs BigQuery Tools


Is there any way to find out the majority color in an image file in java?

Question: I want to find out the majority color in an image file and set it to background of a swing frame. What should I do?
Comment: What kind of image file? Do you know how to read in an image file?
Comment: Any kind of file jpeg, png, gif, or any other. Any example image file you can take.
Comment: How to determine the most frequently used colors in an image file http://sourceforge.net/projects/jiu/forums/forum/51534/topic/3883065 or http://www.daniweb.com/software-development/java/threads/335957
Answer: you need to extract RGB percentage value from your Image for this some algorithm is there which give RGB value. And you also need to divide your whole image into some parts (example Nine square) and then get the RGB value and by this way you get the color which is more in your Image.
May be this will help you.
Answer: You can yourself do this by traversing each pixel in image and then getting color for that. and then increment counter for each color found.
Answer: It all comes down to efficiency. You could literally read every RGB value of the image, and find the Mode, but that would take a long time.
Rather, what I would do is simply split the image into parts, lets say 100 Squares or something. We take the value in the centre of each square, and whichever appears the most is PROBABLY the most common color. Yes, this is sort of risky, because what if the image just happens to have a less used color in ALL the pixels you evaluated. The best thing to do would be to first of all, have a range, so if you get similar rgb's like (0,2,0) and (0,0,0)  you simply treat them as the same.
The next thing you should do, is take about 10% of the image as a sample. It's very likely you will get the proper answer. So, if the image is 500px, use 50px as a sample, evenly distributed along the picture.
This is a trade off between accuracy and speed, because checking the whole image would take a very long time, and doesnt make sense.


iPhone Reminders how to determine account

Question: How do I see which account my lists belongs to in the Reminders app? I'm using an iPhone with iOS 7.
Answer: When you open the reminders app, it will either show a display of all the lists or show you the items in one list.
If you are in the detailed view, tap the white area at the bottom of the screen to bring up the List View.
Each list that is synced through a cloud service has that service listed in grey to the right of the item count. Those without text are stored on the device only.


How to strain yogurt

Question: What is the best method for yogurt straining? cheesecloth? yogurt strainers? coffee filters? I appreciate it if you could share your experience.
Answer: Yogurt is a protein mesh that traps the rest of the milk components. Many of the trapped components are water soluble- in particular un-denatured albumin, residual lactose, lactic acid, and riboflavin. The water and these water soluble components are the whey.
Draining off the whey makes the yogurt thicker, and sweeter as some of the acid washes away.
Stir the yogurt well to break up as much of the protein mesh as possible and free the trapped whey.
Then do as Elendil suggests and hang the yogurt in a cloth to drain for a couple hours. I use sturdy mesh cloth from the remnants pile at the fabric store. Cheesecloth is too fragile to be used very many times. How many times can cheesecloth be reused?
Comment: Paper towel will also work in a pinch. Don't hang it obviously. We put it in a colander.
Comment: I also use a metal mesh colander. It works fine.
Comment: @michael- That is surprising. I would think that would need to be a fairly tight mesh?
Comment: @Sobachatina It does seem strange, but michael is right. Just a standard fine sieve works just fine as long you don't put any pressure on it.
Answer: I usually hang it in cheesecloth or muslin, over a bowl or the sink. This works fine and has the benefit of being washable and reusable.
Comment: I second you, in India a sweet yoghurt dish is made with strained yoghurt, yoghurt is hung in muslin cloth for some time and then cardamom powder with sugar, confectioner's sugar, is mixed
Answer: A tea towel in a colander also seems to work. I'm doing it right now and the results look pretty good.
Answer: I have tried the paper towel in colander and it works great. I left it overnight and had thick creamy yogurt for raita and chicken marinade.

How to strain yogurt


Minecraft 1.7.10 + forge

Question: How do I install minecraft 1.7.10 and forge on a raspberry pi 3. Since I have this friend who wants me to install 1 mod to play on his server.
Answer: You should be able to just install it regularly, i.e. download forge from the site, run the jarfile with java -jar (forge-installation).jar
but keep in mind, to use 1.7 forge requires java 7 iirc.
edit: apparently only some builds of forge work, and you don't get sound. I found this information from https://html.dynu.net/index.php/how-to-setup-minecraft-on-raspberry-pi-forge-version-1-12-2/, but it should apply to 1.7 versions as well. Just experiment a bit (and maybe follow the url for the guide i listed, but with a different download).
another edit: apparently it doesn't work that way... try following the guide but using the download for 1.7 forge
Answer: Minecraft is a game that allows users to build with blocks in a 3D environment. There are many different versions of Minecraft, but the most popular one is Minecraft 1.7.10 because it has many mods that allow for more customized gameplay. Forge is a modding platform that lets players install other mods onto Minecraft 1.7.10, and on Raspberry Pi 3s specifically, it's very easy to do!
To install Forge on your Raspberry Pi 3, you'll need an internet connection and your device's IP address handy. First, open up the terminal window and type in the following command: curl -sL https://install forge-1 7 10-installer .jar | java -Xms512M -Xmx2048M -jar installer . jar (Note: if you're using an older version of Java than 8 Update 131, which is what comes preinstalled on Raspbian Jessie Lite 2016-05-27 , then use this command instead: curl -sL https://forge download fileforge 17 10 installer jar | java –version) This will download the Forge installer JAR file from GitHub; once it's downloaded, just press Enter to run it!
The next step is inputting your device's IP address into the text field at the top of the window and clicking "Install." After installation has completed successfully (it should only take a few minutes), click "Start Server" to begin playing on your own private server with all of your friends!
Answer: You can find it in apt try
<code>apt search minecraft
</code>
and you will find it. Then install it with the package name
Comment: What of the 12 shown programs is the right one?

Minecraft 1.7.10 + forge


Better way to check if script is running on dev server or prod server

Question: For several years, I have been using the approach usually recommended to check whether a page was invoked locally or remotely by inspecting whether $_SERVER['SERVER_ADDR'] equals 127.0.0.1 or is empty. This has been discussed in other questions, such as this and this. Other superglobals such as $_SERVER['REMOTE_ADDR'] are also often mentioned.
Over time, I have found that this approach sometimes seems to fail.
What I really want to know is whether the script has been invoked on my dev server (xampp, wamp, IDE debugger...) or on a production server. This is so that paths to scripts above the web root can be properly set. While this works 99.999% of the time, it seems that sometimes, when Apache redirects to a 404 page, the $_SERVER['SERVER_ADDR'] must be lost, and a script running on a production server passes the "local" test.
As a result, I am looking for other approaches. Of course I may be doing something wrong in Apache, but regardless, it would be good to have a foolproof test in php.
A couple ideas came to me, and I wonder if these are safe, or whether someone has a better idea.
A. One idea is to look at the current path: something like
define ( 'DEV_SERVER',

           (substr(

                   strtolower($_SERVER['DOCUMENT_ROOT']),

                   0,8)

            =="c:/xampp")
);

B. Another idea would be to check for the existence of a local file with a particular name, but hitting the file system seems like too much work.
Thanks in advance for all insights!
Comment: Just define a corresponding environment variable (in your apache virtualhost config)
Answer: You could also try gethostname().
Although, the best method is probably to only deploy dev specific stuff to dev servers. I.e. keep those scripts separate to your production / regression testing scripts. You don't want these DEV server specific stuff to accidentally become visible to users.


Water making its way out of the shower pan, bubbling laminate floor. Grout in shower floor stays wet

Question: How do I keep the water inside my shower??
I'm getting water blisters in the laminate floor outside my shower.
My shower is about 3 years old. The enclosure was hot-mopped hardie-backer cement board. Tile is 12x18" slate with sanded grout, with slabs of old pool table slate used for the seat and curb top. The floor is ceramic penny-round mosaic on mesh backing.
The laminate floor in front of my shower curb started developing blister-looking bubbles. When I popped one, there was water inside. When we don't use the shower for a day, the bubbles flatten out! So, it looks like there's water wicking out of the shower and down to the edge of the laminate flooring, where the flooring butts up against the shower. There aren't any obvious leaks in the ceiling underneath the shower, and no surface water on the floor outside after showering.
The grout stays wet in some spots. I ground out the grout where the walls meet the floor, starting with the dark wet spots. Found some voids in the grout under the wall tiles. I turned on a hairdryer on one of the spots and the dark moisture went away after a few hours, but when I turned the hairdryer on to a new spot, the old spot got wet again! I took the drain cover off and it looks like the weep holes might have been plugged. I cleared them, and there does seem to be pea gravel behind the holes.
There are a couple cracks in the penny rounds on the floor of the shower. Also there is a crack where the chunk of pool table we used to cover the top of the curb seems to have lifted off the curb framing. Maybe water got in and the wood swelled.
How do I keep the blisters from returning?
Answer: Need more pics but an educated guess will is
1 the laminate is NOT approved for all wet areas.
2. Seal your  grout its not waterproof
Comment: For sure. What pictures would help?


Structure of Mandelbrot bug antennae

Question: I have analysed the structure of of Mandelbrot set and I have understood something, but I still have some questions, mainly about antennae and little bugs.
Mandelbrot set consists of

the main cardioid,
heads, that are deformed copies of the whole bug,
and antennae (First part of the visible antenna (for example: from ~(-1.4 + 0i) to period 2 Misiurewicz point at ~(-1.543689 + 0i), from ~(-0.109 - 0.895i) to period 3 Misiurewicz point at ~(-0.101 - 0.956i) and from ~(-0.0176 - 0.796i) to period 3 Misiurewicz points at ~(0.00164 - 0.822i) and ~(-0.0000831 - 0.793i)) is the image of the antenna of the bug, image of which the head is. It is not a part of the antenna defined in this point by me.).

The antennae come out of each image of period 1 Misiurewicz point, where from the end of image of antenna coming out of period n head come n-1 antennae (so this image of period 1 Misiurewicz point is period n Misiurewicz point). (Infinitely many images of antennae come out of each head and each of this images has infinitely many ends. Each of the ends is image of period 1 Misiurkiewicz point.)
Main heads going out of the main cardioid have simply periods equal to consecutive natural numbers ... 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7 ... . Besides, between each two neighbouring heads, there is a head with period being the sum of periods of the two heads (I see that my description of secondary heads periods is not unambiguous, but the pattern is obvious, so I hope that you understand it).
Antennae consist of the main little bug, the part before it and antennae coming out of the main little bug, one from each image of period 1 Misiurkiewicz point. Both parts of antennae seem to have Misiurewicz points with each period that appear in heads and images on heads (in little bugs and in main heads), from which they are coming out, but I can't recognize how they are organised. Each antenna comes from image of head with period 2 in image of head with period 2 in ..., so period 2 Misiurewicz points should be common, but they are hard to find. The most important one inside an antenna as I define it, seems to be ~(-1.839286755214161 + 0i).
Structure of copies of antennae in antennae seems to emphasize the copies that correspond to the copy part of which they are.
Main little bug of main antenna coming from main heads with period n have period n+1. How can one determine periods of other little bugs?
Antennae coming out of a little bug dominate in groups of 2k

1+1: part before little bug and antenna from head with period 2 (head 2)
2: 2 1st antennae from heads 3
4: 2 1st antennae from copy of head 3 in head 2 (head 2 3) and 2 1st antennae from head 4
8: 2 1st antennae from head 3 in main little bug from head 2, 2 2nd antennae from head 5=2+3, 2 2nd antennae from head 3 and 2 1st antennae from head 5

What is the pattern, except that 1st antennae from head n come in the group of 2n-2? The fact that the antenna from the period 5 little bug nearer to the end comes in group of 16 and antenna from the one nearer period 3 little bug in group 32 seems to say something about the structure of parts of antenna.
Maybe you know also some strict formulas for the self similarities with deformed copies. For example Julia sets consist of two images of itself coming from two branches of square root function.
I'd like you to correct my description of this structure, answer my questions and supplement it.
Comment: See papers by G Pastor, for example : https://www.researchgate.net/publication/222553783_Operating_with_external_arguments_in_the_Mandelbrot_set_antenna
Comment: @Adam: Than you. Finally I tried to look at the whole paper and I saw something about the structure of antennae. Now I have to understand it.
Comment: Ok. If you need software see : http://mathr.co.uk/blog/mandelbrot.html and http://www.mndynamics.com/indexp.html.
Answer: The real slice of Mandelbrot set consist of

periodic part: period doubling cascade
the Myrberg-Feigenbaum point
chaotic part = main antenna = a shrub of $F_{1/2}$ family

It is descibed in wikibooks based on papers by Pastor and Romero, like : Chaotic bands in the Mandelbrot set October 2004, Computers & Graphics 28:779
DOI: 10.1016/j.cag.2004.06.015

Structure of Mandelbrot bug antennae


Is it possible to create a LAN between Raspberry Pi, Mikrotik Access Point and a laptop?

Question: I need to create a LAN communication between my Windows laptop and a Raspberry Pi. Is it possible to create a network with a following gear and configuration:
Windows Laptop - (Wi-Fi) - Mikrotik Groove Metal - (ethernet cable) - Raspberry Pi. No other clients or sources and special routing tweaks needed. Just a good old LAN connection in within this gear config.
Answer: Given that the Mikrotik Groove Metal is what is commonly called a "WiFi router", I see no reason why it shouldn't work.
Configure both the Windows laptop and the Rasp Pi to use DHCP on their respective connections.
Answer: Set the Wireless interface on the Mikrotik to be a "ap bridge" and configure the settings such as SSID and security profile. Then make sure you have both the Ethernet Interface and Wireless Interface in the same bridge. I would hard set IPs on the Pi, Mikrotik, and Windows computers (192.168.88.XXX) so its easier to access them (say from the laptop to the Pi using SSH). That's one good thing about Mikrotik is that you can configure them how ever works best for you.


caching UIViewControllers on the UIStoryBoard for better performance

Question: I am building a todo app.
I am using the new storyboard option introduced in iOS 5.
i notice VC's are not being cached which creates a performance issue on my app.
one of my app's VC is titled "task details" and is widely use. i noticed viewDidLoad: is called every time the screen is displayed which takes about a second (being a rather complicated screen which is party constructed by code).
at first i used segues and connected other screens to this screen. whenever it was needed i'd use:
<code> [self performSegueWithIdentifier:@"showTaskDetails" sender:self];
</code>
i would prepare it's model with:
<code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender;
</code>
then i noticed the performance issue. i investigated and saw viewDidLoad is loaded again and again. i was forced to stop working with segues and cache the TaskDetailsViewController and manually add it as a modal. I wonder if there is a solution for caching "popular" VCs on storyBoards. Otherwise, i will end up having a half-half solution which will work but les elegantly - and elegancy is important in our profession, isn't it? ;-)
Answer: UIStoryboard does not provide any caching mechanism. You'll have to cache view controllers on your own.
You could cache the data a particular view controller is based on so the load time is faster.


Connection Between Automorphism Groups of a Graph and its Line Graph

Question: First, the specific case I'm trying to handle is this:
I have the graph $\Gamma = K_{4,4}$.
I understand that its automorphism group is the wreath product of $S_4 \wr S_2$ and thus it is a group of order 24*24*2=1152.
My goal is to find the order of the AUTOMORPHISM GROUP of the Line Graph: $L(\Gamma)$.
That is - $|Aut(L(G))|$
I used GAP and I already know that the answer is 4608, which just happens to be 4*1152.
I guess this isn't a coincidence. Is there some sort of an argument which can give me this result theoretically?
Also, I would use this thread to ask about information of this problem in general (Connection Between Automorphism Groups of a Graph and its Line Graph).
I suppose that there is no general case theorem.
I was told by one of the professors in my department that "for a lot of cases, there is a general rule of thumb that works" although no more details were supplied.
If anyone has an idea what he was referring to, I'd be happy to know.
Thanks in advance,
Lost_DM
Comment: Are you sure about the order of Aut(L(K(4,4)))? `Size(AutomorphismGroup(EdgeGraph(EdgeOrbitsGraph(WreathProduct(SymmetricGroup(4),SymmetricGroup(2)),[1,5]))));` gives 1152 for me.
Answer: The automorphism group of a graph and the automorphism group of its line graph are very closely related.  The latter is also called its edge automorphism group and was studied by Whitney (1932).
There is a homomorphism from Aut(Γ) to Aut(L(Γ)) for any simple graph Γ.
The kernel is the group of permutations of the vertices contained in connected components of size at most 2.  In particular, avoid (more than one) isolated vertices and connected components of type K2 and you always have an injection.
The image of Aut(Γ) is almost always all of Aut(L(Γ)).  There are exactly 3 connected exceptions.  A graph Γ is an exception if and only if it has one of these connected exceptions as a connected component, or if it has a certain pair of components (K1,3 and K3).  You can calculate the index fairly easily from the list of exceptional components in your Γ; the index is $2^k \binom{m+n}{n}$, where Γ has k exceptional connected components and m connected components that are K1,3, and n connected components that are K3.

In particular, for Γ = K4,4, the homomorphism from Aut(Γ) to Aut(L(Γ)) is an isomorphism.

This is known as Whitney's theorem, from Whitney (1932).  An easier to read version is in the introductory chapter (pp. 11-13) of Lauri–Scapellato (2003), but only the kernel is proven.  A weaker corollary is described in the wikipedia article, and the paper itself is concerned with strong connectivity.  Hemminger (1972) has a nice description of the exceptions and why they occur (as well as references to two other simpler proofs and their textbook presentations). Jung (1966) is quite short and fairly easy to read (in German).

Whitney, Hassler;
Congruent Graphs and the Connectivity of Graphs.
Amer. J. Math. 54 (1932), no. 1, 150–168.
MR1506881
Zbl3.32804
DOI:10.2307/2371086
Jung, H. A.
Zu einem Isomorphiesatz von H. Whitney für Graphen.
Math. Ann. 164 (1966) 270–271.
MR197353
DOI:10.1007/BF01360250
Hemminger, R. L.
On Whitney's line graph theorem.
Amer. Math. Monthly 79 (1972), 374–378.
MR299514
DOI:10.2307/2978089
Lauri, Josef; Scapellato, Raffaele.
Topics in graph automorphisms and reconstruction.
London Mathematical Society Student Texts, 54.
Cambridge University Press, Cambridge, 2003. xii+159 pp.
ISBN: 0-521-82151-7; 0-521-52903-4
MR1971819
Answer: If G is a graph with minimum valency (degree) 4, then Aut(G) is group-theoritical isomorphic to Aut(L(G)). See Godsil & Royle, Algebraic graph theory exercise 1.15. The proof is not too hard.
Answer: I'm not sure if this is what you are asking, but there is always a map from $\mbox{Aut}(G)$ to $\mbox{Aut}(L(G))$ that is an injection in your case, explaining your divisibility relation. If $\phi$ is an automorphism of $G$, then $\phi$ also acts on $L(G)$: $\phi$ already knows what to do to vertices of $L(G)$ (which are edges of $G$), and $\phi$ also preserves the edge incidence relation, so extends to a map on edges of $L(G)$. This is not always an injection: consider the case of the graph with a single edge connecting distinct vertices. But in your case the map is an injection, which explains your divisibility relation.
Comment: Very good. This is close to what I'm looking for.
Now I only wish to explain why $Aut(G)$ is a subgroup of index 4 in $Aut(L(G))$
Answer: The order of a graph usually refers to the number of vertices. The line graph of $K_{4,4}$ has 16 vertices since this is the number of edges in $K_{4,4}$. The number of edges in $L(K_{4,4})$ is 48 since it's a 6-regular graph. I'm not sure where 4608 comes from. Are you referring to the automorphism group of the line graph?
Your graph $\Gamma$ is very symmetric and so there can be various numerical coincidences between its symmetry group, its number of edges, number of pairs of incident edges etc.
In general you should not expect a relationship between the automorphism group and the line graph (again, are you really comparing $\mbox{Aut}(G)$ and $L(G)$, or $\mbox{Aut}(G)$ and $\mbox{Aut}(L(G))$?). Most graphs have no non-trivial automorphisms at all, while they do of course have non-trivial line graphs. The automorphism group "measures" global symmetry, while the line graph just represents the incidences between edges and is "unaware" of the global structure.
Comment: I'm compering $Aut(G)$ and $Aut(L(G))$. 4608 is the order of $Aut(L(G))$ According to GAP. You are correct, I wasn't clear on that. Edited original msg. Thanks!


Eclipse: path variables expand to relative instead of absolut path

Question: I want to build eclipse projects without eclipse. I want to put several dependent projects into one git repo.
I have a library project l and an executable project p.
I specify an include in p (under G++ Compiler -> Includes) as "${workspace_loc:/l/include}. The build goes well.
However the autogenerated subdir.mk has -I"/home/user/workspace/l/include", i.e. the absolut path.
This makes it impossible to check out the git and build p without opening the project in eclipse first (which would update the relative paths).
Answer: Use relative path in Includes Direcories rather than variables. E.g. something like this ../../l/include.


How can I determine if Apache is installed on a system?

Question: I have Linux Mint on my computer but I don't know how to find out whether Apache2 is on it or where it is actually installed. I run my web browser (PHP installed) with http://localhost as a URL and it works.
Comment: what do you mean by PHP installed?
Comment: How is that related to c, c# or unix?
Comment: you want to know the path where are the files from that site?
Answer: I would recommend
dpkg --get-selections | grep apache

It lists all installed packages that contain "apache" in their name. For example:
apache2                                         install
apache2-doc                                     install
apache2-mpm-prefork                             install
apache2-utils                                   install
apache2.2-bin                                   install
apache2.2-common                                install
libapache2-mod-php5                             install
libapache2-svn                                  install

It indicates that the package apache2 is installed on the system.
Another approach, to find any running HTTP daemon on the default port would be:
sudo lsof -nPi | grep ":80 (LISTEN)"

Which lists something like:
apache2    1026     root    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    3966 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4014 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4015 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)
apache2    4016 www-data    4u  IPv6    3739      0t0  TCP *:80 (LISTEN)

Comment: This question is about Linux Mint. Using dpkg on platforms that don't have it is pointless.
Comment: ``-bash: dpkg: command not found`` is the above done in a certain directory?
Comment: @elliotrock No, try running it with `sudo`.
Comment: `-bash: dpkg: command not found` same error on aws linux even tried with sudo.
Answer: Try the which command:
# which apache2

In my experience, the Apache binary is located in /usr/sbin on most installations.
Comment: Depending on distro you might also try which with 'apache' and 'httpd'
Answer: To check whether if apache is running or not (the status), type:
sudo service apache2 status

at the command line.
Comment: This only works where Apache is installed as a (`sysv` etc) service; which admittedly will cover a lot of cases.
Answer: Just do a which httpd as user root.
Comment: Afraid to say, but on Mint (a Debian derivative) it would be `apache` or `apache2`, but not `httpd` ...
Answer: As I recall, Mint is based on Ubuntu, so you should be able to check apt-cache policy apache2:
$ apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: 2.2.20-1ubuntu1.1
  Version table:
     2.2.20-1ubuntu1.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ oneiric-security/main amd64 Packages
     2.2.20-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages

In this case, you can see it's not installed on my system. If you haven't asked for it to be installed, it's probably not -- I doubt it's part of the default distribution.
Answer: Try this bash command:
if [[ -z $(apache2 -v 2>/dev/null) ]] && [[ -z $(httpd -v 2>/dev/null) ]]; then echo "Apache not found"; fi

Answer: As root, you can test if apache is running under process name httpd, apache, or apache2, using
ps -A | grep 'apache\|httpd'

But again, this will only find apache if the process is running.
Comment: If works even if you are not root.
Comment: Ah cool, wasn't sure if non-privileged users could list global processes, thanks.


How to find a passenger who left NYC to europe around 1885-1913.

Question: How to find a passenger manifest who left New York City to Europe around 1885-1913? I know he arrived to New York City, and there are 4 records at Ellis Island of people who would match him almost perfectly, but I know he returned home after maybe a year in New York City.
Comment: Europe is a big place -- can you be more specific about the country/countries concerned?
Answer: As @ColeValleyGirl says, this is rather a broad question and it would be easier to give a more specific answer with more knowledge of what country they might have been going to.
As far as I know there are no passenger lists for passengers leaving the US which means you will need to look for records of people arriving in Europe.
Passengers arriving in the UK are listed in collection BT 26 at the National Archives and that collection is also available on Ancestry.
I believe that it wasn't uncommon for passengers to continental europe to travel via the UK so it's possible you might find them in the UK lists anyway, though only if they actually changed ship rather than if their ship just called in the UK en route.
Answer: The only passenger lists currently on-line for people leaving the U.S. are those for entry in the UK (as discussed in TomH's answer) and entry to Canada (not all crossing points). There may be archived copies in the various countries with international ports, but I have more than 15 such ports referenced in my database for relatives leaving Austria-Hungary.
In addition to bracketing the return date with other records (census, marriage, birth and death), sometimes a later return to the U.S. will generate additional evidence. These include the previous U.S. residence column on post-1905 passenger lists (although error-prone), and passport applications (both for naturalized citizens leaving on a trip, and for American-born children taken to Europe wanting to return).
Answer: A search at the US National Archives' catalog for the keywords 'passenger lists departing' will find several catalog entries for passenger lists, many from Record Group 85.
Ancestry has digitized several of these collections, as part of their  database U.S., Departing Passenger and Crew Lists, 1914-1965 (dbid=60882), which was added on 14 January 2016.
The about the database article contains a 'View Sources' link to another page which lists the included records with their National Archives catalog identifier (NAI).
The records closest in time to your target date range are:

Registers of Vessels Departing from New York, New York, 8/11/1917 - 12/31/1971. NARA microform publication A3487. NAI: 3730419. Records of the Immigration and Naturalization Service, 1787–2004, Record Group 85. The National Archives at Washington, D.C.

However, it isn't clear how the user can choose to view the records from 1917.  Choosing "New York" in the browse box doesn't show any records from A3487.
General information about the records at NARA can be found in their online Guide to Federal Records.  The introduction to RG 85 is on the page Records of the Immigration and Naturalization Service [INS].