Skip errors in ModelBuilder?

Question: is there a way to handle an error within the ArcGIS ModelBuilder? I have a model which iterates over hundreds of raster files. some of them may be corrupt. i`m looking for a way in which the ModelBuilder skips any corrupt raster files and proceeds with the next file.
Answer: ModelBuilder is great but has its limitations even with the new (to v 10) iterations and much depends on how you define 'corrupt'.  While it would not be impossible to do what you want in ModelBuilder, I think it would get messy and you would probably have to write a script to test whether the file meets your criteria anyway.  Therefore, it would probably be simpler to export your model to Python and add a try-except test.
I regularly used ModelBuilder to prototype a process and then export it to Python and add tests for validity, iterations etc.  Just note that the export from ModelBuilder will not include the iteration but that is straight forward to add.
Comment: thanks mappagnosis,  that was my plan b. i will try it that way.
Comment: I always opt for pragmatism over coercion when it comes to model builder :)
Answer: Another alternative to skipping errors would be to instead pre-test for issues that would lead to errors.  So, in your example above, after you iterate to the next raster, you could write a small Python script that could pre-test the raster and either pass or fail the raster, at which point your model could read the results (True/False?) either pass the layer to the remaining portion of skip it.

Skip errors in ModelBuilder?


Killing Vectors of BTZ black hole and their calculation in general

Question: I was wondering what are the Killing vectors of BTZ black hole and how to guess them easily? Will it be the same as of AdS? What then will be Killing vectors for AdS-Schwarzschild e.g.?
Answer: The geometry of the BTZ black hole, including its Killing vectors, is described in Steve Carlip's paper (which I just noticed is also referenced by the wiki article).  Another good reference on this topic is this one.
Basically, in the Schwarzschild-like coordinates, the Killing vectors are just $\partial_t$ and $\partial_{\phi}$.
As for how these Killing vectors can be "guessed" - the BTZ hole is obtained by quotienting AdS space by an isometry.  Since the isometry is itself generated by a Killing vector, I'd start by looking for Killing vectors on the original AdS which commute with the chosen isometry-generating one.
As for AdS-Schwarzschild, I'm not sure - it's only asymptotically AdS, so the AdS Killing vectors would only apply in some sort of limit.


How do I delete lines from the QGIS canvas which no longer are attached to a shapefile?

Question: Using QGIS 2.18.1, I started to create a shapefile layer with a line feature, but then decided not to proceed.  I first tried to select and delete the lines but couldn't seem to select them with the select tool.  So I then deleted the shapefiles using File Explorer which seemed to go as expected.  However, the lines are still on the canvas, and appear to be impossible to delete, and of course are no longer associated with a layer .  How can I clear the canvas of these lines?
Comment: What have you tried so far? have you closed and opened the program, tried deleted the project file? starting a new project file?
Comment: Can you post a screenshot? I suspect the line is from a (digitizing) tool and not from a feature on the layer itself (or that would really be strange).
Comment: Thanks, all.  I found if I saved the project, closed QGIS, re-started QGIS and loaded the project, the lines had gone.  I should have tried that first, so thanks for your patience with a novice.
Answer:
select the relevant layer in the Layer Panel and activate the editing
Select the orphan line segment with the selection tool in the editing toolbar
Press the delete key of your key board

That's all.
Comment: And when you've removed all relevant orphan lines, deactivate the editing and save the layer
Comment: Thanks for the reply, user 29366.  However, there is no layer in the Layer Panel but the lines are still on the canvas.
Answer: This worked for me.
1. Save the project
2. Close QGIS
3. Restart QGIS
4. Reload the project and the lines have disappeared.


New Medicine Cabinet - Stud Removal

Question: I am installing a new inset medicine cabinet. I need to add about another 1.5" inches in height to get the new one to fit. I would like to remove the header on this (it's a true 2" stud) and replace it with a piece of 1x4. I'm pretty sure this is setup just to support the original cabinet. Would there be any harm in doing this (or possibly removing the header altogether)
Comment: the header is not really holding anything
Answer: You can do a number of things here:
Shorten the stud board coming down to the header and move the header up 1.5" to 2" inches (I would do that ) - a nice oscillating cutting tool would make that easy to do right in place.
I would then install my cabinet - and I would have a sturdy upper frame for it as well.
You could remove it , replace it with something thinner .. but really why spend the extra money for wood - just cut the stud board and move the thing up the distance you need.
Comment: Its only there to allow you to attach the top of the cabinet to something solid. You could get away with removing it completely as well. It does not create a load bearing connection to the cabinet because your cabinet wouldn't bear any weight from above. Having one on the lower side is needed to help support the weight of the cabinet.
Comment: If there is nothing there there would be no support for the new wall covering and cabinet to attach two, I would cut it out and move it up as in ken's answer.+
Answer: You want to follow the instructions given to cut the upper short stud some and then move the header up the requisite amount. Make sure to re-nail the lower end of the short stud to the raised header.
Please ignore the noise here regarding removing the header entirely. You do not want to do that since that upper short stud lower end would be unsecured and will create a spot on the wall that can flex. This can be especially problematic if someone tries to attach a load on that stud from the opposite side of the wall. Just imagine how bouncy it would be trying to hammer in a nail to that stud from the opposite side.
Comment: +1 Just assume that the carpenter who put that header there in the first place knew more about wall structure than the internet does.

New Medicine Cabinet - Stud Removal


PC^2 equivalent compatible with Python

Question: I will be running a programming competition for high school students in the near future, and was originally going to use PC^2 (Programming Contest Control System) for the automated judging of the solutions. This software is commonly used in the ACM's International Collegiate Programming Contest regionals as well as the world finals. This is an excellent system which I have used before, but one of its pitfalls is its language support (Java, C, and C++). I'm a little bit concerned, as not all high school students who may be attending will have exposure to any of these languages. However, many local high schools teach introductory programming courses in Python. Is there an equivalent system to PC^2 which has Python support?
Comment: Your best bet would be to contact the folks that do this contest directly, to see if they support Python.  Their e-mail address is one that I found in their Wiki - firstname.lastname@example.com.
Comment: I'm fairly certain they don't support Python. I've spoken with the individuals in charge of the Mid-Central Regional at the University of Chicago and they know for a fact PC^2 only supports the three languages I've listed. I'm looking for an alternative to PC^2 with similar features (i.e. solution submission, judging, clarifications,  and so on).
Comment: In the current version (9.5.4) Python is supported natively!
Answer: You can use some open source implementations of the online judges.
for example ONJ http://sourceforge.net/projects/onj/
It is easy to configure and it can be made compatible to run on languages of your choice. You dont need local copies of it on every system where the students will sit, you can just run it on a server and give the students its web-link to submit their solutions.
Answer: Do it with Sphere Online Judge, contest hosting is free of charge, many languages available.
Answer: I actually found a much better way to accomplish this. In their latest release, PC^2 added support for interpreted languages (such as Python, etc). Since PC^2 requires an executable, you need to "stub out" the compile command and simply invoke the interpreter with the script.
The full guide can be found at http://pc2.ecs.csus.edu/wiki/Interpreted_languages
Answer: Assuming you are still interested, PC^2 is very adaptable. I run a scripting contest using it and support Python, Perl, PHP and Ruby. Basically, PC^2 expects a language to compile and then run. You need to write a dinky script that pretends to compile the code and return success. Then the run script simply runs the scripting submission. Pretty easy to do.
You can visit http://acm2012.scusa.lsu.edu and look at the scripting contest info. Feel free to contact us for more info.
Answer: It's simpler than one may think. The following is for pc2 9.2.3-2565
Add language as follows (python here as an example):
Display Name: Python
Compile Cmd Line: touch OK
Executable Filename: OK
Program Execution Command Line: python {:mainfile}
python3.3 or python3.4 will work too.
pc2 could be easier, of course, but there does not seem to be much support left at CSUS. Reseting contest would be even greater feature; the current need to clone directories for test, practice, and actual contest is very awkward. Better management of the database (like the ability to remove things) would make it into a great tool. It is alright, but it could be great.

PC^2 equivalent compatible with Python


Formal definition of parser?

Question: I'm looking for an accepted, formal definition of a parser as function $f$ returning an AST, but I cannot find any reference in literature; all I can find is the definition of a recognizer as a function $f:\Sigma^*\to \{0,1\}$ with obviously $f(w)=1$ when $w\in L(G)$ and $0$ otherwise ($G$ being a grammar and $L(G)$ the generated language).
Comment: In Chapter 5 of Robert Harper's book http://www.cs.cmu.edu/~rwh/plbook/book.pdf you can find a relational definition of what you are looking for (excepts it's not a function).
Comment: Unambiguous grammars give you a parse tree. The AST is a transformation of the parse tree. Keller et al., "Tree transformation techniques and experiences" seems to have some formalization of the latter process.
Answer: There is more in recognition that appears at the first sight. It is naturally generalized into recognizing all the substrings of a given string so that the output is a matrix A where matrix element A[i,j) corresponding to semiopen interval/segment [i,j) contains all the symbols derived for the substring cut by this interval. For example, given a grammar
S → S + M
   | M
M → M * T
   | T
T → number

and an input
6 + 7 * 8

we have
A[2,5) = {M,S}

i.e. the symbols M and S were derived for the substring 7 * 8 at the interval [2,5). It is essentially a table used by CYK parser. "Principles and Implementation of Deductive Parsing" by Shieber, Schabes, Pereira describes how Earley parsing fits into this framework as well.
Given a parsing matrix, one can recover a parse tree (and contrary to what wikipedia CYK page says, one doesn't have to store backpointers), but the takeout message here is that parsing matrix is more fundamental than the parse tree; in particular, it is well defined even for ambiguous derivation.
Comment: This is a nice observation!
Answer: A reasonable formal definition of (context-free) parsing is thus: given $\langle \mathcal{G},w\rangle$ a context-free grammar over some alphabet $\Sigma$ and an input word in $\Sigma^\ast$, return the set of parse trees of $w$ in $\mathcal{G}$ (note that the grammar might be ambiguous, which means that this is indeed a set, which might even be infinite if the grammar is cyclic).  Recognition then consists in finding out whether this set is empty or not.
A very elegant way of solving the parsing problem is known as parsing as intersection: context-free languages are effectively closed under intersection with regular languages, i.e. given $\langle \mathcal{G},\mathcal{A}\rangle$ where $\mathcal{G}$ is context-free and $\mathcal{A}$ is a finite-state automaton (a NFA), we can construct $\mathcal{G}'$ a context-free grammar such that $L(\mathcal{G}')=L(\mathcal{G})\cap L(\mathcal{A})$ and furthermore the set of derivation trees of $\mathcal{G}'$ is (a relabelling of) the set of parse trees of all the words in $L(\mathcal{A})$.  Of course a single word $w$ can be recognized by a NFA.  This construction is almost as old as context-free grammars; see

Bar-Hillel, Perles, and Shamir, On formal properties of simple phrase-structure grammars, Zeitschrift für Phonetik, Sprachwissenschaft, und Kommunikations-forschung 14:143--172, 1961,
Lang, Recognition can be harder than parsing, Computational Intelligence 10(4):486--494, 1994, doi: 10.1111/j.1467-8640.1994.tb00011.x.

Formally, let $\mathcal{G}=\langle N,\Sigma,P,S\rangle$ with nonterminal alphabet $N$, terminal alphabet $\Sigma$, finite set of productions $P\subseteq N\times (N\cup\Sigma)^\ast$, and start symbol $S\in N$.  For the automaton, let $\mathcal{A}=\langle Q,\Sigma,\delta,I,F\rangle$ with state set $Q$, input alphabet $\Sigma$, transition relation $\delta\subseteq Q\times\Sigma\times Q$, initial states $I\subseteq Q$, and final states $F\subseteq Q$.  Construct $\mathcal{G}'=\langle N',\Sigma,P',S'\rangle$ where
$$\begin{align*}
  N'&=(Q\times (N\cup\Sigma)\times Q)\uplus \{S'\}\\
  P'&=\{S'\to (q,S,q')\mid q\in I, q'\in F\}\\
    &\:\cup\;\{(q_0,A,q_m)\to (q_0,X_1,q_1)(q_1,X_2,q_2)\cdots(q_{m-1},X_m,q_m)\\&\qquad\qquad\qquad\qquad\qquad\qquad\mid A\to X_1X_2\cdots X_m\in P\wedge q_0,\ldots,q_m\in Q\}\\
    &\:\cup\;\{(q,a,q')\to a\mid (q,a,q')\in\delta\}\;.
\end{align*}$$
The intuition behind this construction is that a nonterminal $(q,X,q')$ in $Q\times(N\cup\Sigma)\times Q$ derives the intersection of the language of the symbol $X$ with the language of $\mathcal{A}$ restricted to paths from $q$ to $q'$.
The beauty of it is that the construction of $\mathcal{G}'$ is asymptotically efficient: it has size $$O(|\mathcal{G}|\cdot |Q|^{m+1})$$ with $m$ the maximal length of a production right-hand side.  Since without loss of generality we can "binarize" $\mathcal{G}$ so that $P\subseteq N\times(N\cup\Sigma)^{\leq 2}$ at the expense of a linear blowup in the grammar size (this is not the Chomsky normal form, which would forbid $\varepsilon$ and unit productions, and would induce a quadratic blow-up), we obtain an $$O(|\mathcal{G}|\cdot |Q|^3)$$ parsing complexity.  As context-free grammar emptiness can be solved in linear time, the recognition problem is also in $O(|\mathcal{G}|\cdot |Q|^3)$, which matches the complexity of the CKY and Earley algorithms since an automaton for $w$ has $|w|+1$ states.
Comment: let us suppose that we restrict to such subclass of context free (deterministic grammars, right?), then $|\langle \mathcal{G},w\rangle |\leq 1$, is this right?
Comment: @NoWhereMan: if you consider *unambiguous* grammars, then the set of parse trees is either a singleton or empty for any $w$.  The grammars accepted by deterministic parser generators are unambiguous (being for instance LL(1) or LALR(1)), modulo some ambiguity resolution mechanisms (typically precedence and associativity).
Answer: In attribute-value logic, a parser is a function $f: \Sigma^* \rightarrow \Phi_\mathcal{L}$ that takes words to formulae over a (first-order) language. The formulae are usually interpreted as directed acyclic graphs but they could be restricted to trees (ASTs).

Formal definition of parser?


Can we house a baby squirrel in the same cage as a ferret or bunny?

Question: I wanted to know if a baby squirrel could stay in the same 4-floor cage as a pet ferret or bunny we were thinking of adopting or buying. I also want to know if the baby squirrel might attack or anything, and we are not keeping the squirrel for long. we are just going to care for him because he's an orphan and his mom was killed by stray cats in our area. my last question is if we should turn the squirrel to animal control. I asked many people and a few said that they'd kill him.
Comment: If you're worried about animal control, what about asking a local vet? (Exotic vets might have more resources.) It sounds like you were planning on keeping it for a while and then letting it go - I'd be worried that if you do that it wouldn't be able to fend for itself in the wild. You really should consult a professional with experience before you do that.
Answer: So you never want to mix species in the same cage. Ferrets are in the weasel family and are natural Born Killers. They WILL kill a squirrel (baby or adult, as well as birds,bunnies, rodents etc...) Also, bunnies are a little territorial. Even if you have the sweetest bunny, an accidental kick from their strong back legs could do some major damage to your rescued squirrel. The other concern is that wild animals and caged animals have a different tolerance to sickness, bacterias and fungi. Your squirrel may have been exposed to something that could make another animal sick, if exposed by close encounters, urine and decal matter, or other bodily fluids (sneezing or sharing drinking water, etc). Even if your squirrel is healthy it doesn't mean he hasn't been exposed to something it's tolerant of that other caged animals have yet to build antibodies towards ridding off.
Try looking up a wildlife rescue or a squirrel rehabber in your area. They will be more informed and more likely to care for and re-wild the squirrel than animal control.


Was the laughing gas dentist scene in The Pink Panther Strikes Again done previously?

Question: Was the laughing gas dentist scene in The Pink Panther Strikes Again done in a previous movie? Maybe a Jimmy Cagney comedy from the thirties or forties?
Answer: I don't think that it was done exactly, and there have been many different scenes with dentists and tooth mishaps.
However if you are thinking it's Jimmy Cagney, there are two possibilities. The first is the original film "The Man Who Knew Too Much", (1934) which was a Hitchcock thriller. This featured a scene in a dentists chair where the dentist is probing around in the hero's mouth and interrogating, only to have the tables turned on him.
The Jimmy Cagney reference is from the remake of the same name in 1956, but in this movie the scene was changed from a dentists office to a taxidermy shop.
If neither of those are correct, here is at least a partial list of movies with dentist scenes in them: Dentist scene list
Answer: The movie I was looking for is Pale Face starring Bob Hope.  He has the same scene as Sellers, getting goofy on the laughing gas and then pulling the wrong tooth.  Blake Edwards' version is much longer and funnier, but Hope and Sellers were different comic actors.


What are groups and elements in lenses?

Question: I hear people talking about groups and elements in lenses, but I am not sure what they mean. Could someone please explain?
Comment: Related : http://photo.stackexchange.com/questions/65126/are-there-any-secrets-in-lens-design
Answer: Except for a few budget cameras of the past, all camera lenses are made using at least two or more separate lenses. Each of these "thin" lenses is termed an "element". In optical jargon, when individual lens elements are combined, the pair is called a "component". Thus the typical camera lens contains several components. The elements that make up a component are usually, but not always, cemented together. Several components make up the compound camera lens. Components are generally not in contact with each other. Between them is an "air-space". The air-space is also lens shaped, and thus it acts as a weak lens. The synonym for component is "group".
Such a complex mix of elements and components are needed to mitigate defects that prevent the lens from making a faithful image. We are talking about aberrations. There are seven aberrations, two induce color errors, five induce blur and/or distortions.
Comment: You say "usually" not in contact; are they ever (intentionally)? Optics that touch (in the middle, not edge) have an annoying habit of forming Newton's Rings, which can look like an oily smudge, but I don't know how that would affect the overall optical performance.
Comment: @ Nick - In projector optics, when the likelihood the lens elements will get hot, elements are not cemented together. Also, large telescope achromatic lenses are often not cemented. The old standby cement was Canadian Balsam, a resin made from a pine tree. In modern times, artificial resins are used. These are less susceptible to supporting bacteriological growth. Newton rings can be devastating, a thin gasket is often used to allow a minute air space.
Answer: A group is two glass elements cemented together. This avoids the air to glass boundary between them.  The two different elements have different index of refraction (affecting color wavelength differently).  More elements are used to correct more aberrations.
The most simple "lens" is a single element lens, like a simple magnifying glass.  But it is a poor lens, with serious optical problems, it cannot even focus different colors in the same place (called chromatic aberration).  So a "doublet" or a two element group (of two different index of refraction) is a much better lens, it corrects for two colors (but not for three).  How it does this is shown here:
http://en.wikipedia.org/wiki/Chromatic_aberration#Minimization
The third one on the right shows two elements in one group.
But very much more can be done if we are critical.  Maybe five elements makes a decent prime lens (a longer one), but when we make it zoom over a range, including wide angle, and add internal focusing, the $2000 lenses are often more than 15 elements. We certainly do consider them improved.
Answer: Honestly I ignore them. There is no provable correlation that have more elements and groups mean anything when it comes to image quality.
That being said, to answer your question:

A lens element is a single lens in the traditional non-photography meaning of lens. It bends light in a certain way depending on its shape and material. Most lens elements are made of glass. They can also be made of fluorine (or is that fluorite?), ceramic or plastic.
A group is one ore more lens elements which are moved together when the lens is focused or zoomed. Sometimes there is space between such elements but sometimes they are in contact.

Logically, you cannot have more groups than elements. So you can have a 16 element lens with 6 groups but not a 6 element one with 10 groups. Generally, more elements and more groups means that the design is more complex. These elements are there to correct different types of aberrations which can help improve performance. It can also allow lenses to have a longer zoom, closer focus range or higher magnification which is why more elements to not necessarily means better output.
Comment: Once you get over a certain minimum number of elements or groups, sure, but I don't think you'd like the results of anything less than [three elements in three groups](https://en.wikipedia.org/wiki/Cooke_triplet), or [two elements in one group](https://en.wikipedia.org/wiki/Achromatic_lens) at a bare minimum.

What are groups and elements in lenses?


Can I learn martial arts at a Shaolin temple by helping out at the temple?

Question: I have not learnt any martial arts. However, I believe if I were to attain a state of inner discipline and peace I need to learn the arts.
Unfortunately, I work in India and my earnings do not allow me to save handsomely.
Can I approach a Shaolin temple in China or Japan and request a sensei to teach me in return for my services as a helper, teacher, worker at the temple?
If so would you'll know any temples?
Thank you for your time.
Answer: You can approach a Shaolin School, but it is highly unlikely that they will teach you in exchange for services.
The Shaolin Temple in China is essentially a business.  They make a large profit from the money they get from students and have plenty of them.  Smaller Shaolin Schools are also businesses.
You also mention temples in Japan.  I assume by this you mean the Shorinji Kempo movement (of which I am a member) This is not actually shaolin kung fu but shares a similar zen philosophy.  This is a multi-part organisation, but may as well be considered a business.  The only way to get 'free' training that I know of with this organisation is the Busen School.  These are basically monks (as opposed to people like me who you might call lay members) and I don't know how you would apply.  You would certainly need to know Japanese first as this is the philosophical school and lessons are only taught in this language.
However it would be a mistake to think you have to go to china or japan to study martial arts.  There are schools in India of the Shorinji Kempo Movement and I am certain of the actual Shaolin Kungfu as well.
Answer: Adding to Huw's answer (that these major temples are a lot like businesses now and probably will not accept alternatives for payment in exchange for teachings, though there may be some exceptions for those in monkhood) -
it is worth noting that many schools, at least around the U.S. and with Chinese and Japanese martial arts, will offer flexible rates depending on income level. Based on the experiences of myself and my peers, you're more likely to have success forming that agreement if you can reach out to the leader to discuss it privately. If you are short on finances but can help support the school in other ways, maybe you can work out a deal like that (help setup and clean up, perform some other chores). If you have little income for now but are working to improve your situation, you might be able to get a discounted rate (e.g. a student discount).
The important thing there ties into Huw's bottom line as well: you don't need to go to physically travel far and abandon your house and job to get good martial art training which will help you cultivate a state of inner discipline and peace. Act locally, be sincere and honest, and be willing to emotionally travel and sacrifice. Not all schools will be flexible but I bet the more local the school, the better your chances, to be honest. For the school it can pay to be flexible with those in the community it is in, whereas they may want to avoid attracting unwanted attention by being flexible with travelers with little from far away.
Answer: According to my Sifu, the kung fu performed by Shaolin monks in the modern day is largely flashy wu-shu stuff. While it looks really cool for the tourists, it has little to no actual combat application.  Don't go looking over seas, look for a school close to home that teaches real kung fu. Heung Gar, white eyebrow, chow gar, ship pal ki, wing chun and countless other styles are all taught in North America.
Comment: While there is a good answer in there, the current tone is a little aggressive for my liking.  Could you perhaps rephrase a little? Again, a reference would be nice but if it's your Sifu's opinion it might be hard to get an external source.
Comment: Certainly.  No disrespect intended toward the monks.  I'm sure they train hard to do what they do.  But it is historical fact that much of the Kung Fu in China was lost when the Communists took over and killed off most of the masters in 1949, banned the practice if Kung Fu, and burned down temples.  Kung Fu was associated with ruffians and considered a taboo practice.  Practitioners were call "gong fu fei jai" (Kung fu gangsters).  While there may well be temples practising traditional kung fu, the temples in the tourist areas are very much tourist attractions.
Comment: further to my previous comment, we can credit Bruce Lee for bringing Wing Chun to North America, but as for other styles, I'm not sure.  I'll try to ask Sifu tonight how Chow Gar (the style I'm training in) came into North America (he's a real history buff).
Answer: No, it's financially motivated now. History of Kung Fu post 19th century is a sad one. Due in large part to reforms made during and after the Cultural Revolution in China. During this period militant efforts to purge "traditional Chinese" culture to reinforce Maoism, led to the destruction of a lot of martial arts manuals, documents, and treatises as well as the extermination of many practitioners. Three million people were subject to be killed specifically because they were well known teachers of traditional Chinese culture, and this included well known martial artist. That's not mentioning the anti-Buddhist purges that targeted many Buddhists (and martial practitioners).
By the 60s and 70s, interest in martial arts from movies made in Hong Kong by Ip Man and Bruce Lee rekindled interest in kung fu/Wushu practices. Martial artists who escaped China went to Hong Kong, Japan, the US and Taiwan where they did their best to rebuild the schools of instructions with what little reference material they had available. In the 80s, kung fu movies took off successfully in the US home video market. And new actors Jet Li and Jackie Chan also help rekindle greater interest in westerners wanting to learn kung fu/wushu as a practice. VHS tapes of martial arts became amateur practice references, LONG before Billy Blanks and Tae Bo in the 90's.
The Chinese government used martial arts as a tourist draw, to market their teaching styles, and prospective students are being lured away by the draw of mixed martial arts (MMA), a combat sport that is exploding in popularity and requires no standard technique to implement. As a result, few fighters think of kung fu as a legitimate martial art any longer. Today, kung fu is a blend of martial technique and various isometric exercise, stretching, and elaborate gymnastics. You can learn martial arts at a temple, but be prepared to pony up the cash. You can learn outside China, if people are still around to teach.


Vegan option for lactose?

Question: I have been vegan since 2000.  So lactose is out for my brews.  What would be a good substitute?  I have seen people suggest maltodextrin as it is an unfermentable sugar, but it doesn't add any sweetness.  Others have suggested adding an artificial sweetener to add some sweetness.  Which basically means adding two things to get the effect of lactose.  Anyone have any other ideas or experiences?
Comment: Along with the great ideas here I was also wondering if pulling off a bit of wort and caramelizing it as is suggested for some Scottish ales would help.  The caramelization would convert some sugars into something that can't be utilized by the yeast thereby leaving some residual sweetness and body.  But the extra taste might not be beneficial.  Thoughts?
Comment: Not an answer, but a follow-up question... Are there vegan sources of lactose? Obviously dairy is the easiest source, but lactose a straightforward disaccharide of glucose and galactose. There must be SOME non-animal source of such a small sugar.
Comment: @Nick Apparently milk is the only natural source of lactose. This gives the strict vegan only non-natural sources, there are natural sources of galactose however and it should be possible to synthesize lactose from that. A non-strict vegan only concerned with the non-volentary exploitation of animals could consider human milk as a source (which is extracted with volentary consent).
Answer: Some options:

Mash at a higher temperature, around 158 F. This will decrease the fermentability of the wort and make it fuller-bodied and sweeter.
Add some carapils, maltodextrin, or carafoam. All of these increase head retention and body a bit.
Treat your water to favor the flavors. A 2/1 Chloride/Sulfate ratio with 100+ ppm of Chloride will help, as will some additional Sodium (but keep Sodium below 150 ppm)
Increase the amount of low lovibond crystal/caramel malt you use. For example, if you have some Crystal 20 at a rate of 5% of the batch, up that to more like 10%.
Reduce the astringency you introduce for dark grains (like chocolate malt and roasted barley). This can be done in a number of ways, including using Carafa Special (dehusked chocolate) or De-bittered black malt. Alternatively, you can steep your dark grains separately (below 170 F) or "cold brew" them like a coffee then add them after the mash to help avoid tannin extraction.

There's really a lot you can do. I actually stopped using lactose even in sweet stout so I didn't have to worry about it impacting lactose-intolerant friends, and I employ most of these techniques when making a sweet stout. If you're interested in a longer write-up, feel free to hit up an article on my site.
Answer: You might try bumping your OG and mash temp to increase the amount of non-fermentable sugars.
Depending on the style, you may need to look for other ways of adding some of the flavors that the lactose may have provided.
Answer: This would depend on you having a kegging system, but if you force carb, you could take a page from the winemakers books and kill off the yeast through whatever means (a combination of potassium sorbate and potassium metabisulfite being suggested by JackSmith as the winemakers approach), and then back sweeten with your choice of sweetener (e.g. some malt extract).
Comment: The idea is good, but winemakers don't kill yeast with campden (potassium metabisulfite).  The yeast is stunned into submission using a combination of potassium sorbate and potassium metabisulfite.  It's the sorbate that stops fermentation; the k-meta merely helps the sorbate to be more effective.
Comment: @JackSmith, thanks. I haven't done winemaking so I wasn't entirely clear on that approach, but felt it should be suggested. I've edited to show that.
Answer: Think about what lactose provides to the beer, and adjust your recipe and processes to try to compensate for those things.  You can reduce the bittering hops to increase the perceived sweetness.  For a "thicker" mouthfeel, use Carapils or flaked oats or barley.

Vegan option for lactose?


Can I substitute whole eggs for egg whites in cake mix?

Question: A box of white cake mix needs three egg whites.  If substituting whole eggs for egg whites, how many whole eggs would I use?
Comment: Is there a specific reason why you cannot omit the yolks?
Answer: If you truly desire a white cake, you don't want to make this substitution.
The reason the white cake mix directs you to add egg whites only is to to avoid the yellow color from the yolks, which will tint your cake yellowish.
Cake mixes are highly engineered wonders, and are very tolerant of almost everything a home cook can do to go wrong within reason.  Still, substituting in the yolks increases the amount of fat—and more importantly, the emulsifier lecithin, and so will change the texture of the outcome.  This will probably not be bad, but still will not be the optimal result from your mix.
Answer: The Pillsbury White Cake Mix calls for either 3 whole eggs OR 4 egg whites.  Depending on which way you go, the amount of water called for is different - for 4 egg whites you use 1 cup of water, and for 3 whole eggs you use 1 1/4 cups of water.  The 1/3 cup of oil is the same for both.
What makes a yellow cake different from a white cake is that you use whole eggs, which gives you a yellow color (from the yolks).  If you want a truly white cake, you should use all egg whites, i.e. for a wedding cake.
When I have a lot of wedding cakes to bake, I get the frozen egg whites from my local Bakery Supply.  I have a chart on my cupboard which tells me how much egg white to use to equal 1 whole egg, 2 whole eggs, 3 whole eggs, etc.
On the rare occasion that I get an order for a yellow cake, I make a white cake with whole eggs and add a little yellow food color.  Clients can't tell the difference, and I'm not going to tell.  I find the yellow cake mixes very runny, and don't like to use them.
By the way, Pillsbury Cake Mixes are rated the best by the Culinary Institute of America, as well as Wilton, and they are usually the cheapest.
Comment: You don't tell them you add coloring? My children and I are allergic to red and yellow dye. It's best you tell them. This is great to know though... if I ever do order cake from anyone I will have a signed receipt saying no dyes are present in the mix or added.
Answer: Ideally you have the weight of egg whites that you require; however I found that a normal sized egg has whites weighing approximately 1.2 ounces.
A whole egg is usually around 2 ounces, erring on the side of less.
Therefore, I would say you may get away with using 2 whole eggs. To be more meticulous, I recommend scaling out 3.6 ounces of whole eggs. You can beat the eggs together and then scale them.
There's also the concern that you won't get the same results by using whole eggs instead of pure egg whites; but considering that boxed cake mix is so robust, I would consider these effects negligible.
Comment: Thanks for the help. I thought also about trying two whole eggs as you suggested.
Answer: I found instructions on the Betty Crocker mix in small print.
Betty Crocker mix says:  add the whole egg and don't change anything else.  That means 1 egg for every 1 egg white.
This will make a softer cake after baked.   But it will also yellow the cake mix.   So you will want to add vanilla so you have the flavour of the yellow cake mix.
If you want a true white cake you would not do this.  But to answer your question yes you can substitute whole eggs for egg whites in a cake mix.
Comment: Seasons, welcome to the site! Please note: Stack Exchange works differently than most internet forums - we have a very strict question/answer format here and for a good reason. Please have a look at our [help center](http://cooking.stackexchange.com/help), especially the page on [how to write a good answer](http://cooking.stackexchange.com/help/how-to-answer). You have a good point with the BC mix - that would make an answer. Have you tried it? Then please edit your answer with the results and it will be a good answer.
Comment: I *think* this is marginally an answer, because it provides instructions from Betty Crocker which presumably work. I think the issue is more that it's slightly unclear what you mean (replace each egg white with a whole egg? add a whole egg on top of the egg whites?), though it'd certainly be good to know how you think it works.
Comment: Fixed comment..


Ubuntu Desktop 12.04 LTS does not work with Radeon Generic PnP display

Question: I have a HP Pavillion g6-1330se laptop with Intel i5 processor, 6GB RAM, Radeon Generic PnP display and Windows 7 Home basic version. I have downloaded Ubuntu Desktop 12.04 LTS from the website and have extracted the .iso file on to an external DVD. However, upon trying to boot from DVD, I get a blank screen. Also, I tried installing Ubuntu using Windows installer - while the installation goes through successfully and during booting I get options to select Windows 7 or Ubuntu, upon selecting Ubuntu, I get a blank screen.... How can I resolve this problem? Thanks in advance.
Answer: I have the same problem with ATi Radeon 6750HD. When you get the option to boot into Ubuntu, press Enter and quickly hold left Shift key. Choose Ubuntu recovery mode. It will give you a set of options. Select Resume normal boot and you are good to go.
Comment: Do you have to do that each time you boot? Or, is there a setting you can choose that will make a permanent fix?


Play a live YouTube stream in the YouTube app

Question: For example youtube.com/opener - it won't play via the browser, but I can't figure out how to access it via the app.
Is it possible?
Answer: You can't. This feature was added in the ICS version of the YouTube app. Older versions don't support it.
Answer: Check how you are looking for it in the app you have a couple options you can try:
From the regular youtube.com/opener site subscribe to the channel
or
From the app search for the AlterArt2 channel and subscribe to it
The channel isn't actually listed as opener it is under AlterArt2 so watch that to make sure you are able to find it. I located it on my youtube app and was able to subscribe and view. I'm using an HTC One X ICS.
Hope that helps.
Answer: It seems that if you add the livestream to your Watch Later list, you can then view it via this on your mobile device. However, it will start from the beginning of the stream and it seems you cannot forward it. You can pause it, but I found that if I left the application, when I  would go back it would take me all the way to the start again.
Maybe this can help someone somehow.
Answer: You can use the browser.
Just type the livestream link, and it will load normally. On the downside, it will lag a little bit.


When using a hash and a collision occurs and linear probing is used how is that item found again

Question: How is the search for the item supposed to find the specific item if the data is all clumped together and all the search is given is the output of the hash function. I don't understand how it knows which of the pieces of data is the one that corresponds to the key if linear probing has been used so it could be any of a number of pieces of data?
Thanks for any help
Answer: Any given equality function over the objects.  You're asking if an object is in a hash table, and it is if there is an object that is "equal" to the given object.
And remember that object equality implies hash equality.
Comment: Thanks, but say I want to get an object that corresponds to a key and when the key is passed into the hash function it gives an array location, from that how do I know which of the elements is the one i want if there is a number of elements that have all been shifted along due to linear probing? Thanks
Comment: @JackFerguson The entry in the table contains a copy of the key.
Answer: In linear probing, The hash function only points to the bucket in the hash table that is the starting index for the search. So say item $x$ after hashing has a hash value of $h(x)$. This is just the starting index of the bucket. If the data at hash bucket $h(x)$ is not equal to the data, we incrementally search $h(x)+1, h(x)+2,....$ till either the data is found or an empty slot if found.
Comment: But when you say till the data is found how do you know when the data has been found if all you know is the key that corresponds to that piece of data?


CMS spread vanilla options quotation

Question: How are vanilla (call/put) options on CMS spread quoted on the markets ? Through an implied (normal/lognormal) volatility with a normal/lognormal model on the spread in the forward measure ?
Answer: Here is a quotation from an interbank broker last week:  1Y 2-10 Str 26-27.  This means that a one year at the money straddle on the (10yr cms - 2 yr cms) has a spot price of 0.26% bid, 0.27% offered.   So, they are quoted in price terms , not volatility.
To value  the above option, most traders would use the volatility of 1y-2y and 1y-10y swaptions , and a correlation between those forward rates.  This produces a normalized volatility for the spread, which is then used to compute the value.
Comment: Oh ok. I am trying to do the converse : backing out the correlation to use it for a pricing of a mid-curve swaption whose payoff I approximated (by freezing some annuities fractions to their time-0 value) by a "generalized" spread option, of pay-off $\max(\alpha S_T^1 - \beta S_T^2,0)$ where the $S_T^i$ are the two CMS rates.
Comment: Actually I know that many banks quick price mid-term swaption like this, with a gaussian copula, backing out its $\rho$ from the aforementioned correlation.

CMS spread vanilla options quotation


Why did Cardinal Ratzinger stop supporting a literal interpretation of creation in Genesis?

Question: I read that Cardinal Ratzinger stated the story in Genesis 1 and 2 should not be interpreted as a literal account of the beginning of things. In spite of recent events like this, they have always been in favour of a literal explanation of creation based on Genesis. This is what I read. Why does Ratzinger hold this view on such an important matter?
Comment: I can't speak for the Catholics, but in Orthodoxy there has always been flexibility about how literally you take Genesis; it's not that we question its validity, but we consider its prophetic aspects as both a more reliable form of interpretation and also more useful.
Comment: I wonder where the impression comes from (repeated in one of the answers below) that the Church insisted for a long time on a literal reading of Genesis. St. Augustine was grappling with how to interpret it back in the 4th century. On the more recent end, there's an amusing passage in Canticle for Leibowitz (a sci-fi novel from the 1950s written by a Catholic) that makes it clear that a literal reading of Genesis was not then considered essential to Catholicism either.
Comment: I'm not sure if flexibility is the best word to use @RiverC. Quoting [Fr. Seraphim Rose](http://www.orthodox-christianity.com/2011/04/how-to-read-genesis/): *"The very nature of the reality which is described in the first chapters of Genesis (the very creation of all things) makes it quite impossible for everything to be understood "literally"; we don't even have words, for example, to describe "literally" how something can come out of nothing."*
Comment: Please see http://christianity.stackexchange.com/questions/5049/did-adam-and-eves-progeny-commit-incest/5056#5056
Comment: See also http://christianity.stackexchange.com/questions/5598/how-old-is-old-earth-creationism
Comment: -(cont.) *"How does God "speak"? – does He make a noise which resounds in an atmosphere that doesn't yet exist? This explanation is obviously a little too simple – the reality is more complex."* However, considering "it's prophetic aspects" is a good way to put it.
Answer: Ratzinger writes at such length as to obscure the point, in my opinion.  If you read the Catechism of the Catholic Church, 283 (2nd ed.), the reasoning is spelled out in a brief and clear form:

The question about the origins of the world and of man has been the
  object of many scientific studies which have splendidly enriched our
  knowledge of the age and dimensions of the cosmos, the development of
  life-forms and the appearance of man. These discoveries invite us to
  even greater admiration for the greatness of the Creator, prompting us
  to give him thanks for all his works and for the understanding and
  wisdom he gives to scholars and researchers. With Solomon they can
  say: "It is he who gave me unerring knowledge of what exists, to know
  the structure of the world and the activity of the elements. . . for
  wisdom, the fashioner of all things, taught me."

That is, they recognize and appreciate the value of scientific studies for the information they yield about matters including the history of the universe and life on earth.  This is entirely consistent with their stance that faith and reason can never truly be in conflict (CCC 159):

Faith and science: "Though faith is above reason, there can never be
  any real discrepancy between faith and reason. Since the same God who
  reveals mysteries and infuses faith has bestowed the light of reason
  on the human mind, God cannot deny himself, nor can truth ever
  contradict truth."37 "Consequently, methodical research in all
  branches of knowledge, provided it is carried out in a truly
  scientific manner and does not override moral laws, can never conflict
  with the faith, because the things of the world and the things of
  faith derive from the same God. The humble and persevering
  investigator of the secrets of nature is being led, as it were, by the
  hand of God in spite of himself, for it is God, the conserver of all
  things, who made them what they are."

In this case, the scientific evidence against a literal reading of Genesis is so overwhelming that if truth cannot contradict truth, it suggests that the error is to read Genesis literally.  I do not know why it took so long for the Catholic Church to recognize this, but the current position is internally consistent and reasonable.
If they were to continue to insist on a highly literal interpretation, they would have had to drop their position on discrepancies and simply state that faith wins.  That would have been a much larger doctrinal change than maintaining (as they do, to my understanding) that Genesis 1 and 2 is spiritually accurate without being a literal account of all events.
More on this topic can be found in a large number of places, including here.
Answer: My mother-in-law has that book you link to (she's a very traditional minded Catholic and would be aghast if the Pope invalidated the Genesis account).  I read a little of it and it's more or less a collection of meditations written by then Cardinal Joseph Ratzinger, it has no official doctrinal significance and is little more than his opinion.  Frankly, I'm aghast that someone could infer from a collection of meditations, written by a man who didn't even really want to be pope, something about Catholic doctrine.
Rex did a good job of giving the Catechism's take on Faith, Reason and Creation.  But I've got to put a plug in for the YouCat, it just answers the questions outright

41.) Does science make the creator superfluous
No.
42.) Can someone accept the theory of evolution and still believe in the Creator?
Yes.
43.) Is the world a product of chance?
No.
44.) Who created the world?
God alone.
45.) Do natural laws and natural systems come from God also?
Yes.

There's a lot more to those answers than just yes's or no's, but it's nice that initially they don't mince the words.  I'll leave it to you to get your hands on a YouCat in case you want to know more, just find someone who went to World Youth Day in Madrid in 2011 and they ought to have one in your language.
However, and to your exact point, question #46 has a more nuanced answer.  I won't quote it completely since it's copyrighted, but I'll try to give you the gist of it all.

46.) Why does the Book of Genesis depict creation of the world as "the work of six days"?
The symbol of the work week, which is crowned by a day of rest, is an expression of how good, beautiful, and wisely ordered creation is.

It goes on to give 7 points, which I'll phrase in my own words.
The 7 days account are symbolic of these principles:

God made everything out of nothing, nothing in creation was not made by God
God made everything good.
Even things that are bad now still have some good in them 1
All of creation is connected somehow.
Everything that was created is a reflection of God's glory.
There is a hierarchy in creation and more complex beings (us) are on top of it.
All of this points to a glorious and final end where we all be one in God.

Science is not going to inform our theology any more than theology is going to inform science.  They're completely separate entities and they tell us completely different thing.  Theology is infinitely more important than science since it concerns our ultimate destiny and knowledge of science is not necessary for entrance into Heaven.  Science is not the realization of what is hoped for nor the evidence of things not seen.  Theology is for the simple (Virgin Mary, St. Bernadette, St. Juan Diego, the 3 Children from Fatima) and it was not incumbent on them to understand complex theological principles any more than it was incumbent on them to understand complex scientific principles to receive God's grace.
If you show me one scientist who fully understands the Big Bang, Evolution and Quantum Mechanics, I'll show you one scientist who fully appreciates God's grandeur in the infinite and infinitesimal.

And that [the unheard-of precision of the processes associated with the "Big Bang"] is supposed to have happened by chance?! What an absurd idea!
Walter Thirring, Austrian physicist

Finally, I'll leave you with the words of Pope Benedict XVI (in the margin of the YouCat)

We are not some casual and meaningless product of evolution.  Each of us is the result of a thought of God. Each of us is willed, each of us is loved, each of us is necessary.
Pope Benedict XVI, April 24, 2005 2

1. tell your sister you were right
2. Mass for the Inauguration of the Pontificate, thanks St. @ath
Comment: The very last quotation is from the Mass for the inauguration of the Pontificate, on April 24, 2005: [Mass for the inauguration of the Pontificate](http://www.vatican.va/holy_father/benedict_xvi/homilies/2005/documents/hf_ben-xvi_hom_20050424_inizio-pontificato_en.html).
Answer: More recently, Pope Francis has made a statement that more than confirms Cardinal Ratzinger's position. Francis said it was easy to misinterpret the creation story as recounted in the book of Genesis, according to which God created heaven and Earth in six days and rested on the seventh, saying, "When we read the creation story in Genesis we run the risk of imagining that God was a magician, with a magic wand which is able to do everything." Pope Francis said there is no incompatibility between the Big Bang or evolution, and God as divine creator.
Notice that this position, like that of Cardinal Ratzinger, is incompatible with traditional readings of the creation account in Genesis. Undoubtedly the evolution of the Church's position has come about because anything else would become increasingly unsustainable as science moves forward in understanding the origins of the world. Even in the third century, Origen recognised that traditional readings of the creation account in Genesis are contrary to reason (De Principiis, Book 4.1.16):

.as even these do not contain throughout a pure history of events, which are interwoven indeed according to the letter, but which did not actually occur. Nor even do the law and the commandments wholly convey what is agreeable to reason. For who that has understanding will suppose that the first, and second, and third day, and the evening and the morning, existed without a sun, and moon, and stars? and that the first day was, as it were, also without a sky? And who is so foolish as to suppose that God, after the manner of a husbandman, planted a paradise in Eden, towards the east, and placed in it a tree of life, visible and palpable, so that one tasting of the fruit by the bodily teeth obtained life? and again, that one was a partaker of good and evil by masticating what was taken from the tree? And if God is said to walk in the paradise in the evening, and Adam to hide himself under a tree, I do not suppose that any one doubts that these things figuratively indicate certain mysteries, the history having taken place in appearance, and not literally...
Answer: This is because Ratzinger professes that the Bible was constructed from pagan sources and therefore he doesn't think its true or take it literally,
Ratzinger, A New Song for the Lord, 1995, p. 86:

The pagan creation accounts on which the biblical story is in part based..."

If the biblical creation account in the book of Genesis is based in part on pagan creation accounts, then it is neither original nor inspired directly by God. It's heresy and another reason he is not a Catholic, and was not a Pope.  He was the head of the counterfeit Catholic Church set up in the last days prophesied by Our Lady of LaSalette, Pope Leo XIII, Our Lady of Fatima, and The Book of Revelation.
Comment: I have difficulty expressing this opinion more charitably than "you've missed the point" as well as "you cannot be both Sedevacantist and Catholic".
Comment: @Igantius Theophorus Are you just quoting yourself?   You're antipope says the Bible is based on Pagan Myths.  I'm the one charitably pointing out that your mindlessly following a non-Catholic.
Comment: The Bible is divinely inspired. But perhaps there is a spark of the divine in the pagan writings; or maybe [more likely] they stumbled across the truth and it was only recognised as Divinely Inspired Truth by those who could recognise it.
Comment: @Andrew Leach You agree with Benedict that Genesis is based on Pagan myths, fine with me.  I believe that the Bible is true and not based on a mishmash of pagan religions, to each their own.
Comment: I didn't say anything about what I believed after the first sentence of my comment. I commented on a possibility concerning the pagan myths, not the Bible. Please don't read what I didn't write.
Comment: @Andrew Leach You are going at great lengths to defend some one who says the Bible is based on Pagan myths.  It doesn't matter how you say it, your action is loud and clear.
Comment: @apocalypse_info_click_here It's a play on the quote "You cannot be pro-choice and Catholic". As to "Based on Pagan", again, you've very clearly and obviously missed the point. English is based in part on Latin, that does not mean that it *is* Latin.


Microsoft Wireless Mouse 5000 Scroll Not Working

Question: I have a Microsoft Wireless Mouse 5000 with Intellipiont 7.1 installed on Windows 7 x64. The scroll has stopped working before, but a restart or two always seemed to resolve it. I tested the mouse on another computer and it worked. I also tested an Microsoft Arc mouse on this computer and the scroll worked. I have checked everything I could find on google and nothing helps. I have reinstalled intellipoint two times. Tried to change my mouse to another model in the intellipoint settings as suggested in many forums. Nothing.
If anyone has any suggestions that would be great. Otherwise, I think my next step is to pitch this mouse and get a logitech at Best Buy tomorrow.
Answer: Perhaps try installing default drivers, or older models' drivers.


Can SharePoint servers in a farm be a mix of Server 2008 SP2 and Server 2008 R2?

Question: We just found out that our server team built some servers with 2008 SP2 and some with 2008 R2. Is this going to cause problems?
Answer: AFAIK this is supported by Microsoft and I have seen multiple environments with a mixed OS setup. For example, during the transition to 64-bit with SharePoint 2007, it was fairly common for customers to split the upgrade into tiers, often starting with the SQL tier.
As long as the individual servers meet the minimum requirements I can't see it being a big issue.
If you are deploying customisations you may see inconsistencies between servers due to differences in the underlying OS, and from a configuration standpoint you may find that security changes etc. lead to additional administration overhead.
If Microsoft don't support a mixed OS setup that otherwise meets the minimum requirements I would be surprised and interested to know why.
Answer: This is a bit tricky since there is a difference between "causing problems" and "is supported by Microsoft".
First: It is not recommended to mix different OS's in one farm. If you can change it with reasonable effort, I would do it.
Second: If it is not possible to change the OS, at least make sure that every server role (like WFE, SQL, APP) has the same OS. It is not supported to mix OS within a role.
Third: If you have a problem with your farm and ask MS support to help, they will kindly please you to re-produce that issue on a farm with servers that have the same OS.
BTW: Troubleshooting errors caused by mixed OS is -let's say- ...interesting!
Comment: Is the "do not mix different OS's" recommendation documented somewhere?
Comment: I haven't found it yet. It has been a statement from our MS support technican.
Comment: If someone finds a statement that mixing OS's *within a role* is supported I'd like to delete my answer as it might be obsolete.


Automate item selection in Content Porter using Content Porter API

Question: i have name,path and type column in my Excel sheet for content porting.now i have to create export.xml form the Excel sheet data.so it might save my time for (item selection) in content porter.so i can use load wizard(to load Export.xml) which generate CP package.Is there any better solution using content porter API.
if any post,references.. please,
thanks in Advance.
Answer: Have you thought about using Bundles for keeping track of what to release with Content Porter. This article has one approach (automatically tracking stuff which is changed), but you can also add items manually to a bundle as part of the dev process.
Regardless of whether you add the items manually or automatically into the bundle, once you have a bundle of items its easy just to select the bundle with Content Porter to trigger the export. If I remember rightly, the only subtlety is that if you select a bundle with the Content Porter GUI, you should click again and explicitly choose select children, as by default it does not, meaning the bundle has no items selected.
Take care with where you create your bundle(s) in the blueprint however, typically I create them as low as possible in the BP tree and add the items in from that lowest publication. Content porter will take care that blueprinted items are ported from the correct parent publication, so you don't have to worry about that.
Comment: Indeed, if you already have a spreadsheet with thousands of items, then you need some automation to deal with this current case. However presumably this spreadsheet was created by manual actions - what I am suggesting is instead of recording stuff in Excel in future, you record it in a bundle (either manually or automated)
Comment: yes @will its correct but what if we have already modified pages and component.this process is good when we do initial setup(structuring of organizational item) then only event handler help to note down process(changes in component and pages) else where i don't think it will help..and thanks for  Answer.
Answer: If you're using TCM 2013 SP1, you can use ImportExport API.
Having WebDAV URL or TCM URI of items you want to export, you can execute something like this:
var client = new ImportExportServiceClient();
var selection = new[] { new ItemsSelection(itemsList) };
string processId = client.StartExport(selection, new ExportInstruction());

Each item in the itemsList will be exported (together with their dependencies).
You can also group your items into bundle and export all items in it in one go:
var selection = new[] { new SubtreeSelection(bundleOrSearchFolderId, includeRootContainer: false) };

If you can get all your items as a result of search query (like all items modified yesterday), you can save search folder with that query and export its content the same way as it was done with bundle.
Comment: hey @AntonM thanks,i achived exporting using your post but i have one question when i tried to download pkg using
 var stream1 = client1.DownloadProcessLogFile(processId, false);
 var stream =  client1.DownloadPackage(processId, false);                  so  i am getting """"file not found """exception.but exporting is happening properly.why it is?
Comment: @Pankaj786 that might happen if you don't wait for the export to complete. Package becomes available when process is in Finished state. Here is an example on how to poll the server:
http://tridioninternals.blogspot.nl/2014/01/poll-server-for-process-status.html
Comment: nice work @AntonM...your blogs help me a lot in automating content porting.Thanks you very much...
Comment: i followed your blogs so i am able to automate content porting i am getting export package and import package but ............can we get export and import xml too????.
Answer: There is some code around that can generate the XML that Content Porter uses, it's linked in Nuno's answer here: How can Content Porter be automated to move commonly changed items between environments?
One of our guys (Chris Eccles) used it to make an experimental tool a while ago which creates a Content Porter package, maybe you could do something similar?
Although, since you're on 2013 SP1 maybe the Import-Export service changes your approach somewhat. The later stages of Dom's post here: http://www.indivirtual.nl/blog/sdl-tridions-importexport-api-end-content-porter/ might point you in the right direction.


Does Venus have a north star or south star?

Question: I am  trying to figure out how you would navigate on Venus. On Earth you can use Polaris as a North Star to find north. Would there be a star on the Venus sky which could function as either a north star or south star?
Comment: It seems unlikely that one could see stars from the surface through the perpetual cloud cover.
Comment: @kimholder polaris is our "north star" because of the direction that Earth's axis is pointing. So the question is really "which way does Venus' axis point"? and the answer is that Venus' north star would be at RA=18h11m, Dec=67.16 deg ([Wikipedia](https://en.wikipedia.org/wiki/Venus)). But with a little bit of knowledge of the stars, one does not need a North star to navigate. Especially if one is smart enough to build an airplane.  http://www.astronoo.com/en/articles/axial-tilt-planets.html
Comment: If you were navigating in the sky, in some sort of plane, say, the stars are the same as on Earth. It takes a change in location much larger than the distance from here to anywhere else in the solar system for the stars in the sky to look different. For instance, as Earth moves around the sun over the course of the year, it changes location much more than Venus does, which orbits well inside the orbit of Earth.
Comment: @uhoh - right, i wasn't thinking there at all. Though we are imagining different scenarios - flying blind because your navigation is down.
Comment: related in Astronomy SE: [North Stars of each Solar system planet?](https://astronomy.stackexchange.com/q/41586/7982)
Answer: A pole star for a given planet would be a star that coincidentally just happens to be in the direction that the planet's axis of rotation is pointed. According to Wikipedia, that direction for Venus is RA=18h11m, Dec=67.16 deg.
You can see on the screenshot that the Earth's pole star Polaris is not exactly at the pole position, and if you watched it over centuries or eons you'd see that its always moving around.
An interesting question might be how to do navigation on Venus without a view of the night sky due to the (very) opaque clouds. An antenna large enough to receive radio signals from the Sun, Jupiter, or a variety of bodies outside of the solar system may not be so portable, and the very thick atmosphere would tend to block X-rays and any directional components that might be found in cosmic rays.
However, a robotic solar power plane flying somewhere around 60 - 80 km above the surface where sunlight can recharge its batteries might venture near the darker parts of the terminator to spot some stars and planets for additional location cues (assuming it had an on-board ephemeris). It wouldn't necessarily need a pole star to do this though.

below: Screen shots from a planetarium view at in-the-sky.org, but with a "star" shape added at the approximate position of a hypothetical north or south pole star for Venus.
Edit: But stating which one is which requires some careful definition as was pointed out by @TomSpilker's comment. If you look down at the solar system "from above" and looked at each planet, you'd see that all planets rotate around the Sun in the same direction, counter-clock-wise. The direction of this rotation is called prograde. If you then look at the direction of the rotation of each planet around its own axis you'd see that Venus and Uranus spinning was retrograde.  https://en.wikipedia.org/wiki/Retrograde_and_prograde_motion
So if you use the right hand rule to define a North for each planet, Venus' North points to the same hemisphere as Earth's South. So I've left the plots of the locations of Venus' hypothetical pole stars unlabeled.
Definition of rotation       Axial Tilt
     "retrograde"                2.64°
    right-hand-rule            177.36°

Comment: @Tristan Just saw this post. The polynesians were navigating the Pacific ocean, reliably finding tiny islands hundreds to thousands of km apart, long before the European explorers ventured forth. They did it using multiple references, including stars, but none of those stars were Polaris.
Comment: @Tristan Step back from a Eurocentric point of view for a moment and think of how many civilizations close to the equator and below it (such that viewing polaris was impractical or impossible) did just fine without it.
Comment: This raises an interesting question -- the precise forum for which it is appropriate I don't know, maybe worldbuilding.se?  How would our ability to navigate the earth have developed and evolved if we didn't have a pole star to start with?
Comment: How many of those developed reliable transoceanic navigation capability? (Not a rhetorical question, I am not familiar with the history) -- Celestial navigation (and all the technology derived therefrom) isn't as necessary when you can stay near land, but in the middle of a featureless expanse, it's quite a different story.
Comment: @Tristan stars are also helpful when walking or riding on animals for long distances. I'm no scholar of this either, so as for where to ask, perhaps [History of Science and Math stackexchange](https://hsm.stackexchange.com/) then?
Comment: The question would be applicable to the Southern hemisphere.
Comment: @Tristan cool question. After all my interest in this is partly for world building purposes. I am trying to imagine how a Venus colony would operate. My speculation would be that northern countries like Norway, Netherlands, Britain etc would not have become major maritime powers at various times without it. That again would have affected history of western colonialism.


how to login some other user on facebook in your app?

Question: i am publishing some story on the user's facebook wall in my app. its working fine but i wanna know if some other user wanna login in my app with other facebook account how can he do that. i mean how can i logout an existing user and allow other user to login. my code in AppDelegate is:
<code>     - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
         [self.window addSubview:navigationController.view];
         [self.window makeKeyAndVisible];
         facebook = [[Facebook alloc] initWithAppId:@"app_id"];

         NSArray* permissions =  [[NSArray arrayWithObjects:
                      @"publish_stream", nil] retain];

        [facebook authorize:permissions delegate:self];
     return YES;
 }

   - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {

        return [facebook handleOpenURL:url];
  }
</code>
and my code in DetailViewController is:
<code>  AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

  SBJSON *jsonWriter = [[SBJSON new] autorelease];
  NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                        [sTitle stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"name",
                        [sSummary stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"description",
                        [sLink stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""], @"href", nil];
      NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
      NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                           @"XXX", @"api_key",
                           @"Share on Facebook",  @"user_message_prompt",
                           attachmentStr, @"attachment",
                           nil];

     [appDelegate.facebook dialog:@"stream.publish" andParams:params andDelegate:self];
</code>
once app is installed it asks for username and password for facebook. and then it publishes stories to only that user. what about if i wanna change user in my app. where should i write
<code>   [facebook logout:self];
</code>
Answer: You'll need to provide the options for login/ logout. This post will help you how to do it.


"Could not connect to tor control port"

Question: I installed tor browser bundle for windows on Windows 7, 32 bit.
When I start the tor browser, in 80% of the cases, I get an error with "Could not connect to tor control port". I tried with disabled antivirus and disabled firewall, but that does not help. Because sometimes I can connect, it is likely to be a timing issue.
I used tor browser on the same laptop for years without problems. With version 6 the problems began. Any ideas to solve my problem?
Comment: Nothing in the antivirus, firewall or windows application event logs?
Comment: Try a different control port number - something may be using it already on your PC
Comment: Run firefox.exe from the following location: \PATH\Tor Browser\Browser\firefox.exe It worked for me.
Answer: UPDATE 2018: This appears to be a popular question so I edited my answer. I put all the solutions I could think of at the beginning of this post.
You must have made sure your firewall etc. are allowing access to 127.0.0.1:9150 and 127.0.0.1:9151 which are Tor's SOCKS and control ports. I assume you haven't modified your torrrc file. By the way, I also have 32-bit Windows 7.
Try doing strange things with tor.exe, like starting two different versions (or two copies of the same version) of the program at the same time suddenly terminating the TBB process tree and running it again, disconnecting (or switching) the network while Tor Launcher is loading, use Sysinternals Process Explorer or some other utility to suspend tor.exe, forcably closing the TCP/IP connections tor makes, click Run as Administrator before launching TBB, maybe even log out of the system while Tor Launcher is loading (and failing)... You never know which one will fix the problem. Execution order is not predictable.
But don't change Firefox, proxy or pluggable transport settings. That won't help.
As a last resort, delete the Browser\TorBrowser\Data folder and try reinstalling Tor Browser. Then start it again, choose network settings that appear on the screen and wait about 5 minutes while it connects to the Tor Network. Then "Welcome To Tor Browser" should display in the Tor Browser window.
If you have bookmarks, preferences or other stuff that you want to backup, maybe you should use FEBE from Firefox Add-ons. It will work for now (until Firefox 59 ESR comes to Tor Browser). This Mozilla Support page shows you where your things are stored on your computer.

I ran into this question (once again) two days ago after I was also getting the same error the OP got (except this time in 100% of the cases).
I tested Tor Browser versions 7.5 and 6.0.5 on Windows 32-bit and they both had this problem. After I got "Could not connect to Tor control port", they both proceeded to state "Waiting for Tor to start...". It can't detect the Tor process (why not I wonder?), so there are zero messages in the Tor log.
There appears to be a connection to a relay node but it's state is ESTABLISHED and not LISTENING. The main firefox process is waiting for Tor so the whole thing is stuck.
Standalone Tor works normally. Then I tried to run 6.0.5 while 7.5 is stuck and then I get the same problem as described in this question (The picture and the second paragraph). If I close 7.5, 6.0.5 finally opens the Tor Network settings. I then connect directly to the Tor network, it is connecting slowly... and finally loads. When I closed 6.0.5 and attempted to start 7.5, now it starts.

The Tor Project developers do a great job in testing TBB for the real world, but occasionally, no matter how streamlined the error detection system of a program is, some external conditions will still slip past it and cause problems such as yours and mine. A random error condition can be solved by doing random things such as those I have described above.
Keep that in mind the next time you have some obscure software problem.
Answer: The issue is the one I describe here. If I get a more precise solution, I shall update the comment.
MAC OSX 10.12 Sierra -TOR cannot connect to control port mac os sierra fix
Answer: I have managed to fix this issue by disabling Windows Firewall,
for all 3 profiles - "Private", "Work", "Domain".
Those of us who use a third-party firewall forget to disable the native Windows
Firewall which continues to run side-by-side with the third-party firewall.
So, check for Windows Firewall to be disabled even if you have already installed another Firewall.
To open the Windows Firewall settings, press on your keyboard "WIN + R" to open the "Run" window,
then type "wf.msc" and press ENTER.
(wf.msc = windows firewall microsoft console)
This issue with Tor happens because all other non-Microsoft firewalls usually ask the user to accept/deny unknown connections, but Windows Firewall sometimes decides instead of you to deny some connections, without even asking, so that was preventing the Tor Browser from connecting to the Tor control port in my case.
so, I have installed a third-party firewall instead of Windows Firewall and disabled Windows Firewall and now Tor works fine.

"Could not connect to tor control port"


How do I view the blazemeter sense report when I run the jmx script via the terminal or Jenkins?

Question: Recently added the blazemeter sense uploader plugin for reporting purposes and it is really nice. Post running the script, you get a sense.jtl file and a url to view the reports on the browser with valid authentication. Please suggest how to view the blazemeter sense report when I run the jmx script via the terminal or Jenkins?
Answer: If you're running Linux you can use grep command to fetch the URL from jmeter.log file like:
grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*/gui/[0-9]*/" jmeter.log | head -1

As a result it will produce URL to the results page like:
https://sense.blazemeter.com/gui/123456/

Which can be used for publishing as a build artifact in a form of HTML page, from Jenkins pipeline perspective it would be something like:
sh "cat > sense.html <<'EOF'\n" +
                                "" +
                                "\n" +
                                "https://sense.blazemeter.com/gui/123456/\n" +
                                "\n" +
                                " "

And then publish the generated HTML file to the Jenkins dashboard like:
step([$class: 'ArtifactArchiver', allowEmptyArchive: true, artifacts: 'sense.html', fingerprint: true, latestOnly: true])

Comment: If I'm using windows then?


Serialized transaction bigger than the actual transaction object? CVE-2013-4627

Question: I'm surveying old Bitcoin DoS vectors and came across CVE-2013-4267, for which there appears to be little public information available. This thread should shed some light on this CVE.
There's a description in this blog post:

Transactions are also first deserialized in order to be parsed, but they are stored "as is" in a temporary cache called MapRelay, and forwarded without being serialized again. I really don't know why this is done. But the point is that the storage of messages as they are received leads to the possibility that an attacker creates messages much bigger than the actual transaction object contained, which, when stored in MapRelay memory, can be used to exhaust the memory of a node.

There is also this relevant thread which appears to say the network was under attack using this vector.
Based on the transaction serialization and deserialization code in ~v0.8.2, it looks like the attack may have been: add large amount of random data at the end of a valid serialized transaction. The deserializer finds what it looks for (the valid blob prefix), but appears to ignore what comes after. If a serialized transaction with random data at the end of the transaction is sent to the victim node, it will be deserialized, passed to the mem-pool and then placed in mapRelay in its full size (and then possibly forwarded further, which seems like a pretty powerful attack vector).
So: was the attack described by CVE-2013-4267 based on adding random data at the end of (valid) serialized transaction data?
Answer: Yes. The attack was adding junk to the end of otherwise valid transactions to cause the junk to get relayed around. (as an aside, if we hadn't fixed that, segwit would have been easier to deploy...)
Comment: Well, any fix was going to have to refuse to relay data that couldn't be validated.
Comment: Interesting. Was it (in hindsight) fixed in a bad way, too rigid perhaps? Would a less hastily fix perhaps allowed for more forward-compatible flexibility?


How does someone topologically prove that a function is analytic on some curve

Question: Let us say for the sake of an example, that I want to evaluate $\int_\gamma \! \frac{1}{z-5} \,$ where $|\gamma| = 2$. I know that this integral gives me zero which means that the function $f(z) = \frac{1}{z-5}$ is analytic on the circle $\gamma$ but how do you prove this fact? I am boggled down by the geometry a little bit, $z=5$ lies outside of the circle $\gamma$.
Comment: Are you referring to Morera's theorem?
Answer: Do you mean that the function $f(z)$ is analytic in the circle $|z|=2$? We normally say that a function is holomorphic in a domain, rather than over a curve or path.
To prove that a function is holomorphic in a domain (here we are looking at $\mathbb{C}-{5}$), sometimes it helps to look at first principles and to calculate the derivative
$$f'(z) = \lim_{z\rightarrow z_0} \frac{f(z)-f(z_0)}{z-z_0}$$
Domains where the derivative exists are areas where the function is holomorphic (and therefore analytic) over them.
Answer: In general, polynomials, rational functions away from their zeros, compositions of elementary functions and analytic-looking functions are analytic. For a proof, certainly taking the derivative may be the best way to go; you can also claim that since the second partials of the function $f(z)$ are continuous away from the point $z = 5$, and since the Cauchy-Riemann equations are satisfied, it must be analytic (i.e. holomorphic). Note that neither of these conditions alone implies analyticity, though they can be relaxed slightly (I think you only really need continuity of the function, and I think there's a proof in the case where $f$ is only bounded).
What I wanted to say was that $\oint f dz = 0$ does not imply analyticity! It must be true on every closed (Jordan) curve, or at least on triangles or rectangles (as Alex said, Morera's theorem).


What is the result of boiling beer?

Question: Recently, I had seen a video where a Coke was boiled, and end result was tar like substance.  I am just curious to know if anyone has tried boiling beer, and what is the result?
Answer: Well, I never tried such an heresy, but theoretically you will end up with some kind of syrup (or broth, I really don't know the most appropriate word in english for it), thick, and more or less sweet depending on the beer you use. Some beers have more residual sugars than other ones.
Alcohol will be the first to evaporate, then water, which is basically the majority of beers composition, in volume, leaving behind sugars and proteins, basically. Those last compounds can be modified or merged, as well, I can't say. Then, depending on the beer's malt bill (pale, crystal, caramelized, roasted, smoked, etc), you might get different flavors related to it. I don't know what would happen to hop compounds when boiled for a long time, but you'll probably still get some bitterness from them.
You know what, you question got me curious about how it would taste at the end. =P
Comment: I think in some dishes, beer powder might actually be really tasty. Now there's an idea!
Comment: Maillard reaction, my friends. Bolied beer will taste more bready, cracker-like etc. And if it's high on sugar, it will end up with more caramel in it. Both are actually good in hot winter beer or in cooking.
Comment: @PieBie Dizzy Pig Barbecue Company makes an IPA rub that's pretty tasty. Not a beer powder exactly (ground hops are used), but evidence to support the general concept.
Answer: Beer reductions can make very good sauces.  For more flavor you go with darker beers, but you apparently want to shy away from using hoppy beers because the bitterness can become rather harsh.  Just punch in something like "beer reduction" into your favorite search engine.
Comment: You can make a tasty beef stew with Guinness, or any IPA type beer.
Answer: Beer will evaporate down when boiled. During this it will become thicker. The alcohol will evaporate the quickest, then the water. Caramelization (Maillard reaction) will occur. The bitterness will NOT evaporate, making the bitterness more concentrated.
However; boiling wort is "required" to make beer and excessive boiling is used in some styles to give it extra flavours and colours or to make the resulting beer stronger.
Answer: Technically if you could reduce the water but not the alcohol you would then have a hard liquor. If you could later re-add carbonated water then you would have beer again.  It would likely loose some original flavor along the way.

What is the result of boiling beer?


Since there are gravitational lenses, are there gravitational mirrors?

Question: Gravitational lensing is an observed phenomenon. Can one have a gravitational mirror?
A slightly unrelated question: Can gravitational waves be reflected?
Comment: As far as I know gravitational lensing refers to the lensing of _light waves_, so in an analogous way a gravitational mirror would reflect light waves, and not gravitational waves.
Answer:
Can one have gravitational mirror?

Gravitational lensing phenomena are due to light deflection, i.e. the change in direction of a light beam, analogous to refraction by ordinary materials but, for building a decent "gravitational mirror" you would need a different phenomena: reflection.
Reflection in an ordinary mirror happens because electrons in the atoms of a metal layer on the back surface of the mirror, absorb and re-emit the photons back. There is no analogous phenomenon due to gravity, but you can think nevertheless of the possibility of a very strong deflection that turns a light beam back to you.
The formula Eddington used during the famous solar eclipse of 1919 for testing GR was first derived by Einstein. He departed from the assumption of having a nearly flat metric, a slightly perturbed version of the flat metric $\eta_{\mu\nu}$ of special relativity:
$$g_{\mu\nu}\approx \eta_{\mu\nu}+h_{\mu\nu}$$
$$\lvert  h_{\mu\nu} \rvert \ll 1$$
He obtained a formula for the deflection angle, in terms of the impact parameter $d$, or minimum distance to the deflecting point mass:
$$\alpha=\frac{4GM}{c^{2}d}$$
Now you can see that the only way to have a 180 degrees refraction, i.e. a quite big $\alpha$ value, is by means of sending a light beam with a very small impact parameter $d$, quite close to the deflecting point mass. That is a problem, not only because then the nearly-flat metric will no longer hold, but also because usual astrophysical objects (stars) are extensive. You need an object that is both very small and very dense, that is, a black hole.
In summary, there is the theoretical possibility of a extreme light deflection, quite close to a black hole, so that a light beam you send happens to come back to you after a 180 degrees deflection. You can name that "mirror" in some sense, but it would not be enough for having a decent, spatially extended image of you.

Can gravitational waves be reflected?

In General Relativity, gravitational waves are supposed to propagate along null geodesics, exactly as light does. That is, you can have deflection of gravitational waves, but again no reflection.

EDIT: You could theoretically send a light beam as close as you want to a sort of point-like black hole without an event horizon, a so-called naked singularity, see here
Comment: Totally speculative here: Light reflects through interaction with conductor electrons, so is there any hint from "heuristic quantum gravity" that light might interact with a graviton in a like way?
Answer: The question has been addressed by a physicist (a respected specialist of quantum optics) Raymond Chiao and his coworkers in several articles, particularly in http://arxiv.org/abs/0903.0661 entitled Do Mirrors for Gravitational Waves Exist?
The first sentence of the abstract claims :

Thin superconducting films are predicted to be highly reflective
  mirrors for gravitational waves at microwave frequencies.

The authors argue specifically that :

The existence of strong mass supercurrents within a superconducting
  film in the presence of a gravitational wave, dubbed the
  "Heisenberg-Coulomb effect," implies the specular reflection of a
  gravitational microwave from a film whose thickness is much less than
  the London penetration depth of the material, in close analogy with
  the electromagnetic case.

The least one can say is the idea is controversial and (paraphrasing a remark one can find in the Editor's note of another article by R.Chiao : https://arxiv.org/abs/0904.3956) if some people find the hypothesis that gravitational waves could be reflected by some superconducting films to be reasonable, others (the concensus?) think it is highly
questionable and possibly inconsistent with the current theory of charged superfluids. Unfortunately I regret I have not enough expertise to point out to any specific conceptual flaw and haven't found any attempt to possibly debunk this theory.
Nevertheless it would be very interesting to know if it is possible to make any connection between the former speculations and the already experimentally demonstrated nonclassical rotational inertia of superfluids, superconductors and Bose Einstein condensates ...
Comment: Yeah I am aware of that article. Unfortunately it is not published in any journal as far as I know, so I am not sure about its correctness.
Comment: I share your doubts (the submission history of the article doesn't inspire confidence either) but it would be better to build or find a precise rebuttal...
Comment: It got published here: [S. J. Minter, K. Wegter-McNelly, R. Y. Chiao: *Do mirrors for gravitational waves exist?* Physica E **42**(3) 234-255 (2010)](https://doi.org/10.1016/j.physe.2009.06.056)
Answer: Gravitational mirrors are possible, but it would be a very unstable mirror. Nonetheless, they are possible.
Just before the event horizon of a black hole, there exists a place called a photon sphere. This orbit is the closest you can get to a black hole without having to accelerate. At this strange place, photons can orbit the black hole. So, theoretically, you can enter this sphere, turn your head to the side, and see the back of your head, because light from the back of your head would go around the black hole and go back to your face.
As I said, though, it would be a very unstable orbit. The slightest perturbation can cause the photons to escape the black hole, or to fall into it.
So there should be a very small chance, a chance close to nothing, where something happens: a perturbation that causes a significant part of the photons in this sphere to escape the black hole, but in a non-diffused way. If you're lucky enough to live to see this happen, the light coming from you could orbit in the photon sphere, turn around, and be released by a perturbation. It could then travel all the way back to you, as if you were looking into a mirror.
That's just science fiction for now, though.
As for mirroring gravitational waves, I'm not sure. I can't say it's impossible, because I don't think anybody has ever tried doing that before. If you were able to reflect gravitational waves, that would be something like gravitational shielding -- that is, antigravity. Antigravity is, as far as I know, not forbidden by the current laws of physics.
Edit - I realized with some thought, it is possible to "reflect" light around a curved spacetime. However, the curvature must be large over a large distance. This will not tend to distort light -- the downside being, light has to travel a large distance first, and so it will take a long time for you to be able to see your "reflection."
Consider a system of many Sun-sized stars. If you shine a light on it at just the right angle, it will deflect. If there is another faraway star to "receive" this deflected light, the light will deflect again. If you compoud this process many times, you will be able to get a full 180 degree "reflection" of light, without distorting the image. I'd assume it might take years for the original beam to make its way back to you, though.
Comment: Since gravitational lense bends light by a gravitational field, by gravitational mirror I meant reflecting light by a gravitational field
Comment: I think reading your comment I get the answer to the gravitational mirror question. I now realize that this would require spacetime with high degree of curvature to reflect light which exists only inside a blackhole
Comment: That's not exactly right, either. Inside a black hole, you cannot "mirror" light. The spacetime curvature you're looking for is such that if you shine a light, it will follow a curved path that will U-turn back to you. But that kind of curvature would only exist if you were standing at the singularity. But, by the very nature of that same curvature, light cannot leave where it is. It can't, therefore, reach the U-turn point, and cannot be mirrored back.
Comment: @markovchain, no, see the final edit in my answer. There are *naked singularities* without the problems of an event horizon, and thus the U-shaped path is possible.
Comment: As long as light doesn't reach an event horizon, the U is possible or, more precisely, something like an open O (a fat U, if you prefer so)
Comment: @EduardoGuerrasValera, You're right after all. Your answer gave me another idea though - a similar thing but on a larger scale. I'm not sure if this answer is good enough for the purposes of the question, but I think it should be :)
Answer: Your question can be rephrased in the following way: are there metrics which satisfy the Einstein field equations such that if you existed in it and looked around you, you can see your mirror image?
The answer to this is yes. A simple set of solutions that fits what you are looking for are conical angle deficit solutions, which describe the gravitational field of an infinitely long string. By picking a particularly massive string, you could either have one where the total angle around the string is 180 degrees or 90 degrees (as opposed to 360 degrees if it had mass zero). One half will act like a mirror, except it is split in two halves and your mirror image is in the half opposite to where  you are standing. With 90 degrees you can have a "corner reflector" which would effectively look like two mirrors at right angles to each other.


Why did Solomon Lane still trust Ilsa?

Question: Why does Solomon Lane still trust Ilsa after she helps Hunt in Mission: Impossible - Rogue Nation, lets him escape twice and even brings him an empty drive (which was supposed to contain the red box, of which Hunt's team still had a copy). Why doesn't Lane suspect her and kill her earlier? It seems to me that he put too much trust in her.
Answer: I would say he knows how he can make sure Hunt does exactly what he wants. As we can see in the start of the movie, he kills the IMF agent at the record shop and Hunt chases him as he wanted.
He didn't trust Ilsa but used her to send a message to Hunt. He knew that he can catch her again (and he does) even if he gave her the task to convince Hunt to unlock the drive. and we can see he ordered his men to kill her once the drive was unlocked (as we see in end that Hunt gives him an account number to verify).
Answer: I think he didn't trust her, he just tought she was under control after the failure with the empty drive (which wasn't her fault for being empty), with her being close to the bomb in Benij's body...
Also, this is a mission impossible movie, you should expect these kind of villains who thinks they can control everything agains the unkillable heros...
Comment: The drive being empty may not be directly her fault, but Lane tasked her with bringing the file. Wouldn't Lane take that as failing in the task?

Why did Solomon Lane still trust Ilsa?