Why is a flip-flop also known as a latch?

Question: I am new to digital logic design and would like to know why a flip-flop is also known as a latch?
Comment: Can you clarify your question by giving us your understanding of the terms "flip-flop" and "latch"?
Answer: Because the electronic device reminded engineers of both this item:

and this one:

In the first case, the devices have two states: flipped (in contact with heel) and flopped (not in contact with heel). In normal use they alternate continuously between those two states at about 1Hz.
In the latter case, you can change the object's state from open (unlatched) to closed (latched) by pushing the device. Once in the second state it cannot be returned to the first state by more pushing, you have to apply a specific reset operation to go from closed (latched) to open (unlatched).
Comment: I'm not sure that he asked about the origins of the words. +1 for a great answer though!
Comment: Note lower left of schematic: http://imgs.xkcd.com/comics/circuit_diagram.png
Answer: In general, "flip-flop" and "gated latch" are synonyms. However, the term "flip-flop" is often used when referring to "edge-triggered flip-flop" (just because it is shorter). When people speak about "D flip-flop" the usually refer to "D edge-triggered flip-flop", however when you hear "JK flip-flop" it can refer to both "JK edge-triggered flip-flop" and "JK gated latch".
In different groups of engineers there are different consensuses as to the usage of these terms. However, if you understand the basic concepts you'll be able to determine the type of the element in question by the context.
You can see my answer to other question, where I tried to explain the difference between these terms.
Comment: Exactly!!  You can can as pedantic and argumentative about the "real" definitions as you want, but you aren't likely to change decades of the way things are.  You need to be able to recognize all common usages (right or wrong)-- at least to recognize when you need to ask for clarification.
Answer: A simple "RS" (reset/set) latch contains two interconnected switchable elements (typically NAND gates); when using NAND gates, one input will be wired to each gate, wired such that driving it low will force its associated gate high; if the other gate was high at the time, that gate will then go low.  When an input is used to flip one gate (make it go high), the other gate will flop (go low).  Hence, "flip flop".
A transparent "D" latch uses some gates to convert a "data" input and an "enable" input into RS signals which then drive an RS latch. Any time the enable signal is inactive, the R and S outputs will be as well. When enable is active, either R or S will be activated, depending upon the state of the "data" input. Thus, when enable is active, one gate of the RS latch will go high and low to match state of the data input, and the other will go low and high the opposite way; deactivating enable will cause the output gates to retain their current state until enable goes active again.
An edge-triggered register may be implemented by using two D latches in sequence, the first receives the data input and a clock signal; the second receives the data output from the first and the inverse of the clock signal.  When the clock input is in the state to enable the first latch, that latch will track the state of the input, but the second D latch will hold whatever it's holding at the moment. When the clock switches state, the first D latch will stop following the state of the input, but the second will start following the state of the first (which should hold whatever the input was holding just before the clock switched state).  When the data input changes, it will affect the state of one latch (flip), and then the second (flop).
Once upon a time, "D" transparent latches were more common than edge-triggered registers, and the term "flip flop" was used often to refer to RS latches.  Things with edge-triggered clocks were described as having edge-triggered clocks.  Today, however, edge-triggered registers are more common than "D" transparent latches, and thus the term "flip flop" is used to describe them. The terms "flip" and "flop" refer to different parts of the internal circuit operation from what they did in an RS latch, and I would prefer using "flip flop" to refer to RS latches (particularly given that many edge-triggered registers don't actually use cascaded transparent latches inside) but the common usage is to describe edge-triggered registers.


I renewed my passport and my visa is on my old passport. Will this create problems with Immigration?

Question: My old passport has a 2-year validity visa for DR Congo expiring on 04.06.2016. It has only two blank pages remaining, so my boss told me to obtain a new passport, which I did. Presently I am on holiday and due to go back to DR Congo on 01.05.2016.
Will the Immigration officer accept my visa if it is in my old passport?
Comment: Did you renew your passport? Or did you ask for a second one (I would assume the former). Do you still have your old passport and is it still valid?
Comment: By "make new passport," do you mean that you got a new passport from the government, or you literally made (created) a new passport for yourself?
Comment: This happens all the time.  The general rule is that while a passport can expire, it does not invalidate existing visas inside the passport. Carry both and you'll be fine. If need be you can search 'transfer of conditions' or similar phrase to access the specific rule for the DRC.
Comment: Related: https://travel.stackexchange.com/questions/121252/refused-entry-to-india
Answer: You will need to carry both your old and new passport while traveling and immigration would have no problems with that. I have ten year and five year visas for many countries (including Canada and USA) and they are all on my old passport including an indefinite leave to remain in the UK stamp and I just carry both my passports with me.
Source : Own experience
Comment: You guys are lucky you can keep your old passport. The last time I renewed my French passport, the French consulate kept my old passport as part of their new security protocol.
Comment: @StephanBranczyk - you need to ask it back and they MUST give it back providing you have valid visas .
Comment: @ObmerkKronen Australia visas are electronically tied to passport numbers, and [you're required to update your passport number](https://www.border.gov.au/Lega/Lega/Form/Immi-FAQs/What-if-I-have-a-new-passport) when you receive a new passport. If you made such a journey, it's because the airline updated your details for you (which they're allowed to do).
Comment: It's important to note that there are exceptions to this rule (such as Australia). But it's generally true.
Comment: @MichaelHampton - As far as I know there is no exception for Australia . See my answer . ( also thee fact that I myself entered Australia with such a passport )
Comment: @MichaelHampton know. That is my point . You can see reference [here](http://singapore.embassy.gov.au/sing/visas-faq.html) and [here](https://www.border.gov.au/aboutyourvisa#New%20passport) . at any rate - that does not make Australia an exception regarding valid visas in old passports . It just require an update to the details. This update can also be done on arrival ( true - takes some more time - but still can be done ) . Usually it is done by Airline on Check-in - which is what MOST Countries do anyhow without formally noticing it .
Comment: @ObmerkKronen, I have dual citizenship, so I didn't face the same problem as the original poster since I didn't have an active visa in there. I only wanted my old French passport back for nostalgic reasons.
Comment: @StephanBranczyk - I understand you completely . I am actually very upset about the fact that many countries ( soon - all ) stop the practice of stamps on the passport. Nostalgic too but  Also for practical reasons ( tracking own movements )
Answer: You will have no problems .
Since I travel a LOT , I need to renew my passport every year almost . I have some long term visas ( Including 10 year visa ) . I just carry the ones I need together .
Further Information regarding valid visa in expired passports :
Some countries require that you will renew the visa if the passport is changed . Most don't . ( I never actually encountered it in case you have the old one )
That is the case for EXPIRED  passport - not for LOST or DAMAGED .There is a difference.
When you renew your passport , the consulate ( or respective minister ) is obliged by international law to give you back the old one providing it has valid visas from 3rd countries . legally speaking , the visas in your passport are properties of the country that issued them, and no other entity can invalidate or destroy them .
The most common way of invalidating a passport is to cut the "ears" or corners of external cover . That way no visa is damaged .
If you do not have valid visas some entities will punch a whole through the passport and give it back if specifically ASKED to.
In most cases ( depending on country of course ) , when applying for a new passport - the old passport will be validated with some kind of a note such as <code>" this passport is replacing an Expired document NO. XXX "</code> of one kind or another . This ties both old and new passport together .
Some countries require further documents on arrival, such as Australia and the Airline is actually the one to prepare it .
from the Australian Consulate immigration Info page

If you have a valid visa associated with an expired passport (i.e.you
  have been issued with a new passport since your current valid visa was
  granted), you may travel carrying your old and new passports together
  and the airline will arrange to have the details updated at time of
  check-in. If so, you should check-in a little earlier to avoid delays.

So again - the direct answer - You will have no trouble as long as the visa page on old passport is valid and not physically damaged , and you have that with you  on arrival .


RPM fluctuation when driving

Question: Nissan Altima 2009 RPM goes up and down and car  jerks when driving below 60mph and going up and down the hill.
Comment: Welcome to Motor Vehicle Maintenance & Repair! Your question is *very* broad. There are probably a thousand things which could cause what you're suggesting. Could you please edit your question with more detail as to what exactly is going on in your specific instance so we can stand a better chance of helping you?
Comment: Maybe TPS, if you have a ODB tool showing live data you can look at the values the ECU gets as you gradually peddle down and up check the ramp up is small. If it jumps around  then likely this
Answer: If you have an automatic transmission from which most of the fluid has leaked out, the torque converter will sometimes "slip" as air gets into the mechanism instead of fluid. This may happen more often on hills. This produces the same effect as depressing the clutch on a car with manual transmission. The engine will speed up. Then, when the torque converter gets enough fluid to work again, there will be a "jerk" as if you released the clutch pedal.
So check your transmission fluid. Look in your car's manual and follow the procedure to check the fluid. If you do not have the manual, find it online.
If the dip stick does not show any fluid level follow the manual's procedure for adding fluid or take the car to a service station to add fluid to the proper level. And maybe fix the leak.
Answer: Two questions here:

"What would cause the car RPM to fluctuate"

Pressing or letting off the accelerator.  Changing load on the engine due to hills, wind, A/C compressor.

"cause a vehicle to vibrate on smooth roads?"

Tires of of balance or otherwise damaged, worn suspension, worn drivetrain components.

RPM fluctuation when driving


Disk goes to sleep a lot

Question: Running PopOS-20 /ubuntu based. This is a secondary box I use for backups etc.
I have a 750GB HD. What's weird with that one, and something I have never had with any disk before, is that it goes to some sleep state very often and very soon.
I usually log in via sshd, then, after I have done something, I come back later, say 1 minute, and typing has a lot of delayed response. I can hear the HD spinning up, and when at full, the shell becomes responsive again.
Why could that be? Can I improve that? Some power management thing? I recall that before recently upgrading to PopOS, I had some older distro running, but I had the same behavior, so it seems not to be OS specific.
I vaguely recall having done some power management config on the disk many years ago. Any suggestion how I can clear that? I have no idea.
Comment: Thanks. It's a Seagate
Answer: hdparm -B 255 /dev/sda completely disables power management. I actually did
hdparm -B 250 /dev/sda and it is at least muuch better. Not sure I want to disable completely.
I had probably run hdparm -B 127 /dev/sda way back a couple of years myself.

Disk goes to sleep a lot


Can I make a custom keyboard shortcut available to all users?

Question: I've created a keyboard shortcut but it only works for my current user, we have 3 users on our Mac (OS X 10.8.3) but if I set up a short cut, I have to then set the same one up for our other 2 users.
Is there a way to make it universal?
Answer: Typically when you adjust a Keyboard Shortcut, the file(s) that are actually effected are in ~/Library/Preferences/ . If you take those same files to /Library (Not the User Library) they should be accessible to All Users.
Examples might be
com.apple.systempreferences.plist
com.apple.symbolichotkeys.plist


3D head mesh morphing from one mesh into another using coding

Question: I have 2 3D head images and want to morph one into the other (animation) without using blender etc. I want to do it using coding preferably using C++, C# or python(libraries are ok). I have done 2D image morphing etc but was unable to replicate it in 3D. Kindly give guidance about the steps that needs to be followed to achieve this task. ( Any Sample project would help).
Answer: One method, probably the easiest. Is to have a one to one association of vertices in 1 model (model A) with vertices in the other model(model B). To do the morph look up the two vertices and lerp between them. Where the linear interpolation ranges from 0 to 1 and the two points form a line segment. 0 would represent model A and 1 would be the fully morphed version of model B.
The biggest problem with this approach is generating the association between the vertices.
To overcome this issue, a relatively simple solution is to scale and rotate both models so they effectively share the same model space, and are approximately overlapping each other. Distortions don't matter here, the goal is to get the two models roughly equivalent in size and shape with the bits of model A that map to model B close to each other. (if the two models are rigged, then this actually becomes easy to do automatically just by mapping the joints to each other)
Once you are happy that the basic parts are lined up, simply iterate across the vertices doing a brute force search for the nearest vertex from model A in model B. There will be some repeated vertices, either repeat them or create a structure to hold multiple mappings.
The result is your mapping. At this point the models can be massaged to be GPU friendly or whatever else is needed.
Other methods exist, but they get very bogged down in theory and math. I like this simple approach because it is relatively easy to implement and understand. (it is also easy to adjust it to fit different needs)


Conversion of Reich-Moore resonance parameters to neutron cross section?

Question: For the Single-Level Breit-Wigner (SLBW) formula, the peak resonant neutron cross section is related to the total width, $\Gamma = \Gamma_{(n)} + \Sigma_{r}\Gamma_{(r)}$, reported as GT in ENDF. For Reich-Moore (RM) resonance parameters format, however, there is no reported total resonance width (see for example:
U-238(N,RES) interpreted resonance parameters.) For Reich-Moore format, then, is $\Gamma$ still equal to the sum of the partial widths (GG, GN, GFA, GFB), and if not, how does one calculate the peak neutron cross section from the given partial widths?
Answer: The "Reich-Moore formalism" in ENDF-6 is actually not the "true" Reich-Moore formalism, some approximations were made in order to fit the restrictions of the format and to include 2 partial fission channels. Using this approximation you have indeed the Gtot=GN+GG+GFA+GFB.
You can find, or rather deduce, informations on this approximated-formalism in the ENDF-6 manual's appendix, but I acknowldge it should be written explicitely in the corresponding section.


Windows forensic files

Question: I'd like to back up important Windows files for forensic purposes. I am aware of the Event Logs and Anti Virus logs, are there any other logs or files that have personal use information, connections or any other important information that could be backed up aside from that? If so, where is it located?
Answer: Forensic Purposes is far reaching. There are a huge and scattered number of resources that can be important in a forensic analysis. What's more, the relationship of this data to file contents and time stamps are huge.
It sounds like you're interested in collecting specific logs. Forensic purposes really implies a full system copy or "Image".
A middle ground would be a Triage capture of target subsets. Often this includes recently run executable file names and sometimes snapshots of running network connections or even memory dumps, depending upon your objectives.
There is no simple list short of "everything". You'll need to refine your objective.

Windows forensic files


Negotiating for an unlimited contract

Question: I have been working for the same company over almost 10 years now, always on temporary contracts, although I am a staff member (not a contractor).  It seems that they are now also keen in offering me a promotion, but again under a limited term contract.  I am interested in taking that position, if they would offer me an unlimited contract instead. Could you please share sound argumentation to successfully negotiate this with the HR department?
Comment: Country please? In some legislation you may have significant rights at this point
Comment: German labor law
Answer: If you are working in Germany, and at the same company for ten years, then German law puts facts ahead of contracts. In this case, the FACT that you worked there for ten years would override the CONTRACT that says your employment is for say one year only. You cannot use contracts to change facts in Germany. In practice this means that your notice period and your severance pay will be the same as for everyone working at a place for almost ten years.
There's no need to press for a new contract. Actually, a new changed contract could be legally to your disadvantage since you intentionally deviate from the current facts.
Comment: Just to make this point clear: If the company is not legally based in Germany (I mean, the company could be based elsewhere and still hire a contractor in Germany without having a legal presence in Germany), then this answer does not apply, right?

Negotiating for an unlimited contract


Is it possible for a planet to have floating islands caused by the magnetism?

Question: I am working on this planet that has several moons and - possibly - rings. In the planet's earliest era after its inception, it was hit by a large meteor that dislodged huge chunks of earth. I'm wondering if it's possible for a planet and its satellites to be so heavily magnetized that a floating island could exist lodged between the pull of the planet and its satellites.
Comment: Thank you. It does answer little, but mostly no. The answer on quantum levitation and supergravity was enlightening. The suggestions of using thick atmospheres and light gasses produced by organisms and trapped in geological structures reaffirmed its likelihood on my planet - which is very humid - but I'm focusing heavily on the factor of magnetism causing the pieces of broken-off earth to remain suspended in the air.
Answer: Aliens did it
As mentioned by Robert Rapplean, and the answer linked by Little Pickle, floating islands is just not doable as a natural occurrence. But that doesn't mean it can't be something encountered by your characters.
This planet was cracked open by some ancient impactor. That means its deep interior is much more accessible to industrious folks whose goals might be anything from straightforward mining, to scientific study of planetary cores, to physics research isolated from high-energy particles, or even military strategy. A planet like this is going to be a rare find, meaning it will definitely attract spacefaring civilizations.
So, assert that aliens did come here eons ago, and erected floating islands using their advanced technology because that kind of spatial configuration suited their purpose: either it was necessary for the work they were doing, or their culture drove them to establish these physically disconnected landmasses.
Now the aliens are gone, but their construction remains. They built to last, the technology harnesses some natural energy source, and the machinery requires very little maintenance (or is self-maintaining, via AI robots or nanites or whatever).
Your characters never need to discover any of these details. You want floating islands? You've got them. Since the aliens are gone, and seemingly left no other trace of their presence (or no other trace has survived -- perhaps picked clean by later visitors), you're left with something that appears to be naturally occurring for all intents and purposes.
A story is not necessarily better for presenting an exhaustively detailed explanation for every story fact, something we seem to be losing sight of in this age where every story is expected to spawn a franchise.
Comment: I think "aliens did it" could be used for almost anything, but I give you upvote anyway. it's a serious plot line commitment, but would be more fun.
Comment: In fact, Dave Freer used it in *Cloud Castles*.
Answer: I don't believe so, no. Magnetic levitation is notoriously difficult to balance. If you're talking about levitating off of a strong planetary magnetic field, then you're definitely out of luck. That would be like trying to balance a pencil on a wall. The forces are just going the wrong direction.
If you had reverse polarity fields in a circle around a magnetic mountain, the mountain would attempt to slide off of them, or would flip over. You might be able to tether the bottom of the mountain to the ground, but then it wouldn't be floating.
So, for a naturally formed configuration, I don't seen any way that this could exist. The satellites would make it even worse, perturbing them out of whatever equilibrium they could establish.
Let's say you had a moon in geosynchronous orbit, tide locked with a magnetic core pointing at the planet. Magnetism is much, much stronger than gravity, and decreases with the square of the distance. If the magnetic pull were strong enough to lift something off of the ground, it would pull it closer to the moon, which would increase the pull, which would yank it completely off of the planet.
So, no, no magnetically flying mountains.
Answer: It's quite a stretch
It would be a one-in-a-quadrillion chance, but it could be possible that some landmasses ended up smack middle in-between the gravity pulls of the main planet and one of the moons and now they're being pulled by an equal force towards both sides, remaining in place.
1.) The landmass would have to maintain a constant distance both between the planet and the affiliated moon, otherwise it would be pulled towards one end or the other.
2.) The landmass is going to be tidally locked to the planet due to its proximity, there's no way around that and, due to its negligible size compared to it, its own atmosphere and gravity would be nearly non-existent.
3.) Due to the gravity difference between the planet and the affiliated moon, the landmass would have to be SIGNIFICANTLY closer to the moon rather than the planet, which would effectively put it at the very edge or even outside of the planet's atmosphere, way out of the habitable area so it couldn't support life unless artificial, fully sealed colonies are built on it.
4.) The sheer size of this landmass could be just large enough to accommodate a small city and it could only serve as the pitstop travel point between the planet and the affiliated moon. There's no feasible way this landmass could be self-sufficient unless you really stretch reality. The size of the landmass must remain negligibly small, nearly unnoticeable compared both to the moon and the planet so it would remain locked in-between them.
5.) One could desperately hope the moons are aligned properly so their individual gravities do not cause further complications for any landmasses they happened to have pulled to float away from the planet. The worst imaginable scenario could occur if one of the lower moons gets too close to a floating landmass it isn't affiliated with and ends up slingshotting it into another moon, causing a chain reaction that could easily devastate the whole system.
Answer: Hypothetically, yes, but it would need to be perfectly balanced otherwise the island would simply flip over and the repelling force would become an attracting one. Causing it to crash to the surface. A magnetic field that strong would also effect any ferrous metals for miles around making things like iron tools or steal armor unusable.


