Help please formulate a formula for calculating the number of all possible combinations for these conditions:   The string must contain the a certain number of characters (no more, no less )!  Symbol A - 2 count Symbol B - 3 count Note: characters and their count can be more than two (for example, C-1, D-2, E-32, etc)   I sketched all the combinations manually for an example:  aabbb abbba bbbaa bbaab baabb abbab ababb babba babab bbaba
There are 11 letters in the word.   M - 1 I - 4 S - 4 P - 2  so the number of different permutations is $\dfrac{11!}{1! 4 !4!2!}$  Is this correct solution?
I have created 50 spreadsheets for 50 students. Each spreadsheet contains 33 sheets, numbered 1 to 33, along with a couple of other sheets.  Within each of these 33 sheets, there are many protected ranges.  I accidentally protected a range that ought not to have been protected. So, with 50 students each having 33 sheets, I have over 1800 sheets to unprotected.  I want to loop through each sheet, 1 to 33, and remove protection from cell F15. Right now, I (the owner) am the only editor.  Since I'm not an actual programmer, I've clearly not done this properly.  Can someone offer a suggestion of how I can change my Google Script to make this work?  var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheets = ss.getSheets();  for (var i=2; i  &lt;sheets.length; i++) {   var sheet = ss.getSheets()[i];   sheet.activate();   SpreadsheetApp.flush();   var range = sheet.getRange('F15');        var protection = range.protect().setDescription('Protected range');        var me = Session.getEffectiveUser();        protection.addEditor(me);        protection.removeEditors(protection.getEditors());        if (protection.canDomainEdit()) {          protection.remove();          } //end of if statement  } In the 1960s I read book--an older children's book, I think--which I loved, and still remember, roughly.  I have no idea what the title is or who the author is, and I'm wondering if anyone knows this one:  Scientists had invented a device which they didn't fully understand, and which had puzzling effects.  For example, when a pencil was put into the machine, it disappeared, and then reappeared inside out: The lead was on the outside.  When people went into the machine, they came back dead, having died from fright.  Finally they sent a very open-minded person into the machine.  She was an artist, I think.  She was able to return alive, and described an alternate universe in which geometry was very different.  I distinctly remember that there were supposedly square triangles or four-sided triangles--or was it three-sided squares?  (This is, of course, a literally contradictory claim, but I didn't see the matter as clearly then.)  Thanks! 3D arrows with TikZ Asymptote does give 3D arrows when drawing three dimensional figures (they even have shade!). Could we fake it with TikZ? Here's an example, manually written, with just one arrow worked:  \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[-&gt;,scale=2]   \draw[&gt;={Triangle[width=3pt,length=5pt]}] (0,0,0) -- (1,0,0);   \draw[&gt;={Triangle[width=3pt,length=5pt]}] (0,0,0) -- (0,1,0);   \draw[&gt;={Circle[sep=-.9pt,width=3.08pt,length=2pt]Triangle[width=3pt,length=5pt]}] (0,0,0) -- (0,0,1); \end{tikzpicture} \end{document}     But that's (wrongly) manually calculated by trial and error (apart from the fact that it's not perfect, seeing how the other two axis —x and y— are oriented, it should have certain slant). It would be nice to have an interface like the other arrows  &gt;={3D[length=⟨real length⟩,width=⟨real width of the base⟩]}   Which would then calculate from those values (and, of course, also taking into account x=⟨x vect⟩,y=⟨y vect⟩,z=⟨z vect⟩)  Circle[sep=⟨value⟩,width=⟨value⟩,length=⟨value⟩,slant=⟨value⟩] Triangle[width=⟨value⟩,length=⟨value⟩] % And I'm not sure if `slant=⟨value⟩`                                        % is necessary in this Triangle case   Example  Using the code from the answer (thanks to Symbol1), for instance, this code (taking the idea from another question, link in the comments)  \begin{tikzpicture}[x={(0cm,1cm)},                     y={({cos(30)*1cm},{sin(30)*-1cm})},                     z={({cos(20)*1cm},{sin(20)*1cm})},                     thick,                     scale=3]   \pgfmathsetmacro{\ax}{.4}   \pgfmathsetmacro{\ay}{.6}   \pgfmathsetmacro{\az}{-.6}   \pgfmathsetmacro{\bx}{.4}   \pgfmathsetmacro{\by}{-.7}   \pgfmathsetmacro{\bz}{-.8}   \draw[densely dotted,thin] (\ax,\ay,\az) -- (\ax,0,\az);   \draw[densely dotted,thin] (\ax,\ay,\az) -- (0,\ay,\az);   \draw[densely dotted,thin] (\ax,0,0) -- (\ax,0,\az) -- (0,0,\az);   \draw[densely dotted,thin] (0,0,\az) -- (0,\ay,\az) -- (0,\ay,0);   \draw[densely dotted,thin] (\bx,\by,\bz) -- (\bx,0,\bz);   \draw[densely dotted,thin] (\bx,\by,\bz) -- (0,\by,\bz);   \draw[densely dotted,thin] (\bx,0,0) -- (\bx,0,\bz) -- (0,0,\bz);   \draw[densely dotted,thin] (0,0,\bz) -- (0,\by,\bz) -- (0,\by,0);   \draw[-{Cone3}] (0,0,0) -- (1,0,0) node[right] {$x$};   \draw[-{Cone3}] (0,0,0) -- (0,1,0) node[above right] {$y$};   \draw[-{Cone3}] (0,0,0) -- (0,0,1) node[below right] {$z$};   \draw[-{Cone3}] (0,0,0) -- (0,0,-1) node[above left] {$-z$};   \draw[thin] (0,0,0) -- (0,-.9,0);   \draw[-{Cone3}] (0,0,0) -- (\ax,\ay,\az) node[below left] {source};   \draw[-{Cone3}] (0,0,0) -- (\bx,\by,\bz) node[above right] {sim}; \end{tikzpicture}   gives this figure Main Reference + Appendix with "Other Sources" I need your help with references. I have 1 main reference section, and I want to include a second list of references as an appendix. For the main reference I use:  \newpage  \bibliographystyle{plainnat}  \bibliography{library}   The problem is that I don't know how to include the second list using a different bib file, and then calling the function \nocite{*} to show every sources inside the file.   I have the appendix part workout. I need your help to design the function to call the second bibliography, and that does't interfere with the main reference:   \newpage  \appendix  \section{Other Sources} \label{app:ReferencesB}   In addition, I will prefer that the word References is not shown after Other Sources.  Thank you so much!! Limit of a decreasing sequence of measurable sets. Let $(X,\mathcal{A})$ be a measurable space, with measure $\mu$. Let $\{E_n\}_{n \in \mathbb{N}} \subseteq \mathcal{A}$ be a sequence of measurable sets, with $E_{n+1} \subseteq E_n, \ \forall n \in \mathbb{N}$, that is a decreasing sequence, and $\mu(E_n)=+ \infty, \ \forall n \in \mathbb{N}$. Let $E=\bigcap_{n \in \mathbb{N}} E_n$ the limit set of the sequence, $E$ is measurable for definition. Is true that $\mu(E)=+\infty$? If not in all cases, is true with $X=\mathbb{R}^{N}$, $\mathcal{A}$ the collection of Lebesgue-measurable sets, and $\mu$ the Lebesgue measure on $\mathbb{R}^N$? What are the best practices for battery longevity? How do you maximize the cycle count of your battery?  There seems to be a debate between:   Leave plugged in 24/7 but do a full cycle once a month Charge to ~100%, drain to ~10%, repeat.   NOTE: Taking your   Which method is better and why? How much of a difference does it really make?  Here are some of the better sources I've found about battery behavior so far. Even still I feel they don't conclusively answer the question above. See my elaborations below:           Elaborating on Option 1  Now IF Apple engineers were smart and optimized for AC draw when plugged in to not use up your charge cycles, then it seem logical to assume that you are using effectively none of your 1000 charge cycles while plugged in. If that's the case, it would seem that the LiPo drop from holding at 100% would be vastly outweighed by the fact you're not using any charge cycles.  However, this is a purely speculative assumption and I could find no evidence to either confirm or deny.  If this is NOT true, and the AC adapter only goes to charging the battery, then there would be no difference. Your battery would drain to 99%, then back up to 100%, then back down to 99%, etc. Those micro-charge cycles would add up at the same rate as 100% -> 0% -> 100%, and you would get no gain. In this case the negative effect of holding LiPo batteries at 100% would outweigh everything else.  Elaborating on Option 2  There are lots of good reasons why Option 2 is the way it is:   Because of known LiPo chemistry issues, holding a 100% charge for a long time causes the battery to degrade Apple specifically recommends not to leave it plugged in all the time  Draining a battery all the way to zero all the time is bad for the cell (Which is why ~10% is used) Heat is a killer, and when plugged in AND charging, you get extra heat that causes damage.   There are a couple reasons why I'm challenging Option 2:   It seems silly that the most intuitive use case for thousands of people that use their macs as primary computers is wrong. If the hypothesis in option 1 is true, you're just burning unnecessarily through your finite charge cycles. It's a pain to have to remember to keep plugging in and plugging out and be worried about whether or not your device is plugged in. Making extra parameters optional I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit:  add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', 'index.php?page_id=71&amp;event_year=$matches[1]&amp;event_month=$matches[2]&amp;event_day=$matches[3]','top');   /whats-on/2012/01/25 I'll show all events on this date.  /whats-on/2012/01 goes to 404 but I'd like the parameter to be optional so I can show all January dates and the same for /whats-on/2012 all dates in year 2012  Any help will gratefully received - thanks Test if there are files matching a pattern in order to execute a script I am trying to write an if statement to test whether there are any files matching a certain pattern. If there is a text file in a directory it should run a given script.  My code currently:  if [ -f /*.txt ]; then ./script fi   Please give some ideas; I only want to run the script if there is a .txt in the directory. How to make pages metabox display all hierarchy in menu admin? Running WP 3.9.1  I've got lots of pages and sub pages.  When I get to create menu lots of sub pages doesn't display on the right level, but some do?    The pages metabox should display something more like this    EDIT  Number in screenshot are a bit screwed sorry about that.   The problem is after the first few all the pages are displayed on the same level but they shouldn't.  It should look like this       Page 1                      SubPage A of Page 1             SubPage B of Page 1                                      SubPage 1 of SubPage B                     SubPage 2 of SubPage B                     SubPage 3 of SubPage B                                                 Page 2                      SubPage A of Page 2                                      SubPage 1 of SubPage A                     SubPage 2 of SubPage A                                           SubPage B of Page 2                                      SubPage 1 of SubPage B                     SubPage 2 of SubPage B                                               ...    Any idea what cause this or how to fix it, so i can manage my menu? 60% Downpayment on house? Foreign key constraints failures Given the following tables:  CREATE TABLE `longdescs` (   `comment_id` int(11) NOT NULL AUTO_INCREMENT,   `bug_id` mediumint(9) NOT NULL,   `who` mediumint(9) NOT NULL,   `bug_when` datetime NOT NULL,   `work_time` decimal(7,2) NOT NULL DEFAULT '0.00',   `thetext` mediumtext NOT NULL,   `isprivate` tinyint(4) NOT NULL DEFAULT '0',   `already_wrapped` tinyint(4) NOT NULL DEFAULT '0',   `type` smallint(6) NOT NULL DEFAULT '0',   `extra_data` varchar(255) DEFAULT NULL,   PRIMARY KEY (`comment_id`),   KEY `longdescs_bug_id_idx` (`bug_id`),   KEY `longdescs_who_idx` (`who`,`bug_id`),   KEY `longdescs_bug_when_idx` (`bug_when`),   KEY `comment_id` (`comment_id`),   CONSTRAINT `fk_longdescs_bug_id_bugs_bug_id` FOREIGN KEY (`bug_id`) REFERENCES `bugs` (`bug_id`) ON DELETE CASCADE ON UPDATE CASCADE,   CONSTRAINT `fk_longdescs_who_profiles_userid` FOREIGN KEY (`who`) REFERENCES `profiles` (`userid`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=82727 DEFAULT CHARSET=utf8  CREATE TABLE `trace` (   `id` mediumint(9) NOT NULL AUTO_INCREMENT,   `comment_id` mediumint(9) NOT NULL,   `type` varchar(255) NOT NULL,   `short_hash` char(22) DEFAULT NULL,   `stack_hash` char(22) DEFAULT NULL,   `trace_text` mediumtext NOT NULL,   `quality` double NOT NULL,   PRIMARY KEY (`id`),   UNIQUE KEY `trace_comment_id_idx` (`comment_id`),   KEY `trace_short_hash_idx` (`short_hash`),   KEY `trace_stack_hash_idx` (`stack_hash`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8  ALTER TABLE trace ADD CONSTRAINT `fk_trace_comment_id_longdescs_comment_id` FOREIGN KEY (`comment_id`) REFERENCES `longdescs`(`comment_id`) ON UPDATE CASCADE ON DELETE CASCADE; ERROR 1005 (HY000): Can't create table 'bugs4.#sql-4bb_6f1d' (errno: 150)   MariaDB [bugs4]> show warnings;  | Level  | Code | Message | | Warning |  150 | Create table 'bugs4/#sql-4bb_6f1d' with foreign key     constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.  | | Error   | 1005 | Can't create table 'bugs4.#sql-4bb_6f1d' (errno: 150)                                                                                                                       |   Any idea why I get that error? FYI I looked it up and it appears that it was a bug but not anymore. spectral radius in normed space is subadditive. I am reading the book "characterizations of c*-algebras" by Doran and Belfi. On the page 299, the book reads "It can also be shown that if $xy=yx$, then $\nu(x+y)\le\nu(x)+\nu(y)$." The definition of $\nu$ is as follows: in normed algebra,  $$\nu(x)=\limsup_{n\to\infty}\|x^n\|^{\frac1n}$$  Note that the algebra is not assumed to be complete and is also not assumed to be complex scalar(we can have real scalars)  This is my trial: I just tried to mimic the proof of the Minkowski inequality, but failed.  Thank you In evaluating integral $\int\sin^{3}x dx $ I am pretty sure we need to use substitution $e^x=t$, but can't go  next step. Nielsen & Chuang Exercise 2.2 - “Matrix representations: example” I just installed Ubuntu alongside to Windows 7, and now Windows 7 will not boot.  When the system starts, it shows me entry for Windows 7 in the boot menu, when I click on the Windows 7 option in the boot menu, after few seconds it will show me the boot menu again and Windows will not boot. It shows me no error message. Windows 7 option is available in the boot menu but it just does not boot.  Here are my boot info results   update - 30/01/2012 I tried windows recovery - fix startup issues - that showed no problems but issues were not resolved  Then I tried the widnows recovery console and run following commands  bootrec /fixboot bootrec/ fixmbr bootrec /RebuildBCD   But that does not help, Now neither ubuntu nor windows will boot. When I boot from windows CD it shows me a valid windows installation in c:\ drive.  update After a lot of help I got from #ubuntu channel and trying out different things, ultimately I can now boot both windows and ubuntu, still, the issue is not completely resolved though.  Here's what made it work  Boot using ubuntu live CD and then run the testdisk utility as steps mentioned  Restart system and I was able to see the boot menu and boot into Ubuntu, then put the following code in boot/grub/custom.cfg. Restart and now I can see one more entry to boot win7, clicking on it boots windows.  menuentry "Windows 7 (loader) with grub ntldr workaround" --class windows --class os   {     insmod part_msdos     insmod ntfs     set root='(hd0,msdos1)'     search --no-floppy --fs-uuid --set=root FAF0F57DF0F54085     ntldr /bootmgr }   It will make windows boot probably but now windows have a dependency on Ubuntu and I can not remove Ubuntu or else windows will stop working.  Credit goes to 'Jordan_U' on #ubuntu channel.   update Here are the win7 boot details I got from EasyBCD  Windows Boot Manager -------------------- identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795} device                  partition=C: path                    \bootmgr description             Windows Boot Manager locale                  en-US default                 {04fe8f95-4b17-11e1-a45c-909d3d25f938} displayorder            {04fe8f95-4b17-11e1-a45c-909d3d25f938} timeout                 30  Windows Boot Loader ------------------- identifier              {04fe8f95-4b17-11e1-a45c-909d3d25f938} device                  partition=C: path                    \Windows\system32\winload.exe description             Windows 7 Home Premium locale                  en-US osdevice                partition=C: systemroot              \Windows resumeobject            {8d25a443-4b0a-11e1-a835-806e6f6e6963}   Note Still, I am looking for how can I have everything clean and how can I boot windows without having a dependency on Ubuntu. so that if ever I have to remove ubuntu, windows will keep booting file without ubuntu. Prove that $\lim_{x \to \infty} \frac{\log(1+e^x)}{x} = 1$ Show that $$\lim_{x \to \infty} \frac{\log(1 + e^x)}{x} = 1$$ How do I prove this? Or how do we get this result? Here $\log$ is the natural logarithm. Every cyclic group with order > 2 has at least 2 distinct generators Every cyclic group with order > 2 has at least 2 distinct generators   Here's what I've got so far:  Either order of our group, $G$, is finite or infinite.  Suppose infinite: then our group is isomorphic to $\mathbb Z$ under addition. This group has two distinct generators, therefore so does $G$.  Suppose finite: Then $G$ is isomorphic to $\mathbb Z_n$ under addition modulo $n$.  We know order of $G$ is $\geqslant 3$. If order of $G$ is odd, both 1 and 2 are generators of $\mathbb Z_n$ under addition modulo $n$, so $G$ has at least two generators.  If order of $G$ is even, then both 1 and some odd number between 1 and $n$ are generators. How do we determine this odd number?  Does this look like I'm on the right track? We have to prove that  "the product of two numbers ending in 6 also ends with 6" mathematically.  I have no clue how to start. I don't want you to prove it for me! but some hints would be very helpful as I'm totally stuck on how to start this prove. Let $I$ and $J$ be ideals of a Noetherian ring $A$. If $JA_P\subseteq IA_P$ for every $P\in \operatorname{Ass}_A(A/I)$, then $J\subseteq I$.   I'm reading Matsumura's Commutative Ring Theory book on my own. This is exercise $6.4$ in that book, and I fail to prove it. Could you help me with this? Thanks in advance. I'm using ubuntu 13.10 as htpc. To save some power, i have set it to suspend after 30minutes of inactivity. Before entering suspended state, a popup appears to warn me that computer is about to get put to sleep. This is a little annoyance since it appears when i resume the pc later.   How can i disable this notification for good?