java| problem null pointer when print encoding
What is a NullPointerException, and how do I fix it?
What is the "?" symbol in URL used for in php? Equivalent of typedef in C# Is there a typedef equivalent in C#, or someway to get some sort of similar behaviour? I've done some googling, but everywhere I look seems to be negative. Currently I have a situation similar to the following:  class GenericClass&lt;T&gt;  {     public event EventHandler&lt;EventData&gt; MyEvent;     public class EventData : EventArgs { /* snip */ }     // ... snip }   Now, it doesn't take a rocket scientist to figure out that this can very quickly lead to a lot of typing (apologies for the horrible pun) when trying to implement a handler for that event. It'd end up being something like this:  GenericClass&lt;int&gt; gcInt = new GenericClass&lt;int&gt;; gcInt.MyEvent += new EventHandler&lt;GenericClass&lt;int&gt;.EventData&gt;(gcInt_MyEvent); // ...  private void gcInt_MyEvent(object sender, GenericClass&lt;int&gt;.EventData e) {     throw new NotImplementedException(); }   Except, in my case, I was already using a complex type, not just an int. It'd be nice if it were possible to simplify this a little...  Edit: ie. perhaps typedefing the EventHandler instead of needing to redefine it to get similar behaviour. Was it just coincidence that Tahir Mahmood went on stage? In episode 3 of “Bodyguard,” Tahir Mahmood steps onto stage at St. Mary’s college as the Home Secretary is speaking and the two of them, plus others, are blown up by a bomb. In the next episode we discover that the stage had a weight trigger and that his arrival set it off. This heavily implies that whoever asked him to go on stage was affiliated with those who planted the bomb.  We know that Mahmood was sent on stage by advisor Rob Macdonald as part of a scheme, together with other members of the home secretary’s staff, to embarrass her. The audience knows that some of the people in on this scheme have been plotting with the U.K. security services. This, together with interference in video recordings of the event, characteristic of the security services, implicates the security services in the assassination.  In the final episode it is revealed that the bomb had been set by members of an organized crime gang who had gotten the explosives from an Islamic terrorist. A senior member of the police force had been helping them by leaking information. So, were the security services involved? If so, why? If not, who got Mahmood to go up on the stage? Was it just coincidence that he went up there at the right time? If there is a wizard that, by some means, has acquired proficiency in the use of shields, can said wizard use his shield in one hand and his arcane focus quarterstaff in the other and still cast somatic component spells?  Since the quarterstaff has been crafted to also be an arcane focus, and the Sage Advice Compendium states that you can provide the somatic components of spells with the same hand wielding the arcane focus, in this case an arcane focus quarterstaff, could that wizard still be able to perform somatic component spells while using a shield in the other?  I understand War Caster is the feat that allows you to cast somatic component spells even while using a shield and weapon or two weapons in each hand, but is this a simple way around those rules seeing as this "weapon" is your arcane focus? I would like to believe it is not, but I'm not fully fluent in the ways of spellcasting. What is a feminine version of 'guys'? I commonly use the word 'guys' to refer to a group of males colloquially. It's colloquial but not rude, off putting, condescending, patronizing (though I wouldn't use it with a group of men at a board meeting (hypothetically of course), unless I knew them). So, some that I would not consider as replacements would be    buddies: too old-fashioned dudes: too informal boys: too patronizing men, gentlemen: too formal or false respect   I realized that I had also been using it for any group of people, males and females, even just females. It worked for me and I didn't think of the gender implications, that women might not care for it. No one ever complained, directly or indirectly (rule of life: sometimes people don't complain about things they should).   But it occurred to me (maybe by reading something that sparked realization) that the intended hearers might not all care for it.  What might be a female gendered or non-gendered version of 'guys'?  Some that I've considered don't feel right about (though these may be reasonable answers) are:   dolls: too old-fashioned babes: too informal  ladies: too formal or I've heard from women, too creepy women: too factual girls: too patronizing (as much as 'boys') everyone, you all: too bland y'all: perfectly non-sexist but too regional (might work, but not everywhere)   Hopefully I haven't eliminated all the possibilities -- any suggestions? How to prove this inequality $\left|x\sin{\frac{1}{x}}-y\sin{\frac{1}{y}}\right|<2\sqrt{|x-y|}$? For any real numbers $x,y\neq 0$,show that $$\left|x\sin{\dfrac{1}{x}}-y\sin{\dfrac{1}{y}}\right|&lt;2\sqrt{|x-y|}$$ I found this problem when I dealt with . But I can't prove it. Maybe the constant $2$ on the right hand side can be replaced by the better constant $\sqrt{2}$? Thank you. Canonical has recently announced , which is Ubuntu with a specific interface for mobile devices.  Where can I get phones with this version of Ubuntu pre-installed? If no devices are available yet, where can I pre-order one? Shapefile layer no longer editable (toggle edit option greyed out) in QGIS? I would like to think that some of the software I'm writing today will be used in 30 years. But I am also aware that a lot of it is based upon the UNIX tradition of exposing time as the number of seconds since 1970.  #include &lt;stdio.h&gt; #include &lt;time.h&gt; #include &lt;limits.h&gt;  void print(time_t rt) {     struct tm * t = gmtime(&amp;rt);     puts(asctime(t)); }  int main() {     print(0);     print(time(0));     print(LONG_MAX);     print(LONG_MAX+1); }   Execution results in:   Thu Jan  1 00:00:00 1970 Sat Aug 30 18:37:08 2008 Tue Jan 19 03:14:07 2038 Fri Dec 13 20:45:52 1901           The functions ctime(), gmtime(), and localtime() all take as an argument a time value representing the time in seconds since the Epoch (00:00:00 UTC, January 1, 1970; see time(3) ).      I wonder if there is anything proactive to do in this area as a programmer, or are we to trust that all software systems (aka Operating Systems) will some how be magically upgraded in the future?  Update It would seem that indeed 64-bit systems are safe from this:  import java.util.*;  class TimeTest {     public static void main(String[] args) {         print(0);         print(System.currentTimeMillis());         print(Long.MAX_VALUE);         print(Long.MAX_VALUE + 1);     }      static void print(long l) {         System.out.println(new Date(l));     } }    Wed Dec 31 16:00:00 PST 1969 Sat Aug 30 12:02:40 PDT 2008 Sat Aug 16 23:12:55 PST 292278994 Sun Dec 02 08:47:04 PST 292269055   But what about the year 292278994? Aware abbreviating those commands need not always be helpful, I would like to know how to abbreviate them? The following is what I tried, which does not work:  \documentclass[11pt,handout]{beamer} \newcommand{\bframe}{\begin{frame}} \newcommand{\eframe}{\end{frame}} \newcommand{\ftitle}{\frametitle}   \author{Author} \title{Title}   \begin{document} \maketitle  \begin{frame} \frametitle{Outline}  \end{frame}   \bframe \ftitle{Introduction}  \eframe    \end{document}   At first I thought it might be the case that commands such as \bframe was already defined. But using \def instead still gives no desired result. Switching languages in bibliography with biblatex I would like to have a bibliography with both Cyrillic and Latin and the main document language being English. How can I make biblatex to automatically switch between languages? (without using XeTeX as suggested by some) The minimal example returns an error if the main language is English. However, with the main language being Russian the document works.  \documentclass{article}  \usepackage[utf8]{inputenc} \usepackage[russian,english]{babel}  \usepackage[backend = biber,babel=other]{biblatex} \usepackage{csquotes} \addbibresource{library.bib}  \begin{document} %\selectlanguage{russian} %if the main document language is Russian the bibliography is compiled without any problem. This is a test. \parencite{Bara2006,Baranov2001}  \printbibliography  \end{document}   The .bib entries are  @book{Bara2006, address = {New York}, author = {Bara, Judith}, publisher = {Routledge}, title = {{English Citation entry}}, year = {2006} }  @book{Baranov2001, address = {Санкт-Петербугр}, author = {Баранов, Николай А}, title = {{Эволюция взглядов}}, year = {2001} } Matching a sentence with grep Blaise Pascal's famous wager was that even if the existence of God cannot be determined through reason, a rational person should wager as though God exists, because living life accordingly has everything to gain, and nothing to lose.  What logical flaws and/or fallacies (if any) are committed in making this argument? How do TTL NAND gates work? This is supposed to be a simple NAND gate. I understand how the output is 1 if one of the inputs is zero but if both inputs are 1 then the base of Q1 is supposed to be zero. This is what I don't understand. I know that Q2 and Q3 will be in cut off so the base of Q1 is floating. If that is true, how is it zero then?When A and B are open does current flow through Q2  Q3 via R1 to turn on Q1? I have a Fujitsu laptop and all was working fine until I ended teamviewer. On the keyboard it has a numberpad on some of the letters which you press the Fn button to use. The system is acting like I have the Fn key pressed and I get numbers shown when it should be letters. If I press the Fn key the numbers go to letters. The Fn key is not stuck down. Is there a way to reset keyboard settings or a known fix. The operating system is Ubuntu 11.04 Natty. I am looking for an adjective/noun for someone who is able to speak/ makes speeches very well and uses words effectively to influence/impress people. Revision history & community wiki links show the same page latex : Exclude draftwatermark from specific pages I am using draftwatermark package. Is there any option to exclude watermark from some specific pages? Say no watermark from pg 3-4. I can not use xwatermark package. It conflicts with the geometry package of my document.  MWE:  \documentclass[12pt,a4paper]{exam} \usepackage{draftwatermark}  \usepackage{lipsum}   \SetWatermarkAngle{45}  \SetWatermarkLightness{.8}  \SetWatermarkFontSize{10cm}  \SetWatermarkScale{5}  \SetWatermarkText{\tt{12345}}  \begin{document}  \lipsum[1-20]  \end{document} I read this set of stories in the 80's.  What I recall is this:  A planet where the ruling caste was made up of humanoid women.  These women would, as almost pubescent girls, go out into the wilderness with only a spear and attempt to kill an animal in a life or death struggle.  When it happened, they would burst open a DNA packet in themselves that caused them to rapidly mature, their skin to become bronze colored, and give them some kinds of other "powers", I think over fire.  They were called "Bahronas", I think.  The population of this planet was primitive, but they were in contact with an advanced humanoid species, I think of actual homo-sapiens, who were there observing and advising them.  The advanced species wasn't allowed to intervene, just advise and watch.  The main character was a castaway boy, crash landed on their planet and stranded.  He became friendly with the ruling family of Bahronas and entered their confidence.  We find out through the course of the story that he's been genetically engineered and is not a normal boy.  At some point, the advanced species notices him and explains that he is a clone of a famous explorer and a spy, and they explain that they won't do anything in front of him.  The central part of the story is something of a blur, but, the final part of the story is told in a dramatically different style and shifts to a planet populated by catlike creatures who live in boughs of silk scarves, some of which sing.  THey are recording devices which play back the songs.  On this planet, there is another silk scarf, a white one, which doesn't play a song at all.  The cat creatures are greatly disturbed by it when they hear it's message, which they don't understand.  The narrator then goes on to say that it's a spoken word recording, made by the explorer which the boy was a clone of, explaining that he is captured and held hostage on the planet which makes the scarves, and forced to help make them (I think.) Can one introduce magnetic monopoles without Dirac strings? To introduce magnetic monopoles in Maxwell equations, Dirac uses special strings, that are singularities in space, allowing potentials to be gauge potentials. A consequence of this is the quantization of charge.  Okay, it looks great. But is this the only way to introduce magnetic monopoles?