jQuery error (tinyMCE is not defined) on Wordpress admin panel

Question: After upgrading Wordpress from 3.2 to 3.5 i am getting jQuery error on admin side.
below is the error.
Error: ReferenceError: tinyMCE is not defined
Source File: http://domainname.com/wp-includes/js/tinymce/langs/wp-langs-en.js?ver=345-20111127

Can any one please help me here . Thanks
Comment: it seems some of your plugins installed do not support WordPress 3.5
Comment: [Troubleshooting WP 3.5 - Master List](http://wordpress.org/support/topic/troubleshooting-wordpress-35-master-list)
Answer: It's better to use a declaration:
define('CONCATENATE_SCRIPTS', false);

in wp-config.php.
Answer: After reading a million posts about turning everything off, reinstalling everything, waving chicken bones over my keyboard and throwing salt over my shoulder, I decided to get serious.
tinyMCE is not defined means exactly that.  Assumption: it never got loaded.  Check the page source for http://yourdomain.com/wp-includes/js/tinymce/tiny_mce.js?ver=359-20131026'> or some other script tag for tiny_mce.js.  I bet you don't have one.  If you do, this is not the solution for you.  If you don't, read on.
I located the code that should be placing the js tag in your page in ...\wp-includes\class-wp-editor.php.
There is an if block "if ( $compressed ) {..." that will load ...\wp-includes\js\tinymce\wp-tinymce.php into the js tag (doesn't work) when $compressed = 1, or ...\wp-includes\js\tinymce\tiny_mce.js when $compressed = 0.  So I set $compressed = 0 just before the if block to force the else.  That fixed my problem.
It's an easy fix and if it doesn't solve your issue it is easily reversed without risking breaking anything else in the WP ecosphere.
Comment: Only solution that works. Gotta love it when we need to edit the core files. Great job Wordpress!
Answer: In my situation, disabling the defer javascript enhancements that I made in functions.php caused this error to disappear when loading edit pages.
Answer: For anyone else that comes across this and is pulling their hair out a bit, @dale3h's answer was the solution for me.
If you have a function in your functions.php which hooks into the script_loader_tag filter and doesn't always return the appropriate parts of the original tag markup, or has a bug in it of some kind, it can make some scripts fail to load because scripts to be output to the page are run through this filter first.
Something I've done to avoid this is whitelist script handles depending on what extra attributes I want to give them, so the work can be done conditionally (leaving all other scripts intact):
// Manage extra attibutes for enqueued scripts
function foo_script_extras( $tag, $handle, $src ){

    $whitelist = array(
        'js-font-awesome-core'  => array(
            'sri'   => 'sha384-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
            'defer' => true
        ),
        'js-font-awesome-light' => array(
            'sri'   => 'sha384-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
            'defer' => true
        ),
        'js-popper'             => array(
            'sri'   => 'sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ'
        ),
        'js-bootstrap'          => array(
            'sri'   => 'sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm'
        ),
        'js-gtag'               => array(
            'async' => true
        )
    );

    // Construct the script if we want to give it extra attributes
    if( array_key_exists( $handle, $whitelist ) ){

        // Extra markup
        $extra  = '';
        $mods   = $whitelist[$handle];

        // Check for SRI
        if( array_key_exists( 'sri', $mods ) ){
            $extra .= ' integrity="' . $mods['sri'] . '" crossorigin="anonymous"';
        }

        // Check for deferral
        if( array_key_exists( 'defer', $mods ) ){
            $extra .= ' defer';
        }

        // Check for async
        if( array_key_exists( 'async', $mods ) ){
            $extra .= ' async';
        }

        // Reutrn full script tag
        return '';

    }else{

        // Return the tag as-is otherwise to avoid breaking it
        return $tag;

    }

}
add_filter( 'script_loader_tag', 'foo_script_extras', 10, 3 );

This is not a terribly general solution in terms of checking for which attributes to add to the whitelisted handles, and I would have used something along the lines of "for each attribute of a whitelisted handle, add the key if it's a bool and is true, else add it's value" but SRI needs two attributes (integrity and crossorigin) so I've left it for now.
Additionally, if you don't see /wp-includes/js/tinymce/ somewhere in your page markup (similar to what @Mar said, but the exact script name can change between versions it seems) then that script ain't loading!


Physical Meaning Behind Matrix Factorization

Question: As we all know, Matrix Factorization is an effective method to do rating prediction jobs in recommender systems. Thanks to the work of Yahuda Koren. My question is why MF can do this job ? What's the physical meaning behind it? Waiting for your kindly reply....
Comment: See  http://stats.stackexchange.com/questions/177102/what-is-the-intuition-behind-svd/179042#179042
Answer: The Singular Value Decomposition is one of the most useful matrix factorizations, and is used often in the application you mentioned.
A great way to understand the 'meaning' of the SVD is to think of each of the three factors $U,\Sigma, $ and $V^*$ as a step in a process which takes $x$ to $Mx$ (where $M = U\Sigma V^*$).
First, recall that $V$ and $U$ are both unitary. This means that magnitudes are preserved under the transformation (i.e. $\langle Ux,Uy \rangle = \langle x,y \rangle$ for all vectors $x$ and $y$). Also note that $\Sigma$ is a diagonal matrix of scalars, and so only affects magnitude and does not rotate vectors it operates on.
Now think about what happens to a vector $x \in \mathbb{R}^n$.
First, $V^* \in \mathbb{R}^{n\times n}$ rotates the vector (rotations are the types of linear transformation which preserve magnitude) in $n$-dimensional space.
Then $\Sigma$ scales the vector $V^*x$.
Finally, $U\in \mathbb{R}^{m\times m}$ rotates the vector in $m$-dimensional space.
Wikipedia has a great animation which reinforces this process.


DDrescue sequence of operations?

Question: So I'm running DDrescue on a 1.5tb drive. I left 'r' at 2, to attempt to cut down on time needed to complete the task. At 2 1/2 days, it's still going, and now it's making the first pass on retrying bad sectors. Is the sequence of operations for DDRescue, 1 pass untried blocks->retry bad sectors->repeat process according to 'r'?
Answer: Note that GNU ddrescue is a pretty advanced tool. While it offers a lot of flexibility, this warning from their manual should be heeded. If you are merely in the unfortunate situation of trying to get as much of your data back as possible, you may be better off with the dd_rhelp script included with dd_rescue
Here is the desciption of "retries" from the GNU ddrescue manual:

-r n
  --retry-passes=n Exit after given number of retry passes. Defaults to 0. -1 means infinity.  Every bad sector is tried only once in each pass. To retry bad sectors detected on a previous run, you must specify a non-zero number of retry passes.

To answer your question directly: after the initial read (pass 1) it will retry two more times on just the sectors that it was unable to read the first time. This means effectively three passes total.
When it gets done with the initial read it will display on stdout Retrying bad sectors... Retry 1 and then Retrying bad sectors... Retry 2 before finally Finished.

DDrescue sequence of operations?


ALAssetsLibrary causes "Store configuration failed. Creating new database." Message

Question: EDIT: I am using a shared instance of the ALAssetsLibrary in the AppDelegateController, and have debugged it several times and see that the lifespan of the library seems to be for as long as the app is running.
static ALAssetsLibrary *library;

+ (ALAssetsLibrary *)sharedLibrary {

  if(library == nil) {
    library = [[ALAssetsLibrary alloc] init];
  }
  return library;
}

I am executing the following code in an iOS 5 (release) app:
[[ALAssetsLibrary alloc] init]

Frustratingly, I see the following:
Store configuration failed. Creating new database. (Error Domain=NSCocoaErrorDomain Code=134010 "The operation couldn't be completed. (Cocoa error 134010.)" UserInfo=0x329b30 {metadata=<CFBasicHash 0x34f3b0 [0x3e7a3630]>{type = immutable dict, count = 0,
entries =>
}
, reason=The store type in the metadata does not match the specified store type.})
This causes the UIImagePickerController to not see any of the phone's stored photos.
I am running this on an iPhone 4. I'm unsure if this matters, but this app was originally built for iOS 4.3, and recently we were upgrading a few things to iOS 5.0 compatibility.
Is anyone else running into this? Any work arounds or solutions exist?
I've been doing a lot of Googling and searching the Apple Forums, but haven't had any luck.
Thanks!
Answer: Most likely your Photo Library is corrupt. Please perform the following steps:

Sync your device one time with iTunes
Open the Photos app on your device.

This should rebuild the Photo-Library.
Then try to run your app again.
Cheers,
Hendrik
Comment: I forgot to mention that we've tested this on about 5 other devices, so I don't think it is likely corrupt photo libraries here.


get tAda for cardano legacy testnet

Question: How can I get testnet ada for cardano testnet, Now that cardano faucet only has option to get tAda for preprod or preview testnet. I'm trying to mint NFT using this website. https://stage.cardahub.io/marketplace My nami wallet address addr_test1qppc30u4xqy3afe0vlpg65p850w88zw8zxa066r5rs980ltxfzqvxhdf33fnyepwwkhuua522lvyaajyk3l5lp7204kscn3pax Please send me 20 tAda if you have some.
Answer: The testnet is deprecated, latest release of node does not support it. Best to use pre-prod.
Comment: Yes I know its deprecated, I tried to use the above website mentioned in my question. I guess I'll just skip that. BTW do you know any testnet NFT marketplace.

get tAda for cardano legacy testnet


Can you suffocate a creature using Create Water?

Question: Can a cleric with Create Water conjure water inside a corporeal creature's lung (or appropriate respiratory system) to suffocate him? If not, can he drown the creature by conjuring water around him?
Comment: @Samuraisoulification Stack Exchange isn't a good fit for open discussion questions; you're basically asking for any creative use of the spell that we can think of. That means every answer is equally correct and it invites debate and discussion (like the "but what about?" comment you gave to the answer below), which isn't what Stack Exchange is for. You would have more success with this question in a standard RPG forum. Please take a look at the [tour](http://rpg.stackexchange.com/about) and the [help](http://rpg.stackexchange.com/help); they're a useful introduction to the site.
Comment: @Samuraisoulification I edited the question to be objective, assuming you have intended that way. Please check the revision, and feel free to accept or decline it based on whether the edit fits your purpose. By the way, you don't have to worry about purifying the water, since SRD specifically says _The water created by this spell is just like clean rain water, and it doesn't go bad as the food does._
Answer: The specific description of the Create Water spell on page 215 of the Player's Handbook says:

Water can be created in an area as small as will actually contain the liquid, or in an area three times as large

and

Note: Conjuration spells can't create substances or objects within a creature.

Thus you couldn't create the water directly inside the creature, both because it is a creature, and because it's mouth would (most probably) be too small to contain the entire  volume created.
This does not stop you from conjuring the water in an appropriately inanimate container and then forcing it into the creature.
Answer: No to the first, can't create it within the creature.
As to the second, if you could drown a creature by creating sufficient water around them... that depends on where we are and how much water*.
If standing in relatively flat land, creating the water over the head would just lead to the equivalent to the "Ice Bucket Challenge" or the ritual pouring of water over a coach's head at the end of a sports game. You could argue for some surprise value, but gravity keeps it from staying at nose level for too long.
At 8 gallons per cubic foot, you'd need to be around 144th level to cover someone in a sarcophagus with a foot of water. But what about their head? At 4th level you could cover someone's head reliably enough. They'd have to be unable to remove their head from said water. This wouldn't be terribly doable in combat, and if the goal is SOLELY to kill, it's not terribly effective.
However, as an execution ritual it works fine. It also works well for a magical murderer. Add in a custom spell (or side-effect of another spell) to freeze water, and you've got yourself a D&D take on the old "ice bullet" mystery!
* = And, of course, depends on your GM. If your GM says that your Half-Orc who's wrestled a kobold can put his hand over the kobold's mouth and use Create Water to suffocate/aid in suffocating the critter, that makes sense... but it also makes sense if your GM says "No, that's not the point of the spell so it just doesn't work that way."


Finding highest point relative to point data

Question: I'm very much a beginner with QGIS (3.10.4) and I'm still learning terminology etc so my understanding is currently quite basic. I'm trying to find out the highest point of a hill relative to a point. I have slope and aspect and height data extracted for each of my 600 points but is there a way how I can find out if a certain point is or isn't at the highest point of that hill? Hope that makes sense...
Comment: I'm not sure what "the highest point of a hill relative to a point" means. Do you mean the highest point that can be reached going only uphill from some given point? How are your hills defined? Do you have one elevation map for each hill for each of your 600 points?
Comment: Are you looking for the maximum elevation of all of your 600 points on a map?
Comment: Due to the QGIS fast development cycle, if it's possible, try to use the latest LTR release whenever possible.
Comment: Thanks all, I have points for coin hoards and want to see if they're buried at the highest elevation of the immediate landscape, I have a 50m DEM. Apologies for my lack of understanding.
Answer: Step 1: Add raster values to points (set z from raster), so your points know how high they are.
Step 2: Run maximum("height field") on your point layer in the field calculator creating a new field of the corresponding type containing the maximum value of the height field of all your points.
Step 3: Check whether the height of your current point of interest is the max height.
Comment: Thanks Erik I will try this.


Server-sided variable output within a style tag in the ASPX markup

Question: I got a user control that I want to style with a larger bunch of CSS. Because the control can be implemented several times into the website as well as the CSS can vary on dependent properties of the user control, I cannot use a global extern CSS. So I need a scoped CSS part that comes with the control itself. Unfortunately HTML5 scoped styles are not common yet, so this is out of question.
My idea: I want to use a style tag within my root asp:Panel of my user control to style specific parts of my control. With the generated client ID of the parent container I can define a strict scope of the CSS. I optain the generated ID with a server variable:
<asp:Panel ID="pRoot" runat="server">

    <asp:Panel ID="pTest" runat="server" CssClass="myClass" />
</asp:Panel>

Now this will not work as it assumes <%= this.pRoot.ClientID %> is CSS, too.
I know a static parent ID or code behind mechanics can solve this specific case, anyways.
So I just wonder:
Is there a way to get a server sided variable into my style part of my markup without using code behind?
EDIT: It turned out, that the above example will work. Visual Studio just tells me the above example is not valid HTML. Annoying error, makes the same problems just as using server sided variables in JavaScript. Microsoft, something has to be done about that.
Any idea to get rid of this error?
Answer: You can bind to page level methods and properties:
<%# propertyName %>

<%# MethodName() %>

both implemented in your page class.
The ID could come from server side anyway.


Terraform Mars with Phobos dust?

Question: According to the following reference, a few tons of infalling space dust cause the Martian clouds: https://www.sciencedaily.com/releases/2019/06/190617125120.htm. These clouds can boost local surface temperatures by up to 20 Kelvin. Could we boost this effect by mass driving crushed dust from Phobos into the Mars atmosphere? 10 tons a day would already be a factor of 4 increase.
Comment: Welcome to Worldbuilding.SE Ags1, glad you found us.  Please check out our [tour] and [help].
Answer: Meteorology is a nasty science: there are a lot of interactions, feed-back and feed-forward, making hard to evaluate the effect of a single element.
What you read in that article comes from the dust acting as condensation nuclei and leading to cloud formation.
However, more dust in the high atmosphere means also more solar light reflected back into space (Krakatoa and Pinatubo eruptions, nuclear winter, all those are due to this). This makes me think that the increase of temperature due to the higher cloud coverage could be easily canceled by the lowered solar irradiation resulting from the dust in high atmosphere.
Even if this was not the case, by just increasing the temperature you won't terraform Mars. You also need to have more water and more gases in the atmosphere, and a magnetic field to shield solar wind. By just increasing the temperature you just increase the net loss of gases from Mars, due to the increased fraction of them reaching escape velocity.
Comment: All Mars terraforming strategies I know of first increase Mars temperature. That liberates the frozen CO2 deposits and leads to a positive feedback warming cycle as well as thickening the atmosphere. Regarding water, Mars has plenty, enough to cover one third of the planet in 100m of water. Atmospheric erosion is an issue - over geologic timescales. Needing to build an artificial magnetic field in the next 100,000 years doesn't sound like a big problem.

Terraform Mars with Phobos dust?


Do modern refrigerators and freezers benefit from point-of-use surge protection?

Question: If so, what type of protection is recommended?  And is it still needed if you have a whole-home surge protector installed at the load center? (I do, FWIW).
Answer: There are some common misconceptions, even with experienced electricians, with respect to surge protective equipment.
Most common surge suppressors are shunt type and function as parallel devices.  When you use a power strip, it doesn't block surge current from reaching the receptacles, it bleeds off surge energy before it gets to those receptacles.
The electronic component that achieves this function in most commonly available surge protection is a metal oxide varistor, or MOV.  MOV's come in different sizes and different qualities with respect to how they react to voltage changes.  Some MOVs are more sensitive than others.
Shunt type surge protectors like MOVs work better when they are closer (in wire distance) to the protected equipment due to the effect of the inductance in the wires.  Longer leads to the MOVs and longer wires to the protected equipment have more inductance and allow more surge energy through to the protected equipment.
The whole house protector on your panel is good,  but it's better still to have point of use surge protection as well.  The point of use protection will usually react faster (more sensitive) and will allow less voltage through to the protected equipment.  The panel protector protects everything in the house and helps dissipate some of the energy so the point of use don't have to do it all on their own.
The major components of appliances are generally pretty robust so traditionally people use more basic point of use surge protection for them.  The receptacles with built-in surge protection were consider pretty basic but adequate.
However everything has a microcontroller any more, and nothing's repairable any more - appliances are made to be disposable - and they are certainly more expensive than ever.  So it makes more sense to use better point of use surge protection for appliances today.
MOVs are sacrificial.  Sometimes they get hit with a big surge and explode.  Sometimes over time they erode blocking smaller surges over time.  Usually the MOVs in appliances are on the small side and don't have a real long lifespan.  I have never seen an appliance that lets you monitor how much life is left in the MOVs.  So although it's good that there's surge protection in appliances, it still makes sense to use point of use surge protection.
Answer: Many modern refrigerators have built-in protection . The last one I had burn out due to power surges was a 1980 model GE ( burned out start capacitor - replaced). My present 2010 Samsung has been through many power outages including instantaneous on and off as the power company works on the line. I try to turn it off but often it is too late. So , I do not think it would be a benefit for a modern unit.
Comment: The small MOVs in appliances are helpful but they don't last long, and you have no way of knowing how much they have degraded.  You might want to install some point of use protection before they are done.
Answer: Wow some bad info here. Surge protection as identified for line surges from the power company or on separate circuits are best protected as close to the main as possible. If you have a dedicated circuit for the fridge you need no other protection.  The whole home protection will take care of small motor loads better than a point of use in the case of a dedicated fridge, washing machine (laundry circuit is dedicated) those are most homes big loads other than a well and again normally a dedicated circuit or sub.
If you have sensitive electronics don't put them on the same circuit as motor loads. Most point of use issues I have been called in for are meltdowns on homes that did not have whole house suppression.
The elcrapo point of use " surge protectors" really do almost no good and when they actually dump a good jolt to ground many melt down.
Why do I say this the point of use normally have a much higher breakdown voltage so you think they are doing a good job because the little green light is on but they don't start working in many cases until over 800v spikes, if they don't have a monitor that verifies they are functioning they are useless as you don't know if they are good (they are designed to blow open when overloaded).
If you could not get one with a monitor because you don't have a proper ground is it still good? If your whole house unit is still green your point of use will be also.
So as you can tell I am not a fan of point of use I have seen probably close to 50 melt down melt carpeting and damage furniture but none caught fire yet smoke yes. They all had the same issue they were not mounted on a non combustible surface. Well do you want a point of use where it can do damage inside or a unit mounted on or close to your breaker panel that dose a better job in the first place.
Comment: Sorry but you're dead wrong on the distance issue.  Most manufacturers of MOV type surge protection, which is 99% of what's on the market, have whitepapers explaining that the protection works best when it's closest to the protected equipment due to the effect of inductance in the wire on let-through voltage.  This is the same reason you keep the leads as short as possible when installing surge protection at the panel.  Remember, they are parallel devices, not inline / series surge protection.
Comment: surge protection as close to the main as possible is the best if you read my answer second sentence I did say exactly that!  not only am I a electrician but I have a degree in electronics. It makes absolute no difference on dedicated circuits and the cheap point of use strips because the MOV's have a higher break down voltage. The cheap point of use ones are also known for melting down I have read about them catching fire but I have only observed meltdowns.
Comment: With all due respect (and you are due considerable respect!) that is what I am disputing, nearer the main breaker is less effective than protection near the protected equipment.
Comment: Absolutely no difference on a dedicated circuit with the main being protected as I said, if you want to suggest a product other than the standard melt down type of devices that have higher breakdown voltages it could be true on a non dedicated circuit but the meltdown models having a higher breakdown voltage could be attached directly to the motor and do less good than most whole house units. It's all in the breakdown voltage and the joules they can dump. Both are substandard in almost all point of use plug in units. I don't know of anyone that thinks these block a surge they dump to ground.


Question related to Diophantine approximations and Roth's theorem

Question: The following question came up in my arithmetic geometry course yesterday. Suppose $\alpha$ is an irrational real algebraic integer, and suppose $\epsilon >0$ is given. Then by Roth's theorem there are at most finitely many rational numbers $\frac{h}{q}$ with $\gcd(h,q)=1$, $q>1$, such that
$$
\left| \alpha - \frac{h}{q}\right| < \frac{1}{q^{2+\epsilon}}.
$$
Are there any results on how large such $q$ can be? Thanks.
Comment: I presume not, for two reasons.
1) The proof of Roth's theorem involves many solutions h/q, H/Q, with Q much larger than q and concludes that they don't exist. Knowing effectively one h/q would lead to an effective Roth's theorem, which is still unknown.

2) In the related context of Mordell's conjecture, Szpiro has put forward a "small points conjecture" asserting that a curve has a point whose height is not too large. Again, it implies the yet unknown effective Mordell.
Comment: Ramin, you probably wanted to ask "how large the largest such $q$ can be?" ($q=1$ works for any $\alpha$ as you can choose $h$ to make $|\alpha-h|\leq 1/2$.) As far as I know there is no known bound, this is a major open problem in number theory. If $\alpha$ is special (e.g. a cubic irrational) then there are bounds for $\epsilon$ not too small.
Comment: @GHfromMO do you have a link to the source for the special case of $\alpha$
Comment: @PTrivedi Seach for "effective irrationality measure". For example, here is a 2009 result by Bennett on approximating $\sqrt[3]{2}$: https://doi.org/10.1017/S144678870000104X
Answer: Of course, there may be none or there may be a very small one (if $|\alpha|<1$ then $q=1,h=0$ works). If there is a small very good approximation, the others must be very large. There are lots of papers on effective diophantine approximation dealing with this. I recall there was a paper of Davenport and Roth which first established such a bound.
Comment: Davenport and Roth's paper deals with bounding the number of $h/q$ such that the inequality is satisfied. They do say though that they do not know how to answer the question I'm asking. I was wondering if there has been any progress in this direction. I added the restriction that $\alpha$ is an algebraic integer.
Comment: I'm not sure I understand how making $\alpha$ an algebraic integer will change anything, you can still have $|\alpha|<1$ and $q=1,h=0$. You might want to think more carefully about what it is exactly that you want to ask.
Comment: I added $q>1$ to the statement of the problem. As Antoine points out this came out of the discussion to figure out if it was possible to make the proof of Roth's theorem effective (or improve the Davenport-Roth bound).
Comment: You still are not making sense. I can still have $|\alpha| < 1/8$ and let $q=2,h=0$ which works for any $\epsilon < 1$. If you want to make Roth's theorem effective, you need to ask how big $q$ can be in terms of $\alpha$, not how small. There is also something called the gap principle which shows that good approximations to a fixed algebraic number cannot be close together.
Comment: Correction, of course $2,0$ are not coprime. Take $q=2,h=1$ and $|\alpha - 1/2| < 1/8$.
Comment: Felipe, I am with you, see my comment to Ramin's original question. Ramin, you really need to change it.
Comment: For some odd reason I kept missing the point. Sorry. I just changed the statement.
Answer: My other answer was for the first version of this question. The question has now been changed completely. As Antoine mentioned in his comment, an effective Roth's theorem is not known in general. Finding such a result is the probably the main open problem in Diophantine approximation. There some instances in which a non-trivial effective result can be proved. Most notable is the Baker-Feldman theorem which provides such a result with an exponent of the form $\deg \alpha - \epsilon$ (instead of $2+\epsilon$) for a suitable small positive $\epsilon$.


