I was taking a look to java java.lang.Integer class and I noticed much methods with ">" and "&lt;" operators but I don't know what are.  For example the method Integer.signum(int i):  public static int signum(int i) {     // HD, Section 2-7     return (i &gt;&gt; 31) | (-i &gt;&gt;&gt; 31); }   Or Integer.rotateLeft(int i, int distance)  public static int rotateLeft(int i, int distance) {     return (i &lt;&lt; distance) | (i &gt;&gt;&gt; -distance); }
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.
Have a web-part display only sub-folders? I am new to SharePoint 2013. I was curious how to put a WebPart for a Document Library on a page with SharePoint 2013, not 2010.   This WebPart would then show the content of a specific library folder and not start at the root of the folder. So say I have a library with multiple folders like "Marketing", "Finance" etc,   I want to be able to create a web part that would only show the contents within the “Marketing subfolder and all of it contents. Is this possible? I'd like to map an int value pbs_errno declared as a global in the library libtorque.so using ctypes.  Currently I can load the library like so:  from ctypes import * libtorque = CDLL("libtorque.so")   and have successfully mapped a bunch of the functions. However, for error checking purposes many of them set the pbs_errno variable so I need access to that as well. However if I try to access it I get:  &gt;&gt;&gt; pytorque.libtorque.pbs_errno &lt;_FuncPtr object at 0x9fc690&gt;   Of course, it's not a function pointer and attempting to call it results in a seg fault.  It's declared as int pbs_errno; in the main header and extern int pbs_errno; in the API header files.  Objdump shows the symbol as:  00000000001294f8 g    DO .bss   0000000000000004  Base        pbs_errno The easiest thing to do is [to] call for a taxi Overriding public virtual functions with private functions in C++ Can we get a better wording for protected questions? For context, see .  In essence:     "This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation (not including the ) on this site."   Suggested addition to existing message is in bold. I've seen this Kuratowski definition for ordered pairs, but can't fathom why it implies an order to $x$ and $y$  $(x,y):=\{\{x\}, \{x,y\}\}$  As I understand sets, $\{\{x\}, \{x,y\}\}$ is also $\{\{x,y\}, \{x\}\}$. Only when I think about the Axiom of Union does $\{\{x\}, \{x,y\}\}$ "collapse down" to $S = \{x, y\}$, but that doesn't give me much either. All I can see is some as yet hidden message in the set saying "I am the set $\{x,y\}$ and my order of $x$ first is indicated by having $\{x\}$ along for the ride." Is there a way to export large multi-layered Illustrator file to Photoshop?  When I export with preserve layers and text edit-ability, the complex layers are flattened. I've reorganized my layers to have simple groupings but that's time consuming.  Is there a more effective way of doing this? Or script to automate it? My text introduces multi-quibt quantum states with the example of a state that can be &quot;factored&quot; into two (non-entangled) substates. It then goes on to suggest that it should be obvious1 that the joint state of two (non-entangled) substates should be the tensor product of the substates: that is, for example, that given a first qubit $$\left|a\right\rangle = \alpha_1\left|0\right\rangle+\alpha_2\left|1\right\rangle$$ and a second qubit $$\left|b\right\rangle = \beta_1\left|0\right\rangle+\beta_2\left|1\right\rangle$$ any non-entangled joint two-qubit state of $\left|a\right\rangle$ and $\left|b\right\rangle$ will be $$\left|a\right\rangle\otimes\left|b\right\rangle = \alpha_1 \beta_1\left|00\right\rangle+\alpha_1\beta_2\left|01\right\rangle+\alpha_2\beta_1\left|10\right\rangle+\alpha_2\beta_2\left|11\right\rangle$$ but it isn't clear to me why this should be the case. It seems to me there is some implicit understanding or interpretation of the coefficients $\alpha_i$ and $\beta_i$ that is used to arrive at this conclusion. It's clear enough why this should be true in a classical case, where the coefficients represent (where normalized, relative) abundance, so that the result follows from simple combinatorics. But what accounts for the assertion that this is true for a quantum system, in which (at least in my text, up to this point) coefficients only have this correspondence by analogy (and a perplexing analogy at that, since they can be complex and negative)? Should it be obvious that independent quantum states are composed by taking the tensor product, or is some additional observation or definition (e.g. of the nature of the coefficients of quantum states) required?  1:  (bottom of p. 18) &quot;so the state of the two qubits must be the product&quot; (emphasis added). When can an autonomous system be written using a Hamiltonian? Styling border to match fill in QGIS? In the past I have just manually matched the color of the border to the color of the fill, but this can be time consuming.   I am wondering, is there any way to have the program automatically match the border color to that of the fill?   The fill color is being assigned through the styling tab in layer properties.  Using QGIS 2.8.6 Get a resource using getResource() When to use \par and when \\, \newline, or blank lines Getting a closed form from $\sum_{i=1}^{n-1} \sum_{j=i+1}^{n} \sum_{k=1}^{j} 1$ I have a brand new 32GB flash drive that was bought from Hong Kong but manufactured in China.  When I plug it in, it's detected, and when I examine the properties of the drive the size is reported to be 31.2 GB.  Windows forces me to format it but I have not manged to actually do that.  I then I browsed the internet and a forum told me to change the letter to L. After I did that I searched many programs that can help me format it, but when I checked it back, it is 4MB now.  Any idea what's happening with my drive? Proving the measure of an increasing sequence of measurable sets is the limit of the measures Object-orientation in C What would be a set of nifty preprocessor hacks (ANSI C89/ISO C90 compatible) which enable some kind of ugly (but usable) object-orientation in C?  I am familiar with a few different object-oriented languages, so please don't respond with answers like "Learn C++!". I have read "" (beware: PDF format) and several other interesting solutions, but I'm mostly interested in yours :-)!    See also Start modal operator from a click in panel I want to start a modal operator by clicking a button in a panel in the properties region. It should then stop when I click somewhere in the 3D viewport. I want to execute some code when I start and finish the operator (see the code below). I tried modifiyng the modal operator template with an execute method to start the modal operator. But the now the context.space_data.type is always &quot;PROPERTIES&quot; because that's where the panel is located, I guess. Is this a bad way of doing what I want? class MY_OPERATOR_OT_click_on_3dview(bpy.types.Operator):          bl_idname = &quot;mesh.click_on_3dview&quot;     bl_label = &quot;Click on 3D&quot;      def modal(self, context, event):                  if context.space_data.type != 'VIEW_3D':             return {'PASS_THROUGH'}                  if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:             # allow navigation             return {'PASS_THROUGH'}         elif event.type == 'LEFTMOUSE':             # DO ALL THE POST-SELECT STUFF             return {'FINISHED'}         elif event.type in {'RIGHTMOUSE', 'ESC'}:             return {'CANCELLED'}          return {'RUNNING_MODAL'}      def execute(self, context):         # DO ALL THE SETUP STUFF           context.window_manager.modal_handler_add(self)              return {'RUNNING_MODAL'}            def cancel(self, context):         print(&quot;CANCEL???&quot;) I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing).  Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb.  In the database project I have a function which retrieves a data table as follows   private class AdminDatabase    ' stores the connection string which is set in the New() method    dim strAdminConnection as string     public sub New()    ...    adminName = dlgopen.FileName    conAdminDB = New OleDbConnection    conAdminDB.ConnectionString = "Data Source='" + adminName + "';" + _        "Provider=Microsoft.ACE.OLEDB.12.0"     ' store the connection string in strAdminConnection    strAdminConnection = conAdminDB.ConnectionString.ToString()    My.Settings.SetUserOverride("AdminConnectionString", strAdminConnection)    ...    End Sub     ' retrieves data from the database    Public Function getDataTable(ByVal sqlStatement As String) As DataTable         Dim ds As New DataSet         Dim dt As New DataTable         Dim da As New OleDbDataAdapter         Dim localCon As New OleDbConnection           localCon.ConnectionString = strAdminConnection          Using localCon             Dim command As OleDbCommand = localCon.CreateCommand()             command.CommandText = sqlStatement             localCon.Open()             da.SelectCommand = command             da.Fill(dt)             getDataTable = dt         End Using      End Function End Class   When I call this function from my Word 2007 Template project everything works fine; no errors. But when I run it from the console application it throws the following exception     ex = {"The 'Microsoft.ACE.OLEDB.12.0'   provider is not registered on the   local machine."}   Both projects have the same reference and the console application did work when I first wrote it (a while ago) but now it has stopped work.  I must be missing something but I don't know what.  Any ideas? First, this question is motivated by the imprecise question: Is there a sensible notion of parity (evenness and oddness) for real numbers?   Here are some properties a notion of parity for $\mathbb{R}$ should have:    It should be an equivalence relation on $\mathbb{R}$ with exactly two equivalence classes.  Each equivalence class should be dense in $\mathbb{R}$. There should be some kind of symmetry between the two equivalence classes. (This is intentionally imprecise.)   If we divide $\mathbb{R}$ into rationals and irrationals, this lacks symmetry, since the rationals have measure zero and are countable, while the rationals have infinite measure and are uncountable.   So we could require that each equivalence class be uncountable and/or have positive (or infinite) measure. Then take one equivalence class to be the rationals, union with countably many fat cantor sets with positive measure, and the other class its complement. Then both classes are now dense, uncountable, and have infinite measure. But again, symmetry is lacking. One of these classes is "uncountable everywhere" and has "positive measure everywhere" while the other does not.   I propose some definitions: A subset $A \subset \mathbb{R}$ is uncountable everywhere if for any open interval $(a,b)$, the intersection $A \cap (a,b)$ is uncountable. A subset $A \subset \mathbb{R}$ has positive measure everywhere if for every open interval $(a,b)$, the intersection $A \cap (a,b)$ has positive measure. We can see immediately that having positive measure everywhere implies being uncountable everywhere, since a positive measure set must be uncountable.   Finally, my questions:    Is there a partition of $\mathbb{R}$ into two sets that are both uncountable everywhere?  Is there a partition of $\mathbb{R}$ into two sets that both have positive measure everywhere?  Is there a partition of $\mathbb{R}$ into two sets that split each interval $(a,b)$ into two parts of equal measure?   Potential generalizations for extra credit: What about partitions of $\mathbb{R}$ with $n$ equivalence classes, where $n \in \mathbb{N}$, or even with countably many, or even uncountably many equivalence classes?  Note: If you've seen these definitions of uncountable everywhere or positive measure everywhere somewhere under a different name, please let me know. I've never found anything where other people were thinking about these notions.  EDIT: By "measure," I mean Lebesgue outer measure, so we don't have to worry about anything being measurable. What is $i^i$ and $(i^i)^i$ What is $i^i$ and $(i^i)^i$. I fond some answers  but is there a clearer explanation of this? Maybe something help me to understand.