How does Very Long Baseline Interferometry work?

Question: According to internet sources, this technique increases the effective diameter of the telescope, thus improving the angular resolution of the telescope. However I don't understand how this actually works. The way I understand it, I know that signals from different locations in the boundary of the black hole may constructively or destructively interfere, and from the information about the relative separation between the telescope can tell us about the shape of the black hole.
However how does any of this have anything to do with the 'effective diameter' of the telescope?
Answer: @JamesK's answer explains in prose, but we can also address the OP's comment

On what grounds do you say that a larger diameter leads to larger phase difference?

more rigorously.
The diagram below shows two dish antennas on the ground separated by a distance $D$. Each dish is tilted so that it is pointed directly at the source, so that the phase of the received signal is constant and independent of where the signal hits the dish.
However, The signal is coming in at an angle with respect to the surface of the Earth, so the phase will be different between one dish and the next.
If we draw a big right triangle, with the hypotenuse being the baseline between the two, and define $\theta$ as the angle of incidence with respect to the zenith, the triangle construction will show that length of the side representing the phase difference will be $D \sin \theta$. The extra phase $\Delta \phi$ accumulated along that length for the signal collected by the further  antenna with respect to the closer antenna will then be given by
$$\Delta \phi = 2 \pi \frac{D}{\lambda} \sin \theta$$

