Im having trouble understanding what &lt;&lt; means in C. Im supposed to explain some code as a homework assignment, but it's kinda difficult to find an answer by googling.  It's related to programming a multi function shield connected to arduino (atmega328p chip)  Here's the line:  PORTB = ~(money &lt;&lt; 2);
I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ...   What I'm wondering is, at a core level, what does bit-shifting (&lt;&lt;, &gt;&gt;, &gt;&gt;&gt;) do, what problems can it help solve, and what gotchas lurk around the bend? In other words, an absolute beginner's guide to bit shifting in all its goodness.
Purge unused data (e.g. particle system, or groups) by script How can I completely remove a objects (e.g. particle system or groups used in particle systems) in blender using python?  The problem is this: I have a script, with which I create a scene (e.g. adding some normal objects and some group of objects with a particle system). For a research study I would like to repeat that that several times, without restarting blender. So I can create a scene, delete everything, e.g. with a script like this:  import bpy scn = bpy.context.scene for obj in scn.objects:     obj.select = True bpy.ops.object.delete()   If I rerun the script to recreate the scene with objects using particle system, the latter is not shown in the scene anymore (only the placeholders of the particle system). Now I'm not sure where exactly the problem lies, but I guess not everything is immediately deleted, running the script above. Only the startup of blender helps (but that's not what I want) or pushing the purge button. The purge button seems to start the command:  bpy.ops.outliner.orphans_purge()   But I can't get this piece of code to run in the console. It says that "the context is incorrect". Is there a way to purge the unused data by python script? Thanks a lot for any help. Error: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables MVC DateTime binding with incorrect date format Your visa application has been concluded - what does this mean? I got two mails from the UK embassy in Abu, saying your visa application has been concluded. I'm really confused, did I get the visa or not? What could the possible results be? What goes wrong if we add a mass term for gauge bosons without the Higgs mechanism? How can I show or hide boot messages when Ubuntu starts? Given a countable collection of metric spaces $\{(X_n,\rho_n)\}_{n=1}^{\infty}$.  Form the Cartesian Product of these sets $X=\displaystyle\prod_{n=1}^{\infty}X_n$, and define $\rho:X\times X\rightarrow\mathbb{R}$ by  $$\rho(x,y)=\displaystyle\sum_{n=1}^{\infty}\frac{\rho_n(x_n,y_n)}{2^n[1+\rho_n(x_n,y_n)]}.$$  Show that $\rho$ is a metric on $X$ whose induced topology is equivalent to the product topology on $X$.  So basically what this problem is saying is that there's a canonical way to define a metric on the countable product of metric spaces.  I showed in a previous problem that the topology induced by $\rho_n$ is equivalent to that induced by $\frac{\rho_n(x_n,y_n)}{1+\rho_n(x_n,y_n)}$.  And thus we can go ahead and just assume that $\rho_n&lt; 1$ for all $n$ and replace our infinite series by  $$\rho(x,y)=\displaystyle\sum_{n=1}^{\infty}\frac{\rho_n(x_n,y_n)}{2^n}.$$  Now comes the interesting part: how should I go about showing that the product topology on $X$ and the topology induced by $\rho$ are equivalent?    The basis for the product topology given to me in my book's definition is that of cartesian products made up the $X_n$ except for finitely many which are $O_n$ for some open subset of $X_n$.  However I believe I was able to improve upon this and show that I could decompose these into a basis where the $O_n$ were all open balls induced by their respect $\rho_n$ metric.  For $\rho$ I'm using the basis of open balls that it induces, as I can see no other reasonable choice.    However I can't seem to match these two bases up.  There are many different points $\{x_n\}\in X$ which make my infinite series less than a certain value and there is so much freedom in which terms in the series I choose to reduce in size that it seems hopeless to try and fit an open ball induced by $\rho$ into any one of my basis elements for the product topology.    Is there a more appropriate strategy for proving these two topologies are equivalent? Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is?  I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail. argument about fallacy of diff(M) being a gauge group for general relativity I want to outline a solid argument (or bulletpoints) to show how weak is the idea of diff(M) being the gauge group of general relativity.  basically i have these points that in my view are very solid but i want to understand if there are misconceptions on my part that i'm simply not getting and if its so, i ask for help to make the case more solid, or understanding why it doesn't apply (to gravity):    (thanks to Raymond Streater for making that point completely clear) gauge invariance in electrodynamics is an observation that physical observables are unchanged after a gauge transformation without changing coordinate frame ( we are ask to believe that in gravity someone did the same? that is, someone made the observation that physical observables are unchanged after a diffeomorphism-gauge-transformation, only to later argue that because of this, that there are no physical observables to begin with, that doesn't make a lot of sense, to not say that its just plain stupid circular argument ) . The invariance is of course broken when the theory is quantized and $\hbar$ makes an appearance, because it assumes a preferred scale for certain energies. The key point here is: classical gravity is not special regarding having diff(M) as a symmetry group from bulletpoints 2 and 3, if i cannot infer that Diff(M) is a gauge-invariance of electrodynamics, the same should apply to gravity   For this question, i would say that a valid answer would either disprove any of the arguments as fallacies themselves (hence showing a solid argument why gravity is special and diff(M) is without a doubt its gauge group), or improve the argument for making it bullet-proof (sorry for the pun) Ring and Subring with different Identities Basically, here's my MWE, and I need to include "Chapter" before every section title in the ToC (without changing anything else).      \documentclass[12pt]{article} \usepackage[utf8]{inputenc}  \usepackage[english]{babel} \usepackage[titles]{tocloft} \usepackage{titlesec} \usepackage{titletoc}  \addto\captionsenglish{ \renewcommand*\contentsname{\centerline{TABLE OF CONTENTS}}}  %\renewcommand{\thesection}{CHAPTER} %\renewcommand{\cftsecpresnum}{Chapter \thesection} \titleformat{\section}[display]% {\null\vskip1em\sffamily\bfseries\filcenter}{Chapter \thesection}{0em}{}[] \titlespacing*{\section}{0em}{1em}{1em}  \titlecontents{section} [1.5em] % ie, 1.5em (chapter) + 2.3em {} {\contentslabel{1em}} {\hspace*{-1.5em}} {\titlerule*[0.5pc]{.}\contentspage}  \begin{document} \newpage \tableofcontents \newpage  \section{Section One} \section{Section Two} Content \end{document}   The commented out code is what I've already tried. The first one just changes the number to "CHAPTER" and doesn't move the text in the ToC (so it just overlays on top of the name of the section), and if I include "\thesection" after "CHAPTER" it creates an infinite loop definition error. The second one causes no differences, and the code still compiles.  Thanks! Is it ever acceptable to have a  in your C or C++ application?  What if you allocate some memory and use it until the very last line of code in your application (for example, a global object's destructor)? As long as the memory consumption doesn't grow over time, is it OK to trust the OS to free your memory for you when your application terminates (on Windows, Mac, and Linux)? Would you even consider this a real memory leak if the memory was being used continuously until it was freed by the OS.  What if a third party library forced this situation on you? Would refuse to use that third party library no matter how great it otherwise might be?  I only see one practical disadvantage, and that is that these benign leaks will show up with memory leak detection tools as false positives. Dimensions of Scale (Gamma) and Offset (Beta) in Batch Norm While implementing Batch Normalization for a particular layer 'L' with 'n' hidden neurons/units in a Neural Network, we first normalize the Activation values of that layer using their respective Mean and Standard Deviation, and then apply the Scaling and Offset factor as shown:     X-norm = (X - mu)/sd X' = (Y * X-norm) + B       where    mu = mean of X and it is a (n,1) vector          sd = standard deviation of X and it is also a (n,1) vector         X = Activation values of layer 'L' with dimension (n,m) if mini-batch    size = m   X-norm = normalized X with dimension (n,m)   Y = Gamma / Scaling factor   B = Beta / Offset factor   Now my question is, what are the dimensions of Gamma and Beta ? Are they (n,1) vectors or are they (n,m) matrices ? My intuition says that since they somewhat are analogous to the Mean and Standard Deviation, they should be (n,1) vectors. How to stop Katoolin from crashing Ubuntu? I updated from 14.04 to 16.04 and used katoolin to add some Kali tools. After restart, the boot up of Linux ran codes, but stopped at a certain point never to load login. So I reinstalled 16.04, ran updates and tried again. This time, the boot menu was changed to Kali as well as the OS name (I'm using Windows 7 dual boot with Ubuntu); login started in Ubuntu style without user name, had to type in the name... then it goes to the logo screen never to log in.  How can I use katoolin without it affecting the boot menu interface? Does this happen when the user selects the option 'add Kali repositories and updates'? Are the Kali repositories necessary? I'd much rather just install the tools and not mess with the Ubuntu interface. How do I enable or disable the global application menu? I'm fairly excited for Unity, as it looks like a promising new direction for Ubuntu.  However, I do have a concern - will it be possible to use Unity without the global menu?  I have my window manager set to focus-follows-mouse/sloppy focus, and find the productivity gains to be immense. Sloppy focus is incompatible, however, with global menus, as it is possible for the focus to change while you move from window to menu.  Will Unity support an option to use window menus while still using Unity? Having problems with listings and UTF-8. Can it be fixed? Show that the set $\mathbb{Q}[\sqrt{2}] = \{a + b \sqrt{2} \mid a, b \in \mathbb{Q}\}$ is a field with the usual multiplication and addition. I'm starting on mono blue mill deck and I saw . I'm not sure about its ability.     {tap}: put a charge counter on Grindclock      {tap}: target player puts the top X cards of his or her library into his or her graveyard, where X is the number of charge counters on Grindclock.   If I just cast  and use its first ability, will the second ability take effect, or do I just put a charge counter on it? If there's already one charge counter on it and I use the first ability again, it will have two charge counters on it? Then the second ability will take effect with two cards being sent to graveyard?  If I use spells or ability to untap it after being used can I use its ability again on the same turn? Why are springs shaped the way they are? Why are springs coiled the way they are? Why not some other shape? Is the shape due to its elasticity or something? It appears that in anticipation of D&amp;D Next Wizards of the Coast has removed much of the Dungeons and Dragons, 3rd Edition Web content. I didn't perform a thorough search to determine if all the content is removed (e.g. I know the Three Dragon Ante Web enhancement  and the Mind's Eye column about psionic tattoos  are both gone--better not to ask why those are my go-to articles), but it all might be.  What's the best way--and by best I mean both legal and convenient--to continue to access this content?