Family with kids driving from Marrakesh to Fez - any threat of danger for daytime driving?

Question: We are two parents with three children, a blonde, a red head and one brunette, ages 8,9,and 12 years.  Why do I write that? because we look very American which may not be such a good thing in Morocco.   I love everything I read about the adventure, history and beauty of Morocco and it may be ignorance, but I am afraid of driving cross country and have a fear of being pulled over by machine gun toting rebels kidnapping my children.  Feels awful to say it and this is very ignorant on my part but as a mother I wonder if I am jeopardizing my children??  We have planned driving trips through many European countries and Mexico, when it was safe.  We love to drive and gain our freedom and it is also economical for a family of 5.  All I have read say that Morocco is safe and the people are kind to Americans.  We are well traveled and enjoy simple living and immersion into the culture.  My route would take us from Marrakesh over the mountains to the Kasbahs, Falls, Atlas Film Studio with a drive toward Merzouga and an overnight camel trip to the Sahara and then a drive to Fez. I want to figure out how to put Essouira into the mix as well. I know bad things can happen anywhere in the world I just don't want to fly my family into a place where I shouldn't.  I am becoming more educated that this would be a safe journey.  Please respond.
Comment: The drivers are pretty reckless. But I don't think it is much worse than in Rome or other capitals. The road are in a bit worse condition than in Europe. That probably could be an issue.
Comment: Did you end up going to Mergouza/Sahara? IF so, did you feel safe? We are considering the same trip with our 3 daughters.
Answer: You're worrying way too much about this! Morocco sees a huge number of European tourists (~370,000 from the UK alone) due to its proximity to Europe thanks to cheap low-cost carrier flights as well as historic ties it has with France, being a former French colony. (To this day, French is one of the more commonly spoken languages, at least in the bigger cities, in Morocco.) Travel advisory by the Foreign & Commonwealth Office UK mentions a general threat of terrorism as is common in the Asian/African region, and yes, driving standards may be significantly different to what you're used in the US or Europe. However, in practical terms Morocco is an extremely safe country and you certainly aren't going to find 'machine gun toting rebels' (who exactly do you think is rebelling against what?) kidnapping tourists.
There have been incidents of tourists being kidnapped a couple of years ago in some other North African countries such as Algeria, but not Morocco (as far as I can see from a general web search).
Comment: Another victim of US mass media saved :)
Comment: @littleadv Ahem all you want but none of the places in the itinerary fall in the less-inhabited bits of the Western Sahara. :) All the places *including* Merzouga which can legitimately count as a part of the Sahara are widely frequented by tourists and there haven't been incidents of tourist kidnappings.
Comment: Ahem... Western Sahara folks? Not that I disagree about your general assertion re the safety in Morocco, but there **are** rebels there.
Answer: I've just returned from a 1500km driving tour of central and eastern Morocco. My girlfriend and I both felt very safe in and out of the car, welcomed by the locals in cities and villages. The only risk for driving during the day is the abundance of traffic police with checkpoints and radar guns. We were stopped for crossing the white center line (which is hard to avoid doing with very slow trucks, donkey carts, and cyclists on the road) and asked to pay a fine. I talked my way out of it, but could see it happening again if I wasn't on my toes.
Answer: Morocco is a relatively safe place.
The biggest issue would be heat and sun if you travel in summer.
Take care of air conditioning in the car and of long sleeves to protect the skin of your blonde and red head children (though I guess that all the family could benefit).


