Installing SteamCMD on CentOS 7

Question: when I try to install SteamCMD on CentOS 7 I get an error: Login Failure: No Connection, I can confirm that selinux is disabled, and that the firewall is turned off, I can get it to work fine in CentOS 6, but for CentOS 7 there seems to be some sort of hiccup, any help would be appreciated, has anyone else tried to install SteamCMD on CentOS 7?
Comment: This has nothing to do with programming. A better place would be ServerFault.
Answer: I did it on CentOs 7.
I created a separate user, downloaded the tar and extracted it as stated in official doc.
Double check your dependencies and your Firewall, the new firewall in centos 7 is called "firewalld".
So this is what I would try in your case (as root):
yum install glibc.i686 libstdc++.i686
systemctl stop firewalld
useradd steam
su - steam
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
./steamcmd.sh

Answer: https://developer.valvesoftware.com/wiki/SteamCMD#Manually
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

worked for me

Installing SteamCMD on CentOS 7


What is considered 'extreme ranges' for McCrees fall off damage?

Question: McCrees buff says he keeps the same damage at long ranges but damage gets lower at extreme ranges.
What is considered extreme ranges?
Answer: Falloff range for McCree's weapon is 35 to 55 meters, and the damage would fall off from 70 damage at 35 meters to 20 damage at 55 meters. Extreme range probably means beyond 55 meters of range, which is considered the highest possible distance where the damage is at the lowest.
EDIT: McCree's damage falls off starting 20 meters now.
Source for damage and damage falloff numbers: http://overwatch.gamepedia.com/McCree
Comment: As of the latest patch that went live yesterday, McCree's damage fall off now starts at 20 metres. [Source.](http://www.overpwn.com/news/207-july-26th-overwatch-patch-ana-buffs-mccree-balance)
Answer: According to the Overwatch Wiki on Gamepedia, the damage seems to start dropping at 35 meters.
I suggest trying it out in the practice range on training bots to get a feeling for it - there are distance markers on the ground.
From trying this myself, the damage seems to start dropping consistently, starting at about 34 meters.
It is worth noting that the damage falloff is fairly significant - a body shot at 40 meters distance deals 12.5% less damage than a normal shot. As a result, it takes five bullets to kill the training bot at this distance, instead of three.


Reference or book on simulation of experimental design data in R

Question: Can someone tell a reference and/or book that explain how to use R for simulation of experimental design data?
Comment: Would you mind clarifying what you mean by "simulation of experimental design data"? Are you looking after some function or R code that possibly generate random data for e.g., a RCBD or Latin square?
Comment: @chl: Yes, I'm looking some R codes to generate random data for experimental designs like CRD, RCBD, Latin and other design situations. Any idea. Thanks
Answer: I have the feeling that pretty recent "Introduction to Scientific Programming and Scientific Simulation Using R" by Owen Jones, Robert Maillardet, and Andrew Robinson (2009) could be what you are looking for.
There is also a very positive review for it in the Journal of Statistical Software..
Although this book is not specifically targeted at simulating experimental data it will probably get you in the direction you want to go.
Answer: Here is an example of some code that I wrote for this purpose. The experimental design is: there are four levels of nitrogen and six replicates at each level. These data could be tested using a one-way ANOVA, but as the levels are continuous, I tested the fit of different curves.
<code>set.seed(1)
library(nlme)
library(ggplot2)
### Below is a set of practice data

## 1. four levels of Nitrogen:
##    0,1,4,10
N <- c(rep(0,6),rep(1,6),rep(4,6),rep(10,6))

## 2. variance
s <- 2

## 3. Data simulated to provide examples of the
##    Various hypothesized responses of Y to N

## 3.1 asymptotic incr Y = 10*N/(1+N) + 10
asym <- c(rnorm(6,10,s),rnorm(6,15,s),rnorm(6,18,s),rnorm(6,19,s))
## 3.2 Y = 0*N + 10 the Null model
m0 <- c(rnorm(24,10,s))
## 3.3 Y =0.2*N+10 a shallow slope
m1  <- c(rnorm(6,10,s),rnorm(6,10.2,s),rnorm(6,10.8,s),rnorm(6,12,s))
## 3.4 Y = 1*N + 10 a more steep slope
m4 <- c(rnorm(6,10,s),rnorm(6,14,s),rnorm(6,26,s),rnorm(6,50,s))
## 3.5 Y = 4*log10(N)+ 10 an log-linear response
lm4 <- c(rnorm(6,10,s),rnorm(6,12.4,s),rnorm(6,15.6,s),rnorm(6,18.2,s))
## 3.6 'Hump' with max at N=1 g m-2 yr
hump <- c(rnorm(6,10,s),rnorm(6,20,s),rnorm(6,9,s),rnorm(6,8,s))

## A function to compare the fit of five models:

fn.BIC.lmnls <- function (x,y,shape){
  foo.null <- lm ( y~1)
  foo.poly1 <- lm(y~x)
  foo.poly2 <- lm(y ~ x + I(x^2))
  foo.poly3 <- lm(y ~ x + I(x^2) + I(x^3) )
  foo.mm <- nls ( y~ (a*x)/(b + x),start=list(a=1,b=1))
  bic <- BIC(foo.null,foo.poly1,foo.poly2,foo.poly3,foo.mm)
  print(bic)
  return(bic)
}

### now, plot data and print BIC values for each of the data sets
par(mfrow = c(3,2))
fn.BIC.lmnls    (N,m0,"Y = 0*N +10")
fn.BIC.lmnls    (N,m1,"Y = 0.2*N + 10")
fn.BIC.lmnls (N,m4,"Y = 1*N + 10")
fn.BIC.lmnls (N,lm4,"Y = 0.4*log10(N) + 10")
fn.BIC.lmnls (N,asym,"Y = 10+10*N/(1+N)")#Y = 20*N/(5+N)
fn.BIC.lmnls (N,hump,"Y =  [10,20,9,8]")
</code>
Answer: Statistical models in S, by Chambers and Hastie (Chapmann and Hall, 1991; or the so-called White Book), and to a lesser extent Modern Applied Statistics with S, by Venables and Ripley (Springer, 2002, 4th ed.), include some material about DoE and the analysis of common designs in S and R. Vikneswaran wrote An R companion to "Experimental Design", although it is not very complete (IMHO), but there are a lot other textbooks in the Contributed section on CRAN that might help you get started.
Apart from textbook, the CRAN Task View on Design of Experiments (DoE) & Analysis of Experimental Data has some good packages that ease the creation and analysis of various experimental designs; I can think of dae, agricolae, or AlgDesign (which comes with a nice vignette), to name a few.
Comment: Could you please refer me a book available in online for simulation study in R (not only for design of experiment,but also for basic learning which will develop strong basic background. )


Solve a circular reference in WCF from my POCOs

Question: I have a couple of classes (for now) and I'm trying to clear up a circular reference between the two since it is killing WCF's serialization.
I am using EF with POCOs in a WCF REST service is that helps. I have simplified my problem down to bare bones for an easy example here:
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Groups
{
    [WebGet(UriTemplate = "")]
    public Message GetCollection()
    {
        var message = new Message { Body = "Test message" };
        var group = new Group { Title = "Title of group" };
        message.Group = group;
        group.Messages = new List<Message> { message };
        return message;
    }
}

public class Message
{
    public string Body { get; set; }
    public Group Group { get; set; }
}

[DataContract(IsReference = true)]
public class Group
{
    public string Title { get; set; }
    public ICollection<Message> Messages { get; set; }
}

I have added the [DataContract(IsReference = true)] to the Group class so that the circular reference is cleaned up however my returned results end up like this:
<Message xmlns="http://schemas.datacontract.org/2004/07/LmApi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    Test message
    <Group z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"/>
</Message>

Where are the properties of the Group and how can I get them?
Answer: BritishDeveloper,
There are no properties associated with Group. That's why all you see is the ID of 1.
The reason is that as soon as you annotate the Group class with [DataContract(IsReference = true)], you are telling the DataContract serializer that it's no longer a POCO type. It's a DataContract type.
So, to serialize Group with properties, you now need to go ahead and annotate the Title and Message properties with DataMemberAttribute.
An alternative would be use the "preserveObjectReferences", which you can pass as a parameter to DataContractSerializer, DataContractSerializerOperationBehavior, and other classes.
Hope this helps!
Answer: I decided to make my own smaller classes that have a constructor that takes an entity and sets all of this lighterweight properties correctly.
Basically it is a very small copy of the class that has just the properties needed in the payload. (Obviously I have excluded the problem navigation properties)
Answer: This is similar to Circular References and WCF Here is my answer modified for this case
I had the same problem and resolved it by excluding the navigation property back to the parent from the DataContract
[DataContract]
public partial class Message
{

        [DataMember]
        public virtual string Body { get; set; }

        [DataMember]
        public virtual Group Group { get; set; }

}

[DataContract]
public partial class Group
{
        [DataMember]
        public virtual string Title { get; set; }

        public virtual ICollection<Message> Messages {get; set;}
}


Is it legal to upload a photo from a public place without the subject's permission?

