Why my topN percentile is not updated in careers?

Question: Why my topN percentile is not updated in careers? Here i'm in 4% (10%) for scala, but on careers page - i'm still in 20%.
Comment: Most likely we determine that on the Careers side with a different query than what's on data explorer. I'll see if I can find out.
Comment: maybe it should be http://data.stackexchange.com/stackoverflow/revision/256810/333779/what-percentile-am-i-in-for-a-given-tag
Answer: Both comments are correct. Let me clarify a little:

The data explorer query in your question gives your top placement relative to all users with a non-null total score in the scala tag: you're top 4%

The data explorer query in your comment gives your top placement relative to all users with a total score greater than 5 in the scala tag: you're top 11% (here your are  competing only against users with a higher score)

The top % shown in your Careers profile is your placement relative to all Careers users with a linked SO account and a total score greater than 5:  you're top 11%. It is the same % as the previous case, but that's just because the Careers users are rather representative of the SO users for this tag.

Careers rounds the top % to the higher multiple of 10: you can be either top 10%, top 20% or top 30% (if higher than that, it is not displayed).
So even though your real placement is 11%, it shows as top 20%.
As en encouragement, your total score in scala is 116, and the current threshold to be top 10% is 138. You're getting there ;)
Comment: yeah :). is it possible to replace original version with my changed script somehow? because i found several questions that use original query.
Comment: It's not possible to replace the original query afaik. The link would have to be updated in these questions


How to know which block I am mining solo in bitcoin core wallet?

Question: How to know which block I am mining solo in bitcoin core wallet? How do I know which block I'm in? And how to know how many blocks are left for me to mine 1 whole block by myself?
Answer: Your last question seems to imply that you think that there is some guarantee that after enough blocks you will mine a block. This is not the case. You could mine a block right this moment, although it is extremely unlikely. As the total hasrate of the network increases the probability of you mining a block is getting smaller and smaller, to the point that it is not economical to even try; you'll be paying more in energy bills to have your PC running than the block rewards will yield you.
Answer:
How to know which block I am mining solo in bitcoin core wallet?

https://developer.bitcoin.org/reference/rpc/getmininginfo.html says

"blocks" : n,                (numeric) The current block

Your screenshot shows

"blocks" : 737143

That gives you the information you seek.

How do I know which block I'm in?

I don't know what you mean by that.
You aren't ever in a block, but you are only ever mining the next possible block. The one whose block height is 1 more than the last block mined.

how to know how many blocks are left for me to mine 1 whole block by myself?

You can only mine the next block. One that is a descendent block of the last mined block. (by which I mean a block that contains a reference to the block-ID of the block most recently mined by the Bitcoin network).
Beyond that are an almost infinite number of blocks to be mined.

Note that mining blocks in mainnet is a hopeless task unless you are using recent ASICs.


Can I connect a Yamaha Clavinova CLP-230 to a MBAir using USB cable?

Question: I tried, using a USB A to USB B cable but the computer did not recognize the Clavinova CLP-230 in Garageband. Not sure where I am going wrong? Tried a different cable but still no luck. OS 10.13
Comment: First, have you looked at the Yamaha website for manuals and downloads? I would imagine the manual will tell you if it is Mac compatible. Second, what macOS version is on your Mac? Finally, What is the model number of the Clavinova? Please add **ALL** of the answers to your original post (not as a comment)
Answer: You'll need to install the Yamaha USB-MIDI driver first:
https://dk.yamaha.com/da/support/updates/usb_midi_driver_for_mac.html
This driver works across all the Yamaha Clavina models with USB port for MIDI.
When you have installed the driver, reboot the Mac and insert the USB-cable from Mac to piano. Then turn on the Piano. Finally start GarageBand, and the new MIDI device should be available for use.


Who should write e2e tests?

Question: I understand that preparing test cases and scenarios that goes through the whole system stack should be written by a QA person. But my question is with automating these tests, and I mean specifically e2e tests. Who should be responsible for the implementation of e2e tests, is it developers? or qa engineers? and why?
Comment: Why do you believe that "preparing test cases and scenarios that goes through the whole system stack should be written by a QA person"? I do not believe that to be generally true. However, let's assume that it is true. Who is responsible for executing those test cases? Now consider automation as a form of execution test cases. If automation is execution, who should be responsible for automation?
Comment: QA has its own set of skills, and writing test cases to cover all possible considerations of a specific feature is one of these skills that is not necessarily as sharp in a developer. I also believe that the answers to your questions is also QA person. So QA person should write test case, execute it (manually or automated), and then report to devs if needed. This is the full QA cycle as I see it.
Answer: Test automation can be as complex as writing the application it tests. How you write automated tests determines who writes the tests, because of the different skills involved.
If using a GUI tool to create tests, programming skills become less important. This increases the number of people qualified to write these tests, which usually means "not the developers or QA automation engineers." This tends to be done by manual QA testers who have fewer technical skills.
If practicing Behavior Driven Development, a business analyst or product person writes the tests in Gherkin. Developers or QA automation engineers would create the testing infrastructure code that implements the Gherkin step definitions.
You can, of course, write the test cases in whichever programming language your team is comfortable with. Developers or QA automation engineers would then write the test cases and infrastructure code for the tests.
Who writes the automated tests depends on the skill set your team has and how you choose to write the tests — and how you choose to write the tests depends on the skill set of the team.
Answer: The idea that a QA person must prepare test scenarios and cases and then execute those cases is not generally true. Although some organizations are structured this way, only a small number of the most critical systems require a dedicated QA person to do this type of work, and even then, the trend is to have others do this as well with the QA team providing an extra layer of security and to meet compliance rules.
For the vast majority of development, the team, as a whole, should be responsible for quality activities. It may be helpful to have various QA specialists - people who have special skills around analyzing requirements for testability or identifying test cases or exploratory testing or test automation frameworks - on the team. However, the existence of a specialist doesn't mean that all of the work must be done by this individual. Instead, they exist to teach the rest of the team how to have these skills in sufficient amounts to be able to produce a quality product and to review the work of people who may not be as proficient in these areas.
Unless you have specific regulatory constraints, I would suggest that anyone who is a developer should learn the test automation framework and tools and be able to write automated tests. In a larger organization, it may also be useful to have a team (or perhaps the team of QA automation specialists attached to development teams) ultimately responsible for decisions pertaining to the test automation tools and frameworks, but that doesn't mean that they are responsible for creating and maintaining all of the automated tests.
I would also point out that just because the ideal state is that the developers help out, to some extent, with test automation doesn't mean that your organization can support this. Some organizations aren't set up to have cross-functional teams in this manner, especially if the performance of the developers is measured by shipping features (or bug fixes). There could be shifts at an organizational level needed to enable this kind of collaboration and whole-team mindset.

Who should write e2e tests?


Castle Windsong in a book that sings when the wind blows

Question: There was this cool castle in the book, I think it was like a giant harmonica when the wind blew it sang and they called it Castle Windsong.
Answer: Possibly The Harp of Imach Thyssel (1985) by Patricia C. Wrede, the third book in the Lyra series. There is a castle called Windsong there that makes music.

The harp had been lost for centuries until Emereck the minstrel stumbled across it in an abandoned castle. Emereck wished it had never been found at all - for all magic has its price. Nonetheless, it was one of the greatest treasures in the world of Lyra - for its music could make a dying man whole or a whole city die, according to the songs of old.
Comment: Now that you mention Lyra I remember Lyre being used in the book as a synomym for a type of instrument either a lute or harp possibly.
Comment: The old Star Wars Jedi Academy Trilogy introduced the planet Vortex Cathedral of Winds. From Wookipedia: "The center of the Vor's society was the Cathedral of Winds, a building that resonated with tones as the planet's strong winds struck it." It was key parts of 2nd & 3rd books regarding Ackbar plot.


Can a Vampire fall unconscious due to physical damage without entering torpor?

Question: Just what the title ask. Can a Vampire fall unconscious due to physical damage (bashing, lethal or aggravated) without entering torpor, like being hit in the head? What are the rules for it?
Answer: You need to be at Incapacitated with enough blood to heal yourself conscious.
When a mortal takes enough health levels of damage to become Incapacitated, they fall unconscious. When a vampire takes that many health levels, they either spend one Vitae to heal themselves to Crippled or, lacking that blood, fall into Torpor. It's possible to lose consciousness during this period of being Incapacitated — Sabbat mass embraces are described this way:

This infamous method consists of collecting a number of victims, Embracing them with the tiniest quantity of blood possible, bashing them over the head with a shovel (to knock them unconscious before they frenzy), and burying them in a mass grave. The newly Embraced Cainites rouse quickly, and they must dig themselves out of the grave to sate their frenzy, often at the expense of the weaker vampires entombed with them.

So there's a period while being Incapacitated where one can "be unconscious" without falling into Torpor. However, there's no equivalent to the "knock on the head" where you're unconscious without having your damage boxes full of damage. (Certain disciplines can do it, but they're exceedingly rare -- Daimonion 2 and Auspex 8)
Comment: So, they can't be unconscious without losing all health levels, right?
Comment: That's correct. If you want to have a vampire taken out without rendering him near-torpid, stake him.
Comment: Maybe this is house rules, but I believe that when you suffer health levels equal to your stamina (plus Fortitude, I suposse) you are stunned (can only take defensive actions?) and when you suffer more heath levels than your stamina you are knocked out. Could it be?
Although a good question is... how much time are you knocked out?


Why doesn't the execution of a function of my contract in a network other than the main network of my contract give an error?

Question: I have come across a strange problem. My contract is on the Polygon network, but for example, when I connect to Metamask with the Binance network and run a function of my contract, it is done successfully. while it should throw error or a warning, should it? I should Handle this in the client ?
Answer: Yep, the client should make sure it's connected to the right network. The reason calling a function from your contract on another network doesnt throw is because theres no contract deployed on the other network, and when you send a transaction to an EOA, the calldata is simply ignored. You could deploy an empty contract at the same address (the deployment address of a contract is a function of the deployer address and the nonce, so you can perfectly deploy a contract at the same address on 2 different networks) to prevent this from happening
Answer: Yes, must handle it in the client. MetaMask is sending a transaction to an (probably) inexistente account on Binance Smart Chain. MetaMask has no way of knowing that your contract is on Polygon.


