Returning permanents from my graveyard

Question: If i have a sorcery or instant or creature ability that allows me to return target permanent to its owners hand, can I use that ability or spell to return permanents from my graveyard
Answer: No, you cannot do that.
Only objects on the battlefield are called permanents. In the graveyard, they are just cards. You can only return cards from the graveyard to the battlefield or to your hand if the spell or ability specifically says "from the graveyard".
Comment: +1 however, I would recommend against using mtgsalvation as a source to link to. They are a nice resource, but I find that their rules sections are often stale when compared to the actual comprehensive rules. You might consider starting with mtgsalvation and then trying to find the same rules quotes in the comprehensive rules text.
Comment: I just wanted to demonstrate that avoiding that wiki is not the only solution. The mtgsalvation link you provided now has the most up-to-date rules.
Comment: I've never noticed that problem with mtgsalvation. Can you give an example of a stale rules article?
Comment: I forget the big one that made me not want to use it as a citation but here is one minor example: http://wiki.mtgsalvation.com/article/Starting_the_game they are clearly citing the innistrad rules (and they say as such). However in 2014 rule 103.4 changed (slightly) http://www.yawgatog.com/resources/rules-changes/dgm-m14/

Returning permanents from my graveyard


How to configure steak with akephalos

Question: Some time ago I have tried to use the thoughtbot version of akephalos
based on this article http://robots.thoughtbot.com/post/1658763359/thoughtbot-and-the-holy-grail, but could not make it work, does anyone have a sample app to show me
how to test with steak, capybara, akephalos. If not is there any app sample with Steak and selenium.
Thanx
Answer: I have written an small app based on the configuration I copied from a rspec test
https://github.com/boriscy/akephalos_steak

How to configure steak with akephalos


How to define Guid for custom field type?

Question:
I have developed in Visual Studio solution that define custom field type for SPList. Everything works fine. After deploy I was able to add my custom column into SPList. SP has created field ID (Guid).

I have noticed that some SP fields has always the same guid, for example blog body: 7662cd2c-f069-4dba-9e35-082cf976e170. It's easy to find column for SPListItem id you know ID.

Question:
Can I define my custom Guid that will be used by SP to set field id in data base?
Answer: The reason the Guid is same for the 'blog body' is because its a site column. Site column is a resuable column definition (based on a type), that can be reused in multiple lists.
If you create a column in a list, that column is local to that list and the Guid will be different from all other columns. If you would like to reuse a certain column (usualy a part of content type), you would create a site column and add the site column to the list/library. In this case no mater where you use the site column in the target site collection, the Guid will be the same.
Note that you cannot set a guid, when creating a site column using UI. But you can control the guid if you are deploying it via code. Look at this for more info.


What is the correct IUPAC name of this compund?

Question:
I thought C=C is the "functional group" here and Br is a substituent so the numbering should start from the top left C, making the name 4-Bromo-3-methylbut-2-ene, but my book says 1-Bromo-2-methylbut-2-ene. Which is correct?
Comment: Overall smaller locators. Not sure as I studied nomenclature long time ago
Answer: According to P-14.4 in Nomenclature of Organic Chemistry: IUPAC Recommendations and Preferred Names 2013 (Blue Book):

P-14.4 Numbering
When several structural features appear in cyclic and acyclic compounds, low locants are assigned to them in the following decreasing order of seniority:
[...]
(e) saturation/unsaturation: [...]
(f) detachable alphabetized prefixes, all considered together in a series of increasing numerical order;
(g) lowest locants for the substituent cited first as a prefix in the name;

In this compound, unsaturation, in the form of the double bond, has the priority for low locants. Since both numbering schemes (shown below) assign the locant '2' to the double bond, criterion (e) is not sufficient for the purposes of deciding between the two options.

However, criterion (f) does allow for a choice to be made. The detachable prefixes in this name are 'bromo' and 'methyl'. Since the locant set (1,2) is lower than the locant set (3,4) (note that both sets are ordered in increasing numerical order as stipulated), the preferred IUPAC name (PIN) will use the locant set (1,2).
Note, however, that your double bond also contains configurational information. According to the Cahn–Ingold–Prelog rules (see P-92 of the Blue Book), the double bond in your molecule as drawn is (E)-configured. Stereodescriptors such as 'E' are cited together with the locant describing the position of the stereogenic unit (see P-91.3).
Hence, the PIN of the molecule as depicted in your question is (2E)-1-bromo-2-methylbut-2-ene.

Note that contrary to existing answers, there is no inherent preference between "bromo" and "methyl" for low locants, unless the application of criterion (f) does not lead to a difference. In that case, criterion (g) must be invoked. Since 'bromo' is earlier than 'methyl' in alphanumerical order, it will be the prefix cited first in the name, and will therefore have priority for a lower locant. For example:
Answer: You are correct that double bond gets preference over halogen. But after that, we seek to give small locant to bromo and methyl. Since in second name, both substituents get smaller locants, it is the correct name.
That is correct name is 1-Bromo-2-methylbut-2-ene
Had the question been this instead:

Then the name would have been 1-Bromo-3-methylbut-2-ene because in this case as orthocresol comments:

The name 1-bromo-3-methylbut-2-ene is preferred over 4-bromo-2-methylbut-2-ene because the locant set (1,3) is lower than the locant set (2,4). Alphabetical order only comes into play when the locant sets are the same.
Comment: Well, the IUPAC nomenclature system is complicated (the 2013 Blue Book has >1,500 pages) and is often taught based on outdated recommendations, or simply taught wrongly. I wouldn't fault you.
Comment: The first part is correct now, but your second part is not quite right: the name 1-bromo-3-methylbut-2-ene is preferred over 4-bromo-2-methylbut-2-ene because the locant set (1,3) is lower than the locant set (2,4). Alphabetical order only comes into play when the locant sets are the same; I have an example in my answer.
Comment: I better stay away from chemistry.
Comment: ortho - Ok so as I understand, this concept of  locant set means all numbers in set $(1,3)$ are lesser than corresponding set $(2,4)$ so there is no confustion. Am i right there
Comment: The numbers must be compared one by one from the first one onwards. Since 1 is smaller than 2, the locant set (1,3) is lower than (2,4). If one were to compare (1,3,5,7) with (1,3,5,8), then the first three numbers would be ties; however, since 7 is smaller than 8, (1,3,5,7) is lower than (1,3,5,8). Similarly (1,5) is lower than (2,3) because 1 is smaller than 2. You can see the link on your other deleted answer for some real life examples (I made up all the above).


How important is humidity when smoking a brisket?

Question: Recipes for smoking brisket typically recommend a temperature of 225 F. My weber smokey mountain has a water pan to help regulate the temperature. But what if I am able to maintain that temperature without a waterpan? Would it cook the same way or is the humidity necessary when smoking brisket?
Comment: Some people will fill the water pan with sand instead of water. Sand also adds thermal mass and doesn't have to be refilled. Cover the pan with foil so the sand doesn't get too grody.
Comment: Crushed brick is also used to stabilize temps without water.
Answer: According to Big Green Eggic, the main effect of the water pan is help keep the heat even and low in the cooker by:

Providing a buffer mass
Not heating above the boiling point (212 F / 100 C)

This makes it easier to hold even, low temperatures (like 225 F) for long, low and slow cooking.
They claim the humidity change is not really terribly important, as water evaporates from the surface of the foods relatively quickly in any case.
The article Physicist Cracks BBQ Mystery in the Huffington Post blog (which is very interesting in its own right) mentions that many successful competition barbequers are choosing to barbecue at slightly higher temperatures, which would make the entire point of the water pan moot.
Comment: I don't agree with everything on amazingribs, but they have some great research pieces including the article you linked about "the stall".  The article you link is also rather "pro" water pan "... But this is no reason to stop using water pans because the moisture in the atmosphere inside the cooking chamber mixes with the smoke, influences flavor, and lets the meat's interior catch up with the exterior so it cooks more uniformly. Water pans also help stabilize the temp in a charcoal fire because it heats and cools slowly and this tends to even out spikes and valleys"
Answer: The water pan does affect humidity in the cooking chamber and therefore, it does change the how quickly moisture evaporates out of the meat.  The question really becomes - "Will the meat be moist enough without the water pan?"  Which, to a degree, is personal preference.  Some choose to not use a water pan and baste instead, some use both and some neither.
I would recommend trial and error.  Brisket is relatively pricey so I would recommend using pork shoulders.  Smoke one with the pan and one without and see if you think the moisture content is satisfactory.  The briskets won't cook exactly the same but the relative moisture level in the shoulders should give you a decent estimate.
I personally always use a water pan, but I don't usually fear meat from a smoker being "too moist", and it does wonders for temperature stabilization.  I also have a larger smoking chamber than a WSM so it's possible that too moist is a larger concern for you.
One last note, while cooking too hot for too long will inevitably dry out your meat, cutting a brisket or shoulder without letting it set for at least an hour (ideally 2) after cooking will also dry it out.


Window switch works when it wants to