Running C# files out of Google Drive

Question: I like to be able to code on both my laptop and desktop (both with Win 10), therefore I have Google Drive to sync my files between the two. My first issue was that the user folder on both computers was different, but I've changed them so they'd effectively have the same path via the method in this post.
However, now the issue I'm having is that my C# files keep giving me an "access is denied" error when trying to run them through Visual Studio:

Error : DEP0700 : Registration of the app failed. error 0x80070005: Opening file from location: AppxManifest.xml failed with error: Access is denied.
  . (0x80070005)  App1

I've tried saving them to my documents folder to which they ran with no problems, so I tried reinstalling Google Drive, but with no change. Also, just to note, I made a new project to test after each change.
Comment: Can you make sure that both folders on both PCs are exactly the same? I tried to do the same 2 years ago. I have created a project in the Google Drive directory of PC1 and it executed. Then I tried to run the project on PC2 (same name and path), but it did not run. The problem back then was that GDrive did not synchronize all files, because some file extensions were not allowed. Therefore, some files were present on PC1 (where the project was running), but not on PC2 (where the project was not running because of missing files). However, I don't know if they have changed that in the meantime...
Answer: I was having the same issue as you but I managed to resolve this. The error you have is a logical result of the NTFS rights on your hard disk.
When installing Google Drive, the drive has been setup to only be managed by the user with the email address you provided. So, technically, the system itself has by no means access to your drive. Only you, having that email, can access it.
We can resolve your problem by adding "system" as a folder administrator of your Google Drive.

Go to your drive folder. Right-click and select properties:

Go to the security tab:

Add the system as a user:

Set its rights to all:

So, this should have resolved your problem.
Be sure to do this while your visual studio is closed, so no files from the drive can be altered during this process.
Answer: Google Drive is not appropriate for storing or syncing code.You should use version control for storing and syncing code. SVN and Git are both good at this, but Git is far more common these days and you can use Git with Github for free. It allows you to sync between two computers easily, but far, more importantly, it allows you to version your code which is absolutely essential when it comes to building software.
Sign up for Github or some other Git service and store a clone of your code there. That will mean that your code is always available wherever you are, and every line will be versioned.

Running C# files out of Google Drive


My male platy's behavior has changed

Question: My male platy is the father of the four females in the tank.  Mom died about six months ago and we figured dad was just get along with the females once they got older.  He was always a little guy but they are MUCH bigger.  They might be pregnant. However, they have soundly rejected him and he wanders alone in the tank, sometimes just hanging with the catfish.  The females are wild and all over the place and literally will bump him and he has started to hide. He also looks smaller or are the girls just bigger.  What gives?
Answer: Are you absolutely sure they are all female? In my swordtails (they are pretty much the same fish anyway) I've noticed that late developing males are a common occurence, fish I thought were female in the start turn out to be male.
I have had many cases of these "late bloomers" who turn out to be male when they get bigger. Maybe one of your females is actually a male now, and because he's bigger, simply bullies your other male out of the picture. Observe your fish and make sure. There is a very aggresive hierarchy among males in these types of fish. The smaller one will always be bullied if there are not more than 2 to spread the aggresion on. This leads to it being forced to hide 24/7.
Comment: They aren't necessarily "late bloomers". These fishes (and some other species) will actually become male if there's a shortage of male fishes. I'm not exactly sure how they determine that though.
Comment: True, this as well. This adds onto the "female is now male" idea I'm bringing up.

My male platy's behavior has changed


Itô Formula for Hilbert space-valued Lévy processes

Question: I know there are Itô formulas for cylindrical Brownian motions with values in a Hilbert space and Itô formulas for Lévy processes in $\mathbb{R}^d$.  My question is:
does there exist an Itô formula for a Lévy process with values in a Hilbert space?
Answer: Yes, there is an Itô formula for Hilbert space valued semimartingales.  On this matter, see Appendix D of

S. Peszat and J. Zabczyk, Stochastic Partial Differential Equations
  with Levy Noise, Encyclopedia of Mathematics, Cambridge University
  Press, 2007.
Comment: Great!  But I was wondering if there is an Ito formula for a function of time and space similar to Theorem 4.32 of "Stochastic Equations in Infinite Dimensions-Cambridge University Press (2014)" but with Levy Noise instead of Brownian Noise


General Relativity view of Newton's apple