Question: For example, a buddy of mine recorded or captured a photo/video of someone let us say fighting or just talking in a public place such as the public road. It is legal to post it in social media even though that buddy of mine has no permission from the subjects in the photo/video?
Comment: Does this answer your question? [Can a celebrity sue someone who takes obnoxious pictures/videos of him in public and uploads onto internet without his permission?](https://law.stackexchange.com/questions/33692/can-a-celebrity-sue-someone-who-takes-obnoxious-pictures-videos-of-him-in-public)
Answer: Yes
australia

The photographer owns the copyright.
The subject has no right not to be photographed: in [R v Sotheren (2001) NSWSC 204][1] Justice Dowd said "A person, in our society, does not have a right not to be photographed."
Australia has no privacy rights on person-to-person interactions (and pretty trivial ones on person-to-business).

There are limitations mainly related to voyeurism and commercial use, which are discussed at http://www.4020.net.
Answer: Depends on the jurisdiction, of course. In many parts of Europe, the answer is "probably not."

A picture of the public road with people in the background (freedom of panorama) is different from a picture of people who happen to be on the public road. If the picture is about "people fighting," they are probably not the background.
People fighting may or may not constitute a newsworthy event, which means freedom of the press intersects with privacy and copyright laws.
Picturing the victim of a crime that way might even get you into jail.

How the various rights balance (your right to report a fight, their right to control their own picture) depends on the country.


Finite generation of stabilizers in a $G$-set

Question: Suppose that $G$ is a finitely generated group, $X$ is a $G$-set, and $x \in X$ is a point.  Are there any sorts of conditions on $X$ and $G$ that would let me conclude that $\operatorname{Stab}(x)$ is finitely generated as well?
Comment: Note that for any subgroup $H$ you can take $X=G/H$, so what you are asking is for a characterization of all finitely generated subgroups of a given group.
Answer: "Stabilizer of $x$" is not any more specific than "subgroup of $G$" (consider the regular action of $G$ on $G/H$).  In other words, you are asking for conditions on $G$ such that its subgroups are finitely generated.
This is false, in general.  It's true in nilpotent (and virtually nilpotent) groups.  It's false in solvable groups (consider the lamplighter).
Answer: Lior Silberman is absolutely correct, but I wanted to add one other natural and simple condition in which you can conclude that the stabilizer of $x$ is finitely generated, namely, when the orbit of $x$ is finite. Equivalently, subgroups of finite index in finitely generated groups are finitely generated. This follows from Schreier generators (see "Schreier's lemma" or "Schreier's subgroup lemma").


Is there actually a large change in accuracy with Compensated pistols' "+350% Weapon Accuracy"?

Question: The first chest of Hyperion Station, while grinding against the Legionaries and opening it while Jack's getting beat on the floor, sometimes, I'm seeing some very big numbers in the loot's descriptions, like a Level 2 Compensated Factualizer with:

+350% Weapon Accuracy
+148% Weapon Recoil Reduction

Looking at variants listed on the Wiki, it seems confirmed that the Compensated prefix is what's causing it.
I'm not a fan of "Consumes 2 ammo per shot" guns like that, so I don't know if I should have gone for it, instead of tossing it.
Does "+350% Weapon Accuracy" have an effect that matches its large numbers? Like, how much tighter are my groupings, for instance?
Comment: I'm kinda missing the "+8% Crit damage" all the original Hyperion weapons share.
The factualizer uses the hyperion barrel that usually grants this trait.
Comment: @procra - I didn't list all the modifiers, I just listed the ones I care about.
Answer: Recoil reduction is in general a great trait and often underrated, BUT(T) it kinda messes up the reverse recoil reduction of Hyperion weapons.
The higher accurancy means the maximum accurancy will be approx 100% given to the already top accurancy of Hyperion weapons it will become a pinpointer. But the recoil reduction causes the gun to reach that maximum accurancy much slower as the guns accurancy increases based on the recoil. If recoil gets reduced, the increase of accurancy also gets reduced, meaning you have to fire longer to get on levels with the gun. Plus Hyperion mag sizes are rather small compared to others and recoil gets applied per shot - not per bullet. So the double shot accessory is more an ammo drainer than useful. It's suitable for Maliwan and/or Torgue and absoluetly gross on Vladof. A "Dva Anarchist" will eat your ammo pool like nothing.
Recommendation: toss it into the grinder, there's better handguns than that. Of the characters in BLTPS there is no Hyperion-focussed class (like Sal, Catalyst Maya or Anarchy Gaige in BL2), maybe except a fragger Claptrap with unpredicable results.


Can I swap as cards for a headless setup of a Raspberry Pi?

Question: I recently got a new Pi Zero W for a smart home project and I'd like to set it up for SSH without getting micro adapters for display, keyboard, etc. I currently have a Pi 3 and I was wondering whether I could just change out the SD cards. Would the SD card retain the WiFi credentials and have the same IP address? If so it would make my life a lot easier.
Answer: Here is how to enable SSH and go headless:

Shut down the Raspberry Pi
Remove the SD card and plug into a linux / windows machine
mount the /boot partition
in /boot create an empty file named "ssh" or "ssh.txt"
unmount the /boot partition
Plug it into Raspberry Pi and boot it
Use your router's DHCP allocation table or use nmap to find the IP address of your Pi
ssh into the pi as user (pi for new system)

For a new system you would have to create a wpa_supplicant.conf file in /boot to configure your wifi. Follow this post for a new setup.
Answer: You can change the SD Card of UP TO DATE Raspbian images between ALL models.
My Pi Zero W indeed started life as a copy of my Pi3 card.
HOWEVER there are caveats;
This assumes you are running a default setup
You will potentially have problems if you run multiple systems with the same hostname.
In general Bluetooth pairings are not transferrable, due to different MAC and you cannot pair the same peripheral to different PI (although I have configured my OS in multiple Pi so all have the similar settings).
It is possible to configure the OS so that this will not work, but it is impossible to know.
You will NOT in general have the same IP address (which would be a disaster), however this is a function of your DHCP server, which will in general assign a new address, based on MAC.
All my Pi use identical wpa_supplicant.conf files.
Indeed they use identical config.txt files, although I use conditional settings to accommodate different peripherals (such as RTC).


Undersampling improvement F1-score

Question: Im doing a 2-class classification project for an imbalanced data set.
The imbalance is about 18%/82%. Im noticing a huge improvement in F1-score when I under-sample; from 16% without under-sampling to 49% with under-sampling. Im wondering if this is possible or that I am doing something wrong? Before under-sampling I split the data set in a train- and test set, apply outlier detection and normalisation (normalisation first on train set, then on test using the scales obtained from train set). Does anybody have any idea, if this improvement is too good to be true, what could be going wrong?? Many thanks in advance!
Comment: I guess the question isn't exactly a duplicate of your other question https://datascience.stackexchange.com/q/64910/55122, but the answer is the same: without adjusting the thresholds, resampling methods shift the proportion of samples' predicted classes, so you shouldn't be surprised by large changes to accuracy, recall, precision, F1, ...
Answer: Improvement in the evaluation metric by rebalancing depends on the type of classifier algorithm. Certain algorithms are very sensitive to rate imbalances, thus adjusting the respective levels of support will change the algorithm's performance.
One way to empirically verify that only under-sampling is driving the improvement is to run an experiment - gradually increase the level of under-sampling and plot the result on the F1 score.

Undersampling improvement F1-score


Is pornography allowed in Islam?

Question: The title asks it all. Is porn allowed in Islam?
Comment: @alhajahmad The question should have been Is pornography allowed in so called Muslim Countries?
Comment: Please do see "[Hypersexuality, nymphomania and related medical conditions](http://islam.stackexchange.com/a/30120/9123)". I hope it helps.
Comment: See [here](http://www.medicaldaily.com/knowledge-brain-power-how-stop-shrinking-your-brain-and-improve-your-thought-process-302450) for scientific explanation of why porn is not good for your brain. In short, **it shrinks your brain.** Also, you don't care about your normal life anymore as you'll be dwelling in your fantasy world.
Answer: No it is not.
There are tons of quranic verses and hadith that describe about the ethical behaviour and clearly state that immodesty/unabashedness is a big sin and one must control not to do it.
To give a small but a very heavy reference is Surah An-Nur 30,31

Tell the believing men to reduce [some] of their vision and guard their private parts. That is purer for them. Indeed, Allah is Acquainted with what they do.
  And tell the believing women to reduce [some] of their vision and guard their private parts and not expose their adornment except that which [necessarily] appears thereof and to wrap [a portion of] their headcovers over their chests and not expose their adornment except to their husbands, their fathers, their husbands' fathers, their sons, their husbands' sons, their brothers, their brothers' sons, their sisters' sons, their women, that which their right hands possess, or those male attendants having no physical desire, or children who are not yet aware of the private aspects of women. And let them not stamp their feet to make known what they conceal of their adornment. And turn to Allah in repentance, all of you, O believers, that you might succeed.

Please read this link for a better explanation of this ayah.
So, bottomline, islam talks about modesty and clearly pornography is not allowed in Islam.
Comment: Plus to your answer, It is because of external and internal corruption in culture and religion
Comment: Just to add, I think the Hadith in this [answer](http://islam.stackexchange.com/a/30435/9123) for "The logic on prohibiting the pornography" best fits here, i.e. *"O Ali, do not follow a glance with another, for you will be forgiven for the first, but not for the second"*
Answer: Of course it is not.
There are several reasons why the Muslims were visiting porn sites
Delayed age of marriage, and by virtue of the customs in Islamic countries
Prevent non-legitimate relations, They visit those sites to compensate
Answer: No, Please check out this verse In surat "Al-Israa":
وَلَا تَقْرَبُوا الزِّنَا ۖ إِنَّهُ كَانَ فَاحِشَةً وَسَاءَ سَبِيلًا
Translation:
"(32) Nor come nigh to adultery: for it is a shameful (deed) and an evil, opening the road (to other evils)."
Answer: No, it is common sense in Islam that watching porn is Haram. The only naked body allowed to be seen is the one of your spouse.
Comment: This answer could benefit from references.

Is pornography allowed in Islam?


Setting Workspaces in Gnome without activating gnome panel (and workspaces applet)

Question: I'm using Avant Window Navigator and don't have any gnome-panel. But, I wanna resize my workspaces from 4x1 to 2x2. But in the help and other documentation, to do this, I must right click in Workspaces applet in gnome panel. Can I do this without activating gnome panel?
Answer: You can configure your workspaces through CompizConfig Settings Manager (ccsm)
sudo apt-get install compizconfig-settings-manager

It's placed in System > Preferences > CompizConfig Settings Manager.
You will find the setting under General Options>Desktop Size.
Answer: Don't know if indicator-workspaces will is what you are looking for you need to install i from a personal ppa.
in terminal type
sudo add-apt-repository ppa:geod/ppa-geod
then
sudo apt-get update && sudo apt-get install indicator-workspaces
it will be in your accessories menu.
Hope this helps


Unable to publish entry to channel

Question: I have a channel (media) that has various custom fields, one a matrix field where you can post images to a gallery, I have already published 20 images to this gallery and everything worked as it should, now when I try to publish any more images it just won't work, no error message is given it just redirects to the CP homepage. Anyone ever came across this before??
Comment: What version of EE are you using?
Comment: 2.6.1. I'm just updating Assets, Matrix and EE to see if that helps. Really weird how it has just stopped working though. I can publish to any other channel without issue.
Comment: Does it add another row in the Matrix table and not save? Or will it not add an additional row? Are there any js errors in your console? Do you have a limit of 20 rows in your custom field?
Comment: Yeah I can add rows no problem, it just doesn't save after I add them. No JavaScript errors. No limit in my custom field.
Comment: Everything updated, Matrix, Assets and EE, still the same issue. Is there a limit in size per entry or any other kind of limit that I might be breaching that I don't know about??
Answer: Go to "Members" -> "Member Groups" -> "Edit Group" and check if option "Include Members in PUBLISH page multi-author list?" is set to "Yes".
Make sure you have privileges (if you are not a Super Admin) to edit that channel.
While editing channel entry go to "Options" and check if you are on the dropdown list "Authors".
If not - go to your profile settings -> Member Preferences and check option "Include user in PUBLISH page multi-author list?".
Go to entry you want to edit, change author to yourself and it should be working now.
Comment: Paul, I have tried all of the above but I am still getting the same issue. Well, it has changed ever so slightly, I am now getting a server error "Unable to load the webpage because the server sent no data.
Reload this webpage.
Press the reload button to resubmit the data needed to load the page.
Error code: ERR_EMPTY_RESPONSE"
Comment: Doing some research it may be to do with my php limit, I'll check that out and post again if that solves the issue.

Unable to publish entry to channel


How to: Easily Move a WordPress Install from Development to Production?

Question: I do development on one box and use a second for production. Right now I just dump the database and then do a find a replace for the URL changes; then copy over the files and import the new SQL.
Are there better ways of doing this?
Comment: Today, there is a plugin called Duplicator: http://wordpress.org/extend/plugins/duplicator/ It's literally a three-step process and works like a charm. Used this multiple times already to deploy a website from a test environment to a live one.
Comment: For the newcomers to the qeustion. 1 Year later and I'm still using @MikeSchinkel plugin. He has a 0.7 out that I've moved a couple installs to without problems. http://mikeschinkel.com/downloads/wp-migrate-webhosts-0.7.zip
Comment: Here's a plugin-free script that I've release that has helped my process immensely. http://philipdowner.com/2012/01/script-to-make-wordpress-site-migrations-easier/
Comment: http://wp.tutsplus.com/tutorials/how-to-sync-a-local-remote-wordpress-blog-using-version-control/
Answer: @Insanity5902: Deployment of a WordPress site from one box to another has been a PITA since day one I started working with WordPress. (Truth-be-told it was a PITA with Drupal for 2 years before I started with WordPress so the problem is certainly not exclusively with WordPress.)
It bothered me that every time I needed to move a site I'd have to spend so much often duplicated effort and it kept me from deploying to test as frequently as I would have preferred. So about 4-6 months ago I started working on a plugin to solve the webhost migration problem and I mentioned my ideas on the WP Tavern forum.
Well fast forward to today and I've pretty much got it working and I'm conveniently calling it "WP Migrate Webhosts." Even though the plugin is still very much beta (probably even alpha) given your question I think I'm ready to let people start banging on it.
The envisioned use-case is that:

first the developer handles uploading all the changed theme and plugin files via FTP,
then uploads the development MySQL database to the testing server in its entirety and finally
then runs the plugin to migrate any references from the prior domain to the new one. (My plugin does not attempt to solve the merging of new database fields or tables with live data; THAT is a much bigger problem that I'm not sure how to solve.)

You can download the plugin from my website and unzip into your plugins directory (if you don't know how to do this then this plugin is not for you because it requires someone who knows what they are doing to use it.) I'll keep this plugin online until I release it to WordPress.org after which you should look for it there.
To use it you take a different approach in your wp-config.php that normal by commenting out the four (4) defines DB_NAME, DB_USER, DB_PASSWORD and DB_HOST and instead registering the defaults for webhosts and then registering info about each webhost itself. Here's what that segment of wp-config.php might look like (note the first section is the unneeded code commented out and also note that I set up my hosts file on my local machine with non-routable .dev top level domains to make day-to-day development easier. On the Mac VirtualHostX makes this a breeze):
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
//define('DB_NAME', 'wp30');

/** MySQL database username */
//define('DB_USER', 'wp30_anon');

/** MySQL database password */
//define('DB_PASSWORD', '12345');

/** MySQL hostname */
//define('DB_HOST', '127.0.0.1:3306');

require_once(ABSPATH . 'wp-content/plugins/wp-migrate-webhosts/wp-webhosts.php');
register_webhost_defaults(array(
 'database'  => 'example_db',
 'user'      => 'example_user',
 'password'  => '12345',
 'host'      => 'localhost',
 'sitepath'  => '',        // '' if WordPress is installed in the root
));
register_webhost('dev',array(
 'name'      => 'Example Local Development',
 'host'      => '127.0.0.1:3306',
 'domain'    => 'example.dev',
 'rootdir'   => '/Users/mikeschinkel/Sites/example/trunk',
));
register_webhost('test',array(
 'name'      => 'Example Test Server',
 'rootdir'   => '/home/example/public_html/test',
 'domain'    => 'test.example.com',
));
register_webhost('stage',array(
 'name'      => 'Example Staging Server',
 'rootdir'   => '/home/example/public_html/stage',
 'domain'    => 'stage.example.com',
));
register_webhost('live',array(
 'name'      => 'Example Live Site',
 'rootdir'   => '/home/example/public_html/',
 'password'  => '%asd59kar12*fr',
 'domain'    => 'www.example.com',
));
require_once(ABSPATH . 'wp-content/plugins/wp-migrate-webhosts/set-webhost.php');

Hopefully this is (mostly) self explanatory. I attempted to make the code as clean as I could but unfortunately it requires those two cryptic require_once() lines before and after the block of webhost registration code since there was no way for me to "hook" WordPress before wp-config.php is called.
Once you have updated your wp-config.php then you can simply use the URL shortcut wp-migrate-webhosts to go to the admin screen like so:

http://example.com/wp-migrate-webhosts

The above will take you to an admin screen like the following which has a fair bit of description text and allows you to migrate FROM any of the other webhost domains with a single click after selecting the domains to migrate from (NOTE: this example shows going DOWN from test/stage/live servers to local development but rest assured it can migrate TO any domain where it happens to be located. This also means the plugin will be great for taking an existing live site and quickly getting a local development environment working!):

If it's not clear "migration" in this context means to update all the references in the current database to be appropriate for the currently defined webhost (and "current" is sniffed by inspecting $_SERVER['SERVER_NAME'].)
What's cool about the plugin is that it implements some basic migrations but anyone can hook it and perform their own migrations. For example, if you add a gallery plugin that stored full paths to images in the database you could hook the migrate_webhosts action which will be passed the "from" webhost and the "to" webhost each as an array of metadata and you'll be allowed to perform whatever you need to do in the database using SQL or any applicable WordPress API functions to do the migration. Yes any of us could do this without the plugin but without the plugin I found that writing all the code needed was more effort than it was worth. With the plugin it's just easier to write these tiny hooks and get it over with.
You may also find my migrations fail in edge cases I've not tested and maybe you can help me improve the plugin?  Anyone who wants to can email me via my gmail account (my alias is "mikeschinkel.")
Also, the plugin was designed to accept user-define webhost metadata in addition to the ones it recognizes like database, user, password, host, domain etc. A perfect example might be googlemaps_apikey where you can store a the different API keys for each domain that your Google Map's plugin needs to operate correct (who among you who has used a Google Maps plugin hasn't deployed an app to a live server and forgotten to change the code to the correct API key? Come on, be honest... :)  With this plugin, a googlemaps_apikey element in your register_webhost() array and a small custom migrate_webhosts hook you can effectively eliminate that as a concern!
Well that's about it.  I'm launching this plugin here on WordPress Answer's Exchange because
@Insanity5902's question triggered it. Let me know if it's helpful, here if appropriate or via email if not.
P.S. If you do decide to use this remember it is alpha/beta and that means it will change so be prepared for some minor surgery if you want to use it now and then use the released version once its been beaten on by many hands.
P.P.S. What are my goals with this?  I've love to see this migrate into WordPress core so that everybody would have access to it. But before that can even be considered lots of people have to be interested in using it to ensure it actually solves more problems then it potentially could create. So if you like the idea then by all means use it and help me gain momentum with it for eventual hopeful inclusion into WordPress core.
Comment: So, what's the state of affairs for this plugin? It looks mighty appealing but I would like something mature and well-vetted. This post is the only information I can find on it.
Comment: /wp-migrate-webhosts produces a 404, and /wp-admin produces 'error establishing a database connection'
Comment: Nice solutions I've got a couple of questions though 1) Do you still need to define the WP_SITEURL to get into the admin area? 2) Does the tool on display for only Administrator Users? (not sure if the Tool section displays for non-admin's)
Comment: Hi @Insanity5902:

1) No need to set WP_SITEURL, the plugin does for you. You actually are setting it when you "register" a "domain" and "sitepath" for a webhost. In normal WordPress operation WP_SITEURL is required to be set either in code or the database to ensure nobody spoofs the URL and does nefarious things because on an unexpected value in $_SERVER['SERVER_NAME']. The WP Migrate Websites plugin sets WP_SITEURL indirectly based on $_SERVER['SERVER_NAME'] but it will ONLY do so if the current domain matches one of the domains you've defined in your wp-config.php file, nothing else.
Comment: 2.) The URL shortcut I mentioned actually does a redirect into the admin console so it is only for people logged into the admin. I don't have specific checks for administrator only built in yet though. I've never added capabilities to a plugin but will be needing to fully research how in the next few weeks so can work on that over the next month. However the plugin is not destructive; it can ONLY migrate to the current domain and the process is repeatable so even if a non-admin got in there's really no harm they could do with it, at least not that I can envision.
Comment: @Mike: Can you add it to the wordpress plugin repository? I think that will gather additional feedback and developer support.
Comment: @harke - I plan to when it's mature. I want to get about 5-10 people to use it so I can make sure it is robust and verify the use-cases are valid before I subject it to the rating system on the plugin forum as I think this plugin has the potential to be significant if managed properly. I also want to fully document it before posting and documenting it will force to me validate many of the assumptions I made during development.
Comment: Thanks for making this plugin. I'm trying it out at the moment, and it seems to work really well. I would love to send you feedback though, where's the best place to do that?
Comment: @Sam Murray-Sutton - I see from my email inbox that you figured out how to email me, but if others want to I have my email on my profile page.
Comment: I'm def. going to give this a try. Currently setting up my first complete environment and hope i can link this with my bitbucket repo. Anyway: Thanks alot for a) explain well (again) and b) sharing nice stuff (again). Wish you best, Mike!
Comment: This is essentially the same process we follow with our wp-config.php. Being able to push out code to a staging server without screwing everything it the _only_ way to work. We don't do db pulling and pushing though WP and do this with a mysql client, which is just a effective, if not a little slower.
Comment: @mike how could I use this method migrating a single site out of a multisite (local) setup?
Comment: @MikeSchinkel - maybe roll this into the mix: http://wordpress.stackexchange.com/questions/24314/wordpress-database-synch-between-dev-and-prod/24982#24982
Answer: When possible, I set WP_HOME and WP_SITEURL in wp-config.php. This, combined with a database dump and import, is the most simple of all solutions I'm familiar with.
http://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php
Comment: @jfklein I'm almost always working with a WordPress Network, which is incompatible with these constants.
Comment: When would it not be possible to set these?  This sounds slightly simpler than changing things in the database.
Comment: Doing the same. Regrettably, not all themes honor this. i.e. 'Repsonsive Theme' from ThemeID. Searching the dump/all tables for 'http://localhost' (or whatever you chosen local name), especially wp_options and making search&replaces is often unavoidable.
Comment: @FranKee I've create a plugin https://wordpress.org/plugins/pitta-migration/ that uses the constants to update the wp_options table which should cover most themes and plugins
Comment: @icc97: Lovely. Will look at it. PS: Nice header image, pictures the situation.
Comment: @FranKee cheers :)
Answer: My favourite hack; add a setting to your /etc/hosts to make the production domain point to your development box, just on your machine. To deploy to production you rsync all the files and push the database over.
The risks of this strategy are clear; you might confuse your development environment with your production environment.
It still an easy fix though.
Comment: Yes! I'm so glad I wasn't the only person to have thought of that! _any_ difference between dev and prod is bad. Removing that difference altogether is far better than trying to work around it. And this setup takes no work at all. One can even do testing on a virtual machine with modded hosts file if needed.
Comment: I like this method a lot, but how do you handle the database push/pull?
Comment: As for the risk of confusing dev with prod, I use a Chrome plugin that displays the IP address of the webpage. You'll know you're on local when its 127.0.0.1
Answer: I wanted something similar when I migrated to WP a few months back, so I wrote a pretty simple shell script that uses rsync and mysqldump over ssh:
http://snarfed.org/sync_wordpress
It's not sophisticated or web based, but I'm happy with it.
Answer: WP Engine is a new service that offers "One-Click Staging":