Question: I bought an aftermarket window master switch for a Jeep Liberty it works most of the time when it stops working and all I do is unplug it and plug it back in and it works fine for about a week then stops working I unplug it works again for another week Ideas to fix the problem thank you
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: The problem is most likely a galvanic reaction between the metal of the contact in the connector and the metal in the switch, especially if the switch is an aftermarket one (read: Chinesium). When you disconnect the two and put them back together, the interference is broken and the connection is restored ... until there is a new buildup between the two.
If this is the issue, you can most likely cure the issue by using a small jewelers file or possible a small strip of sandpaper where the contacts meet. Sand it to bare metal, the put some dielectric grease (sparingly) where the contacts meet. The dielectric grease should help with the galvanic reaction and allow the electricity to flow unabated.
Answer: Clearly a loose connection in the circuit or switch.
Comment: Thanks but I just want to say it never happened with the old switch I replaced the switch because the button broke, Have had two after markets switches they both do the same if I put the original switch and it's fine
Comment: The fact that you undo it and it then woks would suggest the connection is not perfect-i would clean all connections. Use mutimeter and check each part of the switch circuit.

Window switch works when it wants to


My iPad won't accept my Apple ID password

Question: My new iPad won't accept my Apple ID password. I get a "your Apple ID has been disabled" message. If I go to my laptop everything works fine.  I've logged on and off the iPad, changed my password, pondered to Apple emails, etc., but am at a loss now on how to fix the problem.  Any advice for this new Apple user is appreciated!
Answer: Try signing into find my friends and then signing out.  I know it sounds dumb, but this honestly might work.


Could hidden service connect to regular internet ?

Question: If I run a hidden service on a computer that has a public ip adress and ssh into it, could I connect to the regular internet or all my outbound connections can just be into the tor network ?
Answer: A hidden service does not route all the other traffic on the computer through tor. To do that you need transparent proxying on the server.
So - if you set up a server with tor, create a regular hidden service on port 80, then ssh into it through public IP then do any web requests and such on the server then it will be routed through the regular Internet connection.
All the traffic to\from the tor hidden service port is routed through tor if configured properly.
Also - keep in mind that if the port 80 is bound to anything else then 'localhost' then the hidden web service could be reached through the public ip on the server.
Answer: Yes, all three cases :

Can a HS(Hidden Service) itself connect to clearnet - Yes, in your case it can. Tor is just a transport layer, so after it has forwarded your query to the HS port - like STunnel - Tor's job is done. And if there's a clearnet exit and no firewall rules prohibition - the server implementing the HS service itself can connect to clearnet just like usual.
Can a HS be your tunnel to clearnet if you've connected to it through Tor - Sure! Use OpenVPN in TCP mode, put the VPN server's port as a HS provided via Tor, and release the whole traffic to and/or from clearnet from the host your HS VPN server running at.
Can all the outbound connections be served via Tor - Just a firewall magic : route all the traffic except SSH and Tor via TransPort of Tor. Ssh and tor services' traffic is better separated by user ID/name in iptables at least.
Answer: You can use your computer in a way like you were sitting directly in front of it. What does this mean for your setup? You connect to your computer via Tor and your computer is set up in a a way that all outbound connections are done without Tor. When you now open a connection from your computer to some other website, chat or anything else, this is done without Tor.


Is it practical to get a satellite phone for communication from remote areas?