Question: If one considers the free fall of an object of mass $m$ from a hight $h$ in the Earth's gravitational field (neglecting air friction) from the point of view of GR, what would be the main corrections to the Newtonian result for, say, total time until the object reaches the ground?
Comment: This is essentially the question: *"How long does this take in GR to fall to the ground?"*, right? (That question would be homework-like, in my opinion)
Comment: Well, I am not interested in the actual calculation, I just assume this a well know result in GR and was curious as to the order of magnitude of the difference from the classical (Newtonian) result.
Answer: There isn't a simple closed form expression for the distance as a function of time in general relativity. However if you're just interested in how big the difference is I think there is a nice way to see this.
For simplicity let's take a falling object with zero total energy. In the Newtonian case this means the kinetic energy is equal to the potential energy i.e. that the object notionally starts at rest at infinity. Equating the kinetic and potential energy gives:
$$ \tfrac{1}{2}mv^2 = \frac{GMm}{r} $$
from which we get the Newtonian equation of motion:
$$ \frac{dr}{dt} = -\sqrt{\frac{2GM}{r}} \tag{1} $$
The derivation of the corresponding equation in general relativity is somewhat involved so I'll skip the details and just quote the result. If you're really, really interested the gory details are given in this article. Anyhow, the result is:
$$ \frac{dr}{dt} = -\left(1 - \frac{r_s}{r}\right) \sqrt{\frac{2GM}{r}} \tag{2} $$
where $r_s$ is the Schwarzschild radius.
The difference between the Newtonian expression (1) and the GR expression (2) is that factor of $1 - r_s/r$, so calculating the factor is a good way to see how big the difference is. Let's do this for the Earth's surface. The Schwarzschild radius is:
$$ r_s = \frac{2GM}{c^2} $$
and if we feed in the mass and radius of the Earth we get:
$$ \frac{r_s}{r_e} = 1.39 \times 10^{-9} $$
So GR predicts the velocity when the object reaches the Earth's surface will be smaller than the Newtonian expression by a factor of $0.9999999986$.
The more eagle eyed amongst you will have spotted somethng odd - equation (2) tells us that when $r = r_s$ the factor of $1 - r_s/r$ goes to zero, so the velocity is zero at the event horizon. This is the reason for the notorious claim that nothing can fall into a black hole, because all falling objects tend asymptotically to a velocity of zero at the horizon.
Comment: Is this the non simple closed form equation? https://goo.gl/photos/e4Gfz7fWtksGY7g47

The time it takes for a particle to fall from r2 to r1. The equevelant of t=sr(2h/g) in Classical Physics
Answer: The difference is often due to the addition of the Lorentz factor, which you can apply to equations of motion using a Lorentz transformation. Dr. Wolfgang Rindler was kind enough to write a small paper on this on scholarpedia. The Lorentz factor ($\gamma$) is often defined as:
$$\gamma = \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$$
This changes basic momentum from $p = mv$ to $p=\gamma m v$. The wikipedia article actually shows a chart about the value of the Lorentz factor depending on speed. The Lorentz factor tends to not matter at low speeds ($v<<c$), but becomes increasingly important as the speed increases, in a very non-linear manner.
When you say how long does it take for an object to fall, do you mean as measured by the object falling or an on the surface who is not moving? According to the summary of a talk given by Benjamin Knorr here, fast-moving objects experience an (constant) acceleration in proportion to the cube of the Lorentz factor when compared to the stationary acceleration. Specifically:
$$a_{moving} = \gamma ^3 a_{stationary}$$
which means the fast-moving object will experience a much larger force, which helps it conform to the stationary observer's observations of the object. This means the fast-moving object takes less time to hit something according to its perspective than the stationary observer sees.
So the correction to Newton's falling apple will go from
$$\Delta x = v_0 + at^2$$
to:
$$\Delta x_{apple} = \gamma v_{0, observer} + \gamma^3a_{observer}t_{apple}^2$$
where variables with the "apple" subscript are relative to the apple's perspective and variables with the "observer" subscript are the observer's. The observer will be considered stationary. For our observer, the apple falls like normal.
If the apple fell at mach 1, the Lorentz factor is about 1.000 000 000 000 644, which means the apple does not experience much time dilation. (I did it quickly on wolframalpha.com, and they didn't give me enough places to see a difference beyond the micro-second range.) For the observer, nothing really changes if they're using Newtonian or Relativity-Adjusted Newtonian mechanics.
Comment: Now I get it. The Lorentz factor differentiates Classical Physics with Special Relativity. The question is about General Relativity which explains free fall with curved spacetime
Comment: So why did John in the answer above say that there isn't a simple closed form equation in GR? You can very easily solve for time in your equation and whoila!!
Comment: @Bill I think I'm coming at it from a simpler perspective than John... Honestly, I need to take time to read that paper he linked to find out why he didn't go for the Lorentz factor.


bitcoin transaction showing unconfirmed over 6 days

Question: A friend sent some bitcoin to me worth $91 on May 7 2017 (with extremely low fees without initially telling me). It show unconfirmed till 10 may 17 when it returned to sender and was able to login and send bitcoin to other users.  Surprisingly, I login this morning and the bitcoin has resent itself to my wallet.  Since then I have tried two transfer with extremely high fees.  It is showing pending and I need those transfer to really go through. Pls how do i solve this problem. The hashcode is b27e371f54cd24d2bdcc8d9e283dc7929589949c6d8ab47232feb6d13cb9f778.
Please I need urgent help.
Answer: The only thing we can do is to wait for the transaction confirmation, like me now. This link show that more than 120.000 transaction unconfirmed including ours https://blockchain.info/unconfirmed-transactions
Hope that we get confirmed before it resent


Let $a>0$. Show that $\int_0^\pi {dx\over a+\sin^2(x)}={\pi\over \sqrt{a(a+1)}}.$

Question: Let $a>0$. Show that $$\int_0^\pi {dx\over a+\sin^2(x)}={\pi\over \sqrt{a(a+1)}}.$$
I'm not sure how to show this. Any help is greatly appreciated.
Comment: Although I voted to reopen this as an interesting application of complex variables to real integration, I think you should improve the Question by providing context.
Answer: METHODOLOGY 1:  Complex Analysis and Contour Integration
We can simplify the problem by using the double-angle formula for the cosine to write
$$\begin{align}
\int_0^\pi \frac{1}{a+\sin^2(x)}\,dx&=\int_0^\pi \frac{2}{(2a+1)-\cos(2x)}\,dx \\\\
&=\int_0^{2\pi}\frac{1}{(2a+1)-\cos(x)}\,dx \tag 1\\\\
\end{align}$$
Next, we move to the complex plane by letting $z=e^{ix}$.  Then, we have
$$\begin{align}
\int_0^{2\pi}\frac{1}{(2a+1)-\cos(x)}\,dx&=\oint_{|z|=1}\frac{1}{(2a+1)+\frac12(z+z^{-1})}\,\frac{1}{iz}\,dz\\\\
&=\frac{2}i\oint_{|z|=1} \frac{1}{z^2+2(2a+1)z+1}\,dz\\\\
&=\frac{2}{i}\,(2\pi i)\text{Res}\left(\frac{1}{z^2+2(2a+1)z+1},z=-(2a+1)+2\sqrt{a(a+1)}\right)\\\\
&  =\frac{4\pi}{4\sqrt{a(a+1)}}\\\\
&=\frac{\pi}{\sqrt{a(a+1)}}
\end{align}$$

METHODOLOGY 2:  Real Analysis and the Weierstrass Substitution
As an alternative to using contour integration, write the integral in $(1)$ as
$$\int_0^{2\pi}\frac{1}{(2a+1)-\cos(x)}\,dx=2\int_0^\pi \frac{1}{(2a+1)-\cos(x)}\,dx$$
Then, use the classical Tangent Half-Angle Substitution to write
$$\begin{align}
2\int_0^\pi \frac{1}{(2a+1)-\cos(x)}\,dx&=2\int_0^\infty \frac{1}{(2a+1)-\frac{1-t^2}{1+t^2}}\,\frac{2}{1+t^2}\,dt\\\\
&=\frac{2}{a+1}\int_0^\infty \frac{1}{t^2+\frac{a}{a+1}}\,dt\\\\
&=\frac{\pi}{\sqrt{a(a+1)}}
\end{align}$$
as expected!
Answer: Hint: use symmetry to make it an integral from $0$ to $2\pi$ (or $-\pi$ to $\pi$ if you prefer), and transform to an integral around the unit circle with $z = e^{ix}$.  Use residues.
Answer: My hint would be to divide the numerator and denominator by $\cos^2 x$. Then in the numerator you have $\tan'x$ and in the denominator you have $a(\tan^2 x + 1) + \tan^2 x$. Use the substitution $y=\tan x$. (To avoid infinities in the middle, switch the limits of integration to $[-\pi/2,\pi/2]$ or divide instead by $\sin^2 x$ to deal with cotangents. Then you'll end up with $\int^\infty_{-\infty} \frac{dx}{a+(1+a)x^2}$ which you'll be able to evaluate.
Answer: I wanted to just show you this potentially interesting property about your integral:
Let$$I(a):=\int_0^\pi \frac{\text{d}x}{a+\sin^2 x}$$
Then
$$(-1)^{n+1}I^{(n)}(a)=\int_0^\pi \frac{\text{d}x}{(a+\sin^2 x)^{n+1}}$$
This implies that
$$I(a)-I'(a)+I''(a)-I'''(a)\cdots=\int_0^\pi \frac{\text{d}x}{a+\sin^2 x+1}=I(a+1)$$
This is a bit too long for comment, but might help with some solution-finding =)
Answer: Rewritten as
$$\int_0^{\pi}\frac{dx}{a\cos^2x+(a+1)\sin^2x}$$
this is an integral that gets posted about once a week. There are $6$ methods I can think of to attack it, and they all work with the result $\frac{\pi}{\sqrt{a(a+1)}}$. The first time I saw this was in a differential geometry textbook.
EDIT: The above might seem a bit dismissive, but that is far from the truth; in fact I love this integral $\heartsuit$. So much, in fact, that I will provide a seventh method! Cue Gary Larson cartoon with free-body diagram of baseball approaching window$\dots$ Now, consider an object subject to a $2$-dimensional harmonic oscillator potential, where the force is proportional to the distance from the force center: $\vec F=-k\vec r$.
Now, wait a minute, you are saying: shouldn't such a force in $2$-d be different from that in $1$-d or $3$-d? For example the Coulomb force is spatially invariant in $1$-d (electric field near a large flat sheet of unifort charge or flat-earth gravitation) proportional to $1/r$ in $2$-d (electric field near a long uniformly charged wire) or $1/r^2$ in $3$-d (electric field of a small charged object or round-earth gravitation.)
But the reason for the harmonic oscillator potential is that if an object is at its equilibrium position due to the conservative forces acting on it, then the zero-order term of the Taylor series for its potential doesn't contribute to forces ($\vec F=-\vec\nabla V$) and the first order terms are all zero (that's the condition for equilibrium) so the first terms that can act for small displacements from equilibrium are the second-order terms, so we get quadratic potential, linear force in any number of dimensions. Examples are objects near the $L_4$ or $L_5$ points in orbit, or the old experiment with NdFeB magnets and pyrolytic graphite.
OK, given that such a restoring force is plausible and assuming $2$-d motion in an isotropic field, we have the potential $V=\frac12kr^2$. The kinetic energy $T=\frac12mv^2=\frac12m(\dot x^2+\dot y^2)$, where $k$ is the force or 'spring' constant, $m$ is the object's mass, $x$ and $y$ its spatial coordinates and $\dot x$ and $\dot y$ their time derivatives. So now we have the Lagrangian of the system
$$\mathscr L=T-V=\frac12mv^2-\frac12kr^2=\frac12m(\dot x^2+\dot y^2)-\frac12k(x^2+y^2)$$
And we are ready to derive Lagrange's equations of motion:
$$p_x=\frac{\partial\mathscr L}{\partial\dot x}=m\dot x$$
$$\dot p_x=m\ddot x=\frac{\partial\mathscr L}{\partial x}=-kx$$
$$p_y=\frac{\partial\mathscr L}{\partial\dot y}=m\dot y$$
$$\dot p_y=m\ddot y=\frac{\partial\mathscr L}{\partial y}=-ky$$
So there it is, $\vec F=-k\vec r$. For an isotropic harmonic osciallator, the $x$ and $y$ motions are decoupled like this and we know how to solve this system:
$$x=c_1\cos\omega t+c_2\sin\omega t$$
$$y=c_3\cos\omega t+c_4\sin\omega t$$
Where $t$ is the time and $\omega=\sqrt{\frac km}$ is the angular frequency of oscillation. This kind of motion would produce Lissajous figures of ellipses on your oscilloscope, or a straight line in exceptional cases. But let's choose an ellipse of semimajor axis $a$ oriented in the $x$ direction and semiminor axis $b$ in the $y$ direction: $x=a\cos\omega t$, $y=b\sin\omega t$ for our model case.
Now we are going to attempt solution of the system in polar coordinates where $x=r\cos\phi$ and $y=r\sin\phi$. Then $\dot x=\dot r\cos\phi-r\dot\phi\sin\phi$, $\dot y=\dot r\sin\phi+r\dot\phi\cos\phi$, so $v^2=\dot x^2+\dot y^2=\dot r^2+r^2\dot\phi^2$ and now we have the Lagrangian
$$\mathscr L=\frac12mv^2-\frac12kr^2=\frac12m\left(\dot r^2+r^2\dot\phi^2\right)-\frac12kr^2$$
We can find the momentum conjugate to $\phi$
$$p_{\phi}=\frac{\partial\mathscr L}{\partial\dot\phi}=mr^2\dot\phi$$
and its time derivative,
$$\dot p_{\phi}=\frac{\partial\mathscr L}{\partial\phi}=0$$
So we find that angular momentum is constant as it is for all central forces. This is Kepler's law of areas.
$$mr^2\dot\phi=\ell=\text{constant}$$
Now we are ready to do the integral! Going back to our model solution, $$r^2=x^2+y^2=a^2\cos^2\omega t+b^2\sin^2\omega t$$
At $t=0$, $r=a$ and the tangential velocity $r\dot\phi=v_y=b\omega\cos\omega t=b\omega$. So $\ell=mr^2\dot\phi=mab\omega$ and so
$$mr^2\frac{d\phi}{dt}=mab\omega$$
Rewrite as
$$\begin{align}\frac{d\phi}{ab}&=\frac{\omega dt}{r^2}=\frac{\omega dt}{a^2\cos^2\omega t+b^2\sin^2\omega t}\\
&=\frac{d\theta}{a^2\cos^2\theta+b^2\sin^2\theta}\end{align}$$
Where we have substituted $\theta=\omega t$. Now we integrate over a full cycle of the motion:
$$\int_0^{2\pi}\frac{d\phi}{ab}=\frac{2\pi}{ab}=\int_0^{2\pi}\frac{d\theta}{a^2\cos^2\theta+b^2\sin^2\theta}$$
The seventh method!


