If all land mass was desert would the world be hotter or colder than it is now?

Question: Its normally said that deserts cool planets because they reflect more radiation back to space. According to this logic if all the land mass in the world was desert the world should be colder.
Is it true that the average temperature of a desert is higher than green land in a similar climate?  If so wouldnt the average surface temperature be higher if all the world was a desert? And if so how can we still claim deserts cool the earth? Isnt the metric of whether we have global warming, the average surface temperature?
Comment: many of the questions you ask here is answered @ https://en.wikipedia.org/wiki/Albedo
Comment: The Sahara is a net heat loss.  The Earth loses heat through the Sahara.  I haven't modelled it, but if all the Earth was a desert, I think it would be a pretty cold place with very little Greenhouse Effect for lack of water vapour.
Answer: Water vapor is a powerful greenhouse gas. The key characteristic of a desert is lack of precipitation, and that is typically correlated with a low humidity. That reduced humidity means more thermal infrared radiation going from the Earth's surface to space.
Desert doesn't necessarily mean hot. A place is qualified as a desert if it has very reduced precipitation. The Atacama Desert, one of the (if not the) driest places on the planet, can get quite cold. Almost all of Antarctica is technically a desert, and it is very cold. At the height of the last glaciation, much of the northern portion of the Northern Hemisphere was technically a desert, and it too was very cold.
On the flip side, a billion years or so from now, the Earth is predicted to go through a warm greenhouse phase due to the Sun getting more luminous. The oceans will evaporate, some water will be split into hydrogen and oxygen, and eventually the hydrogen will escape into space. At that point, the entire Earth will technically be a desert as there will be no water anywhere, and it probably will be hot.
Comment: If the atacama desert was regreened would it be colder or warmer?
Comment: If you say if the entire earth is desert a billion years from now because of runaway greenhouse, then according to conventional climate science shouldnt it be cold because deserts escape more heat? Why do you say it is hot?
Comment: @mudpuppy Because the Sun will be hotter and presumably the CO2 levels will increase. The predicted increase in free oxygen due to photodecomposition of water will oxygenate whatever material is available, and since hydrogen won't be available, it will combine with carbon. The Earth will eventually become Venus 2.0.
Comment: @mudpuppy Geoengineering has lots of unintended consequences. Besides, why would we want to regreen the Atacama? It's one of the best places (if not the best place) on the planet for astronomy.
Comment: The question is more about if the atacama was naturally green what would be the effect. Climate scientists say that regreening deserts will heat it up, not cool it down. https://climatefeedback.org/claimreview/deserts-cool-the-planet-by-reflecting-solar-radiation-to-space-vegetated-areas-have-an-overall-warming-effect-so-planting-trees-in-deserts-doesnt-necessarily-cool-the-planet-the-guardian/ . But I think this may be wrong...
Answer: Blisteringly hot at day, freezing cold at night
Assuming that "deserts" here mean sandy places with extremely dry air, then it will get really hot at day, but freeze over at night.
Deserts, which are mostly made up of sand (excluding a few places of bare rock and stuff), tend to act like mirrors. Sand has an extremely low specific heat capacity i.e. it heats up quickly with much less energy, but also cools down really quickly. Sand also has a really high albedo i.e. it is very reflective, so it tends to reflect away sunlight. Dry sand also has the nasty habit of reflecting away infrared (wet sand, on the other hand absorbs IR). This gets even worse, as desert air is generally extremely dry, with no water. If it had been humid air, there would atleast have been a chance of water absorbing this heat and thus reducing the temperature (Water has a extremely high specific heat, second to only hydrogen). But with no water vapour, there is nothing to absorb the heat.
Assuming that we switched Earth's entire surface with just sand and a few areas of exposed rock, Earth would look like Mercury on steroids. The dayside would get ridiculously hot, perhaps hundreds of degrees, as the sand reflects infrared and visible light back into the air, heating it up rapidly. However, since sand has an extremely low specific heat capacity, it will rapidly cool, once daytime has ended. At night, the temperatures may plummet to below freezing, as the sand quickly releases its heat away.
TlDr Blisteringly hot at day, but freezing cold at night
Comment: @SteveSaban It is not twice as cold. The lowest temperature at the North Pole is not the lowest temperature in the Northern Hemisphere. (That honor currently goes to a spot in Greenland.) Moreover, the only way one can legitimately say "twice as cold" (and then it would be better to say "half as warm") is to use an absolute temperature scale such as the Kelvin scale. While the South Pole is definitely colder than is the North Pole, it is not "twice as cold."
Comment: Antarctica is technically a desert. It does not get anywhere close to "blistering hot" at day, and its day lasts for up to six months.


Gmail encryption

