unable to use if then else statement
Brackets in if condition: why am I getting syntax errors without whitespace?
Undefined variable problem with PHP function Getting the expectation symbol to behave like $\sum$ instead of $\Sigma$ How can I get an expectation symbol which behaves like $\sum$?  Specifically, I want the underscore to be like that of a summation.  At the moment I use   $$\mathbb{E}_{x\in A}$$    However, I do not like this.  It feels like I am writing a sum as   $$\Sigma_{x\in A}$$    Whereas the alternative  $$\sum_{x\in A}$$   is much nicer when in a centered equation.  (The underscore appears directly below the sigma, instead of slight infront and below.)  Is there a way to make an expectation symbol which behaves like $$\sum$$ rather then $$\Sigma$$? Generating correlated binomial random variables I was wondering if it might be possible to generate correlated random binomial variables following a linear transformation approach?  Below, I tried something simple in R and it produces some correlation. But I was wondering if there is a principled way to do this?  X1 = rbinom(1e4, 6, .5) ; X2 = rbinom(1e4, 6, .5) ;  X3 = rbinom(1e4, 6, .5) ; a = .5  Y1 = X1 + (a*X2) ; Y2 = X2 + (a*X3) ## Y1 and Y2 are supposed to be correlated  cor(Y1, Y2) How can I get a views exposed filter to persist across multiple views? I have 2 separate views that return a set of results for each of my content types. The fields are different, but the filters are exactly the same - Sort by Location / Distance. This Distance / Proximity filter is exposed, and it is set to 'remember' the last entry. I followed the tutorial here  to be able to filter results by distance. It works great.  In views, to remember the last entry, Views uses sessions. But, each view has its own individual $_SESSION variable. That means what I set for one view does not carry over to the next, and even each view can have different values, which is not what I want. Here is a dump of the session after they have been set:  [views] =&gt; Array     (         [search_pages] =&gt; Array             (                 [default] =&gt; Array                     (                     )              )          [baby_clothes_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 11211                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )          [baby_gear_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 22343                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )      )   What I would like to do is create a small module or snippet of code that will simply allow someone to type in their 5 digit zip code and then it update all the values across all my pages with this filter. If it is changed on any page, then it changes it for the rest of the pages as well. It also needs to work so that it affects the results on the next page load so that it correctly shows them filtered.  Here is a snippet of code I was experimenting with to try to set this value, but it's the wrong direction.   $all_views = views_get_all_views();            // get an array of all views in use on the site  foreach ($all_views['category_pages']-&gt;display as $key =&gt; $value) {  //check to see if the structure exists I am looking to modify if(array_key_exists('postal_code', $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value'])) {  //if so, set its value $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value']['postal_code'] = '28152';  //try setting the session instead $_SESSION['views']['category_pages'][$key]['distance']['postal_code'] = '28152';     }   What's the correct direction? How do I get this value changed? Could it be done in the template.php file with preprocess function? Should I do it in a module, and if so, what do I need to alter?  Very lost at this point. Thanks for the direction! How do I install the Tor Browser Bundle in Ubuntu? In Ubuntu 13.04 I used to use the ppa:upubuntu-com/tor64  PPA to install the 64-bit Tor Browser Bundle. However, in Ubuntu 13.10 it doesn't work anymore. How do I install the Tor Browser Bundle in Ubuntu? What is the right way to get the current users profile in an apex class?  When I tried to print the following in visualforce page,  i am able to get the profile name  &lt;apex:outputText value="{!$Profile.Name}"/&gt;    But when i tried to print in the Apex class using System.debug(Profile.Name), I couldn't. No sound (speakers/jack) + microphone's dead after spilling water Sadly, yesterday I've spilled some water on my MacBook Pro (El Capitan). Before you yell at me - it was closed, turned off and it wasn't a lot of water, the laptop was wet only on the top and under - not inside.  Today I've turned him on. At first battery wasn't recharging for some reason, but SMC reset fixed the problem.  At the first booting speaker was like talking to me, hard to explain but it was weird. Also only right speaker was "talking", despite the fact that only left side of the laptop was watered. Then there was no sound at all, not from the speakers, nor from the headphones. Also microphone's not working. USB ports are okay. The water was spilled from the left side of the laptop. I know this is hardware issue, and something's broken, but I want to be 100% sure. No it's not muted. I've also tried NVRAM reset a few times, but it doesn't fix the problem :(  There might be one factor, before spilling, my laptop "died" for the first time (battery energy ran off), but I doubt it's the case. (but hey, every info matters, right?)  It wouldn't be weird for me, if only left speaker wouldn't work, but built-in microphone not working is kinda weird in this case, isn't it?  I just want to ask you guys, what else can I check, before I'll be 100% sure it's dead inside?  I've plugged in external microphone - it's not working too. I am trying to lock some boxes in a map of mine, and I used this command:   /blockdata 10 4 9 {Lock:Elyiana's Mage Key}   At first it worked, but then when I logged back on the next day it gave me this error message:    Data tag parsing failed: Expected '}' but ''' at: {Lock:Elyiana'&lt;--[HERE]     I don't know why it doesn't like the apostrophe in the key's name. I would change it, but it already worked and locked some other items. My version is 1.12, does anyone have an answer to my problem? Twitter Bootstrap - multiple image (thumbnail) carousel - move thumbnails one at a time I want to change the default placeholder text in my Custom Post Type title field. This isn't possible while registering a new post type.  The following screenshot describes it. Let's assume we have a table where it has two columns, one an ID and one an hstore column, which stores key/value pairs.  You could query that column as such:  SELECT name, attributes-&gt;'device' as device FROM products WHERE attributes-&gt;'edition'= 'ebook'   Can you create a view for this table where the keys/values appear as columns in the view instead of all in the hstore column?  Example: I have an hstore key where it might have the key of amenity.  I want to create a view showing the the ID and the amenity values in a new view. MicroSD card is set to Read-only state. How can I write data on it? I have a MicroSD card reader in my notebook. When I insert a MicroSD memory card into it, I can't write any data on it - it's read-only. The same thing happens when I try to do it under root. And I can't change the permission policy for it. This problem happens for all microSD cards (I've tested 2 cards). I've encountered it on Ubuntu 12.04 LTS, now I'm on Ubuntu 12.10, the problem is still on it's place. When I try to insert such a "read-only" card in my mobile phone, everything's OK and I can write data on it. So, can anybody tell me, how can I write a data onto the card?  UPD: here's fdisk -l output:  Disk /dev/sdc1: 2013 MB, 2013135360 bytes 62 heads, 62 sectors/track, 1022 cylinders, total 3931905 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000   Device Boot      Start         End      Blocks   Id  System   The file system of the card is msdos. As to me it's weird.   UPD2: I've found a small "lock" switch on my card adapter, and it turns out, that when I insert it in my notebook, it switches on. Perhaps, I have to find some glue or something to get that switch stuck...  UPD3: There was no glue near me, so I've decided to buy another card-reader. Well, this is an exercise problem from Herstein which sounds difficult:   How does one prove that if $|G|&gt;2$, then $G$ has non-trivial automorphism?   The only thing I know which connects a group with its automorphism is the theorem, $$G/Z(G) \cong \mathcal{I}(G)$$ where $\mathcal{I}(G)$ denotes the Inner- Automorphism group of $G$. So for a group with $Z(G)=(e)$, we can conclude that it has a non-trivial automorphism, but what about groups with center? What UML (Unified Modelling Language) tools are available? I saw a video where the person copied a material from one object to another (Cycles).  How can I accomplish this? How do I select background music for my RPG campaign? Music is an essential component of my games. When running games set in the Star Wars universe, the music of John Williams adds a new dimension to the experience, both for me and for my players. Now that I'm starting a fantasy campaign, I'm a bit more uncertain about which music to use.  How do I create a soundtrack suitable for using in a fantasy campaign?  Specifically:   What sort of characteristics make for good back ground music? What makes for bad background music? What should I look for to get a fantasy feel? Which genres/sub-genres support fantasy games? What are good sources for fantasy background music?   A few notes:   Because the music will be used in the background of game sessions, most of the tracks should be one minute or longer, to avoid repetitive loops. Likewise, soundtracks with a variety of themes are preferred, so that they can easily support different modes of the game: exploration, combat, and chases, to name a few. Orchestral or acoustic music is preferred over music with vocals or electric instruments. Need help in proving that $\frac{\sin\theta - \cos\theta + 1}{\sin\theta + \cos\theta - 1} = \frac 1{\sec\theta - \tan\theta}$ We need to prove that $$\dfrac{\sin\theta - \cos\theta + 1}{\sin\theta + \cos\theta - 1} = \frac 1{\sec\theta - \tan\theta}$$  I have tried and it gets confusing. A program I am using spits out LaTeX tables in LaTeX files (outreg2 command from Stata), which I run using texify to make pdfs of the tables.  I crop these tables (using pdfcrop) and embed them elsewhere.  However, the pdfs include page numbers, which prevent pdfcrop from cropping directly around the table.  I need an automatic way to remove the page numbers before cropping.  I want to insert the command \pagenumbers{gobble} into the LaTeX code to automatically remove the page numbers.    I believe   texify --pdf --texinfo="\pagenumbering{gobble}" filename.tex   should work.  It does not. No exception pops up, but the page number remains. I cannot find documentation anywhere showing examples of using the --texinfo option to splice LaTeX code into the file before running the LaTeX file to create a pdf.   How should I properly use the texify command?  Or is there another way to splice in  \pagenumbering{gobble} before running texify? Why is Array.Length an int, and not an uint Why is Array.Length an int, and not a uint. This bothers me (just a bit) because a length value can never be negative.   This also forced me to use an int for a length-property on my own class, because when you  specify an int-value, this needs to be cast explicitly...  So the ultimate question is: is there any use for an unsigned int (uint)? Even Microsoft seems not to use them. Introduction to string theory I am in the last year of MSc. and would like to read string theory. I have the Zwiebach Book, but along with it what other advanced book can be followed, which can be a complimentary to Zwiebach. I would like a more mathematically rigorous book or lecture notes along with Zwiebach.   Specifically, mention whether the book discusses string theory   Rigorously? Intuitively?   What's the scope of the book? Does it cover the advanced materials, e.g. Matrix string theory, F-theory, string field theory, etc. Maybe even String Phenomenology?