what is the cons and pros of using webfiltering based on cloud security?

Question: nowadays some vendors offering web filtering based on cloud security , where your web traffic will be forwarded to vendor cloud to be filtered and controlled at the vendor proxy , the vendor will provide you with management interface to define your own we browsing policy, comparing to having your own web proxy with web filtering capabilities , what is the cons and the pros of this solution ?
Answer: Pros:

Possibly reduced cost. You won't be maintaining your own
infrastructure.
Cloud solutions typically allow you to force company assets (like laptops for example) to      be routed through the cloud proxy for URL filtering even when off network. (increased security)

Cons:

Could increase latency. This may or may not be applicable based on your location.
Less control over the infrastructure. With an internal solution you can disperse proxies over different locations and chain them together for increase response times.
Answer: Depending on where this proxy device would hypothetically reside on your local network, it could cause unintended local congestion, interfaces errors, etc.  The cloud solution would keep all this off your network.
Answer: Cloud-based filters offer several advantages over appliance based filters.
There is no need to purchase an appliance, so that is a big initial saving
DNS-based cloud filters are quick and easy to implement. You just point your DNS to the solution provider
There is no latency, at least with a DNS-based filter such as WebTitan
Cloud-based filters are more scalable - If you expand your operations, you don't need to purchase another appliance
Cloud-based filters can be easily accessed from anywhere via the management console - They are also great for MSPs as no site visits are needed.


How to downgrade from Lollipop to Jelly Bean on my Samsung Galaxy Grand?

Question: I upgraded my Samsung Galaxy Grand from Jelly Bean to Lollipop. it worked properly for one week, but then problems occurred. Only black screen is displaying on my phone . While dragging from top of the screen , it shows "No notifications" and it also shows time. Screen is still working properly, but i can't use my phone other than these.
How can I downgrade my Samsung Galaxy Grand from Lollipop to Jelly Bean?
Answer: I would suggest to simply flash the desired version of Android for your phone. Surely, official images of Jelly Bean for Samsung Galaxy Grand exist.
Flashing a rom is really simple:
This instructions are for a Windows system, if you are using another OS just tell me.

Step 1: Install Fastboot on your Windows system

Download this file, it is an installer for the strict indispensable tools you need to put files on your softbricked phone from your PC.
http://forum.xda-developers.com/showthread.php?t=2588979
Install it and say yes both to the adb and the driver questions.

Step 2: Reload your phone to fastboot and flash CWM

When your device is turned off, connect it to your PC via USB and hold the power and volume down button. You should be in fastboot mode now.
Open a command prompt in Windows (Start --> cmd.exe). Type cd C:\adb and then fastboot devices. You should see an hexadecimal code followed by "device". If not, tell me in the comments.
Now download the file you find at this link, it is our recovery.
http://forum.xda-developers.com/showthread.php?t=2201860
Extract the .img file you find inside and rename it recovery.img. Place it in C:\adb.
In the command prompt, address this command
fastboot flash recovery recovery.img

Now reboot your phone to recovery using the power and volume up buttons. You should see the new recovery.

Step 3: Download the ROM and copy it in your phone

Download your desired ROM. Leave it as a .zip.
While your phone is in recovery mode, type adb devices and you should see again a code and "device". Then move your rom .zip file in your C:\adb folder and address these commands:
adb shell
mount /data/
adb push nameofrom.zip /data/

Obviously replace nameofrom with the name of the zip archive of the rom you have downloaded. If you want, rename the zip to address the command with more ease.

Step 4: Install the ROM

When the push process has succesfully finished, navigate through your phone's recovery to install zip, install from internal memory or something like that. Select the zip you just pushed. It will start installing and, after finished, your phone should boot again upon reboot.


Scottish Religion Problems

Question: I want to write a science fiction/fantasy nation based heavily on Scotland with it having Gaelic for its main language and despite having futuristic technology there still being a very medieval European aesthetic for architecture. The biggest problem I've stumbled on is the religion of this nation. I want them to have a Celtic pagan religion with a focus on the Scottish side of Celtic paganism. Problem is I cannot really find any information specifically about Scottish Celtic paganism and instead I just keep getting looped back to Irish deities and practices.
Does anyone have any information that could aid me in my search?
Comment: *"I just keep getting looped back to Irish deities and practices":* That's because the [Gaels](https://en.wikipedia.org/wiki/Gaels) came from Ireland, [from the 6th century](https://en.wikipedia.org/wiki/Dál_Riata) onwards, and they were already Christians at that time. (Well, mostly Christianized. Some remnants of the old pagan Celtic practices might have endured for a short while.) There was no time in real history when Gaelic was spoken by a pagan people in Scotland. (In Roman times the Scotti inhabited Ireland and our Scotland was inhabited by [Picts](https://en.wikipedia.org/wiki/Picts).)
Comment: Is this a World building question or are you wanting the real-world information in order to create your world? If it's the latter - it's not really applicable to us - it would be more appropriate to ask on https://mythology.stackexchange.com/
Comment: You cannot find much about the Picts because not much is known about them. Even the name *Picts* is an exonym: the Romans called them Picti, meaning the Painted Ones in Latin, because they painted themselves blue with [woad](https://en.wikipedia.org/wiki/Isatis_tinctoria). We do not know how they called themselves in their own language, we don't even know if they were one people or multiple peoples with multiple different languages. It is believed that they spoke some sort of Brittonic (as opposed to Goidelic) language, but that is only an assumption.
Comment: @AlexP yeah it's hard to find anything about the Picts either.
Comment: we have almost no good sources on _any_ Celtic paganism. We have a small number of votive offerings and dedicatory inscriptions mostly in Gaulish that give us the names of some deities. We have some evidence from the names of people, tribes, and places that either survive into modern languages or in transcription. We have some dubious descriptions of their religious practices from the Romans. Everything else comes to us from a thoroughly Christianised context and so cannot reliably be used to draw conclusions as to actual pagan practice
Comment: @Gemini You can blame the Gaels for not being able to find out anything about the Picts. See "Brochs" for an example.
Comment: They're pretty much the same except the names - with the exception of localised myths (Nessie, Ghillie-Dhu, there's some friendly werewolf story too). You could start with those. For further real-life info on mythology our [mythology.se] stack may be of more help.
Answer: You're getting looped back to Irish because Scots were originally Irish who founded a kingdom (Dal Riata) in Argyll and eventually superseded the Picts in importance in terms of culture and language (roughly in the time between 900 to 1100 AD).
There was no difference between their religion except regional ones.
Very very little is known about the Picts, mostly just some legendary stuff and a few names and nouns. So for the purposes of your story you can give them any religious beliefs you want.
Comment: added some links and a time frame to your answer

Scottish Religion Problems


Can this garbage disposal be saved ? Black gunk doesnt drip down to cabinet floor but my skin crawled when i saw this?