WPEngine has an exclusive feature called "staging." Here's how it works: Before you make a scary change to your blog, click the "snapshot" button. We make a complete copy of your blog and set it up in a separate, safe area. You can play with anything you want; nothing's live. Only when you're ready to make it live do you touch your main site.

Looks like a very easy way to quickly move from development to production, especially with an already live site.
Comment: That's a very nice option indeed and will be great for many people! That of course doesn't work for embedded URLs nor does it help for people who develop locally so they can use an IDE with a debugger. Now if WPEngine can create an interaction that merges a local deploy too then it will really be something (Technosailor, you listening?)
Comment: @sam actually, they just recently started rolling out the ability to copy from staging to production. http://wpengine.com/2013/04/user-portal-v2-and-staging-to-production/
Comment: Agreed, that would be a fantastic addition.
Comment: The snapshot feature copies *only* from production to staging, not the other way around. It's great for testing changes, but it won't help for deploying to production.
Answer: Duplicator Plugin:
Here is a plugin that I have been working on.  It's currently in beta but it gets the job done for most sites.  Right now it is targeted at smaller WordPress installs.
http://wordpress.org/extend/plugins/duplicator/
Resources:
Additional resources for the plugin can be found here:
http://lifeinthegrid.com/duplicator/
Community:
Please let us know about your successes or any issues you might run into!  In an effort to more easily manage the various threads please post issues to the WordPress.org plugin forums.   Please do not post any logging data from the plugin into the online forums.  Logging data can be submitted to our support site.
Answer: You might take a look at a product from iThemes, called BackUpBuddy. I've only used it twice, each time had a hitch or two, but overall it looks promising.
Answer: This looks promising.   We are working on some scripts to handle migrating some of the data, wp-options for example, changing paths in the db, a copying over media.
The issue I have is that the live site continues to grow while the other is in development.  One site we work on has 20 posts a day and over 3,000 comments per day.  That is too much data to move over with phpmyadmin or via the command line.  Also, moving the data around always causes UTF issues for some reason.
Also, now that it looks like menu options are stored in the DB, I have even more to deal with.
I check all my code into SVN and deploy the code via FTP from the server (Beanstalk).  This does not make the changes to the DB for me though or activate new plugins.
My plan right now is to create a manifest file while I am developing to do all my changes to the live site.
For example the file would have human readable lines
It would include plugins to activate, wp-options to move over, images to move, pages to move.
Then my plugin, would detect the manifest file and make all the changes to the staging site.
Once I tested that and was sure I got everything, I could be sure it would work on production.
This plugin is still just an idea, but I have some code written for it.
Also, if you want to make changes to just the URL in you DB, you can use the following SQL.
just replace $old$ with the old domain and $new$ with the new
update wp_postmeta set meta_value = replace(meta_value, '$old$' , '$new$') ;
update wp_posts set post_content = replace(post_content, '$old$' , '$new$') ;
update wp_options set option_value = replace(option_value, '$old$' , '$new$') ;

