I keep doing classes and typing away at learning programming and in a few different lesson they say this is how you declare a null variable(java and Kotlin if i remember right python is a "none" not exactly the same).   But everything I read or learn says don't do it.  Why do it or is there a legitimate use for one?  REV 1.0 Below  I edited and rolled this question back some because a none after some more digging into the subject acts very similar as a null.  Instead of changing my question please make comments on how i can look at it differently or reframe or ask better questions.
We noticed that lots of bugs in our software developed in C# (or Java) cause a NullReferenceException.  Is there a reason why "null" has even been included in the language?  After all, if there were no "null", I would have no bug, right?  In other words, what feature in the language couldn't work without null?
echo text after curl command on same line #!/bin/bash echo "$(curl -s -I https://google.com|grep Server)" abc   returns:  abcer: gws   and bash -x shows:    ++ grep Server ++ curl -s -I https://google.com ' abco 'Server: gws  abcer: gws   but    echo abc "$(curl -s -I https://google.com|grep Server)"`    returns  abc Server: gws   In other words, if I add text AFTER the curl command, it gets mangled, but it's ok if I add it before curl. What is happening? I cannot figure it out. What regular expression will match valid international phone numbers? ffmpeg is not even cutting this and other mp4s to the nearest second I have a file  Other - Analogue Clock-JEJqy1Wlovw.mp4  which is just a download from     It's 2 minutes 13 seconds long.  I had some issues cutting it to the second.  I was able to use this command   ffmpeg -ss 0 -i infile.mp4 -c copy -t 60 output.mp4  to make a file that was 60 seconds, so no problem so far.  That's the file exactly 1 minute, no issue there so far.  C:\vids\a&gt;dir blahhclo.mp4   9,590,540 bytes  C:\vids\a&gt;   C:\vids\a&gt;mediainfo blahhclo.mp4 General Complete name                            : blahhclo.mp4 Format                                   : MPEG-4 Format profile                           : Base Media Codec ID                                 : isom File size                                : 9.15 MiB Duration                                 : 1mn 0s Overall bit rate                         : 1 278 Kbps Writing application                      : Lavf58.3.100  Video ID                                       : 1 Format                                   : AVC Format/Info                              : Advanced Video Codec Format profile                           : High@L4.0 Format settings, CABAC                   : Yes Format settings, ReFrames                : 3 frames Codec ID                                 : avc1 Codec ID/Info                            : Advanced Video Coding Duration                                 : 1mn 0s Bit rate                                 : 1 146 Kbps Width                                    : 1 920 pixels Height                                   : 1 080 pixels Display aspect ratio                     : 16:9 Frame rate mode                          : Constant Frame rate                               : 25.000 fps Color space                              : YUV Chroma subsampling                       : 4:2:0 Bit depth                                : 8 bits Scan type                                : Progressive Bits/(Pixel*Frame)                       : 0.022 Stream size                              : 8.21 MiB (90%)  Audio ID                                       : 2 Format                                   : AAC Format/Info                              : Advanced Audio Codec Format profile                           : LC Codec ID                                 : 40 Duration                                 : 1mn 0s Bit rate mode                            : Constant Bit rate                                 : 126 Kbps Channel count                            : 2 channels Channel positions                        : Front: L R Sampling rate                            : 44.1 KHz Compression mode                         : Lossy Delay relative to video                  : 40ms Stream size                              : 920 KiB (10%)    C:\vids\a&gt;   But I do have an issue when I try to cut it at the following times, and it's whether I try to cut the 1 minute one or the whole 2 min 13sec one.  If I cut with -ss 0 -t 1,   it produces a file that is 1s 22ms.  So that's not too bad that's fairly close to one second. 1.022 seconds is quite good for an attempt to cut one second.  If I cut with -ss 0 -t 2, it produces a file that is 3s 19ms   That is terrible! it's meant to be one second!  If I cut with -ss 0 -t 30 then it is fine it does 30s 1ms.  Or this video for example, also an mp4   C:\blah&gt;ffmpeg -ss 189 -i vid.mp4 -c copy -t 6 someoutput.mp4  C:\blah&gt;mediainfo someoutput.mp4   produces a duration of 8s 383ms  That is so wrong though 'cos it should be 6 seconds! So that is two seconds too long!  C:\blah&gt;ffmpeg -ss 191 -i vid.mp4 -c copy -t 6 someoutput2.mp4  C:\blah&gt;mediainfo output2.mp4   shows that ffmpeg produced a duration of 10s 403ms  which is crazily wrong 'cos the ffmpeg command specified 6 seconds!  So that's not just one second out, that is 4 seconds out!  That's almost 50% longer than it should be! Is there any software that can easily create a Styled Layer Descriptor (SLD) without using a  script? Formatting a float to ###.## (two decimals) Reference — What does this symbol mean in PHP? Why can't I use a type argument in a type parameter with multiple bounds? So, I understand that the following doesn't work, but why doesn't it work?  interface Adapter&lt;E&gt; {}  class Adaptulator&lt;I&gt; {     &lt;E, A extends I &amp; Adapter&lt;E&gt;&gt; void add(Class&lt;E&gt; extl, Class&lt;A&gt; intl) {         addAdapterFactory(new AdapterFactory&lt;E, A&gt;(extl, intl));     } }   The add() method gives me a compile error, "Cannot specify any additional bound Adapter&lt;E&gt; when first bound is a type parameter" (in Eclipse), or "Type parameter cannot be followed by other bounds" (in IDEA), take your pick.  Clearly you're just Not Allowed to use the type parameter I there, before the &amp;, and that's that. (And before you ask, it doesn't work if you switch 'em, because there's no guarantee that I isn't a concrete class.) But why not? I've looked through Angelika Langer's FAQ and can't find an answer.  Generally when some generics limitation seems arbitrary, it's because you've created a situation where the type system can't actually enforce correctness. But I don't see what case would break what I'm trying to do here. I'd say maybe it has something to do with method dispatch after type erasure, but there's only one add() method, so it's not like there's any ambiguity...  Can someone demonstrate the problem for me? Soql query on parents other child object I want to write a soql query , My scenario is as follows. I have three objects objectA,objectB,objectC. objectA is the parent object for both objectB,objectC.   objectA - objectB  (Master-detail relationship) objectA - objectC  (Master-detail relationship)`   ObjectB has two fields:   Start_date__c End_date__c   ObjectC has a field:    Date__c   Now i want to retrieve records with date__c in objectC those were in between start_date__c and end_date__c of objectB. how can i achieve such functionality . I'm trying to solve a question where I need to write $\frac {1}{1+z^2} $ as a power series centered at $z_0=1$  I'm not allowed to use taylor expansion. So my first thought was to rewrite the function in a form where I can apply the basic identity:  $$ \frac{1}{1-x} = \sum_{n=0}^\infty x^n $$  So let's rewrite the original function $f(z) = \frac {1}{1+z^2} $ and use above identity:  $$\frac {1}{1+z^2} = \frac {1}{1-(-z^2)} $$ But observe that I need to center it at $z_0=1$ so I rewrote it to:  $$\frac {1}{1-(-z^2)}=\frac {1}{2z-(-(z-1)^2)} $$  I can factor out $\frac {1}{2z}$ and use the basic identity to get : $$\frac {1}{2z}\frac {1}{1-\frac{(z-1)^2}{2z}} = \frac {1}{2z}\sum_{n=0}^\infty \left(\frac{-(z-1)^2}{2z}\right)^n =\frac {1}{2z}\sum_{n=0}^\infty \frac{(-1)^n(z-1)^{2n}}{(2z)^n} = \sum_{n=0}^\infty \frac{(-1)^n(z-1)^{2n}}{(2z)^{n+1}}$$  The problem is if I ask wolfram alpha: power series$ \frac{1}{1+z^2} $centered at z = 1 it will give me a different answer that doesn't match the sum I found.  Can anyone help me figure this one out? What am I doing wrong? Simulate repeated rolls of a 7-sided die with a 6-sided die What is the most efficient way to simulate a 7-sided die with a 6-sided die? I've put some thought into it but I'm not sure I get somewhere specifically.  To create a 7-sided die we can use a rejection technique. 3-bits give uniform 1-8 and we need uniform 1-7 which means that we have to reject 1/8 i.e. 12.5% rejection probability.  To create $n * 7$-sided die rolls we need $\lceil log_2(  7^n ) \rceil$ bits. This means that our rejection probability is $p_r(n)=1-\frac{7^n}{2^{\lceil log_2(  7^n ) \rceil}}$.  It turns out that the rejection probability varies wildly but for $n=26$ we get $p_r(26) = 1 - \frac{7^{26}}{2^{\lceil log_2(7^{26}) \rceil}} = 1-\frac{7^{26}}{2^{73}} \approx 0.6\%$ rejection probability which is quite good. This means that we can generate with good odds 26 7-die rolls out of 73 bits.  Similarly, if we throw a fair die $n$ times we get number from $0...(6^n-1)$ which gives us $\lfloor log_2(6^{n}) \rfloor$ bits by rejecting everything which is above $2^{\lfloor log_2(6^{n}) \rfloor}$. Consequently the rejection probability is $p_r(n)=1-\frac{2^{\lfloor log_2(  6^{n} ) \rfloor}}{6^n}$.  Again this varies wildly but for $n = 53$, we get $p_r(53) = 1-\frac{2^{137}}{6^{53}} \approx 0.2\%$ which is excellent. As a result, we can roll the 6-face die 53 times and get ~137 bits.  This means that we get about $\frac{137}{53} * \frac{26}{73} = 0.9207$ 7-face die rolls out of 6-face die rolls which is close to the optimum $\frac{log 7}{log6} = 0.9208$.  Is there a way to get the optimum? Is there an way to find those $n$ numbers as above that minimize errors? Is there relevant theory I could have a look at?  P.S. Relevant python expressions:  min([ (i, round(1000*(1-(  7**i )  /  (2**ceil(log(7**i,2)))) )/10)  for i in xrange(1,100)], key=lambda x: x[1]) min([ (i, round(1000*(1- ((2**floor(log(6**i,2))) / (  6**i ))   )    )/10)  for i in xrange(1,100)], key=lambda x: x[1])   P.S.2 Thanks to @Erick Wong for helping me get the question right with his great comments.  Related question: If $f$ is continuous with $f(x) = f(2x),f(1) = 3$, then what is $ \int_{-1}^{1}f(f(x))\,dx$? If $f(x)$ is a continuous function such that $f(x) = f(2x)$ and $f(1) = 3\;,$ Then $\displaystyle \int_{-1}^{1}f(f(x))\,dx$   $\bf{My\; Try::}$ Here $-\infty &lt;x&lt;\infty$ and Given $f(x) = f(2x)$  So Using Recursively $$\displaystyle f(x) = f(2^1x)=f(2^2x)=..........=\lim_{n\rightarrow \infty}f\left(2^{n-1}x\right)$$   OR we can write it as $$f(x) = f\left(\frac{x}{2}\right)=f\left(\frac{x}{2^2}\right)=........=\lim_{n\rightarrow \infty}f\left(\frac{x}{2^{n-1}}\right)$$  Now How can i prove that $f(x)$ is a constant function.  Help me  Thanks How to see the error messages when I get the white screen of death? How can I see the error messages when the site I am working on gets a white screen? ref to subsection number only is there a way to reference the subsection part only? Example:  \documentclass{article} \begin{document}  \section{This is my section} For further information see subsection \ref{subsecthree} within this section. \subsection{One} \subsection{Two} \subsection{Three}\label{subsecthree}  \end{document}   Usually gives (without the stars):  1 This is my section For further information see subsection **1.3** within this section.   But I want:  1 This is my section For further information see subsection **3** within this section.   Is that possible?  [Edit] To make it more clear: I am looking for a command that works like \ref, but prints (the arabic number of) the value of the subsection counter at the position of the \label.  ======================= == Solution in LaTeX ==  There is another solution below. This is a different solution I came up with  (I cannot post an answer to my own question, so I put it here):  \documentclass{article}  \newcommand{\labelsubseccounter}[1]{     \renewcommand\thesubsection{\arabic{subsection}}     \addtocounter{subsection}{-1}     \refstepcounter{subsection}     \label{#1}     \renewcommand\thesubsection{\thesection.\arabic{subsection}} }  \begin{document}  \section{This is my section} For further information see subsection \ref{subsecthree} within this section,  which is called \ref{onepointthree}, not \ref{onepointfour}. \subsection{One} \subsection{Two} \subsection{Three}\label{onepointthree}\labelsubseccounter{subsecthree} \subsection{Four}\label{onepointfour}  \end{document}   (I would like to insert the compiled code, but don't know how, sorry) Should the network use thousands separators in numbers? Why do some devices have 200V on the case? I recently got a desktop LED lamp, and I feel a "strange" slight vibration when touching the metal case. I found that other devices also have high voltage on their case.  What is the reason/trade-off to design the PSU that way? Are "real" transformers inefficient? Even if it's harmless, why is the high voltage connected to the metal case, and not just through insulated wires?    When I turn the lamp on, the setup in the picture measures the power line (220V) 214Vpp (59Vrms). When I also touch the metal case, the voltage drops down to around 30V.  AC adaptor: Why do we need to dummy code categorical variables I have a small Problem that occurs from time to time.   Sometimes, when I copy things or when I put an object from the symbol library on my page, the whole file gets messed up. The screenshot shows it. I make the graphic on the right, Illustrator the ones on the left.   I have pixel snapping checked. Is there a way to tell Illustrator to align everything to pixels no matter what? How can I shorten my command line (bash) prompt? Currently it is:   michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$   Outside of renaming my machine and directory structure...  How could I make it be something more like:  michael:controllers$ Short description of the scoping rules? Is hiding the ball allowed in football? Imagine all our football team except one player form a tight circle, with our hands on the shoulders of the people next to us.  Inside the circle there is the eleventh person with the ball. The whole "construction" is moving slowly towards the opponent's goal. It is inevitable that we will score.  Is this illegal? If yes, according to what rule?