Question: When going into remote areas, it would be great to be able to communicate with the outside world, for emergency purposes or just to be able to call home on long trips. Is it practical for an average person to obtain and use a satellite phone? In other words, roughly what do they cost to buy or rent, how large are they, and what is the cost to use them to place calls? On what kind of trips would it make sense to consider this option?
Answer: What is practical is up to you, but I can give you some information to help you make up your mind.
Typical rental prices for a satellite phone are $15-$30 a week (According to this site). The cost per minute is in addition to this cost, and is around $0.50-$3 USD a minute. Weight is usually around 400 grams, or just under a pound. Battery life is pretty much comparable to a smart phone, 3 hours talking and 24 on standby.
Comment: More reasonable than I would have thought.
Comment: The new InmarSat iSatPhone Pro claims the battery life is 100 hours standby and 8 hours talking. Calls cost about $1/min to landlines.
Answer: In addition to @Pearsonartphoto's technical specs, it is important to remember that a Sat Phone is one tool at your disposal, and not a replacement for smart decision making, or proper planning. I have seen them provide people with a false sense of security thinking it gives added insurance against making bad decisions.
Like any electronic equipment, sat phones depend on batteries (which don't last all that long), must be kept dry, and can not be depended upon. (Ie, assume it will be broken / dead when you need it.)
I have been required to use sat phones extensively in the back-country as part of my work responsibilities - in both the mountains and canyon country - and they have proved extremely useful, if frustrating. Getting a signal can be challenging and talk time is short (as satellites whizz by above) possibly to the point of miscommunication: ("Hi honey - I'm ....." "Oh my! what's wrong? Did she break her leg? Why was she cut off?!? Panic!")
All that being said, having a sat phone saved at least one life I was responsible for.
Answer: You're almost certainly going at this the wrong way.  For something like this you want a Garmin inReach unit--the costs are a lot lower.  They only give you text messaging, no voice communications.
There are also the SPOT units, I'm not sure about their messaging capability.  There are also some smaller players now entering the game, I don't know the details.
Finally, purely for emergency use there are personal locator beacons.  They have no messaging capability, when triggered they send out a generic HELP!  The advantage is there is no monthly cost.  (Although you do need to replace or refurbish your beacon every 5 years.)
Comment: While I also use an inReach, you cannot say the OP is going about it wrong since he specifically asked about calling home on long trips. Maybe he would be OK with texting if he had a plan that allowed for enough of those, but that isn't what he asked about. My wife is fine with the generic "I'm OK" text each night. Of course, 7 years ago, the satellite messengers were not as good either.


What are some permanent shower shelf options?

Question: I have found shower caddies and suction cup add-ons, but I want to add shelves to my shower surround that are permanent.  I haven't had much lucking finding anything.  What are my options, and where do I get them?
Answer: Buy/find/scrape up a small piece of corian. I'll bet you might find something online, or even better, go to a countertop maker in your area. They will surely have some scraps that you can take off their hands for a small fee. A square foot piece is scrap to them, so they might as well make a few dollars extra from it.
Cut into a triangular shape, to fit into a corner of the shower. You might also choose a quarter quadrant of a circle as the shape. The nice thing about corian is it works well with saws, routers, hand saws, files, etc. And you can sand the edges smooth, even to a glossy finish. Make a pair of blocks from the same corian, 1 inch high, and as long as the edges of your triangular shape. These will be supports for the shelf.
Now, glue the supports to the wall of the stall, using a high quality silicon as an adhesive. Angle the shelf just slightly down, so that any water on it will drain properly, but not enough so that something placed on it will freely slide off. Glue down the shelf with the same silicon to the supports and to the wall.
Comment: Not as friendly on the tools, but I've also seen triangles of 12x12 or larger tile used -- they trimmed a little off the bottom of the two tiles going in on the wall there, and just slotted the triangle in the gap.  (I'm not sure if all tiles would be rated for this ... I want to say it was a cut stone, like marble, but it was a hotel bathroom, and I can't even remember where or when I saw it)
Comment: I'm sure that marble would work nicely here. The only problem with this general idea (corian, marble, etc.) is if the enclosure walls are too flexible. Flexing behind the glued on shelf will cause the glue to peel away before long.
Comment: You could also cut the point out, and angle the shelf downwards in that direction for drainage. (i.e. towards the corner)
Answer: I have found a couple of places that sell items that look promising.
http://www.universalplastics.com/store
http://www.caddycoinc.com
Answer: I guess this depends on the material in your shower surround.  If it is anything "hard" - tiles, hard panels, whatever... then I would go with corner shelving.  If you have tile they usually recommend installing with construction adhesive and then caulking.  If you have panels sometimes it is construction adhesive and sometimes it is epoxy.  These are very easy to put up (however if you need to buy the epoxy it is sometimes hard to find).


Indentaion in inferior-python-mode

Question: In Python mode (python.el), I am in the habit of hitting C-j to return and indent properly. However, when I am in an inferior python buffer, this command only inserts a newline and does not indent. Is there any way to get the inferior-python-mode to work more like python-mode in this respect, or maybe even set up auto-indent the way it normally works in ipython? I have read through the documentation for inferior-python-mode, but can't find anything useful. I love using Emacs for Python, but there are a few pain points, and I am having trouble finding good documentation. Thanks in advance for any advice!
Answer: The problem is that newline-and-indent (the function that C-j is bound to) inserts a literal newline then whatever would be inserted by TAB. What you want is to send the current input:
(defun send-input-and-indent ()
  (interactive)
  (comint-send-input)
  (indent-for-tab-command))

Next, bind send-input-and-indent to C-j only when in inferior-python-mode:
(define-key inferior-python-mode-map (kbd "C-j") 'send-input-and-indent)

Put both snippets in your initialization file and you're good to go.

Indentaion in inferior-python-mode


Windows Mobile 6.1: Can't access internal site via https

Question: Whe have several Motorola Symbols (don't remember the exact model) running Windows Mobile 6.1  They are used for entering data in the field, and then at the end of shift the employees come in and "sync" them via an application which utilizes web services.  We recently renewed our SSL certificate, and since then we've been unable to get them to sync over https.
Since the application wasn't giving good error message, I decided to see if I could load the page in IE which produces one of three error sitations (and it appears to be device dependant which one you get):

Some hand helds just display a gray box (i.e. they don't load anything)
some return a message saying "Cannot find 'https://<server>/<dir>/<file>' Make sure the path or Internet address is correct."
finally some say "The page cannot be displayed because the Web site cannot be authenticated."

In trying to understand the situation better, I've noticed that:

If I change https to http, they can always load the page
If I revert to the old certificate, they work
We renewed three certificates all with a new CA; if I try one of the other two it works

the problem server is running IIS 6 under Windows Server 2003 Standard edition Service Pack 2
Working server 1 is running IIS 6 under Windows Server 2003 Standard Edition Service Pack 2
Working Server 2 is running IIS 7 under Windows Server 2008 R2 Standard Service Pack 1

There is an intermediate certificates

on both the 2003 boxes (haven't checked the 2008), the intermediate certificate does appear the Certificate (Local Computer) -> Intermediate Certification Authorities\certificates in the Certificates MMC Snapin
openssl s_client -connect <server>:<port> -CAfile root.crt indicates the intermediate is installed properly
It appears to work fine on other devices; but I've only done limited testing
Under IE 7, Firefox 4/5 we receive no errors (tested under Windows 7)
Under Firefox 3.5 we receive no errors (tested under the newest Ubuntu)
Looking at the logs, I don't see any entries from the mobile units (although this is problematic as the server is really busy this time of year, so I could have missed them)
In double checking the supported cipher suites, the working 2003 server has been secured (it passes PCI scans), so its supports fewer cipher suites than the non-working server, so I don't think its a cipher suite issue.
Finally, I have tried to manually compare the certificates
CNAMES, serial numbers, etc are obviously different
On the two which work they have Object Identifier (2 5 4 9) = 154 W 12th Avenue where as the one which doesn't work has Object Identifier (2 5 4 9) = LEAVE_THIS_FIELD_BLANK  (the reason is we have a centeral group which actually submits/approves them and the centeral group is supposed to replace that text with the correct street address.  Obviously they missed it.)
If you think its a problem, I can fairly easily have the certificate re-issued; I just hate to do it unecessarily.
(Edit) Also, I've hooked up a laptop the same way the handhelds connect and can connect just fine; thus I don't think its a networking issue.

I would greatly appreciate any suggestions on how to proceede.  I think at this point my options are:

Match the ciphers suites so they are identical (I doubt it will help, but the more apples to apples the better)
Ask for the certificate to be re-issued with a correct address
Move the webservices the hand helds use to communicate to one of the two servers they do work with (undersireable as they are open to the world where as the non-working server is only open to our WAN network; it could work short term)
Answer: Reissuring the certificate appears to have resolved the issue.
We corrected the address issue.  I also ended up generating a new private key, but I can't see how that's related as both should be 2048 bits.


Sudden graphical glitches in wine

Question: I have been using Ubuntu since 9.10 and have always gamed in wine without an issue. I have been running 12.04 since its release and have been playing the Sims3 and Wow in Ubuntu flawlessly. However I recently upgraded my video card from a Radeon HD 6850 to a HD7870, when I did the upgrade I reformatted and reinstalled Ubuntu 12.04 with the version of fglrx available through jockey. Now when I run games in wine they still play OK and 90% of the graphics are there, but not all. For example in the Sims3 everything renders just fine except the trees, they render as green cubes with the texture displaying as a flat image protruding from the center. There is a screen shot below.

Wow isn't any better, flags and banners in the game just display as large textured rectangles, however Wow is so bad it wont even load completely into the game, but the errors are evident on the character select screen.
I am not sure what to do, I had both of these games running fine with the same fglrx version just a few weeks ago, and now they do not work properly. I know its not a hardware issue seeing how all these games run flawlessly in windows, If I can get 50-60 FPS in BF3 on Ultra, then I think the card is OK.
I attempted to install the (Post release updates) version of fglrx but it fails every time (seems to be a know issue, so its not just me.) I installed "fglrx-updates" and the corresponding amdcccle package through synaptic, and it broke my system, so I had to remove them and revert back to the open source driver. Lastly I attempted to install the latest driver from the AMD website, it installed with no errors however once I restarted I was still using the open source driver and the catalyst control center was nowhere to be found even though the software center claimed that it was installed.
I am out of ideas, any help would be very appreciated. Thank you.
Answer: Problem solved. I tried for a second time to follow the guide here and this time it worked. I'm now at Catalyst 12.8 and everything is running just fine.

Sudden graphical glitches in wine


"Yeah Right" expression

Question: Where does "Yeah right" come from? Can it be used in a formal writing? If not, what is a good alternative?
Comment: @kiamlaluno - I think this one is different. See @Robusto's answer below.
Comment: possible duplicate of ["Yes", "Yeah", "Yep"](http://english.stackexchange.com/questions/1954/yes-yeah-yep)
Answer: "Yeah, right!" is an example of irony. Irony is the use of a word or phrase to mean exactly the opposite of its literal sense. Here it would also qualify as sarcasm. It would be understood to mean "No f@$*ing way!"
You would definitely not use it in formal writing, unless that composition was a treatise on slang or some other academic discourse on language.
Comment: Yes, a lot would depend on intonation. But if you detect any sarcasm at all — and that is a very subjective thing, involving tone of voice, facial expression, etc. — it is most likely being used in the negative sense.
Comment: Nice answer. But is it always irony though? Sometimes I say "yeah, right!" when I genuinely meant to agree with something that the other person said. Can I be misinterpreted?
Answer: There's also a joke (that as far as I know can be applied to other languages as well with similar constructions; the Greek equivalent «Ναι, καλά» comes to mind for some strange reason :) where the teacher explains that there are times and languages where a double-negative has positive meaning ("Can't say I didn't see you") or it can keep a negative meaning ("Haven't done nothin!"), but there is no known case of a double-positive having a negative meaning, at which point the smart-alec of the class says:
"Yeah, right."
Answer: Alternative in formal writing could be
I strongly disbelieve that statement
or
Our company plans to take over facebook medio 2011
You: "That sounds inconceivable"
Answer:
Yeah, right

could also be interpreted as another variation of

I know, right?

It entirely depends on inflection when speaking.  When written, if the ending punctuation is an exclamation

Yeah, right!

you could infer the meaning to be ironic, whereas if the ending punctuation was a question mark

Yeah, right?

you could infer the acceptance-seeking meaning.
Regardless, neither is appropriate for formal writing.

"Yeah Right" expression


UIView Animation for ImageView in ios

Question: i Have requirement were i have to animate image view from current position to full screen in grid view. i made images into Grid view.
- (void)viewDidLoad
{
    [super viewDidLoad];

    imagesArray = [[NSMutableArray alloc] init];
    for (int i=1; i<11; i++) {

        [imagesArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image%d.png", i]]];
        NSLog(@"imagesArray:%@", imagesArray);
    }

    float horizontal = 20.0;
    float vertical = 20.0;

    for(int i=0; i<[imagesArray count]; i++)
    {
        if((i%3) == 0 && i!=0)
        {
            horizontal = 20.0;
            vertical = vertical + 220.00 + 20.0;
        }

        imagesView = [[UIImageView alloc] initWithFrame:CGRectMake(horizontal, vertical, 310.0, 220.00)];
        imagesView.userInteractionEnabled = YES;
        [imagesView setImage:[imagesArray objectAtIndex:i]];
        imagesView.tag = i;

        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
        tap.numberOfTapsRequired = 1;
        tap.numberOfTouchesRequired = 1;

        [imagesView addGestureRecognizer:tap];

        [self.view addSubview:imagesView];
        horizontal = horizontal + 310.0 + 20.0;
      }

}

here i have created grid view with images, like i have 10 images. i made 3x3 grid view.
next i have add tap gesture to it and i am getting the image view position by calling with tag
-(void)handleTap:(UITapGestureRecognizer *)recognizer
{
        UIView *piece = recognizer.view;

        [UIView animateWithDuration:1.0 animations:^{
            piece.frame = CGRectMake(piece.frame.origin.x, piece.frame.origin.y, 1000, 700);

        } completion:^(BOOL finished) {

    }];

    }

Can you say me how to make image view animate from current position to full screen by tapping on it.
Answer: Since you're adding the views to self.view of your view controller, you can assume that self.view is occupying the entire screen of the device. Therefore, you can animate to its bounds:
[UIView animateWithDuration:1.0 animations:^{
    piece.frame = self.view.bounds;
} completion:nil];

Note that if piece must have a parent view that spans across the entire screen so that your inner view won't be clipped during animation.
Comment: how to apply padding say 100px around the image on all sides
Comment: You can use `CGRectInset`: `piece.frame = CGRectInset(self.view.bounds, 100, 100);`
Answer: This code will help u to add the animation effect like zoom your imageview that your are expecting. You need to customize once the animation is over show the full screen image view.
-(void)addZoomAnimationToZoomViewController:(UIImageView *)zoomView
{
    CABasicAnimation *zoomAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
    [zoomAnimation setDuration:0.8];
    [zoomAnimation setRepeatCount:1];
    [zoomAnimation setFromValue: [NSNumber numberWithFloat:0.1]];
    [zoomAnimation setToValue: [NSNumber numberWithFloat:5.0] ];
    [zoomAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [[zoomView layer] addAnimation:zoomAnimation forKey:@"zoom"];
}

UIView Animation for ImageView in ios


What alternatives are there to the existing Certificate Authority system for SSL?

Question: Whilst the current CA system works very well for a lot of people, it does put a lot of power into individual CAs' hands, and makes a CA hack potentially devastating for customers and business. What alternatives are there to certificate authorities, and what are the challenges in switching to such systems? I've seen proposals for a variety of distributed P2P-like systems, but nothing has ever come of them.
Comment: [Dot-Bit](http://dot-bit.org) is an open-source distributed DNS system based on [Namecoin](http://namecoin.info) (a Bitcoin derivate). There is a working TLS plugin for Firefox (early stage but working for encryption and authentication). It is completely independent from CAs and relies solely on algorithms and a blockchain.
Comment: it's here btw: http://dot-bit.org/forum/viewtopic.php?p=3054
Comment: I totally agree with the fact that it puts a lot of power into individual certificate authorities' hands which is an important problem for those who work on projects against governments and corporations' interests.
Comment: Namecoin is a DNS registrar. It does not encrypt websites.
Answer: "Alternatives" depend on whether you want something which may work in the future, or something which works right now, with existing browsers.
Right now, Web browsers expect that servers send X.509 certificates, and then they validate them against the set of root CA integrated in the browser (or operating system). This means that if you want something that works without any extra software installation, then all you can do is alter the set of root CA (your trust anchors). You can:

Remove some of the CA (it has been said that you can remove most of them without really impacting your browsing experience, because not all trusted CA are equally active).
Add new trust anchors. Note that a trust anchor is "a name-and-public-key that you trust a priori". Trust anchors are usually encoded as certificates (because the format is convenient for that), and traditionally are self-signed (mostly because in a certificate, there is a field for a "signature" which cannot be left empty). But you can trust certificates which are not self-signed; you can even trust end-entity certificates (i.e. you trust the specific certificate of a given SSL server: this is called direct trust). With direct trust, you manually manage what you trust with very fine granularity. Note that, with direct trust, you lose the benefits of revocation (a directly trusted certificate cannot be untrusted except by a manual intervention on your part, whereas revocation is about propagating mistrust information automatically).

(One can note that the direct trust model is exactly what SSH follows, and it works well in the usage context of SSH.)
In the future, there could be other models. There are several proposals, some being backed by existing software add-ons. To my knowledge, none has reached the "generally usable" level yet. There are, for instance:

DNSSEC and DANE: DNSSEC is about mapping a PKI on the DNS system, primarily so as to authenticate the data returned by the DNS itself, but this can be leverage to distribute SSL server keys (what DANE is about). This is still a hierarchical PKI, with a limited set of trust anchors; the difference with the existing set of root CA is mostly a change of players: the new set of gatekeepers would be smaller, and only partially overlaps with existing root CA. Also, DNSSEC/DANE binds the process of authenticating Web servers to the DNS infrastructure and actors, and it is not clear whether this is good or bad.
A Web of Trust like OpenPGP does. The WoT model relies on graph superconnectivity. To keep things simple, with a WoT everybody is a CA, and each actor is its own and unique root CA; to cope with gullible or downright malicious "CA", WoT users (i.e. Web browsers) accept a target certificate as valid only if they can verify it through many paths which go through distinct CA and all concur to posit the target server key. The decentralized nature of WoT is very popular among people who distrust governments and anything which looks like an administration. However, WoT security is very dependent on critical mass: it will not give you much until sufficiently many people collaborate. See the Monkeysphere project for an implementation (with browser add-ons)(I don't know much about the project quality, though).
Convergence is a descendant of the Perspectives project. If you get down to it, Convergence relies on Hope and Laziness. What Convergence assumes is that wannabe attackers will find it too hard / expensive / tiresome to actively impersonate a given server with a fake certificate for both a long time and in the view of many people. Namely, practical Man-in-the-Middle attacks are either close to the victim (e.g. users of a given WiFi hotspot), in which case they impact only very few people, or close to the server, which requires something wide-scale (like heavy DNS poisoning) which will be quite conspicuous, hence will not last long. Under this model, Convergence is a nice, relatively inexpensive solution, with only minimal centralization (it still requires notaries, and de facto centralization can be expected, but not as thorough as the current set of root CA).

An important point is that the current system "works". Actual attacks which target the PKI are very rare (much publicized, but still rare). The actual system with roots CA is sufficiently hard to break that attackers find it easier to bypass it through some other ways (foremost of which being abusing the credulity of human users). As such, there is little incentive for replacing it with another system which, at best, will do the same. So, while the alternate proposals have some merit (mostly in financial and political terms), I deem it relatively improbable that any of them dislodges the existing root CA in the near future, for "the Web" as we know it.
For closed architectures which are not the Web, and where you control both client and server, you can use whatever system you want, but closed architecture are precisely the situation where hierarchical PKI work very well.
Answer: One alternative is DANE/TLSA, which is a RFC standard that allows self signed keys in DNS.
One of the challenges is that this is very new and most client software doesn't yet support it. (Chrome being a new addition)  In addition DNS is subject to various attacks, especially on WiFi networks and the like.
One way to remedy the DNS attack is to use DNSSec, and to ensure the client software will only use DNSSec for domains that offer it.  If this latter feature doesn't exist then that would open users up to an SSL-strip type of vulnerability.
Comment: @Bruno - See Thomas Pornin's answer `the difference with the existing set of root CA is mostly a change of players: the new set of gatekeepers would be smaller, and only partially overlaps with existing root CA.`
Comment: [Adam Langley wrote a blog entry about DANE deployment in Chrome](http://www.imperialviolet.org/2012/10/20/dane-stapled-certificates.html)
Comment: @CodesInChaos That is fresh / great news only a few weeks old.  Thanks! I'll be sure to be experimenting with this soon
Comment: Isn't DNSSEC ultimately very centralised, thereby being similar to having one big top CA (possibly with a number of sub-CAs)?
Answer: SSL also supports Secure Remote Password (SRP).  This is where you authenticate using a password instead of a certificate.  Too bad Browsers don't support it.
There is also Convergence which is a drop in replacement for the CA/PKI system.  In theory you could use a self-signed certificate and still defend your self against MITM attacks.  It also provides protection against rogue CAs.
Comment: Do you know convergence-type solutions for other browsers? Last I checked it was Firefox only.
Comment: @makerofthings7 not that I know of.
Answer: It's worth pointing out that the chain-of-trust concept isn't itself any more or less vulnerable than web-of-trust, shared-secret or any other mechanism if implemented at the same scale as our current PKI.
The primary problem is the proliferation of trusted CAs as well as the lack of differentiation between CAs for trust purposes. For application-specific use-cases (i.e. not web browser), you can work around this and create a very solid and very trustworthy private PKI. Since SSL/TLS implementations allow you to specify your own trust roots, there's no reason why you have to included the popular CA lists provided by Mozilla and Microsoft. In fact, if you're not using a browser, then there's little reason why you should include the global CA list and plenty of reasons why you shouldn't. If you're the only CA, then your attack surface is significantly limited (as Microsoft recently learned).
As for the browser PKI, a more ideal solution would be to create segmented TLDs by trust category (e.g. <code>*.bank</code> for financial institutions, etc.) and most importantly limit CA authority to only a given TLD. That way the Hong Kong Post Office can no longer sign for Paypal or Google.
But since the current technology is effectively set in stone by popular use, the chance of this or any other alternate security infrastructure becoming mainstream is effectively zero.
Comment: The fact that CAs for EV certs are hard-coded into browser partly removes this ability to configure the CAs you want unfortunately.
Comment: @Bruno True, but IIRC it's the fingerprint that's hard-coded, not the certificate itself. So if you remove it from your trust list, then certs it signs still won't be trusted, even though they would otherwise qualify as EV.


What are the best methods you have found for attaching filters to unthreaded lens tubes?

Question: This one is for the resident mad scientists. I think the MagFilter is a pretty neat concept. Being more interested in other filters, though, I'd like to hear about methods other people have used to attach filters to the front of compact camera (or other smooth, unthreaded) lens tubes. In particular, methods that allow for reasonably easy on/off, and don't compromise the pocketability of the camera or filters. I'll eventually get around to posting the method I've used in the past (it's hard to describe without images), but I'm hoping to collect some other, possibly better, ideas here.
Answer: I literally just hold up the filter to the lens and take the picture. I'm too cheap to buy multiple sets of filters for both my DSLR and compact cameras, so I buy one larger set for the DSLR lenses and use that all the way around.  I've done the same thing with my smartphone and my DSLR filters too.
Comment: I can't tell you how many times I've done that with the powershot I have. Haven't tried it on a cellphone though..
Comment: I do this for the odd polarizer shot (out train/plane windows, etc) but it doesn't work well for long exposures with an ND filter or using close-up filters on tiny electrical components. :)
Answer: I've had attachments that slip-fit over a smooth outside cylinder.  Especially in a compact camera, the base of the lens is a plain cylinder that is wider than the extended lens.
I saw some dyi ringflash plans that used a split piece of pvc pipe, where the original pipe was a bit smaller than the lens barrel to slip over. Opened to fit around the lens, it makes a C shape, and two were glued together to make a pvc ring of the desired size from a pipe of a different size.
You can fasten a base to the tripod mount that extends in front of the camera, and mount other things on that. If "close up filter" you mean a macro lens (basically a magnifying glass) you need to keep it lined up, not twisted, and in justnthe right spot. The rail where the magnifier can be slid back and forth is a conventional approach.
For less than full aperture, you could take a lens cap (it holds on to the end somehow, right?) And cut out the middle.
Comment: Yea, we don't need no stink'n 3D printer.
Comment: The split PVC idea is along the lines of what I'm contemplating, sizing up every small plastic bottle that crosses my path lately. Unfortunately, the OEM lenscap for my camera doesn't work that way (it attaches to the body when lens is retracted), but it might be worth looking for some cheap generic ones that would fit...


To what extent are Lévy processes used in financial engineering?

Question: I know that (time changed) Lévy processes are actively researched in the academic world, including tools such as minimal entropy martingale pricing measures and fast Fourier transforms.
To what extent are such topics used in financial engineering, i.e. in trading desks of options market makers?
Answer: Levy processes are not used for pricing derivatives and are useless in practice. When the task at hand is to price a derivative, i.e., working in the risk neutral measure, then using Levy processes is worse than useless, it is dangerous and should actively be avoided. You can add entropy risk measures, FFTs and other (practically) useless concepts from academia to that list.
If implemented properly, and there is a big emphasis on "properly", then they may be useful for risk management, i.e., working in the statistical measure. I would not use them for risk management either, but they could be used in this context for benchmarking purposes.
Comment: This answer is materially incorrect ('levy, FFT practically useless') and the tone strangely derisive. Perhaps lack of appreciation for these 'useless concepts' stems from narrow field of problems encountered?
Comment: Hmm - So I guess there is a distinction between the fact that many useful processes are Levy, and whether or not Levy process specific techniques are used in practice in their analysis. @Rodolfo for example jump diffusions used for pricing eg quanto CDS - pure brownians cannot hit mkt prices. Don't think myself that I've seen FFT used much for years (>decade) but again, particular to a given area, so wouldn't seek to generalise
Comment: James: In what context have you seen Levy processes and/or FFT used? Thanks
Comment: @Mehness Thanks for the noting the use of jump-diffusions and your not having seen FFT used to solve it. May that be because there are almost closed form solutions for affine processes? That about gamma variance processes, which have infinitely many jumps per period?
Comment: @Rodolfo, no probs. So, cpl of things, yes affine processes super useful, particularly for gap risk-sensitive payoffs, when frankly, pure brownians cannot expose the salient risk characteristics. A friend of mine at another bank was using variance gamma a long time ago for credit vol products however not sure how widely it caught on. As a general point, not testing exotics against a suite of models and dynamics, including levy processes, is frankly remiss from a trading / model approval perspective, and anywhere I've been forms part of a rigorous model validation process.


Does hydrogen really have seven isotopes?

Question: I know that there are 3 isotopes of Hydrogen. But according to this website it is showing 7 http://periodictable.com/Properties/A/KnownIsotopes.htmlWebsite
Comment: As you can see by your link, heavier isotopes have decay time measured in $10^{-13}$ fractions of nanosecond. They are of theoretical interest for nuclear physics, but from chemists point of view can be ignored completely.
Comment: Look at the data there. The half-life of 3H is 12 years. The half-life of 4H is 1.39×10-13 nanoseconds. Does that count as existence for you?
Answer: Yes, there are seven known isotopes of hydrogen, though only two ($\ce{^1H}$ and $\ce{^2H}$) are stable with respect to nuclear decay, and only three ($\ce{^1H}$, $\ce{^2H}$ and $\ce{^3H}$) exist/can be made in enough quantities to be relevant outside of nuclear physics. All other hydrogen isotopes have extremely small half-lives. The next most stable hydrogen isotope after $\ce{^3H}$ ($t_{1/2}=12.3\ yr$) seems to be $\ce{^5H}$ ($t_{1/2} \sim 10^{-21}\ s$). Given that even the fastest chemical reactions happen in timespans of the order of $10^{-15}\ s$, we can safely discard any influence of hydrogen isotopes heavier than $\ce{^3H}$ in chemistry.
Out of the currently 115 elements which have been confirmed to exist, there are approximately 254 isotopes which are considered to be indefinitely stable, or have half-lives so enormous (over trillions of times greater than the age of the Universe, 13.8 billion years) that no value could yet be determined. Theoretically, only 90 of those 254 isotopes are expected to be truly indefinitely stable (proton decay aside), but there are great difficulties in setting up experiments capable of measuring such rare decay events.
On top of the previous 254, another 34 isotopes have half-lives which have actually been measured in laboratory, but are still large enough (>50 million years) so that a small fraction of the isotope could conceivably have survived since the creation of the Earth 4.6 billion years ago, and may be of interest in geological timescales. There are also isotopes with smaller half-lives, but which are continuously replenished by the decay of heavier atoms or by the action of cosmic rays, so they can still be found on Earth today. In all, about 339 different isotopes can be found naturally on our planet.
However, as many as 3100-3300 different isotopes of the first 118 elements are claimed to have been detected in laboratories, most of them with very small half-lives (seconds or less). Nobody knows for sure how many elements and how many isotopes can exist, though the number is finite.
Comment: Would a combination of other singly-positively-charged particles with an electron (positronium, muonium, bottomonium, etc.) be considered an isotope of hydrogen? Their chemistry should mimic that of hydrogen.
Comment: @iad22agp Good question. According to IUPAC, isotope is by definition a term applicable strictly to differing combinations of protons and neutrons. Anything not made solely of protons, neutrons and electrons is not an atom, but rather an [*exotic atom*](http://en.wikipedia.org/wiki/Exotic_atom), of which there are several types depending on what gets replaced.
Comment: Helium, for one has isotopes from no neutrons up to eight.  The former limit [may have been observed experimentally and is an intermediate in proton-proton fusion](https://en.wikipedia.org/wiki/Isotopes_of_helium#Helium-2_(diproton)).


what is the most commonly used font in book publishing?

Question: I am choosing fonts for book design and want to know what font the average book uses? Is it possible to use calligraphy as a font in a book?
Answer: Choosing a font is a strictly stylistic choice where the font should match your subject and your way of writing. For example, using a silly font like jokerwood for a serious nonfiction piece could be considered an incorrect utilization of font.
Here is a link with the top 10 most widely used fonts used by book design winners: http://fontfeed.com/archives/top-ten-typefaces-used-by-book-design-winners/
Answer: Common typefaces include Minion, Adobe Garamond, Caslon, and Palatino.
The typeface can depend on what type of book (fiction? nonfiction? kids' picture book?), and what type of text (body, chapter title, title, subhead, etc. etc.). A calligraphy-style typeface might be acceptable for a title or heading, but it'd most likely be hard to read with body text. I'd probably advise against it.
Choosing a font is a stylistic choice, but keep in mind that the font and design of your book have to contribute to a comfortable reading experience.


the differential of a regular map between varieties

Question: I'm reading the book of Shafarevich of algebraic geometry. I'm having troubles with this page:

What is explicitly the differential of a map in terms of the regular map $ f:X\to Y $?
Obviously is a composition of a lot of maps , isomorphism between the tangent space and $m_x/m^2_x$, etc... I think that it's very obvious but I prefer to be sure.
Answer: Typing "Differential of a regular map" into Google gave me this:
http://www.jmilne.org/math/CourseNotes/AG500.pdf (I recommend pages 78+)
Typing "Differential of a smooth map" into Google gave me this:
https://en.wikipedia.org/wiki/Pushforward_(differential)
Comment: Yes... It's similar but it's not the same, here we are working over any kind of algebraically closed field, and not necessary over the real numbers. We are working over Varieties, in Algebraic Geometry and not manifolds.
Answer: Technically, given a linear form $\ell\in(\mathfrak m_x/\mathfrak m_x^2)^\ast$, we have
$$(d_xf)(\ell)=\Bigl(\mathfrak m_y/\mathfrak m_y^2\ni \phi \mapsto \ell(f^\ast(\phi))\Bigr)  $$
Answer: Given $f: X \to Y$ we go
$$
\Theta_{X, x} = \text{Hom}(\mathfrak{m}_x/\mathfrak{m}_x^2, k) \stackrel{?}{\to}\text{Hom}(\mathfrak{m}_y/\mathfrak{m}_y^2, k) = \Theta_{Y, y}.
$$
Here the maps which I'm calling = are the content of Corollary 1, and the map I'm calling $?$ is $\phi \mapsto \phi \circ f^*$ where $f^*$ is the usual pullback map on local rings $\mathcal{O}_{Y, y} \to \mathcal{O}_{X, x}$.


Rust on Brake Calipers

Question: Is driving equally safe whether the brake calipers are rusted or not? I found this question, and I didn't read that driving was discouraged with rusted calipers (only that it wasn't as aesthetically pleasing as non-rusted calipers); however, a shop recently recommended replacing them for safety concerns. Some more background: I replaced the brakes ~3 years ago, so should I go ahead and replace them again or are brakes typically good for much longer?
Answer: Aesthetics has little to nothing to do with how well calipers function. As long as the caliper pistons do their thing and don't leak, there's no issues keeping them. There are no safety concerns with them as well. Unless the shop can point out a mechanical problem with them, the rust will not pose any issue. You usually won't see anything more than surface rust anyway. This is usually cased from the heat burning away any paint which isn't heat resistant.
There is only one way which rust may interfere with the operation of the caliper and that would be where the caliper slides. This would just entail cleaning and lubing, but not replacement.
Answer: In the rust belt, all of the vehicles in our family (GM cars and trucks / BMW / Subaru) will develop sticking rear disc-brakes every year due to rust buildup between the brake-pad plates, pad-slides and caliper-brackets. It seems to make little difference what kind of lube is used; between the heat and harsh environmental conditions, annual service every spring is the only fix we have found.  If some offered all stainless-steel rear brake components, I'd be first in line.
Answer: I would disagree a little with @Paulster2.  Rust can build up behind the rubber dust shield and even the piston seal and cause the piston to stick rather than slide in and out.  This will cause the brakes to stick on slightly and cause heating of brake disc and maybe pulling to one side. I have seen this on a number of vehicles, but does depend on the design of the caliper.

Rust on Brake Calipers


Adjusting yeast and rise times in recipes

Question: Is it possible to reduce the amount of yeast and increase the rise times for leavened doughs? If so, is there a simple method to calculate the changes? Does 1/2 the yeast mean twice the rise-time?
Answer: It is definitely possible. However, there are many, many factors that are going to guide yeast activity: sugar levels, water temperature, gluten development, etc. If I can, I normally cut back the yeast and just keep an eye on my dough, the less yeast, the more the flavor can develop.
Answer: In optimal conditions, the yeast cells in bread dough can double their number in about 100 minutes to 2 hours. And by optimal, I mean like in a lab with perfect ventilation and temperature control @ 86°F/30°C . In a kitchen there are many other factors that can influence this (e.g. temperature of room, salt and sugar levels of the dough, presence of other yeasts in the air, etc...) so that 2 hour number will only go higher depending on your setup.
But if you use that 2 hour number as a guide, each halving of the yeast in the recipe will add 2 hours or more to your rise time. Note that this rule of thumb won't work if you are looking to do a refrigerated or lower temperature rise.


How effective is cognitive behavioral therapy for anxiety disorders?

Question: How effective have cognitive behavioral therapy type techniques been shown and proven to work for anxiety based on published literature?
Citations please.
Comment: My answer in https://psychology.stackexchange.com/q/1977/7604 may help to gain some balance against the accepted answer.
Answer: Meta-analyses are usually pretty accurate, as they essentially bring together the data from many studies that investigate the same topic of interest together and use statistical methods to effectively get the most conclusive answer possible, throughout all of the studies assessed, just HOW effective is a certain treatment?
For your specific question, there's one in particular that strongly supports CBT for anxiety.  It looks at 71 different studies (that's a ton).  It also investigates it's effectiveness in a variety of different environments and versions of it's therapy.
 It was even published only last month.

Clin Psychol Rev. 2013 Jul 20;33(8):954-964. doi:
  10.1016/j.cpr.2013.07.003.
A meta-analysis of nonrandomized effectiveness studies on outpatient cognitive behavioral
  therapy for adult anxiety disorders. Hans E, Hiller W. Source
  Department of Clinical Psychology, Johannes Gutenberg University
  Mainz, Germany. Electronic address: firstname.lastname@example.com. Abstract
OBJECTIVE: The primary aim of this study was to assess the overall
  effectiveness of individual and group outpatient cognitive behavioral
  therapy (CBT) for adults with a primary anxiety disorder in routine
  clinical practice. METHOD: We conducted a random effects meta-analysis
  of 71 nonrandomized effectiveness studies on outpatient individual and
  group CBT for adult anxiety disorders. Standardized mean gain effect
  sizes pre- to posttreatment, and posttreatment to follow-up are
  reported for disorder-specific symptoms, depression, and general
  anxiety. The mean dropout from CBT is reported. RESULTS: Outpatient
  CBT was effective in reducing disorder-specific symptoms in completer
  (d=0.90-1.91) and intention-to-treat samples (d=0.67-1.45). Moderate
  to large (d=0.54-1.09) and small to large effect sizes (d=0.42-0.97)
  were found for depressive and general anxiety symptoms posttreatment.
  Across all anxiety disorders, the weighted mean dropout rate was
  15.06%. Posttreatment gains for disorder-specific anxiety were maintained 12months after completion of therapy. CONCLUSIONS: ****CBT for
  adult anxiety disorders is very effective and widely accepted in
  routine practice settings.**** However, the methodological and reporting
  quality of nonrandomized effectiveness studies must be improved. ©
  2013.

Across 71 studies, the conclusion used the word "very effective," which is very rare to see in any study in the conclusions section, especially a meta-analysis,  the weighted mean dropout rate across all different types of its application was only 15.06%, AND gains were generally maintained for 12 months (maybe more, I don't have full text) after beginning therapy.
The only caveat they mention is that the methodology and reporting quality must be improved, but I feel that's a general trait that almost all studies need improvement in.
Plus when you investigate SEVENTY-ONE (71) studies, statistical laws start to take over anyway.
Based on this, I'd have to say that there is very, very strong evidence that Cognitive Behavioral Therapy is an effective treatment for anxiety disorders.
In my opinion, and as an analogy, it's almost just as if not more proven than using aspirin or acetaminophen to relieve a simple headache.  It just works according to the literature, which, if you have that many studies then "routine clinical analysis" really does become reality.  More and more clinical psychologists are switching over to this method or attempting to make some sort of derivative of it.
Comment: Best answer ever.
Comment: Considering the non-randomized studies (even via a meta-analysis) as "best evidence ever" is pretty silly. A lot of low-quality studies have concluded various dubious things "work", e.g. https://skeptics.stackexchange.com/questions/6860/has-most-peer-reviewed-research-on-homeopathy-given-positive-results
Answer: Frankly, I don't see how the meta-analysis of 70-something non-randomized studies from the self-accepted answer is such amazing evidence. On the other hand, there's a 2008 meta-analysis of just the randomized (and double-blind) studies (RCTs), and these are not so few either:

We included studies that randomly assigned adult patients meeting DSM-III-R or DSM-IV criteria for an anxiety disorder to either CBT or placebo. Of 1,165 studies that were initially identified, 27 met all inclusion criteria. [...]
Random effect models of completer samples yielded a pooled effect size (Hedges' g) of 0.73 (95% confidence interval, 0.88–1.65) for continuous anxiety severity measures and 0.45 (90% confidence interval, 0.25–0.65) for depressive symptom severity measures. The pooled odds ratio for completer treatment response rates was 4.06 (95% confidence interval, 2.78–5.92). The strongest effect sizes were observed for obsessive-compulsive disorder and acute stress disorder. The advantage of CBT over placebo did not depend on placebo modality, number of sessions, or study year.
Our review of randomized placebo-controlled trials indicates that CBT is efficacious for adult anxiety disorders.

The notion of placebo is however not always clear when it comes to psychtherapy; in this meta-analysis it

had to involve interventions to control for nonspecific factors (e.g., regular contact with a therapist, reasonable rationale for the intervention, discussions of the psychological problem). Placebo interventions that included active treatment ingredients for the target problem (e.g., an intervention that specifically instructs participants to engage in exposure exercises to test certain predictions or to challenge a maladaptive thinking style) were not included

Also only double-blind studies were included in these 27:

(c) Participants and evaluators were blinded to treatment condition (i.e., participants and evaluators were not aware whether they received active treatment or placebo intervention); (d) The evaluators were blinded to treatment conditions (i.e., evaluators were not aware which treatment condition participants had received; and (e) the description of drop-outs was provided.

There's even a newer (2018) meta-analysis of the same kind

The purpose of this study was to examine the efficacy of cognitive behavioral therapy (CBT) for anxiety-related disorders based on randomized placebo-controlled trials. We included 41 studies that randomly assigned patients (N = 2,843) with acute stress disorder, generalized anxiety disorder (GAD), obsessive compulsive disorder (OCD), panic disorder (PD), posttraumatic stress disorder (PTSD), or social anxiety disorder (SAD) to CBT or a psychological or pill placebo condition. Findings demonstrated moderate placebo-controlled effects of CBT on target disorder symptoms (Hedges' g = 0.56), and small to moderate effects on other anxiety symptoms (Hedges' g = 0.38), depression (Hedges' g = 0.31), and quality of life (Hedges' g = 0.30). Response rates in CBT compared to placebo were associated with an odds ratio of 2.97. Effects on the target disorder were significantly stronger for completer samples than intent-to-treat samples, and for individuals compared to group CBT in SAD and PTSD studies. Large effect sizes were found for OCD, GAD, and acute stress disorder, and small to moderate effect sizes were found for PTSD, SAD, and PD. In PTSD studies, dropout rates were greater in CBT (29.0%) compared to placebo (17.2%), but no difference in dropout was found across other disorders. Interventions primarily using exposure strategies had larger effect sizes than those using cognitive or cognitive and behavioral techniques, though this difference did not reach significance. Findings demonstrate that CBT is a moderately efficacious treatment for anxiety disorders when compared to placebo. More effective treatments are especially needed for PTSD, SAD, and PD.

Since this 2018 meta-analysis presented itself as the successor of the one a decade before (it shares some authors as well) it still included OCD, acute stress disorder, and PTSD even though these are no longer classified as
anxiety disorders in DSM-5.
It's also interesting that there few RCTs of CBT in GAD though (only 2).
Also RCTs aren't all the same quality-wise...

the strength of the effect of CBT depended on whether the analysis
  was conducted on completer or ITT [intent-to-treat] samples, with completer samples
  producing significantly larger effect sizes, though not ORs [odd ratios], compared
  to ITT samples. Such a discrepancy between ITT and completer samples is particularly important given that CBT was associated with significantly greater dropout rates than placebo in the present analysis,
  a result not found in Hofmann and Smits (2008). Notably, this result
  appeared to be driven by greater dropout rates among CBT patients
  in PTSD studies, which has also been found in previous meta-analytic
  research (Imel, Laska, Jakupcak, & Simpson, 2013). Such a finding suggests that for PTSD studies, the superior effect of CBT compared to
  placebo may be inflated by lack of data from dropouts.
[...] only 16 of the 41 studies included used ITT analyses,
  and the use of completer analyses appeared to lead to greater effect
  size estimates. Even among studies using ITT analyses, results from our
  risk of bias assessment indicated that many studies did not account for
  missing data properly, or did not provide adequate information for why
  data were missing or how missing data were dealt with. Relatedly, the
  present results may have been influenced by publication bias. In addition, criteria for treatment response varied between studies, potentially contributed to increased heterogeneity in the effect sizes for
  categorical outcomes.

They also note that meta-analyses using only waitlists as opposed to more active placebos had reported even greater effect sizes:

For instance, the metaanalysis by Bandelow et al. (2015) comparing CBT to waitlist produced
  an overall effect size of 1.23 for anxiety disorder symptoms. In contrast, we observed that CBT was associated with an effect size of 0.56
  when compared to placebo.

The  metaanalysis of Bandelow et al. is also interesting in its own ways; although it targeted fewer disorders (I think they adopted to the DSM-5 view) namely only Panic disorder/agoraphobia, GAD and Social anxiety disorder, it compared treatments multiple treatments, with some interesting conclusions:

In direct comparisons, individual CBT/exposure was
  significantly more effective than waiting list, psychological
  placebo and pill placebo conditions (Table 3). Group CBT was superior to waiting list, but not to pill placebo. Relaxation and non-face-to-face therapies were superior to waiting lists.

In that last table, "Fail-safe N" (number of
negative studies needed to reject the hypothesis that a
treatment differs from a control group) and "Egger P" estimate publication bias; the "adjusted d" is using the publication-bias-correcting 'trim and fill' method of Duval and Tweedie (2000). (Alas the meta-analyses of Hofmann and Smits did not report something like this.)
Answer: I can only give my experience, which is that it did not help one bit.
I had two lots of 6 sessions, and was described as a " very compliant patient"
It was like standing on a motorway trying to persuade one car to slow down, sometimes they did, but there were so many more it was exhausting.
I have no doubt it works for some, but I rather think its effects are being over hyped.
Try this :
https://www.psychologytoday.com/us/blog/conquer-fear-flying/201402/why-cbt-cant-regulate-anxiety
Its relatively cheap and is fashionable.....but as I said..did absolutely nothing for me and for others I know.
I guess at least it is without side effects....as long as those administering it do not see the patient as the problem if it fails.....its too easy to do that
Gina x
Comment: Opinions and anecdotes are [frowned upon](https://psychology.meta.stackexchange.com/q/1037/7001) here, please edit the answer to summarize evidence from valid references.
Comment: My answer in https://psychology.stackexchange.com/q/1977/7604 may help to gain some balance against the accepted answer.


Nginx and reverse caching proxy for a dinamically generated files under apache+php

Question: I have a PHP application under Apache that generates Excel files that are exact the same during a day just with different the names. The names are generated randomly and are killing the server because they are getting bigger and the user number is increasing too.
Is Nginx able to help me on this? Any suggestions?
Answer: Playing around with the proxy_cache_key (and creatively using different variables for it) might get you to where you want to be. However, I suspect your best answer is to modify the code that generates those files to use a singular name when the content doesn't change; off the top of my head a very simple solution would be to use the MD5 hash of the file's contents as the file name. Nginx would be able to trivially cache that for you (but see the other caching settings on the same page I linked above to get the best bang for your buck).


Trouble getting FTP login to work in IIS6

Question: I'm trying to setup an FTP site for one of my clients to retrieve files from my organization using IIS6. I've created the FTP site, have set to not isolate users (not necessary as FTP will be read only with authentication).
Here's the problem. The FTP is to be password protected, so I turned of anonymous access on the FTP site. I then created a ftpuser account on the machine, and gave it read and browse directory permissions on the ftp's root directory. However, when I go to test the ftpuser login, I get a 530 "ftpuser cannot login" error. However, if I browse to the same directory over HTTP (anonymous access turned off as well) and enter the ftpuser login info, I can download files and browse directories successfully. Why is the ftpuser working over HTTP but not FTP? Shouldn't I be able to login over FTP with the ftpuser login information I just created?
Answer: FTP status code 530 is definitely related to a username\password error. Have you tried authenticating to the ftp site as:
machinename\ftpuser
password


Is it possible to set session variables from javascript?

Question: Is it possible to set session variables from javascript?
Answer: The short answer is no.
You can set cookies, but they're not quite the same.
You could also use AJAX to post back to a script on your server that will set the variables.
Session variables exist only on the server.
Answer: session variables belongs to server-side scripting, thus javascript, being a client-side script is not able to set session variables. however, you are able to make use of ajax to set the session variable asynchronously, meaning without refreshing the page =)
Answer: yes, if you use an ajax call to a server handler. Its probably not a safe thing to do. Why do you need to?
Answer: the only thing related to sessions you can change with javascript would be the session identifier, since this is what the client sees. but changing that won't have any valuable effect on your session data—which is stored on the server


How to make a message into a polynomial on NTRU encryption?

Question: How to make a message into a polynomial on NTRU encryption? for example how we can conver 'hello world' to polynomial...
i have read the converting operation on IEEE Std 1363.1- 2008, but i can't understand the process without example, can anyone show for the small example?
Comment: use https://8gwifi.org/ntrufunctions.jsp for debug
Answer: According to Wikipedia:

Alice, who wants to send a secret message to Bob, puts her message in the form of a polynomial m with coefficients {-1,0,1}. In modern applications of the encryption, the message polynomial can be translated in a binary or ternary representation.

So, lets say you have a message encoded in base 2 as 101101, you'd set the polynomial to $1+0x+1x^2+1x^3+0x^4+1x^5=1+x^2+x^3+x^5$. That then is your message to encrypt. Technically you could encode a message in ternary and do the same thing. Then you'd have coefficients in $\{-1,0,1\}$. There is no reduction in security by encoding in binary, however, and only having coefficients in $\{0,1\}$.
Now, moving that to your string. First encode your string in base 2 (you can do this how you want), then construct your polynomial. If you have more bits than the degree of the NTRU polynomial, you'll have to split up the message into blocks. I'm sure you know about the standard warnings with using public key encryption for large messages. Unless you have a really, really good reason you shouldn't do it. Encrypt a random key with the public key cipher and encrypt the plaintext with the random key.
Answer: To encrypt the message "hello world", using the ASCII conversion table (http://www.albany.edu/~yx152122/ASCII.pdf) you get the hexadecimal representation as 68 65 6C 6C 6F 77 6F 72 6C 64 and corresponding binary representation. Then convert to polynomial by adding powers of X
h 01101000 X^3+X^5+X^6
e 01100101 1+X^2+X^5+X^6
l 01101100 X^2+X^3+X^5+X^6
l 01101100 X^2+X^3+X^5+X^6
o 01101111 1+X+X^2+X^3+X^5+X^6
w 01110111 1+X+X^2+X^4+X^5+X^6
o 01101111 1+X+X^2+X^3+X^5+X^6
r 01110010 X+X^4+X^5+X^6
l 01101100 X^2+X^3+X^5+X^6
d 01100100 X^2+X^5+X^6

Then you can input this as your message in NTRU


How many Mars sized planets can form and remain stable in the habitable zone of a Sun-like star?

Question: By Mars sized I mean with masses between 0.10 (M⊕) and 0.25 (M⊕), the planets need to  have independent orbits around the star. We can assume the habitable zone stretches from 0.70 AU, to 1.5 AU for a typical G type star like the Sun. I don't know if adding a gas giant to the system will cause instabilities, but I think they are important for perturbing comets and other volatiles to terrestrial planets.
Comment: No idea of the actual answer, but here is a simulation you can play with.  http://www.stefanom.org/spc/
Comment: Can't calculate it now, but I dare to say that for Sun-like star you can't get very different results. Sun-like star would form from solar-system-like disk, leaving similar protoplanetary disk... I guess 4. give or take.
Comment: I managed to find an interesting planetary system generator called StarGen, Though I haven't been able to generate what I want just yet, not sure how accurate the systems are either. If anyone wants to try it here is the link, http://fast-times.eldacur.com/StarGen/RunStarGen.html
Answer: .7 to 1.5 A.U.?
Venus is .72 A.U., earth is 1 A.U. and Mars is 1.52 A.U. So judging by our solar system, 3 planets are possible.
Smaller bodies at a star planet L4 and L5 are stable if the smaller bodies are 1/25 the mass (or less) of the larger planet. And 0.04 (M⊕) lies below the 0.10 (M⊕) boundary you suggest. Unless the larger planet is 4 times the mass of the earth, then it could have a Mars sized trailing as well as a leading Trojan.
Would a planet 4 times earth's mass destabilize the other planets within the habitable Goldilocks zone? Sorry, I don't know. If a super earth is possible, I could see a super earth with two Mars sized trojans as well as two other Mars sized bodies in other star centered orbits. So my guess is up to 4 Mars sized bodies and a super earth are doable within a sun like star's Goldilocks zone.
Edit: JDługosz suggested double planets are possible. I believe this is true.
So I think 6 are possible. Here's a pic:

At 1.5 A.U. is a super earth with a Mars like moon. Also at 1.5 A.U. are two Mars sized Trojans.
At 1 A.U. is a single Mars sized body. I want to keep this guy small so he doesn't destabilize the super earth trojans.
At .7 A.U. is a double planetoid, each Mars sized. This might be far enough from the 1.5 A.U. orbit that a more massive double planetoid won't destabilize the trojans.
Speaking of Mars sized moons, that raises the possibility of one of my favorite settings: A Gas Giant In Earth Like Orbit (GIELO) and an Earth Like Moon (ELM). I talk about GIELO and ELM on my ZRVTO post.
Comment: Super-earth trojans? I thought they were all mars sized.
Comment: The super earth and it's Mars sized moon needs to total a mass 25 times (or more) massive than each Trojan mass. Or else the L4 and L5 Trojans aren't in a stable orbit.
Comment: Ok, I missed that; thought the primary was a Giant.
Answer: Based on the series of essays Building the Ultimate Solar System, one of his "super" systems comes to mind.
3 stable orbits of different radii.  Maybe need a wider spacing if we play more tricks, but you can push the far end of the zone by using greenhouse effects.
Each orbit might contain 2 bodies 60° apart, being in each other's trojen points.
Or, each body might actually be a double planet!  So that's 6 to 12 bodies.
The presence of additional giant planets will mess that up.  HopDavid's variation uses a giant with a habitable moon to get 3 in one orbit, but that means the other orbits can't share so much and I still worry about the eccentricity being pumped up.  So ditch the giant completely and put 2 to 4 Mars bodies in each orbit.
Comment: Trojans more than 1/25 mass aren't stable. Moreover a planet in a neighboring orbit orbit can destabilize Trojans. Jupiter can hold on to its Trojans because it's the big frog in our solar system swamp. So in my opinion two Trojans max. Double planets isn't a possibility I had considered through. I might edit my answer to reflect that possibility.
Comment: Ok, I reread the article. Part 4 isn't clear on its own but in part 5 the illustrations/examples indicate 2 sharing an orbit, not 3, of equal-mass bodies.
Comment: What do you mean by "giant"? A Saturn or Jupiter would undoubtedly destabilize the lower orbits. But something 4 earth masses? Possibly, but at the moment I'm betting 4 earth masses at 1.5 A.U. wouldn't be that destructive.


Does it ever make sense to stall for time?

Question: The game clock is used to prevent players from overly delaying the game (the keywords being "overly delaying the game"). Are there times in a timed game that stalling one's own development of the board makes sense, and if so, what would be the best example of this taking place?
Answer: In the bughouse variant a situation can definitely arise in which it makes sense to stall for time. If I'm facing checkmate next move on my board no matter what I do, then if my partner's opponent has less time on the clock than I do, I should just sit tight and hope that my partner can win on his board before my time runs out. (And if my partner's opponent has more time than I do in that situation, then he should just sit tight as well and force me to either accept mate or flag first.) But I realize you are actually asking about chess proper here, not bughouse.
I can't think of any scenario in which it makes objective sense, in terms of the game play, to stall for time, assuming you are talking about a situation in which: I already know what my next move is going to be (and have no intention of reviewing my decision any further), but I let my clock tick down instead of making my move immediately. But a player might have a psychological reason to stall at times.
In this interview (with accompanying videos in Russian) of grandmaster and noted commentator Sergey Shipov, conducted just recently during the ongoing world championship match, the topic arises as to the amount of time top players like Gelfand, Kramnik and Kasparov spend when making moves in positions that they've already analyzed during their home preparations. (See section "6. Kasparov puts on a show.") Shipov opines:

For example, when, in Kazan, Gelfand thought for almost 40 minutes about one continuation in that game against Grischuk it later became clear that he'd looked at it all before. [17. Rd1 in game 6 of the candidates' final] ... he was considering some nuances, subtleties. He'd looked at the plan itself, but perhaps he was clarifying some of the concrete details. That depends greatly on the chess player. Kramnik won't, for example, think for 20 minutes, never mind 40 minutes, about something he's already looked at. He'll play quickly. Kasparov, on the other hand, might do that. With Kasparov a position could be absolutely familiar to him but he'd think for 20 minutes, look at it, make various gestures, and it seemed to everyone that Kasparov was creating and coming up with something at the board. In actual fact, however, it was a one-man performance based around the creative process. (My emphasis)

Shipov doesn't indicate exactly what he thinks Kasparov's underlying motivation for this was supposed to be, but he is clearly suggesting that Kasparov wanted either his opponents or his spectators not to be sure when he was in his preparation and when he was extemporizing. So that's one possible answer.
Answer: Ed Dean has an excellent answer about most cases (and even touches on what I'm discussing), but there is one situation that I can think of where stalling is an excellent idea:
This mostly only applies to stronger players (2300+), but the information is good...
Sometimes it is very useful to spend a lot of time on an early opening move to try to confuse the opponent.  If the opponent thinks that you don't know the position, they are more likely to play natural looking moves.  This is frequently a bad idea, especially in complicated positions where natural looking moves fail to various tactics.
The idea behind waiting a long time before moving is to lure the opponent into making those natural looking moves, or to think that the opponent's position is good when really the position has been analyzed fully and is deemed to be good for the player.  Basically, the point is that the opponent won't be fully on the lookout for sharp tactics going forward, especially in double edged positions.
Answer: There was a game where Korchnoi was completely lost and deliberately ran himself into time trouble so that the opponent would try to take advantage of it rather than playing the merits of the position. I believe it worked and he turned the game around.
Ref : http://en.chessbase.com/post/clean-tricks-and-creative-attacks
Answer: On a personal note, I once found myself facing an 8-year old who was a superior player; I knew he was a superior player before we started, having watched several of his other games at the club downtown.
I intentionally let extra time go off my clock on every move, even when it was something blatantly obvious.  Relatively quickly in the game, I found myself down a minor piece... but it became clear by mid-game that he didn't have the mental stamina to keep it up: he started fidgeting, and his attention started wandering.  Eventually, he made a blunder I was able to capitalize on, and I managed to win.
I spoke to his father afterward - and he related that delaying the game until his son's mental fortitude wore off was the only way he could win, too.  With that said, I'm sure that the young man - whom I have since lost touch with - became a MUCH better player once he matured enough to sustain a longer play style.
Comment: Perhaps. A lot of kids with autism (and unmedicated ADHD) have a *very* difficult time with this. It can get better with age or maturity, but it can also get worse. Still, it's a reasonable tactic and speaks to the psychological aspect of competition.
Answer: Overall, I don't see any reason to do this unless you want to annoy your opponent.
If your opponent is advanced, I think you would just be wasting time, especially if you think your opponent is going to be psychologically tricked into making some sort of blunder.
If your opponent is a beginner, stalling may have some psychological effect as your opponent may think that because you took so long to move, you had to have calculated some long winning combination. Your opponent may then start to panic and look for what you saw.
Regarding the stalling with a beginner, I know this is true, because it works on me. If my opponent takes a while to move, I usually think they have something up there sleeve unless it is some horrible mistake like hanging their queen.
Answer: In team matches it can sometimes make some kind of sense. One case I saw was white was miles up on time and in a somewhat better position, but certainly not clearly winning. At that point Black offered a draw, to which white responded by waiting for the other boards to become more clear before he decided whether the team needed a win from him, or if a draw was sufficient. In the end neither was (I was on the side of Black)!


Which brand 1.4 Teleconverter ensures autofocus for Sigma 150-600mm C other than TC 1401 sigmas own

Question: I have a Kenko tokina 1.4 teleconverter. When attached to 150-600mm C sigma lens and camera switched on, it shows Err01. However if the electrical contacts of the teleconverter are blocked with a tape the lens and teleconverter operates Manual. The same teleconverter works allright with a canon 70-200mm L lens with autofocus options. Tried all techniques to overcome Err01 error. Did not succeed. So which brand of 1.4 teleconverter offers autofocus.
Comment: What camera are you using?
Comment: How old is the TC? Kenko sometimes updates the firmware included in their TCs when it is necessary for them to work with newer Canon lenses/bodies. But the older ones already sold don't get the benefit of it, only the ones manufactured going forward. If you just bought a Kenko TC and it is an older one that does not work on your camera, some dealers will swap it out for a newer one if they know what that even means.
Comment: There are also several different models (4 element, 7 element, etc.) of Kenko 1.4X TCs for Canon EF mount. Which one do you have? Specifically, what is printed on the barrel of the TC?
Comment: It is the 4 element model. ie 1.4X Teleplus MC4. Obviously the old model. The camera body is canon 77D. Everything said, how come my 70-200mm Canon L lens when attached with the same TC works fine on this body(with autofocus)
Answer: The simple answer is: the one that the camera company makes.
For example, a Canon TC is guaranteed to work with Canon bodies and appropriate Canon lenses.
But, once you go to third party (Kenko, Sigma, etc) lenses or TC's, the guarantee is gone. The specifics of why this is get into the electronics and technology baked into the lens, TC, and camera - but the end result is that you should only ever expect a lens or TC to work with a body if the manufacturer says it will. (For example, if Kenko says their TC works with 60D and 70D and 70-200L, but they're missing the 80D or Sigma lenses on their approved list...then you have no evidence that their TC will work with either that body or lens).
TLDR; there is no list of autofocus approved TC's. There is only the TC, and it's approved camera body and lens combinations. If you go outside of those rec's - you're in uncharted territory. Things may still work, but don't be surprised if they don't.
Comment: Best practice when mixing third party TCs and lenses is to try it all (camera, TC, lens) together in the store *before* you buy. Bring your camera and TC and try it with the new lens, or bring your TC and lens and try it with the new camera, etc. Or buy from a seller that will take no-questions-asked returns for 15-30 days and test it at home as soon as you receive it.