Fantasy novel series; one of the books has a general with eagle-like features on the cover

Question: I'm looking for a series of fantasy novels I read in the '90s. One of them had the following cover featuring a general with eagle-like features, who was one of the main characters.
Note that the image below is a tracing of the cover.
Comment: Hi @LogicDictates, I hoped that I recalled more. I stumbled upon the image, which I traced at the time from the cover, and that gave me some hope of finding it.
Comment: Hi, welcome to the site. We could really use some more info to help us identify this series. Please [edit] your question to describe the plot and any prominent characters, in as much detail as you can recall.
Comment: https://www.goodreads.com/book/show/176844.The_Eagle_the_Nightingales?
Comment: looks like it could be [Enki Bilal](https://www.google.com/search?q=enki+bilal+eagle&source=lnms&tbm=isch&biw=1622&bih=848) work.  Did the guy have Soviet/Eastern Bloc look too?  Or something based on Egyptian goods?
Answer: I think this is "El Devastador", book 3 of the series "El Reino de los Dragones" by "Richard A. Knaak". The cover image matches the tracing both in general pose and down to details such as the three-fingered hand with one slightly bent finger.
The original title of the book (which features different cover art) appears to be "Wolfhelm", from the (first) "Dragonrealm" series.

After having no success with many combinations of related terms in English (e.g. general/major/character/...; eagle/buzzard/hawk/falcon/...), I decided to broaden my search into other languages. Eventually, googling for

libro fantasia aguila general

brought up a cover image of this book.
Comment: Well done!  ISFDb doesn't have the best coverage of translations, but that art is [noted as used](http://www.isfdb.org/cgi-bin/title.cgi?1981837) for a 2014 omnibus of the first three books.
Comment: You have to admit the spanish title is MUCH better than the original.
Answer: The closest I can come to that particular image is the 1995 Baen imprint of The Eagle & the Nightingales by Mercedes Lackey, as seen here:

It's the 5th book in a series, but the bird seems to be lacking enough clothing for it to be the right pick, might be worth a look regardless.
Comment: I did consider posting this as an answer (rather than a comment) but I couldn't find a relevant book cover, noting that OP *traced* it from the original. This one comes closest, but it's not the same; https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1178878474l/848558.jpg
Comment: Also, the birdman character in that book is not a general, but an ambassador / bard.


Ways to implement an own registration process

Question: I want to start a project and first I check the technical feasibility. I want to implement a login area. There a lot of people can registrate and have the possiblity to work with an interactive mindmap. The data should be evaluated (inputs, tracking) in Salesforce. After the registration a lead should be created automatically. It's not required that everybody who want's to registrate have to posess an own licence. Is it only possible with a third party system (external web portal), which can communicate with Salesforce with the REST API or exists another way to solve the problem with minimal effort?
Thanks for your help!
Answer: I believe you can use Salesforce Portal licenses or Salesforce Community Licenses or guest profile to perform that logic or you can use full-licensed one dedicated API-Enabled user for all of your communication.


What is the correct way to use a Symfony bundle?

Question: I want to use https://github.com/KnpLabs/KnpSnappyBundle in a Drupal 8 project. How do I correctly use it?
Answer: Drupal 8 isn't using Symfony bundles, only some Symfony components. Therefore you should use https://github.com/KnpLabs/snappy instead of bundle you've mentioned. You should install it using composer and then use available classes in your Drupal code. If you want to create PDF-generation service, you should follow official Drupal documentation.
Answer: I can't speak to configuring it as outlined in their documentation, but the typical way of using external packages is to install them with Composer, then one of these scenarios:

Define a custom service in your module that injects that bundle as an argument
In some cases, you could use new ClassName(...) if thats how that package works
Inject it from the container in your own classes create/construct method

Here is a more advanced method I wrote about some time ago about taking an external package and configuring it BEFORE it is injected to your class/service:
https://kevinquillen.com/dependency-inject-php-classes-drupal
This might be more in line with what you need to do, since you do not have the Symfony config.yml/app.yml their documentation alludes to for Symfony apps, and you have a need to configure the service as it is injected. This also works for packages that have config methods but are framework independent, like Solarium is.
As Milos also mentioned, this seems like the package you are looking for: https://github.com/KnpLabs/snappy


Number operator - annihilation operator commutation

Question: Is there a rigorous way to prove that
$$
(N+1)^{-1/2} a = a N^{-1/2}
$$
where $a$ is a bosonic annihilation operator and $N=a^\dagger a$ is the corresponding number operator?
Answer: Consider the action of the two operators on an arbitrary number state $|n\rangle$:

for the left-hand side,
\begin{align}
(N+1)^{-1/2}a|n\rangle
  & = (N+1)^{-1/2}\sqrt{n}|n-1\rangle
    = \sqrt{n}(N+1)^{-1/2}|n-1\rangle
\\& = \sqrt{n}(n-1+1)^{-1/2}|n-1\rangle
    = \frac{\sqrt{n}}{\sqrt{n}}|n-1\rangle
\\& = |n-1\rangle,
\end{align}
whereas on the right-hand side
\begin{align}
aN^{-1/2}|n\rangle
& = a \frac{1}{\sqrt{n}}|n\rangle
  = \frac{1}{\sqrt{n}} a |n\rangle
  = \frac{1}{\sqrt{n}} \sqrt{n} |n-1\rangle
\\& = |n-1\rangle.
\end{align}

Since the two operators agree on a basis, they are equal as operators.


Why does the use of symlinks in /system gradually erode available space?

Question: I am working on a routine for swapping dictionaries on an e-reader (Nook Simple Touch--Android 2.1). I've got the shell commands nailed down and have constructed an app using Tasker. It all works great except that after a few dictionary changes the amount of available space in /system (where the dictionary databases are) decreases to the point that the stock dictionaries cannot be restored to their original place.
I start by moving the stock databases from their default location to a directory where all the dictionaries will be stored. One option is in /data/media and the other on the sdcard. Both appear to work fine. Once those are out of the way, symlinks are created to replace them, referring to databases in the dictionary storage directories. This is the general sequence in terms of shell commands:
adb shell ln -s "'/data/media/B&N Downloads/Dictionary/en-de.db'" /system/media/reference/basewords.db
adb shell ln -s "'/data/media/B&N Downloads/Dictionary/inflect-de.db'" /system/media/reference/inflectedwords.db

or, for the /sdcard storage option:
adb shell ln -s "/sdcard/Dictionary/en-de.db" /system/media/reference/basewords.db
adb shell ln -s "/sdcard/Dictionary/inflect-de.db" /system/media/reference/inflectedwords.db

These changes require a reboot to take effect.
To remove the symlinks in preparation for a different dictionary or before restoring the stock dictionary to its proper place:
adb shell rm /system/media/reference/basewords.db
adb shell rm /system/media/reference/inflectedwords.db

As I say, it all works fine except for the disappearance of available space in /system to the eventual point that you cannot restore the original dictionary.
Before doing any of this stuff I typically have about 80% of /system used. There should be about 55 mb still available (that's with the stock dictionaries in place). But after several dictionary swaps I show about 89% full and down to around 30 mb available. Restoration of the stock dictionaries requires about 57 mb available space.
I've looked through /system trying to find something "new" that is taking up space but have not been able to find anything.
I've never seen this issue addressed anywhere. I'd be grateful for some input.
Comment: you are probably wasting inodes or left file system dirty. /system is read-only partition reserved for ROM only, no userspace files (or symlinks) must saved there. userdata partition is mounted /data
Answer: Thanks to the comment from alecxs and additional research in that vein, I have arrived at a solution for at least my instance.
It is stated elsewhere that removing files which are being used by running processes will cause a loss of available inodes. Although I can't claim to understand all the inode nuances, this made me look at the background processes on the e-reader. One, com.bn.nook.reader.activites, has its tendrils in the dictionary. I therefore tried:
adb shell pidof com.bn.nook.reader.activities
This returns a four-digit number which I use as:
adb shell kill [pid]
Then I proceed to do my operations with the database files, including moving, deleting, creating symlinks, deleting symlinks, restoring the original files, etc.
It all works with only the expected changes in /system available space at each juncture. No data appears to be lost by killing the background process and the reader function starts up right away when a book is accessed with the new dictionary immediately accessible, no reboot required (a bonus).
So before every change from the Dictionary Management app I just get the pid and kill the background process. Works like a charm!
Thanks again, alecxs!


Create a Contact History report that shows only one row

Question: I created a report on Contact History and I summarized the report by Contact Id. I need to use the Edit Date of that report to mass update records but the summary shows multiple lines from when the record was edited.
What can I do to the report so only the latest date shows? Only one line per Contact Id.
I was thinking about a formula but I don't know what kind of formula I can create, I don't have many options.
Thanks in advanced.
Answer: I'm not sure if you're limited to a report, but if you have the ability to use SOQL/APEX, then this should get you the information you want:
SELECT Id, (
    Select OldValue, NewValue
    FROM Histories ORDER BY CreatedDate DESC LIMIT 1
    )
FROM Contact

So you might do some anonymous apex like so:
List<Contact> contacts =
    [SELECT Id, (
    Select OldValue, NewValue
    FROM Histories ORDER BY CreatedDate DESC LIMIT 1
    )
    FROM Contact];

for(Contact c : contacts)
{
    if(c.Histories.size() == 1)
        // Do something more useful than this
        System.debug(c.Histories[0].OldValue);
}

Comment: LyBer, Thanks for the update. The only issue is, I need to exclude 2 users that edited the records, API User and Data.com User.
Data.com doesn't have a UserId so I can only exclude that user by the alias. and I don't need the OldValue and NewValue but the EditedDate and EditedBy fields. I tried using workbench but I am limited to use Contact History and I don't get the Contact information when I do that. Any other way you can think of doing this using Apex?


Finding torque equation for my robotic arm

Question: I am designing a 5 dof robotic arm, and for that I would like to find a torque equation. However, I am a little confused here:
According to me the torque equation for M1 should be l2m2+l3m3+l4m4+l5m5 (m is mass of motors)(plus mass of link on their COG) but as these things will rotate so am I suppose to take their inertia or their mass?
Answer: It's actually quite a bit more complicated than that.  You need to take into account not only the lengths and masses of each arm (and joint), but also what velocities and accelerations you want to support.
This paper provides a graded approach to understanding robot arm dynamics, starting with a simple dual-link arm.


How to update Xcode?

Question: A mac newbie question: I have an older version of Xcode and want to update it to a newer version. How do I do that?
Comment: For the command line tools, this answer is also very good: https://stackoverflow.com/a/34617930/2776727
Answer: Just an extension to this. I'm using OSX Lion and you can install/update via the App Store.
Comment: It is possible to create an account **without** providing a credit card, but it must be done in a very specific way: http://support.apple.com/kb/ht2534 I did it way back when and I'm able to download (free) apps from the App Store without a credit card.
Comment: Unfortunately you need to provide your creditcard number to enable updating though the App store... In that case, I'll just download it from the website.
Answer: To update Xcode, sadly, you have to download the entire .dmg file from Apple's website again.
Comment: It depends now. Xcode 4 (via Lion) is supposed to now do delta updates that are much smaller. Unfortunately, this hasn't come up in practice yet for an installation - there has only been a single 4.1.1 update that was just an installer fix. For Xcode 3, you need to download the whole .dmg again. It's not 10 GB - it's just 2 or 3 :P
Comment: @b.long No you cant. You still need to install each version differently. Especially if you have developer previews or betas installed. I just tried it and I have probably 10 different versions of xcode installed as a result. This has to be the single dumbest thing apple has ever done.
Comment: Seriously? Like all the 10 giggs + again?
Comment: Just downloaded, thanks for the info. I guess there are some strong downsides of doing incremental updates but hopefully they can work something out in the near future.
Comment: Although this likely _was_ the correct answer when the question was originally asked, today you can update via the App Store, per this answer: http://stackoverflow.com/a/12065167/320399
Answer: I recommend installing into a different folder in the root of your hard drive. I have had problems in the past, not with this specific upgrade, that were fixed by doing a fresh install.
Comment: I've never heard of this issue, but if it's a concern, you're better off uninstalling your previous version before installing rather than having two different point versions of developer tools on your system. That said, upgrading Xcode has been pretty painless for any recent build I've used.
Comment: Right now I have 2.5, 3.1.4, 3.2.4, 3.2.5, 3.2.6, 4.0 installed on my main development machine. The problem I was referring to was somewhere in the Xcode 2.x (Panther or Tiger version of the OS) when you could only have one blessed Developer folder on your system and I forgot to uninstall first, so I renamed the old folder and did a "fresh" install. If I continue on for another couple of weeks without any problems running 3.2.6 I'll remove the other 3.2 versions.
Answer: On Mac open the App Store and look for an Xcode update. You may need to update OS X first if, for example, there was an update to Command Line Tools (see also xctool) required by the Xcode update.
Answer: In my case, when I cannot see it in the AppStore Update section I searched for it in the AppStore and once I saw Xcode in the search results it displays a button below it saying "Update" if you are not in the latest version.
Answer: I upgraded from 10.7.5 to 10.11.5 on my pro and it rendered my old Xcode (4.4.1) unusable on the new OS. I had to download a new version from App Store. I guess the update feature is not enabled yet in Xcode 4 (as @Dominic mentioned)

How to update Xcode?


Difference between a View's Padding and Margin

Question: What is the difference between a View's Margin and Padding?
Comment: Padding is inside of the border, margin is outside. See the [W3C Box model](http://www.w3.org/TR/CSS2/box.html) for details. [This blog post](http://www.goer.org/HTML/intermediate/margins_and_padding/) is much more readable, though :-)
Comment: this is the same as HTML, see here for more http://stackoverflow.com/questions/2189452/when-to-use-margin-vs-padding-in-css/5888753#5888753
Comment: This may be helpful [Declaring Layout](http://developer.android.com/guide/topics/ui/declaring-layout.html#SizePaddingMargins)
Comment: See my answer on similar question https://stackoverflow.com/questions/21959050/android-beginner-difference-between-padding-and-margin/46649472#46649472
Answer: To help me remember the meaning of padding, I think of a big coat with lots of thick cotton padding. I'm inside my coat, but me and my padded coat are together. We're a unit.
But to remember margin, I think of, "Hey, give me some margin!" It's the empty space between me and you. Don't come inside my comfort zone -- my margin.
To make it more clear, here is a picture of padding and margin in a TextView:

xml layout for the image above
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="#c5e1b0"
        android:textColor="#000000"
        android:text="TextView margin only"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="#f6c0c0"
        android:textColor="#000000"
        android:text="TextView margin only"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#c5e1b0"
        android:padding="10dp"
        android:textColor="#000000"
        android:text="TextView padding only"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#f6c0c0"
        android:padding="10dp"
        android:textColor="#000000"
        android:text="TextView padding only"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="#c5e1b0"
        android:textColor="#000000"
        android:padding="10dp"
        android:text="TextView padding and margin"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="#f6c0c0"
        android:textColor="#000000"
        android:padding="10dp"
        android:text="TextView padding and margin"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#c5e1b0"
        android:textColor="#000000"
        android:text="TextView no padding no margin"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#f6c0c0"
        android:textColor="#000000"
        android:text="TextView no padding no margin"
        android:textSize="20sp" />

</LinearLayout>

Related

Gravity vs layout_gravity
Match_parent vs wrap_content
Answer: Padding is the space inside the border, between the border and the actual view's content. Note that padding goes completely around the content: there is padding on the top, bottom, right and left sides (which can be independent).
Margins are the spaces outside the border, between the border and the other elements next to this view. In the image, the margin is the grey area outside the entire object. Note that, like the padding, the margin goes completely around the content: there are margins on the top, bottom, right, and left sides.
An image says more than 1000 words (extracted from Margin Vs Padding - CSS Properties):
Comment: The answer is for HTML/CSS, the question was about Android. Android's view model is inspired by HTML, but not identical. For one thing, the border is not a first-class sizable object there.
Comment: NOTE: In Android, the layout_width property includes content and padding. (In HTML, the css width property refers to content width only.)

As Seva said, Android has no built in concept of borders. You can use a 9-patch png background or an xml vector drawable to add a border in Android.
Comment: It's also worth noting that the background is modified based on the margin but not the padding (in Android.)
Comment: In Android, what is here referred to as the "border", is actually the 'view container'. This should clarify things a bit I would hope.
Comment: In general I'd agree with the saying about the image and 1K words, but here the legend destroys clarity. Instead, the word Margin could be inside the blue region, and the word Padding inside the yellow region. Then the saying would apply. For now, the textual analogy with the coat in the accepted answer is, for me, more clear than the image here, in much less than 1K words :-) In fact, the image is even wrong. The white around the text Content is part of Padding.
Answer: Padding is inside of a View.
Margin is outside of a View.
This difference may be relevant to background or size properties.
Answer: Padding is within the view, margin is outside. Padding is available for all views. Depending on the view, there may or may not be a visual difference between padding and margin.
For buttons, for example, the characteristic button background image includes the padding, but not the margin. In other words, adding more padding makes the button look visually bigger, while adding more margin just makes the gap between the button and the next control wider.
For TextViews, on the other hand, the visual effect of padding and margin is identical.
Whether or not margin is available is determined by the container of the view, not by the view itself. In LinearLayout margin is supported, in AbsoluteLayout (considered obsolete now) - no.
Answer: Below image will let you understand the padding and margin-
Answer: Padding means space between widget and widget original frame. But the margin is space between widget's original frame to boundaries other widget's frame..
Answer: Padding
 Padding is inside of a View.For example if you give android:paddingLeft=20dp, then the items inside the view will arrange with 20dp width from left.You can also use paddingRight, paddingBottom, paddingTop which are to give padding from right, bottom and top respectively.
Margin
Margin is outside of a View. For example if you give android:marginLeft=20dp , then the view will be arranged after 20dp from left.
Answer: Padding is the space inside the border between the border and the actual image or cell contents.
Margins are the spaces outside the border, between the border and the other elements next to this object.
Answer: Sometimes you can achieve the same result by playing only with padding OR margin. Example :
Say View X contains view Y (aka : View Y is inside View X).
-View Y with Margin=30 OR View X with Padding=30 will achieve the same result: View Y will have an offset of 30.
Answer: Let's just suppose you have a button in a view and the size of the view is 200 by 200, and the size of the button is 50 by 50, and the button title is HT. Now the difference between margin and padding is, you can set the margin of the button in the view, for example 20 from the left, 20 from the top, and padding will adjust the text position in the button or text view etc. for example, padding value is 20 from the left, so it will adjust the position of the text.
Answer: In addition to all the correct answers above, one other difference is that padding increases the clickable area of a view, whereas margins do not. This is useful if you have a smallish clickable image but want to make the click handler forgiving.
For eg, see this image of my layout with an ImageView (the Android icon) where I set the paddingBotton to be 100dp (the image is the stock launcher mipmap ic_launcher). With the attached click handler I was able to click way outside and below the image and still register a click.
Answer: In simple words:

Padding -  creates space inside the view's border.
Margin - creates space outside the view's border.
Answer: Margin refers to the extra space outside of an element. Padding refers to the extra space within an element. The margin is the extra space around the control. The padding is extra space inside the control.
It's hard to see the difference with margin and padding with a white fill, but with a colored fill you can see it fine.
Answer: In simple words:
padding changes the size of the box (with something).
margin changes the space between different boxes
Answer: Padding is used to add a blank space between a view and its contents.

Margin is used to add a space between different views.

For both padding and margin, we have two way to set those,

setting all sides with equal value
setting side specific values as per requirement

All sides with equal values:
You can use android:padding="15dp" for setting padding of 15dp all the sides
and  android:layout_margin="15dp" for setting margin of 15dp all the sides
Sides with specific values:
Padding

android:paddingBottom Sets the padding at the bottom edge
android:paddingStart Sets the padding at the start edge means at the left side of view
android:paddingEnd Sets the padding at the end edge means at the right side of view
android:paddingTop Sets the padding at the top edge

Margin

android:layout_marginBottom Specifies extra space on the bottom side of this view.
android:layout_marginEnd Specifies extra space on the end side, means at the right side of this view.
android:layout_marginStart Specifies extra space on the start side, means at the left of this view.
android:layout_marginTop Specifies extra space on the top side of this view.


Dynamically build GUI based on model

Question: i have a question regarding the dynamic coposition of a GUI with respect to the data that this GUI should display. is there any kind of best practice or pattern how to dynamically build a GUI and still maintain a clean seperation of concerns / layering strategy?
here is my business case: i want do wirte a tool for creating a large number of random sharepoint list items i a sharepoint list. therefore i want to provide the tool the list URL. the tool will then query the list and provide a text box to enter a set of random values for every list column. since the colums vary from list to list, i cant buld a static UI / view. i have to build this view dynamically after getting the list information.
my current idea is to buld some kind of presentation logic, that reads the list metadata and then creates the textbox controls with respect to this metadata. this could happen in some kind of event handler.
thinking in the direction of MVC i dont got a static view which is (common) in MVC in my situation. would it be good design if the view examines the list metadata in its initialising routine, then builds the input controls (textboxes) dynamically and then binds / links them to the corresponding list columns?
Thanks for your feedback and best regards
Patrick
Answer: Sounds very much like the Naked Objects approach:
http://en.wikipedia.org/wiki/Naked_objects
However, your data layer (including the database) would need to be very well designed i.e. would need to relate to the problem domain.
Answer: Give my project FormFactory a whirl.

Dynamically build GUI based on model


In SharePoint 2013 how can I set up a Two-Way Auto Sync connection between 2013 excel file and sharepoint

Question: I am using Sharepoint 2013 , and there is a excel(2013) file with in the Sharepoint. I want to create a list by using some columns in the excel sheet, so after creating the list i want two way sync between the list and excel file ... i.e if i make any changes in list should appear in excel file and viceversa. Is there any way to do this? please comment your views.
Answer:
There are several ways to synchronize data between a SharePoint list
  and a spreadsheet program. Whichever way you choose, this
  synchronization is one-way, or unidirectional. Changes made in the
  SharePoint list can be written to the spreadsheet program, but any
  changes that you make in the spreadsheet program are not written to
  the SharePoint list.
To synchronize a SharePoint list, you must have a compatible
  spreadsheet program, such as Excel 2013, installed on your client
  computer, and you must have read permission to the list.

Synchronize a list with a spreadsheet program
But to over come this, You can use add in called "Synchronizing Tables with SharePoint Lists". What the add in does is it allows us to synchronize a SharePoint list with an Excel file.
Read complete here:http://sharepointrhapsody.com/2013/04/02/connecting-an-excel-sheet-to-sharepoint/
Comment: Thank you Waqas for your response, i am using ADD IN but it  is not working fine with excel 2013. is there any chance to write a code behind in visual studio and deploy to make this sync work?.


Refinishing wood floor

Question: We had our floors refinished and there are still separations between the boards. The company claims that it's due to the original installation of the floor and are not fixing it any further. Is it possible to fill the holes with something that doesn't need to be finished or sanded? The guy recommended painters putty, does anyone have experience with that? Other solutions?
Comment: Not an answer but just discussion. I have cracks like this too. Putty doesn't last. The bigger the crack the worse it falls apart. But I saw an episode of This Old House where the put strands of rope in between cracks of a wooden floor. But I think those were wide boards not tongue and groove hardwood. Is this an option for tongue and groove?
Comment: @JoK If the linked Q&A doesn't help you, please update this one with additional details to help distinguish them and to enable anyone answering to provide you with specific help. Thanks!
Answer: Painter's putty would work, but I don't know if it'd be your best option.
First of all you'd need a ton of it to fill between every piece of flooring. Also, unless your going to use it after you put the finish on your floor, I'm not sure that the stain or lacquer wouldn't dissolve the putty.
Unfortunately, I don't know what would be your best option, but I couldn't imagine that you should entertain the notion of painter's putty. I could be wrong, though...it certainly has happened before.....once...ha
Answer: Those gaps are never to be filled. The seasonal movement of wood will squeeze the putty back out of the gaps. Next heating cycle, the flooring will shrink again and will show the gaps again, looking something like the ragged edges your pictures show. Somebody tried filling the gaps already.... at least that one....
Comment: Yes, the gaps were filled two days ago. I can't imagine the cycle of shrinking and expanding has already happened. It was surprising to see these cracks immediately after the floor was refinished. Any thoughts on that?
Comment: @JoK the floor probably has some slight give in it which makes the boards move as they are walked on. All it takes is for someone to walk on the floor before the putty is completely cured to crack it. Standard wood putty will never hold up in this situation. There are latex based stainable caulks which might work in this situation. I have never tried it myself, but it could work in theory, You could try it in a small area prior to the wood stain being applied and see how it looks.
Comment: Wood is going to move, that is what it does, there is not stopping it, only ways to control it. Wood filler does not control it, especially as Jo K pointed out, it appears since the floor was puttied a few days ago, there is movement of the floor under foot. Another reason the gaps are not puttied. The only gaps I ever seen puttied were at the ends of the flooring where it joined the next piece. Wood changes dimensions in its width or thickness depending on the orientation of the growth rings, very little in its length.
Answer: Wood filler can temporarily fill anything, even the annoying gaps that run parallel to the long edges of your floor boards.  But the size of those gaps changes all year long and the wood filler in those gaps isn't elastic enough to swell and shrink with the seasons and so will just get pummeled and eventually break up.

Refinishing wood floor


PHP MapScript API Development for MapServer

Question: PHP MapScript Tutorial
I'd like to use the PHP MapScript API and am curious how others have successfully used it to produce a site that serves up remote sensing data.  I've got land surface temperatures, emissivities, and reflectances I'd like to share via a mapserver.  I've already installed mapserver on an apache webserver and have also installed the MapScript shared library.  What is a good development environment to use for PHP MapScript development?  Any example sites that use PHP MapScript people know of?  How useful is the MapScript API and how easy is it to use?  Thanks in advance!
Answer: I will try to answer to each question separately, starting from the development enviroment: I guess any IDE that supports php will work for PHP mapscript development. I can't suggest any because I don't use php, just google 'php ide'.
As for example sites I should point you to the two most popular Open Source web applications built with PHP/mapscript:

p.mapper : probably the best one, actively mantained and with the most comprehensive feature set
cartoweb : outdated, still pretty good (for learning the api at least)

With regards to your last question I think that the Mapscript API is probably not the easiest to use, mostly because it's very powerful and documentation still has to catch up for some areas that have recently changed. Other than that I think an average developer should be able to be up and running within days and, if there are any problems, the mailing list and the #mapserver IRC channel are both active.
Comment: But would you suggest not using the MapScript API?  I like that it's powerful but not that it's hard to use.  I know there are other SDKs out there besides MapServer as well.  I'm looking at your suggested example sites now.


how is the esterification of amino acid carried on in this reaction

Question: i was asked to synthesis this compound from this amino acid, i first alkylated the alpha carbon using enolate alkylating method then i esterficated the amino acid but i'm doubtful that my steps are right, do i need to protect the amino group in the esterification step? or even before ?
Comment: I don't think your alkene hydration will work on the unprotected amino acid
Answer: I think you need a protection strategy and there are several choices. This one uses O'Donnell's benzophenone imine strategy details here.
First you prepare glycine ethyl ester hydrochloride from glycine with EtOH/HCl, a method is here patent.
From the ethyl ester hydrochloride prepare the benzophenone imine by O'Donnell's method as described in ref 1. This gives a protected species that can be easily alkylated under phase-transfer conditions with allyl bromide as described in ref 1
The allyl product is then epoxidised (MCPBA) and the epoxide opened with iodide procedure here
Deprotection with acid hydrolysis gives your target molecule.


Is it cost effective to use a solar panel in an apartment if I have a low electricity bill?

Question: I would like to be more sustainable and I am thinking of installing a solar panel on the roof of my apartment, my question is how cost effective I will be knowing that my current electricity bills are low (something about 50 USD per month) and the cost of solar panels are considerably high. Or shall i use solar heating only?
Comment: There are online calculators that allow you to put in your location, roof angle etc. and calculate how much power will be generated. You don't say where you are and they tend to be regional so I haven't found one for you. Unless you can get a tariff that credits you for electricity returned to the grid, you need to consider how much electricity you'll use when the sun is shining.
Comment: JZF can you provide your location? Local conditions and regulations will very much determine the cost-effectiveness
Comment: Thanks @THelper . I am in Stockholm - Sweden (I know, it is not the best place to use PVs !)
Comment: Can we know your average power consumption? You should have the monthly use available on the bills, with luck even the daily power use. I'd like to calculate things for a more detailed advice. :)
Answer: The amount of power you consume/power costs are surprisingly unrelated to the cost effective-ness of solar power. To be more accurate, they are "slightly" related.
When you install a solar panel you will start generating power. Then there will be four things that can happen.

excess power will go directly towards your power supplier.
excess power will be stored in some sort of battery and once this is
full, direct the rest to the power supplier.
excess power will be lost
Excess power will be stored in some sort of batter until it's full
and the overflow will be lost.

Selling to the supplier
What does it mean when power goes to your supplier? It means they will pay you for your excess power. This means that your solar panels may generate you profit. The thing you should note is that you will receive less money for the power you send to the supplier than the costs to receive power from the supplier. This is why it's always in your best interest to have a battery to power your house at night and rainy days.
This is why your electricity bill doesn't really have an impact on the effectiveness on the solar panel.
In the optimal situation, you will have a battery that will nearly always have power stored in it. This means you will never receive an "electricity bill". Instead you will receive money from this bill.
So I would advise to calculate how much sun/power you can produce with a solar panel at your location. Then inform yourself on how much power you use, get a battery that can hold x amount of power for Y hours/days. If you have good connections with your power supplier you will be able to strike a good deal on selling them power.
Note: you will be selling power, this will be a form of income, so I don't know to what degree income taxes are involved.
calculating effectiveness without selling
If you cannot sell to your supplier (see @Thelper's comment). Then you'll want to calculate this to be more efficient.
Many solar panels can only supply you with a certain amount of power per hour/day/month. What you'd want to calculate is how much you use during your "light" hour and how much you use during your "dark" hours. The larger your battery is, the less accurate you need to be with your calculations. Assuming you have a gigantic battery you will want to calculate how much power you use within an average day/month. And then look for a solar panel that can provide these amounts at your location.
Expect to need more power during the winter and less power during the summer.
Look at the time period you wish to start benefitting from your solar setup. Chances are that you may not be able to get back the amount you invested until year X. Especially if you can't sell to your provider.
Comment: [Net metering](https://en.wikipedia.org/wiki/Net_metering) regulations vary widely from country to country, so without knowing the location of the OP you cannot say if he/she can sell any excess electricity back to the utility company
Comment: @THelper Gosh dang it, I did not think of that. I'll be editing to add/cover that in the answer. :)
Comment: A fifth thing can happen: excess power will be used by electrical consumers that are turned on automatically and do useful work. Such ass a water heater. For how to do this, see [this question](https://sustainability.stackexchange.com/q/6521).


Deploy List Workflow in Production Environment

Question: I created list workflow using SharePoint Designer.
How to deploy my list workflow in Production environment?
Comment: (http://www.sharepointalex.co.uk/index.php/2012/10/converting-a-list-workflow-to-a-re-usable-workflow/) Can i use this link to convert list workflow to reusable workflow? If i did this i can save my workflow as template and deploy it in my Production Environment. Please suggest your thoughts..
Answer: You can try workflow import/export feature to deploy your workflow to your production environment.
Check the following link to import/export your designer workflow:
http://blogs.technet.com/b/wkng/archive/2012/08/21/exporting-and-importing-sharepoint-designer-2010-list-workflow.aspx
Answer: Use a migration tool like: DocAve, Metalogix, Quest, etc.
If you can't use a tool, then you have to do a manually:

Create a new workflow on the Production site with the same name.  Be
sure to add a fake condition and one fake activity.  This will
generate the standard workflow files.
Copy the XOML and RULES files from your workflow in Dev (open the folder in SPD2010 and copy these specific files).
Paste those files into the workflow folder you created in step 1.
Open the workflow again in Prod, and click through all the steps to reassociate each data point (simply click on the item, and it
will re-associate).
If you have any lookups like "Update List Item," then you'll need to manually edit the    XOML file in SPD or Notepad so that you
can find/replace the GUID of the associated list.  Of course, that
list must already exist on the Prod site, too.
When done, click Finish to publish the workflow with the copied settings, and it should now work.

Second is:
Using Save List As template option create List template then after upload this List template to Production Environment.
Comment: I am not having any migration tools. I tried copying workflow files from my dev site to prod site. Files are copied but it does not reflect when i open the workflow in prod site.
Comment: Check GUID of associated List and Task List.
Comment: Yes i verified GUID also. But i can see only the initial test conditions and actions which i gave before copying. Do i need to modify anything else?
Comment: Once you paste XOML and RULES files then save workflow don't publish.
Comment: Yes I saved the workflow files. When i opened the workflow after saving i can't see the updated workflow.


Zoom with camera in an animation

Question: Is it possible to animate zooming in on an object, or is moving the object the only option available to get it to appear closer to the camera?
Answer: You can animate Focal length in camera properties panel

Go to the first frame of you animation and insert a keyframe on the focal length, right click over the focal length and select Insert Keyframe value or press I)
Move to a different frame, change the focal length value and insert another keyframe.
Animation example
Answer: You can animate the camera, just as any object. For instance, it's perfectly possible to animate the focal length:

You can also animate the camera position:

As you can see, the zooming effects of these two options are different, and which one to use depends on what you want it to look like. You could also animate both position and focal length together, to make it look like zooming in while moving away or zooming out while moving closer.
Answer: Moving and keyframing has already been covered here but there a couple of other things that can help make this very easy to work with.

To start with, if you select the camera and press the Number Pad 0, the viewport display switches to the camera's view point.  You can also access this feature using the menu shown in the following image.

For now, if you move anything then the view will return to the normal viewing but in Orthographic mode, however! if you open the numeric panel using n or the tiny little plus tab that sticks out at the side of the viewport, you should see an entry named "Lock Camera To View".

When you have the camera selected and you activate the checkbox, you should now be able to move the scene around from the camera's point of view just as you would normally do if the camera wasn't selected, only now it's actually the camera that is moving.
It's very intuitive to use and works flawlessly for aligning the camera to your scene.  When you exit that mode by deactivating the checkbox and you move the view again, the normal viewing should return except that maybe it will be in orthographic mode which has no 3D perspective.
You can return to the 3D view by pressing NumberPad5 or by using the menu shown above where it says "View Persp/Ortho"
And the customary animated .gif.(Unfortunately I had to go fast because I kept exceeding the 2MB limit for file size uploads.)

If you find that you can only rotate the view but you can't really pan around very quickly then you need to reset the view.  This happens often with Viewport navigation and can be fixed with either NumPad . which zooms to the selected object or Shift+c which zooms to the entire scene.  That happened to me when I recorded the .gif.

Zoom with camera in an animation


Cracked egg leaves egg white residue. Should I worry about the other eggs?

Question: I had an egg crack in the carton and cover the other eggs with egg white. I consider the cracked egg a lost cause, but what about the splash damage? Are the eggs that have received an inadvertent egg white wash safe to eat?  Particularly, for someone who may be very vulnerable to infection?
Answer: If the egg actually exploded as in the title, then no, that egg is probably highly contaminated.  Not only is it bad, but nothing its contents have touched can be considered safe to use and should be discarded.
I assume however that you actually have an egg that was broken in handling.  In that case, only the broken egg is a loss.  Other answers and comments have addressed that, choice by location and your own personal sense of safe for you.  I hate wasting food, but eggs today are a relatively inexpensive commodity for most of us, so if you feel uneasy, error on the side of safety.
When an egg is only partially cracked, but the membrane is intact, that egg is normally safe for use for several days.  You have lost some protection, but not the immediate integrity of the egg.  One issue though is you do not know when it was cracked.  In your possession can be safe, my personal rule being about a week.  But if it already was cracked, I do not know if it happened before washing (in the US) or after.  If before, the egg is compromised.  Now, this is one spot that the EU with non-washed eggs are at a slight, very slight, disadvantage.  IMO, unwashed, a cracked egg is compromised even if the membrane is intact.  That paragraph is not exactly your question, but could be for people searching that find their way here.
Comment: Whenever an egg cracks so that egg white gets to the outside both the inner and outer membranes are broken and there is an entry path to the inner parts.
Comment: +1, although personally I hate to waste eggs even more than most other foods and don't consider them an inexpensive commodity, depending on how you measure the [cost](https://en.wikipedia.org/wiki/Chick_culling).
Comment: @cbeleitesunhappywithSX That was well beyond what the OP asked, but was strictly included as people come here via web search engines.  It does not apply to the details asked by this question, but related searches get here too.
Answer: Edit after the question was substantially changed. This answer wasn't initially concerned with the fate of the broken egg itself, but the others around it.
If the white 'exploded' bin it. If it 'leaked' then that egg is compromised. If you broke it, eat it today. If you don't know when it was broken, discard & treat the rest of this answer as it stood before you changed the question.
Don't wash European eggs.
US eggs already have had their natural protective layer washed off, so this action would be sensible to prevent further contamination.
EU eggs still have their natural protection, so should be left alone. Wash right before use if you're worried.
Comment: US rules are all over the place and vary by state. No washing, must wash but moving water,  I forget which one, but one state you actually must use dry sand paper. It is sad that EU is sane and requires Salmonella vaccination, but in the US you have to jump through hoops to even get chicks vaccinated which immediately makes eggs shelf safe. The vaccination costs pennies (US) per bird and increases safety immediately. But our massive factory farms get the rules set.  Sorry for the rant, but we all pay the price for the shortsightedness. USDA puts out guides, but then states set their own rules.
Comment: Despite the answer being "neutralised," I'm glad that it's on the post - the reminder on the distinction between how to treat eggs differently based on context feels like super-useful information!
Comment: This is often also true with farm fresh eggs in the US.  I have a small flock and some of my customers want pristine shells, so those get washed.  Mine, and some other customers want the bloom in place for its natural protection, so those are not.  With eggs that still have the bloom in tact, if dirtied in the OP's way, try to still use within say a week to reduce risk
Comment: idk how it would work for a small farm, but here it's just not allowed to wash eggs before sale, because here it's "well known" that eggs don't need refrigeration. If the eggs have been washed, that no longer applies, so you just cannot do it, you'll poison people.
Comment: Once you wash an egg you have to assume it is no longer safe, hence my initial warning. It's less important what happened to the broken egg as it is to the remainder. Unwashed eggs are unrefrigerated. Once washed they lose *all* natural protection & have to be treated as a much more 'perishable' item.
Comment: @EvangeliusAg I fully agree.  I hobby farm now but for a few years supplied farm fresh to some high end restaurants.  Frankly, and this is personally only, after a lot of research on US rules, I will no longer buy eggs other than direct from small farmer or eat those I raise.
Comment: @Tetsujin  in danger of straying far off topic, but my personal preference is to use duck eggs.  They have some very nice baking qualities, plus a very heavy bloom.  When dirty, as long as you do it with care, you can even wash them and keep most of the protective bloom in place.
Answer: Sure. Wash them off with a little cold water, rub them dry carefully with some paper towels in case you want to keep them for longer and not have sticky old egg whites on the outside.
Answer: I am new to your site so I may not understand how to view all the answers or the entire discussion, but I did not see the solution my mother taught me. You can use the same "trick" to test for freshness that you can use to test for potential contamination in your egg, so I will give the answers to both. (I noticed some people do not like you deviating from the original question but, hey, I'm old. I figure it is NEVER too late to learn something that may come in handy some day.)
Place your egg in a cup or bowl of cold water - cold tap water, not cold as in refrigerated.
Make sure there is enough water that the egg can stand up on end in the container and still be covered with water.
If the submerged egg lies flat along the bottom, the egg is very fresh. ENJOY! If it doesn't but was sold as fresh, you might want to mention that to the vendor.
If the egg stands up on one end it is not so fresh, up to maybe a few weeks, but still good to eat.
If the egg floats, it contains air and should be tossed. It is not only old, but air can contain contaminants and air is how contaminants get into your egg.
Believe it or not, I have had eggs that have been in the refrigerator for months that stand on end in water and are just fine. But remember ALL pre-washed eggs can contain air and contaminants that can cause Salmonella-and-such so always thoroughly cook your eggs. If you must drop a raw egg in a drink, you might want to make sure it lays flat on the bottom of a glass of water first.
Comment: I am sorry, but I have to disagree. The "submerge in water" method is solely based on physics. Over time, some liquid evaporates (note that eggshells aren't airtight, so that the chicks can breathe) and the air bubble at the end gets larger, which leads to the various sinking/floating behavior. Bacterial contamination need _not_ influence the size of the air bubble and with that the behavior in water. The only connection of the two is that older eggs are _more likely_ to be spoiled, especially as the eggshells get more porous over time. The water test says nothing about bacteria in fresh eggs.
Comment: Nevertheless, welcome to Seasoned Advice! If you have a moment, the [tour] and the [help] will explain more about how the site works and if you have questions, there's [chat] and detailed discussions on the site's scope are on [Meta].
Comment: Does this answer the original question about whether egg residue affects safety of uncracked eggs?


CA Network Flow Analysis - sFlow Monitoring Issues

Question: I've been attempting to monitor sFlow traffic from some F5 LTMs, but I'm getting figures like 9 terabytes of data over http, which I don't believe we are getting. Has anyone else had issues like this when monitoring flows with CA NFA ?
Comment: 9TB over what time period?
Comment: time period of 24 hours.
Answer: I'm not familiar with that particular tool, but this sounds like the sFlow sample rate is being misreported or misapplied. Essentially: sFlow samples every N packets, and then the collector multiplies by that number to estimate the true volume. If you're getting every 10 packets and the collector thinks you're getting every 100 packets, though, you can see errors like this.
If you can, see if you can download a single file of known size from an IP address that isn't commonly accessed from your network. Track down that flow and compare the reported size to the actual file size. (There will always be errors -- this is estimation -- just look to the difference in magnitude)


Momentum in Lagrangian mechanics

Question: In the context of translation symmetry for lagrangian mechanics i was given this statement:

For a mechanical system $\frac{∂L}{∂\dot{q}_i}=p_i$ is the momentum.

I have no idea where this comes from.
Answer: Calling $\frac{\partial L}{\partial \dot q}$ plainly "momentum" is a little awkward, especially for people first learning about Lagrangian mechanics. More accurately it is called "generalized momentum" just as $q$ are the generalized coordinates.
The reason for the term "generalized momentum" is that you know what momentum is for systems of point bodies in cartesian coordinates $x$ (Newtonian mechanics). Then you transition to Lagrangian mechanics and notice that what you have always recognized as cartesian momentum since Newton, can be represented as $\frac{\partial L}{\partial \dot x}$. Then you notice that this is a conserved quantity if space is homogeneous (i.e. if there are no potential energy terms contained in $L$ that are fixed in space, or in other words, that explicitly depend on $x$). Finally you notice that Lagrangian mechanics can be applied in any generalized coordinates, especially if it can be expressed as a variational principle (Hamilton's principle). If the generalized coordinate space happens to be homogeneous as well (e.g. for a freely rotating joint with the angle as generalized coordinate), then you can conclude that what you have called "generalized momentum" (e.g. the angular momentum of the body that is constrained by the revolute joint) is also conserved.
You could also give it a name very different from "generalized momentum", but then you would miss the analogy of being conserved under appropriate conditions (homogeneity of the associated generalized coordinate space).
Answer: To supplement the previous answers, consider the Lagrangian for a particle in a 1D potential $V(q)$ with a speed $v = \dot{q}$ and mass $m$: $L = \frac{1}{2} m\dot{q}^2 - V(q)$. Then the generalized momentum is: $p = \partial L/ \partial \dot{q} = m\dot{q}$. This matches the expression for momentum of a classical particle $mv$.
Lagrangian mechanics, though, is much more general as pointed out by the other answers. It allows one to study other systems with other generalized momentum associated with translational invariance.
Answer: It's rather a generalized momentum. The generalized momenta of a mechanical system are defined in a different way to conventional linear and angular momentum.
Consider a holonomic mechanical system with Lagrangian $\mathcal{L}=\mathcal{L}(q,\dot{q},t)$. Then the scalar quantity $p_j$ defined by
$$p_j=\frac{\partial \mathcal{L}}{\partial \dot{q}_j}$$
is called the generalized momentum corresponding to the coordinate $q_j$ It's also called the momentum conjugate to $q_j$

Edit: The above is defining property of momentum. All you can do is to make this significant: As I pointed out it's not linear or angular momentum but plays a much more border role in classical mechanics which can be seen from Noether's theorem, I'm stating it here.

Let $\mathcal{S}$ be a holonomic mechanical system with $\mathcal{L}(q,\dot{q},t)$ and let $\{\mathfrak{M}^\lambda\}$ be a one-parameter famility of mappings that have the action
$$q\rightarrow q^\lambda$$
where $q^\lambda=q$ when $\lambda=0$. If the mappings $\{\mathfrak{M}^\lambda\}$ leave $\mathcal{L}$ invariant in the sense that $$\mathcal{L}(q^\lambda,\dot{q}^\lambda,t)=\mathcal{L}(q,\dot{q},t)$$
for all $\lambda$, then the quantity
$$\sum_{j=1}^np_j\left[\frac{\partial q^\lambda_j}{\partial \lambda }\right]_{\lambda=0}$$
is conserved in any motion $\mathcal{S}$.

Note that the conserved quantity is not generally one  of the momenta but linear combination of all of them with coefficient depending on generalized coordiante.
Comment: It is the momentum, assuming that you correctly set up the Lagrangian. It comes from Noether's theorem. https://en.m.wikipedia.org/wiki/Noether%27s_theorem
Comment: I'll still say that's the defining equation of generalized momenta.
Comment: Your statement coincides with mine. Given a Lagrangian the Noether theorem tells you what the momentum is.
Comment: I added a little explanation to account noether's theorem

Momentum in Lagrangian mechanics


Material disappears while object is deselected

Question: Basically when I have the object selected it looks perfect and the moment I select anything else it vanishes, this only happens in material view and rendered view, I have absolutely no clue what I could have done to cause this.
Answer: From the screenshots it appears you're seeing the OpenGL masking effect.
The pink container's outer walls are semmi transparent and masking the portion of gray plate that's behind it.
Parent the outer container to the gray plate then unparent it again.  (child = pink container)
If that doesn't fix it, try ticking/unticking both objects' "Transparency" box. That's in the properties (cube icon) at right, way down to the "Display" tab.


Complex conjugates of Newman-Penrose spin coefficients

Question: I am looking to understand the Newman-Penrose formalism. I understand that the spin coefficients are determined by a tetrad $ \{ e_{1}^{\alpha},e_{2}^{\alpha},e_{3}^{\alpha},e_{4}^{\alpha} \}$ = $\{l^{\alpha}, n^{\alpha}, m^{\alpha}, \bar{m}^{\alpha} \}$ where the overbar denotes a complex conjugate.
The spin coefficients are determined in terms of Ricci coefficients:
$$ \gamma_{abc} = g_{\mu \lambda} e^{\mu}_{a} e^{\nu}_{c} \nabla_{\nu} e_{b}^{\lambda} $$Suppose I take one of the spin coefficients,
$$ \pi = -\gamma_{241}$$
To get the complex conjugate of this coefficient, can I just switch all the 3's to 4s and vice versa, i.e.
$$ \bar{\pi} = -\gamma_{231} $$?
Answer: Yes. See e.g. Chandrasekhar, The Mathematical Theory of Black Holes, pg. 42.


Page permalink ending in "-2"

Question: I have a couple of child pages that keeping ending in "-2" on the permalink even if I go in and manually change the permalink. I do not have any pages that are a duplicate title of these so I have no clue why the "-2" keeps popping up on the permalink. Any clues?
Answer: I'm guessing that you have do have duplicates - duplicate permalinks, not necessarily duplicate titles per se. Have you trashed some posts with duplicate permalinks? Until you empty the WP trash, WP still considers their slugs in use. Also, what about Custom Post Types?

Page permalink ending in "-2"


UI Matrix for Mobile Devices

Question: Does anyone have or seen a nice Matrix or Dashboard listing the capabilities between viewing a mobile website on a smart phone and on a non-smart phone?
Answer: I'm not sure this is a direct answer, but have you read this: http://www.passani.it/gap/
specifically section 1.3?
Comment: Seems unrelated to UI, as it mostly talks about what to pay attention to when implementing (outdated) XHTML-MP. Or am I missing something?
Answer: The new jQuery Mobile site has a pretty detailed chart for mobile graded browser support:
Mobile Graded Browser Support
Answer: I'm not sure that all the capabilities can be summed up in a single chart. Programming the Mobile Web is an excellent resource for this though as the author dedicates multiple chapters of his book to that very question.
Answer: This might help you:
http://www.quirksmode.org/webkit.html
Your question is a little bit vague.
What are you looking for specifically?

UI Matrix for Mobile Devices


How to make a video game map that can be used by Android?

Question: I am interested in developing games for the Android OS. I have played Replica Island and I have browsed over the source. I found that the levels/maps were in a .bin format. I could execute them because they were in an Android format. So how could I make a game map/level that could be used in my game? What program would I use? How could I load the map in Java (for Android)?
Answer: I think you're missing it a bit here. What happens is that your game or app is run, and that then opens and reads in the data from a map file. The map file is not actually executable, it simply holds data.
Say you have a tile map of 10x10 in a 2d array. Say that it is all water (tile ID 0) and grass (tile ID 1). You would save this into a file, row by row, probably in a binary (not human readable) format. So if your map had a few rows like this:
0001011101
0010111101
0001011101
0010111101
0001011101
0010111101
0001011101
0010111101
0001011101
0010111101

(It's repeating, but it's an example. All the 0s are water and 1s are land)
You would go through each row and save it to a file. So your file would just be, in binary:
0001011101001011110100010111010010111101000101110100101111010001011101001011110100010110010111101

When you come to read it in, you would read in number by number, and you know that a 0 is water (and you would set that tile to be water) and the 1 to be land.
Of course, this is very simple. But the chance is you would have an ID system, so rather than saving 'water water land' you can do '001'. Same for items - instead of 'sword, location 1,0; axe, location 3,0' you would maybe write yours in binary as '45 1 0 76 3 0'.
For Java, look up any kind of file API documentation.
Answer: Usually, you make a map like lets say a 2D array, and then output it in whatever format. Binary is small and fast, so you might want to use that. You would then have a reader in your game which would parse through that file (binary or whatever) and load your "level" data structure accordingly.
Comment: How would I create a binary file to hold that byte data (I'm running Linux/Windows)? Would I have each byte represent a specific kind of tile such as a wall, sprite? Could you please give me an example of what that 2D array would look like? (Sorry, I'm new to game development)
Comment: See TheCommunistDuck's reply. It should give you an idea of what the 2D array would look like. The idea is..imagine your world to be segmented into tiles (each of dimension 32 x 32pixels). This would look like a grid (or 2D array). Now, you can assign int ids to each cell and the array would look like his reply. So, now your game knows wheres land and wheres water. Now, once you author this 2d array, you can serialize it and store in binary format. When your game loads this file, it would deserialize it and reconstruct that 2D array, which your game can now interpret based on the ids stored
Comment: Look at serialization/deserialization for storing your data in a binary file.


no lines/conics on a degree 4/5 surface?

Question: Are there explicit examples of smooth surfaces of degree 4 and 5 in P^3, which
contain no lines or conics (i.e. smooth rational curves of degrees 1 and 2)? An example over a finite field would be better, but if not - I will take one over complex numbers :)
Comment: What if you try something more basic than what is suggested below.  E.g. for lines on degree 4 hypersurface in P^3.  The choice of hypersurface is 35 coefficients (c_i).  Then on a standard A^4 patch of Gr(2,4), you have 4 variables.  The equations for one line to lie on the hypersurface will be a system of 5 equations in the (c_i).  Do the same thing on the other patches of Gr(2,4).  What happens if you turn on your computer and try to "randomly" find (c_i) so that none of these equations have solutions?  Conics will of course be harder still, but maybe manageabl.e
Answer: The generic hypersurface of degree 5 in P^3 has no rational curves at all, let alone a line or a conic:  see
G. Xu, "Subvarieties of general hypersurfaces in projective space", J. Diff Geom 1994
So you can certainly get a complex such hypersurface without any lines or conics just by embedding the function field of the moduli space of hypersurfaces into C.  Since the locus of quintics containing a line or conic is a proper closed subvariety, you'll also get plenty of examples over finite fields if you make the finite field large enough (though to be fair this will not exactly be "explicit.")
I guess the generic quartic hypersurface probably also has no lines or conics (though it will have rational curves) but I didn't check this.
Comment: Your last sentence is correct!
Answer: Explicit examples are hard to construct, even though as Jordan pointed out, most surfaces work. If you can compute the zeta function and check that the Neron Severi group has rank one, then there are no lines or conics. Kedlaya and some students have an algorithm to compute the zeta function. See their paper in the proceedings of AGCT 10.
http://smf4.emath.fr/Publications/SeminairesCongres/2009/21/html/index.php
Answer: I think that the quartic with equation
\[
x^4 + y^4 + xy^2z + yw^3 + z^3w
\]
over $\mathbb{F}_2$ has no line and that it has no conic defined over a field of size at most $2^8$. Both statements I have checked using a computer, so there could be mistakes in the program I used, but I did some testing for the algorithm to decide existence of lines. For the algorithm for conics, I could never get it to finish, this is why I resorted to brute force search for some conic defined over a small field. If the example above works, then any quartic with coefficients in $\mathbb{Z}$ reducing to the one above modulo two, also has no line and no conic on it. Also, if it works, it is the only one with at most five monomials, up to isomorphism.
Answer: I will work over $\mathbb C$. Although I have not checked, the example below should work for characteristic different from $3$.
To exhibit a degree $d$ projective surface $S \subset \mathbb P^3$ not containing any line you can consider surfaces of the form $t^d = f(x,y,z)$ where $f$ is homogeneous polynomial of degree $d$.
Let  $C \subset \mathbb P^2$ be  the curve determined by the polynomial $f$ and $\pi: S \to \mathbb P^2$ be the linear projection from the point  $p=[0:0:0:1]. $ If $\ell$ is a line contained in $S$ then $\pi(\ell)$ is a line tangent to $C$ at a total inflection point $q$, i.e. the contact between $C$ and the line $\pi(\ell)$ at $q$ is of order $d$. For details see Section 6 of  Counting lines on surfaces by Boissière and Sarti.
This reduces the problem of finding a surface without lines to the one of finding an
algebraic curve without total inflection points. For quartic curves we have not to look much, as Klein determined all the inflections of his famous quartic
$$
x^3y + y^3 z+ z^3 x = 0.
$$
All its $24$ inflection points are simple, see for instance Jeremy Gray's paper in
The Eightfold Way: The Beauty of Klein's Quartic Curve. Thus the surface
$$
t^4 - x^3 y - y^3 z - z^3 x =0
$$
has no invariant lines.
It should be possible to pursue this argument further to determine the sought examples.
Edit: The quartic surface above ( as any quartic of the form $\{ t^4- f(x,y,z)=0 \}$ ) has many conics, as the pre-image of a bitangent line (there are $28$)  is the union of two conics. On the other hand, the surface
$$
  t^5 - x^4y - y^4 z - z^4 x =0
$$
seems to be a good candidate for a quintic without lines nor conics.
Answer: A quartic surface containing a line or a conic has Picard number at least 2. There are explicit examples of Ronald van Luijk of quartic surfaces defined over $\mathbb{Q}$ such that the (geometric) Picard number is 1. (See http://www.math.leidenuniv.nl/~rvl/ps/picone.pdf)
The reductions of these surfaces mod 2 and 3 contain a line resp, a conic, so they do not work for you.
However, this paper hints at algorithm how to find examples in positive characteristic:
Take a smooth quartic surface $S$ over a finite field with $q$ elements. By point counting (or more efficient methods) you can determine the characteristic polynomial $P_2(T)$ of Frobenius on the second (etale) cohomology of $S$.
Let $r$ be the number reciprocal zeros of $P_2$ the form $q\zeta$ with $\zeta$ a root of unity. This number $r$ has the same parity as the degree of $P_2$, which is $22$ for quartic surfaces. It is well-known that $r$ is at most the geometric Picard number of $S$.
Suppose now that you find a surface such that $r=2$. Then either the geometric Picard number $\rho(S)$ equals 1, and you are done, or the geometric Picard number equals 2. In the latter case the Tate-conjecture holds. Milne proved that the Tate-conjecture implies the Artin-Tate conjecture. Now the Artin-Tate conjecture enables you to determine the discriminant $D$ of the intersection pairing on the Neron-Severi group up to squares from $P_2(T)$. (See, e.g. my paper on elliptic K3 surfaces with geometric Mordell-Weil rank 15.) Now if $\rho(S)=2$ and $S$ contains a line then $D=-k^2$ for some integer $k$, and if $S$ contains a conic then $D=-3k^2$ for some integer $k$ (this is an easy exercise). Hence you have a criterion to check whether your quartic surface contains a line or a conic.
For quintics something similar works, only the degree of $P_2$ differs, and the values of $D$ in the case that $S$ contains a line or a quintic differ.


Enumeration relying on integer boolean conversion

Question: In my compiler project, I have an enumeration that goes like
enum Result {
  No,
  Maybe,
  Yes
};

I have put No explicitly at the first position, so that i can rely on the boolean evaluation to false. If my compiler is not sure about something, and has to wait for facts until runtime, its analysis functions will return Maybe. Used like
if(!typesEqual(t1, t2)) {
  diagnose(types_unequal) << t1 << t2;
}

I wonder whether you or your company considers it bad style not to compare to No explicitly
if(typesEqual(t1, t2) == No) { /* ... */ }

Comparing explicitly seems wordy to me, but relying on the implicit boolean conversion somehow makes me feel guilty. Have you had that feeling before, and how have you dealt with it?
Comment: I think i'm going to make it CW, because it seems more of a style question!
Answer: I'd feel guilty about it as well, because from reading the code above what would you expect the boolean typesEqual() expression to return for a Maybe? Would it return true? Maybe! Would it return false? Maybe! We don't know - that's the entire point of the enum. That's why it makes sense to explicitly compare to No, even though it's more verbose.
Answer: I don't usually use an explicit comparison with zero for integral or pointer types since the conversion-to-boolean is well-defined and obvious.
However, I always use an explicit comparison for enumerations, just in case someone changes the definition of the enumeration.  You can never be sure that someone won't change the enumeration later, after all.
Relying on the underlying numeric value of an enumerator just seems like a bad idea.
Answer: This seems similar to Boost.Tribool. Tribool supports conversions to bool for use in conditional statements, which would seem to suggest that implicit conversion to bool in a case such as this is not bad, at least according to the Boost organization (whom I have found to be fairly reasonable).
Answer: What I don't like is that it is asymmetric.
E.g. what you really wanted somewhere was
if(typesEqual(t1, t2) == Yes) {
    do_something();
}

but by accident you wrote
if(typesEqual(t1, t2)) {
    do_something();
}

It seems somehow strange/ugly that you can use the boolean trick for No but not for Yes.
I think I would solve it by renaming the function to tryCompareTypes(t1, t2), and change your enum to
enum Result {
  Maybe,
  No,
  Yes
};

So tryCompareTypes() returns 0 if it "failed" to definitively decide whether the types are equal, otherwise it returns either No or Yes, both of which are nonzero and hence indicate "success".


When to use datetime or timestamp

Question: I've searched for this but no clear answers (especially on the latter). In what cases should you use a datetime or timestamp?
Comment: "When to use datetime or timestamp?" does not have the same meaning as "Should I use field 'datetime' or 'timestamp'?". Not sure why it's been marked as duplicate.
Answer: Assuming you're using MS SQL Server (Which you're not, see the Update below):

A table can have only one timestamp
column. The value in the timestamp
column is updated every time a row
containing a timestamp column is
inserted or updated. This property
makes a timestamp column a poor
candidate for keys, especially primary
keys. Any update made to the row
changes the timestamp value, thereby
changing the key value. If the column
is in a primary key, the old key value
is no longer valid, and foreign keys
referencing the old value are no
longer valid. If the table is
referenced in a dynamic cursor, all
updates change the position of the
rows in the cursor. If the column is
in an index key, all updates to the
data row also generate updates of the
index.

Information on MSDN
If you need to store date/time information against a row, and not have that date/time change, use DateTime; otherwise, use Timestamp.
Also Note: MS SQL Server timestamp fields are not Dates nor Times, they are binary representations of the relative sequence of when the data was changed.
Update
As you've updated to say MySQL:

TIMESTAMP values are converted from
the current time zone to UTC for
storage, and converted back from UTC
to the current time zone for
retrieval. (This occurs only for the
TIMESTAMP data type, not for other
types such as DATETIME.)

Quote from MySQL Reference
More notably:

If you store a TIMESTAMP value, and
then change the time zone and retrieve
the value, the retrieved value is
different from the value you stored.

So if you are using an application across timezones, and need the date/time to reflect individual users settings, use Timestamp. If you need consistency regardless of timezone, use Datetime
Comment: Kind of, they are converted to UTC before being stored, and then converted back to the current time zone settings on retrieval. So if time zone settings change between storage and retrieval, you will get back different values; although still corresponding to the same UTC datetime.
Comment: It means that the value for **the row being edited** would be changed - note: that is for MS SQL only; I've updated the answer to include MySQL information.
Comment: Thanks for the reply. What exactly is meant by the timestamp column being updated? Does this mean that all values in a column are changed?
Comment: Ok, thanks for the update. So to reformulate, a timestamp value adapts to a change of timezone setting or when data is imported on a server with a different timezone?
Comment: Sounds like a logical approach. I appreciate the clarification.
Answer: See Should I use field 'datetime' or 'timestamp'?
It has a comprehensive coverage about the topic.
EDIT -
Just to summarize properties for MySQL and my experience with it-
Timestamp -
a) 4 bytes per column (compared to 8 for datetime)

LOWER RANGE ('1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC ) THAN DATETIME - So definitely don't use it for birthdates etc. Most usage patterns are to actually provide a 'Timestamp' of 'NOW' for activities like row updates, etc etc.

b) stored internally as an integer

Performance wise... my personal experience has been ambiguous.. sometimes its faster... sometimes slower than DATETIME. It takes less space though.

c) Has timezone info!

so - if I add '2011-01-01 3:30' in TIMESTAMP (with curr timezone as EST - Boston).. later, i change the server & mysql timezone to PST(california) and restart server - the value will change to  '2011-01-01 00:00' -- (PLEASE CONFIRM... i had tested this a long time ago). However, DATETIME will remain the same.

d) All the DATE() / DAY() / MONTH() functions work for both TIMESTAMP and DATETIME
e) In MySQL, you can have multiple TIMESTAMPS per table

(YES, however only one of them (the first) will be updated automatically with the time of row update, also... only one can be made NOT NULL (think the first))

f) first TIMESTAMP in a table is automatically updated...

so be careful if you use it for some other purpose.. and want to allow nulls there. (null stored as '0000-00-00 00:00:00' in both DATETIME and TIMESTAMP)

I have used multiple timestamps for other purposes.. needed the space saved (had to be very careful and keep all these issues in mind.
My advice, go for TIMESTAMP for non timestamp purposes only if u know what u are doing.. and if SPACE is a huge concern (my eg - 15,000,000 rows and growing and 8 datetimes!))
Comment: @James P. just added my personal experience with both
Comment: Point c) is confusing.  The point is that you WANT to use timestamps, because they are based on a single universal time all over the world; whereas DateTimes are merely local, and so subject to opinions as to which time zone you're in.  The current explanation makes it look backwards.  4:30 in Boston will translate as 1:30 in California, with timestamps, because they are actually the same time.  This is what you want, esp. if you are doing banking.  With DateTimes, the timezone information is not taken into account; so 4:30 in Boston will also be given as 4:30 in California.  Oops.
Comment: Thanks Jai. I have already skimmed through the topic but it seems to be more about the technical differences between the two (quite confusing I'll add) rather than what cases they should be used for. See unbeknown's reply for what I'm looking for.
Answer: I did not get your question clearly, but see below link. it may help you
http://www.sqlteam.com/article/timestamps-vs-datetime-data-types
Answer:
In MySQL, on DateTime type you can work with DATE() related functions, whereas on timestamp you can't.
Timestamp can not hold values before 01-01-1970.
Also, one of them holds the daylight savings and other don't (I don't remember which one right now)

I tend to always choose DateTime.
Comment: Timestamp can hold values before 1970 - you just use a negative integer. Also, if you use an unsigned int, you can go past 2038.
Answer: Need to specify database server.
Some server engines will automatically update the timestamp fields, so it can be used as record version in Optimistic Locking
Comment: In that case, [google first hit](http://www.google.com/search?client=opera&rls=en&q=mysql+timestamp&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest) will tell you that [TIMESTAMP in mysql offers automatic updating and converts to UTC time](http://dev.mysql.com/doc/refman/5.0/en/timestamp.html) regardless of the connection timezone. You need to explicitely sepcify `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` in the column creation though
Comment: Edited the question. This is for MySQL.
Comment: Ok, so timestamp should be used when an application is used accross timezones. Are there any other cases that come to mind where it can be used?
Comment: No. Timestamp would be used for versioning of records. The UTC conversion is only instrumental to that end, so comparisons are efficient and safe always. Did you read the wikipedia link? If you don't know what I'm on about, you probably don't need this anyway. Do you use explicit locking/transaction isolation? Forget this then
Comment: Ah, it appears there are different opinions on how it should be used. Yes, I understand the concept of optimistic locking and, no, I don't use anything of the sort.
Comment: Ah... well on reading the docs one more time, it appears that there may be a usecase for TIMESTAMP just for timezone normalization. I was a bit rash there because I was reiterating my knowledge of TIMESTAMP columns on multiple database engines, instead of reading the MYSQL specific bits. I think you have enough info to work things out :) Thx

When to use datetime or timestamp


Why does scrypt need HMAC?

Question: I don't understand how HMAC can be used in the scrypt algorithm. For what purpose does scrypt use HMAC?
Answer: The scrypt function utilises a key-derivation function (KDF) in a manner which is expensive in terms of both CPU time and memory. It does this in a way which allows a time/memory tradeoff, where implementations which use less memory require more CPU time.
The KDF used in scrypt is PBKDF2. The underlying pseudo-random function (PRF) used in PBKDF2 is user-selectable, but must take two parameters. As such, a HMAC hash is ideal, due to its two input parameters (message, key) and it being safe as a cryptographic PRF.
The immediate answer to your question is that scrypt requires a HMAC hash because PBKDF2 requires a PRF with two inputs, and a HMAC hash is a commonly chosen function type for this, so it made sense for scrypt to take that option. The scrypt specification itself defines HMAC-SHA256 as the PRF.

Why does scrypt need HMAC?


I want to be an airline pilot. Would becoming a NON-COMBAT Air Force pilot be a good way to become one?

Question: I know that becoming a fighter pilot is highly competitive, making it a difficult route, but would becoming a pilot for an Air Force cargo aircraft or something of the like be a good way to reach my final goal of piloting for an airline?
Comment: It's one way but not the only way.
Comment: Matters not whether you were flying a fighter or a transport or tanker or even a trainer like the T-6.  The airlines see the hours gained over several years in the Air Force as both highly valuable and highly desirable, regardless of what one has been flying.
Answer: It depends on which part of the world you're in.
Airlines based in a country with a healthy General Aviation scene will probably prefer civil pilots. If there General Aviation scene is limited then it would make military pilots an attractive source.
I'm not saying that Military pilots are any worse/better but there have been airlines where the safety record was quite poor as a result of poor CRM from the military pilots, China Airlines and Korean Air are examples. These airlines have recognised and rectified the problems and today are up to industry levels in terms of accidents/incidents.
Comment: This isn't true.  Mil pilots are awesome at following procedures and are more of a "known quantity" to airlines.  A fighter pilot, for example, may have fewer hours and less experience in certain areas (like really bad weather, icing, IMC, etc), but that really doesn't matter since most of what they need to know can be trained in relatively easily.  On the other hand, a civil pilot with a varied background and twice the hours may have bad habits that are tougher to train away.  Which pilot is "best?"  Who knows...and it depends on the type of flying being done.