Question: Garbage disposal is about 3 years old. It got jammed , so i tried to find the reset button on bottom.  It wouldnt budge so i got a flashlight and got on the floor to make sure i was pressing right thing.  I was horrified when i saw this nasty sight in the middle of the garbage disposal. Looks like dried slime. It doesnt run down the machine or to the cabinet floor but something definitly is wrong.  I got disposal un jammed and it works fine but underneath scares me. Is it worth tryin to fix ?
Comment: One way to find out would be to take it apart and clean it.  Looks like possibly a combination of corrosion and leak or possibly corrosion caused by leak.  There look to be signs that at some point there were drippings there.
Comment: If it is jammed it should have come with a key. Some are hex wrenches some are square stock bent into a L shape.  Un plug and try turning in both directions if there is an arrow for normal operation try going the opposite direction. The thing that is jammed may release very easily in the opposite direction where continuing to force it in the normal direction may bend things. As far as the gunk I have seen much worse
Comment: It is interesting to me that gunk looks to have run down the metal but not onto the gray of the disposal which is clean.  I wonder if that rust / gunk predates the current disposal.
Answer: It looks like whoever installed the disposal didn't tighten up the locking bracket enough. You have three brackets in there. Two are for the mounting to the sink and they are not leaking.  See picture below of standard installations.

The lowest bracket is what holds the disposal to the sink fitting. You can undo that bracket by turning it counterclockwise with a screwdriver or allan wrench like in the picture. You'll want to disconnect the pipes and turn off the power first. Once you unlock that bracket the disposal will drop down. Clean it off, make sure the rubber flange is securely in place and put the disposal back in place and turn the locking bracket clockwise while holding the disposal in place.The bracket has to attach to the upper bracket in three spots, make sure they are all engaged. Make sure you tighten the bracket all the way.
This requires some strength and working in a slightly confined area so if you don't feel comfortable doing it, get some help ahead of time


Store extended properties and apply to another copy of the database

Question: I'm using SQL Doc to document a development copy of a database. SQL Doc uses extended properties to store user entered values. At some point, I would like to copy those extended properties to the production database. What is the best way to do this?
Answer: You can use this script to get the columns descriptions from your development database.
SELECT
DB_NAME(DB_ID()) as DBName
,SCHEMA_NAME(sOBJ.schema_id) as SchemaName
,sOBJ.name AS TableName
, sEXP.value AS [TableDescription]
,sOBJ.type_desc As ObjectType
,sOBJ.create_date As CreateDate
,sOBJ.modify_date As ModifyDate
FROM
[sys].[objects] AS [sOBJ]
LEFT JOIN [sys].[extended_properties] AS [sEXP]
    ON [sOBJ].[object_id] = [sEXP].[major_id]
    AND [sEXP].[minor_id] = 0
    AND [sEXP].[name] = N'MS_Description'
WHERE [sOBJ].[type] IN ('U','V','TR','P')

Then upload a table with DataBase/Instance/Table/Column/Description to your production server, and use the following script to insert the description on your server.
It only works with fields that don't have a previous description, so you must filter previously.
Declare   @sql as nvarchar(max)
, @Database as nvarchar(max)
, @Instance as nvarchar(128)
, @Table as nvarchar(128)
, @Column as nvarchar(128)
, @Description as nvarchar(3000)

Declare mycursor cursor for
Select [Database], [Instance], [Table], [Column], [Description] from [dba].    [DescripcionesTablas]

open mycursor
fetch next from mycursor into @Database, @Instance, @Table, @Column, @Description
while @@FETCH_STATUS= 0
begin
set @sql = 'EXEC [' + @Database + '].dbo.sp_addextendedproperty
            @name = N''MS_Description'',
            @value = ''' + @Description + ''',
            @level0type = N''Schema'', @level0name = ' + @Instance + ',
            @level1type = N''Table'',  @level1name = ' + @Table + ',
            @level2type = N''Column'', @level2name = ' + @Column + ';'
EXEC (@sql)
fetch next from mycursor into @Database, @Instance, @Table, @Column, @Description
END
close mycursor
deallocate mycursor

Answer: I don't know of an easy way to just extract them and reapply to another target, but you could use the data in sys.extended_properties to generate a script to add the properties to another database using calls to sp_addextendedproperty.
See https://msdn.microsoft.com/en-us/library/ms177541.aspx and https://msdn.microsoft.com/en-us/library/ms180047.aspx for a bit of documentation around that.
If the target database may already contain some properties (from earlier transfers, or added for other reasons) then the script you generate may need to be more clever and check to see if it should call sp_updateextendedproperty instead (also potentially sp_dropextendedproperty to remove properties that are now deprecated).
Comment: FWIW - If you name the extended property with a date extension, such as `Caption_20150223` instead of just `Caption`, then you can add a new entry and later review and remove (if necessary) the older entries.  This does add some noise to the descriptions, of course.


How long does it take for a transaction to reach a given depth? (How long to reach depth N?)

Question: I realize that the time it takes to reach specific depths is not precisely calculable. Nonetheless, there must be a rule of thumb for roughly how long each block takes to process. For example, if we want to estimate how long it will take for a transaction to reach a depth of 20, what formula should we use?
Answer: Given the time of one slot is defined by slot_length being one second right now.
And the chain parameter active_slots_coefficient, which gives us the proportion of slots in which blocks should be issued, it is set to 0.05.
This means, that we can expect one block in average in 1 / 0.05 = 20 seconds.
However, you must account for mempool and pending transactions too.
Answer: Average block time is 20 seconds, so...
Average-time-to-depth-N = N x 20 seconds


Upper Bound of Markov Chain Convergence?

Question: Reading about Markov Chain Monte Carlo in this book on Probability (DeGroot), it says

In general, the distribution will get pretty close to the stationary distribution in finite time, but how do we tell, in a particular application, if we have sampled the Markov chain long enough to be confident that we are sampling from something close to the stationary distribution? Much work has been done to address this question, but there is no foolproof method.

Assuming all the transition probabilities encoded in a matrix, it looks possible to know that the stationary distribution has been reached by solving $P\mathbf{x} = \mathbf{x}$, but then there is the question of whether doing so is tractable.
What is the upper bound on either the

iterations, or
computational complexity

to determine that a \Markov Chain, encoded in a transition matrix, has converged to a steady-state, stationary probability distribution?
Comment: The convergence time is dependent on the second eigenvalue of the matrix.
Comment: @nonlinearism would you please explain why the convergence time is dependent on the *second* eigenvalue in particular?
Answer:
it looks possible to know that the stationary distribution has been reached by solving $P\mathbf{x} = \mathbf{x}$, but then there is the question of whether doing so is tractable.

No. The main problem is that one does not know $P$ hence "solving $P\mathbf{x} = \mathbf{x}$" is irrelevant.


Unity3d saving with prefabs: Bad Idea?

Question: I am developing for Android.In my game data is in objects which aren't derived from MonoBehaviour.So I am using binary serializer and taking references from the gameobject.It works, but I have too many variables to save most of variables are in script attached to gameobject Gamemanager So I made a prefab of gameobject of Gamemanager and saved it using prefabutility and load it again It works but Can someone tells me whether this is right approach or not, please??
Comment: You could serialize the objects you want to save in to a string and then store that with [PlayerPrefs](https://docs.unity3d.com/ScriptReference/PlayerPrefs.html), which allows you then later load the data to a string and deserialize in to objects.
Comment: I'm voting to close this question because it is a [cross-post from Stack Overflow](https://stackoverflow.com/questions/41827836/unity3d-saving-with-prefabs-bad-idea). Please choose the best Stack Exchange site and post your question only there.
Answer: This is going to work as long as you run your project from the editor. But when you try to actually build it, you will notice that it doesn't compile. The reason for that is that the class PrefabUtility is part of the UnityEditor packet, which doesn't get added to real builds of your game.
I ran into the same trap in my last project. I was lucky that I only used PrefabUtility in my map editor which I was going to dummy out of the release build anyway.
You will have to find a different solution to serialize your gamestate.
One possible alternative is the class JSONUtility which allows you to convert objects to JSON and back. It doesn't work on complete game objects, but it works with anything which extends MonoBehaviour or ScriptableObject and with any plain C# class when it has the [System.Serializable] attribute. Note that it will only serialize the public variables and properties of your classes.
Comment: Hey thanks for the answer, Can you please tell me What to use to save data for Android.I have too much data to save(many NPC-ENEMY stats) also it should work after updating I read on stack overflow that In Binarformatter when you update or change the class. Your old settings might be lost since the classes no longer match.So What should I use to save data JSON/XML? Also, do JSON/XML throw an error if I change class later?
Comment: @paulp This is a whole bunch of new questions which should be posted as new questions.
Comment: okay I will post new question.
Answer: Use a ScriptableObject instead and mark the classes you want to serialize in it with [System.Serializable]. Mark each field you want to serialize into the .asset file with [SerializeField] or make it public.
When you've created the asset file, put it in the Resources folder and load it runtime with Resources.Load("assetPath"). Since it's an asset you should not have to Instantiate it once you load.
This handles serialization in the same way as a monobehaviour, but in an asset file on disk instead. It can handle arbitrarily much data up to a certain limit. If you have more than that, you should reorganize your data in multiple files instead.

Unity3d saving with prefabs: Bad Idea?


Pronunciation of "е"

Question: Why is "нет" pronounced "nyet" instead of "net"? I was informed that the Cyrillic letter 'е' is equivalent to the Latin letter 'e'. Is this incorrect? If so, what is the equivalent of 'e' if one exists?
Comment: I was correcting the capital letter. It might be confusing, I myself first thought that you are asking about the reading of this letter in the beginning of names, like "Ельцин"
Comment: That makes sense. Usually in English we usually capitalize letters when we are referring to the letter itself, which is why I capitalized it. I'm sorry if I overreacted to the edits. I just didn't see a reason for it at the time.
Comment: " that the Cyrillic letter 'е' is equivalent to the Latin letter 'e'. Is this incorrect? " This is incorrect. "net" is pronounced as with Э not as with russian Е. To denote the difference between russian E and Э using english letters, you need to write something like nyet, just to make it look different from "net".
Answer: 'Е' Can be pronounced in several ways, depending on position, stress and previous letter
Basically, Russian vowels comes in pairs. First are simple vowels

'А' as in u in run
'O' as a in all
'У' as u in bull
'И' as ee in cheese
'Э' as a in cat
'Ы' with no direct analog.

There are several derived vowels

Э - Е
У - Ю
О - Ё
А - Я
(technically Ы - И are often paired, but this relation is incomplete)

These derived vowels are pronounced differently in different positions.
At the beginning of the word, after 'Ь' and 'Ъ' and after other vowel they are prononced as

Е - ЙЭ
Ю - ЙУ
Ё - ЙО
Я - ЙА
И can be sometimes pronounced as йи or й, but very rarely.

however, after сonsonants they are threated differently. First, they are pronounced as their basic vowel. Second previous consonant is palatalized (some consonants are always palatalized and И is still pronounced as И and has pretty quirks after ш/ж, but the base is this).
But that's not all, we have something to blow your mind: reduction. Every vowel if unstressed is reduced.

О (and O part of Ё) & A (and A part of Я) are reduced to really short 'a'
Э (and Э part of E) & И are reduced to really short 'и'
in fast speech most vowels in unstressed positions may be reduced to some common sound I doubt I can describe.

There are several inconsistencies, like жи/ши is pronounced ЖЫ/ШЫ , but never written. Another complication is the Ё often typed as Е and without context it is often impossible to guess which one is really here.
Answer: The fact that the Russian 'е' is an equivalent of the Latin letter 'e' does not mean that they should necessarily correspond to the same sound. Pronunciation of 'е' depends on the preceding consonant: 'е' "softens" most consonants (б, в, г, д, з, к, л, м, н, п, р, с, т, ф, х, ч. щ), producing the ʲe̞ sound not found in English, as in "нет" (no) or "день" (day). When 'е' follows one of the remaining consonants (ж, ц, ш), it makes a sound that is similar to the Latin e, as in "цель" (aim), "шея" (neck) or "жесть" (tin-plate).
Answer: "нет" is NEVER pronounced as "nyet". There is no "y" sound there. It is pronounced as "net" but with soft "n".
Comment: +1 The only correct answer here.
Answer: There is so called close-mid front unrounded vowel, this is the sound you are exactly talking about, to put it simple it is 'e' :)
In Russian there are two letters you can use for indicating this sound, e and  э. As many other letters, letter 'е' is used for indicating different set of phonemes.  In the beginning of the word 'e', for example, actually stands for 'je', after consonants it stands, almost always, for [e] as well, it's just that the preceding vowel is palatalised. Exceptions are ж, ш and ц plus the majority of foreign words (e.g. шоссе, молибден, темп).
This is not that simple, since there are lot of words of foreign origin obeying "normal rule": checkout for example демократия.
Answer: The letters е, ё, ю and я sometimes indicate that the consonants before them are palatalized.