Comment: Just a note, my sql call may break you serialized data.

s:14:blogs.prod.com has the length encoded as 14. After running the code, we now have

s:14:dev.prod.com

which is corrupt. Should be

s:12:dev.prod.com

use with caution.
Answer: As of 2017 here are the two best ways I've found to handle the transfer of a WordPress database from development to production.
WP Migrate DB Pro / WP Sync DB
https://wordpress.org/plugins/wp-migrate-db/
These WordPress plugins let you push, pull, and sync database tables between WordPress installations. This is much better than a find/replace for many reasons because it:

Exports your database as a MySQL data dump (much like phpMyAdmin)
Does a find and replace on URLs and file paths
Handles serialized data
Allows you to save it to your computer as an SQL file

I'm a fan of being paid for the work I do, so I recommend you support Mr. Brad Touesnard and buy a licenses copy of the real thing. WP Sync DB is a replicate and it's always behind in support as a result. With this plugin the process is dead simple:

Install/activate the plugin on your localhost and production environment
Configure a push transfer from your localhost/development server to your production
Fill in rules for which tables to transfer, and define find and replace rules to perform
That's it!

Database Search & Replace for WordPress Databases by InterconnectIT
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
This free tool is not a plugin, but is installed in your root directory of your WordPress production install. This isn't as good as WP Migrate DB Pro because it requires a few manual steps, but nonetheless it's a great option that consistently works. When using this approach the process looks like this:

Backup your local database, this is absolutely needed as we'll be re-importing it soon
Add the script to a folder in your installs root directory
Run the find and replace on your database
Export your database and save it for your production environment
Re-import your backup from step #1 to restore your localhost
Connect to your production database and back it up (as you always should before doing these things)
Import the export we made AFTER running the find/replace routine from step #4

You can use a faster approach, but it involves downtime for your production site which in my opinion is unacceptable. That's why we call it production, right?
Answer: I am personally addressing this issue with my project on Github, called Autopress. I don't have a perfect solution yet, but I'm getting closer, especially with the wpstage plugin from the wpengine folks.
Comment: Is this it? http://github.com/vluther/Autopress I suggest creating links in your answers so people can click right through!
Comment: @Mike Lee: Yes, you can up-vote comments. See, I upvoted artlung's comment. Look for the uparrow on hover to the left of the comment.
Comment: Not sure if this is it, but there is a WP Engine plugin which is used for site migration across hosts. It's called [Snapshot](http://wpengine.com/plugins/) ([Direct link](http://plugins.wpengine.com/wpengine-snapshot.zip)).
Comment: Just checked out your script. Nice. If I understood it installs a fresh WP on the server. The question here is how to migrate from development to production. Can it help with that?
Comment: I'm working on a way to keep everything in version control, and then pushing from dev to production. I've been able to do it without any issues for a few sites already, but there are still some tweaks that I need to address.
Comment: http://plugins.wpengine.com/wpengine-snapshot.zip is gone :(
Comment: He seems to have deleted his github account.
Comment: Yep this project has definitely gone.
Answer: Two Google Summer of Code projects that have a similar goal:

Automatic Migration (GSoC 2010)
WordPress Move (proposal) (GSoC 2011)
Comment: It doesn't look like either of these projects got off the ground?
Answer: I've been using http://wordpress.org/plugins/wp-clone-by-wp-academy/. It works nicely!
Just 3 steps:

Install the plugin on both sites.
Use the plugin to generate a backup on the old site.
Take the backup URL it gives you and plug it into the plugin page on the new site, hit go, and your migration is complete in just a few seconds!

It adjusts all the URLs automatically - including serialized string replacements - so no risk of losing widget configurations, etc.
The only issues I've had are with some websites with larger databases (~300MB), which caused PHP script execution timeouts during import of the site backup.
Answer: I use subversion's export command to install the WordPress files (http://core.svn.wordpress.org/tags//) as well as all plugins in the repository (http://plugins.svn.wordpress.org//tags//), then just zip the theme and custom plugins and install them normally. Once all of that is up and running without content, I export the test DB and do a search/replace for the URL AND the filepath (stored for media) and import into an empty database, then just switch the database info in wp-config.php. Generally takes me about 10 - 20 minutes.
Answer: Normally I login to phpMyadmin upload the database and edit the contents of wp_options>siteurl  and wp_options>home to the expected domain. If you need to update URLs within your posts and pages content you can do a search/replace for the URL and the media/uploads path on the .SQL file prior to uploading. It's a quick job.
Answer: While there's no shortage of good solutions here, in the spirit of sharing I thought I would add my bash deploy script to the pile: https://github.com/jplew/SyncDB

