Sizeof Structure in C
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
Why can't I press the Install button when installing applications from unknown sources? I'm trying to sideload an application, as seen in the picture below.    I have allowed the installation of applications from unknown applied actions in settings, but I can't seem to press the install button. The cancel button works correctly and installing applications via adb install works correctly. What's the problem?  EDIT: For those who have this problem, using ChainFire's  will correct it because the app uses hardware compositing, and Android doesn't notice a "layer" on top of the current screen. Differences between ways to express future actions Should I use an offset for my Poisson GLM? I am carrying out research to look at differences in fish density and fish species richness when using two different underwater visual census methods. My data was originally count data but then typically this is changed to fish density but I have still decided to use a Poisson GLM, which I hope is right.   model1 &lt;- glm(g_den ~ method + site + depth, poisson)   My 3 predictor variables are method, site and depth which I ordered as factors when I input them.   My response variables are grouper species richness, grouper density and the same for other fish groups. I am aware that density is not an integer and it is numerical data e.g 1.34849. I am now however getting this error:      In dpois(y, mu, log = TRUE) : non-integer x = 0.037500   I've been reading up and many people suggest using an offset, is this the most advisable thing to do? Solving binomial theorem via induction Suppose $K \subset L$ is a finite field extension of degree $m$. Is it true that there exists some natural $n$ such that $L$ is isomorphic to a subfield of $M^{n\times n}(K)$, the ring of $n\times n$ matrices with entries in $K$? What is the smallest dimension (as a function of $m$) for which an isomorphism exists?  The example I had in mind was the 2-dimensional extension $\mathbb{R} \subset \mathbb{C}$ with $\mathbb{C}$ being isomorphic to $\{ \begin{pmatrix}a&amp;-b\\b&amp;a\end{pmatrix} : a, b \in \mathbb{R}\}$. Read it in the 90's. I remember one specific part where the inventor of the peeking mechanic has his Eureka moment, and has the presence of mind to give a thumbs-up/wave to the future, when they look back on his Eureka moment.  I also remember that they had computer screens that were like plastic cloth that they would just unfold on whatever surface was handy.  Sorry I don't have much more to go on.  Please and thank you! Allow adding bounties from the iOS & Android app (I was surprised I couldn't find this in an existing question, so here goes)    I'd like to add a bounty to a question, but I'm too lazy to go get my computer or a web browser. I like the SE app, and want to use it to do everything. I can't find the button to add a bounty to a question.  Please add this button, I really want to be able to add bounties to questions from the app. How to I stop a launchd script from running on wake I have a simple launchd script that plays a sound every 30 minutes and it runs out of the user library ~/Library . It doesn't run if my machine is asleep, but does run the last event missed when the machine wakes. I think this is the expected behavior. My question is, how do I stop this happening. If I missed the half-hour event, I don't want it to be run at 20 minutes past the hour.  Here's the core of my script. It calls a Python script. I tried to put a block in the python script to check that I am within a few minutes of each 30 minutes, but that doesn't seem to work on wake. (Is it missing the system clock somehow?)  &lt;key&gt;ProgramArguments&lt;/key&gt; &lt;array&gt;     &lt;string&gt;/usr/local/bin/python3&lt;/string&gt;     &lt;string&gt;/Users/pheon/Documents/playsound.py&lt;/string&gt; &lt;/array&gt;  &lt;key&gt;StartCalendarInterval&lt;/key&gt; &lt;array&gt;     &lt;dict&gt;         &lt;key&gt;Minute&lt;/key&gt;         &lt;integer&gt;0&lt;/integer&gt;     &lt;dict&gt;         &lt;key&gt;Minute&lt;/key&gt;         &lt;integer&gt;30&lt;/integer&gt;     &lt;/dict&gt; &lt;/array&gt;   Here is a snippet from the python code which checks the time before playing the sound.  time0 = datetime.datetime.now() if (time0.minute % 30) &lt; 2:     subprocess.run(["/Users/pheon/bin/afplay-vol.sh", "1", bell],check=True) The cardinality of the set of all finite subsets of an infinite set Migrate to *any* site? I have an image with a woman, and I need to make an ad (size 260mmx125mm). I want to put the woman to the left side, but then right side becomes empty. So, how I should solve the problem? I have picked the color from image, but it is definitely different than in the actual picture.  Should I use the Clone Stamp Tool in Photoshop, or there is a better way to do this?  By the way, it will be used in print, so I need a good quality. Spotlight overrides first character What's wrong: I hit CMD+SPACE to open up spotlight, typically type in the name of the application I want to start, hit enter and either the wrong app or no app at all will start, because the app name is missing the first character. "Learn to type" I hear you say but wait: as I enter the first character in the search bar, the cursor jumps to the beginning of the line and my second character input overrides the first one. So entering for example "ever", in order to start Evernote, will result in "ver". "php" to start PHPStorm will result in "hp" and start my damn HP printer app and so on.   This cursor jump to the beginning of the line will not happen in any other application and even if I accept the fact that my cursor jumps from time to time, I don't get why the second character overrides the first one. I'm not even sure if you can configure your Mac to always override the character at current position, but I surely haven't.  So this keeps on happening quite regularly and I cannot reproduce it. It just happens and when I try it again (close Spotlight, CMD+SHIFT again), it won't happen again, even if I give it like 5 tries or so.  It won't kill me but I am a software developer myself and this kind of bugs just leave me frustrated plus I can not imagine that this is the desired behavior. I have seen some talk about this issue on the internet but I did not come across a solution..  I have 3 MacBooks, different ages, all with German keyboard layouts and German set as system language and they all do this. Just mentioning this, because after that fact, I can barely imagine this isn't affecting at least a lot, if not all, MacBook (Pro?) users.   13" Pro 2010 or so 15" Pro Retina 2013 13" Pro Retina 2015   They all run El Capitan but I already encountered this before. I don't know the OS X version I had installed when I first stumbled across it. How to twist radial vector to make spirals? How can I take a photo with everything in focus with my DSLR? How to install and use Ubuntu from a USB flash drive on Windows 8? I'm using Ubuntu 12.04 &amp; everything about it is great except that it just won't resume after suspend. I've tried the suggestions listed in this thread  but none worked. I'm using Lenovo Y510P. I'm new to Ubuntu, or unix for that matter, so please let me know if there's anymore  information that I should be posting. Thanks.  update  I tried the suggestion by Dima on this post . The machine wakes up from hibernation but immediately the screen gives a screen like this     Wondering if this is an issue with the graphics card or something. How to use enum values in f:selectItem(s) When should I use mmap for file access? POSIX environments provide at least two ways of accessing files.  There's the standard system calls open(), read(), write(), and friends, but there's also the option of using mmap() to map the file into virtual memory.  When is it preferable to use one over the other?  What're their individual advantages that merit including two interfaces? $(this) inside of AJAX success not working Unable to check a mdadm RAID1 array, says the file system's read only? I recently migrated a RAID1 from a CentOS 5 system to a CentOS 6 system and ever since when I attempt to perform a check I get the following:  $ echo 'check' &gt; /sys/block/md127/md/sync_action -bash: /sys/block/md127/md/sync_action: Read-only file system   This actually shows up from a CRON too, specifically, /etc/cron.d/raid-check. this is included in the mdadm RPM:  $ rpm -ql mdadm | head -5 /etc/cron.d/raid-check /etc/rc.d/init.d/mdmonitor /etc/sysconfig/raid-check /lib/udev/rules.d/63-md-raid-arrays.rules /lib/udev/rules.d/65-md-incremental.rules   Here I'm running the same command that's used by the CRON:  $ raid-check /usr/sbin/raid-check: line 96: /sys/block/md127/md/sync_action: Read-only file system   This typically runs once a week and sends an email which is what originally alerted me to the issue. But at any rate I'm at a loss why this RAID seems to be unable to be checked.  The RAID seems fine on inspection though.  $ cat /proc/mdstat  Personalities : [raid1]  md127 : active raid1 sda1[0] sdb1[1]       976759936 blocks [2/2] [UU]  unused devices: &lt;none&gt;   I point this out only because while googling I found this thread regarding a bug in mdadm but this was for a older version of mdadm.      Version info  $ lsb_release -d Description:    CentOS release 6.6 (Final)  $ rpm -q mdadm mdadm-3.3-6.el6_6.1.x86_64  $ mdadm --version mdadm - v3.3 - 3rd September 2013