Should I do the repeat sign when there is a fine

Question: I stumbled upon this piece, Lágrima by Francisco Tárrega, and I would like to know if I should do the repetition sign when doing da capo al fine or just end the piece.
Answer: The repeat sign applies only to the first encounter with it. After the D.C., the piece ends at the Fine — no repeat.
Comment: In fact, even if there were a repeat in earlier measures, you would normally ignore it after a D.C.
Comment: and if the is a repeat with multiple endings, only use the last ending on the DC time through.
Comment: @DKNguyen no, I mean you go through all the various endings initially, but when you are on a DC run time you only use the last ending.
Comment: @DKNguyen - I suppose I should have said _use only_, rather than _only use_.
Comment: @ElementsinSpace Oh, so you just keep repeating the first ending only until the last run? So I guess you have to know in advance there is a DC somewhere?
Comment: @DKNguyen: if there is a Fine, there's a D.C. Al Fine or D.S. al Fine somewhere as well.
Comment: @ElementsinSpace Oh okay. You said *only* which makes it sound like you meant otherwise, as in "only use the last ending on DC and never on any other run".
Answer: You don't stop at the Fine when you first read it. If there is a Fine, there's a D.C. al Fine or D.S. al Fine somewhere.
IMHO, whether you repeat or not depends on where the Fine is written. In your case, you don't repeat, because the Fine is before the repetition.
In the following case, the Fine is after the repetition, so you repeat:
Comment: Isn't the convention to never play repeats after a D.C. or D.S. unless explicitly specified in text?
Comment: The difference between DC and DS is DC is Da Capo (from the beginning) DS is Dal Segno (from the sign).  If you have a DC you start playing from the beginning of the music, if you have a DS then you look for the Segno - § and repeat from there
Comment: Is there a difference between D.C. al Fine and D.S. al Fine? I'm reading the definitions, and it sounds like both mean "from the beginning to the end". Maybe I should write a separate question? Edit: Nevermind, I just noticed "segno" which means to start playing at a specific part.
Comment: @Dekkadeci I think the decision is generally left to the performer (or conductor if there is one).  Most will probably not do the repeat after D.C./D.S., but I've heard it done in some cases, particularly if the repeated section is relatively short.  Some will skip repeats altogether if they're very long.  (In the days of vinyl recordings, this was often the only way to fit the whole piece on the record.)
Comment: @DarrelHoffman: If a first and second ending contain a full cadence, and differ only in the trailing anacrusis, skipping the first time through on a DC would be typical.  If, however, a first ending has a half cadence and the second has a full cadence, the music should be played through both times even on a DC.
Answer: Repeats can be used either to notate "self-contained" sections that should be played multiple times, but they can also be used to save space in cases situations where two parts of a section have identical content.  While some might eschew the use of repeats for the latter purpose, many performers would rather have a piece of music that can be performed without page turns than one which is "theoretically" correct.
Consider, for example, a piece of music where many 16-bar sections have the following chord sequence:
<code>I   I   I   IV  I   IV  I   V
I   I   I   IV  I   IV  V   I
</code>
If the bars 1-6 and 9-14 are identical, the amount of space required may be reduced by about 30% by using a start repeat, bars 1-6 (which match 9-14), a first ending containing bars 7-8, and a second ending containing bars 15-16.
If one or more repeats is being used for the latter purpose, the parts of the music indicated thereby should be performed twice through even on a DC, especially if there are some 16-bar sections which are written out in their entirety because the first six bars don't match bars 9-14 of the section.
I don't there's usually anything printed on the page to indicate which function is being performed by various repeat signs; instead, a performer must exercise musical judgment.


What should I look for in a vehicle insurance policy for taking my US vehicle into Mexico?

Question: I have been told that driving my private vehicle from California into Mexico is no big deal EXCEPT that I must have Mexican insurance. I am looking for specific recommendations about what to look for when buying the insurance - are all policies basically the same, is there an official agency that needs to underwrite the policies, are there exemptions to be wary of, etc etc. If you know of approximate cost of the policies, please post that as well.
Answer: "Mexico" Mike has good information about Mexican auto policies for U.S. drivers on his Insurance Reviews page.  Which company and policy is right for you depends on where you'll be driving in Mexico.
The company I have used before, as recommended by "Mexico" Mike, Nelson Insurance is apparently no longer around, as evidenced by the broken link, and the fact that it's no longer listed on his review page.
His page also claims that insurance is not strictly required:

Auto insurance is not required to drive in Mexico. If you want to risk having an accident, losing your car, motorcycle or RV and being thrown in jail to save a couple of hundred dollars, that is your right. Personally, I think it is foolish not to buy auto, RV or motorcycle insurance from a Mexican company to drive in Mexico.
...
You see the statement that "Mexico requires automobile insurance" on numerous web sites. Honestly, that is not true. I want you to get insurance, but I also want to tell you the truth. Mexico is one of 4 countries in this hemisphere that do not require auto liability insurance nationally.

I do know that it's not required for Mexicans to have auto insurance, but I've also heard that it is required for foreigners to have auto insurance when registering their vehicle at Mexican customs. I've always had insurance when I entered, so have never tested this requirement personally.
And as cheap as Mexican auto insurance is (or has been for me, with the company that's no longer around), I think you'd be foolish not to buy insurance, too.
And finally, one thing to be aware of when buying Mexican Auto insurance is that most Mexican auto insurance policies work differently than U.S. insurance policies.  Where as part of a U.S. policy, you generally select a deductible, which in turn affects your premium, most Mexican policies simply pay a percentage of damages, up to a maximum.  I have seen some Mexican policies that operate more like U.S. policies, but they are hard to find (I think Nelson used to offer those).
Answer: You can buy a policy online through AAA.  See this link.  It does not appear that you have to be an AAA member to buy a policy.  The cost depends on your car, length of your trip, what limits you want, etc; it should be easy to see a quote.
I haven't done this myself, and I also can't speak to how competitive the price is, but I have had my regular auto policy through AAA for several years and have found them to have good service and be very competitively priced.
You might also ask your own auto insurance company.  If they don't write Mexico policies themselves, they may be able to recommend another company.
Comment: I wasn't aware AAA offered anything along those lines. Thanks for the heads-up, but I feel more comfortable with one of the companies I found through Flimzy's post. Best,
Answer: Prices are regulated by the Mexican Governments, (Mostly federal laws), so it is best to compare services, as more or less service is the same price. Instant Mexico Auto Insurance has off street parking, assistance with claims in their office - not just giving you the carrier's phone number, drive through, lobby with clean restrooms.
There are things that can be added to policies, coverage amounts can be increased, more drivers, etc.
The underwriters must be an Mexican carrier who fall under Mexican laws. US companies do not fall under Mexican laws so the Government of Mexico has little control over them. A US company may fix your car but the problem is damages to other people.
In Mexico a car accident, liability, falls under the criminal law; You must show proof of ability to pay any liability, (A Mexican Insurance policy instantly shows that), or you could be thrown in jail until you post a bond which would cover the liability. By having a company that helps with claims, is basically a service specifically to help you; not a required service and not one you pay more for.
There was a case, I think in the state of Sonora, where the court ordered the carrier to pay more than the min liability required. I am guessing they had to pay 80,000 instead of 50,000 to a third party. Some agents are now selling policies of 300,000 because of that 3 year court case. Some carriers are in the process of rethinking the min they sell. But, the driver of the vehicle only needs to show the police the insurance coverage paper from a Mexican carrier.


Where to look for a bottleneck after elimitating CPU, memory, and disk

Question: I have a database job that runs each night to create a warehouse table. Using my new database server and SAN I have gotten the process down from 4 1/2 hours to 35 minutes. I have optimized it to run in the shortest amount of time through experimentation (WITH INDEX NOLOCK, FORCE ORDER, LOOP JOIN, MAXDOP 0). I'm happy with the improvement, but I hate not knowing why a query takes as long as it does. I'm perfectly OK with bottlenecks, as long as I know where they are. When this query is running, there are significant periods of time where the obvious resources are all underutilized. What is SQL Server doing at these times?
Comment: Can you give code, schema and indexes please?
Comment: SQL Server will always access data from memory. That's why we give it so much memory.  See my updated answer.
Comment: @gbn I apologize, but I don't think I can share all that. I know it is a little rude given that I am asking for help. I was just hoping there was something I'm failing to notice - perhaps SQL Server is actively accessing data cached in memory and I don't know of a way to check for that.
Answer: The execution plan and statistics IO will tell you everything you need to know about what is going on.
There are four places the SQL Server can bottleneck and you listed three of them.  Disk (logical and physical IO), RAM or CPU.  After that it's just crappy code that generates more logical IO than is actually needed.
With all those tuning hints in there you've probably got some code that needs to be cleaned up.  You need to look at the execution plan for the query (post it if you'd like) and see where the problems in your query are at.  You can see if the IO is logical (cache hits) or physical (disk hits) from looking at the output when set statistics io on is enabled.
Answer: Try this query: select * from sys.dm_exec_requests where session_id>50. This will show you all the currently executing user queries. Look at the wait_type, last_wait_type, and wait_resource to see what your queries are waiting on.
Also use: select * from sys.dm_os_waiting_tasks where session_id>50. This will show you all your queued tasks. This query also returns a wait_type column. If the CPU usage is low it gives the impression that SQL is not doing anything. Most of the time SQL will be waiting on another non-cpu related resource to be freed up. An inner look can be done with the queries above.
You can read a bit more about it here.
Answer: Most likely it's running logical reads in preparation for the next insert/creation/action of whatever kind.  I've had the EXACT same issue with my DW, where code will just sit around doing what looks like nothing for a while.  The end result of that one was that one dimension table had hit whatever threshold in the database that made it take much longer on occasion to pull the data; even forcing a query plan didn't fix the issue.  Restructing the query and adding a new index made it perfectly happy.
If you can and it doesn't impact production significantly, try to run a profiler trace behind the code in question and gather the SHOWPLAN results.  That should indicate if you have an index issue, or perhaps a query that would benefit from being rewritten.
Comment: Good idea. I haven't really used profiler much, so it's probably time that I started. I will post my results here.
Answer: I would look at the problem by investigating waits.
There is a ton of info on the internet about waits, starting from sql server 2005.
Check these out:

http://msdn.microsoft.com/en-us/library/cc966413.aspx
http://www.simple-talk.com/sql/performance/sql-server-wait-events-taking-the-guesswork-out-of-performance-profiling/

good luck!
Comment: Welcome to [dba.se]! Could you provide some more detailed information on how to go about investigating waits instead of just providing links? This would improve the answer.
Comment: @DTest: Providing more detailed info would be difficult. SQL Server has many wait types defined. Executing a query involves many subsystems and resources. Each time SQL server waits for an unavailable resource a wait is generated. A resource can be: cpu cycles, a lock, a latch, a memory buffer, etc.; sql server can even wait to send data to the client (may it be a .net or mgmt studio). You have to use some query's over system dmv's to understand on what is sql server waiting: you reset the wait counters, run the problematic query and analize waits using select over dmv's.


Are the cards a one-time use?

Question: In Rise of the Tomb Raider, when you buy cards from the store, are they a one-time use or do they have infinite uses?
Answer: From GameRant:

The foil cards are an interesting development in Rise of the Tomb Raider's microtransaction model. Normal cards disappear after being used in-game, but foils are permanent.

This EuroGamer article concurs with this statement:

Packs contain common cards, which can be used a single time, and foil cards, which can be used repeatedly.

From the Expedition Cards wikia page:

Generally speaking, five star cards are foil and as such can be used infinite times, but it's worth noting that outfit and weapon cards also are permanent, regardless of their individual rarity. Foil cards are easily distinguished by their gold borders and distinct shine in the card selection screen.
Comment: What is the difference between foil and non-foil, such as which cards are and which aren't? You don't need a source for this question.
Comment: From [here](https://www.wikiraider.com/index.php/Expedition_Cards) (sorry, I needed a source for this :p), it looks like in general, 5-star cards will be foil.  Also, that weapon and outfit cards are always permanent. (I just added this to my answer) Foil cards will have gold borders and shine in the menu, though, if you are looking for a visual indicator.
Answer: Foil cards have unlimited uses, while non-foil cards are single use only.

Are the cards a one-time use?


Display the content of particular content type in side a block?

Question: I tried to create a block called contact details. I already created a content type called contact. I wanted to add the content of each contact content type in my custom block. I researched a lo abd I'm confused.
Answer:
Install and enable the Views module.
Create a view with 'Block' display.
Filter by content type 'contact'. You can also choose sort options, etc.
Go to the Blocks administration page at Administration > Structure > Blocks.
Enable the Views block.
Answer: So you can do some custom work to the output of those fields? I hope that's right.
So this is relatively easy depending in how you want to go about this.
Follow steps:

You've created your content type and added all of the fields that you want. I'm assuming you've also created some content already to
  test the next part.
You need to create a view that has a block display. See screenshot for an example. https://skitch.com/therealwebguy/8ksue/block-step-1
Set up your block view appropriately. See screenshot for more specific details for this:
  https://skitch.com/therealwebguy/8ksw9/block-step-2
If you refer to the screenshot provided in Step 3, you'll
  notice in the bottom right that I have highlighted the "Information"
  link for the Theme layer. Clicking this link will bring up a list of
  all of the .tpl files you can create for this view to target what you
  need. It has everything from the top-level view tpl to the output of a
  single field being rendered by the view. Choose the one that's best
  for you needs, copy the HTML provided and add it the view.tpl.php file
  you've chosen to use.

Lets recap:

We've create a content type and added fields to it.
We've added actual nodes of the new content type for testing.
We've created a new view which will provide a block display, showing us > the field values of our content type that we want to show.
We've created a custom tpl override for the view of our choice to do some more customization at the theme level that best fits our needs.

The only thing left to do is to head over to your blocks administration and put the block where you want it.
Hope this help to solve your problem/doubt.
Comment: Nice tutorial, but this isn't a tutorial site. #3 in your recap is really the only step relevant to the question, and that's already been covered.
Answer: In block_view of your custom block write this code
$nids = db_select('node', 'n')
    ->fields('n', array('nid'))
    ->fields('n', array('type'))
    ->condition('n.type', 'contact')
    ->execute()
    ->fetchCol();
$nodes = node_load_multiple($nids);

Loop $nodes with foreach and get the fields whatever you want.
Answer: Your need to use core contact form and uses contact save to save and fetch contact detail. thats it.


When transposing songs from major key to minor key, should it be natural minor or harmonic minor?

Question: I noticed that people can transpose songs from major key to minor key vice versa, but I'm wondering that should a major key be transposed to natural minor or harmonic minor? I'm confused
Comment: Related question: [What is the formal definition of 'transpose'?](https://music.stackexchange.com/questions/95021/what-is-the-formal-definition-of-transpose)
Comment: do you mean transposition (which, as laurence payne kinda hints at, is not actually possible, but we get the sort of melodic transformation you mean), or reharmonization? in either case the answer is going to start at "natural and harmonic minor are scales representing different features of the same key".
Answer: Whichever suits your taste. (And don't forget the option of the Melodic Minor scale.)
It's a transformation more than a transposition.  Do you like the astringent augmented 2nd interval between 6 and 7 of the Harmonic Minor?   Or the smoother 'modal' feel of the Natural Minor?   Do you want to keep the leading note, the 'sharpened' 7th, that's central to the dominant chord, or are you looking for a more relaxed, less 'functional' sort of harmony?  Try all these options, hear how they affect the music, make your decision.
And why only consider major/minor transformations?  There are other scales...
Look at this set of transformations.  A, D and E have a major 3rd.  All the rest have as much claim to be considered 'minor'  as do the natural, harmonic or melodic minor scales.
Comment: @Divide1918 - I actually considered "why only consider major/minor transformations?" to mean keeping transformations based on scales other than minor scales a possibility, even if you're still changing music to a minor key. I remember pointedly using Neapolitan chords and their bII scale degree when composing the minor-key version of a major-key theme for one of my earlier pieces (a sonata-allegro).
Comment: "why only consider major/minor transformations?" probably because the op wants to keep the question focused? Which is a reasonable thing to do on this site.
Answer: Natural and harmonic minor refer to scale patterns occurring in a minor key; they are not keys in themselves. These describe how some scale steps are mutated (or not) in various contexts.
To change from major to minor, the simplest thing is just to change chords I, IV, and V to i, iv, and v or V (depending; to be addressed below). There are a few minor (hah!) changes that are commonly used in the minor mode.
When approaching the end of a phrase, the dominant chord may have a raised chord third making a major chord (perhaps with a seventh). In other places, this may not sound as good. An example is the Romanesca transposed to a minor key (Pachelbel's Canon in a minor): the major key version is I-V6-vi-iii6-IV-I6-IV-V (C-G/B-a-e/G-F-C/E-F-G(7). There are variants with the last IV being a ii0 or ii06 or the iii6 being a I64. The pattern is repeated several times. In a minor key (though I don't know any common examples) there are a couple of differences. The pattern starts i-v6-VI-III6-iv-i6 (or I6)-iv-(or ii06)-v-(or V) then repeats i-v6-VI-III6-iv-i6-iv-V. The V in the second case usually leads to a short coda but it signals a phrase ending. The v6 at the beginning isn't a major chord as there is no cadential pattern implied. (The I6 rather than a i6 is just to make the bass have a chromatic lower neighbor; the ii0 or ii06 instead of the second iv is common.)
This is a rough idea of how chords are changed. Most things are identical; the i and iv chords get the same treatment as in the major mode; the v and V both are used in slightly different contexts. A common cadence pattern in a major key is ii6-V7-I; in a minor key it's ii06-V7-i; the ii06 is a bit more dissonant than the ii0.
The best way to think of the notes in a minor key is to consider the third step as lowered from the parallel major and scale steps six and seven being "mutable" by having a lower and upper version. There are some common (but not obligatory) procedures in using the different choices available for steps six and seven.
When the underlying harmony is "tonic" (mostly i chords), the upper forms of steps 6 and 7 are common in ascending passages, and the lower form in descending passages. This gives rise to the concept of a "melodic" minor but composers have ignored this concept and used whatever suited them; the lower form of step 6 and upper form of 7 is common in many instrumental passages.
When the underlying harmony is "subdominant" (mostly iv chords and some ii0 and similar), the lower forms of both steps 6 and 7 are often used. Again the raised 7 is used rather often too.
When the underlying harmony is "dominant" (V chords or vii0 chords), the raised forms of steps 6 and 7 are used. The lower form it 6 is common too.
There are some common procedures in a minor key that do not fit the above. The lowered form of scale 6 is the "upper neighbor" to scale step 5 regardless of other considerations. An arpeggiated dominant chord always works well: steps 2-4-5-b6-7 or notes D-F-G-Ab-B in C-minor. The augmented chord on step 3 is very rare (at least until after the 1850s; the voice-leading is difficult), so Eb-G-B would be rare in C-minor (though not impossible).
The VII chord is common in minor key music but doesn't really have a good parallel in major keys. It's not used in cases like the Romanesca i-VII-VI as the voice leadings between VII and VI are tricky.
The above suggestions (or some subset thereof) can allow you to transpose a piece at sight from major to minor (or vice versa.) It's kind of fun; once, one of my band members suggested I play "Fraulein" in a minor key during a dance. I also converted it to a waltz. The audience didn't notice the similarity when we sang "Fraulein" normally in the next set.
Answer: Any times I've 'transposed' from major to minor - for choirs - I've used harmonic minor as it seems to be more simple to sing thus.


Where can I buy Framesaver in Canada?

Question: My LBS has told me they're unable to order Framesaver due to difficulties shipping aerosol canisters across the border. Are there any reputable retailers (either online or in the Greater Toronto Area) who've dealt with the hassle and have Framesaver available for sale within Canada?
Comment: @mgb accidental upvote on comment... Meant to agree with freiheit. WD40 does *not* leave any protective coating behind. I was hoping for something to coat and protect since I have reasonably harsh Canadian weather to deal with.
Comment: Doesn't WD40 do the same thing?
Comment: @mgb: I think WD40 evaporates and leaves nothing behind
Comment: Never needed to coat the inside of a frame, WD40 is useful to get any water out. I suppose car wax could work?
Answer: You can get it from Niagra Cycle Works via Amazon.com. Not quite the great TO area but not too far either.
http://www.amazon.com/T-9-Rust-Protectant-Ounce-Spray/dp/B001447PEK/ref=sr_1_1?ie=UTF8&qid=1298302015&sr=8-1
Answer: Framesaver is really hard to get, also sucks to breathe and get on the skin, I would use linseed oil instead, apply it pretty much the same, break frame down squirts some down all tubes and rotate bike all around for an even coating, the linseed will cake on the steel and leave a residue that's harmless to steels but will protect from oxide. Linseed oil can be purchased at hardware stores for about 10 bucks a litre which will do a few frames
Answer: No idea how to get Framesaver into Canada, but there are some alternatives.

A classic alternative to Framesaver is Linseed oil. It's a liquid oil that slowly hardens. Used to be common as a wood varnish, so you might find it at a hardware or furniture store. If you go this route, be careful with rags, since a rag soaked in linseed oil can spontaneously combust.
Boeshield T-9 or another paraffin based chain lube should work reasonably well. It's basically waxy stuff in a solvent that leaves the waxy stuff behind.
As ChrisW suggests: check out an auto store. They may have a rust-inhibiting product that would work, too.
Comment: "hardware or furniture store" - Alternatively maybe a car/automobile shop would sell a rust-inhibiting product, for steel.

Where can I buy Framesaver in Canada?


What's the State of the Art of Homomorphic Encryption?

Question: I get the impression from some internet resources I have skimmed that homomorphic encryption is yet computationally very inefficient. However, an Infineon press release from 2010
says that the CPUs of chip cards can do computations in encrypted form. Are there then no more practical hinderances to homomorphic encryptions today, since common CPUs are certainly more powerful than those on chip cards?
Comment: It's extremely unlikely that this chip supports fully homomorphic encryption. It's far more likely that they're using some extremely limited form and the marketing department blew it up.
Comment: My guess is that they use some kind of obfuscation, where data doesn't appear in its natural form, but isn't strongly encrypted either. Somewhat similar to whitebox crypto, where the key never appears explicitly, but can still be extracted by a sophisticated attacker.
Comment: Homomorphic encryption is not the only technique available for performing computation on encrypted data. Multi-party computation protocols is another technique which is quite practical in [real life](http://eprint.iacr.org/2008/068).
Answer: There are two types of homomorphic encryption.
Partially homomorphic encryption is about computing one type of operation over encrypted values. For instance, you know E(m1) and E(m2), and, without knowing the private key, you can compute E(m1*m2). Several efficient algorithms which allow for that are known, especially ElGamal (which allows you to multiply encrypted messages) and the Paillier cryptosystem (which allows you to add encrypted messages). Partially homomorphic encryption is useful for some protocols, e.g. electronic voting (the idea is that you can tally together encrypted votes, and decrypt the result at the end). Partially homomorphic encryption works well and has done so for at least a decade.
Fully homomorphic encryption is about computing two types of operations over encrypted values: from E(m1) and E(m2), you can compute E(m1*m2) and E(m1+m2). Fully homomorphic encryption allows for arbitrary computations; ultimately, you could provide encrypted inputs to a biiig computer, which will run the computation and provide the encrypted result, without needing to trust that big computer. The idea is that the state of a transistor in a virtual circuit can be encrypted, and the additions/multiplications are sufficient to emulate state changes based on inputs to the transistor. The big computer would have to run a virtual CPU, with a few homomorphic operations for each transistor in the virtual CPU and for each clock cycle. Needless to say, this looks expensive.
Unfortunately, the best known fully homomorphic encryption algorithms (derived from Gentry's work in 2009) are awfully slow and inefficient, making it not worth the effort (i.e. the whole Amazon S3 cloud could not compute homomorphically faster than what a single smartcard could do without the encryption). The research area is not dead, far from it; but it is very new and has not yet produced anything practical.
Answer: No.  Fully homomorphic cryptography is not practical today -- not on a desktop computer, and not on a chip-card.  See, e.g., the following question on our sister site, Crypto.SE: What is the most practical fully homomorphic cryptosystem?.  (Excerpt: "none of them are practical ... yet".)  The press release you are reading probably got distorted by the publication relations folks.  Hey, it happens.
It is possible to do partially homomorphic cryptography in a reasonably efficient way, but that's a lot more restricted in its applications and does not have the power or usefulness of fully homomorphic cryptography.
For more information about this topic, see the following questions:

In what ways does Full or Partial Homomorphic Encryption benefit the cloud?
What Partial Homomorphic Encryption implementations exist and how do I leverage them?
Is there difference between Algebraic Homomorphic Encryption and Fully Homomorphic Encryption Schemes?

Use the search bar on the upper-right of this site, and on Crypto.SE, to find more information about homomorphic cryptography.
Answer: Not sure how to read between the lines on the press document, but I'm seeing here that it is by no means dead, and I'm seeing a lot of hot topics on it with respect to Cloud Security - which makes at least some level of sense on a macroscopic view, although the part of me that actually used to implement security solutions says "don't believe it till you see it".
My take on what I'm seeing in Google is that it is still very much in the world of university research - lots of math still to be done and lots of computational analysis.  It'll be a while before we see companies invest big-time in anything hardware related or anything significant in software implementations - by which I mean a very solid, tested, certified peice of software usable for large scale computing (vs. something in a lab for verification purposes).
It sounds like value of the capability is high enough that funding for research is still available.
Addition based on commentary:
With more digging, I'm seeing things like:

http://www.faqs.org/patents/app/20120039473
http://people.csail.mit.edu/joanne/vahlis-slides.pptx
Link

Which makes me stick with my initial assertion - with papers of this type being published in this time frame, the nature how exactly this mathematics can best be implemented is still undergoing some level of evolution.  I'm willing to agree "there are no practical hindrances" in the sense of "we simply haven't found a way to do this with technology in a time efficient way" - but I would argue that at this phase of the game, I don't see anyone in the industry making making money selling such a solution - so even if we figured out how to do the math efficiently, I don't see it being used yet in implementation.  I'm not saying it's not coming, but it isn't there yet, and there's probably still come implementation hurdles ahead - likely to be fixable with time and money, which will increase in availability as soon as industry works its way through some driving use cases and proves the solutions can scale.
Comment: @Mok-KongShen Do you have any clear statements about what this IntegrityGuard chip actually does? From that marketing text, it could as well be a simple obfuscated chip. You can't use it as an example of working homomorphic encryption, unless you can show that it actually uses homomorphic encryption.
Comment: No, I don't know what's actually going on there. It is claimed that computations are done on encrpyted data instead of in plaintext form and that's considered a distinguishing feature of the chip in comparison to others of its genre.
Answer: I'm afraid this press release from Infineon is misleading. Infineon have published a Common Criteria Evaluation Security Target document for the SLE 78 chip (available for download here). From reading this document one can infer that though data is encrypted in memory, on the bus and in registers, it is in fact decrypted when used for computations (e.g. by the ALU).
Fully homomorphic encryption is definitely not computational feasible on a chip card at this time.
Comment: "In the CPU itself" most likely refers to the CPU registers and not the ALU itself.
Comment: One reads however from http://www.infineon.com/cms/en/product/promopages/CCS/integrityGuard/index.html the fairly definite assertion "fully encrypted data path leaving no plaintext on the chip - incl. calculation with encrypted numbers in the CPU itself".
Comment: [addendum] Being surprised in hearing the lecture I mentioned earlier, I asked the lecturer how the chip could manage to compute with encrypted data and obtained from him
an answer in a similar sense. As said, I have written an email and hope soon to be able to get a definite clarification.

[OT] While not relevant to our theme being discussed, a very recent paper by M. Bond et al. entitled "Chip and Skim: cloning EMV cards with the pre-play attack" may be of some interest:
http://www.cl.cam.ac.uk/~rja14/Papers/unattack.pdf
Comment: You may be interested in what I just posted. (I wrote this comment so that you would be alerted via your inbox, since the thread is almost 2 months old now.)
Answer: In his answer (and a comment) David Wachtfogel was of the opinion that a phrase involved in the press release of Infinion, namely "in the CPU itself", most likely refers to the CPU registers and not the ALU itself. If this is indeed the case, the seeming paradox could be explained. I like however to report that I have written an email to Mr. Janke, a team member of Infinion developing the chip, and obtained the following in his response:
Aus den Zertifizerungsreports bzw. den Security Targets können Sie entnehmen (Quelle: https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Zertifizierung/Reporte06/0640b_pdf.pdf?__blob=publicationFile):

"The TOE provides full on-chip encryption covering the complete core, busses, memories and cryptographic co-processors leaving no plaintext on the chip." [Der Begriff "core" beinhaltet auch die CPU inklusive der ALU, vgl. Abbildung auf Seite 16.]
"No data in plain are handled anywhere on the TOE and thus also the two CPUs compute entirely masked and in addition dynamic mask changes are applied."
[Hier wird deutlich, dass die CPU's mit verschlüsselten Daten arbeiten, wobei die Schlüssel sich dynamisch verhalten.]

These paragraphs evidently very firmly claimed the opposite. So what do experts consider to be the case in reality?
Comment: That has *nothing* to do with homomorphic encryption.  Encrypting data on-chip does *not* mean that it is encrypted with a fully homomorphic encryption algorithm, and does *not* mean that fully homomorphic encryption is practical.  They are probably encrypting using standard non-homomorphic cryptosystems (e.g., AES) or partially homomorphic cryptosystems (which are well-known).
Comment: @D.W.: Could one achieve purposes of arithmetic operations through processing AES-encrypted data without having to decrypt them in the processors?
Comment: @D.W.: I highly doubt the answer to the question in my previous comment could be positive. Thus there remains only the other probability you suggested. But that is unlikely, since I had asked the development team in their lecture in Deutsches Museum whether they could perform all 4 arithmetic operations on encrypted data and the answer they gave was "yes". BTW, after receiving the cited email, I wrote Mr. Janke again on 8th October, asking about the homomorphic encryption issue and requesting also patent informations, but till now without reply (on 8th November another email was sent to him).
Comment: It seems unlikely that my said email would get a reply, 4 weeks being elapsed by now. (BTW, the Infinion team was one of the 4 finalists competing for the "Deutscher Zukunftspreis 2012", see http://www.deutscher-zukunftspreis.de/aktuelles.)


Cartoon in which a boy and girl travel with a robot

Question: I used to watch this cartoon when I was little, maybe around 2007, although I think it was older than that. I am not sure, but I think it was an anime. I do not remember it clearly but there was a boy and a girl who fought the bad guys. The boy and girl used to travel with the help of a giant robot or machine, they hopped on the legs of it. I think the robot looked like a cat (?) or some other animal. I've been searching on Google, but I can't find it with the little info I remember.
Comment: Hello! I've taken the liberty of editing your question for clarity, but there are still some thing you could us out with to make it easier to find an answer. Firstly, you say that that you watched this cartoon "when [you] were little", but since we don't know how old you are this doesn't really help to establish a timeframe. Do you know what year(s) you saw this cartoon, and whether it was in reruns or not?
Comment: Welcome to Science Fiction & Fantasy! These might help you to improve your question; [How to ask a good story-ID question?](https://scifi.meta.stackexchange.com/questions/9335/how-to-ask-a-good-story-id-question) and [How to ask a good (anime) Story-ID question?](https://scifi.meta.stackexchange.com/questions/11874/how-to-ask-a-good-anime-story-id-question/11875#11875)
Answer: Could it be Robotboy you are talking about? The robot has ears that make his head look like a cat. There's 2 boys in it, and a girl and they both 'beat up bad guys'.
Comment: I've edited in the DVD cover of the first volume as it seems like it would be helpful for the OP to recognise this. Feel free to [edit] and revert my changes if you want.
Answer: Could it be Yatterman (or another humorous anime from Tatsunoko's Time Bokan series)?
Of course the two heroes had different robots, that were dogs, elephants, pelicans, pandas (I don't remember any cats), but the basic description corresponds: a boy and a girl who travel on the legs of a robot.

In that series, usually the bad guys were the true protagonists (and were usually very funny); they usually fought using small robots that came out from the mouth of the main robot
Answer: I'm distinctly getting a Sym Bionic Titan feel from this question. Posting a visual for the OP to reference:

I came to this conclusion from these details:

.....around 2007, although I think it was older than that. I am not sure, but I think it was an anime.

This series focuses on a trio made up of "the alien princess Ilana, the strict, but rebellious soldier Lance, and the robot Octus; the three are able to combine to create the titular Sym-Bionic Titan." The titan could be seen as the robot, and though the years are a bit off the animation [not the art itself] used by creator Gennedy Tartakovsky was anime-inspired [as seen by the big eyes and hair], but not anime itself.


Lancia Delta Integrale Fuel Pump

Question: I have a Lancia Delta Integrale with a suspected fuel pump problem. I tried to start the car by spraying some Bradex Easy Start into the air intake. It fired for one or two revolutions then stopped. I disconnected the fuel line and cranked the car but no fuel came out however, it did in the past when there was a fissure in the same pipe! As the car has been parked up for about 4 months, what could have happened in the meantime to cause the problem?
Comment: I think you are on the right track with the fuel pump. What could go wrong is anybody's question. I have little knowledge of the Integrale, so don't know if it has an electric or mechanical fuel pump. You didn't give a year of the vehicle, whether it's the 8V or 16V version (though I doubt this will affect any answers). Any other information you can give us?
Comment: It is a 16V from 1991.
Answer: It sounds like you're on the right track - it'll be either a problem with the fuel pump or one or more of the fuel lines.
Does it have an in-line fuel filter? If so, is that clear? Are the rubber fuel lines in good condition - it might be worth replacing them as a matter of course, as new lines are cheap.
If it is an electric pump, you ought to be able to test it fairly easily, by switching it on and listening to it - also check the wiring to make sure it is getting power!
Mechanical pumps are harder obviously, the easiest way to test them is to remove them from the car and work the lever manually. The Integrale is injected isn't it - does it have two pumps for low and high pressure?
Comment: It think that it only has one pump and a pressure regulator.
Comment: The problem was the fuel pump. First of all I checked the relays and found two linked to the immobilizer that didn't seem to be working. After replacing them I checked that the fuel pump was receiving power. It was but not pumping fuel so removed it and verified on the bench that it was not pumping fluid.

Lancia Delta Integrale Fuel Pump


Buffer Systems and Ion Reaction

Question: If we have a buffer solution as follows where HA is a weak acid and $\ce{A-}$ is its conjugate base, $\ce{HA + H2O<=>H3O+ + A-}$, do we ever consider $\ce{A- + H2O<=>HA + OH-}$? This is because in all of the buffer system problems I've done we only use the first reaction to find pH and other values but, we never consider the reaction of the conjugate base with water to form hydroxide ions which should increase the pH. Why is this so?
Comment: If you are in an acid media don't exist a reason for consider the second equilibrium.
Answer: Yes the equilibrium certainly exists. In fact, there exists a third equilibrium, the self ionisation of water. Considering any of the two equilibria gives the concentrations of all the species involved, there is no need to write down the third equilibrium as the third equation will be a combination of the first two. The problem arises only when you invoke stoichiometry. For example, if $0.1\ \mathrm{mol}$ of the acid dissociated, it would certainly give $0.1\ \mathrm{mol}\ \ce{A-}$, but $0.1\ \mathrm{mol}$ would not be the amount of $[\ce{H3O+}]$ as it is part of another equilibrium. However, if we do make this approximation, ignoring the hydrolysis of $\ce{A-} $, we can justify it in some cases. Say if $K_\mathrm{a}$ is around $10^{-5}$ then the equilibrium constant for the hydrolysis would be $K_\mathrm{w}/K_\mathrm{b}$ which would be around $10^{-9}$. Thus it would not be a bad approximation to ignore the second equilibrium for finding the pH.

Buffer Systems and Ion Reaction


How practicable is application whitelisting

Question: I understand that application whitelisting is better and more accurate than black listing. However, my question is, if you whitelist a directory, won't the malware also be able execute in that directory? So what use is application whitelisting in this respect?
Comment: I don't think you are understanding how application whitelisting works. Why are you whitelisting a directory?
Comment: Hi. Thanks. Don't we have to whitelist for example, `C:\program Files`, if I want all legitimate programs inside this directory to run? Or do i have to do it one by one?thanks.
Comment: Your question is not clear. In which context is the white listing done? Being able to execute files in a specific directory?
Comment: Hi, I am more concern that if I whitelist one application, and if this application makes use of other types of files, eg dlls, then I might as well whitelist the whole directory that contains the dlls?
Answer: If you whitelist a directory, then sure, any malware in that directory can run.
That's why you don't whitelist directories.  Instead, you whitelist programs, and you take precautions to ensure those progrms aren't modified.  For example, instead of whitelisting "c:\Program Files\Internet Explorer", you whitelist "c:\Program Files\Internet Explorer\iexplore.exe with SHA-256 checksum c09bc04058f1e2d4eae481490b998381486311e02ff782e99383c16d77c1b3bc".
Comment: You whitelist the needed DLLs, taking the same precautions against modification that you take for executables.
Comment: Have you ever actually seen or worked on a system that does this? This sounds like well meaning advice lacking practical experience, and you should at least add a disclaimer.
Comment: @Mark - you hit the nail on the head with "many years ago" - not much current software does it, because it's so difficult to keep up with software updates. Gatekeeper is based on signatures not hashes. The signature includes a hash, sure, but that architecture avoids having to maintain the list of whitelisted hashes which is the biggest problem. BTW, application signing is coming to Windows 10 as part of Device Guard. Until then whitelisting directories using AppLocker is the only practical way.
Comment: Hi, thanks. In your example, say, iexplore.exe uses other files such as dlls in the same directory or in System32 and I didn't whitelist c:\windows\system32, would iexplore still run?
Comment: @paj28, never done it on Windows, but this is how (give or take implementation details) Gatekeeper on MacOSX works.  I believe the current incarnation of Google Chrome extensions also work like this, and many years ago, I used a personal firewall that used checksums to verify which programs were trying to access the Internet.
Answer: In a corporate environment the purpose of whitelisting is that an administrator can authorise programs to run, but a regular user cannot.
In that case it is ok to whitelist a directory that a regular user does not have write access to. In fact, there is a standard AppLocker profile that allows execution from C:\Program Files and C:\Windows, but excludes user-writeable directories. It is rare to see this in practice, but I think it is an excellent security control. In particular, it stops a user downloading an exe file from the Internet, and running it.
The approach Mark mentions of hashing individual exe and dll files, while nice in thoery, has been generally discredited as impossible to implement in practice.
I can imagine your follow-up question: what if malware does privilege escalation and writes itself into a whitelisted directory? Well, clearly that malware will then run again in future. AppLocker white listing does not protect against that. In fact, very few protections work against malware that has escalated privileges to root/administrator. Whitelisting is a useful technique - but it is not a silver bullet.


Why is my streaming video so choppy?

Question: I am new to Ubuntu and have installed the most recent copy of Ubuntu 64bit. I also have a relatively new NVidia video card, GeForce 210 1GB DDR3. I have downloaded the drivers for linux from NVidias web site, will this fix the problem and also I am not sure how to install them as well.
Answer: Have you gone to setting then restricted drivers this will install any driver you need.
For choppy playback install the flash-helper firefox plug-in it will sort your flash out for you.

Why is my streaming video so choppy?


Anyone knows of a tutorial on how to remove/replace the radio and AC unit in a 2001 Subaru Legacy?

Question: I have new radio and AC units for my 2001 Subaru Legacy L Station Wagon but I do not know how to install them. It seems more complicated than I expected. Does anyone knows of a good tutorial or manual on how to remove and replace those two?
Comment: The radio is a piece of cake, to be honest. The hardest bit is popping the dash without scratching it, but then it's obvious. As far as a/c goes, the dash module is as easy as the radio, but as Paulster says, replacing the actual guts of the thing is not for beginners.
Comment: What part of the AC unit are you trying to replace, the compressor? If so, there are a few specialized tools you'll need to complete this. Such as a vacuum pump and an A/C manifold to check pressures, to name a couple. If you don't have these and really don't know the process, I'd highly suggest you take your work to a qualified shop. Not something an average backyard mechanic can attempt and complete successfully.
Answer: As far as the radio goes, you can use this tutorial. If you just want to replace the AC front panel box I am sure you can figure it out using the same tutorial. But as said in the comments, if you want to work with the AC unit itself, better take it to a shop.


Which one of Superman's powers was the last Superpower to fully develop?

Question: Assuming that all of DC comics Superman's powers have completely and totally matured, which one of them was the last power to fully develop? I haven't read each and every universe, but I'm pretty certain he still has his long established set in his arsenal.
Comment: "I haven't read each and every universe" — you, sir, are what we refer to as a lightweight.
Comment: @PaulD.Waite You're just saying that because it's true.
Comment: @PaulD.Waite Sorry bro, all my extra coin goes toward Lego. I enjoy my comic books vicariously through you guys. I love Science Fiction, but Lego is my main addiction.
Comment: Does rebuild-the-Great-Wall-of-China-vision in Superman IV count?
Comment: @DarthWedgius - imaginary movies that never happened never count
Answer: Superman has a history of sometimes developing different powers at different times. This was extremely prevalent back in the Golden/Silver Age when they needed a new super power to handle a new super threat.
They toned this down more so in the modern age, however just this year Superman developed yet another superpower. Here's an article detailing this new ability.
So, to more specifically answer your question, Superman's powers seem to be in a constant state of flux depending on the writer. Just when you think the Man of Steel can't get any more super, suddenly he's got a new trick up his cape.
Answer: Just as @splitting-adam said, This article outlines his X-ray/ heat vision as being his final development. This is a prevalent trait throughout his mature life as well. The comics detail his murky 'double vision' occurrences during his early years, but never exactly explains the heat ray until after other powers are developed or explained.
Although it's not exactly a "power", after every super power is explained, his allergy to kryptonite is described. This is an example of a 'super power' because humans can not exhibit the same reaction, therefor being a 'super' or 'superior' power. Even though this is a downfall to the character's strengths, the description of this weakness is his last described power/feature.
UPDATE: This article explains that his "telescopic and microscopic vision" was one of the last to develop but it depends on the actual time in history you are looking at. And that the comics developed depending on the author.
Comment: The answer to this question will never be permanently correct because change to this can always happen.
Comment: This is not an original answer.
Comment: @amalgamate I accidentally clicked the submit button before my answer was ready. I have edited it since.
Comment: ok. Fine. 15 characters. Fine.
Comment: What do you think? Which power was last to develop? It is really up for interpretation but, I think the last power to develop was the vision, and the last downfall to be exposed was the kryptonite.
Comment: I shrug my shoulders.
Comment: Cheers mate. Same here, just the evidence above, don't really know for sure unless you discuss it with the authors or experts.


Help me with my hand Brakes

Question: I have a 2007 Honda Civic DX sedan. Recently my hand brakes stop staying up. Mechanic said the cables are good but I need some sort of clip or spring but he isn't sure because he is unfamiliar with this vehicle. Can someone help?
Comment: have you physically inspected anything.  checked the spring, checked the cable.  anything like that?
Comment: A friend of mine took of the outer arm which is broken nut we didn't see a spring is their supposed to be one?@DucatiKiller
Answer: Yes, your parking brake has a return spring.  You should be able to goto a local auto parts store to get that and the arm replaced.
I also recommend you find another mechanic as most of this information is available on the Internet.
Hope this helpful.

Help me with my hand Brakes


How do I add the timezone field to a profile?

Question: Timezone is one of the fields in the address table. I'd like to add it to a data entry profile but it's not listed in any of the dropdown menus. How can I add it to the profile even if it's not in the dropdown?
Comment: Is this a custom field for address?
Comment: @PradeepNayak, no. Timezone is a standard (not custom) field in the address table in the database.
Answer: This is not supported by CiviCRM but you can do a small change in your existing CiviCRM file as shown below and clear civicrm cache, the profile form should then should allow you to add timezone field of address.
<code>diff --git a/CRM/Core/DAO/Address.php b/CRM/Core/DAO/Address.php
index b1e00a83dc..ee9bf2d945 100644
--- a/CRM/Core/DAO/Address.php
+++ b/CRM/Core/DAO/Address.php
@@ -731,6 +731,7 @@ class CRM_Core_DAO_Address extends CRM_Core_DAO {
           'table_name' => 'civicrm_address',
           'entity' => 'Address',
           'bao' => 'CRM_Core_BAO_Address',
+          'import' => TRUE,
           'localizable' => 0,
           'html' => [
             'type' => 'Text',
</code>
Comment: Thanks, @PradeepNayak. Works great! Might it also be useful to add `'export' => TRUE,`? I notice all of the other fields that are normally included in the Profile dropdown also that.
Comment: Looks like I responded to soon. The timecode field is in the Profile dropdown but data entered into that field doesn't get saved in the address table.


What's the difference between down-vote, vote to close and flag ?

Question: For some questions, I'm not sure whether I should down-vote it, vote to close or flag for moderator attention? Which one should I choose?
Answer: I've seen recently some moderator flags that weren't completely justified, so here is some general guidelines about when to use what.
From the general guidelines:

When should I flag?
If anything happens on our site that makes you feel uncomfortable -- that clearly does not belong here, in your opinion -- please flag it and bring it to our attention!
When should I vote down?
Use your downvotes whenever you encounter an egregiously sloppy, no-effort-expended post, or an answer that is clearly and perhaps dangerously incorrect.
When should I close a question?
Questions that are sufficiently off-topic, as outlined in the FAQ, should be closed by casting close votes. Questions that are sufficiently similar to older questions should be closed by casting close votes.
Note that once you gain the reputation to vote to close, you should no longer flag for moderator attention to have questions closed or migrated. It is your responsibility to vote now.

In general, the point is that in the long-term the community should moderate itself. In other words, vote as much as you can (in particular, down-votes on questions are free, you won't lose any reputation!), when you have enough rep, vote to close.
Comment: @scaaahu: Noble is right, the point is whenever you flag, to also use the other mechanisms you have. In that particular example, you did right to flag, because this content was clearly to be removed and not just closed. Then, the point was to down-vote it, because below a certain score, the question does not appear, which is good. The vote-to-close was not bad, but not strictly speaking mandatory, since it was clearly spam. Anyway, thanks for the participation :)
Comment: I just saw a spam question "Why are you so dumb". It's obviously a spam. I flagged it, down voted it and voted to close. Do I really need to vote to close and down vote it? Please clarify.
Comment: @scaaahu `voting down` does not necessarily alert the community or the moderators. But `vote to close` enables users of enough high reputation (and the mods) to have a look at it using `review` tool. If you have `voted to close`, you need not necessarily `flag` it. That's what @Charles is trying to convey.


Can I export related fields using a data loader?

Question: I want to be able to export the related account fields for each quotation in Salesforce using Data Loader. I suspect this is possible using relationships (Object__r.FieldName__c), but I'm not 100% sure. If it is possible, can you explain how?
Answer: You can export parent and their parent attribute values from Child object.
But from the parent, you cannot export child object related attributes.
You could move to 5 levels up to the Parent or related objects.

As we cannot query foreign key relationships more than 5 levels away from the root SObject

so, maximum up to this level is supported from Quote:

Opportunity.Account.Parent.Parent.Parent.Name

In the below example I have shown how to move from

Quote --> Opportunity --> Parent Account --> Parent.Parent.Account

Example
SELECT Id, Name,
    OpportunityId,
    Opportunity.Name,
    Opportunity.Account.Name,
    Opportunity.Account.Id,
    Opportunity.Account.ParentId,
    Opportunity.Account.Parent.Name
FROM Quote

Results
Answer: Yes, Data Loader supports this behavior. You just have to type out your SELECT clause, since it won't let you select them yourself. For example, this query exports just fine:
SELECT Profile.Name FROM User

You can use any Parent__r.Field__c you want, you just have to properly specify the field path.
Answer: Yes, this is possible. Say for example if Account is a Parent object and User id is a child object. Then you can export the data of the user object by a query into the Account object. You have to use a relationship query like below:
SELECT ACCOUNTOWNER,CLIENT_PARTNER__r.name,CLIENT_PARTNER__r.email from ACCOUNT

Here CLIENT_PARTNER__c is the API name on account object.


A Worldwide Wave

Question: What would have to happen for a giant tidal wave to wash its way around an entire planet? The planet can be like earth, with the same size, mass, and everything else. However the wave must start without an impact from space.
Comment: Have you considered tsunami's?
Comment: You might need to help us with some specifics.  For example, in the movie *Interstellar,* Miller's planet had a giant sphere-encircling wave caused by the huge gravitic (tidal) sheer of a nearby black hole.  On the other hand, as @pojo-guy suggests, a whomping big earthquake could (theoretically) cause a tsunami that would encircle the globe (though unlikely over land).  So, can you tell us more about what you're looking for?  Tell us specifically about your planet and how you want this wave to interact with the planet.  Thanks!
Comment: Do you want the wave to go through oceans, or it has to cross continents as well, like in "2012"?
Comment: A rogue planet flying by? A water-air mix e.g., the ocean's surface is an excellent dampener, so you'd need an enormous and sustained force to create tsunamis that big. Would simultaneous  tsunamis in the Indian, Pacific and Atlantic Oceans work? I really don't think there is enough water in the world (or air pressure) to sustain a single tsunami capable or circumnavigating the globe.
Answer: It sounds like you're asking for a phenomenon similar to the waves in Interstellar - a periodic and regular wave that sweeps across the surface of the planet. In that case, your use of the term "tidal wave" may have been remarkably prescient, because you're actually looking for tides.
Tides literally are waves that sweep across the world. Without any landmasses in the way, we would have four bulges of water sweeping across the planet surface, two from the Moon and two from the Sun. So, in order to have a planet with the same mass and size as Earth that has tides sweeping across the surface, cover the thing in water.
Now, that didn't feel like I answered the spirit of the question. On an Earth like ours, could we make this happen and retain the landmasses? Well, tidal height is linearly proportional to mass and proportional to the cube of distance. The average height above sea level for continents is 800 meters. On Earth, the average tide height is ~1-2 meters. To increase that by 400x, we'll need to move the Earth to about 1/8th of its previous radius. That puts us well within Mercury's radius and would probably just melt the planet whole. That's why a black hole was used in Interstellar to obtain a similar effect - maximizing the mass and minimizing the heat produced.
Answer: The largest tsunamis that are anticipated by natural causes, not including meteor impacts, occur when there are large landslides.  The greatest of these include large sections of continental shelves.  There is a large continental shelf off of western Africa that is expected to collapse some time in the future.  The tsunami will be tremendous and obliterate many cities.
HOWEVER, I don't believe that even the worst case scenarios would generate enough wave energy to carry a large body of water across an entire continent with two mountain ranges (e.g. North America with the Appalachians and Rockies.)
Answer: Do you want the giant waves to be regular, predictable phenomena, or sudden catastrophes happening only once in the history of the planet and destroying everything?
1) Make a planet with very flat continents - I can't think of a reason to have continents that are very flat, but there must be some. Or make the continents all submerged except for small, flat atolls that barely break the surface.
2) Make it a very young planet that has a very young and very large moon.  The moon has recently formed and is still very near to the planet.
Dubukay's answer says that tidal height is linearly proportional to mass and proportional to the cube of distance.
At present the Moon is about 384,389 kilometers from Earth. If Earth's Moon was still only a tenth as far as it is now, the tides would be about 1,000 times higher.  If Earth's Moon was only a fifteenth as far away as it is now, the tides would be 3,375 times as high.  If the planet's continents are small and flat, the tides might sweep completely over them two times a day.
Of course the moon was believed to have formed in a gigantic collusion that would have exterminated any life on Earth.  If your planet has a very young large moon that recently formed in the same way, the planet could not have advanced lifeforms that took billions of years to evolve, and you may desire them for your story.
3) Make the planet a moon, a satellite of a gas giant planet that orbits in the habitable zone of their star.  Earth has 81.300813 times the mass of the Moon.  The gas giant planets in our solar system have masses that range from 14.6 times the mass of Earth (Uranus) to 317.8 times the mass of Earth (Jupiter), and thus 1,186.9918 to 25,837.398 times the mass of the Moon.
So if Earth orbited a giant planet like those in our solar system at the same distance (384,389 kilometers) as the Moon orbits Earth, the tides the giant planet caused on Earth would be 1,186.9918 to 25,837.398 times as high as lunar tides on Earth.  If you arbitrarily move the planet out to about four times the distance of the Moon, or kilometers, the tides would be one 64th as high, but still 18.5467 to 403.70934 times higher than lunar tides.
Astronomer have discovered giant planets in other solar systems that are several times more massive than Jupiter.  Of course a Earth sized moon orbiting a giant planet should become tidally locked with one sized always facing the planet.  Thus the tidal bulges one opposite sides of the moon would stay in the same places instead of sweeping around the world.  So method of preventing the moon from becoming totally tidally locked to the planet would be necessary.
4) Make the planet orbit very close to its star to have giant tides.  Dubakay in his answer claimed that if the planet orbited close enough to its star to have giant tides, the planet would be sterilized by the heat of its star.
But if a star is very dim, a planet would have to orbit very close to it to receive the same amount of heat and light as Earth gets from the Sun.  According to the list of potentially habitable exoplanets, the four potentially habitable planets orbiting in the habitable zone of the dim spectral type M8V star TRAPPIST-1 have years ranging from 12.4 Earth days down to 4.05 Earth days.  Their distances from TRAPPIST-1 range from 0.02888 astronomical units (AU) to 0.0451 AU, or about 4,320,386.4 to about 6,746,863.9 kilometers.
If TRAPPIST-1 had the same mass as the Sun, its four potentially habitable planets within its habitable zone would have tides ranging from about 10,900.168 to 41,515.227 times as high as solar tides (not lunar tides) on Earth.  But TRAPPIST-1 is less massive as the Sun.  The mass of TRAPPIST-1 is about 0.089 the mass of the Sun, so the tides created by TRAPPIST-1 on its four potentially habitable planets should range from about 970.116 to about 3,694.8596 times as high as solar tides on Earth.
Since the Sun's tidal attraction on the Earth is about 0.4727 that of the Moon, the tides created by TRAPPIST-1 on its four potentially habitable planets should range from about 458.573 to about 1,746.5601 times as high as the Moon's tides on Earth.
Of course it is expected that the planets orbiting in the narrow habitable zone of a class M star would be tidally locked to their star.  Thus the tidal bulges on opposite sides of the planet should be motionless.  A way to keep the planet from being tidally locked is needed.
If the planet orbiting close to a dim red star is actually a giant moon orbiting a giant planet, it should become tidally locked to the giant planet and thus avoid being tidally locked to the dim red star.  Thus it would have days as long as the months of its orbit around the giant planet, and the giant tidal bulges created by the star would sweep around the moon.
Anyway, those are my thoughts about how to have periodic giant water flows covering the small and very flat continents of an otherwise Earth like planet.

A Worldwide Wave


Does using design patterns makes java code slow?

Question: Does using design patterns makes java code slow? If I use extra interfaces and syntax constructions (like class wrap) will I get well organized but slow code or that won't make my code significantly slower?
Answer: This will not make your code significantly slower. As some function calls are wrapped in additional classes or methodes, some method-calls are a little bit slower, but a human will not notice this. It's about nano-seconds. Allways prefere the advantage of good readable and reusable code.
I a high performance application, you should consider to refactor your code to a higher performance after designing and implementing it based on patterns. But normaly this is not needed.
And as always: It depends on the used pattern and the usecase of your program.
Comment: Well, a human **might** notice a nanosecond multiplied by a billion, so the argument can only be stated in percentage, not nanoseconds.
Comment: For example, in high-performance APIs like Lucene great attention is given to exactly this kind of issues.
Comment: +1 .... http://programmer.97things.oreilly.com/wiki/index.php/Write_Code_for_Humans_not_Machines
Comment: @Simulant: AFAIK, most of the complications comes from using indirect calls, and that's something what gets mostly completely optimized away. I agree with all the rest.
Answer: Following your line of thought, one should never use Java in the first place because it is full of abstraction layers that make it more convenient to write correct and maintainable code, but reduce its speed below the speed of assembler or C. If you worry about wrappers making your code significantly slower, you probably have a use case that would make C a better fit than Java.
On the other hand, you should definitely take care not to overengineer and throw truckloads of patterns on every problem you see in your code. Use patterns judiciously, where you can clearly see the benefit, not just where you see a pattern might theoretically fit.
The way I prefer to code is to first make the simplest, dumbest solution that solves my immediate problem. If later I must add one or two more similar functions, giving rise to code duplication or other code smells, only then will I think about introducing an appropriate pattern.
Answer: Interfaces make your code clearer and easier to change in future, but have no effect on speed, because they exist only to tell the compiler how your code fits together.
Design patterns patterns are commonly occuring solutions to common problems. If you have the problem then use one of the well-known solutions. Will it make your program slower? It depends on the choices you make between the available solutions. You need to understand the trade-offs of each pattern in order to nake the choice.
But without using a design pattern solution, you are using your own home grown DIY solution; when we do this we usually doesn't solve the problem as well, or as quickly (in our time, and in machine time), or as understandably for future maintenance. This last point is because design patterns give us a new way of talking about problems and solutions. Once we understand that new vocabulary, we can solve more complex prolems more easily.
So do they make your program slower? No, they make it work. Faster.
Enjoy your patterns reading. They make more sense if you have an actual problem to solve.
Answer: As said before, the overhead of using design patterns is insignificant, and to be sure, just take a look at the code source of some java projects where the performence is needed like android, and you will be surprised that all of them use heavily design patterns.
However some design choices coud impact the performence , like choosing to use List instead of hashmap where the map is more suitable.
Answer: Ideally, when using a permitted programming constructs, you should not worry about performance. JVM is good at keeping code optimized.  Most performance issues generally arise by the code where we write code related to thread synchronization, and where we do I/O such as DB calls.  Having few extra interfaces and classes to make your design modular and neat will not hurt. You may have to be bit careful if you are writing your own frameworks that rely on using reflections and other advanced features, if you do it sub-optimally, you can risk adding  performance bottlenecks.
Answer: In most cases additional code wrapping makes code a bit slower. But in some cases this is not true. If you iterate >1 billion iterations, additional wrapping can be significantly slower. Good practice is first to write good readable and reusable code. And only after that try to profile and optimize code there is worst performance. Often you need change compute algorithm, but some times you need write workaround code.
Answer: Maybe. As usual, there are no easy answers when it comes to a trade-off.
You have established that using a certain pattern will make the code clearer, but that may come at the cost of a performance penalty. So what do you do? You use your best judgement. Often that may be to first try the pattern and then test whether that's fast enough, and then optimizing as needed. Sometimes you already know that it has to be as fast as possible, or conversely, that the code is not performance-critical.


Odd flute behavior

Question: I am very new to flute, but I have played various instruments over the years.  A thing I am having issues with is when I go from the fingering for G4 to the fingering for A4 (according to all the fingering charts I have seen), it actually jumps to something closer to B-flat.  Do I just suck right now, or is something odd going on with my flute?
Comment: It shouldn't sound like that so I am wondering if your Bb key is maybe a bit sticky?
Comment: @Jomiddnz A sticking B-flat key will not affect an A.
Comment: Yes, either you are doing something wrong or your flute is not working properly. Or maybe both. Without seeing your flute and/or hearing you play we have no way of telling what the problem is.
Comment: @PiedPiper thanks for the information.  I was just trying to solicit some advice before taking it in.  Just seemed like something odd was happening.  It sounded odd to my ear and when I went to the tuner, it was showing it as almost a semitone off for the A fingering but was pretty much right on for the G fingering.  I'll take it into my local shop and see what they say.
Answer: Several possibilities here, but you're probably not going to get a definitive answer without standing in front of a more experienced flautist and showing them.

as @Jomiddnz suggests, perhaps your Bb key is stiff
the padding on your B or A key may be leaking
you may be subconsciously tightening your embouchure  in an effort to 'make' the higher note
you may be subconsciously changing the horizontal angle of the flute against your lip, or rolling it inwards
you may be touching a key further down the flute, perhaps on your right hand, to steady the flute as your left hand has less contact

Or it could be a combination of more than one of the above, or something else I've not thought of!
Comment: If the Bb key is stiff that's not going to affect the A at all. If a pad is leaking that will affect the G more so than the A. If OP is touching keys farther down the flute that will *lower* the pitch rather than raise it. Tightening the embouchure or turning the flute in, is unlikely to raise the pitch almost a semitone.
Comment: Could it be that the G4 is actually closer to an F# and the A is an A?

Odd flute behavior


Joining lines when direction is not known

Question: I am struggling with this problem: I have a polyline made up of several segments. Each segment is made up of points, each point identified in 3D space by coordinates and elevation. Together, if plotted, the segments make up a more or less continuous line (there could be breaks between segments), but the segments themselves are not consecutive, nor do the points of all segments follow the same direction of travel.
The question is: how can I create, using Python preferably, a single line from these non-consecutive segments so that I can measure the distance between points and the total length of the line?
I don't even know which of the segments is the first one or the last one in the line, but somehow I have to put them in the right sequence and make sure they all point in the same direction so I can measure them.
I'll be happy to supply additional info, data, etc...
I stress I am not asking for the actual python code (not that I would refuse it...), just the strategy.
Comment: Do segments in the polyline cross other segments?  If so, is there a requirement to break the segments at these intersections?
Answer: The segments can be used to form an abstract graph G in which they play the role of nodes.  Consider a node that is the segment (arc) from point P to point Q, PQ.  Let R be the closest endpoint among all the other segment endpoints to P and let S be the other endpoint of R's segment.  G then contains an edge from node PQ to node RS and we will label this edge with the points P and R.
If we are to be successful, then G is either a linear graph or a single cycle.  You can detect which is which by storing the degrees of the nodes as you create the edges.  (The degree of a node counts the edges emanating from that node.)  All nodes, except possibly two of them, must have degree 2.  The other two must both have degree 2 (for a cycle) or degree 1: this marks them as the ends of the polyline.  In the first case pick any node to start constructing the polyline; in the second case, pick one of those of degree 1. Any other combination of degrees is an error.
The polyline is initialized to the starting node (an arc).  Look at one of the edges e incident on this node: its other node tells you which arc to process next and its label tells you which vertices of those arcs to join.  (Join the vertices with a new line segment if they do not have identical coordinates.)  Update the growing polyline in this fashion and, at the same time, remove edge e from the graph G.  Continue until either an error occurs (and report that the edges do not form a non-branching connected polyline) or all edges are removed.  If no error is raised, output the polyline you created.
Example

In the figure the arcs are AB, CD, EF, and FG.  The nodes of the graph are therefore {AB, CD, EF, FG}.  The edges are AB--CD (labeled with B and C), CD-EF (labeled with E and F), and EF--FG (labeled with F and F).  The degrees of AB and FG are 1 whereas the degrees of CD and EF are 2.  Here is a schematic of the abstract graph and its edge labels:

Let us arbitrarily start with FG, one of the degree-one nodes.  Because it has degree 1, there is a unique edge EF--FG connected to it, labeled with F.  Initialize the polyline with arc G-->F.  Because the label designates a common endpoint of GF and EF, we don't have to make a new connection.  Remove edge EF--FG from the graph and extend the polyline with EF via G-->F-->E.
This edge removal reduces the degree of EF from 2 to 1, leaving it with a single edge to arc CD labeled with E and D.  This tells you to extend the polyline from E to D (with a new line segment there) and thence along arc CD: G-->F-->E-->D-->C.  In the same manner, after removing edge ED--CD, you will extend the polyline further to its final form G-->F-->E-->D-->C-->B-->A.  You stop because all edges have been removed from the graph: this indicates the procedure was successful.
Comment: Thank you Whuber. I am going to need some time to evaluate your suggestion, but I already have some questions: you say "Let R be the closest endpoint". This I believe is the crux of the problem. There are three potential points of contact between segments, the x , the y and the z coordinates. Even if we eliminate the z coordinate because a line could be perfectly flat, that still leaves two choices. Remember the solution has  to be programmed (in Python), no visual choice is possible.
Comment: My current thinking is to use Matplotlib to plot the segments regardless of sequence, that would create the line but the points would need recreating. How?
Comment: @Bob Finding the closest point is a relatively simple GIS operation (even in 3D).  Each segment PQ has two endpoints P and Q.  First find the closest point to P among the collection of endpoints of all segments (not including PQ itself).  It is the endpoint, R, of some different segment RS.  Create the edge PQ-->RS labeled by P and R.  Repeat the search relative to the endpoint Q to obtain the other edge.  One thing I did not note: you need a tolerance threshold; if the nearest point is greater than the tolerance, conclude there is no nearest point.
Comment: The real difficulty in the entire procedure is that connecting disjoint segments can potentially create tiny self-intersections (depending on why and how the segment endpoints don't exactly match).  This can be troublesome to fix in general.  If such problems occur, consider cleaning up the polyline to eliminate such flaws.
Answer: Following on from whuber's answer, if you are looking to do this in Python then have a look at the NetworkX library that has all sorts of functionality related to graphs, nodes, and edges. I think it is the Traversal functions that implement what whuber is describing. It also includes basic drawing functionality.
Once you have your line orders then you can easily construct geometries in Shapely to do further GIS type analysis, or display in MatPlotLib, export to GeoJSON etc.
Answer: I would calculate the distance between each start segment and end segment, and then join the ones with the shortest distance between them?
Comment: I thought of that too. I'm not sure if it would work as a general solution.
Comment: @George You are correct.  Problems occur in situations similar to the one I described in a comment to @nathanvda's post.  You want to use endpoint-to-endpoint distances for any solution.  @johanvdw's suggestion can be implemented if the distances are understood in this sense; it is analogous to the standard technique for constructing the Euclidean minimum spanning tree of a collection of points.
Comment: You are right. I meant start _node_ to end _node_ instead of segment.
Comment: That is indeed what i ment as well :)
Answer: You have a lot of segments, no specific order or orientation. You do not know which actually touch or overlap, and which are merely close.
For each segment only the begin and endpoint is important. The goal is to make one big polyline, the orientation of that polyline is not important, i guess.
In that case i would make some kind of set/array of segments, start with the first one, which is entirely random.
In pseudocode do something like
all_segments = set of all segments

# take the first segment out of set
new_polyline = all_segments.pop

until all_segments.empty?
  start_segm = find_segment_closest_to(new_polyline.start_point)
  remove_from_all_segments(start_segm)
  expand_polyline_at_begin(new_polyline, start_segm)
  end_segm = find_segment_closest_to(new_polyline.end_point)
  expand_polyline_at_end(new_polyline, end_segm)
  remove_from_all_segments(end_segm)
end

Something like that?
That is a very high level. You will need to handle boundary cases.
I am guessing you know or could the biggest possible gap/distance, because you will need to be able to somehow exclude points being found: if the closest possible point is at the other end of the polyline than it is not an option :) The easiest way to handle that is to define a maximum gap-distance. This will also limit the number of points you will have to look at for eacht segment.
[EDIT: detail the find_segment_closes_to]
To make it absolutely clear how i would find the closes segment, i will write first a very crude approach:
def find_segment_closes_to(point)
  closest_point = nothing
  closest_distance = MAX_GAP_RANGE
  all_segments.each do |segment|
    if distance(segment.end_point, point) < closest_distance
      closest_point = segment.end_point
      closest_segment = segment
      closest_distance = distance(segment.end_point, point)
   else if distance(segment.start_point, point) < closest_distance
      closest_point = segment.start_point
      closest_segment = segment
      closest_distance = distance(segment.start_point, point)
    end
  end
  # the closest segment
  return closest_segment
end

This is a very crude approach, that will iterate over all segments and check for each endpoint which is the nearest.
Ideally you would have some datastructure where you could ask for all the start- and endpoints that lie within range and only find the closest point among those.
Does that help? I hope it gets you started.
Comment: 'find_segment_closest_to' will produce erroneous results in some cases.  Imagine a polyline that *almost* closes on itself, but not quite.  One vertex of this polyline might be extremely close to the *middle* of another of its segments, *but it should not be connected to that segment.*  This is why a correct algorithm relies on point-to-point comparisons, not point-to-segment comparisons.
Comment: Yes indeed: you should only be looking at begin- and endpoints of a segment. Maybe you said in your solution almost the same, but i found it very hard to read and understand.
Comment: Knowing the language and basic techniques of graph theory is essential if you want to be able to read the literature on algorithms.
Comment: @whuber thank you for the tip. I will look into that.


Are rainproof fittings to connect meter box and weather head to rigid steel conduit required?

Question: My utility company specifies 2" rigid steel conduit for my exterior-mounted, overhead service drop/service entrance.  Do I need to use special rainproof fittings when coupling the rigid conduit to the meter box, weather head, and any intermediate couplings?  If so, please provide an example.  References to the relevant sections of the NEC are also appreciated.
Comment: As a rule, NEC considers ALL exterior conduit to be wet inside. As such, I'm not sure that there is much to be gained by "raintight" .vs. any normal fitting. I can certainly attest that glued PVC conduit becomes wet inside from condensation alone if there is no direct leak into it, so other than normal good workmanship to avoid massive water entry, I can't see a lot of benefit over the ordinary threaded couplings (which are pipe threads, just like on 2" galvanized water pipe) on normal 2" rigid fittings...cut threads and install normal fittings.
Comment: This run is outdoors, correct?
Comment: @Ecnerwal -- to some degree, I agree -- the big question you raise is "are non-raintight conduit fittings listed for use in wet locations?" as the Code requirement is a listing one.
Answer: Given that the overhead service drop is likely run outdoors, which'd put it in a wet location, 314.15 applies:

314.15 Damp or Wet Locations. In damp or wet locations, boxes, conduit bodies, and fittings shall be placed or equipped so as to prevent moisture  from accumulating within the box, conduit body, or fitting. Boxes, conduit bodies, and fittings installed in wet locations shall be listed for use in wet locations. Approved drainage openings not larger than 6 mm (1/4 in.) shall be permitted to be installed in the field in boxes or conduit bodies listed for use in damp or wet locations. For installation of listed drain
  fittings, larger openings are permitted to be installed in the field in accordance with manufacturer's instructions.

In general, a fitting labeled "raintight" will be listed for wet location service.  Non-raintight, albeit acceptably corrosionproofed, fittings may or may not be -- check with the manufacturer for their suitability.
Comment: Thanks, ThreePhaseEel, for the code reference.  With that, though, is there a requirement for rainproof fittings?  @Ecnerwal seems to vote no above, as does the electrician I found at Home Depot, and that seems to be how my neighbors' new services are connected (I did some sleuthing after posting my question).  My plan now is to install the weather head without any additional gasket or sealant, and install the rigid to the meter box hub without any gasket or sealant at (however, I will add a bead of silicone at the interface between the box and hub).
Comment: @the_meter413 -- perhaps you could ask "are non-raintight conduit fittings listed for use in wet locations?" as a new question. I don't have an answer for that question offhand, but perhaps one of other denizens can dig it up.
Answer: This appears to be one of those places where things are muddled because the case is not clearly called out specfically - but the contrary case is mentioned.
Threaded RMC connections are tapered pipe threads, designed to hold pressure, as they are used in pipes. Threadless connectors are called out as "needing to be liquid-tight (NEC via conduit maker www.wheatland.com) - Threaded connections are not specifically mentioned, other than the prohibition of leaky threads. In observed practice, ordinary threaded couplings are commonly seen on RMC installions in wet locations, and the "raintight" designation is (almost?) exclusively seen on non-threaded (or non-threaded on one side) connectors.

344.42 Couplings and Connectors.
  (A) Threadless. Threadless couplings and connectors used with conduit shall be made tight. Where buried in masonry or concrete, they shall be the concretetight type. Where installed in wet locations, they shall comply with 314.15(A). Threadless couplings and connectors shall not be used on threaded conduit ends unless listed for the purpose.
(B) Running Threads. Running threads shall not be used on conduit for connection at couplings.

Part (B) prohibits running (aka straight, untapered, non-sealing) threads on threaded connections. An earlier paragraph specifies taperered threads, and refers to a pipe thread standard:

344.28 Reaming and Threading. All cut ends shall be reamed or otherwise finished to remove rough edges. Where conduit is threaded in the field, a standard cutting die with a 1 in 16 taper (3⁄4-in. taper per foot) shall be used.
  FPN: See ANSI/ASME B.1.20.1-1983, Standard for Pipe Threads, General Purpose (Inch).