SyncDB is bash deploy script meant to take the tedium out of synchronizing
  local and remote versions of a Wordpress site. It allows developers working in
  a local environment (eg. MAMP) to rapidly "push" or "pull" changes to or from
  their production server with a single terminal command.

This script works well with Mark Jaquith's WP-Skeleton, and harnesses mysqldump, git and rsync to synchronize your entire site—database, code, and media—in two easy steps:
./syncdb
git push hub master

Answer: since I run my sites in IIS (I also run asp.net, so I need windows) I use WebPI from Msft to install a new instance, then I copy the template and use the import/export to transfer the data.
It's not perfect but the whole thing takes less than an hour.
Obviously it would be nice to have a one-click solution, but this is what I found to be easiest for me.
Answer: Another paying solution: the Xtreme One theme framework released version 1.2 with Xtreme Backup which allows you to "export or import the settings of your Childthemes, Layouts or Widgets with all their settings/content as XML file."
Answer: A coworker found this. Interesting concept, though it doesn't work cross server it looks like. I'm still exploring it, but looks like it could work great for a staging instance
http://code.google.com/p/deploymint/
Comment: Four months ago, I couldn't make this plugin work... And it's still at version 0.1 in [code.google](http://code.google.com/p/deploymint/source/browse/deploymint.php)
Answer: This may not have been around when you asked the question, but I've been using a service called Blogvault for a couple months and it has done this flawlessly. I've probably done over 50 migrations (crossing domains, sub-domains, and web hosts), not a hitch and takes no time at all.
It's a paid service (per domain/month), but not that much.
Answer: RAMP is a new content deployment plugin from Crowd Favorite, and it looks really slick. It's $250, though, so I haven't tried it out yet. Might just pay for itself in the amount of time saved, though, so I'm considering it.
The big benefit that it has over most of the other methods mentioned, is that it can intelligently merge posts, comments, etc. It's not just importing a mysqldump, it's more like source control for the database. For example, when deploying a post, it'll also deploy the tags for that post, if they don't already exist in production.
Comment: RAMP is for **content** deployment, as opposed to **code** deployment, but I agree, it looks superb. They now have a [demo of RAMP](http://rampdemo.crowdfave.com/) set up so you can try out the features.
Comment: The question was about *content* deployement, not code deployment, and I started my answer off by saying "RAMP is a new *content* deployment plugin..."
Answer: Let me give away one of my favourites :-)
// proven local<->live codefork (covers local network testing, i.e. from mobile devices):
$GLOBALS['is_local'] =
    in_array( $_SERVER['REMOTE_ADDR'], array("127.0.0.1","::1")) || // simple localhost (IPv4 IPv6)
              $_SERVER['HTTP_HOST'] == 'local.workblog'          || // call by local name (adjust)
       substr($_SERVER["REMOTE_ADDR"],0,8) == '192.168.';           // (mobile) device in local network

$table_prefix  = NULL; // ensure scope

if ( $GLOBALS['is_local'] )  // LOCAL fork ------------------------
{
        ....
}
else  // STAGE/LIVE fork -------------------
{

...and then you work your way from there. DB_NAME, DB_USER... table_prefix. Personally I switch on ALTERNATE_WP_CRON on local (to avoid some annoying warnings), WP_DEBUG of on both (if you're not a developer) or on live-only (if you are), another ini_set('display_errors', '0'); for live could also do good, ant lastly, as mentioned above: WP_HOME and WP_SITEURL to the respective local/actual url.
That pretty much all, nothing left above the classic WordPress 'That's all, stop editing!' line...
The 192.168. part allows you to do some local testing (i.e. from pads or phones) within your local network)
The $GLOBALS['is_local'] can come in handy in your theme development, too, for some extra debug output, etc...
Comment: You can use [WordPress Skeleton wp-config.php](https://github.com/markjaquith/WordPress-Skeleton/blob/master/wp-config.php) that sets a `WP_LOCAL_DEV` constant to acheive something similar
Answer: I have been using the backupbuddy plugin for a while now. It lets you make a backup of database and all files, download it as a zip or send it directly to another server via FTP. It also does the URL find and replace for you. It usually takes me about 5 minutes to go through the entire process. And because all files are zipped the uploading/downloading process is much faster. And no, I do not work for them, but this plugin has really made this whole process much easier.
Answer: Another useful tool for handling server migrations for sites is the WordPress CLI, this article has a good overview of what it can do but specifically the section for "Search and Replace" is useful for finding all of the references to the old / dev site url:
Advanced WordPress Management With WP-CLI
Answer: This is the easiest way ever:
https://themes.artbees.net/docs/website-migration/
It only takes two clicks. One to export, one to import.
It's possible by using the All in one WP Migration plugin. Above link shows how to use it.
Answer: If you are trying to achieve continuous synchronization, I suggest using rsync along with a custom cron job to rewrite any url or site-specific data.
Answer: After having followed this answer for a while I've created my own small plugin - Pitta Migration. The reasons being:

Of all the ideas tried here - the simplest is the WP_HOME and WP_SITEURL options
I then use these to set the two matching wp_options URLs - which covers when plugins /themes ignore these
This gives me 100% confidence in what is being changed in my database
This also works cross-platform (all those bash scripts don't play nicely on Windows)
It's easy to understand what the plugin is doing
There's no config beyond the two constants - do a mysqldump and a mysql import to your local database and the plugin sees that the constant and the table differ and updates them to match
No text search and replace
No chance of knackering your database - I use the WordPress Database Object to do two updates and nothing more
It plays nicely with things like WordPress Skeleton where you can have everything in source control and set a local config
I've put it in the WordPress plugins directory and on Github so that it's free, fully opensource, easy for you to fork and easy to install
Once it's installed you can forget about it and it should 'just work' - it gives you a little notice to say that the database has been modified
It should work with any backup / FTP / restore process
Answer: In my opinion the easiest way I follow is the manual transfer.. Just copy wp-content folder and wp-config.php file to the new host. Export the database from old host and import it in a new database of new host..
In the new host database go to wp-option table and there change the site URL and Blog URL to New host address from old host. like from http://localhost/wp to http://example.com
Now in the wp-config file just change the information of database and user with new host info.
Now login to new wp-admin and go to settings and save the permalink.
You are done. I think this is simple without using any plugins.
I have tried different kind of plugins and all of these have many kinds of problems..
So I prefer this simple manual transfer which is easier I think.


What is a comparable beer to Weihenstephaner Hefeweissbier?

Question: I am trying to think of what US brewed beer tastes most similar to a Weihenstephaner Hefeweissbier...
Answer: You can find a discussion about it here.
A couple of US brewed beers that arise from it are Sierra Nevada Kellerweis and Sly Fox Royal Weiss; but if you'd prefer a more easy-going (and usually cheaper solution), I'd go with Gösser Dark - although it's not make in the US (but in Austria) it's widespread across the country.
Answer: Erdinger Urweisse and Erdinger Hefeweissbier should also be close. Both are brewed in Erding (roughly 15 miles from Weihenstephan), but reportedly available throughout the world.


Why do we have Ubuntu and ElementaryOS tags?

Question: Both ElementaryOS(https://elementaryos.stackexchange.com/) and Ubuntu(https://askubuntu.com/) have their own stackexchange sites. This made me wonder why questions under the tags ubuntu and elementary-os are considered on topic when they have dedicated stackexchange sites for themeselves. Is there some reason for this because to me it seems unnecessary?
Comment: Could you explain what the issue is a bit more clearly? Are you asking why we have the tags or why we consider the systems on topic? Anyone can create tags and the presence of a tag doesn't indicate anything at all about whether something is in scope.
Comment: I'm asking about why they are considered on topic. I'll edit my question to make it more clear.
Answer: Our scope includes anything to do with Unix or Linux. Whether or not other sites also cover parts of our scope isn't relevant to whether something is on topic for us. Yes, Elementary OS and Ubuntu have their own sites, but that's a very small part of it. To take a simple example, bash questions are on topic at least the following sites, and probably more:

Unix & Linux
Ask Ubuntu
Ask Different
Elementary OS
Raspberry Pi
Stack Overflow
Super User

We also have questions about emacs, despite the existence of https://emacs.stackexchange.com, about vim, despite the existence of https://vim.stackexchange.com, we have questions about configuring servers, despite the existence of https://serverfault.com, the list goes on.
In short, there are several dozen (almost two hundred, actually) sites on the Stack Exchange network and many of them have overlapping scopes. As long as something is on topic here, the fact that it may also be on topic elsewhere is immaterial. Just like the fact that we exist shouldn't stop Stack Overflow from giving answers about shell scripts. We all coexist.
Comment: ... and it's up to the user asking what audience they want to have for their question (e.g. a generic Unix user/admin crowd, a programmer crowd, an Ubuntu user crowd, a server sysadmin crowd, etc.)


Unable to disable Ctrl + Alt + Backspace (kills Server X / session). Linux Mint

Question: I accidentally killed a session with Ctrl + Alt + Backspace (actually I pressed Shift too but works the same way) and decided I don't want that combination to do that (I have to use similar combinations often and it doesn't ask for confirmation if pressed accidentally).
There were similar questions: https://askubuntu.com/questions/1005618/change-ctrlaltbackspace-to-restart-x-server and this https://askubuntu.com/questions/1357400/change-shortcut-that-restarts-x-server-ctrl-alt-backspace . But although the alternative shortcut is a good idea, they don't say how to disable it.
I tried an answer from Ctrl+Alt+Backspace to kill X server can't be disabled that asks to check for the results of
xmodmap -pke | grep -i server

but this doesn't find anything over the results.
I also tried to remove the shortcut both from the keyboard shortcuts configuration (Settings > Keyboard > Shortcuts > System > Close session) and also by not enabling this option following the steps of this question:
https://askubuntu.com/questions/10622/how-can-i-enable-ctrlaltbackspace
. That is writing on terminal:
sudo dpkg-reconfigure keyboard-configuration

and leaving everything as it is until the screen with the question

By default the combination Control+Alt+Backspace does not do anything. If you want, you can use it to terminate X Server.
Do you want to use Control+Alt+Backspace to kill X Server? ·Yes ·No

I selected No (as it was by default) but still get the unwanted behaviour.
Screenshot with the enabling option for shortcut to kill X Server - in catalan, not english, just to show how it looks:

On the file /etc/default/keyboard I have:
XKBOPTIONS=""

I don't know if should report as a bug or there's another layer that overrides this configuration that I'm not aware of.
My system: Kernel: 5.4.0-107-generic x86_64 bits: 64 compiler: gcc v: 9.4.0
Desktop: Cinnamon 4.8.6 wm: muffin dm: LightDM Distro: Linux Mint 20.1 Ulyssa
base: Ubuntu 20.04 focal
Answer: Go to Menu > System Settings > Keyboard Layouts
Click on Options button, and expand Key sequence to kill the X server and deselected the ctrl+Alt+Backspace. Then close all windows and try this Ctrl-Alt-Backspace again. There should be no more hard reset and hard logout. Just nothing.
Comment: thanks a lot! finally saving waste of time
Comment: And this is successfully ignored by Xorg and kills the server anyway.


iMessage won't send?

Question: My messages on iMessage won't send. It allows me to type the message and hit the send button but it won't deliver. iMessage is on in settings and I've tried reseting network settings on my recently purchased iPad mini. And I have setup my email on it and so has the person I want to message.
Answer: Email and iMessages are generally speaking two entirely different things, with a few exceptions on iOS.
It is possible that this is because the person you are trying to iMessage either doesn't have an iMessage capable device, or doesn't have it enabled. However, because it will allow you to send, it I think it is more of a configuration question, potentially on their end.
First check to make sure the recipient has access to iMessage as well. Also, verify that you are sending it to their Apple ID email, if they are on an non-cellular device such as an iPad, or iPod Touch. You should also try iMessaging someone else, to test it.

iMessage won't send?


calcium and Iron

Question: I was anemic few years back though I used to take lots of greens and iron rich food. Someone told me that Iron  and calcium if taken together, only one will get absorbed and for me Iron was not absorbed.
I used to take greens with curd and dates with milk. Is that the real reason?
Is it true that calcium and iron should not be taken together ?
Comment: Just a note - The only real way for the body to get rid of excess iron is through blood loss, so make sure that you *need* iron supplementation before taking it.
Answer: A quick Google search for «taking iron and calcium supplements together» turns up a lot of results that agree with each other on this topic:

http://www.nlm.nih.gov/medlineplus/druginfo/natural/912.html says: Calcium makes it harder for the body to absorb iron either from food or supplements. However, in people who have enough stored iron, this probably isn't a problem. But if you are iron deficiWait at least two hours before or after your iron supplement before taking your calcium supplement, if you take iron. ent or might become iron deficient, minimize this interaction by separating your intake of calcium and iron. Don't take calcium supplements at mealtime or when you take iron supplements.
http://www.wikihow.com/Best-Absorb-Calcium-Supplements says: Wait at least two hours before or after your iron supplement before taking your calcium supplement, if you take iron.
http://www.mayoclinic.org/drugs-supplements/iron-supplement-oral-route-parenteral-route/precautions/drg-20070148 says: Do not take iron supplements and antacids or calcium supplements at the same time. It is best to space doses of these 2 products 1 to 2 hours apart, to get the full benefit from each medicine or dietary supplement.

For me, Mayo Clinic is a very reputable source.

calcium and Iron


Interview Presentation for Postdoc

Question: I have been asked to give a small presentation as a part of the postdoc interview. The general guideline is that the presentation should foster ideas, roles and vision in the upcoming project. Basically, I have discussed the scientific ideas concerning the project, however what could I add to make it even more effective?
Comment: What about the roles and the vision?
Answer: Without knowing anything about the specifics, good general advice often given to me is 'Present it to your mum / partner / dog'.
Our top professor gave feedback on a talk recently saying that he has seen many talks that are too complicated that he couldn't follow. He has never seen one that he thought was too simple. If you aim to make your presentations understandable by a lay audience, you'll probably hit about the right level of complexity for experienced researchers.
The worst thing possible is that you make it too technical and the panel don't understand what you're talking about.
Answer: The presentation is supposed to be given to highly technical and professional people, not to lay audience. Your presentation should be full of technical knowledge and really impressive. It should reflect depth of your knowledge about the field and your potential.
Make the audience believe  that you are the best candidate for this project. You are not there to increase the knowledge of the audience but to get hired for a paid job.
Comment: I used to think this way when I was a PhD student. Now, I'd strongly advise against this line of thinking.

Interview Presentation for Postdoc


What software is there for brainstorming?

Question: I am beginning to write some short stories and I am trying to find some software that may aide me in brainstorming.
Answer: Freemind is a commonly-used program for mind-mapping.
With a little practice, it can easily become a medium for your own thinking process. One of the best features of Freemind is that you can define your own key-mappings, which makes it more productive than other mind-mapping (brain-storming) tools out there. Also, though it is a mature software, it is still actively developed; so you can expect more features coming in as time goes by.
Answer: Zim is another wiki-like program that allows you to take notes and brainstorm.  It also works with WikiWords and will auto-link notes.
It's a little more difficult than Tomboy to setup, but it's a lightweight and powerful note-taking and brainstorming tool.
Zim is in the repos.
Answer: I find I waste time trying to use fancy mind-mapping tools. Instead, I like using a "distraction-free" writing environment such as:

PyRoom or JDarkRoom: Full-screen, text-only writing. Forget about formatting. Stop glancing at the clock, and do NOT pause to check your email.
Typewriter: True to its name, this text editor has no backspace. Just write. You can come back to it later. (Extract the download until you reach Typewriter.jar)
Single-line visibility in gedit: Blinders for your text editor. Only the current line is visible, so there is no opportunity to get side-tracked rethinking your previous ideas.
Answer: basket is pretty good for it too. It is not so graphical or map oriented, but it allows ideas to be freely explored and different items to be moved around and grouped.
Comment: How I miss basket and its predecessor [KnowIt](http://knowit.sourceforge.net/)!
Answer: I like to use Tomboy for note-taking and for brainstorming.  It works really well, and you can organize all your thoughts into different "notebooks" to keep everything together.  IT works with wikiwords, so you can type a word LikeThis and it will automatically link to the note called LikeThis.  If there's no note by that name, Tomboy will create it.
Tomboy is automatically installed, or if it isn't, it's in the repos.


Control 12V relay with 3,3V

Question: I would control a relay (JQX-15F) with 3,3V but I don't know any component to do it. Do you know some components to do it? For example analog switch, optocoupler o other?
Answer: Drive the relay coil on the low side instead (i.e. with your switching device from the coil to GND not from the coil to Vcc).  A bog-standard 2N3904, a diode, and a resistor will do the job, as follows:

simulate this circuit – Schematic created using CircuitLab
Q1 can be any jellybean NPN small signal BJT, even, and D1 can be whatever rectifier or switching diode you have on hand.  R1's value isn't particularly critical -- anything from over say 500 ohms to a couple of kOhms will do.
Of course, though, this assumes that your 3.3V supply isn't isolated from your 12V supply.  If it is, you'll need to use an optocoupler like the 4N35 -- wire the collector and emitter of the optocoupler in place of the transistor's collector and emitter, and your I/O to the opto's LED with a 330 to 470 ohm resistor in series.
Comment: +1 Don't be *too* cavalier with the transistor size- inductive loads  are a bit unfriendly to BJTs. A 2N3904/2N4401/BC337 should be fine. I would also keep the base resistor to the very low end of your range so Ic/Ib ~= 20.
Comment: Thanks for answer. I will try with transistor and also with optocoupler. Do you think 4N25 is okay?
Comment: Should be alright at least for a reasonably small-ish relay.

Control 12V relay with 3,3V


Camper outlet to power Shed

Question: I have an outdoor electrical outlet that powered my 5th wheel RV trailer. 50 amp style plug. It was installed by a licensed electrical I sold my trailer and want to power a shed. The shed will have a small 25 gallon hot water tank and probably 110 air conditioner along with outlets for tools. Can I run a power cord from a small breaker b and plug int ox
Comment: What sort of tools are you interested in here?  (Woodwoorking, welding/machining, ...?)  Also, how big is this shed, in square feet?  I take it the RV receptacle is installed in a dedicated, surface-mounted box; if so, what make and model is that box?
Comment: Also, how attached are you to still having a RV receptacle there?
Comment: Woodworking tools/small office, bartender sink with hot water, beer fridge, microwave and 110 volt a/c. 12x16 shed on wood runners.
Comment: So...are you still attached to having a RV receptacle? How far away is the shed from the house?
Comment: I no longer need the RV outlet. About 15 feet from the house.
Comment: Can you provide us with photos of the RV outlet box? That'd help us figure out how best to proceed here...
Answer: A feeder can't be a branch circuit.
However, this would require AHJ approval, but I suppose you could run your underground line to the shed using normal & proper wiring methods, and surface it right next to the RV receptacle.  Install an inlet there.  Then have a 3 foot long jumper cord that you plug in to the inlet and outlet to feed onward to the shed.  Don't even think of doing this until you've talked to the AHJ and gotten a general sense of whether they'll approve it.
I would more expect the AHJ to ask "how much harder would it be to simply continue the line on to the panel and do it properly?" You'd want to have a pretty good answer for that.
A more viable option would be to remove the RV receptacle altogether, extend off that junction box the feeder to the shed, converting the branch circuit to a feeder. Then from a subpanel in the shed, install the 50A RV receptacle. If this is wired with #6Cu or #4Al, once it's hardwired you can bump the breaker to 60A, or even 70A if it's THWN-in-conduit.
Comment: This. Code requires a subpanel on a detached structure to be wired differently than an outlet would be. Your RV socket might already be on a sub panel, which may make it further complicated. The biggest and most consistent issue is grounding and neutrals, so code enforcement is the way to ask.
Comment: I had my main house panel upgraded to a 200 amp service, some recess lighting done and the RV outlet all at the same time. The RV  outlet is wired into my new 200 amp panel as the label was added to the two circuit breakers. Could I replace the outlet with a disconnect box and from there run underground up too a panel in the shed?
Answer: Can you? or Should you?  You could, but it probably wouldn't code compliant or safe.  If you have 4 wire service (2 hots, neutral & Ground) to the existing outlet I would suggest installing a small sub-panel in the shed and hardwiring it.  You'll need to leave the junction box and connections permanently accessable and drive ground rods for the sub-panel, but that would give you the most flexibility in the future.

Camper outlet to power Shed


How to make profit from freeware application?

Question: The components that I'm using are restricting me from selling the application. Any ideas how to still make a profit from it? I've seen some freeware apps which set your homepage to some site, I guess they get paid for that.
Comment: Yeah, set users' home page. They'll love that.
Comment: In what way are you restricted? The GPL does not prohibit you from selling applications built from source under the GPL (not a lawyer).
Comment: Ofcourse they won't, but I guess that's the only thing I can do.
Comment: It's using Google Translate - http://research.google.com/university/translate/terms.html
Answer: There are a few ways.  If it's Web-enabled, you can put ads into the app that will generate revenue for you.  Or you could put a PayPal link on your site and ask for donations.  Or you could (probably) pay for a commercial license for the components and then be able to sell the program.
Comment: @blez: Well, if you can hook into Google Translate you can probably also hook into Google Ads, right?  But Berry's right.  Messing around with the user's configuration is a good way to get people thinking of your program as malware, so that's one good thing **not** to do.
Comment: I want to use google translate, **if** google allow me. That's why I wonder how to make my app payed (it's a sort of a dictionary). Should ads work for this?
Answer: In short, not really aside from potential advertising and / or begging for donations via paypal and the like. Things such as setting the user's homepage without permission and installing various crap on their system in return for revenue annoys users no end and would most likely categorise your software as malware!
My advice? Use it to create a good impression. Give away a good piece of software for free and users will thank you for it and sometimes check to see if you've got any more stuff available. It's also great to put on a CV if you've got a well used, decent free application.
If you're looking to make lots of hard cash from this though I'm afraid you're most likely out of luck. If you really wanted to go down this road you should've looked at the components you were using before launching ahead!
Answer: Well, there's probably a large number of ways to make money from something free. The first things that pop up in my head are consulting for the product (not applicable to every product), or using the product to get your name out there so that you get hired to do something else (think of the product as an example of your work).
If you really want to get paid badly enough there are borderline and sleezy ways to do so (adding someone's toolbar to your installer is borderline. Actively changing the user's home page is sleezy). Doing these things will get you some money now (though I hesitate to think it will be much money), but it will give you a reputation as someone who'd do anything for a buck. Make sure that's a rep you want before you go down that road.
I do have to ask though: given that you know you can't charge for the app, and given that money seems to be your primary motivator in this matter, why write it at all? If getting paid is what really matters for you, then you should focus on doing something that you can really get paid for.
If you don't like corporate life (and I can understand that), then you probably need to either find a different project, or a base library set that lets you do what you want. Heck, perhaps writing a new base set of libraries that's less encumbered is a project worth your time.
Answer: In 2003 we started this site that sold guides for games like Everquest and World of Warcraft. We had authors, an editing process, and a decent product.
One of our partners made this plugin for WoW that would help you sell all your uneeded inventory in a more-intelligent-than-usual way, and he gave it away through our site.
Apparently this was something people needed, because according to Analytics, that plugin made us something like 20k over a 6 month period and we didn't even do anything at all to push it. Kind of unbelievable.
So here's my point in a nutshell: software can be the best kind of content, and great content brings a special quality of traffic that converts at a higher rate than usual.
Also... People have done really well by asking for donations. The Dwarf Fortress guy publishes his donations each month and it's usually around $2,000.
Comment: Hmm... 2,000/month * 12 months = $24k per year.  Most professional developers with that level of skill make at least 3-4x that, if not more, so I'm not sure how "really well" that is...
Comment: @Mason Wheeler It's way more than I would have expected, that's for sure! Although you're right, if that's his entire  income, that could be a tough life...
Answer: It depends.  If you purely want to make a living from it then it's not a good path to follow.  However, if you wanted to make enough money to cover hosting costs etc, your best bet is to use PayPal's Donation button.  That way you can slowly receive donations for your work.


What is the difference between "idiom and proverb"?

Question: For example 'Kick the bucket." Is it an idiom or proverb? How can I recognize them?
Comment: @curiousdannii: I marked it as off-topic because it seems language-specific to me, a kind of question someone learning English would ask. To add to that, it has already been asked and answered here: https://english.stackexchange.com/questions/43725/whats-the-difference-between-a-proverb-and-an-idiom. In general, if you feel that one of the moderators has wrongly put a question on hold, please flag it to be reopened. That way, mods get called for attention.
Comment: "kick the bucket" is an idiom because idioms are referential phraseological units, unlike proverbs. For example, "kick the bucket" is simply another way of saying "to die."
Comment: I don't know why this was closed, it seems valid to me.
Comment: I believe the key difference is that an idiom is a figurative referring expression, but a proverb is a proposition (which expresses a common truth). So idioms usually are not full sentences, but proverbs are.
Answer: I think "kick the bucket" is an idiom.
"Idiom"=It is a phrase that the meaning of separate words is different from whole phrase.
"Proverb"=It is a fix sentence.
So the differences between proverbs and idioms are:
1."Idioms" are phrases/part of a sentence but "proverbs" are full/fixed sentences.
2."Idioms"--> sometimes have variants      "Proverbs"-->have no variants
3."Idioms"--> are not intended to have moral lesson       "Proverbs"--> have a moral lesson( advice, warn,..)
4."Idioms"--> every type of text           "Proverbs"--> literally or sociocultural texts
5."Idioms"--> frequently used        "Proverbs"--> are less frequently used
6."Idioms"--> sometimes used literally        "Proverbs"-->rarely used literally
7."Idioms"--> figurative extension of the words meanings        "Proverbs"--> based on folklore, an event/a famous poet, a legends
Comment: I don't think your definition of proverb is accurate.


Android application approval process in playstore

Question: i am new to android development i created one android application and i want to test this application in all aspects before submiting to the play store. I don't know the play-store approval process. please let me know the play-store approval process and also tell me how to test my application without any bugs(that will be rejected by play-store) and against to playstore approval process.
Answer: There is not much of approval process in play store, certainly not much like apple used to do.  You just need to make sure you read this and your app is okay on all points.

tell me how to test my application without any bugs

Well there is no short cut for that. Do your testing.. Google won't do it for you.. If your app is good, then only user downloads it.. It is not only Google that you have to consider..
Comment: This isn't true anymore. As of 2015, Google Play store apps are reviewed by humans, and are subject to similar approvals that iOS apps are: http://techcrunch.com/2015/03/17/app-submissions-on-google-play-now-reviewed-by-staff-will-include-age-based-ratings/
Answer: There is no play store approval process.  They run some automated tests for malware and you'll be on the market in a few hours.  So just do enough testing that you feel happy with the quality.
Answer: You're responsible for testing your own app. Google won't. There are just a few basic rules you need to follow, and your app will be approved:

You can't sell in-app content unless you use Google's in-app purchasing. You CAN sell physical goods using other payment methods.
You can't make your app free and then change them to paid later. Once they're free, they're always free.
You can't do anything racist, criminal, hateful, etc... and you can't do anything you don't disclose -- i.e. steal the user's contacts and upload them to your own server for malicious purposes.

Be very attentive to testing. If your app has bugs, users will quickly complain and down-rate your app.
Answer: There is no "bug policy" for google play store. Even if your app contains bugs, google will still publish it. Develop your app keeping user in mind.


The basics of anti-propositionalism

Question: Anti-propositionalism -- as I understand it -- is the view that sentences don't express propositions.  But if everyday sentences (like "The dog is behind the curtain") don't express propositions, what else could they express?
Comment: To answer your question by a question : nothing. It depends of you're a nominalist or a realist.
Answer: William G. Lycan summarize what he calls "Use" theories of meaning like this in 'Philosophy of Language' (Routledge page 84):

"Use" theories have it that "meanings" are not abstract objects like
  propositions; a linguistic expression's meaning is determined by the
  expression's characteristic function in human social behavior.

These views are closely connected with Wittgenstein's Language-game. In "Preformative Utterances" J.L. Austin state the following:

These performative utterances are not true or false, then. But they do
  suffer from certain disabilities of their own. They can fail to come
  off in special ways, […] the various ways in which a preformative
  utterance may be unsatisfactory we call, for the sake of a name, the
  infelicities; and an infelicity arises- that is to say the utterence
  is unhappy – if certain rules, transparently simple rules, are broken.
(Preformative Utterances in 'The Philosophy of Language', A.P
  Martinich, Oxford University Press page 292-293)

The utterances are what he calls either 'happy' or 'unhappy', not true or false. I found a PDF (Preformative Utterances, J.L. Austin)

When I say "I name this ship the Queen Elizabeth" I do not
  describe the christening ceremony, I actually preform the christening
  [...] Now these kinds of utterances are the ones we call preformative
  utterances.
(Preformative Utterances in 'The Philosophy of Language', A.P
  Martinich, Oxford University Press page 292-293)

Austin's pupil John Searle developed the idea under the label "speech acts". Their work greatly influenced pragmatics (from Wikipedia) H.P Grice have a great article called "Meaning" from 1957, which also can be found in 'The Philosophy of Language' by A.P Martinich.
Here is a good Wikipedia article about Meaning (Read section Usage and meaning).
If a utterance or statement fails to be truth-apt:

truth-apt denotes statements that could be uttered in some context
  (without their meaning being altered) and would then express a true or
  false proposition (from Wikipedia)

You can argue that the utterance or statement do not express a proposition.
Answer: As @GlenW notes, Wittgenstein rejected the notion that sentences, in isolation, expressed propositions, given that they require an entire context and rules of approval in order to actually have any effect.  The sociological arguments that go along with the distinctions he lays out may not appeal to idealists, so here is another motivation.
Propositions are a mathematical idealization of 'steps' or 'moves' in what he called 'language-games'.  In reality, the meaning of a symbol is deeply embedded in some system, and may or may not agree with something that has effective meaning.  Ideal fields like mathematics seem to be the place that should be the safest to assume our idealizations are good enough, but even that fails.
Consider all of the mathematics referring to 'classes' that are not 'sets' to avoid the notions of set theoretic limitation.  We happily talk about 'any group' or 'any topology' with such and such a 'property', but we still do not know whether those generalizations are propositions.  The property could somehow specify something that leads to a paradoxical outcome in some odd corner.  Then, are statements about such things propositions?  Not all of our logic of propositions is going to apply.
We have to see propositions as an idealization and 'get behind them', even to discuss idealized things properly.

The basics of anti-propositionalism


Does Linux provide file system journaling with Btrfs?

Question: NTFS provides something called journal. I think it is a record of actions like file rename/move/deletes done by any application. Can I get the similar journal or log on Linux + BTRFS? One BTRFS partition, which is used by only one Linux installation.
Example of NTFS Journal on Google Images:
Comment: BTRFS uses COW (Copy-On-Write) - not journaling.
Answer: I think you misunderstand the purpose of the journal. It is not a log of the actions done by applications, and doesn't record which application caused a change. It is not intended for users or administrators. It's intended as an internal tool for the filesystem.
For performance, disk writes do not always take place in the same order they are issued. If the system is interrupted by a power failure or a system crash before it has time to write everything, the filesystem could be in an inconsistent state. For example, if a file is being moved from a directory to another, it's possible that the disk block with the content of the old directory has already been written, but the disk block with the content of the new directory has not been written. If the system halts just at this time, the file is no longer referenced from either directory and is effectively lost.
There are several techniques to avoid this problem (which is usually known as resilience in filesystem design). Many filesystems, including NTFS, use a journal for this purpose. The journal records actions in the order they are taken, and each action is added atomically, so reading the journal always yields a consistent state. There are filesystems, called log-structured filesystems, where the journal is where all the information about the content of the filesystem is recorded. With others, including NTFS, all the information is eventually written outside the log: the log only contains recent information which might not yet have been written in its "normal" place. Reading a file does not access the log, it access the data directly in the normal place. The log is only read at boot time (more precisely: when mounting the filesystem) to finish any action that has not yet been carried out.
Generally, with a journaling filesystem that isn't log-structured, the journal will only contain very recent actions. The journal usually has limited space and old entries can be overwritten as soon as the corresponding actions have been written to disk, which typically takes no more than a few seconds. You may still be able to see old journal entries if there isn't much activity compared to the journal size, but it isn't something you can count on.
Some Linux filesystems (for example ext4) use a log. But Btrfs isn't one of them. Btrfs achieves resilience through copy-on-write. It never overwrites a disk block that's in use. To make an update, it creates a new block with the new data, then creates a new block for any place that contains the location of the block that needed to be updated, then creates new blocks for the places that contains the location of that, and so on. When it reaches the root¹, it ensures that all child blocks are written, then it updates the root. This way, the root always references always valid blocks.
If you want to track file operations, a filesystem journal is not the way to do it, either on Linux or on Windows. The main tools for that on Linux are LoggedFS and the audit subsystem. See Is it possible to find out what program or script created a given file? and List the files accessed by a program.
¹  That's the root of the block tree, not the root of the directory tree. The distinction isn't really apparent at this level of detail.
Answer: Given that btrfs is a COW filesystem, it should be always in a correct state unless it was buggy.
Journalling is only needed, if you overwrite data and thus the filesystem could become inconsistent if the write order would follow the idea to make a filesystem fast. Journalling is a way to make non-COW filesysten fast without touching stability.
Comment: @DamnVegetables Just because you've once managed to drive a screw in with a hammer doesn't mean you can expect it to work every time. Use a screwdriver.
Comment: What exatly don't you understand here?
Comment: "Journalling is only needed, if ... the filesystem could become inconsistent" -- But I want journal to track file move/rename/change. If you see the NTFS example above, at the 7th row from the bottom, it has logged that a file has been renamed. How can I figure that out that on Linux+Btrfs?


Directing specific apps to use different network connections than other apps

Question: Let's say that I have an iMac with a wired Ethernet connection and a WiFi connection at same time, on two separated LAN. Is this possible to ask Firefox to use the WiFi and Safari to use the Ethernet wire card ?
Answer: No, this is not possible at the application level.
Comment: You are correct that in the general case, the OS doesn't have a provision for steering traffic on a per app basis, but web browsers have proxy server settings that can be easily abused to accomplish exactly what the OP asks.
Answer: You may not be able to do this at the application level (firefox, safari, chrome, etc)..but you can do this at the ip layer. You can add specific routes and secondary gateways to your networking configuration, but this won't be determined by the browser, it will be determined by the the IP incoming/outgoing and pick a network card after that.
Answer: Yes - browsers are a special case in that they allow you to choose a proxy to access the internet. This doesn't over-ride the default route by itself as you will need to set up a web proxy with a known address.
Another option would be to install a second OS in a virtualization container and letting that OS see the alternate interface. This would be a great solution if you have a speedy mac with plenty of RAM.

Back to (ab)using the proxy settings to work around the network splitting...
Assuming you are OK doing that, then you would use the <code>/sbin/route</code> command to send the browser you want on the non-default interface to go through the non-default gateway.
This assumes you have basic network knowledge and basic command line knowledge. Once it works, you could automate things - but it gets complicated quite quickly. It is possible with some specialized knowledge, but not something you can click a button or two and have traffic from any app ignore the default routing that the system is using.


When we send transaction to a network we only send the signature of the transaction then how is the miner able to decrypt the message?

Question: When we send transaction to a network as shown below we only send the signature of the transaction then how is the miner able to decrypt the message?
If only the signed transaction is sent to the network how will the miner be able to decrypt the content of the transaction? Is there anything that is sent along with the signed transaction like the original transaction object? I understand that the unencrypted message should also be sent along with the signed transaction but the send block only takes signature as an argument. Would be thankful if someone could explain me.
https://www.youtube.com/watch?v=mhwSGYRmkEU&list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi&index=4&ab_channel=AustinGriffith
Answer: When we send a transaction to the network we send the transaction and the signature.
The miner/validator will verify the transaction is valid and signed and then process the transaction.


change application taskbar icon in kde

Question: through kmenuedit i can set new menu items and icons... however, once the application starts, it uses its own icon (which has been set elsewhere, i guess). how do i set a different icon for that application?
Answer: Any KDE application has the capability of loading and using a different icon than the built-in one on application start. Use the --icon option. See the --help-all option for further customisations.
Comment: been there, but to no success. what should i type after --icon? i pointed to an svg file but nothing happened. maybe png?
Answer: It think there is no general solution for this since the application sets this icon itself, AFAIK. However it might be possible to replace this icon for a specific application. For this I would have to know what application's icon you want to change.
Comment: i was actually thinking of firefox (not a kde app, so --icon won't work here).
Comment: On openSuSE 11.2 (64bit) the icons seem to be in /usr/lib64/firefox/chrome/icons/default/. It might be slightly different for 32bit (probably just lib instead of lib64) or other distributions. Just try whether switching the icons there with other icons of the same format works (keep backups of the icons).

change application taskbar icon in kde


Repeating 503's messages when querying DBpedia

Question: I'm conducting a series of queries to DBpedia SPARQL endpoint (from inside a loop). The code looks more or less like this:
for (String citySplit : citiesSplit) {
  RepositoryConnection conn = dbpediaEndpoint.getConnection();
  String sparqlQueryLat = " SELECT ?lat ?lon WHERE { "
                        + "<http://dbpedia.org/resource/" + citySplit.trim().replaceAll(" ", "_") + "> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat . "
                        + "<http://dbpedia.org/resource/" + citySplit.trim().replaceAll(" ", "_") + "> <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?lon ."
                        + "}";
  TupleQuery queryLat = conn.prepareTupleQuery(QueryLanguage.SPARQL, sparqlQueryLat);
  TupleQueryResult resultLat = queryLat.evaluate();
}

The problem is that, after a few iterations, I get a 503 message:
httpclient.wire.header - << "HTTP/1.1 503 Service Temporarily Unavailable[\r][\n]"
(...)
org.openrdf.query.QueryInterruptedException
    at org.openrdf.http.client.HTTPClient.getTupleQueryResult(HTTPClient.java:1041)
    at org.openrdf.http.client.HTTPClient.sendTupleQuery(HTTPClient.java:438)
    at org.openrdf.http.client.HTTPClient.sendTupleQuery(HTTPClient.java:413)
    at org.openrdf.repository.http.HTTPTupleQuery.evaluate(HTTPTupleQuery.java:41)

If I understand correctly, this 503 message is from DBpedia. Am I right?
The number of consecutive queries that manage to succeed is variable. Sometimes it runs for 13 seconds before getting the message, sometimes 15 minutes.
In any case, I don't think this is normal.
What could be happening?
Answer: The Accessing the DBpedia Data Set over the Web page of the DBpedia wiki says, in section 1.1. Public SPARQL Endpoint says:

Fair Use Policy: Please read this post for information about restrictions on the public DBpedia endpoint. These might also be usefull [sic]: 1, 2.

The linked post says that the public DBpedia SPARQL endpoint implements rate limiting.

The http://dbpedia.org/sparql endpoint has both rate limiting on the  number of connections/sec you can make, as well as restrictions on  resultset and query time, as per the following settings:
[SPARQL]
ResultSetMaxRows           = 2000
MaxQueryExecutionTime      = 120
MaxQueryCostEstimationTime = 1500

These are in place to make sure that everyone has a equal chance to de-reference data from dbpedia.org, as well as to guard against badly  written queries/robots.

I think that it is likely that you are hitting that limit.


Illustrator Rectangle Tool disabled

Question: I'm trying to draw rectangles but found that the tool has been disabled.
I'm sure I subscribed to Illustrator but why so many tools are disabled?
They look grey here:
Comment: Its not disabled, it is just a indication that the tool is allready in the tool bar.  And there it is 4 item from the top.
Answer: I just solved my own problem... Right click the icons on the left panel and they will unfold... intuitive design...

Illustrator Rectangle Tool disabled