Cast int to unsigned int c++
When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
Probability of rolling 3 mutually exclusive dice Is there a way to combine custom settings with custom labels ? So that the output from a setting value would be a custom label ?   To explain:  In example, we have an international organisation, and say countries are stored as an ISO code. As this is a limited and stable set of data, using custom settings would be the appropriate way to deal with say the full country name.   The issue arises when I do not just want to store the English country name, but want to have it translatable, presenting the right translation depending on the user's locale. Now, this is the point where I'd like to integrate custom settings with custom labels.  So that say the custom setting with name 'some iso code' doesn't return the full country name, but Label.Country'some iso code', which is than automatically translated in the right version.   Sounds good right. But as custom settings are fixed to certain types, as far as I've gotten is put the label name in the settings as a string value. And then .. i'm stuck :).  No way to cast a string to a Custom label, or have it be interpreted (and translated) as such, or is there ?   I'm aware this can be done in a custom object &amp; apex, I was hoping for a more automated, "cleaner", less resource consuming way, better integrated, configurable way.  Additional clarrification: *The goal is to extend the use of custom labels (translation workbench), by adding a mapping from any data-based value to a custom label.*   While we could do a long matching process in apex, it would be faster &amp; neater if the custom settings mechanism could be used. There are disadvantaged to custom objects, they require soql &amp; apex, while custom settings &amp; custom labels are cached. They too can be used in many other places. Countries were an example, I'd use this mechanism for every variable value that needs to be translatable. Why are dot underscore ._ files created, and how can I avoid them? I am using different operating systems on different machines on different locations. I am using a USB flash disk to keep my files (source codes etc.).  I am new to Mac OS X and now I realize there are lots of files created with a dot underscore ._ prefix.  Questions  Why are ._ files created?   What are their purpose?   How can I avoid them? Service not avaliable Unity3d error in Kubuntu I'm trying to use  in Kubuntu, but I'm getting this error:  Service not avaliable, please try again later.   I've found :  Certain systems may experience "Service unavailable" errors when trying to log in. WORKAROUND: Launch Unity with LD_PRELOAD=/usr/lib/libresolv.so.2 /path/to/Unity (check the path to your local libresolv)   I've checked the path of libresolv.so.2 in my computer. I found it under /lib32/libresolv.so.2 and under /libx32/libresolv.so.2. (Don't know what the difference is).  When I run:  LD_PRELOAD=/lib32/libresolv.so.2 /opt/Unity/Editor/Unity   I get:  ERROR: ld.so: object '/lib32/libresolv.so.2' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.   and when I run:   LD_PRELOAD=/libx32/libresolv.so.2 /opt/Unity/Editor/Unity   I get:   ERROR: ld.so: object '/libx32/libresolv.so.2' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.   With both commands I also get this:  /opt/Unity/Editor/Unity: /opt/Unity/Editor/Data/Tools/libgpg-error.so.0: no version information available (required by /lib/x86_64-linux-gnu/libgcrypt.so.20)   Any suggestion? How do I remove Windows 7 from my dual boot system with Ubuntu? I recently made the switch to Ubuntu. Everything on my laptop works fine except my hybrid graphics card. It is Intel graphics combined with Nvidia GeForce GT650M. I tried Bumblebee, but primusrun doesn't work (segmentation fault, core dumped) and optirun works with glxspheres64, but steam games look worse with optirun than with Intel graphics (e.g. Surgeon Simulator 2013 runs fine with Intel and hangs a lot with optirun)   I tried Nvidia Prime, but it gives me a black screen on startup after install, so I can't do anything and have to power off my PC with the power button. I also tried nvidia-prime 0.5 on Ubuntu 14.04, and then I get 'low-graphics mode' and I can't get to Unity. Illustrator Vector Graphics Appearing Pixellated This has been puzzling me for a few days now, and I asked a graphic designer I knew before trying here and haven't been able to solve it yet. It's quite weird so please bear with me for a bit.  I am using Adobe Illustrator to create a logo, and I have something that can potentially work. I have used only the pen tool with strokes (no fill), but the issue is, when I view the logo at 100%, it looks pixellated! I know vectors should not even be able to appear pixellated, but they are. Here is the screenshot from AI, without exporting to anything:     That was just done using the snipping tool within Windows, and it's at 100% zoom.  I have anti-aliasing turned on from Edit > Preferences > General, and the document resolution is at 300 ppi (I get the same result with 72 ppi).   Could anyone help me with this?   If relevant: Using CS6, and have a 24 inch Dell U2412M at 1920x1200 resolution. I do have a 21.6" Samsung at 1680x1050 and I get the same result there as well. Let me know if you need any other settings, or if you would like the file, I'd be happy to provide it to be able to solve this problem. I came across this example on WordWeb while going through the meaning of the word ''.     the program brought an avalanche of mail (Just like "a group of man men").   I'm quite sure it should be mails. Kindly confirm. Please show changed titles separately in edit diffs In an edit diff, when the revision changes the title, removed words are shown struck out in red and added words are shown with a green background. This is fine when there are only removed words, or only added words, but when there are both, the result is difficult to read.        Getting default accessible fields of… No. Getting accessible fields of an object in a Salesforce object… No. Getting accessible fields of a Salesforce object using REST API. Phew. Yeah, ok.        Program causes run. Time error? Oh, Program causes run-time error … when run on specific machine. Yeah, sounds sensible. What was the old title? Oh dear…  Please show both the old title and the new title, one below the other. Universe being flat and why we can't see or access the space "behind" our universe plane? I'm a layman, but i watched some intereting videos about big bang on youtube[michio kaku, hawking this kind of things, not some crackpots :)]   I described everything on my picture:     So is there any possibility to see that inner side, for example, by creating wormhole, or entering new dimension? Or i get something wrong, on the way, and my model is totally wrong?  And another question. I heard that even if you would fly a ship across the universe you would eventually end in the place where you started, because we live in a 3d space that is defined on a surface of big sphere. But why a big sphere? Universe might be a big mobius strip, and the same principle of ending at start will apply. Is it possible?  Thanks in advance, and please don't bash me for silly questions. Im just curious, but i don't have any degree in physics. Im also not an english native speaker. It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success. How to add a matrix to a LaTeX document How do we add a matrix to a LaTeX document? I want to show that $$f: \mathbb{R}_{\geq0} \to \mathbb{R}_{\geq0}$$ $$x \mapsto x^s$$ is Holder continuous with Holder exponent $s \in \mathbb{R}$, where $0&lt;s \leq 1$. So what I want to show is that $\exists \hspace{2 mm} C \in \mathbb{R}_{\geq0}$ sucht that for all $ x,y \in \mathbb{R}_{\geq0},  $ $$|x^s -y^s| \leq C|x-y|^s$$ and therefore, assuming, wlog $\hspace{1mm} x&gt;y$ $$(x^s -y^s) \leq C(x-y)^s.$$  I thought about Bernoulli's inequality but couldn't make that work.I thought about the binomial theorem, but didn't know how to handle the fact that $s \in \mathbb{R}$. Is there a single word that is a more vicious connotation of "competition"? What does this depiction of a black hole in the movie Interstellar mean? I was expecting a whirlpool in 3D and the matter glowing from friction as it nears the center, as I expected a event horizon to be negligible visually.  How does this depiction work? How big is the central sphere? I am puzzled by the perpendicular circles. Are they the event horizons if they are both visible? What would be a path of a particle as it gets swallowed into the singularity? Many of the people have asked almost the same question.  I'm trying to render a big mesh + fur/grass file with a few characters on the screen.  when I hit render, after a number of processing, copying data to gpu etc... i get following error.  Mem: 2960.07M, Peak:2960.07M | CUDA error: Out of memory in cuMemAlloc(&amp;device_pointer, size).  I'm using Geforce GTX 690 which contains 4GB memory.   Can somebody tell me how can i get GPU rendering, while 2960M is far less then 4196M of memory.   I know somebody would suggest me to use CPU.. but i'm curios why not GPU?   I've already compressed texture, etc   Edited  I don't think any other application is using any of my 1GB remaining memory. everything is closed but blender is there, also the GPU utilities are showing 2000/2000 MB are free on one card and 1900/2000MB is free on 2nd card.    i'm using GTX 690. with two GPUs of 2GB each. If somebody thinks that one GPU should have memory matching to the cuda memory/or Peak memory then I'm doubtful. Because in preferences Blender does know that I have 2GPUs where I can select either first GPU or second GPU or even both.   When I render some of smaller objects/scenes both of my GPU renders simultaneously with two blocks.  I'm running following specs  Xeon E5-1660 0 24GB - 1600mhz GTX690 Show that a ring is commutative if it has the property that ab = ca implies b = c when $a\neq 0$ Show that a ring is commutative if it has the property that ab = ca implies b = c when $a\neq 0$.   This is my proof to show that a ring is commutative if it has the property that ab = ca implies b = c.  We need to show that if x, y ∈ R then xy = yx. Let a = x, b = yx and c = xy. Then ab = x(yx) = (xy)x = ca. Thus, by the hypothesis, b = c, or xy = yx. Thus, for x, y ∈ R we have xy = yx.   How would I show when $a\neq 0$? The ring $\Bbb Z\left [\frac{-1+\sqrt{-19}}{2}\right ]$ is not a Euclidean domain Union of uncountable cardinals I have to prove the following:  Let $\omega_1$ be the least uncountable cardinal and, for each $n \in \omega$ (here, $\omega$ is the set of natural numbers denoted as an ordinal/cardinal), $n\ge1$, let $\omega_{n+1}$ be the least cardinal that is greater than $\omega_n$. Show that $\bigcup_{n\in\omega}\omega_n$ is a cardinal.  I suppose the proof has something to do with transfinite induction/recursion, but I don't know exactly how I'm supposed to use it. Any thoughts? What's the -alhF flag in ls? What is the -alhF flag in ls? I can't find it in the .