Pronunciation of "е"


Can one get a second Master's degree in a related field (biochemistry, bioinformatics)?

Question: If one has already got a Master's degree in Biochemistry and Molecular Biology, can he/she apply to the Masters' Program in Bioinformatics at another university in another country?
Answer: Broadly, yes.
Previously, I worked with students on masters degree who already had other masters degree or other postgraduate qualifications.  Some even had doctorate.  Taking a second masters can be really valuable, especially if you are seeking professional development.
It would depending on the institution that you are applying to for your second masters (such as how you meet the entry requirements etc.), so you would need to check with them for advice on your specific situation.
There are two considerations you need to make, however (this is speaking from a UK context):
Funding
Some funding, especially in the UK, whether student loans, scholarships from private donors, government money and research grants will not cover someone who is taking a qualification of the equivalent level that they have already obtained.  Check this with the university you are applying for.
Visa and immigration
I am not qualified to give visa advice, however, you should know that, at least in the UK at the moment, the decision to grant you a student visa might also depend upon whether you are taking a qualification equivalent to the level of one you have already obtained.
If you're an international student and got your first masters in the UK, your chances of getting a visa to stay to do a second masters could be nil.  Speak with a visa and immigration adviser at the institution you are thinking about.
Comment: It might be worth mentioning that in the Netherlands at least, the government only subsidises a first masters degree. Once you successfully obtain that, you pay the so-called institutional fee for any further master level education, which is substantially higher. See for example https://www.maastrichtuniversity.nl/support/your-studies-begin/tuition-fees/explanation-tuition-fee-rates
Answer: Yes.
Realize that you are switching emphases from the "mainstream" of biology to "informatics," a different field that is, in this case, related to biology.
Put another way, you are emphasizing the "applied," data-intensive,portion of your field, rather than the "pure," theoretical portion. Assuming that your grades are pretty good, many programs will allow you to make the "switch."
Answer: As many have said, broadly, yes.  That said, you should have a thorough understanding about why you need to do so to advance your career, and be able to convince potential employers that it wasn't done to put off hard decisions.


Replying to an appreciation email

Question: Recently I did a major overhaul of a business website, which made it more user friendly, the director of the department sent out an (to the I.T Department) email on doing a great job. Of course, being a newcomer I wouldn't be able to do my job if I wasn't given a proper setup and help from my manager and peers. Is it good to reply to that email, as it is, from the director? If so, how can I make it sound more professional and thankful whilst I also thank my team?
Answer: In my experience, department/company wide emails like this don't really necessitate a personal response.
You could respond if you wanted to, but don't use "Reply All" and keep it pretty short.
Bear in mind that the director is congratulating the department, not just you.  If you reply implying that you did the work all by yourself, this might be misunderstood and seen as you trying to take all the glory (even if you did do all the development work by yourself...).  The director's thanks are also (presumably) directed at the people who gathered the requirements, designed the new website, tested it, and deployed it.
Comment: +1 for "you reply implying that you did the work all by yourself, this might be misunderstood and seen as you trying to take all the glory (even if you did do all the work by yourself...)"
Answer:
Is it good to reply to that email as it is from director, if so how
  can i make it sound more professional and gratitude while i thanks my
  team also.

Just send a simple "Thanks!" email to the director, without replying to everyone.
That shows your gratitude without going over the top.
Comment: @Nofel: You're over-thinking this.
Comment: Might he tell manager that abc replied me, Wouldn't my manager mind over what is going on.
Answer: Being new I would direct it to your superior to handle that sort of thing, he/she can decide if and what should be sent.
Otherwise a short message will suffice along the lines of:

Dear Sir/Madam,
  Thank you for those kind words. We aim to improve the usability of our web-sites and we are glad to have made a contribution.
With kind regards:
  IT-Department
  through Alpha Bravo

Keep it short and sweet.
Comment: But if you write on behalf of the department, make sure the department knows about that. I have had situations where colleagues sent emails also in my name (and theirs) which led to things being said in a way I wouldn't have wanted them to be said and strange situations with the receivers of those mails.
Comment: @skymningen A valid point, what you say stand for you and not for everyone else, unless of course, they have given their expressed consent.
Answer: The director wanted to appreciate all people involved in that improvement and wanted to be sure all of them knew that. Period.
The one(s) that can reply to such email is the manager, or managers if it was cooperation of several teams, of the appreciated group because they are responsible for all the people under their command.
If you, as the low-branch employee, reply it may be, and will be, understood as skipping the ranks. Nobody expects anyone below the team leaders to respond to such emails.
On the other hand, if the director bumps in you personally reply, "Thanks mr. Boss" is comletely sufficient and in that case you are representing whole team. And it was not your decision to stand out.
Answer: Unless he was getting personal like "employee X did a great job of Y", you can safely ignore it, he was just being polite. If you want to thank the team, take them out for lunch or dinner, or at least bring a cake / pizza and share.

Replying to an appreciation email


Way to view if library is using Metatags

Question: We're going through a migration and need to find out if Metatagging is being used.  Is there a list that shows list items (like a master list) that is using and/or not using metatagging?
Answer: If you are migrating from SharePoint on-premises to Online, you can use PowerShell to generate a CSV report of managed metadata columns usage.
Please see the sample script below:
<code>Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$SiteCollURL=" <SiteCollectionURL>"
$ReportOutput="C:\Temp\MMS-Columns.csv"

$WebsColl = (Get-SPSite $SiteCollURL).AllWebs

#Array to hold Results
$ResultColl = @()

#Loop through each site, List and Fields
Foreach($web in $WebsColl) {
    Write-host "Scanning Web:"$Web.URL
    Foreach($list in $web.Lists) {
        Foreach($Field in $list.Fields) {
            if($field.GetType().Name -eq "TaxonomyField") {
                $Result = New-Object PSObject
                $Result | Add-Member -type NoteProperty -name "List Name" -value $List.Title
                $Result | Add-Member -type NoteProperty -name "URL" -value "$($List.ParentWeb.Url)/$($List.RootFolder.Url)"
                $Result | Add-Member -type NoteProperty -name "Field Name" -value $Field.Title

                $ResultColl += $Result
            }
        }
    }
}

#Export Results to a CSV File
$ResultColl | Export-csv $ReportOutput -notypeinformation
Write-Host "Managed Metadata columns usage Report has been Generated!" -f Green
</code>

You can also get a detailed report on the used metadata terms, see the reference below:
Managed Metadata Columns Usage Report in SharePoint using PowerShell.


how to download gta san andreas on ubuntu 12.04?

Question: i wanna a download link of grand theft auto san andreas version linux ubuntu 12.04 please anyone give me a download link of mta san andres and gta san andreas version linux ubuntu 12.04
Answer: first of all search for san andread on POL[play on linux which is a open source application available in software centre] if you find it over there then you can just install the game using a live cd or dvd but in case if it is not available on POL you can use ps2 emulator or wine to play those games
if you are using wine then follow this video
Comment: where is the file in this website : http://appdb.winehq.org/objectManager.php?bIsQueue=false&bIsRejected=false&sClass=version&sTitle=&sReturnTo=&iId=0&iItemsPerPage=25
Answer:
Download link (9.99$).

You'll need Wine or PlayOnLinux to run it, without any guarantee it'll work.
Answer: I'm not familiar with Wine, but I am pretty sure you just install the game and run the .exe through Wine? If you don't have wine, and there isn't a Linux version of the game you can't run it on Ubuntu.


Is it possible to publish a blog post on behalf of another user in SharePoint 2013?

Question: If you're the one publishing a blog post, but you're doing it on behalf of another user, is there a way to show that?
Answer: Each blog post is essentially a list entry with a giant free text field for the main content area. You can open the list settings and customise the metadata columns so that part of the displayed metadata is a manually selectable person field and give it the Custom Column name 'Author' or something similar. Then when you publish a new post you can specify the user you want credited with it's authorship.


Problem with touch pad in linux

Question: I have a Lenovo g500 laptop and I recently installed Ubuntu 14.04 in it. The problem is that the touchpad in not being dectected. I ran Ubuntu in live mode before installation and the touchpad worked perfectly fine. But it stopped working after I installed Ubuntu.The same thing happened with Linux Mint. Can someone tell me what the problem is and how to fix it?
Comment: it is more probable that the guys from http://askubuntu.com/ will help you. But prepare at least the type of touchpad.
Comment: @jakuje Its not just ubuntu but linux mint also doesnt detect the touchpad.
Comment: @Jakuje is correct in that Mint is a Ubuntu LTS Variant.  See my answer.
Answer: Solution
A Google for "lenovo g500 touchpad linux" returned the Laptops and Netbooks Support Page for Lenovo G500,  Setting the Component Dropdown to Mouse & Keyboard yields the following:

Touchpad Driver (Synaptics, Elan)
Version: 184.108.40.206 /11.4.14 .1
Date: 5/26/2013