Source
Comment: Extend to explain why this behaves like one big dish of diameter $D$ (and also in what respects that it doesn't).
Comment: @ProfRob Because I love that bit so much, it is really challenging for me to do it in a reasonably short space suitable for an SE answer post. I'll give some thought to how to do so. My intention here was only to address that one comment under the other answer, not to write the chapter on radio interferometric imaging that your suggestion deserves.
Comment: @ProfRob [nicely done](https://astronomy.stackexchange.com/a/51753/7982)!
Answer: Suppose, instead of thinking about interferometry, you first consider an ordinary mirror. If you are using this mirror to create an image of a point source of light, you would hope that the mirror would focus the point of light to a single point in the image.
This is what "geometric optics" (in which you treat light as moving in straight lines) would predict.
But there is a problem, the light reaches the mirror in phase and so when it is reflected, there is constructive and destructive interference around the point, which blurs the point of light.  This problem is greater with small mirrors, since with a small mirror, the phase difference across the diameter of the mirror is small.  The larger the mirror, the greater is the difference in phase and the smaller is the blurring.
You can even achieve less blurring by having two mirrors that are separated but acting as one  (in practice, getting two mirrors aligned accurately enough is very difficult, you need nano-metre precision to bring the light together to form a single image)
The formation of an image depends on the process of bringing light together.  Now if you are observing in radio waves, not light, you can actual measure the peaks and troughs of the radio wave, and not just the intensity of the wave. (by contrast, when you take a photograph, you only record the intensity).
This means you can record the pattern of the waves, and bring the waves together computationally.  You are essentially using a computer to do what a mirror or lens does: bring the waves together to form an image.
You are limited by exactly the same blurring problem that occurs with real mirrors, but the separation of the radio telescopes can be much greater.  Mirrors and lenses depend on nanometer accuracy to achieve a good image.  But if you can combine the radiowaves in a computer, you can compensate for that, so it is possible to have a telescope with an effective diameter of 10000km.
So the process of VLB interferometry is doing with a computer what a mirror naturally achieves: bringing together radiowave/light from different places to create an image.
Comment: On what grounds do you say that a larger diameter leads to larger phase difference?
Comment: "The larger the mirror, the greater is the difference in phase and the smaller is the blurring." Why does a greater phase difference lead to lesser blurring?
Answer: If you look at an object with a pair of telescopes separated by $D$ and the object is "off-axis" by an angle $\theta$, then as @uhoh's answer shows, there is a phase difference between the signal received by the two telescopes of $2\pi D \sin \theta/\lambda$.
Now suppose we arrange it so that this phase difference is a multiple of $2\pi$ so that the signals are "in phase". What we can then ask is "by how much could we change $\theta$ for the signals to go "out of phase" - i.e. for the phase difference to be $\pi$. Because, if we can tell the difference between a source at an angle $\theta$ and at an angle $\theta + \Delta \theta$ by observing the interference pattern from the two telescopes go from being in phase to out of phase, we can claim to have "resolved" objects separated by that angle $\Delta \theta$. (NB: This definition of the limiting angular separation is a bit handwavy and more exact definitions are usually used).
The limiting value of $\theta$ is therefore given by
$$ \frac{2\pi}{\lambda} D \sin (\theta + \Delta\theta) - \frac{2\pi}{\lambda} D\sin\theta = \pi\ .$$
Using standard trigonometric identities and using the fact that $\Delta \theta \ll 1$ radian
$$ \frac{2\pi}{\lambda}D\sin(\Delta \theta) \cos\theta \simeq \frac{2\pi}{\lambda} D\cos\theta\  \Delta\theta = \pi\ ,$$
$$\Delta \theta \simeq  \frac{\lambda}{2D\cos\theta}\ .$$
Thus the larger $D$ is, the smaller the separation $\Delta \theta$ is between two close sources that can be resolved.
The problem with this is that if we make $\Delta \theta$ a bit larger, then the signals start to come into phase again. However, if we had information from a pair of telescopes with a smaller separation, we would see the signals from those telescopes go out of phase. Combining the information from the two pairs of telescopes we might come to an understanding of exactly what the separation of the sources is (so long as it is $\geq$ the limiting $\Delta \theta$).
The above illustrates how we can say that a pair of telescopes separated by $D$ behaves like a single telescope of diameter $D$ (if the source is overhead and $\cos \theta \sim 1$) in terms of the smallest angular separation between two sources that can be resolved. However, to provide unambiguous information about the separation between the sources we could also do with information from telescopes at smaller separations. This of course is naturally provided by a telescope with "filled" dish, where all baselines from zero to the diameter of the dish are sampled and leads to the formation of an image.
With interferometers one tries to "fill the dish" in two ways (i) as the Earth rotates $\cos \theta$ can change and provide a range of baselines (though this wouldn't be helpful if the source were variable!) (ii) we can use an array of telescopes with different baselines to fill in that information.


Blackberry background Push Notification using MDS

Question: I am working on Blackberry Push Notification using MDS. I have referred the sample project HTTPPushDemo which Blackberry API has provided. I am getting pushed data successfully only when app is running. How I will get pushed notification using MDS when app is not running ?
Answer: The typical arrangement is to have two apps - the foreground app and the background app. The foreground app has all the UI elements, and it starts when the user clicks on the app icon on the device, and terminates when the user selects 'exit'  This would largely be what you've written already.
The background app hides itself - no icon is present in the app switcher or on the device.  This means the background app continues to run whether or not the foreground app is running.  This allows you to setup the push listener, and keep it running even when your app is "not running"
Both 'apps' actually inhabit the same codebase - you differentiate them by adding a new start argument, and then in the app startup, the code checks whether it should be the foreground or background app, and behaves appropriately.


WPF MVVM Light Navigation

Question: I'm working on a windows WPF application using MVVM Light. As far as for switching views and navigation purposes, is there set classes readily available?
Right now, I'm using a MainViewController to load other views with datatemplate and messenger class. But i'm not sure if its the best practice.
Comment: Why not use the MvvmLight Messenger for that?
Comment: how will the messenger be used? just to trigger calls and load the right controller in the main controller?
Comment: @my779 you seem to be on the right track. messenger also allows calls to be "directed" because of the subscription/broadcast concept. An answer with some actual code can be found: http://stackoverflow.com/a/26266708/3109213
Comment: try to implement the Navigation Service to suit your needs, take a look here
http://stackoverflow.com/questions/28966819/mvvm-light-5-0-how-to-use-the-navigation-service/28968560#28968560
Comment: possible duplicate of [WPF MVVM navigate views](http://stackoverflow.com/questions/19654295/wpf-mvvm-navigate-views)
Answer: Meant for switching is ContentControl but it has nothing to do with MVVM Light. Based on its Content you can assign diffrent Views. Take a look here.
Comment: what if the sub view controllers has their own sub views? Such as a detail view from one of the view controllers. Will the MVVM light messenger framework be needed to trigger the change in the content control?
Comment: Presumably yes but you would have to paste some code to find out.

WPF MVVM Light Navigation


What week does baby start listening?

Question: I am 4 months pregnant and wondering in which week of the pregnancy does my baby start to listen ?
Comment: There is lots of evidence that talking to your infant a lot, narrating your day, etc. long before your baby can understand the words really helps language development. Why not begin early, if only to train yourself for later?
Answer: Supposedly a fetus is capable of hearing, depending on the source, as early as at around 16th week of pregnancy [1] or 20th week[2], or 24th week [3]. Apparently, people are not sure:) But what is important is that the baby really does listen quite a long time before it is born.

What week does baby start listening?


Pressing TAB after the "Tags" textbox on Ask Question page should jump to the checkbox underneath

Question: I have prepared the following series of screenshots to show what I mean. I have highlighted the focused element to make it more obvious. The TAB key is expected to go to the logically "next" element; however on this page, it skips an element unexpectedly. The result is that pressing Space, intending to check the checkbox, posts the question instead.
Answer: The CW checkbox is also skipped when tabbing from body to tags. Looks like title, body, tags, and submit button all have tabindex attribute specified, but not for CW or e-mail check boxes. I've never understood why any webdeveloper uses tabindex. In this case, like over 99% of cases, you get the correct tab order just by letting the browser figure it out.
Comment: we don't actually want CW to be part of the tab order because it's so rarely used. So that's why..
Answer: Intentional - that option (along with community wiki) is rarely used, so we skip it in the tab order. It is also not present in some cases.
Comment: Jeff, when you guess the user intentions WRONG it's MUCH WORSE than if you don't try to guess them AT ALL.
Comment: Wouldn't it be better to move the *notify ... of new answers* line **below** the *Post your questions* button (when it exists, of course)? Then it can stay in the natural tab order (i.e. not bug people who don't need it), and still would not confuse people who expect the screen order to be the tab order.
Comment: What happened to principle of least surprise?

Pressing TAB after the “Tags” textbox on Ask Question page should jump to the checkbox underneath


What sightseeing activities are available in winter in the Rocky Mountains?

Question: I will be in NYC in the first week of January. Since I prefer sightseeing and not doing classical winter activities (ski etc), I wonder what sightseeing activities are available in winter in the Rocky Mountains?
Comment: I edited the opinion based and wanta parts out of the question. We don't do recommendations nor travel plans here on travel.se.
Comment: ... hopefully you're aware that the Rocky Mountains are on the other side of the continent from New York City, 2500+ kilometers away?
Comment: @HenningMakholm lol yes I'll take a flight to Denver. Obviously.
Comment: There is nothing stopping you from going to a ski resort and admiring the vista from the lodge. This question might be better-received, for example, if you indicate what you expect to get out of sightseeing, and why you are interested in the Rockies as opposed to the Sierra Nevada or the Cascades, and other such details that indicate that the interest is more than a whim.
Answer: Skip it this time
Unless you are interested in skiing, there are limited activities, and you will miss a lot.
All the major national parks (Rocky Mountain NP, Yellowstone, Grand Teton, Glacier etc) will be closed or partly closed. As will many hotels, most scenic roads/passes and so on. You can look for individual information about each park and its surroundings here.
The majority of this infrastructure will be closed until April (or later).
However, you can try to visit some alternative destinations, like Las Vegas, Grand Canyon, and some of Utah's national parks (which will be open), like Zion or Arches.


How the number of binary collisions increases with centrality faster than the number of participant in heavy ion collisions?

Question: How the number of binary collisions increases with centrality faster than the number of participant in heavy ion collisions at different particle colliders?
Answer: It's combinatorics, a variant of the "handshake problem." Suppose you are at a party with $N$ other people and you want to shake everyone's hand: you're going to give $N$ handshakes.  But so is everyone else, so the total number of binary interactions handshakes will be $\frac12N(N+1)\approx N^2/2$.  You can do this by hand for small parties:

1 person: no handshakes
2 people: 1 handshake
3 people: 3 handshakes (AB, AC, BC)
4 people: 6 handshakes (AB, AC, AD, BC, BD, CD)
5 people: 10 handshakes

In collisions you have the additional complication of pair creation in some binary collisions increasing the number of participants as well.
Comment: I have appreciated your answer. But I wonder, for the case of inelastic collisions the parent particle will loose its own identity by forming some lighter particles. So, how can you relate this phenomena with the "handshake problem", where if you shake hand with other for the first time, then you will loose your identity.


basic rails question

Question:   class Person < ActiveRecord::Base
    validates_uniqueness_of :user_name, :scope => :account_id
  end

my question is about the above three lines of code. by the way I'm c++ programmer and new to ruby and rails. I'm very very confused by the line: validates_... what's that? variable
definition? function call? or something eles. For me, it's a weird line whithin a class definition.
Answer: It's a function call. You could rewrite it as validates_uniqueness_off(:user_name, :scope => :account_id). In Ruby, the convention is to ignore these parentheses. Rails gives you these class methods as part of ActiveRecord::Validations module. The rails API can give you more information about how it's defined and you can also take look at the sources to see how it's implemented. Hope that helps.
Answer: It's a function call.
The function is defined in module (ActiveRecord::Validations). Modules in Ruby are objects and can have functions and variables attached to them.
You can include module and get it's members. Here it's done in your parent class: ActiveRecord::Base. If You look at it's definition it starts with something like:
module ActiveRecord
  class Base
    include ActiveRecord::Naming
    # ...
    include ActiveRecord::Validations
    #...
  end
end

There are some noticeable differences in way C++ and Ruby handles class declaration. Firstly, there is no compilation in Ruby. So class definition can be changed during runtime. And actually it's the default way of declaring a class. In other words: classes in Ruby are always open.
Secondly, class body can have any executable code. In C++ you can't invoke a function from class definition. It wouldn't make much sense. Yet in Ruby it makes, since You are able to do metaprogramming. This way you can invoke a function which constructs some members. That's writing functions which can write another functions. It can be a big productivity boost and a source of worst errors at the same time.
I'd highly recommend consulting the Ruby Metaprogramming: Declaratively Adding Methods to a Class entry.
Comment: @Haiyuan, I added two paragraphs to elaborate on that. Basically Rails is very mature framework using a lot of metaprogramming. Behind the scenes ActiveRecord objects are empowered with tens of fields and functions to handle (among others) validation, typecasting, SQL translation.
Comment: @demas, rekin and anukul: how could a function call occurs in the definition of a class in ruby? which part of ruby I should if I want to fully understand this
Answer: It is a function call. You can find here more examples of validations of model.

basic rails question


Multimodule project with Maven and Eclipse

Question: I am converting my standard java project to maven and at the same time I am setting it up in eclipse. The first thing that stroke me was that in multimodule project (and I suppose every serious java application is multimodule) as mine looks hard to work with. I am using this approach and the problem is do I have to always type "mvn install" so that all the shared projects are built and installed into repository so that other projects will work with their's new version?
It seems a little bit overcomplicated. Why the mvn eclipse plugin doesn't support something like creating "eclipse project dependencies" to ease up eclipse development?
Answer: well... sorry for this question. mvn eclipse plugin does exactly what I described.


Is Statura dead?

Question: Ken Leung portrayed U.O. Statura in The Force Awakens. To my knowledge, he does not appear in The Last Jedi. Is he still alive?
Answer: It would appear that Ken Leung appearing in the The Force Awakens was because of J. J. Abrams using him as a reference to his previous work, in this case Lost.

Grunberg, who also played the pilot on the Abrams-produced Lost, is joined in the Resistance by another Lostie—KEN LEUNG, who played DHARMA spawn Miles. Here he's Admiral Statura, a member of the rebel force set on taking down the First Order.
Daily Beast, How to Spot All the 'Star Wars: The Force Awakens' Cameos, From Daniel Craig to Yoda

With J. J. Abrams not directing The Last Jedi it's likely he may not have had a say in what actors would come back into the film. It would also appear that the actor was filming for Inhumans during a similar period to The Last Jedi so may have had a filming conflict.
In universe though U.O. Statura doesn't appear in the film and I can't find any references to him in it yet so it would appear the character is dead. Likely during the events of the film considering how many died.
It's worth noting that he isn't in the list of currently identified characters that survived to escape onto the Millennium Falcon at the end of the film pointing to him most likely being killed.
Answer: In the novelization of The Last Jedi, it says Leia sent pilots Jess Testor and Snap Wexley to find or recruit allies of the Resistance. There might have been others as well, such as this character.
Comment: Although this answer is basically speculation at the moment it would be greatly improved if you could add the relevant quote from the novelisation.

Is Statura dead?


Does Qmail utilize any of Sendmail's own configuration files?

Question: I am trying to run sendmail in tandem with qmail. Presently there is a symlink in the /usr/sbin/ directory pointing to the /var/qmail/sendmail binary. What do I have to change in the qmail configuration if I remove the symlink and rename sendmail.sendmail (I think this is the present name for sendmail's binary) to sendmail so my program can call it. What do I have to do to isolate the two installations aside from selecting a different port in sendmail's configuration?
Comment: just curious as to why you need both if your program is just calling sendmail to deliver email the qmail wrapper should work the same way?
Comment: It doesn't work quite the same. It's generating an error when OpenEmm calls it with the -q parameter:
Starting sendmails: listener sendmail: illegal option -- q

From what I've read it appears qmail uses a scaled down version of sendmail.
Answer: The sendmail symlink is only provided to provide a sendmail-like interface to qmail, so 3rd party programs that expect sendmail. Qmail itself doesn't depend on it and should never call it.
Renaming/replacing it with a real sendmail binary should not affect qmail - it just means any 3rd party programs that call it will now be interacting with sendmail and not qmail.
Comment: Am I correct that Sendmail's own binary has been renamed sendmail.sendmail so as not to interfere with the symlink? If not, which binary is the correct original Sendmail binary, i.e. what has Qmail renamed it to?


In WinForms .NET C#, how to save to disk the state of a TreeView control

Question: For a .NET 3.5 VS2008 treeview control, where the item labels are set to be editable, how do I save the changes to disk so that I can load them up again when the application restarts?
Thanks
Answer: Here's an article covering serializing and de-serializing a TreeView control using XmlTextWriter and XmlTextReader.
Answer: You have to use a serializer .... binary serializers are the fastest and most efficient but are not widely support by non .Net platforms but they support Serializaition events so you get more granualr control over the serialization process. Use a serializer of your choice to save the state or programmitically do it the long way by using a confile file and save all the expanded nodes and re draw it manually. This is a worthwhile academic excerise but not the best way of doing it.
Serialization is a big chapter, read up on it and choose the class that meets your needs. Remember if your application is goiong to be working with non.Net platforms then XML is the way to go or SOAP !!!


I need grammatical explanation for this sentence "its poor torn mouth an O of agony"

Question: I need grammatical explanation for this sentence "its poor torn mouth an O of agony". It's weird to me that there is no verb in this sentence, I think it would be like "It's poor torn mouth formed an O of agony"
Full context:

The boy seized it and tore the bait from its mouth, ripping it horribly.
'Oh!' I whispered, covering my own lips.
It got a lot worse. The fish was flopping about frantically, its poor torn mouth an O of agony.

From "Buried Alive" by Jacqueline Wilson
Answer: Actually it doesn't need a verb there, because there is already a main clause with a verb ("was flopping"). You could also write:

The fish was flopping about frantically, its poor torn mouth [like] an O of agony.

Compare:

I went to sleep, tired as a log.

She was screaming, [with] her hair [in] a mess.
Answer: Some people refer to such clauses as "absolutes" and others call them "free adjuncts". They act as modifiers of the main clause and can omit a form of the verb-to-be. Semantically they pertain to the main clause but syntactically they're disconnected from it.

His hat at a rakish angle, he strode up to the bar and ordered a whisky, neat.


How do computers execute instructions spanning multiple clock cycles?

Question: There are some(or most) instructions in a computer that simply cannot be executed in a single clock cycle. But there lies a problem. How does the program counter in the computer know when an instruction is completed, considering that one instruction might take 2 clock cycles vs another being 3 clock cycles. How do program counters(or more importantly, the machinery that detects that an instruction is complete) work?
Comment: I strongly recommend watching entire series of videos (over 40 of them!) on Ben Eater's channel describing [building 8-bit computer from scratch](https://www.youtube.com/watch?v=HyznrdDSSGM). He shows exactly how microcode is designed and executed.
Comment: AFAIK the PC is incremented when the instruction is fetched, before it has been decoded, executed and write back.
Comment: A finite state machine controls instruction fetch and decode cycles. Charles Petztold's book *Code* is a good first resource for this kind of question.
Comment: Okay, but watching 40 videos isn't something I can do in one day. I have school, so which video(or videos) do you think best answer my question?
Comment: @TrevorMershon this one: [8-bit CPU control logic](https://www.youtube.com/watch?v=dXdoim96v5A), but it actually has 3 parts. Note that in his build Ben Eater uses fixed microcode length, but he mentions that one of the commands can be "reset microcode counter", which would allow each instruction to have its own length
Answer: tl;dr version: instructions are expanded internally to multiple microcoded steps. The PC is held by microcode until the instruction sequence completes.
get-a-cuppa version:
A CPU has two types of code: instructions (opcodes + operands) that are fetched and executed from RAM, and the small steps that carry out that instruction, called microcode, that implement each sub-operation necessary for the instruction.
For example, an instruction that adds two numbers from memory and stores them back to memory would break down in steps like this:

fetch value A from RAM and load in register A
fetch value B from RAM and load in register B
add registers A and B, store in register C
store register C into RAM

So here we have four defined microinstructions (microcode sequence steps) to complete one opcode, expanded out from just one instruction fetched from RAM. These microinstructions are decoded, one by one, to steer the data from external memory or I/O, through the CPU, and finally back to memory or I/O.
Thus, there are two 'program counters': the system PC (Program Counter) that provides the external instruction address, and a microinstruction sequence count that selects the current microinstruction step. The PC advances on each instruction fetch, while the microinstruction sequence count advances faster, on each CPU clock. Greatly simplifying, the PC advances only when the microinstruction sequence is finished.
So in the above example, the PC is held for four clocks waiting for the microcode to complete, then advances to the next count and the next instruction is fetched. In reality, to save time the next fetch can be - and usually is - overlapped (pipelined) with the current instruction processing. This gets complicated with instructions that can lead to a branch, that is, a jump that isn't to the next code address. Anyway, instruction prefetch is a rabbit hole for another time.
What does it all mean?
Clock cycle count per instruction is a huge deal. It is a subject of hot debate and a long-standing competitive rivalry. Why? Without getting into too much detail, the two main approaches to computer architecture these days are:

CISC, for Complex Instruction Set Computer and
RISC, for Reduced Instruction Set Computer

Broadly speaking, CISC machines (like x86) have many complex, powerful instructions that are code-dense, but take many microcode cycles to execute. RISC machines (like ARM) have simpler (and fewer) instructions that take fewer cycles to complete, but are less code-dense (programs are bigger).
It's been nearly 40 years since RISC came about, and decades longer than that for microcoded CISC (going back to the late 1940s.) In those 40 years alongside each other as competitors for mind- and market share, there has been a lot of cross-pollination between RISC and CISC, hastened along as VLSI technology has become faster and more dense. So CISC hardware got more powerful and cycle-efficient, while RISC hardware increased in complexity while keeping to the small-is-beautiful idea of a simpler opcode set.
Comment: From reading about the "SAP-1",  I think the microcode counter is the ring counter. Is that true in modern computers?
Answer: There are many dozens of different ways in which this is done.  And many computers have variable length instructions (multiple words or bytes, odd numbers of bytes, etc.), so the logic not only has to know when but how much to increment.  Some computer (superscalar, etc.) fetch more than one instruction at a time, and retire variable numbers of instructions each clock, so that also adds to the logic required.  In such cases, the ISA visible program counter may have little (or nothing?) to do with the actual physical instruction addresses being used fetch from various level(s) of the memory subsystem (due to speculation).
In the simplest form, part of the instruction informs a state machine; and, as the state machine sequences (one or more cycles), some of the state machine outputs freeze, increment, add an offset, load, or reset the program counter, as required by the particular state in the sequence.  Or a microcoded CPU implementation does the same.
How do primitive microcode instructions and/or the state machine know what to do next?  In some cases the next microcode address, ROM address, or state encoding is part of every microcode word and/or state machine output.  Sometimes multiple levels of the above (MC68000 had 2 levels).


Why is there low hepcidin levels in hemochromatosis?

Question: If hemochromatosis is iron overload and there is excess iron in the blood, why does the liver reduce hepcidin secretion (which increases the iron uptake) furthering the worsening of hemochromatosis?
Answer: From what I remember it all depends on which type of hemochromatosis we are talking about. There are several types depending on the cause and some of those like the hemojuvelin gene mutation-related have low levels of hepcidin as the CAUSE of the hemochromatosis (since like you mentioned, seeing it as a consequence wouldn't make much sense)
The first 4 pages of this paper should clear things up a little bit https://www.aasld.org/sites/default/files/guideline_documents/Hemochromatosis2011.pdf


Why does SQL Server add a row null bitmask even if the table has no nullable columns?

Question: Sql server adds a null bitmask to each row to store NULL values for nullable columns, but why does this bitmask exists even if my table has no nullable columns?
Answer: I believe it does this so that you can make columns nullable or add nullable columns as a metadata-only operation. SQL Server can do this even on the biggest tables instantly, just like it can (often) add, rename or delete columns with a simple metadata change.
I would have implemented this differently. I would have added a field to the page header that stores the current physical schema version that page is using. When the logical schema of the table changes a new physical schema version is created. All new pages use the new format. All modifications to pages with the old format cause a conversion to the new format first.
But SQL Server does not do that. It keeps per-row information that allows for instant schema changes. (It also stores the number of columns per row so that you can easily add columns.)
Comment: The table structure metadata are not stored in the data page so it should already be as you say. The main point of the row null bitmask is to store whether a column is null or not, this way it is easier/faster to retrieve the information.
Comment: @marcob maybe I misunderstood the question? I thought your question is "why does the bitmap exist even with no nullable columns?". Answer: because it is needed for metadata-only operations (might be usedi n the future). Anything unclear in the answer?
Comment: @urs Sorry I hadn't been clear, I understand what you are saying, but it doesn't feel right to me "bloating" row data storage to make 1 metadata operation faster. Having faster switch from non-nullable to nullable in my mind should be a nice side effect of a deeper reason. Meantime I found this article: http://www.sqlskills.com/blogs/paul/inside-the-storage-engine-anatomy-of-a-record/. SQL Server 2000 was storing bits only for nullable columns. They changed it to all columns, as Paul Randal states it is "simpler", I assume referring to the query execution.
Comment: As I said, I would have done it differently, allowing for much more efficient row storage (also the number of columns would not be needed per row, just per page). On the other hand their implementation avoids reformatting the whole page in case of a single-row update. Also avoids page splits.; Meta-data operations are very important once you get to 100GB tables, let me tell you! Very important enterprise feature.


Safely alter the plist on Calendar.app

Question: I want to add <key>LSUIElement</key> <true/> to the plist of Calendar.app like I would other apps because I don't want it in the dock or my task bar. This being a super-special Apple app, I need special permission. Could anyone tell me how to safely do this?
Answer: To safely alter the file just make a copy or backup of the file and then work with the original:

To modify the file log-in as a sudoer (usually an admin account) and open Terminal.
Enter the following to backup the file:
sudo cp /Applications/Calendar/Contents/Info.plist /Applications/Calendar/Contents/Info.plist.backup

you have to enter your password then.
Open nano to modify the plist content:
sudo nano /Applications/Calendar/Contents/Info.plist

now add
<key>LSUIElement</key>
<true/>

after the line containing <dict> (usually the 5th line).
Hit ctrlo to write the changes to file. Then hit Hit ctrlx to quit nano.
Open Calendar and check if it works. (It doesn't work, Calendar crashes immediately)
to revert the changes enter:
sudo rm /Applications/Calendar/Contents/Info.plist
sudo mv /Applications/Calendar/Contents/Info.plist.backup /Applications/Calendar/Contents/Info.plist

to remove the modified file and rename the backup file.
Enter exit and quit Terminal
Change the icon of Calendar to a more pleasurable one.
Answer: I would just make a copy of the original .plist on your desktop for example. Then copy it a second time, make your changes in this second copy and then drag and drop the edited .plist back to where it came from.
Try out Calendar and see if all is well, if not you can always drag the original copy on the desktop back to where it should be.

Safely alter the plist on Calendar.app


How do transactions fit into mining?

Question: One question about the inner working of the mining process:
I know there isn't such a thing as a block 30% or 99% mined, or a mine is blocked or it isn't, I get it. The thing is: how do the transactions that belong to a block (that dole out transaction fees) get incorporated into the block after it has been found. Are these transactions being processed along with the mining and that's what the mining process is all about?
Answer: The transactions are already there when you are mining. You are hashing the block header which contains a merkle tree root that connects the list of transactions and block header together.
After you hash a valid block header you can't add any transactions as it would change the merkle root and the hash would not be below the current target anymore, so the block becomes invalid. This is also the reason why you can't mine in a pool and take the coins yourself if you find a valid block. That would require changing the generation transaction, which changes the merkle root, and the block is then invalid.
Mining is both about generating new coins (they must come from somewhere) and processing transactions (we need a ledger that everyone can agree is the one true ledger).
Comment: so each share is a "branch" of this merkle tree that is always growing and joining the block header until the time someone hashes a valid block and then the process starts again with another Merkle tree?
Comment: In pooled mining a share is a block which hash is below the target the server gave you. If a block is found/created then you start work on a new block where just about everything is different, and that includes the merkle tree.

How do transactions fit into mining?


Why does the power remain constant during the stepping up and stepping down of current in transformers?

Question: I understand quite a bit of transformers, their structure and other concepts and formulas related to mutual induction. However I'm not able to explain why the electrical power has to be constant during stepping up and down of voltage. This will also help me explain why it is beneficial to transport current at high voltages. Please try to mathematically explain to me why power has to be constant. Or put in other words , How can you prove Current is inversely proportional to voltage where Ohms law states otherwise.
Answer: What do you mean by "during stepping up and down"? "Stepping up/down" isn't a transient state in the operation of a transformer. A step-up transformer continuously produces a voltage that is higher than the input voltage: it is always stepping up voltage as long as the transformer is in operation.
If the input and output powers were different, how would you account for the power difference? Where would the power difference go/come from?
An ideal transformer is an idealized pair of inductors that are perfectly coupled, have infinite inductances and no losses. Under these conditions, it follows directly from the governing terminal (I-V) relations of the mutual inductors that the input power is equal to the output power.
In real transformers, the output power is less than the input power, because of a number of loss mechanisms:

Losses in winding series resistances
Hysteresis (magnetization) losses in the transformer core
Eddy current losses in the transformer core

Update:
The equations for perfectly coupled inductors are:
$$v_1 = L_1\dot i_1+\sqrt{L_1L_2}\dot i_2$$
$$v_2 = \sqrt{L_1L_2}\dot i_1 + L_2\dot i_2.$$
It follows immediately that $v_2 = \sqrt{\frac{L_2}{L_1}}v_1$. Rewriting the first equation,
$$\dot i_2 = -\sqrt{\frac{L_1}{L_2}}\dot i_1 + \frac{1}{\sqrt{L_1L_2}}v_1$$
Now with the assumption of very large inductances, the second term is negligible, and
$$\dot i_2 = -\sqrt{\frac{L_1}{L_2}}\dot i_1.$$
When the transformer is "off", $i_1=i_2=0$, so the integration constant upon integrating this equation is zero:
$$i_2 = -\sqrt{\frac{L_1}{L_2}} i_1$$
$$v_1i_1+v_2i_2=0.$$
Comment: I know that I'll have to do work to change power but why is that so.? Please try to mathematically explain to me why power has to be constant. Or put in other words , How can you prove Current is inversely proportional to voltage where Ohms law states otherwise.
Comment: See the update. Ohm's law applies to resistors, not inductors.
Answer:
However I'm not able to explain why the electrical power has to be
constant during stepping up and down of voltage.

For an ideal (lossless) transformer energy must be conserved, i.e., power into the primary = power out of the secondary, or P=VI= constant. A transformer doesn't generate electrical energy.

Or put in other words , How can you prove Current is
inversely proportional to voltage where Ohms law states otherwise.

There is no conflict with Ohms law. Ohm's law provides the relationship between voltage, current and resistance.
$$P=VI$$
For a resistor
$$P=I^{2}R$$
Therefore, for a resistor
$$VI=I^{2}R$$
which returns Ohm's law
$$V=IR$$
Hope this helps.
Comment: Precise. Law of conservation of energy was the word I was looking for And I was too silly not to have thought of power as energy/time.  BTW, I know the derivation of the equation of E. power= V . I. I was just confused that when power is constant and voltage is changing, current changes inversely to the voltage which I thought was a contradiction to Ohms law (but again a transformer's inductor is not a Ohmic conductor.
Answer: P=E/t .if t is 1 second ( unit time) then p =e (energy) . in a transformer what happens is through a moving voltage, a moving current is passed through the wire so that there is a magnetic field created( biot-savart law{B=miu d (Ix )/4π r^2 ) which results a current (to be precise )due to a back EMF( according to Faraday and lenz law in electromagnetic induction) is created in the other given wire.
This is how the other wire also generates current(for further information study electromagnetism deeper).
if we ignore all losses of energy in a transformer (not realistic though),then the P is constant due to energy conservation law. But in reality due to Eddy currents joule heating and other things the converted electric energy in the secondary coil is lesser than in the primary coil. Hoping you got the answer for why p is constant.
W=VQ. (Q is the  charge that flows through V voltage difference in a conducter)
I=Q/t
So, W = VIt
W/t =P
P=VI
Therefore when p is constant v is inversely proportional to I. ..hope you understand how the equation came into existence which thereby explains this..
I am merely a student learning physics  AND still learning, so my answer rather precise to say opinion might want improvement or to be corrected but through pleasure I made the answer..hope it helped though..(also new to the app so might make mistakes while using it.. please correct me if any)


Book cataloguing from commandline

Question: I have many books both digital and physical, I want to catalogue them and tag them. I also need to search books based on tags or titles. Suggest ideal cli application to achieve this.
OS: Linux or Windows
Java/Python based apps are welcome.
Free or Moderate price software.
Comment: Can't do that without knowing what OS it should run on, if there's a price limit, if Java/Python based solutions are acceptable, what search criteria must be supported … and what you feel "ideal".
Comment: I have edited my answer based on your comment @Izzy
Comment: Thanks! Now it just lacks the search criteria it must support :) Just tags and titles – no authors, release date or anything else? Especially, no contents?
Comment: Hm, looks my favorite candidate might match that: Calibre has [search support](https://manual.calibre-ebook.com/generated/en/calibredb.html#search). It comes with a GUI as well (which might be easier for cataloging). But you can [add books](https://manual.calibre-ebook.com/generated/en/calibredb.html#add) from cli as well. Would that fit you?
Answer: The simplest approach to this is to write a text file with one line per book. You can then use grep to search for books from the command line.

Book cataloguing from commandline


How to make Looney-Tune style eyelids

Question: I'm kinda stuck. I have this character and I'm almost done modeling him, but I want him to have eyelids/eyebrows like Daffy Duck or Bugs Bunny. I tried Making an M-shaped arch out of a cube but it looked ugly, i tried duplicating the eyes, cutting them in half, and positioning them to where I can use shape keys to make them come down over the eye, but I lost confidence in that idea so I quit trying. I even tried using sculpting tools but I never have good luck with those. If anybody knows how to achieve this look and make them come down in a blinking fashion that'd be great
Comment: could you please show your attempts and maybe share your file? Also, do you want the eyebrows to be part of the head mesh?
Answer: The easiest is probably to create some separate meshes for the eyebrows and the eyelids, something like that:

A test of rigging for the eyelid:
Comment: That's really smart! I'm gonna try that

How to make Looney-Tune style eyelids


Postfix to Exchange Migrate Mailboxes

Question: Has anyone migrated from postfix to Exchange and moved saved mails forward? I have been asked to move about 150 mailboxes, and I would rather avoid going down the Outlook/PST route if possible.
Answer: Am sure on the postfix system you are running some sort of imap server, you can use imapsync to migrate the mail across to the exchange server while retaining the message flags.
Answer: What version of Exchange? If it is small business server, you could use the POP3 connector to pull mail from the mailboxes. (Postfix by itself doesn't host mailboxes, you must be using something else alongside postfix to do this).
Obviously, I don't know your set up, but I'd recommend keeping postfix, as it integrates quite nicely with Exchange/Active Directory. Our company uses this set up, as postfix performs our virus and spam filtering (postfix, spamassassin, clamav, amavis), plus it means I don't have to expose port 25 of my exchange server to the world (which makes me very nervous!).
Edit: Just saw you have 150 mailboxes, so you won't be running SBS. An alternative would be to use fetchmail to do the job.
Comment: Problem is that customer insists on going to Exchange, and ditching postfix. It'll be latest version (it's a school). Just don't fancy bulk pulling mail via outlook, one box at a time.
You would *think* that with postfix being so popular, and MS wanting to steal their market share, that MS would write a mailbox puller.
Comment: postfix is set up as virtual mailboxes in /var/mail/vmail/user@domain

Postfix to Exchange Migrate Mailboxes


What is the right permission to allow users to kick other users

Question: I want that our content managers can kick other users which are logged in into sitecore. When I call the site with my admin account I see the Users that are logged in and I can kick them. But the normal content managers is not seeing any users. Is there a specific role I can assign to them that they can kick other users or is this a admin feature only?
Comment: SPE comes with an Elevated Unlock feature. Just add the users to a specific role and they will see the option.
Answer: From Sitecore code comments:

When a user logs in, Sitecore checks if the maximum number of users has been reached (as specified in the license). If so, the logout user web page is shown allowing the user to logout a existing session.

There is a flag in Sitecore settings called AllowLogoutOfAllUsers which is set to false by default.
If this flag is set to false users can only kick their own sessions from other browsers. And administrator can kick everyone.
If this flag is set to true, users can kick everyone else.

<setting name="AllowLogoutOfAllUsers" value="false"/>


What's the significance of repeating this scene in Nobody (2021)?

Question: This below scene repeated so many times at the beginning of the movie:

What's the significance of repeating this scene in Nobody (2021)?
Answer: It's fairly standard movie shorthand for

"This is my boring life. I do the same things every day, every week."

…until…
It tells you a lot about his life in a quick shorthand way.
He has a dull job as something to do with figures at an industrial factory. He has scheduling issues - he can't remember to take out the garbage in time. His wife and son really don't have much time for him. He exercises regularly.
That's quite a lot of personal life that they manage to tell us in about one minute.
It also, presumably quite intentionally, tells you nothing about his past or any hint as to what the opening pre-credit sequence has to do with it.
Comment: @BCdotWEB - tbh, I just flicked quickly through the opening 5 minutes to make sure I was on the right track, but at the same time realised I really do have to watch it all again properly sometime soon, so didn't go any further. I often have a memory like a … ermm… metal thingy… holes… so I like to re-watch.
Comment: And IIRC at a certain point these scenes change subtly and then drastically.
Answer: It not only says that hutch has a boring life, but foreshadows several specific points
Tetsujin certainly get the gist of the point of the scene: Hutch's life is full of routine and somewhat boring.
But some specific points are worth noting. Hutch takes the bus to work using a metrocard. This becomes significant later as it is the card that allows the Russians to work out who he is (hes loses it in the bus fight and one of the Russians picks it up).
While standing or exercising at the bus stop, we see an advert for his wife's real estate business, emphasising his apparent relative lack of success in his work (arguably she is successful enough to have a prominent public profile in a successful business).
We also see him doing ad-hoc exercise (eg doing pull ups at the bus stop) which emphasises both that he is fit, but also that he is keeping fit without a serious effort to go to a gym or to do so in public.
He is also being nagged by his wife over annoying trivialities like not putting out the bins on time. This clearly annoys her and shows that she has, to some extent, not a huge amount of respect for him.
We also see a co-worker who regularly arrives at the factory car park and is slowed down by having to avoid him walking through the car park. Possibly showing that he isn't respected by his co-workers. Why is some factory functionary driving a big SUV when he has to walk? (BTW this co worker is the one shown reading the sign later saying the factory is closed and under new management).
So, yes, this is a very compact way to show his boring life, the lack of respect he gets from his family and his colleagues. He is "nobody". But also to foreshadow some things that will appear and be significant later.


Composer module doesn't contain a .info file

Question:
So I am quite new to Drupal and I was hoping someone experienced could tell me what I am doing wrong.

Essentially, I have Drupal 7.5 linked to my website, but I am having problems installing the Composer module using the control panel.

Whenever I attempt to add the module by either URL or a local download, Drupal claims that it doesn't include a .info file. Which, from what I can tell after unpacking it and inspecting its contents, is true.

So, I was wondering if the lack of a .info file is a problem on my end (likely) or just a case of the Composer devs forgetting to include it (unlikely).

Hopefully someone will be able to help out.
Answer: The project you linked to is a Drush extension, not a module, and only compatible with Drupal 8.
So it makes sense that you can't install it as a module into a Drupal 7 site ;)
Answer: As the project page says, that is not a module, but a Drush extension.

Since this is Drush extension that works across all versions of Drush, it doesn't need a different release for each different Drupal version. Hence this just being an 8.x project.

In fact, it does miss the .info (or .info.yml) file necessary to Drupal to recognize it as module, but it also misses a .module file.
There are module that are also Drush extensions, but this is not the case. It is hosted as module on drupal.org simply for the fact drupal.org doesn't have Drush extension as project type, so you need to necessarly select module if you want to host a Drush extension on drupal.org.


WFI instruction slowing down SYStick interrupt

Question: I've configured my Infineon relax kit for max frequency(120 MHz). I've set my SYSTick for a periodic interrupt of 10 ms. For power saving, I use a WFI assembler instruction whenever my processor is idle. WFI (wait for interrupt) should put the processor in low power mode until an interrupt occurs. So my processor should wake up after every 10 ms. But somehow, this WFI instruction slowed down my interrupt frequency to almost 3 times and it wakes up on every third interrupt.
What can be possible reason for WFI not waking up on every interrupt?
Comment: Cortex M4F need 6 cycles to get back up from normal WFI, shouldn't be a problem if the clocks stay the same (which I try to find out but the user manual is horrible). Can you output the clock used for systick and probe what happens if you go to WFI?
Comment: Does the datasheet say anything about how long it takes to wake up from low power mode? Does it also mention the interrupt latency and any delay in getting to max frequency? Can you provide a link to the datasheet? Which clock runs during low power mode?
Comment: How do you know that it only wakes up every third interrupt?  Is it possible that your MCU goes into some deeper sleep mode, which reduces the core frequency?
Comment: Link to the datasheet:
http://www.keil.com/dd/docs/datashts/infineon/xmc4500/xmc4500_um.pdf

Datasheet does not say anything about interrupt latency. I've enabled system clock(CCU) in SleepCR register to counter any effects of clock gating but to no avail. @Roger Rowland
Comment: @corecode
I have a variable that increments on every systick interrupt. Without WFI, it increments to a 1000 in 10 seconds, but with WFI, it increments to only 330. So this means that my interrupt's been handled on every third call. Or alternatively, my effective frequency has reduced to 3 times.
My MCU goes in sleep mode(not deep sleep) by default.
Comment: @Arsenal Actually I cannot output the clock. There are obviously more than 6 cycles in 10 ms when you're running on 120MHz. Can WFI possibly gate the system clock too which is producing interrupts on SYSTick?
Answer: I'm not familiar with these devices, but in the user manual it is mentioned that:

The Sleep state of the system corresponds to the Sleep state of the
  CPU. The state is entered via WFI or WFE instruction of the CPU. In
  this state the clock to the CPU is stopped. The source of the system
  clock may be altered. Peripherals clocks are gated according to the
  SLEEPCR register.

Taking a look at the SLEEPCR register description shows:
<code>Field  Bits Type Description
SYSSEL 0    rwh  System Clock Selection Value
                 0 -> f OFI clock, 1 -> f PLL clock
</code>
as the reset value of said register is 0, it defaults to the \$f_{OFI}\$ clock. Which runs at 36.5 MHz uncalibrated or 24 MHz calibrated. It has a rather huge accuracy range if uncalibrated (see the datasheet) of at least +-15%, together with the fact that you will get some systicks with 120 MHz in again during your execution it might well turn out to be roughly 40MHz in average.
Solution (hopefully): Set the SYSSEL bit to 1.
Comment: Thanks for the tip. It didn't occur to me. I was setting CCU bit in SLEEPCR register.


How to judge http proxy

Question: everyone! I have a list of http proxy servers, some of then may stop running http proxy process. Of course, there are two cases: the port is not listened any more; and the port may be listened for another service. I have to write a program to judge if a given server is still running http proxy. How can I do that? If I can connect to a port, how can I judge whether it provides http proxy service or not? Is there protocol relative thing I can employ?
Answer: Most proxy servers use port numbers like 8080, which are not assigned to any other services. In those cases, if you can connect, it is usually safe to assume it is still a proxy.
In the case that the proxy server uses a standard port like 80, you may want to make a single request to a known host on the internet. That way you can know that it is still forwarding requests to the outside.
If you're trying to see what services are available on any given server or port, something like nmap may be useful. nmap can usually identify the type of service running on any given port.
IMPORTANT: Running a full port scan on a remote host is (almost always) illegal unless you have written permission from the owner of that host. Sometimes it is illegal even if you have written permission.
Scanning one targeted port using nmap is probably okay.

How to judge http proxy


GKE helth check fail

Question: I have cluster on GKE with expose of loadbalancer type service.
to add SSL, I create service NODE PORT and add ingress to it.
I have done this many time and it works. but in this case, ingress show the GCP load balancer as unhealthy.
If I edit the GCP load balancer, to use the health check created by the GKE LoadBalacner service, it then start to work and I can browser the ingress service. But as soon as I switch it back to the health check created by the Ingress service it will start failing again. I thougt maybe it is firewall issue so I added allow all protocols for the Internet which did not help.
How do I get the ingress to work?
Comment: I came across a post on [Stackoverflow thread](https://stackoverflow.com/questions/58707357/google-kubernetes-ingress-health-check-always-failing) that may be of help.
Comment: If you were formerly able to add an ingress to a nodeport service, what have you done differently this time. Is it that the configuration has just suddenly stopped working? Can you be more specific with the issue by providing error messages?
Answer: I have managed to resolve this issue:
The legacy health check that was created on ingress did not care about the response from health check as long as there is a response.
The new health check is making GET request to root path and want to be responded with 2xx status. but my site is replying with 302 for login if you do not have a cookie which renders the health check as unhealthy.
Adding a probe to the workload container spec with correct path for health check and containerport (must) will generate the correct health check.
Notice that if you add them to existing pods, you need to recreate the ingress as it will not update.

GKE helth check fail


Why are squirrels pruning new bayberries?

Question: Our crew has witness squirrels cutting the tops off recently planted bayberries on a number of occasions. The animals don't seem to do anything with the bark or cut tops. Why are they doing this and what could be done to prevent it (short of culling the scurry)?
Comment: Squirrels are funny little creatures. I would suggest a pretty direct method. Go buy some chicken wire and build an enclosure for the plant.
Comment: Unfortunately there are hundreds of them. The squirrels have hit maybe 10% so far.
Comment: Ah, I see okay well then I would suggest you go buy yourself some squirrel repellent.
Answer: In wintertime in Ontario squirrels will nip the ends of maple twigs; goal is to drink the sap which is sugary at that time of year. If the nipping makes the shoots bleed sweetly then this might be one reason. You would see the nipped ends but if all the squirrels do is drink then this will not be so evident.
If this is the reason, then maybe offer them an alternative equally attractive drink that is easier to get at and they will quit nipping ends, which is more work.


Is there a name for words like "hearsay"

Question: This is obviously a combination word, more so than a contraction, of two verbs, and the definition is almost on point for when you put the definitions of the component  verbs together.  Almost.  One could almost intuit the definition.  Another word like this is skiptrace. So is there a word for this type of word, and are there more examples?
Comment: Do you mean a *compound*?
Comment: @TaliesinMerlin Yes, but a specialized compound made from verbs.  Not like mothball or cabdriver.
Answer: These could be called compound single-word verbs, to differentiate from other compound words such as moonlight (though, admittedly, to moonlight is a verb, albeit a noun-noun compound).
Example of verb-verb compound verbs: stirfry.
In linguistics, there's a technical term "serial verb constructions" (SVC). This paper aims to show that verb-verb compounds in English (and Jordanian Arabic) are examples of SVC. It gives other examples: kickstart, crash-land, sleep-walk.
Comment: @KDog: you're right - I ignored the noun-ness of 'hearsay' etc. and only paid attention the reference to the participating verbs and away I went. Tunnel vision, I'm afraid.
Comment: Hearsay is a noun. Skiptrace is a noun.  I think you mean verb compounds.  The example is spot on.
Comment: I would think *moonlight* is a noun-noun compound that eventually created a verb. *Moonlight* the noun is Middle English; *to moonlight* is 19th century. (I agree the examples are really useful!)


Ubuntu Glossary - Dictionary of Commonly-Used Terms

Question: I see lots of words like "Super", "LTS", "Launcher" and others, and I'd like to know what they all mean.
What common jargon is there - and what does it mean?
Answer: Please edit this CW post to add new info that hasn't been covered. Try to keep it in sensible categories.
All images are clickable to make them larger.

This list was divided in three cateogies:

UI elements and Interaction
Technical
General Jargon

1. UI elements and Interaction
Super
The Super Key is the equivalent to the Windows key on a keyboard, between Ctrl and Alt. We call it the Super Key because on a Mac it's the Command key, on Linux it varies and on Windows it is the Windows key:

Launcher
This is the "Dock" at the side of the screen where you access your applications. You can add and remove programs from it, and it will also show mounted USB pen drives and CDs / DVDs.
See questions tagged launcher
Dash / Show applications
The way to search Ubuntu for applications and documents. This also has the full list of installed applications - whereas the dock has a user defined subset of these.

On Windows, this is the start menu, and on OSX this is Spotlight:

 betanews and  MacStories
Panel / Notification Bar
This is the bar in the top of your screen.

Home Directory
The place with all your files. It will contain Desktop, Documents, Downloads, Music, Pictures, Public, Templates and Videos. It is found in /home/username.
Ubuntu Software
This is the place to install Applications.

It acts as a graphical way to install programs from a safe place. It is like the App Store on OSX or the Store on Windows 8 +
Unity / Desktop Environment / Window Manager
The default Window Manager in (Vanilla) Ubuntu. This is what you see when you start up your computer and login:

This is GNOME Shell. Other Desktop Environments include Unity (17.04 and below), XFCE and KDE. There are more.

2. Technical
Dual Boot
Installing both Ubuntu and another Operating system (or version of Ubuntu) on the same computer. This can be achieved by installing on separate hard drives, or by partitioning one hard drive.
When installing Ubuntu, the current operating systems should be detected, and it will offer to install Ubuntu alongside it:

Image to installation types
Flavour / Distribution / Distro
Ubuntu is open source, which means anyone can take the code and change it or modify it and give it to other people. Some distributions include Ubuntu GNOME, Kubuntu, Xubuntu, Lubuntu, Ubuntu MATE and Ubuntu Touch for mobile. The whole list can be found here.
Architecture
The processor type - 32 or 64 bit. This determines the download - either i386 or amd64.
64 bit processors can run 32 bit operating systems and programs, but not the other way round. Most modern computers are 64 bit, hence this is the recommended type to download.
Terminal / Command Line / TTY** and **Commands
The terminal is the graphical interface to the command line, with which you can execute commands.

This could be launching an application like firefox, removing a file with the rm command or searching through a file with cat and grep or sed.
TTY is also a command line - just a non graphical one. Note that you have to login to use this one. In fact, you do with the Terminal - you did it when you signed into your account.

Bash and Shell
Bash is the default shell in many Linux distributions. It stands for Bourne-Again SHell, and is Bourne shell with many additions. Shell is a command interpreter that executes commands.
BIOS
This is Ubuntu independent - the BIOS is built into every computer for setting up the basics - like choosing which hard drive to use and power management.
Repository
A repository is a software archive with programs that support Ubuntu in them. These are split into Main, Restricted, Universe and Multiverse. These simply contain different classes of programs - for example Multiverse is paid software, and Main is supported by Canonical.
See the Ubuntu Wiki for more information
3. General Jargon
Release(s)
Releases, or versions are each new iteration of Ubuntu. Currently, a new version is released every 6 months, in April and October. The version number (for example 14.04) tells you when it was released:

They also have a codename - for example 14.04 is Trusty Tahr. 14.10 was Utopic Unicorn - they go down the alphabet.
LTS - Long Term Support** also **LTS Release
LTS stands for Long Term Support. ¼ of Ubuntu releases are LTS releases - once every 2 years. The cycle is a follows:
16.04 - April 2016, LTS
16.10 - October 2016
17.04 - April 2017
17.10 - October 2017
18.04 - April 2018, LTS
18.10 - October 2018
19.04 - April 2019
19.10 - October 2019
20.04 - April 2020, LTS

The version numbers are simply examples. LTS releases are supported for 5 years from the release date (meaning you can upgrade to the next LTS release, or even the one after that). A non LTS release is supported for 9 months, so you have time to get the next release before it is EoL (see below).
Supported means it gets security and other updates from canonical. It is highly recommended that you use a supported release.
EoL - End of Life
When a release is no longer supported, it becomes End of Life. See above for what changes.
Open source
Ubuntu is open source. This means the source code of it is available for modification or enhancement by anyone.
Package Manager
The package manager (DPKG in Ubuntu) is a built-in utility designed to streamline app management. You can browse, install, and remove software with this.
The software centre uses this - it's a graphical interface for dpkg.
Root and sudo
Root is the equivalent of Administrator in Windows. It has the power to do anything - like erase the hard drive, change config files and adjust the time.
In Ubuntu, there is no "root" user. Instead, sudo is used. Any command with "sudo" before it (for example sudo nano) will be executed as root.
Users in the "sudoers" list can execute sudo commands.
The root home directory is simply /root - it is not found in /home/root.

Any images not attributed are created by a contributor to this post.
Comment: Please edit this CW post to add new info that hasn't been covered. Try to keep it in sensible categories.
Answer: Much of the jargon that you hear related to Ubuntu may as well be shared with other Linux distros, such as launcher, shell, terminal, release - all these can be found in other distros as well.
What I would suggest you do is pick up a book related to Ubuntu, such as Ubuntu Unleashed, The Official Ubuntu book, or Ubuntu Linux Toolbox, and read through them; as you read you will pick up all the necessary vocabulary.
Coming back to general distro information, I would suggest learning what makes Ubuntu different from other distros - such as package-managers ( Ubuntu uses apt and dpkg, while Fedora and RHEL used to have rpm and yum , Arch uses pacman), default init system ( prior to 15.04 release Ubuntu used upstart, but now is switching to systemd ), desktop environment and desktop manager ( one is the actual desktop, such as Unity for Ubuntu, but the other is login screen such as lightdm), client vs server.
A big portion of using any Linux system is terminal , which is similar to Windows' command line ( cmd.exe ), but much more powerful and flexible. Use UNIX Shells by Example by Ellie Quigley - this book helped me a great deal in learning command line. You will pick up vocabulary such as variables, shell , terminal emulator, regex , and will learn about many useful tools such as find, xargs , for and while loops, awk, sed,.


What does eye power -6 means and how close to blindness is it?

Question: One of my friends went to an eye specialist for checkup and the doctor told him that his eye power changed from -6 from -4.5. He is really very upset and doesn't want to discuss anything on this. I can understand that -6 means the vision is in very poor state but don't have any idea how much worse it is.

Could someone explain me how what eye power -6 means in respect to closeness of blindness?
What can be the minimum negative eye power and maximum positive eye power of an eye?
Comment: I'm voting to close because I think the question _as posed_ is unclear and too broad to be answered. For starters I think you need to define what you consider to be blindness. The numbers you mention appear to be the myopia correction values used by optometrists when writing lens prescriptions, but does severe myopia constitute blindness?
Comment: I think you don't understand.  -6 doesn't mean your eyes are weak, it means they are focusing too close.  It's a measure of the corrective lenses needed to give normal vision.  My wife has been extremely nearsighted her whole life, -9 or worse in the decades I've known her.  If anything her vision has improved slightly over that time--it's an annoyance, not a sign of impending blindness.
Comment: "He is really very upset and he even doesn't want to discuss anything on this." Yes, and this is why people are entitled to privacy of their medical information. Prying is rude. Asking around (including the internet) instead of the person directly doesn't make it less so. Voting to close.
Answer: Your units of measure are likely "diopters."  If someone needs glasses for reading (because the person is far sighted), then they would be given an prescription with a +[digit], and note that each eye could be different (and usually is, at least slightly). An example might be:
left eye: +1.5
right eye: +0.75

If he has a negative number of diopters in his prescription, it just means he is instead near sighted, or myopic: he sees things up close probably pretty well (in the eye with a negative diopter). If both eyes are around -6 diopters (and assuming he doesn't have severe astigmatism on top of this strong near sightedness), he probably needs relatively strong lenses to see distances clearly, and can probably only read an average size font (such as 12-14 points) if it less than a foot (roughly) from his face.
See also: http://www.britannica.com/technology/diopter-optics
and "Amplitude of accommodation" on wikipedia
Answer: I am going to assume with - 6 you mean a measurement of - 6 Dioptre . If you are talking about the strength of the glasses he needs, the minus indicates that this eye is nearsighted, a positive value would indicate farsightedness. If that is a measurement of his eyesight, he is farsighted. A measurement of 0 indicates that the eye can adapt to both short and long distances without problems (though corrections may still be necessary, for example for astigmatism). Because of the definition of a Dioptre, there is no maximum/minimum number.

A dioptre (uk), or diopter (us), is a unit of measurement of the optical powerof a lens or curved mirror, which is equal to the reciprocal of the focal length measured inmetres (that is, 1/metres). It is thus a unit ofreciprocal length.

A measurement of -6 is certainly not nothing and will require corrective lenses. It is, however, far from being blind and can be corrected by wearing glasses or contact lenses. For nearsightedness, -6 is where high-degree myopia begins.
If you are talking about whether he could be considered legally blind , that is a definition that only applies to how much you can see with correction. Since myopia of -6 can be corrected well with glasses, there should be no risk of being defined as legally blind.


Failover and DNS propagation delays

Question: When a DBMS fails over after a failure, if it fails over to a server in a different and unrelated data center, then the IP address of the subdomain name of that database will need to be changed in that name's DNS server, and due to DNS propagation delays, it could be days before all the DNS servers of the world have the IP address for the new master, during which time some clients would still be trying to access to old master.  What can be done to deal with this, other than changing the client software to fetch the IP address of the master from somewhere, or is that the only option?  Thanks.
Comment: Is there a DBMS in particular you're thinking of? Different products handle this differently. For Example, SQL Server has solved this in a way that removes the dependency on DNS propagation.
Comment: I notice you generally discuss SQL Server here, so if your question is around SQL Server Availability Groups, I'd suggest making the question specific to that, as the answer may be different from MySQL. (Also, I can answer the specific case about SQL Server, but not the generic case about all RDBMSs.)
Comment: @AMtwo: I was thinking in terms of SQL Server, but I thought it was handled outside of the DBMS.  I'm interested for MySQL too (which is why I hadn't mentioned a particular DBMS), but if you can answer my question for SQL Server, that would be great.
Answer: In SQL Server, the default behavior with an Availability Group listener is to register ALL IPs in all subnets with DNS. While DNS has all the IPs attached to the listener's A Record, only the IP in the correct subnet for the current primary will be online. Other IPs will be in DNS for the network name, but will not actually be online/resolvable for any actual host.
With a default configuration, multi-subnet AGs require that the clients connecting to them include MultiSubnetFailover=true as a connection string attribute. This attribute tells the driver to expect DNS to provide multiple IP addresses for the Listener name, and to try all of them to find the correct IP to connect to for that network name. Clients that do not specify this attribute will get multiple IPs and not know how to handle them properly–most drivers will pick up one of the returned IPs at random (or maybe just seemingly random), and try to connect to that. This can result in random (or seemingly random) connection failures when it picks the wrong IP.
When failover happens, the DNS records do not change. Instead, the IP that is online & responding to requests will change. The former primary IP will go offline & stop responding, and a different IP will come online in a new subnet, and start handling traffic. This is why the client-side MultiSubnetFailover=true connection string attribute is necessary. The client's driver needs to know how to handle this.
You can turn off this behavior, so that DNS only registers a single IP address at a time, or even create two listeners so that one uses the default behavior and the other registers a single IP at a time. When using the single-IP listener, you do need to wait for the TTL to expire, and for the DNS updates to propagate before clients notice the failover & are able to reconnect. In this situation, you would want to set the TTL sufficiently low that the downtime is acceptable. Adjusting the TTL is ultimately the lever you can pull to prevent the DNS propagation from taking days.
Comment: THANK YOU!  I had no idea.  That was very helpful!

Failover and DNS propagation delays


which os x will be good for pentium 4 pc?

Question: I have an old pentium 4(2.67GHz) pc with 1760MB RAM, 80GB Hard-disk.
I was wondering if i can install something different than windows xp on that.
Comment: This isn't really an Apple question.  :-(  There are some other Stack Exchange sites that are for Linux.  I recommend re-posting your question there.  Good luck.
Comment: I'm voting to close this question as off-topic because as help says is off topic  "Installing or using Apple operating systems on non-Apple hardware (and most other explicitly unlicensed use of product)"
Answer: Apple's OS X is only able to run on Apple hardware. In small part because of driver limitations in the software due to Apple's limited hardware ecosystem that they need to support but largely it's due to the fact that Apple's licensing for OS X forbids running the OS on non-Apple hardware.
This topic has been well-covered on the site. For similar questions and answers please see:

Is there a way to evaluate OS X without purchasing Macintosh hardware?
Can I install Mac OS X Lion (10.7) on my Windows XP PC?
Is installing Mavericks on Hackintosh legal?

Question regarding how to install OS X on non-Apple hardware are off topic here as they violate the EULA.
In all seriousness, I suggest you look to a Linux variant like Ubuntu or Mint or Fedora if you'd like to experiment with an alternative to Windows on your machine.
Comment: You said "_Apple's OS X is only able to run on Apple hardware._" and while I do not condone running OS X/macOS on non-Apple branded hardware, nonetheless it can be run on non-Apple branded hardware, which makes your opening sentence erroneous.
Answer: None, as @IanC points out. Try running a Linux OS like CentOS or Ubuntu...
But if you feeling adventurous and start down the OSX86 (aka Hackintosh) route, be warned that you'll spend time tuning, tweaking and otherwise managing your install. If you're the type that enjoys that work then you're in for a ride. But if you just want your computer to work for you, stick with Windows or a Linux variant.
Answer: It's quite possible to run Mac OS X Mountain Lion without much of a lag, if you install an aftermarket dedicated GPU. This is because Mac OS X works way better with the Intel core processors because they have integrated GPU. So having an aftermarket dedicated graphics card will let you run Mac OS X. Also check if your motherboard is supported or not. Let me also remind you again that what you are about to do is illegal.


A recursive relation for the number of well formed nested parentheses of length $n$ and depth $\leq d$

Question: Consider a function $C(n, d)$ which counts the number of well formed, i.e, balanced, parenthetical 'words' of length $n$ and maximal nested depth $\leq d$.
That is, $(())$ has $n = 4, d = 2$. $()((())())$ has $n = 10, d = 3$ and so on.
$C(n, d)$ counts all well formed strings above (i.e, $($ and $)$ are balanced), of length exactly $n$ and depth at most $d$ (that is, smaller depths are allowed).
There should be a recursive expression for $C(n, d)$.
The base cases are easy enough:
$C(n, d) = 0$ if $n$ is odd regardless.
$C(n, d) = 0$ if $d = 0$ but $n> 0$
$C(n, d) = 1$ if $d = n= 0$ (the empty string)
Now for the recursive step.
I've been thinking about this but there are a lot of overlap which makes things difficult.
For instance, I first guessed $\sum_{i}\sum_j C(n- i, d-j)C(i, j)$ That is, you mixing all strings of length $i$ with strings of length $n-i$ should give you strings of length $n$. I think the depth in general will remain $\leq d$ without problems. But the problem with this approach is that I'm pretty sure there will be plenty of double/extra counting of the same strings more than once.
I have a few other candidates but again I think they largely double count in general.
I was also thinking if I could express it solely in terms of $C(n-2, d-1)$ as ${n-2 \choose 2}C(n-2, d-2)$ (placing $(, )$ at any positions in an $n-2$ string) but then this misses out on potential $d$ depth strings. But doing ${n-2 \choose 2}C(n-2, d)$ might inculcate depth of $d$.
Comment: Cross-posted: https://cs.stackexchange.com/q/151111/755, https://stackoverflow.com/q/72064859/781723.  Please [do not post the same question on multiple sites](https://meta.stackexchange.com/q/64068).
Answer: Suppose that $w$ is a well-formed parenthetical word of depth at most $d$. Then either $w = \epsilon$, or $d > 0$ and $w = (x)y$, where $x$ is a parenthetical word of depth at most $d-1$, and $y$ is a parenthetical word of depth at most $d$; furthermore, the decomposition is unique.


obtaining coordinates of a shapefile

Question: I created a voronoi polygon using the coordinates shapefile of over 3,000 enumeration areas. How do I get the boundary coordinates of each of the enumeration areas for mapping purposes?
Comment: Welcome to GIS SE, please expand more what you mean by "boundary coordinates", is this the bounding xy min/max or the xy vertex coordinates?
Comment: the boundary coordinates are meant to guide mappers so that they dont encroach into another enumeration area. so I need like the coordinates for the four corners of each of the polygons
Comment: Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our [faq].
Answer: Vector -> Geometry Tools -> Extract Nodes

then
Vector -> Geometry Tools -> Add Geometry Column

gives you for each corner node of your polgyons and then adds it's coordinates to your attribute table.
Comment: i have already done that but what i actually need is the coordinates for each of the polygons generated not for the points.
Comment: As I said, leave out the polygon centroid step, but the coordinates obtained are confusing as in you get one coordinate for every corner of your polygon. Oh, forgot a step, I am sorry... updated the post
Comment: i left out the polygon centroid step
Comment: I actually forgot a step, sorry for that. So, now the post is (hopefully) helpful.
Comment: ok, please i am waiting for the post.
Comment: It is there, simply modified ;-)
Answer: just use OGRINFO so simple.  ogrinfo -ro -so nameoffile.shp nameoffile
convert a folder of shapefiles into a GeoPackage
OGR2OGR -f "GPKG" name.gpkg folderofshp

obtaining coordinates of a shapefile


Is the resistive component of impedance the same as DC resistance for a given component?

Question: If I calculate the impedance of a component in an AC circuit as Z=V/I, will the resistance component of that impedance, ZcosΦ, be the same as the resistance when that same component is in a DC circuit with the same voltage, R=V/I?
Comment: No. One counter-example is skin effect in HF conductors. HF current flow is confined to the outer skin of the conductor (depth dependent on frequency) which will have a smaller area and thus higher resistance than the conductor as a whole.
Comment: Yes it is the same.
Comment: NB: High Frequency ... can be "low". See the bus bars distribution for very high currents. Skin depth : 9mm @50 Hz
Comment: No. Consider an impedance transformer L-network. It's AC resistance at working frequency is generally not the same as it is for DC.
Answer: In an ideal world where resistances do not depend on frequency, yes, but in the real world, no. The real part of an impedance at any non-zero frequency (the AC resistance) does not coincide with the DC resistance. The difference may be small, but it's there.
Considering a resistor composed of a resistive material supported by an insulating material, there are several effects that contribute to this frequency dependence:

Skin effect. In DC, the current is typically uniformly distributed across a conductor (under certain assumptions). In AC, the current crowds near the surface of the conductor, increasing the resistance.
Proximity effect. In AC, the current distribution in a portion of a wire is also modified by nearby portions of the same wire.
Dissipation in the stray capacitance toward the environment. The dielectric material that supports the resistance is dissipative, and this can increase the AC resistance at high frequency.
Temperature distribution. In DC and AC the temperature distribution across a device is not the same, and this changes the resistance.

For inductances, in addition to the above effects, there is also the dissipation in the core (if not air) that contributes to the equivalent AC resistance, and this dissipation is frequency dependent.
For capacitors, the frequency dependence of the real part of the impedance depends on the losses of the dielectric material and, to a lesser extent at high frequencies, on transmission line effects at the electrodes.
Answer:
will the resistance component of that impedance, ZcosΦ, be the same as
the resistance when that same component is in a DC circuit with the
same voltage, R=V/I?

No, probably not in anything other than near-ideal components. For instance, a near-ideal inductor will look like an impedance of R + XL where R is the series resistance or DC resistance. But, this near-ideal component does not suffer from eddy current losses or core saturation losses. When you factor those into the analysis you get a loss element due to those AC losses.
Also to consider is skin effect. Skin effect is sometimes called "AC resistance" and, for a given conductor, as frequency rises the electric currents start to hog the outer circumference of the wire. In other words, down the centre of a conductor (where inductance is greatest), currents prefer to travel in other parts. This reduces the usable cross sectional area of a conductor and thus, resistive losses at high frequencies increase.
You might also consider a capacitor that has an effective series resistance (ESR). You cannot measure it at DC therefore, your question doesn't apply but, as frequency rises, the capacitive reactance drops and you are left with a low value of ESR that is a loss but, you can't measure it at DC.
Answer: Not always. The real component of impedance just represents real, permanent power loss (not energy removed from the circuit and stored to be eventually released back into the circuit in the future). Resistance is not the only form of real power loss.
Losses due to eddy currents in the core of things like inductors and transformers, and motors are invisible when measured at DC since you need non zero frequencies to induce the Eddy currents to flow to produce the loss. So measuring "resistance" at DC gives you a lower reading than measuring "resistance" at different frequencies because you're actually measuring the real component of impedance rather than resistance specifically.
Similarly, capacitors don't pass DC except through leakage so "near infinite" resistance but have losses when conducting AC so have a real impedance component that is much lower than infinite.
Answer:
Is the resistive component of impedance the same as DC resistance for a given component?

In general NO, but YES for Conductors, e.g. Inductors always DC resistance in datasheets as DCR.
For Insulators, (i.e. ≡ dielectric) that are supposed to block DC, there is parallel leakage resistance that does pass current at max rated Vdc.

Some RF effects can raise R well above DC as currents travel closer to the surface.
The Effective Series Resistance, ESR is a result of the conductor-insulator interfaces.
Even air is a capacitor, but the electrodes could be soil, a tree, your skin, or a variable capacitor.

There are 3 fundamental fixed electrical passive components, R, L, and C, from which we can model the reality of each physical part.

simulate this circuit – Schematic created using CircuitLab
An RF Inductor always has a DCR, L, and C value that is reported by the Parallel Resonant Frequency (PRF) but more commonly as SRF for "Self Resonant Frequency" because the insulation between each turn causes the impedance at f for L and C to be equal and cancel.
The same is true for RF Caps with the SRF for parts when this is important, but at resonance, the impedances of L & C cancel leaving a notch at ESR.


What is this executable file named "Icon?" doing in my applications folder (and other folders)?

Question: Is this file a malware? Anyone know why these unix executables keep appearing in my folders? This is a fresh installation of macOS High Sierra.
Comment: Do you use the app DeClutter?  I seem to have Icon? in every folder from DeClutter.
Answer: No. It's not malware. These are often found which you create manual application icons by copying and pasting images from the Info menu.
Heres an Apple Script Application I made with a custom icon from Google.

Not sure why its there but its probably safe to delete and wont cause any harm if you don't.


Get components (path and filename) of POSIX filepath

Question: Given:
~/Desktop/Foo.scpt contains:
(POSIX path of (path to me)) as text

Which returns:

/Users/[username]/Desktop/Foo.scpt

How do I get path /users/[username]/Desktop/ and the file name Foo.scpt as individual pieces?
Answer: Just ask Finder he knows how to do it :)
tell application "Finder"
     set parentpath to POSIX path of (parent of (path to me) as string)
     set filename to name of (path to me)

     display dialog parentpath
     display dialog filename
 end tell

Answer: Another option is to use text item delimiters:
set text item delimiters to "/"
POSIX path of (path to me)
text item -1 of result -- "Untitled.scpt"

If the path can end with a slash, you can use a handler like this:
on basename(x)
    if x is "/" then return "/"
    if item -1 of x is "/" then set x to text 1 thru -2 of x
    set text item delimiters to "/"
    text item -1 of x
end basename

basename("/dir1/dir2/file.txt") -- "file.txt"
basename("/dir1/") -- "dir1"
basename("/dir1/dir2/") -- "dir2"
basename("/dir1/dir2") -- "dir2"
basename("/") -- "/"

Note that text item delimiters is a property of the AppleScript object (not local to the function), but as far as I know, you don't have to restore the text item delimiters property if you don't rely on it later in the script.
Answer: This should work:
-- This script returns the full path to the directory that this script is running in

-- get the full path to be split
set pathToMe to POSIX path of (path to me as text)

-- get the path to the directory
set script1 to "dirname '" & pathToMe & "'"
set dirPath to do shell script script1

-- get the file name
set script2 to "basename '" & pathToMe & "'"
set fileName to do shell script script2

-- display the results
display dialog "Directory Path: " & dirPath & return & return & "File Name: " & fileName

Answer: set path_ to (POSIX path of (path to me)) as text
set name_ to name of (info for path_)
set a_ to count path_
set b_ to count name_
set minus_ to a_ - b_
set path_name_ to text 1 thru (minus_) of path_

variable path_ is the path
variable name_ is the name


How to import and manage conflicts an excel file into room sqlite database?

Question: I want to import an excel file into my database designed with room library on android.
I can export the database using a library but for import i need to check items and handle conflicts but I don't know how.
Comment: Please provide enough code so others can better understand or reproduce the problem.
Answer: It would be nice to look on the following articles. Article1 and article2 focuses on using room to import csv using room.
If you can use a different library, this is also helpful.
I will advise to break this functionality into two tasks.

Extract data from CSV/Excel file
Put that data into the database

1 To extract data from CSV/Excel File, you can use the following code.
<code>    CSVReader csvReader = new CSVReader(new FileReader(Environment.getExternalStorageDirectory() + "/" + TableName));
String[] nextLine;
int count = 0;
StringBuilder columns = new StringBuilder();
StringBuilder value = new StringBuilder();

while ((nextLine = csvReader.readNext()) != null) {
      // nextLine[] is an array of values from the line
         for (int i = 0; i < nextLine.length - 1; i++) {
             if (count == 0) {
                 if (i == nextLine.length - 2)
                     columns.append(nextLine[i]);
                 else
                     columns.append(nextLine[i]).append(",");
             } else {
                 if (i == nextLine.length - 2)
                    value.append("'").append(nextLine[i]).append("'");
                 else
                    value.append("'").append(nextLine[i]).append("',");
             }
        }
</code>

To put the extracted data into the database you can use the following code.

Create a raw query function in your DAO.
<code>@RawQuery
Boolean insertDataRawFormat(SupportSQLiteQuery query);
</code>
Using that query put the data into the Database
<code>SimpleSQLiteQuery query = new SimpleSQLiteQuery("Insert INTO " + tableName + " (" + columns + ") " + "values(" + value + ")",
           new Object[]{});
    getDb().cashDrawerDao().insertDataRawFormat(query);
</code>


How to clean shop vac of oily residue?

Question: There was a heating oil leak in my basement, which I soaked up with spill absorber. It worked like a charm, but then I made the mistake of trying to clean up the mess with the shop vac. The oil-soaked spill absorber was too heavy and too slimy for the shop vac, so it just lined the inside of the hose and clogged everything up. Now I have to clean out all the hose and tube segments. My question: What is the best way to do so? I thought about just filling a big tub with water and dish detergent and soaking everything, but do I need something stronger?
Comment: You didn't use nearly enough spill absorber.  You're supposed to be able to sweep/shovel the stuff when it's done.
Comment: I could have. I chose not to, wrongly.
Answer: Start out by soaking the hoses in hot water and blue Dawn dish soap. It's the best for dissolving grease and I'm not affiliated with them in any way. Then you'll want to thread a heavy string or rope through the hose and wrap one end around a big rag and pull the other end so the rag gets pulled through the hose. You'll have to do this a few times to get rid of all the residue. If your rope is long enough, tie the rag in the middle of the rope and you can just pull it back and forth without re threading it through the hole each time. Replace the rag if it gets too oily.
Comment: Suggestion:  Getting the air out of the hose to soak it will be hard.  Instead fill the shop vac tub with hot water and dish soap, pour that into another container and vacuum it back into the shop vac.  Repeat several times, change to fresh mixture and do it a couple more times.  At that point decide if the string and rag trick is even necessary.
Answer: Jack's answer makes sense.  I have done something similar to clean vacuum hoses, and it works.  One additional suggestion would be to use a grease cutter product as a second stage after the dish soap.  They sell stuff like this at automotive and hardware stores.

How to clean shop vac of oily residue?