Question: Is sending emails between Gmail accounts encrypted, can ISP read gmail content in transit??
Comment: *"can ISP read gmail content in transit"* - this Google internal traffic does not pass your ISP, so it cannot read it even if out would not be encrypted. And Google can read the mails anyway, i.e. it does not need to depend on unencrypted transport to read it.
Comment: If you want to know the specific mechanism and protection Google uses internally to send mail from one account to another, then you have to ask Google. It is their infrastructure and it is not public.
Answer: Because Gmail is served with TLS (the https:// prefix), your ISP or any other manipulator in the middle (MitM) should not be able to see your content, only that you're conversing with mail.google.com (which is only discoverable through monitoring your DNS—they otherwise only have that server's IP) and the amount of encrypted bits flowing back and forth.
Google, on the other hand, definitely has access to your content, though it is encrypted at rest.
For a few years, the NSA's PRISM program took advantage of an implementation flaw: data transferred between Google's data centers was unencrypted and the US government was recording it. This was changed about ten years ago in response to a leak that revealed details on this spying program.
Since we're talking about email, it's also important to note that even though most email nowadays is encrypted with TLS, downgrade attacks are possible and can result in another entity reading your mail in transit, though there are several efforts to reduce this (see comments below). Unless Google repeated the sort of flaw that enabled PRISM, this should not be a concern in Gmail-to-Gmail conversations.
Comment: There are also technologies for fighting the downgrade attacks, like *The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA* ([RFC 6698](https://www.rfc-editor.org/rfc/rfc6698)) or Google's  *SMTP MTA Strict Transport Security* (MTA-STS) ([RFC 8461](https://www.rfc-editor.org/rfc/rfc8461.html)). The email security is slowly getting better.
Comment: Yes, there are new standards in the works, but they're very new and I'm not sure how well they work yet. I used to use DANE but it was like asking for extra bounce messages as several people I corresponded with use servers that fail to pass it. These also all rely on DNSSEC, but [DNSSEC adoption](https://stats.labs.apnic.net/dnssec/XA?c=XA&x=1&g=1&r=1&w=7&g=0) isn't growing notably.
Comment: Well, the MTA-STS does not rely on DNSSEC: "The primary motivation of MTA-STS is to provide a mechanism for domains to ensure transport security even when deploying DNSSEC is undesirable or impractical."
Answer: The encyption in transit in the context of email communication refers to TLS between message transfer agents (MTA).
Whether encryption in transit was used or not does not matter much if you are concerned whether the [sender's or the recipient's] ISP can read the mail, because the connections used both for sending and reading the mail are encrypted:

If the web mail was used for writing and/or reading the message, it was protected by TLS in the HTTPS connections.
If external mail user agents (MUA) were used, the submission on the sender's side was protected by the submissions protocol and the reading by the TLS in the IMAPS protocol.

Therefore, it does not really matter how the things are handled inside the cloud service. Google's own documentation promises that Gmail is handling your mail appropriately:

When you send an email or text message, send attachments, or record video meetings, it is stored securely in our world-class data centers. Data is encrypted in transit and at rest. If you choose to access this data offline, we store this info on your device.

You can judge for yourself how much you want to trust this promise after reading the sources cited in Adam Katz's answer.
The encryption in transit matters more in delivery scenarios between two service providers. Here it provides additional protection for the communication between their cloud infrastructures:

Examining encryption in transit from a technical perspective
In general, you could examine the email headers to see what has happened during its delivery. The details about encryption in transit could be logged in the Received headers, e.g., the TLS 1.3 encryption in:
Received: from mail.example.org (mail.example.org [192.0.2.1])
        (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
         key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)
        (No client certificate requested)
        by example.com (Postfix) with ESMTPS id 123456789A
        for <email@example.com>; Mon, 02 Oct 2023 16:12:51 +0000

A message from Gmail to Gmail shows these headers (examine using Show original from the ⋮ menu):
Received: by 2002:a05:7010:a11:b0:385:df3f:9b20 with SMTP id xxx;
        Sun, 1 Oct 2023 23:15:34 -0700 (PDT)
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [18.104.22.168])
        by mx.google.com with SMTPS id x.x.x.x.x.x.x.x
        for <email@example.com>
        (Google Transport Security);
        Sun, 01 Oct 2023 23:15:34 -0700 (PDT)

The first (more recent) header does not explicitly mention encryption whereas the second refers to an abstract "Google Transport Security". This means there is some kind of encryption when Google delivers the mail via SMTP in their own infrastructure, but that they are not disclosing the details.
When Gmail sends messages to an external MTA it is capable of using TLS 1.3:
Received: from xxx.google.com (xxx.google.com [IPv6:x:x:x:x::x])
        (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)

Likewise, it supports TLS 1.3 for inbound mail:
Received: from example.net (example.net. [198.51.100.1])
        by mx.google.com with UTF8SMTPS id x.x.x.x.x.x.x.x
        for <firstname.lastname@example.com>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);

Answer: Sending emails between Gmail accounts benefits from default encryption measures, as Gmail employs Transport Layer Security to secure emails during transit. TLS encryption ensures that your email content remains protected while in transit, both from your computer to Gmail's servers and from there to the recipient's computer. This encryption applies to the email's actual content, safeguarding its confidentiality and integrity.
However, it's important to note that while the email content is encrypted, certain metadata, such as the sender's and recipient's email addresses and the subject line, may still be visible to your Internet Service Provider. Additionally, your ISP could potentially access information about the sender and recipient's IP addresses.
To enhance privacy further and mitigate the exposure of metadata, you have the option of utilizing a Virtual Private Network. A VPN establishes a secure tunnel between your computer and a VPN server, encrypting all your internet traffic as it traverses this tunnel. This added layer of security ensures that even metadata remains confidential.
In addition to encryption measures, you can implement practices that promote email security and privacy, such as using strong passwords and enabling two-factor authentication for your Gmail account. Furthermore, exercising caution regarding the information you share in your emails and avoiding clicking on links from unknown senders are additional steps that help safeguard your digital communication. These practices collectively contribute to a safer and more private email experience.
Comment: Not quite - you're trusting your VPN with their no log policy and put your trust on the VPN provider instead of your ISP..
Comment: Citation needed for "certain metadata, such as the sender's and recipient's email addresses and the subject line, may still be visible to your Internet Service Provider. Additionally, your ISP could potentially access information about the sender and recipient's IP addresses." The statement doesn't make sense in this context.

Gmail encryption


Workstation - How to check space left?

Question: I am using a workstation that is shared with others. I dont know what that means but I think some space is shared. How can I know how much space I have for myself? I ran df -h below
Comment: Please do not [post screenshots of the terminal](https://meta.askubuntu.com/q/8713/250300). Paste the text directly to your question next time and apply [code formatting](https://askubuntu.com/editing-help#code). However, your `df` output does not help here. You don't seem to have a separate home partition, so you should be able to utilize all the space of `/` (maybe also `/data`), unless there is some form of [quota](https://linux.die.net/man/1/quota) applied.
Comment: Looks like there is 210GB available on /dev/sda2 and 2TB available on /dev/sdb1.
However, I can not see a way to tell if the users have a quota set. If quota is installed and you have admin access you can check your user or group to see any limits set.
`$edquota username` (for users)
`$edquota -g groupname` (for groups)

[quota-ubuntu-debian](https://www.howtoforge.com/tutorial/linux-quota-ubuntu-debian)
Answer: You need super user access to determine a users quota utilizing quota. you can determine is it's installed with the command which quota and if not and you DO have super user access you can install it with sudo apt install quota
If it is installed and you don't have super user (sudo) access you can check your group quota with quota -g which if no filesystems are setup with quotas will respond by returning the prompt. you can also issue the command edquota -g or edquota -u username` (where username is your username) which if no quota is setup should return:
No filesystems with quota detected.
For information on how quotas are setup see Using 'quota' for disk limits
If no quotas have been established df -h should provide everything you need to know with the Avail column providing available space.
In the case of a quota you can calculate your available space by subtracting your disk usage du from your quota.
Sources:
man quota

Workstation - How to check space left?


Is it possible to raise stats?

Question: I found a lot of dialogue choices requiring high Perception and I started the game with just 10 plus 1 for being an elf. With a magical helm and tower rest bonus I can temporarily boost it to 13, but is it possible to raise it permanently?
Answer: You could do that with cheats - either with console command AttributeScore player <attribute> <amount> or there are CheatEngine tables that allow you to do that without loosing Steam achievements.
Custom enchanting will allow you to increase whichever stat you need with your favourite equipment options.
Drugs can do a temporary increase to get through the conversations you want.
That said I know of no permanent way within the game to increase it, neither by level-up nor quest reward.
Answer: There are some very specific quests that allow you to increase an attribute, but they require you to be playing an evil and cruel character. These options will generally only appear if your "Cruel" demeanor is high enough.
Comment: That is interesting. It would be great if you could add what quests these are and what attributes can they rise (in spoiler tags preferably)

Is it possible to raise stats?


Get Rid of inSync

Question: I'm new here, so I'm not totally sure if this question would be appropriate for these forums, but anyways... How can I uninstall inSync from my computer. I didn't like the service and so, I disconnected it from my Google account. But, I can't get it off my computer. I do use Ubuntu as my only OS, and I have a 64 bit computer. Also, if I disconnect inSync from my Google Account, will it still send me emails? I'm just wondering. Please reply!
Comment: Have you tried `sudo apt-get remove insync`? (or what the package name of insync now is.)
Answer: The version of the software has changed (as of August 2013), so the answer from ubuntu_tr above may need to be tweaked. To remove the latest non-beta version of insync type
sudo apt-get purge insync && sudo apt-get autoremove

and type 'Y' to confirm. Then to delete the remaining insync folder type
sudo rmdir /usr/lib/insync --ignore-fail-on-non-empty

Then go to Ubuntu Software Centre, move the mouse near the top of your screen to view menu options and click on Edit->Software sources... select the Other software tab and then scroll down, select apt.insynchq.com/ubuntu and click the Remove button.
Answer: sudo apt-get purge insync-beta-ubuntu && sudo apt-get autoremove

This command will remove it. You should also remove ppa entry from the "software sources > Other Software" section
Reference
Answer: I know this is an old question, but I just wanted to add an up-to-date answer.
According to the official uninstall instructions on How to uninstall Insync:
Debian/Ubuntu

Run sudo apt-get remove insync.
Delete the application data folder at ~/.config/Insync.

Fedora

Run sudo yum remove insync.
Delete the application data folder at ~/.config/Insync.
Answer: InSync adds a startup item to Gnome. You can run gnome-sessions-properties from command line to remove or disable it.
Answer: A quick sudo apt-get remove insync-beta will do make sure its not running in the background just in case it gives you problems.
Answer: For beta1 (which installed from a tarball using a python script) the answer is on the insync forums:
sudo rm -rf /usr/bin/insync /usr/bin/insync-set /usr/bin/insync-get /usr/lib/insync
rm ~/.local/share/nautilus-python/extensions/insync_plugin.py

Answer: Insync causes a warning in sudo apt update in Ubuntu 18.04 beta-2 even though all of the methods shown above are taken to remove Insync.
The answer is to remove the repository in Software Boutique. There appears to be no way to remove the Authentication key in Synaptic, but it can be removed in Software Boutique. After removal, the problem shown in sudo apt update is gone.

Get Rid of inSync


Multiple Update Panels

Question: I am using 1 main update panel which contains Search criteria and a Search button.
In side this main update panel I am using 4 update panels.
These four update panels fetching search results from different 4 SQL quires. Currently I did this.
But my question is, currently the page will come to display after fetching all all 4 update panels.
But I needed, If one panel get full record that one panel will come to display. then next filed panel.... Like this.
Please help me.
Answer: If I understand you correctly, you want the inner UpdatePanels to update consecutively when the outer UpdatePanel is updated? If this is correct then by default, all nested UpdatePanels will be updated when the parent UpdatePanel is updated.
It sounds like it would be better to not have the outer UpdatePanel, set a trigger on (inner) UpdatePanel 1 to update when search is clicked, set a trigger on UpdatePanel 2 to update when UpdatePanel 1 updates, etc, etc.
Alternatively, you could implement AJAX calls to Page Methods or Web services to populate the contents of the UpdatePanels and do away with the UpdatePanels instead.
Comment: If I removed outer main update panel, the page will get full post back. This is not allowed.
Comment: Are you sure about that? It's been a while since I used UpdatePanels, but IIRC, the full page postback gets intercepted if the submit button is an AsyncPostbackTrigger for an UpdatePanel (in this case, set it as an AsyncPostbackTrigger on (inner) UpdatePanel 1).
Comment: Hai, I have one problem here. I tried in the AsyncPostbackTrigger method. But here I am using webusercontrols in the pages. That is the main outer udatepanel in one user control. In side this, the 4 update panel appear in side 4 user contols. So, If I try to use AsyncPostbackTrigger it expects the SearchButton inside the same user control. Please hel me.
Comment: Could you edit your original question and update it with the comments you have made and also post your aspx page code, along with any relevant .NET code
Answer: Jason I think you problem may stem from the fact that you have nested your 'SQL' UpdatePanels within the 'Search' Update panel.  You may want to separate them and look at AsyncPostBack triggers to get all four to fire once you have entered search critera.
Comment: I will enter the search criteria in main update panel and click the search button. The innter 4 update panels will load their datagrid using the above search criteria. Now this process is correctly working to me. But my question is, currently the will display the search result only after fetching 4 update panels. This not allowed. If one update panel fetched records immediately it will show to user, then after fetching second update panel, the page will show that one ..... . The inner panels were used only for display search records. No updation there. Please help me.
Comment: Again I would look at where the search cmd is fired, on the main updatepanel.  Un nesting these datagrid updatepanels will make them post independently with an UpdateMode set to 'Conditional' and your search button as a trigger on each datagrid UpdatePanel.
Comment: The AsynPostBackTrigger will give you the ability to do a 'partial' postback on you 'Search' button.
Comment: Hai, I have one problem here. I tried in the AsyncPostbackTrigger method. But here I am using webusercontrols in the pages. That is the main outer udatepanel in one user control. In side this, the 4 update panel appear in side 4 user contols. So, If I try to use AsyncPostbackTrigger it expects the SearchButton inside the same user control. Please hel me.
Answer: The question is not clear, but you can check the results of the four queries in the Selected event of each of the DataSourceControls you use (I suppose you do), and if you find a record in a set displayed in the previous set, then apply your custom adjustment.
A side question: why using 4 update panels while the whole 5 panels are triggered by the same source (the search button)?
Comment: Hai, actually the Main update panel has Search Criteria only, the inner update panels have separate separate paing buttons. Please help me.
Comment: I'm still not clearly understanding, but if you want to populate the data in the 4 panels sequentially in response to user activity, then you should handle certain events for the 1st grid (RowSelecting for example) and populate the next grid with code (grid.DataBind()), but don't let them bind themselves automatically in response to the search button clicks.

Multiple Update Panels


1980s California murder trial transcript

Question: I'm not a legal student or scholar, but I'm looking to get my hands on a full transcript of a California murder trial from the 1980s in which the defendant recieved the death penalty. Since the LA county court's website says that they destroy transcripts after ten years, but keep transcripts from death penalty cases indefinitely, I am fairly sure the record still exists. I just don't know how I should go about getting it, how much an e-mailed PDF copy would cost, how much a scanned copy would cost if I went to the court and got it in person, or even if the record would be found at the court or in the state archives, since the defendant is dead. Any help would be much appreciated.
Answer: I would contact the county court clerk's office and make the request, as they normally will have duties that would include filing transcripts and other court paperwork.  If they don't have it in an archive they own, they would certainly know who does if for no other reason then they would have to send modern cases to them.   I would also check the State Court's website and see if they have case databases availble for search (My state does have access to a search of cases by names or case numbers and will return the names of both parties in the case as well as all witnesses called by either side and all developments and motions and finding results including the verdict.  The transcripts don't normally appear, but since the system depends on state by state, it could.   I would advise calling the clerk's office before going in person.  No use making a trip only to learn your case is elsewhere in L.A. (and you'll be caught in rush hour).


magento transfer from one server to another after that problem

Question: Magento 1.9 transfer from one server to another,as follow  all steps such as(all file transfer, database import, change URL in database, database name change in .XML file and last clear cash), after that when we refresh webpage than automatically start fresh Magento installation process.
so please help me!, what can i do?
Answer: Usually if Magento goes to a fresh installation screen it points to a missing or unreadable app/etc/local.xml. This file is responsible for the database connection and cache setting, if one is not found Magento assumes this is a fresh setup.
I'd make sure app/etc/local.xml exists and is readable by the server (Is correctly chown'd and is under 644 for chmod, example commands below)
sudo chown www-data:www-data app/etc/local.xml
sudo chmod 644 app/etc/local.xml
Comment: local.xml = 644 same problem accrued
check above images
Answer: You can try below methods:
1. Check DB and its permission with the db user
2. Debug by changing the db name in the local.xml and then you will see the report error and just check that error inside var/report directory.


Retrosynthesis of spirocyclic compounds?

Question: I have been trying to complete this retrosynthesis problem for a few days but can't figure out how to get from Ester starting compound to a spirocyclic compound. I have tried removing the Ester but can't figure out what best to replace it with.
I have access to any reagents and starting materials as long as the nominated substance is used.
Answer: Step 1 - Form the anion of your starting material ($\ce{NaOEt/EtOH}$ will do this nicely) and react with phenethyl bromide ($\ce{PhCH2CH2Br}$).
Step 2 - Add the product to hot polyphosphoric acid$\ce{^{[1]}}$ to cyclize it to the required product.
Reference

Cyclization of Aryl-Aliphatic Esters with Phosphorus Pentoxide in Phosphoric Acid by Richard C. Gilmore, Journal of the American Chemical Society, 1951, 73 (12), 5879-5880, DOI: 10.1021/ja01156a521


How to get CPU usage in MySQL per user?

Question: I want to know is there anyway to get CPU usage per user in MySQL? for example I have 3 different users 'user1', 'user2' and 'user3'. I want to get the average/real time memory usage and CPU usage of these users.I googled a lot but I did not find any suitable tool. Maybe I can get these data from MySQL queries, but I don't know where are they stored.
Answer:
Some resource limitations: https://dev.mysql.com/doc/refman/5.6/en/user-resources.html and https://mariadb.com/kb/en/library/grant/#resource-limit-options
Switch to MariaDB to get "user stats" (connections, bytes, rows, CPU, etc): https://mariadb.com/kb/en/library/information-schema-user_statistics-table/ and  https://mariadb.com/kb/en/library/user-statistics/
Comment: its show CPU_TIME but i want to have CPU usage in Percentage or Frequency.
Comment: @behnambahadori - Does it give enough raw data such that you can compute Percentage or Frequency?
Comment: I want to know how can i use raw data to getting CPU usage in Precentage, now i don't have any idea for this issue...
Comment: I know how I can get the CPU usage in time (top, ps, user_statistics,...). I want to know is there anyway to convert the %CPU time to cpu core?
I run top for 5 seconds after 5 seconds I get 30% for %CPU from top which is 1.5 seconds. and mysql shows 60% within the 5 seconds which means 0.9 seconds is for mysql. Now how can I convert this value to cpu core? for example mysql used 1.2 cores during a 5 secind period

How to get CPU usage in MySQL per user?


Move iMessages between accounts

Question: I have two Apple IDs, because one of them is in the US App Store and the other is in the hungarian Store. I use almost every service of iCloud on the US account except for the iMessage. I still have to log in to iMessage with my older, hungarian account, because all my messages since the service was introduced belong to that. I want to simplify my life and use only the US account (except for purchases in the Store). Is there any way to transfer my old iMessages from my old account to the new one?
Comment: cause of your Question the shorter answer is no - but i explained also what you can do and i think this is the way you thought about the Problem right?
Answer: Short Answer: No
Longer Answer:
Apple does not support and even don't know how to merge 2 Apple IDs/Account. But on your local iPhone you can hold all the Data if you only switch the iMessage ID afaik. iMessages are only hold for 14 Days in the Apple Account and are not/nerver longer stored at Apple (claims Apple)
So moving iMessages to another account without Dataloss - No
Keep old Messages on the same Phone (or Backup) - Yes

Move iMessages between accounts


Use of Random Forests for variable importance as preprocess before another analysis

Question: the question
Demonstrate the speed and accuracy of properly applied 'Random Forest' as a variable importance selection tool especially in handling very large data against alternative approaches such as support vector machines (svm).  In an ideal case it would be a pre-processor followed by a second method that is less "non-parametric".
I have given previous answers (link) that weakly answer this, but I think that a clean and complete answer is relevant for the learners in the field.
motivation:
There are several papers published [1,2,3,4] where the approach is described as "generally more accurate and incomparably faster (on massive in both dimensions datasets) than original Freidman's MART and Breiman's RF" and capable for tens of thousands of predictors (columns) of mixed type (categorical and numeric) and can include missing values, by tens of millions of samples (rows) when the "physics" are highly non-linear, multivariate, and noisy.
In these papers the fundamental tool is the 'Random Forest' as a pre-processor.  The general approach is to use the Random Forest to determine the important variables (columns) then using only those columns, operate with a much more sophisticated method.  In one case there is augmentation of the columns of the data to enhance determination of variable importance.  There are a number of alternative post approaches including Least-square fits, and ANOVA.
I personally have found this approach to be very useful, both with high and low dimensional data.  While it is published, I do not know that its utility has been demonstrated outside of a narrow part of the field, so I think many practitioners in the field do not know to use it.
While it is a heuristic argument, I think the fact that the majority of winning-est algorithms on kaggle are related to parallel ensembles (rf) and series ensembles (gbm) is a decent indication of the power of these families of methods.
details:
There should be two data-sets.  The first should be a "decent toy" like the one shown on the demos tab here, and the second should be a decent "big-boy" data set like the pre-processed version of the HIVA data.
Methods should use "default" or "textbook" settings.  Tuning outside of these is likely to result in less generalizable results.
Measures of interest should include both cpu time, and error.
(note to moderators: I think a question like this, and its answer are important and will provide value from cv readers.  I intend to provide an answer to this myself if no excellent answers are forthcoming.  consider this - it is very basic, but keeps getting up-votes because folks keep finding value in it.  This question is my follow-up to this meta question.)
Comment: Perhaps I am misunderstanding the approach, but would there not be an issue with an analysis conducted ignoring the random forest done beforehand? Presumably such an analysis might be overfitting/overconfident (something a proper random forest approach should be better at avoiding)? If not, any explanation for why that would not be the case would be very interesting.
Comment: I meant rf vs. rf followed by naive anova as if no model selection had been done. The latter seemed to be advocated by your initial question.
Comment: Are you familiar with Boruta? It is a feature selection tool that uses ensembles like random forest to discard irrelevant features; this seems related to this question.
Comment: @Björn - clarification request: it sounds like you are saying "comparing with rf based feature selection vs. without rf based feature selection might be useful".  Is that correct?
Comment: @Björn - however you like.  If you can make a good answer - give it a shot.
Comment: @Sycorax - I heart me some Boruta!  I have to daisy-chain it twice to fight the "shakespeare via infinite monkeys" problem, but it works quite well.  I've been toying with making a few homebrew RF-derived learners, stuff I haven't seen published.  I think they might have some good features.  I just get a little lost going through the few thousand lines of C in Breiman's original code. I was tempted to use the pure-G runtime, its decently efficient and runs on nearly everything but I think I would get too much shade for it.
Answer: Note: this answer is incomplete.
Toy Problem:
This is a trivial problem that is typically small in dimension and as accessible as possible to human intuition and learning.  Personally, I find this (link, link) demo to be accessible for my intuition and learning.  So do the folks at the Max Planck Institute for Biological Cybernetics.
The form of the "non-augmented" data is:
$$ \begin{bmatrix}
Class & X & Y\\
 A& x_1 & y_1\\
 A& x_2 & y_2\\
 \vdots & \vdots & \vdots\\
 B& x_n & y_n\\
\end{bmatrix}$$
The "physics" of the "good" class is a spiral starting at the origin while the bad class is uniformly random.  The human eye can see that quickly.  When evaluating "variable importance" we are trying to reduce the number of columns, but the non-augmented has no columns to reduce, thus we augment with random.  There is the problem of overlap, it would be better to reclassify some of the uniform random within a range of "ideal" to class "A".
So here is the code that makes the "non-augmented" data:
#housekeeping
rm(list=ls())

#library
library(randomForest)

#for reproducibility
set.seed(08012015)

#basic
n <- 1:2000
r <- 0.05*n +1
th <- n*(4*pi)/max(n)

#polar to cartesian
x1=r*cos(th)
y1=r*sin(th)

#add noise
x2 <- x1+0.1*r*runif(min = -1,max = 1,n=length(n))
y2 <- y1+0.1*r*runif(min = -1,max = 1,n=length(n))

#append salt and pepper
x3 <- runif(min = min(x2),max = max(x2),n=length(n))
y3 <- runif(min = min(y2),max = max(y2),n=length(n))

X <- c(x2,x3)
Y <- c(y2,y3)
myClass <- as.factor(c(as.vector(matrix(1,nrow=length(y2))),
        as.vector(matrix(2,nrow=length(y3))) ))

#plot class "A" derivation
plot(x1,y1,pch=18,type="l",col="Red", lwd=2)
points(x2,y2,pch=18)
points(x3,y3,pch=1,col="Blue")
legend(x = 65,y=65,
       legend = c("true","sampled A","sampled B"),
       col = c("Red","Black","Blue"),
       lty = c(1,-1,-1),
       pch=c(-1,18,1))

Here is a plot of the non-augmented data.

Here is the code to augment the "toy" for variable importance detection, and assemble into a single data frame.
#Create bad columns class of uniform randomized good columns
x5 <- sample(x = X, size = length(X),replace = T)
y5 <- sample(x = Y, size = length(Y),replace = T)

#assemble data into frame
data <- data.frame(myClass,
                   c(X),c(Y),c(x5),c(y5) )
names(data) <- c("myclass","x","y","n1","n2")

First a random forest (not yet with t-tests as in the Tuv reference) is used on all input columns to determine relative variable importance, and to get a sense of sufficient number of trees.  It is assumed that more trees are required to get a decent fit using low importance data than with uniformly higher importance data.
#train random forest - I like h2o, but this is textbook Breimann
fit.rf_imp <- randomForest(data[2:5],data$myclass,
                       ntree = 2000, replace=TRUE, nodesize = 1,
                       localImp=T )

varImpPlot(fit.rf_imp)
plot(fit.rf_imp)
grid()
importance(fit.rf_imp)

The results for importance (in plot form) are:

The mean decrease in accuracy and mean decrease in gini have a consistent message: "n1 and n2 are low importance columns".
The results for the convergence plot are:

Although somewhat qualitative, it appears that some acceptable level of convergence has occurred by 500 trees.  It is also worth noting that the converged error rate is about 22%.  This leads to the inference that the "classification error" within the region of "A" is about 1 in 5.
The code for an updated forest, one not including low-importance columns, is:
fit.rf <- randomForest(data[2:3],data$myclass,
                           ntree = 500, replace=TRUE, nodesize = 1,
                           localImp=T )

A plot of actual vs. predicted has excellent accuracy.  Code to derive the plot follows:
data2 <- predict(fit.rf,newdata=data[data$myclass==1,c(2,3,4,5)],
                 type="response")

#separate class "1" from training data
idx1a <- which(data[,1]==1)

#separate class "1" from the predicted data
idx1b <- which(data2==1)

#separate class "2" from training data
idx2a <- which(data[,1]==2)

#separate class "2" from the predicted data
idx2b <- which(data2==2)

#show the difference in classes before and after RF based filter
#class "B" aka 2, uniform background
plot(data[idx2a,2],data[idx2a,3])
points(data[idx2b,2],data[idx2b,3],col="Blue")

#class "A" aka 1, red spiral
points(data[idx1a,2],data[idx1a,3])
points(data[idx1b,2],data[idx1b,3],col="Red",pch=18)

The actual plot follows.

For a very simple toy problem, a basic randomForest has been used to determine importance of variables, and to attempt to classify "in" versus "out".
I have an older laptop.  It is a Dell Latitude E-7440 with an i7-4600 and 16 GB of RAM running Windows 7.  You might have something fancy, or something even older than mine.  You could have different OS, R version, or hardware.  Your results are likely to differ from mine in absolute scale, but relative scale should still be informative.
Here is the code I used to benchmark the "variable importance" random forest:
res1 <- microbenchmark(randomForest(data[2:5],data$myclass,
                                   ntree = 2000, replace=TRUE, nodesize = 1,
                                   localImp=T ),
                      times=100L)
print(res1)

and here is the code I used to benchmark the fit of a random forest to the important variables only:
res2 <- microbenchmark(randomForest(data[2:3],data$myclass,
                                    ntree = 500, replace=TRUE, nodesize = 1,
                                    localImp=T ),
                       times=100L)

print(res2)

The time-result for the variable importance was:
       min       lq     mean  median       uq      max neval
1 9.323244 9.648383 9.967486 9.84808 10.05356 12.12949   100

Over 100 iterations the mean time-to-compute was 9.96 seconds.  This is the "time to beat" for "incomparably faster" applied to the toy problem.
The time-result for the reduced model was:
      min       lq     mean   median      uq      max neval
 1.515134 1.598504 1.638809 1.634209 1.67372 2.038021   100

When computed over 100 iterations, the mean time-to-compute was 1.64 seconds.  Running on the important data, and only for "reasonable" number of trees, reduced the run-time by about 84%.
INCOMPLETE.
References:

http://www.statistik.uni-dortmund.de/useR-2008//slides/Strobl+Zeileis.pdf
https://arxiv.org/pdf/1804.03515.pdf (updated 11/27/2018)

Awaiting:

random Forest on non-toy, with timing.  HIVA is not the right data, even though I asked for it.  I need an intermediate set.
random Forest + t-test solution on toy, with timing
random Forest + t-test solution on non-toy, with timing
svm solution on toy, with timing
svm solution on non-toy, with timing


How to start the Snort service with logging enabled?

Question: I setup snort on Centos server and add as a service. When I use service snortd start command, the log file is created but it is empty. If I use snort -q -l /var/log/snort command, the log file created and filled with logs. What should I do in order to use service snortd start and have the logs work?
Answer: Edit the init script and add -q -l /var/log/snort to snort. Save and restart the service.
Answer: You should modify the /etc/sysconfig/snort file as options will be read from there. LOGDIR (-l) is set to /var/log/snort by default.
Answer: According to Snort Manual v2.9.11 written under The Snort Project
To read packets & record them to disc, we need to specify a logging directory that If not specified, by default It is created with name log in current directory. If log directory is not configured in snort, It exits with an error message.
So, you need to specify the logging directory in the init script while starting the snort itself by typing in :
./snort -q -dev -l /path/to/log/file

Now save the script and restart the service.
Also, consider giving your time to this Script by markus1982. It would be really helpful.


General solution of a differential equation nonhomogeneous

Question: I need to find the general solution of a differential equation
The equation is
$$
\frac{dy}{dt} + 2ty = \sin(t)\exp(-t^2)
$$
Any tips on how to begin or full answers?
Answer: if $y'+py=q$ then $u=e^{\int p}$ is a integrating factor.
In that case,$u=e^{t^2}$ since $p=2t$. so we have,
$$(yu)'=sin(t).exp(-t^2).exp(t^2)$$
$$(yu)'=sin(t)\implies yu=-cos(t)+c$$
$$y=(-cos(t)+c)exp(-t^2)$$
$$=-cos(t)e^{-t^2}+ce^{-t^2} $$
Note: If you are not familiar with this method please check; http://en.wikipedia.org/wiki/Integrating_factor
Answer: The first order linear ODE can be solved by using integrating factor. The integration factor is
$$
e^{\ \large\int2t\ dt}=e^{\ \large t^2+C}=e^{\ \large t^2}e^{C}=Ae^{\ \large t^2}.
$$
Multiply the ODE by the integration factor, yield
$$
\begin{align}
\frac{dy}{dt}\ Ae^{\ \large t^2}+ 2ty\ Ae^{\ \large t^2}&= \sin t\ e^{\ -\large t^2}\ Ae^{\ \large t^2}\\
\frac{dy}{dt}\ e^{\ \large t^2}+ 2ty\ e^{\ \large t^2}&= \sin t\\
\frac{d}{dt}\left(y\ e^{\ \large t^2}\right)&= \sin t\\
d\left(y\ e^{\ \large t^2}\right)&= \sin t\ dt\\
\int\ d\left(y\ e^{\ \large t^2}\right)&=\int\sin t\ dt\\
y\ e^{\ \large t^2}&=-\cos t+C\\
y(t)&=e^{-\ \large t^2}(-\cos t+C)\\
&=Ce^{\ -\large t^2}-e^{\ -\large t^2}\cos t.
\end{align}
$$


Is there a service to accompany my 16-year-old daughter through Athens airport that's not the airline?

Question: My daughter will travel from the UK to Athens in the summer. She is 16 years old and a little anxious having to do this for the first time on her own. I'm looking for a service to help her through Athens airport that's not the airline. Is there such a service? Any help would be much appreciated.
Comment: Why are you specific that it is not the airline? Providing service to un-acompanied minors is something airlines do.
Comment: In a similar situation I showed a young traveller some clips of airport arrivals that I found on YouTube. They found that reassuring. I assume she is being met in the airport?
Comment: @jcaron Sure, but the way the asker phrases it makes it sound more like a choice, to me. Most people would say that their airline doesn't offer the service, if that was the case.
Comment: @jcaron furthermore, some airlines that provide the service have an upper age limit that is below 16 years.  For example, Olympic Air has a maximum age of 12.  Some airlines, like British Airways, offer it optionally for older minors, but others, like Olympic, do not.
Comment: @PeterM not all airlines provide the service. Low-cost airlines often do not. Ryanair and EasyJet don't, for instance.
Answer: I'm afraid it seems the airport relies on airlines providing this service (see https://www.aia.gr/traveler/travellers-info/special-assistance).
As some airlines do not provide an escort service for UMs, you are faced with two options:

book with an airline which does provide the service
or give all the useful info to your daughter so she understands it's really not that hard.

Explaining to her what she needs to do, showing her the signs she must follow, and letting her watch videos on the topic should help her a lot. It's really not that hard:

follow the herd out of the plane until inside the terminal (this may just involve walking up a jetway, or that could involve walking down the stairs, taking a bus, and walking a bit more, but everybody else will be doing exactly the same thing, definitely nothing to think or worry about)
follow the signs that say "Baggage / Exit"
At passport control, enter the queue for "EEA visitors" (the language may be "EU visitors" or "EU passports" or "EEA passports" or something similar). It doesn't matter if she enters the other queue, it will just take a bit longer.
when she gets close to the counters, wait for a counter to be available to approach
show her passport to the officer and answer any questions (there probably won't be any)
look up on what carrousel the luggage is to be delivered. Remember to check using the airline/flight number and not just the origin airport, as there may be multiple flights from the same airport arriving at more or less the same time (and airport names are shown in greek half of the time, which makes it a lot less practical)
wait for luggage to come (can be a bit long sometimes)
pick up her luggage and double-check it's hers
follow signs for "Exit"
go through the Blue channel (EU arrivals)
look for whoever is waiting for her!

It seems like a long list, but I really went into a lot of detail. The short version is really: go to passport control, pick up luggage, exit.
Also, she has the advantage that she speaks English, so in case she has any issue she can just ask anyone for assistance.
I recommend you make sure she has international roaming activated on her phone before leaving (this may require an option to be activated on her contract and/or activation on the phone itself, sometimes separately for voice and data). That way she will be able to call you or even use video calling to show what's around her for help.
Another option is when dropping her bags at the origin airport, you may try to ask someone else on the same flight (and exiting at Athens as well) if she can tag along. Families with children are your best bet, as travellers going alone may not want the pressure and/or delay. In some departure airports it might be difficult as there could be many flights to very different destination dropping luggage at the same counters, but it never hurts to try.
She could also ask someone on board (like the person sitting next to her). If she feels too intimidated to do it herself, just have her call you once she's on the plane and ask her to give the phone to her neighbour and sort it out for her. Don't forget to check the person is indeed exiting at Athens and not connecting to another flight.
Comment: The passport signs are actually specified in the [Schengen Borders Code](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02016R0399-20170407), at Article 10, with model signs given in Annex III.  The signs are supposed to say ***EU, EEA, CH*** or ***All passports**.*  (There's also a ***Visa not required*** option, but I've never seen that in use.)
Comment: @phoog I have seen those signs quite a few times, but I have also seen quite a few variations, with many bordering on incomprehensible for most people. That's how you usually end-up with a planeload of Morrocans queuing at the "EEA" lane and being all reprimanded one by one by the IO. Don't know what the signs say in Athens.
Comment: I've never seen such a thing.  Where have you seen it?
Comment: @phoog I don't remember the exact wording, but it was at Toulouse airport, arriving from London, probably 3 years ago. It was one of those LED-dots signs, and it was stating something like "EEA PASSPORTS" or something like it. I think most EEA citizens have no idea they have an EEA passport...
Comment: Perhaps worth adding what to do if her luggage does not turn up?
Comment: @mdewey that's the point where you call mom :-)


Solid State Relay Voltage

Question: I have a basic solid state relay that switches an outlet on and off with a 9v input. Everything works good but I'm confused by the voltage readings I'm getting. The load side is reading 124 volts, and the line side is reading 118 volts, and I'm getting this reading whether the relay is on or off. Is this common?
Comment: Assuming you have a zero cross coupler inside you have to get enough voltage to gate the triac Also you may have some leakage in the trigger circuit. Your description indicates it is on.
Comment: Yes leakage to a 10 Meg DMM is common
Comment: If you want to suppress the voltage out,  add a load like a five watt bulb. Or a 1nF X rated cap.
Comment: Yes, it's common and one of the downsides with an SSR over a conventional relay.
Answer: When in its 'off' state, the SSR will still pass through a small leakage current. You can find its maximum value in the SSR datasheet.
If you have no load on the SSR output except a multimeter or oscilloscope, the very high input impedance of the DMM/scope will draw little current from the SSR. The leakage current will be enough to maintain a high voltage drop across the DMM/scope impedance. Hence the high voltage reading.
You don't say what your SSR load is.
Try connecting a continuous load, like a fan or light bulb, to the SSR output and measure again. You'll find that the small leakage current will be sunk by the load and you'll measure almost no voltage.

Solid State Relay Voltage


Where can I find a web-project "security checklist?"

Question: I'm looking for a complete list of security guidelines for programming and deploying PHP web sites and applications on an Apache (Linux) server. Basically, a "security check list" to run through before finishing a project. I.e.,

Cross Site Scripting
Cross Site Request Forgery
Sanitize form data that goes into database
Disable register globals and error reporting in custom php.ini
Upload files below web root
...(the list goes on)

I did some searching on the internet and in this forum, but couldn't find a comprehensive, succinct, and complete list of guidelines.
Thanks in advance.
Answer: I'd say you should find plenty of informations on the OWASP website, on the matter of vulnerabilities in web applications, and informations on how to help make yours more secure.
(But there is so much to say about that subject that you might actually get "more" informations than you'd first like...)
Answer: Check out this link "Seven habits for writing secure PHP applications":
http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/index.html
The IBM articles are always very useful, thanks.
PS: also this "Recommended PHP reading list"
http://www.ibm.com/developerworks/opensource/library/os-php-read/#security
Answer: I think there are two main categories, which should be considered:
Configuration & installation (for example): http://aymanh.com/checklist-for-securing-php-configuration
Programming (example):  http://www.jemjabella.co.uk/blog/php-security-checklist
Other ideas?
Answer: Take a look at OWASP's Development Guide.


Quantitative Analysis of Cardsort Data

Question: I'm working on some quantitative analysis procedures for cardsort (rank-ordering) type data.  Are there established best practices for something like this?  I was thinking cluster analysis, logit regression, or QCA as candidates.
Answer: I have used Donna Spencer's fantastic card sort analysis spreadsheet and find it to be a handy tool. She provides instructions on how to use it, and it comes fully loaded with formulas and macros. It's much easier to use on a closed card sort where you have provided users with the category names. On an open card sort, you have to use your best judgment to normalize the user-provided names into common category names. And that is the most difficult part. Good luck! I find that there is still a lot of manual work involved in trying to figure out people's intent behind their name choices, but you will still have access to individual records, so you can spot patterns within their choices and apply your own boundless empathy to make sure you're not misinterpreting.
Comment: That's a very good procedural analysis, but what I'm really looking for are quantitative techniques more sophisticated and robust than the basic correlations she discusses (she spends a great deal of time going over what is essentially formatting & data hygiene but very little on actual analysis).
Answer: Have you looked at the tools offered by Optimal Workshop in their OptimalSort and Treejack?
They offer a Similarity Matrix for identifying obvious clusters and dive into alternate pairings.
Dendrograms to visualize content groups and the top labels by participants.
Participant-Centric Analysis that produces different IA structures.
I found that rather than doing detailed analysis, you can first set up a card sort and then validate the groupings by looking at the task success rate in the tree analysis. It goes along with the concept of failing quick and fast to find the best IA for your content.

Quantitative Analysis of Cardsort Data


Splash page with a don't show again, check-box

Question: I'm thinking I could develop a Visual force splash page to notify users. And include a 'don't show again' check-box. Has anyone accomplished something similar and do you have any suggestions?
As for the check-box it could check a flag condition or is there a way to check sessions variables?
Or would the custom home page component be a better option?
Answer: A hierarchical custom setting where you can specify a value per user, could be a possible solution to hold the dismiss value once a user has checked it.
http://blog.jeffdouglas.com/2010/02/08/using-hierarchy-custom-settings-in-salesforce-com/
Answer: Depending on how you would like to implement this, Salesforce already provides some options.
Custom tab's allow a "Splash Page Custom Link" to be defined, the Custom links that show in the drop down are configured under Setup -> Customize -> Home -> Custom Links. And one of the link types you can create is a visualforce page.

As part of the splash page, there is a checkbox where the user can turn off the splash page.
So this will only work if you are able to define it as part of a tab, but hopefully this meets your needs.
Comment: I like this, thanks for taking the time. I guess there's no way to add a temporary custom page to the current Home tab? I see you can make home tab components and new layouts. It's too bad can't have a layout show for a period of time.
Comment: It would be possible to use a home page component, but it would require the ajax toolkit, and the use of unsupported salesforce features (i.e it could break at any time). I will post it as another answer if you're interested
Comment: Sure, if you have the time. I'm familiar with the ajax toolkit. I've used some ajax in other projects prior.
Answer: As requested, here is some sample javascript for using the ajax toolkit from a homepage component. There are 2 ways you could keep track of the users splash page preference both outlined in other answers, my preference would be custom settings.
Working with custom settings in the ajax toolkit is not the same as apex code, there is no cache. You need to query the settings with soql, I've added comments for how I would handle the query.
<code><script type="text/javascript">
    //ApiUtils is unsupported internal javascript and could break at any time
    var __sfdcSessionId = ApiUtils.getSessionId();
</script>
<script src="/soap/ajax/26.0/connection.js" type="text/javascript"></script>
<script type="text/javascript">
    //UserContext is unsupported internal javascript and could break at any time
    var userId = UserContext.userId;
    //get the custom settings
    var result = sforce.connection.query("Select Id, Show_Splash__c from Custom_Setting__c WHERE SetupOwnerId = '" + userId + "' LIMIT 1");
    //if there is no result (the custom settings do not exist for the user) or Show_Splash__c == true
    //use javascript to redirect to your splash page
</script>
</code>
Once redirected to the splash visualforce page you have all the tools back, and you can more easily manipulate the custom settings in the controller.
Answer: One interesting thought is lets have a boolean on user Object and a jquery component inside the Visualforce component or a simple visulaforce component using javascript and lets render on the page depending on the boolean thats set by user using getter setter on the page .You may use outputPanel to hold the component and use render attribute to decide to whether show on the page or not.
Thanks


Upgrade from Ubuntu 17.04 to 17.10 in VirtualBox 5.1.26 - very slow!

Question: Just upgrade from Ubuntu 17.04 to 17.10 in VirtualBox 5.1.26, very slow. It is unusable. It is running 4G RAM for Ubuntu 17.10. Any idea?
Comment: What does `top` say?
Answer: I had the same issue (8GB ram, 4 cpu's). The gnome-shell process constantly uses 10% cpu.
Disabling 3d acceleration did fix it (I didn't have 2D enabled as Virtualbox complains about it). Before you disable 3d acceleration be sure to disable the Virtualbox graphics driver under "Additional Hardware" inside of Unity. If you don't do that gdm3 won't even load.
The Unity desktop is still available and works fine, but one of the reasons to upgrade is to use Gnome. Even logging into unity and doing Additional drivers didn't help gnome.
Comment: With 17.04 I could even watch youtube videos in HD fine. Now in 17.10 everything lags. I don't know why though
Comment: Hopefully this is just a bug and will get worked out. For now not having 3D acceleration works for me, but it was even worse before
Comment: Works but anything graphics related lags and freezes whole machine
Comment: Yeah, but before this resizing a window caused the whole machine to crash, so it is at least better than that.
Answer: I disabled 2d acceleration in virtual box. It seems fine now.
Comment: FWIW, both 2D and 3D acceleration needs to be disabled in VirtualBox - only disabling 2d acceleration didn't work for me.
Answer: With or without 3D it was all laggy for me on VirtualBox 5.2.8, host Mac OS X High Sierra and guest Ubuntu 7.10.
Switched to Unity and lag is gone.
Comment: Thanks! This worked for me, but only after installing VirtualBox Guest ADditions as well.
Comment: Ya thanks for this... switching to Unity fixed all my issues. I already had updated guest additions suspecting that might be the culprit; but `gnome-shell` was using 60%+ cpu.
Answer: It seems that the Wayland display server may be the source of this bug.
I already had 2D and 3D acceleration deselected and was still getting very slow performance from Ubuntu17.10.
Clicking the gear icon beside the "Sign In" button on the log in screen gives the choice of using the default display server (Wayland) or Xorg and when I chose Xorg the flickering and high cpu usage all disappeared without having to switch to Unity.
Apparently the forthcoming 18.04 LTS will revert to using Xorg by default
Comment: My only options were `Xorg` (already selected), or `Unity`, the Xorg one was causing massive lag and crashes every time I tried doing anything - resizing windows etc. And `top` showed 60%+ constant CPU usage by gnome.  Selecting `unity` from this gear when logging in made all the problems go away, and gave me back all my wasted top space so that my apps didn't all have 4 toolbars worth of space being wasted on screen.


Linux support for new Sony Vaio Z external graphics card?

Question: The new Sony Vaio Z series laptop comes with a media dock that has a USB connection (Light Peak) to an external AMD Radeon graphics card. What is the support for devices like this in Linux?
Comment: @TikhonJelvis not much going on here, I am thinking the best chances are going to be in this mailing list: http://lists.launchpad.net/sony-vaio-z-series/
Comment: I'm curious: have you had any progress since asking this question? I have the same laptop, and everything works, except I can't get external monitors connected to the power media dock and I can't connect the dock to the computer if it's running.
Comment: @avilella: Thanks to pointing me to the mailing list; it looks to be a useful resource. Do you have a Vaio Z as well?
Comment: @TikhonJelvis: I used to have a Sony Vaio SZ and created the mailing list to bring Linux users together to share their expertise. Now I have an Asus U33JC.
Comment: @avilella: Since nobody's given a more useful answer than your comment--and your comment *is* useful--why don't you post it as an answer?
Answer: The best chances are going to be in this mailing list: http://lists.launchpad.net/sony-vaio-z-series


Fedora 30 dual boot possible with Windows 7?

Question: My current OS is Windows 7. I have 1 HDD (1 TB). It has a drive C: (100GB), a drive D: (~800GB), and unallocated disk space (100 GB) I intend to use for Fedora.
Can I dual boot Fedora 30 with Windows 7 (To use both of these OS)?
Answer: Sure you can,
boot from a live disk or USB drive and make sure to install you new system on the targeted disk. It's a good idea to make a backup of your important data just in case.
Answer: Yes, you can! (as The Man said).
When you install Fedora (and many other modern distros), you are given the choice to take then entire disk (which you don't want), to use available unused space (excellent choice), or to resize an existing partition (such as D: or C:) and give some of that space to Linux (not necessary from your description).
Each Linux kernel only takes around 10 MB, but new kernels may be worth adding for your consideration. Other minimum space requirements include:

Directory Min. size
  /     250 MB  (where your kernels live)
  /usr  250 MB  (avoid placing this on a separate partition)
  /tmp  50 MB
  /var  384 MB
  /home 100 MB  (this is where your data will live)
  /boot 250 MB

Having a separate swap partition is passe, as ever since the 2.4 kernels, swap files run just as fast.


Why do we parametrize matrices?

Question: I'm learning about rotation matrices in class and one of the topics mentioned to parametrize a matrix.
What do we need to do this?
For further reference: https://www.youtube.com/watch?v=Y8gB7nvtmrU
Answer: I can't really think of a good example of when to parameterize a system of equations involving rotation matrices, but one general thing we can gain from parameterization regardless is a clear indication of the subspace that solves a linear systems of equations. For example, the video you linked shows that the solution to:
$$
  \left[ {\begin{array}{cccccc}
    1 & -4 & -2 & 0 & 3 & -5\\
    0 & 0 & 1 & 0 & 0 & -1\\
    0 & 0 & 0 & 0 & 1 & -4\\
    0 & 0 & 0 & 0 & 0 & 0\\
  \end{array} } \right] \mathbf{x} = 0,\  \mathbf{x} \in \mathbb{R}^{6\times 1}$$
is the linear subspace spanned by:
$$
  \left[ {\begin{array}{ccc}
    4 & 0 & -5  \\
    1 & 0 & 0  \\
    0 & 0 & 1 \\
    0 & 1 & 0 \\
 0 & 0 & 4 \\
 0 & 0 & 1 \\
  \end{array} } \right]   \left[ {\begin{array}{c}
    v_1 \\
    v_2  \\
    v_3  \\
  \end{array} } \right] \subset \mathbb{R}^{6}
$$
where $\mathbf{v} \in \mathbb{R}^{3}$. As far as actual applications go, I suppose you could look at solutions to different robotics equations (forward/inverse kinematics) as constrained subspaces of your original space. My best guess as to why parameterization has been brought up alongside rotation matrices it to find solutions that lie in a certain subspace once a rotation has been applied. However, given the orthonormal nature of rotation matrices, you would be needing to solve for a solution subspace only given that the constraints you are trying to satisfy already lie in some linear subspace (that might be confusing, just think about how a point only has one vector "pre-rotation" that could now satisfy that point, while a line would have a line "pre-rotation" as well). If anything you would be more likely to parameterize a Jacobian or generally any other matrix that can have free variables.
To talk about a parameterizable matrix in robotics, consider a prismatic robot with two joints that both move in the z-axis only. Since you are just now learning about rotation matrices, I won't define this robot's Jacobian or anything like that - so just trust me that:
$$ \mathbf{q}_{} = \left[ {\begin{array}{c}
    1 \\
    -1  \\
  \end{array} } \right] x \subset \mathbb{R}^{2}$$
is the linear subspace of joint configurations where the robot's end-effector is in some consistent configuration - having $\mathbf{q}$ represents the robot's configuration and $x \in \mathbb{R}$. As far as revolute joint robot's go, you will only be able to use this technique at instantaneous configurations. I personally wouldn't lose much sleep over the concept, it's a cool way to think about solutions that lie in a given subspace - but techniques like singular value decomposition accomplish the same ideas in a much more relatable-to-robotics kind of way.

Why do we parametrize matrices?


Time-ordering in QFT

Question: In Srednicki QFT page 37. In the derivation of LSZ reduction formula, he introduces the time-order operator $T$, so no time-dependent creation/annihilation operators are left in the transition amplitude. How can this be justified mathematically? And if I understand this correctly, if time ordering is not used, then a term like  $$\langle 0\mid a_{1}\left ( -\infty  \right )a_{2}\left ( -\infty  \right )a_{1^{\tilde{}}}^{\dagger}\left ( \infty  \right )a_{2^{\tilde{}}}^{\dagger}\left ( \infty  \right )\mid 0\rangle $$ this mean that there's a contribution that depend on the amplitude of transition from the final momenta to the initial momenta but quantum mechanically the final momenta are not known in advance so such a term can't contribute to the process. Does this explain the use of time-ordering physically?
Comment: What do you mean by "justified mathematically"?
Comment: He, probably, means "obtained mathematically as a result of mathematical transformations". It might be there is an implicit deception there.
Answer: I give a full answer to the time-ordering operator in Srednicki's derivation here
To summarize:

Inserting the time ordering symbol $T$ in (5.14) is completely justified just by the definition of the $T$.
The result (5.15) in Srednicki should be interpreted this way: terms containing ladder operators, such as the one you gave, do not contribute additionally to (5.15). because of the following:
The inserting of T in the term on the last line of (5.15):
$$\langle0|\varphi (x_1)... \varphi (x_1)|0\rangle \rightarrow \langle0|T \varphi (x_1)... \varphi (x_1)|0\rangle$$
Neatly cancels out many terms containing ladder operators, this corresponds to writing the operator product time ordered product as a combination of time ordered and normal ordered products, in the canonical derivation of Wick's theorem.

With regards to "there's a contribution that depend on the amplitude of transition from the final momenta to the initial momenta but quantum mechanically the final momenta are not known in advance so such a term can't contribute to the process.". Contrary to your suggestion, in quantum mechanics all we can compute is transition amplitudes from initial to final momenta. To do this you do not need to know the final momentum, the transition amplitude to a certain momenta gives you the probability amplitude the the initial state, after some evolution, will become that particular final state.

Time-ordering in QFT


Return by immigration officials

Question: I was returned from entering SA by a immigration officer because I couldn't show them funds in my account and my passport was stamped and (ADMISSION APPLIED FOR) was written in it. What does that mean?
Answer: You presented yourself at the South Africa border, seeking to enter South Africa.
After examining you, South Africa immigration refused to allow you to enter South Africa.
This is a "Refusal of Entry." It is not a "visa refusal" nor is it a "deportation."
Answer: It means you've been sent home for not meeting entry requirements, you've been denied entry into the country.
It does NOT mean you can't attempt to get in again once you've met those entry requirements.
In short, the border agent was not convinced you'd be able to support yourself during your stay in the country without resorting to working without a work permit or committing some other crime, therefore you were returned to your point of origin. He did not consider this important enough to deny you future entry into the country by blacklisting you from future entry.
So once you get the money together so you can show you can support yourself during your stay you're probably free to enter (unless of course there are by then other factors to deny you, let's hope that's not the case).

Return by immigration officials


Do I need transit visa in Moscow while travelling from Guangzhou, CN to Vienna - VIE]

Question: I am an Indian Passport holder. I do not want to leave SVO, Moscow airport. Do I still need transit visa for travelling from Guangzhou, CN to Vienna - VIE? Will 3 hours  be enough to pass through all immigration and others issues?
Answer: If you don't plan to leave the airport, and you your connection is shorter than 24 hours, you don't need a transit visa. When arriving in Sheremetevo, you should be in possession of the ticket for the next flight leg, with confirmed seating. (Acc to http://www.svo.aero/transit/int-int/.)


Optimal directory structure for keeping millions of files on an ext4 system

Question: I need to keep millions of files on an ext4 system.
I understand that having a structure with multiple subdirectories is the general accepted solution. I wonder what would be the optimal approach in terms of number of dirs/subdirs.
For example I tried a structure like 16/16/16/16 (that is, (sub)directories from 1 to 16) and I found that I am able to move 100K files to this structure in 2m50s.
When trying to move 100K files to a 8/8/8/8/8/8 structure it took 11 minutes.  So the 16/16/16/16 approach seems to be better but I was wondering if anyone has some empirical experience with an even better dir/subdir distribution.
Answer: 1) XFS now is better choice than EXT4.
2) Even 1024 per directory entries should be quite okay, so you can appropriately reduce level of sub-dirs depth.
Answer: After lots of testing I figured out a solution that works for me just find and I hope it may help others as well:
I created a 255/255 dir structure and then I used the ramdisk (/dev/shm) to quickly create the directories and then save files inside them. Then once every minute I move the files to HDD.
Using this approach reduced the time to save 100K files in 255/255 directories from about 5mins to some 5 seconds.
Comment: What tool did you use to move files from ramdisk to HDD? `mv` or `rsync` or ?


Is it possible to show only a path on content tree and media library on Content Editor?

Question: I am planning to create a custom Content Editor view wherein Editors can only view a part of the /sitecore/content tree and /sitecore/media library tree. I am aware of how to configure it in the Core DB by creating a custom button and creating a link /sitecore/shell/Applications/Content%20Editor.aspx?sc_bw=1&fo={GUID}&ro={GUID} but so far I can only make one tree show up. Is it possible to have two trees displayed using this?
Comment: You can manage this by creating custom Roles as well.
Comment: You should use role based access to achieve the same instead of trying to create a custom Content Editor. Based on roles, users will see parts of Sitecore content tree - https://doc.sitecore.com/xp/en/developers/92/platform-administration-and-architecture/create-and-set-up-a-role.html
Answer: Yes, it's possible through Sitecore roles.

Create a new Role in Role Manager
Inherit "Sitecore Client Users" and "Sitecore Client Authoring Roles" into the new role created in step1.

Sitecore Client Users role allows the user to login into the Sitecore portal.
Sitecore Client Authoring role will provide basic authoring access to the content and media items.

Once the role is created, apply the newly created role to the user.
Verify the changes by logging into the Sitecore with user mapped with new role, now you are able to see only Content, Form and Media Library Nodes.

Note: Sitecore Client Authoring role by default inherits from Author and Forms Editor Roles, if you want to disable Form editing you can explicitly deny read access to forms in your new Role.
Also, you can add few more other roles to provide publishing access etc..,


Force a user to write the first number (html)

Question: I have  a field for phone number but i dont want users to put like +1 but instead to write the local number .
How can i make the number to start with  6?
this is the input :      how can i disable the +1  nor
Comment: If you are talking about the new HTML5 ``, then you can apparently ([according to MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input)) specify a `pattern` attribute, so you could set it to numeric only. Bear in mind that you can't *rely* on the browser actually validating this though, as older or simpler browsers won't have implemented this feature.
Comment: Your question is confusing.  Perhaps some examples would make it clearer what you are asking.
Comment: When im commenting this comment, the input field wont let me write words but only input numbers,i want on a input field to start with an number then you can write whatever is needed.
Answer: If I've understod this correctly then you just might wanna add a placeholder as an element to the input, stating the user to type the local number. Another solution might be to add a value to the input. Both very simple things to add if it's the desired outcome.
<input type="text" placeholder="Write local number"/>
<input type="text" value="6"/>

Example to the two solutions:
JSfiddle
Comment: Like that but i want if user types 4 in the beggining of the form it should alert that the number should start with a 6 then u can put anything you like after it..
Comment: Nevermind,i used a  minimum and maximum to make sure the phone number is correct. thanks
Answer: I  used a  minimum and maximum to make sure the phone number is correct. thanks.
so practically is kinnda the same as what i was wanting
This is what i used:
Comment: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment).


How do I annul my vows?

Question: I think there are things I've done three times and no longer do, or things I've committed to doing verbally, and I suspect they may have the status of a vow. How do I go about doing hataras nedarim on these actions? Do I need to gather three men and say something? English, Hebrew?? Do I need to specify each and every thing I've possibly vowed?
Comment: That is what we do every erev yom kippur
Answer: The Shulchan Arukh (Yoreh De'ah 228:1) writes:

One who took a neder [sic: vow] and regrets it, can rectify the acceptance of the neder by having remorse. Even if one took a neder with the name of G-D. What should that person do? They should go to a wise [Torah Scholar] who is an expert, who [is well versed in] learns logical inferences and deductive (talmudic) reasoning. If there is no expert, one should go to three average people. These should be people who study with logical inferences and deductive reasoning, and who also know how to find loopholes; and they will release the vow. Nowadays there is no one considered to be an expert who is able to release a vow solely by themselves.

A bit further, the SA asks "How can you nullify a never?", on which it explains:

You say three times "mutar lach" or "mochal lach" (you can say this in any language)

The Rambam in Mishneh Torah writes:

How are oaths absolved? The person who took the oath should present himself to the distinguished scholar, or to three laymen if no expert is available, and say: "I took an oath concerning this and that, and now I am sorry. Had I known that I might be distressed because of it to such a degree, or that such a thing might happen to me, I would not have taken the oath. Had I known at the time of the oath what I know now, I would not have sworn." Thereupon the scholar, or the eldest of the three laymen, should say to him: "Have you regretted it indeed?" And he should reply: "Yes." Then he should say to him: "You are set free, you are pardoned," or anything similar in meaning in any language. If, however, he said to him: "Your oath is void," or "Your oath is eradicated," or something similar in meaning, what he said is of no avail, because none except a husband or a father can revoke an oath. A scholar may use only terms of absolution and pardon.

See also: Hatarat Nedarim (Annulment of Vows) and the Taz on doing it in your own language (בכל לשון שיאמר)

How do I annul my vows?


What is Fox doing when he is on the phone with Scully?

Question: In X-Files S5E10 "Chinga", Scully calls Mulder on the phone from Maine in order to ask him questions about the doll case she's working on. In the background of the call, Scully asks him what he's watching on TV in his office, and he casually says something along the lines of "World's Deadliest Swarms". Clearly the voices heard are of female persuasion, and the moans and groans sound as if he's watching pornography. At the same time, Mulder's hand is not visible on his desk or on the phone. Are we to believe that Mulder was masturbating in his office? If so, what would the repercussions be for an FBI agent of his caliber?
Comment: They'll give him the basement office and treat him with no respect. Oh, right.
Comment: It's not really that far-fetched as it's a "known secret" that Mulder is very much into porn.
Comment: repercussions? Higher ratings for X-files from all the lonely nerds.
Comment: Strong parallels between this and Runcle's work actions in Californication...
Comment: I've never seen the episode (and doubt Fox was pleasuring himself, plot-wise), but I find the question interesting /amusing in light of what the episode title means to many non-english speakers...
Comment: If you're able to see it (e.g. Netflix? don't know...), go for it. It's a really great episode all around "Scully on her own".
Comment: I love this kind of humour in X-Files, it's really well done and very entertaining. One of my favourite episodes is, basically, a full episode of this strange comical intrigue and misdirection. It's ***Jose Chung's From Outer Space*** (S3 E20) but also, ***Bad Blood***, ***War of the Coprophages*** and more, they all have this fantastic comic intrigue that I love.
Answer: from transcript - scene 3:

(X-Files office. Mulder is eating sunflower seeds and watching television. Lots of groaning and moaning from a male and a female voice. Empty video cassette box on MULDER'S desk reads "Alien Probe." Phone rings.)

and:

MULDER switches off TV, which now shows man being attacked by bugs
Comment: I think this is just one of the many "casual Mulder" scenes trying to lure the viewer into thinking of some "ah, we all knew it", which is then revealed as some "hah, got you, it's not!" moments (which is kind of opposite of the show's general promise, considering there's almost always some monster of the week or some conspiracy (sub) plot). While I can't name any other out of my mind, there have been quite a few throughout the series.
Comment: "Alien Probe" could sound like a porno. Maybe his work was getting to him :P
Answer: In the scene you described, Mulder is watching "World's deadliest swarms" while talking to Scully and eating sunflower seeds.
Mulder's hand is momentarily visible behind the desk and you can see that he is cracking open the sunflower seeds. Then the phone rings and he picks it up. He is definitely not masturbating while eating sunflower seeds.
During the telephonic conversation between Scully & Mulder, you can see there are two television sets: one that Mulder is watching & the other on which Scully is seeing the CCTV footage of the store.
If you have the same version of episode I have then at 7'37" you can see the footage of a man being attacked by a swarm of bees.
Here is the scene:

[Mulder's office. Mulder sitting on his chair behind his desk & eating sunflower seeds while watching TV. Man, Woman Moaning on TV]
[Phone Rings, Mulder pics up.]
Mulder: Mulder!
Scully: Mulder, It's me.
[Moaning continues on TV]
Mulder: I thought you were on vacation.
Scully: I am, I am up in Maine.
Mulder: I thought you said you didn't want to be disturbed. You wanted to get out of your head for a few days.
Scully: I don't. I mean, I do. I... uh...
[Moaning grows louder on TV.]
Scully: What are you watching, Mulder?
Mulder: It's the "World's Deadliest Swarms." Um--  You said you were gonna be unreachable. What's going on?
[Mulder picks up the remote and mutes the TV]
[In Market's security office now. Scully & Sheriff watching the CCTV footage.]
Scully: I, Uh-- I'm at a market here. I'm just trying to give the local P.D. a handle here.
Mulder: A handle on what?
Scully: Well.. I'm not quite sure how to describe it, Mulder. I didn't witness it myself, but there seems to be some kind of an outbreak of people acting in a violent, involuntary way.
[CCTV footage shows what Scully is describing]
[Mulder's office again. Mulder walking towards TV.]
Mulder: Towards who?
Scully: Toward themselves.
[ON MULDER'S TV, A MAN IS BEING ATTACKED BY BEES. MAN IS KNEELING DOWN AND IS IN PAIN. MULDER THEN TURNS OFF THE TV.]
Mulder: Themselves ?
Scully: Yeah. Beating at their faces; clawing at their eyes.
[Market Security office again.]
Scully: One man is dead.
[CCTV footage shows people attacking themselves]
Mulder: Dead how ?
Scully: Self-inflicted, it appears.
Mulder: Huh.  It sounds to me like that's, uh, witchcraft or maybe some sorcery that you're looking for there.
Scully: No, i don't think It's witchcraft, Mulder, Or sorcery.
[Sheriff amused by Mulder's Ideas.]
Scully: I've had a look around, And I don't see any evidence of anything that warrants that kind of suspicion.
Mulder: Maybe you don't know what you're looking for.
Scully: Like evidence of conjury, or the black arts or shamanism, divination, wicca, or any kind of pagan or neo-pagan practice. Charms, cards, familiars, Bloodstones or hex signs or any of the ritual tableau associated with the occult, santeria, Voudom, macumba or any high or low magic.
Mulder: Scully?
Scully: Yes?
Mulder: Marry me.
Scully: I was hoping for something a little more helpful.
Mulder: Short of looking for a lady wearing a pointy hat, riding a broomstick, I think you've pretty much got it covered there.
Scully: Thanks anyway.
Comment: Pretty sure he changed it to the swarm show.


Nagios host notifications not sending via email or logging

Question: I am re-doing our nagios infrastructure with puppet but I am currently stopped at a seemingly simple problem (most likely a config issue).
Using puppet, I spit out some basic nagios config files on disk. Nagios reloads fine and everything looks okay in the UI but, when I mark a host down, it does not send a notification.
nagios.log shows:

[1470699491] EXTERNAL COMMAND:
  PROCESS_HOST_CHECK_RESULT;divcont01;1;test notification
[1470699491] PASSIVE HOST CHECK: divcont01;1;test notification
[1470699491] HOST ALERT: divcont01;DOWN;HARD;1;test notification

In production (where I have changed nothing), I see in nagios.log (after marking a host down in ui):

[1470678186] EXTERNAL COMMAND:
  PROCESS_HOST_CHECK_RESULT;PALTL12;1;test ey
[1470678187] PASSIVE HOST CHECK: PALTL12;1;test ey
[1470678187] HOST ALERT: PALTL12;DOWN;HARD;1;test ey
[1470678187] HOST NOTIFICATION:
  pal_infra;PALTL12;DOWN;host-notify-by-pom;test ey
[1470678187] HOST NOTIFICATION:
  pal_infra;PALTL12;DOWN;host-notify-by-email;test ey
[1470678192] HOST ALERT: PALTL12;UP;HARD;1;PING OK - Packet loss = 0%,
  RTA = 0.81 ms
[1470678192] HOST NOTIFICATION:
  pal_infra;PALTL12;UP;host-notify-by-pom;PING OK - Packet loss = 0%,
  RTA = 0.81 ms
[1470678192] HOST NOTIFICATION:
  pal_infra;PALTL12;UP;host-notify-by-email;PING OK - Packet loss = 0%,
  RTA = 0.81 ms

As seen in the logs, there is a HOST NOTIFICATION logged and sent directly after the HOST ALERT in prod. I have been exhaustively comparing config files today and I cannot find a reason why the new config stops short of the notification.
I have verified that notifications are enabled at the top level. I have verified that email can be sent from this box (though, I am using the logs to verify functionality, not email). I have also tried multiple other google suggestions (and will continue my search too).
Relevant config details below. Please pardon the verbosity of my configuration and lackluster stack-overflow formatting. Thank you in advance.
hosts/divcont01.cfg:

define host {
<code>  address              snip
  host_name  divcont01
  use          generic-host-puppetized
</code>
}

host-templates/generic-host-puppetized.cfg:

define host {
<code>    check_command                  check-host-alive
    check_interval                 1
    contact_groups                 generic-contactgroup
    checks_enabled                 1
    event_handler_enabled          0
    flap_detection_enabled         0
    name                           generic-host-puppetized
    hostgroups                     +generic-host-puppetized
    max_check_attempts             4
    notification_interval          4
    notification_options           d,u,r
    notification_period            24x7
    notifications_enabled          1
    process_perf_data              0
    register                       0
    retain_nonstatus_information   1
    retain_status_information      1
</code>
}

hostgroups/generic-host-puppetized.cfg:

define hostgroup {
<code>    hostgroup_name                 generic-host-puppetized
</code>
}

contactgroups/generic-contactgroup.cfg

define contactgroup {
<code>    contactgroup_name              generic-contactgroup
    members                        generic-puppetized-contact
</code>
}

contacts/generic-puppetized-contact.cfg

define contact {
<code>    use                            generic-contact
    contact_name                   generic-puppetized-contact
    email                          <my email>
</code>
}

objects/templates.cfg (generic-contact config only)

define contact{
<code>    use                             my email
    name                            generic-contact         ; The name of this contact template
    service_notification_period     24x7                    ; service notifications can be sent anytime
    host_notification_period        24x7                    ; host notifications can be sent anytime
    host_notification_commands     generic-puppetized-contact-host-notify-by-email-low
    service_notification_commands  notify-by-email,service-notify-by-pom
    service_notification_options    u,c,r,f         ; send notifications for all service states, flapping events, and scheduled downtime events
    host_notification_options       d,r,f           ; send notifications for all host states, flapping events, and scheduled downtime events

    register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
</code>
}

commands/generic-puppetized-contact-host-notify-by-email-low.cfg:

define command {
<code>    command_line                   /etc/nagios/global/scripts/nagios-mailx.sh -t my email -s "** notification Host Alert: hostname is hoststate **" -m "***** Nagios ***** Notification Type: notification type Host: host State: hoststate Address: address Info: output Date/Time: date"
    command_name                   generic-puppetized-contact-host-notify-by-email-low
</code>
}
Answer: Figured it out...I was building my system within another pre-existing system (dangerous, I know) and my contacts were actually pointing to a generic-contact that had its notifications disabled.
Whoops :)


How to really decide whether an entity is weak or not

Question:
This is the ER diagram example from the Wikipedia. Here they have marked the Orders entity as a strong entity.
As I understand a weak entity is an entity which cannot exist without a corresponding strong entity.
In this case, I think the Orders entity is existence-depended on the Customer entity. Because an Order would not exist without a corresponding customer.
So even though we can have a primary key for the Orders entity isn't it depends on the Customer? Isn't it needs to be a weak entity?
 I will be glad if someone can explain this.
Answer: In the Wikipedia article you are referring to, it says:

a weak entity is an entity that cannot be uniquely identified by its attributes alone

The idea is that the entity by itself contains incomplete information; in the example depicted, there could be several OrderItem entities which all have the same attributes (if you don't count the OrderNumber FK), but are actually related to different Order entities.
In contrast, each Order is uniquely determined by its primary key. Yes, there exist a relation with the Customer, but note that the order doesn't lose its identity if the reference to the CustomerNumber is removed. (Sure, it's a little weird to have an order and not know who the customer is, but the way this is conceptualized, the order really exists independently of the customer, once created.)
Answer: There is a bit of wiggle room whether some concept should be modelled as an entity or as a weak entity.
You notion that weak entities cannot exist without another entity isn't wrong, it's just not the defining feature. Strong entities can reference other entities without becoming weak entities.
Instead, we should ask whether the entity exists independently of the values it contains. In databases, this question is usually equivalent to: does this entity have an ID?
Strong entities exists regardless of what values they have, so they can only be identified by their ID. In your data model: two different customers can live at the same address, but are different customers because they have a different CustomerNumber. Here, it is modelled that Orders have an OrderNumber.
Weak entities are identified by their values. Here, OrderItems are identified by the combination of Order+ItemLineNumber (a composite key). The ItemLineNumber is not a primary key on its own because multiple items can have the same line number, if they are part of different Orders.
Of course this could have been modelled differently. The Orders could be a weak entity that's identified by Customer+OrderNumber. Or each OrderItem could have an ID field, elevating it to a strong entity.
So when should you chose which variant? This depends entirely on the context. The "X belongs to Y" or "X cannot exist without Y" rule is a good heuristic that X might be a weak entity. Then you think about the problem domain. E.g. in my country invoices need to have a unique number, so it makes sense to use the invoice number as an ID for the order – the order has a natural key/domain key. You should also think about how the database will be queried. If an entity is the target of some foreign key reference, queries will be much easier if it is a strong entity with an ID – you can assign a surrogate key/synthetic key.
Comment: A very good explanation!. But one more thing. When deciding whether it's weak or not, do we have to consider the real nature? for an example now in an insurance company really, A vehicle entity really depends on the customer. But in nature, it can exist on its own. But in the DB it won't make any sense to have a vehicle without an owner.  I think this is what you are saying by problem domain. right?
Comment: @NuwanKarunarathna We don't need to model all details of reality. The data model is a *simplified view* that is more convenient to work with. The "problem domain" is a common term to describe the set of concepts, constraints and requirements that we need to solve. The "insurance company" would be one problem domain, "car dealership" a completely different one. How we should model something can only be answered in the context of the problem domain. A car may or may not be an entity for an insurance company, but it would likely be an entity for a car dealer.


Can I Polyurethane a room in sections

Question: Hi I'm currently working on trying to finish the floor in my art room/studio in my home. It is an old hardwood floor, as the house was built in 1914 and I'm unsure of the age, finish or stain, all I know is it's rough and I would like to seal/polyurethane it. When we purchased the house the floors were carpet overtop the wood. The problem is I have several large things in this area that are difficult to move around. I'm curious if I can finish half of the room, move the stuff, and finish the other half. I'm not concerned with appearance, so differences in color or lines where sections meet is fine, I just need it smoother than it is now. Im not very knowledgeable about home improvement but if there are products like spray finish or clear sheet protectors, ways to smooth out my floor, or tips for finishing it please let me know! Thanks in advance!
Answer:
I'm not concerned with appearance, so differences in color or lines where sections meet is fine

Given that, yes, you can finish/refinish in sections. Where the sections meet will likely be initially obvious, but that will become somewhat less with time if all are prepared and finished similarly.
The main issue with refinishing a floor while there's still stuff in the room is two-fold. The floor will need to be sanded, and unless it's in the sort of shape where it barely needs refinished that usually involves a massive, heavy-duty rental sander. Which you can do the whole thing with in one day if you clear everything out. If you opt to leave stuff there, you'll have to cover everything left against extremely pervasive sanding dust, sand, finish and wait an adequate time for curing, then move everything to the finished side, cover it up against dust again, and repeat the process.
Getting some help moving things out and in may cost less than renting for two days, and the whole job will be done faster.
Comment: It may be a benefit to tape off and cover the not-to-be-finished-right-now part of the floor along a joint line.

Can I Polyurethane a room in sections


Drupal commerce order list view - payment status

Question: Is it somehow possible to add payment status and payment method to ordes list view?
I tried to use relationship inside orders list view but the commerce payment transaction is not available.
Thank you for help.
Answer: It's not impossible, but the amount of Views foo required to do it is beyond most mortals.
The tricky part is that an order can have many transactions, and also several which is completed. That is the data model would allow you to pay half by credit card and half by paypal. Also different payment methods might have different status for complete/incomplete payments. That logic is hard to build into a SQL query, which is the limitations of Views.
That said you could add a custom relationship from the order to the payment transactions and probably make something that can work. Doing this will require that you can create a module, know a bit about Views and have a lot of patience, unless you have done this type of thing before.
Comment: Oh, ok thank you for explanation. So it is impossible for me to do:) As a workaround what I did is to put a order balance field into a order list - so if the balance is 0 the order was set to be paid.
Comment: I add a "payment transaction" relationship and add "Commerce Payment Transaction" Field. That works great!! ;)
Answer: Since Commerce 1.3, views has a new Payment relatioship
Answer: You can add field "payment method" or "payment status" to your Order entity.
Than you can set value of this field when you are saving order in you payment method.
Of course this field will be available in views.
Answer: You can use http://drupal.org/project/views_field_view module. More details about it from project page:

This module allows you to embed a view as a field in a view. A new field handler is made available, so this can also be used in area (header/footer/empty) handlers as well as rows.
This view handler can accept arguments from fields of the parent view using tokens and pass them into the child view for each row. Raw or rendered token values can be used, as well as static values.

Check this comment for details.