Synaptics is all we needed from the entry to determine the correct driver.  Readers can now issue a: sudo apt-get update && sudo apt-get install xserver-xorg-input-synaptics followed by a reboot.  If Ubuntu returns that this driver is already installed, read the SynapticsTouchpad Ubuntu Community Documentation, specifically the Troubleshooting Section.  Readers need to make sure the touchpad was detected.

Problem
Many Live CD's use automated hardware detection to ensure that the distribution's LiveCD will work on as many devices as possible.  The issue here is, that once the hardware is detected, the results aren't passed to the distribution's installer script or program.  As a result, the installer only installs packages that will provide basic functionality upon reboot.  In your case, the LiveCD correctly detected a Synaptics touchpad, but the installer was unaware of that.  The easiest way I've found to trick the installer is to leave your external mouse unplugged during an install, thereby forcing the installer to choose the trackpad as the only pointing device.

Problem with touch pad in linux


All the possible inputs for a given AVL tree

Question: Given an AVL tree,what are the possible inputs so that the same given tree is formed(please dont mention brute force technique)?
Comment: Use BFS over the AVL tree to from some possible inputs. Each level can be permuted. This input doesn't require balancing.
Answer: AVL trees are binary search trees with additional balancing restrictions. For any binary search tree the root is the first node that should be in the input. After the root all smaller items go left, and all larger items go right. As long as we do not change the relative order of the items that go left, we obtain the same left subtree, and similarly for the right subtree. We can however swap to consecutive input items if they do not belong to the same subtree.
We can find any input sequence using this observation recursively. The following non-deterministic algorithm would work, its datastucture is a list of trees (subtrees of the original tree).
Start with the original tree. While any trees left, choose one of the trees, remove its root, and replace the original tree by its subtrees.
The order in which the nodes are removed is a possible input sequence. Extra details: The algorithm is related to the algorithm for finding a linear order matching a given partial order: topological sorting. The order is not the order that defines the AVL tree, instead it is the tree order itself.
Comment: can u give me the code(possibly in c++ pls)?


why isn't there a People.SE?

Question: i "think" that there should be a website where people can ask some general social questions, i have seen many sites here which attempts to do the same but they cover a single general topic, thats why i am asking, why isnt there a Peope.Se which could cover much more juice?
Answer: Over the course of launching 40+ Stack Exchange sites, it was found that the concept and engine works best when it has a clear and relatively narrow focus, and is populated by experts for that narrow focus. So things like:

A site for Programmers
A site for Gamers
A site for Physicists
A site for Mathematicians

all seem to work because the goal is clearly defined and the potential experts are clearly defined. When you work with a concept that's broad or ill-defined (People would be that), there's no focus for the user base: it's hard to impossible to know what is a good question for the site, what is a bad question the site, who are the experts in the field, and if there are any experts, why they would choose to participate in the site.
So rather than a People.SE site, think:

An SE for psychologists
An SE for anthropologists
An SE for sociologists
An SE for human resources

And so on.
If you're interested in learning more about the background, the Stack Exchange team has written a few different blog posts about it:

No Artificial Intelligence in Area 51 talks about how a failed SE site, Artificial Intelligence.SE, due to a lack of clearly-defined experts
Stack Overflow Around the World talks about the success of Stack Exchange in narrowly defined topics, and how that relates to localized communities
Pruning Season talks about another failed site, Electronic Gadgets.SE, which didn't have a clearly defined and narrow scope
Merging Season talks about what the sweet spot is for a site's scope

As a postscript, it's also interesting to look at Atheism.SE, which failed mostly because it was an SE site for people who are something rather than a site for people who do something. That is, if you happened to be an atheist, you were automatically an expert: obviously, that's not true, and it's hard to define what an "expert" atheist would be.
The same would be true of a People.SE: who is an "expert" person?
Comment: Good answer, Mark. As a side-note, Skeptics is an "are" like Atheists, although you could generally say the answerers are expert "researchers".  Skeptics explicitly disallows questions *about* skepticism, which, based on your answer here, is a good move. I think it will be interesting to see if Skeptics makes it out of beta (and if so, learn what made it work).
Comment: I wish I could upvote this three or four more times.
Comment: thanks for the answer Mark, i didnt think it that way, it is really hard to describe someone socially "expert" +1 for you
Comment: @Renesis: I think one difference between Skeptics.SE and Atheists.SE is that sceptics *do* something (research why something isn't the case) whereas atheists *don't do* something (believe in god). It is a lot easier to rate how well something is done, rather than how well it isn't done.

why isn't there a People.SE?


Does the equation $f(x)+g(y)=x^2+xy+y^2$ have solutions in real functions $f$ and $g$?

Question: Does the equation
$$f(x)+g(y)=x^2+xy+y^2  \mbox{ } \forall x,y \in \mathbb{R}$$
 have solutions in real functions $f$ and $g$?
Comment: @RaziehNoori Your argument requires, e.g., that $f$ is differentiable.
Answer: No. Assume for contradiction that such $f(x), g(y)$ exist and let $P(x,y)$ be the statement $f(x)+g(y)=x^2+xy+y^2$. Then
$P(0,0)\implies g(0)=-f(0)$.
$P(x,0)\implies f(x)=x^2+f(0)$.
Similarly, $g(y)=y^2+g(0)$. But then $f(x)+g(y)=x^2+(f(0)+g(0))+y^2$ and $P(x,y)$ gives $f(0)+g(0)=xy,\, \forall x,y\in\Bbb R$, contradiction.
Answer: Assume that such functions exist. From the given condition we have
$$f(0) + g(0) = 0$$
$$f(x) + g(0) = x^2 \rightarrow f(x) = x^2 + f(0)$$
$$f(0) + g(y) = y^2 \rightarrow g(y) = y^2 + g(0)$$
Assert this into the first identity we conclue $f(0) + g(0) = xy, \forall x, y \in \mathbb{R}$. The LHS is a constant, while the RHS can be an arbitrary real number. This leads to a contradiction, hence no such functions exist.


cutting a video with ffmpeg with an absolute endposition

Question: I want to use ffmpeg to slice a video into parts. I have two absolute "positions" and not a start and a duration. So i can't use it like that:
ffmpeg -ss 00:00:12.12 -t 00:00:14.13 -i foo.mov...

(again, the time after -t is not a duration) Do i have to calculate the duration between the to positions or is there a way ffmpeg can do this for me?
Comment: http://stackoverflow.com/questions/8488238/how-to-do-timecode-calculation is a nice solution with extra calculations
Answer: As of FFmpeg 1.2 (released March 2013), the -to option can be used in place of -t to specify an end time instead of a duration.
Answer: Use this python script
#!/bin/python
from sys  import argv
from os   import system

ffm = 'ffmpeg -i "' # input file
aud = '" -acodec libfaac -aq  64 -ac 2 -ar 44100'
vid =  ' -vcodec libx264 -crf 25 -r 25 -subq 9'
c=0
def encode(video,option=''):
   global c;   c+=1
   out = ' "'+ video + str(c) + '.mp4"'
   cmd = ffm + video + aud + vid + option + out
   print cmd;  system(cmd)

def seconds(time):
   t = [float(x)  for x in time.split(':')]
   if len(t)==1:  return t[0]
   if len(t)==2:  return t[1]+t[0]*60
   if len(t)==3:  return t[2]+t[1]*60+t[0]*3600

def split(time):
   (start,end) = [seconds(x) for x in time.split()]
   return ' -ss %s -t %s' % (start,end-start)

for slice in argv[2].split(','):
  encode(argv[1],split(slice))
#  $ python split.py "video.mpg" "1:50 9:10,7:30 15:30,13:30 20:10"

Reading man ffmpeg i saw several accepted formats for -ss and -t
This let you slice with overlap. And can split with miliseconds precision.
$ python split.py "video.mpg" "55:30.356 1:01:10.895"

You have to edit acodec and vcodec with your preferences.
I recommend these options with a libx264 core greater than version 100.
Answer: With -ss you mark your start and with -t the final duration. The -t option indicates the diference between your two absolute positions, you have to calculate.


Continued Fraction Expansions

Question: I am a newbie at LaTex. I would like to know how to perform the following on native tex. Pls help me out. Thanks
Comment: By "native tex" do you mean to exclude LaTeX answers, limiting acceptable solutions to tex core code only?  Or, by "native tex", do you mean LaTeX without additional packages?
Comment: Welcome to TeX.SX! Some people take exception to questions of the form "Please do this for me". You will get more help if you post some code showing what you have tried and give a [minimal working example](http://meta.tex.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-example-what-is-that). Btw, if you search for continued fractions on the site you will almost certainly find what you are looking for.
Answer: If you are willing to use LaTeX-packages, you could have a look at the polynom-package.
Note that you can always locate the documentation using the command-line/terminal by writing texdoc polynom, and that works for any package. The documentation is also available at http://ctan.org/pkg/polynom
The following example is taken from a question I answered earlier, Using \polyremainder in polynom package
Output

Code
\documentclass[11pt]{article}
\usepackage{polynom}
\begin{document}
 \polyadd\polya { (X^2+X+1)(X-2) }{0}
    \polyadd\polyb { X-1 }{0}

Dividing \polyprint\polya{} by \polyprint\polyb.
\[\polylongdiv\polya\polyb\]

\polydiv\polyc{ (X^2+X+1)(X-2) }{ X-1 }
Remainder is: \polyprint{\polyremainder}
\end{document}

Continued Fraction Expansions


Restore Derby Database with Java code

Question: I want to restore my embedded derby database using Java code. I used the code below for restoring my database. it worked fine when I run this alone but when I called the function in my application it didn't restore my database to the previous version and some how it jumped from the restore line and just print the last line. I don't know how to make it work for my project. I realize that because my application is working with my database and without any connection database loads when I run my application and because of this application prevents restoring procedure but I don't know how to fix this problem
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Restore {

    public  void restoreDatabaseRoutine(String address)
        throws SQLException, ClassNotFoundException {

    String backupPath = address;
    System.out.println(address);
    String restoreUrl = "jdbc:derby:Test;restoreFrom=" + backupPath;
    String driver = "org.apache.derby.jdbc.EmbeddedDriver";
    Class.forName(driver); // throws ClassNotFoundException
    Connection conn = DriverManager.getConnection(restoreUrl);
    conn.close();
    System.out.println("The database has been successfully restored");
    //return conn;
}
}

Comment: What does "some how it jumped from the restore line" mean?
Comment: It means the restore code line didn't run and didn't have any effect.
Answer: You need the JDBC driver in your class path.  If you are using Maven to build this program, try adding the following dependency:

<dependency>
  <groupId>org.apache.derby</groupId>
  <artifactId>derby</artifactId>
  <version>10.13.1.1</version>
</dependency>

The driver class can be found in the list of classes for the artifact: https://mvnbuild.com/artifact/org.apache.derby/derby/10.13.1.1
Comment: I did this but I think I must create another application for restore the database like iBackup IIS to restore my database.

Restore Derby Database with Java code