How should I read from a file if there is one given as a command line argument, if not I would like to read from std::cin. I tried to solve this with pointers to istrem, but is there a better way.
I want to open a file for reading, the C++ way. I need to be able to do it for:   text files, which would involve some sort of read line function. binary files, which would provide a way to read raw data into a char* buffer.
How to render text pixel-perfectly with subpixel antialising with Illustrator? deploying and retrieving Address settings (State & Country picklists) How to add “jQuery” onclick functionality for a column each row in jQgrid to display different popups for different rows I'm looking to get data such as Size/Capacity, Serial No, Model No, Heads Sectors, Manufacturer and possibly SMART data. What a pluperfect a##hole Use the view from other cameras in the scene as VideoTexture in Cycles I have a scene with monitors that display video from cameras in the same scene (or other scenes, but all of them are linked i.e., same objects in the scene). The cameras shown on the monitors do not view the monitors, so no looping should occur.  I found  that shows how to get the effect in the Game Engine.  I would like to do this in cycles.  Essentially I would like a material input node that corresponds to the output of the composition of a particular scene. The incoming image should honor the render settings of the particular scene and any compositing applied to it.  The Render Layer node does not appear to honor the resolution or compositing settings of the scene it comes from, and is not available to apply as a texture in the material node editor (that I can find).  I understand that this could be done by rendering the animation from the various cameras, then applying that video as textures to the monitors, then rendering the camera of the monitors. That's super tedious if your making changes to the whole scene, and I don't want to do that. No sound after upgrade to 18.10, only a dummy device is shown After I updated to Ubuntu 18.10 my sound device isn't recognized anymore. Only a dummy device is shown.  I have an onboard Intel device:  lspci -nnk | grep -A2 Audio 00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)     Subsystem: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller [8086:2036]     Kernel driver in use: snd_hda_intel     Kernel modules: snd_hda_intel   The command pacmd list-cards does not show any devices:  :~$ pacmd list-cards 0 card(s) available.   This message in /var/log/syslog might have to do something with the problem:  Oct 19 21:02:06 MyComputerName pulseaudio[14331]: E: [pulseaudio]  backend-ofono.c: Failed to register as a handsfree audio agent with  ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono  was not provided by any .service files   Does anybody have the same issue? How can I fix this? Almost every time I turn my XBox on and start up Fallout 4, I am unable to use the "Continue" option because the most recent save is corrupt.  I instead use the "Load" option. Here, I can see that the last save I manually performed is perfectly fine, and load it with no problem. However, there is an additional, corrupt save with the same time stamp immediately after it.  This doesn't happen quite every time, but often enough that I'm surprised when there's no corrupt save waiting for me to delete it.  I've tried a few things to solve this, including exiting to the game's main menu before turning the XBox off, going out to the guide before turning the XBox off, turning it off immediately after saving, and waiting a while after saving.  Why do I get all these corrupt saves? Do others have this problem? How do I fix it? How to restrict some websites in Ubuntu 14.04 I would like to restrict some websites to be surfed. I mean I want to prevent access to some websites. Please guide me on how to do the same in Ubuntu 14.04 LTS. Proof of a formula for the power set of a union of two sets I need to prove that:  $2^{A\cup B} =\left \{ X\cup Y \mid X\in 2^{A}, Y\in2^{B} \right \}$  Note that $2^{A} = P(A)$ (The power set of A).  While I can prove the Right - Left direction fairly easily, It seems very hard for me to prove the Left - Right direction. Can I get some help with that?  How do I prove that $t\in2^{A\cup B}$ makes $t\in \left \{ X\cup Y \mid X\in 2^{A}, Y\in2^{B} \right \}$? Proper to add tense to acronyms, abbreviations and initialisms Where can I access OS X keyboard shortcuts, say for Dropbox sync? How is the passage of time handled in Pokemon? When did our universe and the Star Trek universe diverge? Note that my question assumes as a given that Star Trek is in an alternate universe which diverged from ours at some point in history.  That seems really, really obvious and undeniable to me.  So the question then becomes: at what point in time did the two universes diverge and have different histories? Importing only certain rows between spreadsheet documents Document 1 has many rows of data.  How do I import into document 2 only those rows that have a certain value in column C? Which is grammatically correct?  I can only do so much in this time.  or  I can do only so much in this time. What are the benefits/detriments to graduate students joining unions? Why are the longer edges being beveled more? I'll preface this by saying I'm very new to Blender - I'm trying to put a bevel on an edge, looks something like this:    As you can see, the vertical side is much longer than the horizontal side.  When I apply to bevel to the edge there, the bevel stretches proportionally - so there's 'more' bevel on the longer side.  I want to bevel without any 'ratio' like that - just a 45-degree bevel, if that makes any sense.  Do I have to put in a loop cut to make the side lengths equal?  I tried using a sub-surf modifier, but it applies on a bunch of nearby edges, when I just want to round this one corner. proof that function is constant I'm annoyed by quite a simple problem in calculus (I apologize in advance if I'm not using adequate terms in English, I don't take the course in English nor am I a native speaker):  Let $f:\mathbb R\longrightarrow \mathbb R$ be a function which is continuous at $0$ and satisfies $f(x)=f(2x)\,\forall x\in\mathbb R$.  My question is how do I formally prove that for every $x&lt;0$ $f(x)=c_1$, and for every $x&gt;0$ $f(x)=c_2$, where $c_1,c_2\in \mathbb R$? After proving those two statements (or at least one of them WLOG) it would be quite easy to prove that $f(0)=c_1=c_2$ by the definition of continuity of $f(0)$ and thus $f(x)$ is constant. Those two statements are just so obvious to see that I can't think of any formal way of proving so without "cheating". Thanks in advance! Derivation of the general forms of partial fractions I'm learning about partial fractions, and I've been told of 3 types or "forms" that they can take  (1) If the denominator of the fraction has linear factors:  $${5 \over {(x - 2)(x + 3)}} \equiv {A \over {x - 2}} + {B \over {x + 3}}$$  (2) If the denominator of the fraction has quadratic factors that don't factorise:  $${{2x + 3} \over {(x - 1)({x^2} + 4)}} \equiv {A \over {x - 1}} + {{Bx + C} \over {{x^2} + 4}}$$  (3) If the denominator has a factor that repeats:  $${{5x + 3} \over {(x - 2){{(x + 3)}^2}}} \equiv {A \over {x - 2}} + {B \over {x + 3}} + {C \over {{{(x + 3)}^2}}}$$    I'd appreciate it if someone could explain to me how these equivalence relationships are derived, essentially how do they take the forms that they do? I sort of understand the first one, but the other two I don't.  Thank you