Unity debug error "Frame not in module"

Question: I'm creating a 2D game, and all my game layers are UI canvases. Here's the issue: during debugging, every time I click on the screen, Visual Studio stops and displays "Frame not in module," and I have to click "continue." It's abnormal because I didn't add breakpoints for each click.
Comment: The debugger should only pause "automatically" on unhandled exceptions... Something's gone wrong and you didn't deal with it. In a normal program, that would be the point where your application crashed. Unity will actually catch/hide those errors at runtime, but if they're happening, there's something wrong with your code. If it's happening per-frame, you're wasting a LOT of CPU time handling exceptions.
Comment: To help you troubleshoot this, we'll need you to walk through the steps to create a Minimal Complete Verifiable Example of the problem. Once we can reproduce the symptoms you're seeing, we can investigate root causes and test potential fixes. Try making a copy of your project and deleting everything you can without making the problem disappear — what's left after you do that?
Answer: Well It is solved by rebuild the whole program and close
all the files opened. Maybe it is because I open some unity source code and it does not has PDB file.

Unity debug error “Frame not in module”


Christoffel's symbols for a dual connection

Question: Suppose that $\Gamma^{\beta}_{i\alpha}$ are Christoffel symbols for a connection with respct to a (local) basis $\{E_1,...,E_n\}$. I tried to prove that the Christoffel symbols for a dual connection with respect to the dual basis $\{\theta_1,...,\theta_n\}$ are then $-\Gamma_{i\alpha}^{\beta}$. I checked that the two expressions: one which defines the dual connection, and the expression $-\Gamma_{i\alpha}^{\beta}dx^i \otimes \theta_{\alpha}$ coincide but only for evaluated on pairs $(\partial_i,E_{\alpha})$. My question is: Is it enough in order to claim that the Christoffel's symbols of the dual connection are $-\Gamma$'s?
Comment: see my http://juanmarqz.wordpress.com/2010/11/27/covariant-derivative-of-covectors/
Answer: You seem to have switched notation in your question as there appears $\partial_i$ and $dx^i$, but you didn't start with a coordinate frame. If I understand your question correctly, then the answer is yes. What you are trying to find is $C_{ij}^k$ given by the formula $$\nabla_{E_i}\theta_j=C_{ij}^k\theta_k$$To find these functions evaluate both sides of this equation at $E_l$.
We have that $C_{ij}^k(\theta_k)E_l=C_{ij}^k=C_{ij}^l$, while by definition $$(\nabla_{E_i}\theta_j)(E_l)=E_i(\theta_j(E_l))-\theta_j(\nabla_{E_i}E_l)=-\theta_j(\nabla_{E_i}E_l)=-\theta_j(\Gamma_{il}^pE_p)=-\Gamma_{il}^j$$
Answer: It's been quite awhile since I've looked at a differential geometry book which covers this stuff, so this might not be exactly what is wanted here,  but as I recall the connection's action on the dual basis $\theta_\mu$ may be found from its action in terms of the basis $E_\nu$, i.e., from the formula
$\nabla_\gamma E_\nu = \sum_\kappa \Gamma_{\nu \gamma}^\kappa E_\kappa \tag{1}$
as follows:  the dual basis $\theta_\mu$ to $E_\nu$ satisfies
$\theta_\mu(E_\nu) = \delta_{\mu \nu} \tag{2}$
for all pairs of indices $\mu, \nu$.  Applying $\nabla_\gamma = \nabla_{E_\gamma}$ to this equation yields
$\nabla_\gamma(\theta_\mu(E_\nu)) = 0, \tag{3}$
and since we want the Leibniz rule for derivatives of products to apply to $\theta_\mu(E_\nu)$ we must have
$\nabla_\gamma(\theta_\mu(E_\nu)) = (\nabla_\gamma \theta_\mu)(E_\nu) +\theta_\mu(\nabla_\gamma E_\nu); \tag{4}$
when (4) is combined with (3) we obtain
$(\nabla_\gamma \theta_\mu)(E_\nu) + \theta_\mu(\nabla_\gamma E_\nu) = 0, \tag{5}$
or
$(\nabla_\gamma \theta_\mu)(E_\nu) = -\theta_\mu(\nabla_\gamma E_\nu); \tag{6}$
using the formula (1) in (6) we see that
$(\nabla_\gamma \theta_\mu)(E_\nu) = -\theta_\mu(\sum_\kappa \Gamma_{\nu \gamma}^\kappa E_\kappa) = -\Gamma_{\nu \gamma}^\mu. \tag{7}$
(7) expresses the components of $\nabla_\gamma \theta_\mu$ via evaluation on the vector basis $E_\nu$; from this it follows from a standard but basic linear algebraic argument that
$\nabla_\gamma \theta_\mu = -\sum_\sigma \Gamma_{\sigma \gamma}^\mu \theta_\sigma. \tag{8}$
(8) is the formula for the covariant derivative of $\theta_\mu$;  we see that the Christoffel symbols $\Gamma_{\rho \tau}^\sigma$ occuring in the expressions for $\nabla_\gamma E_\mu$ and $\nabla_\gamma \theta_\mu$ are indeed the negatives of one another, and summed over different indices as well, a lower for dual vectors and an upper index for members of the original basis vectors themselves.  From this point of view, the Christoffel symbols for the dual basis $\theta_\mu$ are indeed the $-\Gamma$, where the $\Gamma$ are the Christoffel symbols for the basis $E_\mu$.
That's how I'd address it, in any event.
It should be observed that in the above discussion, the dual connection is in fact defined by (4); we stipulate the $\nabla_\gamma$ must so act on $\theta_\mu(E_\nu)$.  With such stipulation and definition, the connection coefficients for the dual basis are as shown.  The mixed notation $-\Gamma_{i\alpha}^{\beta}dx^i \otimes \theta_{\alpha}$ is one I have occasionally seen but with which I am not overly familiar, and since our OP truebaran doesn't specify how the corresponding mixed dual connection is defined, I will leave further discussion of this particular point without further comment.
Hope this helps.  Cheers,
and as always,
Fiat Lux!!!
Comment: As far as I understood, first You have proved that the dual connection (to a given one) is constructed uniquely: but I'm not quite sure why You argue that You want to have Leibnitz identity (in order to obtain (4)): You don't have a product but the connection acting on the form evaluated on vector field (more general: on section) which is the smooth function.


