I have a function which return type is Object, when function return NULL, I am getting a object reference not set error. If I Use .ToString(). So how do I override the .ToString() to return empty when it returns null??
Here's the scenario...    if (entry.Properties["something"].Value != null)   attribs.something = entry.Properties["something"].Value.ToString();   While effective and working correctly, this looks ugly to me.  If I don't check for a null before performing the ToString() then it throws an exception if the property was null.  Is there a better way to handle this scenario?  Much appreciated!
When is $2^n \pm 1$ a perfect power Is there an easy way of showing that $2^n \pm 1$ is never a perfect power, except for $2^3 + 1 = 3^2 $?  I know that   gives the result directly, but I'm hopefully for a more elementary method.    I can show that it is never a square, except for $2^3 + 1$.  Proof: Cases $n=1, 2, 3$ are easily dealt with. Henceforth, let $n\geq4$.  $2^n -1 \equiv 3 \pmod{4}$ hence is never a square.     If $2^n +1 =x^2$, then $2^n = (x-1)(x+1)$ and both of these are powers of 2. Thus we must have $(x-1) = 2, (x+1) = 4$. This gives the solution of $2^3 + 1 = 3^2$.    Let's now do an odd prime.  Say $2^n +1 = x^p$. Then $2^n = x^p - 1 = (x-1)(x^{p-1}+x^{p-2} + \ldots +1)$, so both terms are powers of 2. We have $ x = 2^m+1$ is odd. But the other term is the sum of $p$ odd numbers, hence is odd. Since this is clearly greater than 1, we get a contradiction.  Say $2^n -1 = x^p$. Then $2^n = x^p + 1 = (x+1)(x^{p-1} - x^{p-2} + \ldots -x +1 )$, so both terms are powers of 2. We have $x = 2^m -1$ is odd. But the other term is the sum of $p$ odd numbers, hence is odd. Since $x^p + 1 \neq x+1$ except for $p=1$, this means that the term is greater than 1. Hence we get a contradiction. Sorting seach results in Android app The issue is how can user sort questions for a particular search query?   For example, I would want to search questions for  and want to see newest questions first.  Right now If we write any query in Search Questions... input box then users are not able to select sorting options as search questions input box takes whole width of the screen and sorting options box gets hidden.  I have also tried to select sorting options first and then search for  but still its showing questions without considering sorting option I have selected. If/Else with Selenium IDE - when confirmation message comes up I have a scenario, in case of the user registration successful, it will display a success message on the next page otherwise an error message shows on the same page. How to automate the test case to return as passed if it is success and failure in case of error message comes up.  Please help me out here. my circuit is shown on the picture. the problem is the output of the mosfet does't work as desired. For example, If I use Vin=100V and the duty cycle is 50%, the output is Vout=19V.  Anyway, the output is not even near to the desired value. can you help, please? Let $R$ be a ring such that $x^4=x$ for every $x\in R$. Is this ring commutative? Show that  $$\lim \frac{1}{n} \sum_{i=1}^n \frac{1}{i} =0 $$  I've proved that this sequence converges (it is bounded and decreasing). NOW, I need to find a sequence that is bigger than this one and goes to zero. Maybe something using geometric serie of 1/2  Thanks in advance! Let $Z_n$ be the set of all $n \times n$ matrices that commute with all $n \times n $ matrices. Show that $$Z_n = \{\lambda I_n \ | \  \lambda \in \mathbb R\}$$  ($I_n$ is the $n \times n$ identity matrix)  I don't know how to use $E_{ij}$ (matrix with $1$ in $(i,j)$ and $0$ elsewhere) and the elementary matrix $P_{ij}$ to prove this question. Can anyone explain it please? How do you run Ubuntu Server with a GUI? How to effectively deal with Imposter Syndrome and feelings of inadequacy: "I've somehow convinced everyone that I'm actually good at this" Fréchet differentiability from Gâteaux differentiability Let $X$ be a Banach space and $\Omega \subset X$ be open.  The functional $f$ has a Gâteaux derivative $g \in X'$ at $u \in \Omega$ if, $\forall h\in X,$ $$\lim_{t \rightarrow 0}[f(u+th)-f(u)- \langle g,th \rangle]=0$$   How can I prove the following:  If $f$ has a continuous Gâteaux derivative on $\Omega$, then $f \in C^1(\Omega,\mathbb R)$. What is the difference between class and instance attributes? Particular solution of $y''-4y'+5y = 4e^{2x} (\sin x)$ How do I find the particular solution of this second order inhomogenous differential equation? (Using undetermined coefficients).  $y''-4y'+5y = 4e^{2x} (\sin x)$  I can find the generel homogenous solutions but I need help for the particular. I normally dual-boot with 12.04 and Win XP pro sp3 on a Thinkpad R60.  I needed to reinstall windows because of problems piling up, so I ran the computer's built-in hard-disk recovery software.  I told it not to mess with the other partitions, but somehow it deleted the Linux partition.  That's what I was using to backup all of my windows files, so now everything I have is gone.  I just ran the USB setup with linux, and the partition is deleted - it just shows it as empty space.    Is there ANY way to get all of my files back? Why is $1$ not a prime number? Dollar Sign corrupts question In  my question () contains a "$" in a quoted section of the question.  Originally I had a second "$" in a second quoted  section of the same question.    However when I did this the second $ seemed to trigger a style that made the text italic and lost spacing between words.  I took out the second "$" and instead emphasized it with the word "dollars" which solved the immediate problem.  However, in the listing of the question, (not the question itself) the same thing happens after the first "$".  The summary shows the text without spaces between words and in italic.  Seems like a bug.  Below is a verbatim copy/paste of the original issue (two dollar signs):    I was able to find a small ESC for about $12 off of ebay.  If you were designing a robot, would you see that and think?       $12 bucks for an ESC that connects to simple pulse-wave interface -   sign me up!   Or would you think:     $12 just to control a motor? I could throw together an H-bridge for   $0.50 and be done with it.   My robot in particular actually has two motors and therefor $24 to control the two of them.  But the interface is really easy (plus has the added advantage of being R/C vs computer controlled with a simple change of connectors.  Which way would you go? The bottom border on the timeline page looks wrong if a title is multiline Today I bought an ibook G4 from a garage sale. The people who sold it to me didn't know the password for the 2 accounts on it. Apparently it was the guys late father's laptop. Any suggestions on how to get into the laptop and set a new admin account and password? How does the bounty system work? I've got `PDOException: SQLSTATE[HY000] [2002] No such file or directory` when using drush I installed Drush for the first time (so it may be a configuration error) and I'm trying to update to the latest core version of Drupal.  Drush is giving me this error - I'm on an OSX box.  dev5:clientnamedirectory my.name$ drush pm-update projects drupal-7.25 &lt;h1&gt;Additional uncaught exception thrown while handling exception.&lt;/h1&gt;  &lt;h2&gt;Original&lt;/h2&gt;&lt;p&gt;PDOException: SQLSTATE[HY000] [2002] No such file or directory in drupal_get_installed_schema_version() (line 155 of /Users/my.name/Sites/proface/includes/install.inc).&lt;/p&gt;  &lt;h2&gt;Additional&lt;/h2&gt;  &lt;p&gt;PDOException: SQLSTATE[HY000] [2002] No such file or directory in system_list() (line 165 of /Users/my.name/Sites/clientnamedirectory/includes/module.inc).&lt;/p&gt;&lt;hr /&gt;  Drush command terminated abnormally due to an unrecoverable error. I am a Bangladeshi citizen. Back in 2013, I went to India with a tourist visa and overstayed for four days. It was due to a gout attack in my feet but I don't have my medical papers to prove that.  I applied again in 2015 for a visa, at Dhaka, and they refused my visa and blacklisted my passport, writing some numbers and date on it. Now I am not able to get an Indian visa.  How I can remove my passport from the blacklist and get a new Indian visa? Do I need a Indian immigration lawyer to do this?