How should a loss of communications in VFR be dealt with?

Question: Let's say I'm flying a cross country flight and I wanted to land in a Class D or enter Class C towered airport, but I lost my two-way communications radio but have my transponder squawking 7600. Should I blindly continue in and receive light gun signals to land or should I steer out the Class C and D and divert to a non-towered airport? In worst case scenario, what if my transponder is also out?
Answer:
should I blindly continue in

First, never do anything "blindly".
The FAR and the AIM address the Class D question, so this part is the most easily answerable:

FAR 91.129 (d) Communications failure. Each person who operates an aircraft in a Class D airspace area must maintain two-way radio communications with the ATC facility having jurisdiction over that area.
(1) If the aircraft radio fails in flight under IFR, the pilot must comply with §91.185 of the part.
(2) If the aircraft radio fails in flight under VFR, the pilot in command may operate that aircraft and land if—
(i) Weather conditions are at or above basic VFR weather minimums;
(ii) Visual contact with the tower is maintained; and
(iii) A clearance to land is received.
AIM 4-2-13 (3). Transmitter and receiver inoperative. Remain outside or above the Class D surface area until the direction and flow of traffic has been determined; then, join the airport traffic pattern and maintain visual  contact with the tower to receive light signals. Acknowledge light signals as noted above.

After that, 6−4−1 addresses more two-way comms failure actions:

a. It is virtually impossible to provide regulations and procedures
  applicable to all possible situations associated with two-way radio
  communications failure. During two-way radio communications failure,
  when confronted by a situation not covered in the regulation, pilots
  are expected to exercise good judgment in whatever action they elect
  to take. Should the situation so dictate they should not be reluctant
  to use the emergency action contained in 14 CFR Section 91.3(b).

Since "best judgement" is very situational dependent, the rest of this is subjective:  I would not enter Class C, if there was another alternative. If you're already in Class C, and there are Class D/E/G airports available, divert. If you're already in Class C,and there are no other options, continue with the utmost caution (following the advice of the Class D procedures if able), using your own light signals to attempt to alert the tower.

Some "armchair lawyers" might even say that lost-comms (VFR) operations in Class C and even Class B could be conducted in the same manner as Class D, because each section starts with: "each aircraft operation in Class B/C airspace must be conducted in compliance with this section and 91.129."
I'd personally avoid B and C like the plague if I was VFR lost comms.
Comment: But isn't it so that if you have a flight plan, ATC will expect you to stick to it and therefore you should (and thus _not_ divert)?
Comment: The OP asked with reference to VFR flight (not the conditions, or weather, but the rules themselves).  There is no technical requirement for a VFR flight to file a flight plan, and even if one was filed with Flight Service, ATC is not involved and is not tracking the flight. Therefore, there is nothing that ATC is expecting the flight to "stick to".
Comment: @Jimmy 100% Agree, ATC don't always keep track of VFR flight plans until they are needed. Everyday I have a pile of VFR flight plans that are never needed as they never called up. Flight Service knew about them not me.
Comment: Even with an activated VFR flight plan, if you were not on flight following then you just show up as another 1200 and they really can't know which 1200 is which flight plan. Squawking 7600 is better in that they know this radar dot has lost radio but again it started as just another 1200 and they don't know which.


Spark sql using spark thrift server

Question: I want to access tables registered in spark using JDBC kind of service, using the thrift service provided by spark.
I didn't got any documentation for this on google, can anyone please tell me how to use thrift server to access spark tables.
and what will be the lifetime of these table in memory, will these table resides in memory till thrift server is running.
Answer: The Thrift server documentation is located in the Spark SQL reference page under Distributed SQL Engine (http://spark.apache.org/docs/latest/sql-programming-guide.html#distributed-sql-engine).
If you cache a query the cached result will stay in memory until the Thrift server is stopped.

Spark sql using spark thrift server


Faraday cage and EM waves

Question: Containers of metals like copper, steel, or aluminum work well as a Faraday Cage to shield electromagnetic waves of a wide range. But if we go to the end of very high energy radiation (like gamma rays), these containers used cannot prevent rays from penetrating inside.why?
Comment: No offence, but I think you have answered your own question, **high energy**. If the walls of the cage were thick enough, possibly you would reduce the flux, but definitely not with the chicken wire or car body thickness of a "normal" Faraday cage. Gamma rays do not have to get through the walls directly, but they can produce secondary radiation.
Comment: It would be helpful to us if you tell us what your physics background is like. The answer to your question will be different depending on whether you are a high school student studying this phenomenon, an undergraduate, or a layperson. Telling us where you're coming from helps us give you something you can understand.
Answer: The answer can be understood with a very simple classical model of a metal being a neutral plasma of basically free electrons and immobile positively charged atomic ions. At low (radio and microwave) frequencies the electrons follow the oscillating electric field of the em waves and dissipate the energy by collisions with phonons thus attenuating the penetration of the waves. At higher frequencies the electrons cannot follow the electric field anymore and the collisions become ineffective. Above a critical frequency called plasma frequency, which depends on the electron concentration (around 10^23 cm-3 in metals), the metals become practically transparent to electromagnetic waves. In common metals this happens in the ultraviolett range of the optical spectrum. Therefore, high energy electromagnetic radiation like x- and gamma-rays are not shielded by metal Faraday cages.

Faraday cage and EM waves


Bernoulli equation in open vs. closed systems

Question: Can we apply Bernoulli equation to a closed system the same way we apply it to an open system?
In an open system increasing the speed of the fluid implies that either the pressure or GPE should decrease as a result of conserving energy.
I wounder how would this apply to a closed system?
Answer: In a closed system where there is no flow and thus velocity = 0, Bernoulli's equation is reduced to $$ P_1 + \rho gz_1 = P_2 + \rho g z_2$$ $$ P_2= P1 - \rho g \Delta z$$ which is really just the normal rule for pressure in liquids. In gases usually $\rho$ is too small so the pressure is constant throughout the gas. So basically it is reduced to the normal rules you use for fluid statics.
Answer: I suppose the OP thinks of a closed circuit with flow, provided by a pump.
This type of circuit exists for example in a PWR primary circuit, where liquid water is heated by the nuclear fuel in the reactor pressure vessel and continuously pumped to a heat exchanger, called steam generator, where a secundary (also closed) circuit delivers the steam to the turbines.
The Bernoulli equation is valid because it is a steady state flow. The presure at the small pipes of the heat exchanger is smaller than at the large entry chamber for example.


Travel plan for Interlaken from Lausanne

Question: I am planning to visit Launsanne in this april. I will get only one day off. Is it possible to visit Interlacken in one day and come back to Zurich?
Comment: Interlaken is good, but are you not planning to go on top of alps Jungfraujoch?. It starts from Interlaken but you should be able to do it in a day.
Answer: It's definitively possible. I would use the train to do that. It's definitively also possible by car. From Lausanne to Interlaken you need around 1:45 by car and from Interlaken to Zurich around 1:30.
However, more convenient and probably cheaper is the train. Checkout fahrplan.sbb.ch to get the schedule for this connection.
Assuming you want to visit Interlaken on a workday, the first train arrives in Interlaken at 7:57:

The last train to Zurich leaves in Interlaken at 23:00

Therefore, you have around 15 hours in Interlaken.
Answer: It is possible, but I would consider to visit Lausanne on a day and then Interlaken on another day. Like this you could visit Vevey or Montreux or Chateaux Chillon when you are in Lausanne.
And another time go to Interlaken and visit a mountain of your choice that day.
When visiting Lausanne and Interlaken in one day, you could take the Golden Pass train which starts at Montreux (I think), passing Aigle, Gstaad, Zweisimmen and ending in Spiez (I think) which is close to Interlaken.
In my opinion, the town of Interlaken is nothing special and not worth a visit when you are not going deeper into the mountains.


How to tell if chips overheat while soldering

Question: I am new to soldering and I am afraid that I am getting some of my chips too hot. I'm sure this will be less of an issue when I get more experience. I also ordered some DIP sockets but they won't arrive for a few months. In the mean time is there any way I can tell if I have damaged my chips? I am afraid that I won't by able to tell if I have made a mistake in the circuit on the protoboard or the chip is just damaged and malfunctioning. Generally speaking, can you destroy a chip with heat before it gets too hot to touch? I know datasheets list maximum temperatures but it seems like the temperature inside could get much hotter than the temperature you can feel on the outside.
Comment: In addition to the excellent answers given, you might want to try deliberately overheating some cheap chip not needed for anything important.  Test it, put the iron to it for 10 sec, let it cool, test it again, repeat with longer times.  Not really scientific, but good to get a feel for what the thermal limits are like.
Answer: It's all about knowing how to solder.
You should use a temperature controlled soldering station. Set temperature to 300°C and you'll be able to heat each pin of DIP chip for 2-3 seconds without damaging the chip. Guaranteed.
See PDF by Adafruit.
Comment: 5 seconds at 350°C won't kill it either. If after 5 seconds I haven't achieved what I want I let it cool down (e.g. solder other pins) before I try anew.
Comment: use a crocodile clip , so it will absorb the heat and let not transfer to the component.Either no matter how much well you control the temperature you can't defense against ESD. So there's a probablity that chip get damaged. So sorry, no guranteed.
Answer: First of all, it's unlikely that you will destroy your parts even if you hold the iron on the pins for a long time (over 5 seconds). Components are designed to withstand a good bit of heat and time (sometimes minutes) during mass production. However, an iron tip is usually hotter than the temperatures used in factory production, so there is risk of damaging a part if you hold the iron on it too long. Some spec sheets will give limits on soldering time, but these are usually aimed at mass production temperatures, not a hand soldering iron.
I, like many others here, have never fried a part from overheating it. But if you're working with a particularly sensitive part, there are a few techniques you can use to mitigate the risk of thermal damage (some CMOS or MOSFETs are known to be more easily damaged... CMOS technology is used in some digital logic ICs, for instance).

Solder alternate pins, or give the chip time to cool off between pin
Attach a thermal sink in between the chip and the solder joint to draw heat away before it damages the part. Note that this can make soldering more difficult as it will be harder to heat the actual joint.
Use sockets (like you're doing already).
Use a lower temperature (make sure to have a tip in good condition, and a little blob of solder already on the tip to help transfer heat--"tinning" the tip).

In general, though, if you spend no more than 2-3 seconds on the joint, you'll probably be OK. And for large wires, connectors, or ground planes, you may need to spend much more time on the joint to allow the solder to thoroughly wick and bond to all the surfaces. For joints with a lot of metal, try to keep the soldering time below 5-10s.
In terms of temperature, if you have an adjustable temperature iron, stay below 650°F for leaded solder, and 750°F for lead free. I will occasionally set the temperature to 800°F  for large components or ground planes. You're better off finishing a joint in 5-10 seconds at a higher temperature than holding the heat on for much longer at a lower temperature. Long soldering times give the heat time to spread to the components where it can do damage.
How to tell if there's damage? If the component changes color, that's a bad sign. If the board browns or chars, that's also bad. The unfortunate reality is that you may do latent damage to a component by heating it too long and too hot. For example, a chip may initially work, but fail early, or some of its specs may be slightly off from their original design.
As an aside: Why is an iron tip hotter than temperatures used in mass production (and the temperatures noted in spec sheets)? During mass production, the entire board is usually heated, so the pcb, IC and joint are all at the same temperature. When you hand solder, the pcb and IC are much colder than the joint, and are constantly drawing heat away from the joint. Your iron must be much higher than the melting point of the solder to compete against these heat sinks.
Answer: I have been soldering for a couple of years now, and I have not damaged a chip yet. I am usually a bit careless about how hot the chips get (which bad practice). I guess my point is not to worry about it too much, as long as you are not applying excessive heat to a pin for too long a period.
Answer: The best option at this point would be use the Datasheet of the specific chip and check between the pins, using a multimeter, whether it shows for the expected values. for eg. i am doing the same work, and whenever i solder a chip in this case lets consider a n-channel mosfet; i would check between gate pin and drain pin for High Resistence or Open Circuit.
Also it will be really help you, if you could check some of the vids on youtube for the most common practices of soldering for noobs.
Also keep the whole process, as you are starting now, VERY SLOW. take it easy on setting up the chip.
Answer: One thing that hasn't been mentioned is the eutectic point of solder.  If a pin is ever over heated it's almost always due to someone over heating the solder, causing it to de-alloy which then shifts it's eutectic point to a higher temperature.  The poor person then applies more heat, etc. etc.  and soon they are dealing with a poor joint, de-alloyed solder and temperatures waaaay beyond they thought was possible.
The only way out of this is to add fresh solder (and MORE than was in the original melt), suck/wick the fresh and old out and start over.
The solder will start to look bad, not shiny and perhaps even granular.
Answer:

I am afraid that I won't by able to tell if I have made a mistake in the circuit on the protoboard or the chip is just damaged and malfunctioning

you talking about a mistake?
Then first get your diagram and check every node and a branch twice that they connected
correctly and also verify that no other terminals were shorted or connected at the wrong
place. Do it twice for every branch and a node in your diagram.
You better prepare a tabular checklist.That's the method that we are following in here.
You could use statistics and delta debugging techniques. And here , more statical methods
will work. Such as guessing the devices which are more lead to fail. etc etc.
If your protoboard provide some test points, use them to test with the diagram.
Answer: These are my advices:

Make sure that the surfaces are clean
If the surfaces which you want to solder each other are dirty, the solder won't fold them up. Instead, it will become tiny beads.
Use a high quality solder
Half of a successful soldering is using qualified solder.
When it was my first time to to do soldering, I though all solders are same and I bought the cheapest one in the market. All my solders were terrible. I thought that I was bad at soldering. After a while, I coincidentally happened to use my friends solder, and I was surprisingly soldering very good with that one. Then I bought a qualified solder, and my soldering became much better.
Work in optimum temperature
If the soldering iron is too hot, it will damage the element. If it is too cold, soldering time will increase, the element will be heated up for a longer period, so it will be damaged again. If you are inexperienced, I suggest you use a temperature controlled soldering iron. Refer datasheet of the element for optimum soldering temperature. If an optimum temperature is not specified, you may set your temperature to 300oC.
Try to be as fast as possible, don't exceed maximum soldering time
You aim is to make the solder fold up the surfaces perfectly in minimum time. If you can't complete soldering in the maximum specified soldering time, let it cool down. You go on soldering other leads, and come back to the incomplete one later.
Make the holes small
Make the holes smalls so that the leads of the element lightly jams and stays fixed in the hole when you insert the element to its place on the PCB. If you make the hole radius large, the amounts of soldering time and the solder to use will increase, the element will be heat up more, and your PCB will not look good. It is also bad for high-frequency circuits.
Answer: Lots of excellent answers. My two cents based on my experience - may corroborate with what others have mentioned:

Use a heat sink for the concerned pin - use the small crocodile clip (obviously strip away its plastic covering). If needed, attach a larger crocodile clip to this one. I did this for soldering header pins to my MSP430-F2013.
Always use solder flux.
Make sure (this is very very important) that your soldering iron tip is nicely shining and free of any dirt/black residue - you must tin it regularly before and after an actual solder operation. If the iron tip is not clean you will not get good heating - use something like a Dremel with abrasive attachment to get it back in 'shining form'.
Use either a lint free damp cloth or better a good quality damp sponge to wipe the soldering iron before and after tinning.
Comment: Abrading or grinding the tip is a bad idea. You can easily scratch through the plating which is there to prevent the copper tip from slowly dissolving in the solder. Once that's done, the tip will degrade at an increasing rate. If there is crud on the tip that won't come off after repeated tinning and wiping on a wet sponge, then carefully scratching it off might save an otherwise dead tip, but you should never be attacking an iron with a Dremel.
Comment: That's a good point - I wasn't aware of this. I've lightly abraded the irons only very recently...


Do simply-connected open sets admit simply connected compact exhaustions?

Question: Suppose $E$ is a simply-connected open subset of $\mathbb R^n$. Must there be a sequence of compact subsets $K_n$ such that $E = \bigcup_{n=1}^\infty K_n$, $K_n \subseteq K_{n+1}$ for all $n$, and each $K_n$ is simply connected? This is trivially true if $n=1$, and is true if $n=2$ by the Riemann mapping theorem, but topology can become counter-intuitive in higher dimensions.
Comment: This is trivially true for **every open set** (just take the $K_n$ to be closed balls contained in $E$). You probably want the sequence of compacta to be **increasing**.
Comment: @PhoemueX by the term exhaustion by compact sets you require them to be increasing http://en.wikipedia.org/wiki/Exhaustion_by_compact_sets
Comment: Thank you, PhoemueX, I forgot to include that in my definition (although clark is right that this is usually what is meant by "exhaustion.")
Answer: This is false in dimension 3,  Whitehead manifold is an example.
One way to see it is to observe that simply connected compact 3-manifolds with connected nonempty boundary are balls, while Whitehead manifolds cannot be exhausted by balls.
Here is a more general theorem:
Theorem. Suppose that $M$ is a simply-connected 1-ended connected 3-dimensional manifold which is not simply-connected at infinity (e.g., Whitehead manifold). Then $M$ does not admit an exhaustion by simply-connected compact submanifolds with boundary.
Proof. The assumption that $M$ is not simply-connected at infinity means that there exists a compact subset $K\subset M$, such that for every compact subset $K'\subset M$ containing $K$, there exists a loop $\gamma\subset M - K'$ which does not contract in $M-K$. Suppose that such $M$ admits an exhaustion  by simply-connected compact submanifolds with boundary $M_i$. Then the boundary of each $M_i$ is a disjoint union of 2-spheres. It follows that for each component $C_i$ of $M-M_i$, the boundary of $C_i$ is a 2-sphere. Therefore, $\pi_1(C_i)\to \pi_1(M)$ is injective. But this contradicts the property that $M$ is not simply-connected at infinity.   qed
Note. In the solution I assumed that you are only asking about exhaustions by compact submanifolds with boundary. (The proof also works if you exhaust by simplicial subcomplexes.) Exhaustions by arbitrary compact subsets would be much more difficult to analyze and I am not sure how to solve the problem in this case.
Comment: Why is it false for the Whitehead manifold?


I have started my new job but I think I do not like it. What should I do?

Question: I have accepted a job offer and started the new job for about 3 months now. I do not enjoy this job as much as I had imagined. The job is fine, not too hard to do, and the time is flexible. However, i still regret my decision of changing my job sometimes. I had this feeling since I started working this new job. But had decided to give it more time to see if i will grow to like this job. Now after 3 months, I think my feeling is still the same. Any advice on should I give it more time? Or 3 months will be enough? The reason I do not like my new job is not really specific, I would say it's a feeling. I just do not feel belonging in this new job which is different from my previous job. Not sure if I describe my feeling correctly here though. Any advice would be much appreciated. Not liking my new job hence not much motivation to do my job actually.
Comment: Do you like being paid? Or are you independently wealthy?
Comment: I strongly disagree with closing this as a duplicate of "How can one resign from a new job gracefully?" The question is rather unclear, so closing as "unclear" would be ok, but OP's issue seems to be whether quitting is the right option, not how to quit gracefully.
Comment: Anyway, the question is not very clear, so maybe it's best to just let it be...
Answer: First, figure out why you don't like this job. Saying "not really specific" and "it's a feeling" means that you really don't know.
Think about it. Talk about it with friends and former coworkers. Even write yourself notes during the day when you happen upon something that makes you think "This isn't good" or "That is good".
Without knowing what you like and don't like, you can't make any progress. But learning that, you can determine if this job can become what you want, or if it's a lost cause.
If you decide this job has possibilities, you might be able to alter your behavior or attitude and make it better.
And if you ultimately decide that this isn't the job for you, you'll have a better idea of what to look for in your next job. Find a job that will make you happy for longer than 3 months, give your notice here, then move on.
Answer: A lot of people do not work in their dream job, they do it for the money. I suggest that you soldier on and make the best that you can out of it and job hunt for something more suitable.
Really it sounds like an attitude shift would fix most of your issues, I've worked in some absolutely toxic positions quite cheerfully because I brush off the negative stuff. But it doesn't sound like your situation is anywhere near that. Focus on the positives and look around for opportunities. 3 months is not a long time.
Answer: How far along are you in your career -- that is, is this a more or less entry-level job? If you're still pretty young, I'd recommend trying to stick it out for a year. It doesn't sound like you are terribly unhappy or anything like that (which would change things) -- just that you don't love what you're doing. I would stay with it and do everything you can to make it a worthwhile experience: learn something new, take on different projects that are interesting to you, and try to figure out what it is you like doing (and what appealed to you about your old job that you aren't finding here). You said that it's not very challenging, which may mean it's the perfect opportunity to go above and beyond and challenge yourself. That'll put you in a better position when you're applying for your next job.
Other than that, it's really a personal decision. No job is worth being deeply unhappy all the time, but the tipping point on the scale between "I've found my life's passion!" and "I can't get out of bed in the morning because I hate my job" is different for everyone.
Answer: I would give it more time. It is normal to feel a bit out of place as you settle in to a new job, you've left something familiar to start something new, and I remember the same sort of feeling when I started my current role. But I think three months is too short at time to take a decision, and unless the role is really making you unhappy I think you should stick with it for a while and see how you can focus on the positive aspects. Maybe set yourself a decision point at 12 months to see how you feel then.
One last thought: depending on what you do, leaving a job very shortly after starting it may be seen as a negative when applying for new roles.  I interview people regularly, and I wouldn't rule out a candidate who had only spent three months in a role, but I would want to fully understand what had happened and feel that it wouldn't happen again. Leaving quickly can be a perfectly understandable reason, e.g. we had one person leave after a few months because they didn't realize how hard a 90 minute each-way drive to work was and it was impacting their health, but we put a lot of time and money into recruitment and training new hires, and look for people who want a long-term career with us.


GLib Malloced Strings as Keys to Hash Table

Question: I'm using a malloc'd string as a key to a GLib hash table.  I then have several updates to make.  Each update uses a newly malloced string that is identical in the actual sequence of characters.  If I do an an insert, will the old string be overwritten?  How can I make sure to free it so I don't keep extra copies around?  If it's not overwritten, how can I make sure to implement an update without it being too slow?
Comment: Are keys and values `malloc`ed strings ? Did you supply a `key_destroy_func` and a `value_destroy_func` when creating your hashtable ?
Comment: Yes, both are malloc'ed.  I andled frees myself.  The problem is every time I try to add a new record, the string I have for the key is a new one even though the value of the text is the same.  So it's like adding a new key.  I'm wondering if I just have to maintain a separate index and do some string comparisons.
Answer: If you supply the correct comparator and key/value destructors to g_hash_table_new_full when creating the hash table, you don't have to do anything extra. The table will understand that the key strings are the same even if they are separate copies, and it will automatically free repeated copies of the same key as well.
Here is an example (the ugly printfs are only there to show whats happening):
First you write a destructor:
void
free_data (gpointer data)
{
  printf ("freeing: %s %p\n", (char *) data, data);
  free (data);
}

Then you instantiate and play around with the GHashTable:
int main (void)
{
  char *key, *val;
  GHashTable *hash_table
  = g_hash_table_new_full (g_str_hash,  /* Hash function  */
                           g_str_equal, /* Comparator     */
                           free_data,   /* Key destructor */
                           free_data);  /* Val destructor */
  /* Insert 'k_1' */
  key = strdup ("k_1");
  printf ("%s %p\n", key, key);
  val = strdup ("v_1");
  printf ("%s %p\n", val, val);

  printf ("inserting\n");
  g_hash_table_insert (hash_table, key, val);
  printf ("insert finished\n");

  /* Insert 'k_1' again using new strings */
  key = strdup ("k_1");
  printf ("%s %p\n", key, key);
  val = strdup ("new_v_1");
  printf ("%s %p\n", val, val);

  printf ("inserting\n");
  g_hash_table_insert (hash_table, key, val);
  printf ("insert finished\n");

  g_hash_table_unref (hash_table);

  return 0;
}

Here is what a test run looks like:
k_1 0x80cce70
v_1 0x80cce80
inserting
insert finished
k_1 0x80cce90
new_v_1 0x80ccea0
inserting
freeing: k_1 0x80cce90
freeing: v_1 0x80cce80
insert finished
freeing: k_1 0x80cce70
freeing: new_v_1 0x80ccea0

You will see that if you create a 'new' key identical to an existing key, and try to insert a corresponding 'new' value, then the 'insert' operation automatically destroys the 'new' key (because it is the same as the existing one), as well as the old value (because it has to be replaced with the new one).
Comment: Excellent. I had overlooked this g_hash_table_new_full.
Answer: Using g_hash_table_insert (), the key value is freed only if you supplied a key_destroy_func when creating the hashtable with g_hash_table_new_full. If you created your hashtable with g_hash_table_new you'll have to free your keys after the insert if necessary.


Can this old drain pipe still be active

Question: My house is a renovation of a 1940 house. Many of the old nonworking disconnected parts were left in during the reconnection, including this 5 or 6" cast iron drain pipe. I recently noticed that the area where this pipe is found (which is in the basement) smells like a cat's litter box. So it could be the result of dampness, or one of my cats took a pee there or - and this is my question - could it be that this pipe is somehow connected to my plumbing elsewhere in the house and that sewer gases are escaping through it. To me this scenario seems highly unlikely. On the other hand, why would they not cut it out and instead cut the plywood around it?
Comment: I think the only way to get an answer is going to be to have someone look at it on site. Too much detail needed. I'd be tempted to try something silly like pointing a thermal camera at it, running hot water, and seeing if it warms up at all, though that would be a minor effect and probably hard to measure. (My house inspector told me he stopped trying to guess at odd plumbing's intent after what looked like an unexpected drain pipe turned out to be the previous homeowner's safe.)
Comment: @keshlam   Sounds like a neat idea.  Not many people would look or put their hands in what looks like a drain/waste pipe.
Comment: Please not that the pipe is cut off within the picture.
Comment: What's behind the paneling? Is that the foundation wall and this pipe runs directly out from under the house? If so, it's possible that it's still connected to the sewer system somewhere. It's possible that it's disconnected, but that it collapsed somewhere outside the house and that a critter has made a nest in it. You're going to need to look in the pipe with a camera to see what's down there. You can rent one or have a plumber come out and look down there - he'll have more experience to ID what he sees, but you could have a look first.
Comment: @Wynne: Not cutoff, just goes into the concrete. I have some of that in my own basement. Which, FWIW, is indeed still connected and in use.
Answer: Since your question is in regards to the source of an odor, I'd suggest the following.  To see if it's still active (or the source of your odor), take a sturdy plastic bag, stick it over the end, and use some rubber bands to hold it in place and seal the opening.  Then see if the odor remains after couple days.  If the odor disappears, that was the source and you can proceed as appropriate to remediate that.  If the odor remains, you know the source is elsewhere.
Answer: Come at this from the cat angle.
If you are asking yourself - "did my cat pee here?" most of the time the answer is yes.  It is part of their charm.  You could check the area with a black light aka ultraviolet light.

https://pictures-of-cats.org/black-light-helps-detect-feline-peeing-issues.html
Re interesting old pipe: rubber band a plastic bag around the end.  If bag blows off air is coming thru pipe.  If bag sucks in air is leaving thru pipe.  All fascinating.  Then replace bag with wad of rag because rubber band and plastic will deteriorate with time.
Comment: So, peeing everywhere is "Charming", eh?

Can this old drain pipe still be active


osx login is intermittently locked

Question: I am currently using a global hotkey combo to lock Snow Leopard whenever away from the desk. Every month or so, on returning I am unable to login, even though the password is correct. The only way to login again, is to restart, after which the same password works fine. I'm wondering if anyone else has seen this behaviour, or has a fix?
Comment: On a related note - are you sure you're entering the password in correct language? I use Lithuanian/English keyboard layouts and Lithuanian one has numbers replaced with own letters. Since my password uses numbers - I can't enter them while Lithuanian layout is chosen. So make sure you're using ONLY English layout.
Comment: can you log in to the machine using `ssh`?
Answer: Sounds to me like a bug on the machine's OS, when is the last time you reinstalled OSX on that bay... I would just do do simple reinstall, keep the data and flush the settings and start from there... I found that osx (in the latest versions) is alot more dirty then it used to be... Can anyone say iTunes ; )
Later,

osx login is intermittently locked


What are ways to reduce mode errors while learning vim?

Question: I frequently make mode errors while using vim, i.e. I'll start typing text while in Normal mode, or start typing commands while in Insert mode.  I understand this goes away with time as vim's quirks seep into your bones, but are there any ways to speed the process?
Comment: I usually just mash Escape any time I'm not sure what state I'm in. It never really hurts!
Comment: I don't think it's a duplicate. This question is very specific, the other is more general.
Comment: possible duplicate of [What is the best way to force yourself to master vi?](http://stackoverflow.com/questions/74625/what-is-the-best-way-to-force-yourself-to-master-vi)
Answer: I use these autocmd's to highlight the entire line containing the cursor while in insert mode, and not while in normal mode:
if v:version >= 700
  autocmd InsertEnter * set cursorline
  autocmd InsertLeave * set nocursorline
endif

This provides a little bit more visual feedback about the mode.
Comment: And if that's not enough, replace `set [no]cursorline` with `colors [desert|default]`
Comment: ooo... that's a neat idea.  I think there will be a lot of variations on this.  The autocmd InsertEnter, InsertLeave autocommands could be used to trigger a lot.
Comment: I voted this up and selected it as the answer, but will have to post my variant as a separate answer since comments can't contain multi-line code blocks.  Thanks!
Answer: If you haven't done so already you can display the current mode by using :set showmode. That'll display -- INSERT -- in the status bar when in insert mode.
Comment: I think this might be in the default configuration... I've never seen a vim that did not display the current mode in the status bar.
Answer: Try to remember to always leave vim in normal mode.
Answer: Switch "Esc" and "Caps Lock" keys.
If you accidentally click on "Caps Lock" you will start inputing commands that has nothing to do with what you like to do. It is annoying if you are an experienced user; if you are a beginner it may be a hassle to understand what went wrong.
Every time you need to press the Esc key you have to move you entire hand and to get your pinky finger to touch the Esc key and then replace the entire hand again.
Some Vim users will tell you that after a while you get used to doing that and it is not a big deal. I think that argument falls short because you can pretty much get used to mapping any key any where. It is a matter of efficiency.
I believe "Esc" is used very frequently and "Caps Lock" is used seldomly if it is used at all.
So switching the two makes sense as it prevents errors and increases typing speed.
Answer: With gvim, the cursor changes from a block to a vertical bar when going between modes.  This at least gives you a little visual feedback.
Answer: Insert mode should only be temporary. Normal mode is, as its name tells, the favourite mode for edition tasks.
Usually, you should spend more time in normal mode, and always hit ESC when you are done inserting something.
Maybe I speak only for myself, but now I have the habit of assuming that I am in normal mode at all times, and I am almost never wrong.
Answer: Here is my variant of Ned's Answer.  It toggles on window switches (window focus is another modal behavior that provides little visual feedback).
if v:version >= 700
    set cursorline cursorcolumn
    au WinLeave * set nocursorline nocursorcolumn
    au WinEnter * set cursorline cursorcolumn
    au InsertEnter * set nocursorline nocursorcolumn
    au InsertLeave * set cursorline cursorcolumn
endif

I use it with the zenburn color scheme, and I also turn off cursor blink:
if has("gui_running")
    colorscheme zenburn
    set guicursor+=a:blinkon0
endif


Device getting IP without DHCP

Question: I have blocked in my router DHCP for all wired channels and even put the range for the one left, the wireless one, from .60 to .65 and put static IPs for the devices I want to allow to connect. Now theres a wired device that always gets an IP with .53 without DHCP being active. How is that possible? How can I block this unwanted device from getting an IP?
Comment: What is your router model and configuration?
Comment: Does the address of the unwanted device start with 169.254. ? If so, that's an APIPA address the device assigns to itself, usually a sign that DHCP DOESN'T work.
Comment: Nope, it's the good old 192.168
Answer: A few obvious possibilities:

the host has a statically configured IP address, thus not needing DHCP
the host has an old DHCP lease which is still being used
there is another DHCP server in your network providing the host with a DHCP lease

One thing to keep in mind: refusing DHCP requests from specific hosts does in no way block them from accessing the network.
Comment: Thank you for the response. In that case, how can I block him? When I access the mac filtering options in the router it shows me this:
"MAC Filtering is only effective on ATM PVCs configured in Bridge mode."
Comment: That totally depends on the equipment you're using, but this is a feature not present in most low end equipment. The easiest way is to shut down all wired interfaces you're not using.
Answer: Is this a Windows or linux box when yes, than the easiest and quickest way is to run wireshark on the device and filter the output to DHCP and there you can see that wo has assinged this IP to the device.
Comment: I know who it is, but I want him to stay the hell out of the network :(

Device getting IP without DHCP


How to pipelined the Map-input-stream as events directly to WSO2-CEP without selecting or using the "Input mapping type"?

Question: I am using WSO2-CEP with Esper(as runtime),Esper processed queries on Map as siddhi on tuples."Input Mapping type" basically declares the type of input conversion required for e.g XML-Mapping: XML to Map or Tuple.I have run an sample by converting xml events to map but what if i have "Map as input events" and i want to process them as Map only? Any help would be appreciated!!
Answer: WSO2 has depreciated Esper (and Drools) in favor of their new Siddhi engine


How do I save sms messages e.g. to SIM?

Question: Today have fired up my new Samsung Galaxy S II. To find that managing SMS messages is not as intuitive as on my old - non-smart Sony Ericsson. Cant seem to find a way to save messages to SIM - or anywhere else -  for example. And - I'm not up to android progamming!
Comment: possible duplicate of [How do I backup and restore SMS Messages?](http://android.stackexchange.com/questions/2466/how-do-i-backup-and-restore-sms-messages)
Answer: I don't know if there is a way to save them directly on the device, but I do know of a tool called SMS Backup + that I have been using almost since my fist android phone in 2008, and before I used SMS Backup +, I used SMS Backup.
This application will backup your SMS messages and Call Log to your gmail. It puts them in to SMS/CallLog labels so they don't clutter your inbox, but it is a very handy thing to have all your messages backed up. Especially when your wife says "I told you to get 3 loafs of bread", you can pull up and say, "Nope, see you said 30 loafs"...
SMS Backup + can not only backup your SMS/Call Log, but it can also restore them. The developer says MMS is also "coming soon". (but he has said that for a while not, not that I am in any rush for that feature). And, did I mention, the app is free.
Even if I was able to save them to my phone, I would have deleted them 100x over by now with all the times I have done factory resets, new sdcards, etc. Gmail also has way more storage available then my SIM, device, or sdcard. It is also more reliable. I have never lost data stored in my gmail, but I have had 4 sdcards fail on me.
Answer: For just backing up and restoring messages, you can try SMS Backup & Restore which backs up to an XML file on your SD card. You can use the XML file to view messages in a web browser or MS Excel, etc. as well.
Comment: you won't believe this - I discovered that if I just touch rather than tap the message, I get a box opening up offering me a range of options, like select text and save to SIM!!! Which is what I was looking for. The longer-term suggestions like those above I will explore - when I get more confident with the device!
Thanks to all for the suggestions

How do I save sms messages e.g. to SIM?


What is a musical pattern and how do you use it in style?

Question: In music theory what is a music pattern as it relates to style?  Here is a quote I got from this website to help one get my question about style... and the use of "musical pattern. " "Style refers to characteristic features of how music (of a certain era, or within some particular genre) is played or expected to sound, i.e. its actual musical content - the set of expected "musical patterns", mannerisms, expressive devices it conventionally makes use of" comment made under "In music what's the difference between genre and style."
Comment: You need to give more context. Where did you see such a reference to a "pattern" and "style" ... in a book, web page, video...?
Comment: Is this a homework question?
Comment: @piiperi Reinstate Monica I changed my question, hopes this helps.
Comment: @mkorman no it's not
Answer: A pattern is anything whose form repeats.
It's hard to talk about nearly anthing in music without a pattern being involved. Meter itself is a pattern, so if you are dealing with metered music - which is a lot of music - it's patterned.
A more obvious example is a harmonic pattern. In pop music the chords I V vi IV is a common pattern repeated over and over to accompany a song.
A lot of style elements come down to rhythmic/harmonic patterns. In country music a common pattern is the bass playing chord roots and fifths in quarter notes in common time. Descriptions of accompaniment patterns like that are important for defining a style. But patterns can involve other musical elements. It all depends on the particular style of music.
Answer: First off let me say that a music pattern can be any number of things when applied generally to music, but since you stated " as it relates to style", I will point out something such as a rhythm which is commonly used in a particular genre of music such as Reggae, or maybe a common number of bars that may be used such as the twelve bar Blues. Some might say a particular time signature might be a music pattern such as 3/4 is commonly called a waltz. In any event, a pattern in music can be defined as a repetitious characteristic that different styles of music might employ.
Answer: A musical pattern is a type of pattern seen in the sheet music. For example, one type of a musical pattern is sequence. Sequence is when you play a motive, then you play it a whole step or a half step above.
Here is an example of sequence:

Another type of a musical pattern is imitation: where the treble clef or the bass clef play a phrase and the other clef imitates it:

Another type of pattern is ostinato. Ostinato is a repeated phrase or pattern:

Another type, similar to the last is pedal point. Where a note (usual in the bass) is continually repeated or held:

I hope that helped! Let me know if have any questions.


Is the Dirac delta (impulse) signal a power signal or an energy signal?

Question: I'm a beginner so sorry if this question is very fundamental.  Dirac impulse has finite area i.e = 1. But I've heard that $|\delta(t)|^2$ is undefined. So area under $|\delta(t)|^2$ is also undefined and signal doesn't exist in all time $t$ so it cant be a power signal. So my guess is Neither Power nor Energy signal. Am I right?
Comment: A simple statement to remember : "dirac delta only makes sense under an integral sign"
Comment: Yes, I understood my mistake. But solving Parseval's equation ∫∞−∞|x(t)|2dt=∫∞−∞|X(f)|2df,  Energy of unit impulse signal Eω=∫∞−∞|1|2df = ∞. Is this approach of defining the energy to be infinite is fine?
Comment: Leaving $|\delta|^2$ undefined does not imply that its integral is infinite. The reason for the absence of a definition is that there is no consistent way to define it. If you take the approach of defining the Dirac distribution as a limit of unit area functions with the support approaching 0, then the square of that function simply can converge against anything you desire. Therefore the square is not implied by the defining property of the Dirac distribution.
Comment: Specifically, you can define such a sequence of functions that converges to $|\delta|$ so that the area of its point-wise square converges to 0, or any other non-negative number.
Comment: @Jazzmaniac what happens if you define the **object** $\delta(t)^2$ itself as the limit of the normal functions, (just as the usual $\delta(t)$ is defined so) such as: $\delta(t)^2 = \lim_{{\Delta} \rightarrow 0} F_{\Delta}(t)$ where $F_{\Delta} (t) = p_{\Delta}(t) p_{\Delta}(t)  = p_{\delta}(t)^2$... So at least then we would not be asking ourselves about the properties of the square of a generalized function. Rather it's, itself, independent of the $\delta(t)$, defined directly... would that help ?
Answer: [Added a reference on Schwartz's impossibility theorem for products of distribution]
The continuous Dirac delta  $\delta$ is not considered a true function or signal, but a distribution. From its wikipedia page:

The delta function can also be defined in the sense of distributions
  exactly as above in the one-dimensional case.[25] However, despite
  widespread use in engineering contexts, (2) should be manipulated with
  care, since the product of distributions can only be defined under
quite narrow circumstances.

It can be defined such that, for any function $f$ satisfying some important properties, and for $a\in \mathbb{R}$:
$$ \int f(t)\delta(t-a)dt=f(a).$$
From the best of my knowledge, those important properties are not satisfied by $\delta$, so one cannot directly replaced $f$ by $\delta$ and get a meaningful result. As far as know, the product of two Dirac distributions is not well defined, unless one talks about $n$-dimensional versions, or so-called "formal" manipulations as used in physics for instance, or more complicated maths.
A short account of Simplified production of Dirac delta function identities is provided by Nicholas Wheeler. If one wants to dig deeper, I'd suggest The Colombeau theory of generalized functions, by Ta Ngoc Tri, 2005:

Soon after the introduction of his own theory, L. Schwartz published a
  paper in which he showed an impossibility result (see [Sch54]) about
  the product of two arbitrary distributions.

One result is  Schwartz impossibility result. It (somehow) says that if one wants to encompass the derivative of continuously differentiable functions whle keeping  Leibniz's rule of derivation, then one get $\delta^2(|x|)=0$.
However, from an informal point of view, sometimes used in DSP (and in physics), this "product" is, as far as I know, neither energy nor power.
From a logical point of view though, if it does not exist, one could affect this "product" a lot of properties...
Some related posts:

What is product of delta function with itself?
What is the square root of the Dirac Delta Function?
Products and compositions with the Dirac delta function, C. K. Raju, Journal of Physics A: Mathematical and General, Volume 15, Number 2
Comment: When you say *this product is neither energy nor power* do you mean in the sense of the function $x(t) = t u(t)$ which is neither energy, nor power signal, (as it has infinite energy and infinite average power) ? Or do you mean in the sense that it's *undefined* ( or not decidable ) ?
Comment: I was expending my answer, and @endolith (in a nice move), did some edits and my corrections got lost (because of me on Chrome). So, until I find energy to redo: First, unless I find a way for a unique and  well-grounded Dirac square definition, useful to DSP, for which energy/power character can be assessed, it is not  (IMO), in the traditional  mundane way.  Second:  if not unique or decidable, I should choose to add a "not power/energy axiom". Such a product is too wild for my mind at the present time (like $i\times i$ in the past)
Answer: You're right that the square of a Dirac delta impulse is undefined, so energy and power cannot be defined in the usual way for signals containing Dirac impulses.
However, in analogy with discrete-time signals, it is common to define energy and power of a signal consisting of Dirac impulses in the following way. If a signal $x(t)$ is given by
$$x(t)=\sum_{n=-\infty}^{\infty}a_n\delta(t-t_n)\tag{1}$$
then its energy can be defined as
$$E_x=\sum_{n=-\infty}^{\infty}|a_n|^2\tag{2}$$
and its power can be defined by
$$P_x=\lim_{T\rightarrow\infty}\frac{1}{2T}\sum_{n:\;|t_n|<T}|a_n|^2\tag{3}$$
Using definitions $(2)$ and $(3)$, a signal consisting of Dirac impulses can either be an energy signal ($E_x<\infty$), or a power signal ($E_x\rightarrow\infty$, $P_x<\infty$), or neither of the two (both $(2)$ and $(3)$ do not exist).
Comment: The generalisation that squares are not defined for any distribution is not accurate, at least not without additional qualification of the term distribution.
Comment: @Jazzmaniac: I removed the reference to general distributions because it doesn't add anything useful to the answer. By the way, that claim is taken from engineering literature, which might indeed be inaccurate when it comes to details about distributions.
Answer: $\delta(x)$ doesn't really exist at all for any particular $x$. Like Laurent Duval said, Dirac is not an $\mathbb{R}\to\mathbb{R}$ function, rather the whole mapping
$$\backslash f \mapsto f(a) \equiv ``\int_\mathbb{R}\!\!\mathrm{d}t\: f(t) \cdot \delta(t-a)"$$
is a functional, mapping functions to values of the function evaluated at some particular point. Arguably, it would make sense to reflect that with a dedicated symbol, like
$$
  \int\!\!\!\!\delta_a\mathrm{d}t\: f(t).
$$
(The reason it makes sense to write $\delta$ as if it was an $\mathbb{R}\to\mathbb{R}$ function is that any square integrable function $g$ gives rise to a functional in a similar way, namely
$$
  \gamma : L^2(\mathbb{R})\to\mathbb{R}, \quad \gamma(f) = \int_\mathbb{R}\!\!\mathrm{d}t\:f(t)\cdot g(t).
$$
That's in fact just the $L^2$ scalar product between $f$ and $g$; the function space $L^2$ is a Hilbert space The benefit of the Dirac-delta notation is that it allows you to write superpositions of such real-function functionals and Dirac functionals, for example the high-pass impulse-respone
$$\delta(t) - \sqrt{\frac{\omega_0}{2\pi}}\cdot\exp(-t^2\cdot\tfrac{\omega_0^2}2).$$
That's a function you can never actually implement in practice, only approximate, but it captures the concept of a high-pass filter which isn't really concerned with the impulse-response as such, but by the result of folding it with actual real-world signals, and it is the folding that provides the integral which defines the $\delta$'s meaning.)
So, because $\delta$ is not a function, there's no reason to believe it could make any sense to write $|\delta(t)|^2$ since in that expression the delta does not occur exactly once beneath an integral running over its variable. Even if you did write an integral around it, it would always have two deltas with the same parameter in it, and that's not defined.
Summary: you're right, Dirac is not a signal, neither power nor energy.
Comment: Your latex formatting seems to be broken. Did you use a latex formula editor/converter or is this intentional?
Comment: @Jazzmaniac the formatting was fine in my browser, but I had accidentally used a couple of Unicode ℝ instead of LaTeX `\mathbb{R}`, perhaps MathJax doesn't reliably support that. Does it render ok now?
Answer: You have got nice answers here but I'm trying to explain it in a simple way:
An impulse is any signal that is entirely zero except for a short blip of arbitrary shape. For example, an impulse to a microwave transmitter may have to be in picosecond range because the electronics respond in nanoseconds. In comparison, a volcano that erupts for years may be a perfectly good impulse to geological changes that take millennia. Mathematicians don't like to be limited by any particular system, and commonly use the term impulse to mean a signal that is short enough to be an impulse for any system! That is a signal that is infinitesimally narrow and again mathematicians define an impulse as: 1. signal that is infinitesimally brief 2. The pulse occurring at time zero and 3. Pulse must have an area of one [By Steven W. Smith]


What kind of bush is this?

Question: I was walking around town with my kids the other day and this bush caught my eye. I just love it and want one of my own lol. Can someone help me out in identifying it please. It's located in north eastern North Dakota.
Answer: Well it looks like a double flowered blossom, so its probably a Prunus variety, but as to whether its a Japanese flowering cherry such as Prunus Kanzan, or Prunus triloba, flowering almond, is hard to say, need sight of the trunk, overall growth habit and close up of the leaves.
UPDATED ANSWER
I would just offer a piece of advice though- there are myriads of Prunus flowering blossom trees, many with double flowers, and all vary enormously in size and growth habit, so your choice of blossom tree should be based on where you're going to plant it, so that you know it's not going to get too tall or wide for where it is, as much as what the blossom looks like. Regarding blossom, bear in mind its only there for a couple of weeks, in a windy year it'll be ripped off the tree quicker, and then you're looking at just the leaves for six months, so choice should also be related to overall appearance without the blossom present. And be prepared for the piles of browning blossom petals on the ground as the blooms fade!
Comment: Okay, I'll try and get those pictures today when we go for a walk :)
Comment: See updated answer...
Comment: When they are in bloom they are spectacular and  the right size for a smaller garden.  Out of bloom they are insignificant, flop around and don't even have any fall colour.  They stems get an infection and ooze a viscous sap.  When you cut them back they sucker.  Not on my list of favourites.
Comment: @kevinsky you could probably tell they're not on my favourite list either, although serried ranks of them in parks are stunning in spring.  I'd surface rooting as another problem with these, and the suckers they produce as they age. I'd always go for Prunus cistena or cerasifera, at least the leaves are a great colour, if I had to choose one.

What kind of bush is this?


checkstyle rules that covers Effective Java recommendations

Question: Does anyone know if there is a compilation of check style rules that covers most of the recommendations made by Joshua Bloch in his Effective Java book? I know I can add custom rules in the checkstyle plugin but I was wondering if anyone has already done so and if willing to share them. :)
Answer: I am the founder of the Checkstyle project. As far as I know, no such Checkstyle rules file exists. I am not surprised as Checkstyle checks can only check source code level things, such as Javadoc comments, whitespace, etc.
Unlike FindBugs, Checkstyle does not compile the source code, and hence does not have access to type information which would be required to implement implement some of the recommendations made by Joshua Bloch in his Effective Java book.
Comment: nice to have you on StackOverflow. Thanks for the info. I appreciate it.
Answer: I agree with Oliver, that Checkstyle have limitation and not all from "Effective Java" could be covered by checkstyle.
Take a look at our extension for standard checkstyle project - we take bunch of ideas from this book and we have plans to implement more.
Url: http://sevntu-checkstyle.github.com/sevntu.checkstyle/
Feel free to cooperate.


Open Sets Boundary question

Question: I'm really having a hard time with this problem: Find three disjoint, open sets in $\mathbb{R}$ (std. topology) that have the same nonempty boundary. I played around with a few ideas like $\mathbb{Q}$, {$\sqrt{p}+\mathbb{Q}$}, {$\sqrt{q}+\mathbb{Q}$} where $p$ and $q$ are distinct primes, but these sets aren't open. I can find examples that fit two of the conditions, but not all three.
Comment: Just wondering, where did you find this problem?
Comment: I'd like to know where the problem came from too. It stumped me for most of the day and my math professor when I asked him quickly what he thought of it.
Comment: @user124910 My answer to this question needs to be unaccepted. It is demonstrably wrong
Answer: Let $C$ be the Cantor ternary set on $[0,1]$. Its complement in $[0,1]$ is a countable union of open intervals, which are naturally ranked into "generations", for instance by size. Let $U_i$ be the union of the open sets of generation congruent to$~i$ modulo$~3$, for $i=0,1,2$. Then the opens sets $U_0,U_1,U_2$ are disjoint, and $\partial(U_1)=C$ for $i=0,1,2$.
The essential point of this construction is that although each $U_i$ is missing many of the open intervals of the complement of$~C$, the boundary $\partial(U_i)$ does contain the boundary points of such intervals, because $U_i$ contains intervals arbitrarily close to those points. The same is true for the uncountably many points of $C$ that are not an end point of any interval at all.
One can generalise this construction directly to more than three disjoint open subsets with the same boundary, by choosing appropriate disjoint infinite subsets of the set of generations (which is indexed by the natural numbers). In particular one can find countably many disjoint open subsets all with boundary equal to$~C$. Since any collection of disjoint subsets of$~\Bbb R$ is at most countable, this is about as good (or bad, depending on your point of view) as one can expect it to get.
Comment: Looking at this and I'd think you could expand this to have a countable number of disjoint open sets sharing a boundary. Or at the least any finite number you wished.

Open Sets Boundary question


Safek Deorayta and the Meiri

Question: The Meiri Berachot 21 (Peri Hadash, Keneset HaGedola and others) writes that in a case of Safek Deorayta Lehumra where one isn't certain after performing the action that he has fulfulled his obligation (i.e. Techelet) he still must perform the action. I know the Bet HaLevi argues with this. Who else is on the Bet HaLevi's side (if anyone)?
Comment: Is this a question about safek deoraita lechumra or techelet?
Comment: This question doesn't seem to be about the Meiri at all. Am I mistaken?
Comment: I don't know about Meiri but I do know that the Maharit Algazi, Chavos Daas, and Lev Aryeh write that even according to the Rambam that ספק דאורייתא לקולא מן התורה thats only by an issur not a mitzvah in which case one must be מחמיר מן התורה.
Comment: @RebChaimHaQoton yes, but many argue and that and Hacham Yishak Yosef (author of Yalkut Yosef) doesn't hold like that.
Answer: The Maharam Shif says it in Bava Metzia 6b. (Other Rishonim there who don't answer like him presumably argue. For others who argue, see Rav Schechter's Ginas Egoz.)
Answer: I don't remember the Meiri saying more than what the Chavos Daas says but the din safek deoraysa lchumre clearly applies here as is muchach from Mishna berura Siman 32:50, 33:5 and in Biur halacha ד"ה אין and MB 39:26 and Biur halacha in 648 ד"ה שדומה (page 136)
also the biur hagra on 32- 5 is mevour like that
there is an entire sefer dedicated to this on otzar hachochma called mishmeres mitzvah it can be found here

Safek Deorayta and the Meiri


How to fix scrolling lag in office 2016 windows 10

Question: I notice a weird lag while scrolling in some word documents. It takes almost 2 sec for the word to react on scrolling and when it does it goes line by line. Same thing when I actually click on the scrolling bar of the document.
Usually happens when I open 2 documents or more. Is there a way to temporary fix it? I cannot wait for Microsoft to release an update.
Comment: How do you know this is a bug with Microsoft Word? Does it happen with new Word documents, or only when certain content is used (such as tables or images)? Do you experience lag else where on the machine, such as in web browsers?
Comment: @Dave No, I only noticed it in word. Office wod 2016 is really slow. My pc does not have any other problems, only with word 2016. I do not know what causes this bug but it usually happens after I use "search Navigation" in a document.
Comment: Are you able to replicate it else where? For example, on another PC with the same document and Word 2016? Or, and I know this is hassle, try installing Word 2013 to see if the issue persists. Lastly, a re-install may help? Starting Word in safe mode (if you use any plug ins?)
Comment: @Dave The problem seems to be correlated with navigation (search). I cannot test it in other pc and all my friends-colleagues do not have the 2016 version. I ll try to reinstall it soon but I do not think that it is a problem. In google there are results with scrolling lag in office 2016, no solutions were offered. I guess its a bug.
Comment: Please [edit your question](http://superuser.com/posts/1029891/edit) to add the details from your comments. Thanks.
Answer: I had a similar problem, and tried deselecting a number of things in the advanced settings in word - with no improvement. I then tried updating my logitech usb keyboard driver, and problem solved.
Answer: I had the same problem. A workaround that fixed it was turning off animated controls:
In Word, go to Control panel > System and security > System > Advanced system settings (in upper-left side) > Advanced tab > Settings in Performance box > Visual effects: Here disable Animate controls and elements inside windows.
Answer: I was experiencing the same behaviour in OneNote 365 (previous version were fine) I turned off smooth scrolling in my Logitech mouse software - Uncheck Enable Smooth Scrolling on the Pointer and Scrolling Settings tab and it solved my scrolling issue.


Account with most Won opportunities

Question: I am trying to find the Account with most Opportunities in Closed/Won state.
Is there any way to achieve this functionality using configuration, without code?
Answer: There's no need to use up a custom field on the Opportunity, in order to achieve this.
You can filter the Account roll up summary field to only Count (not Sum) Opportunities where Won EQUALS True.
See this documentation for more details.
Comment: Of course, much simpler :)
Answer: You could create a Formula field on the Opportunity as follows:
IF(TEXT(StageName) == 'Closed Won', 1, 0)

Which would yield 1 if the opp is Closed/Won.
Then, on your Account, create a Rollup Summary that SUMs these. Then, essentially what you'd have is a count of the Closed/Won opps on an Account, which you could then produce a report or list view for.

Account with most Won opportunities