Why is "mod(n)" so central to most aspects of cryptography?

When I first started learning cryptography, I had my first a-ha moment when I fully appreciated the value of a One Time Pad and XOR and all the functions that attempt to emulate that OTP's randomness (PRP/PRF).  Now that I'm learning about the math behind various lemmas, I see a recurring theme regarding "take the modulo of a number, and then do f()".  That is a reoccurring theme that I don't fully appreciate, or understand.  So why is mod(n) used so frequently in cryptography?  What is consistent, special or useful about mod(n) that makes it so consistently used by cryptographers such as XOR is?


Documents required for a mexican citizen getting married to Sri Lankan in Dubai

Which documents are needed for getting married in Dubai to a Mexican woman? She will come on a visitors' visa and she will come between 5 to 10 days. I have resident visa and I am from Sri Lanka . What documents are needed from her? And how can find a any marriage service consultant?


There was lot of discussion in this question:   So much discussion that it made me confused. So... what is a database, anyway? Are only relational databases "databases"? Are object-oriented databases "databases"? Is any system that allows me to store and retrieve information (like a map, list, etc) a database?   Or does a database have to store/retrieve information and also have some administration features like Users and Privileges? Was dBase III plus a database, since it wasn't really relational?


A book where 2-dimensional species evolved on rapidly changing environment

I remember a book that described various lifeforms evolving in the galaxy (and i think may be the overriding theme was extinction).  One of them was 2-D species evolved on rapidly changing environment (probably rings of some planet?)  For some reason I'm thinking it may have been "Manifold" series but I honestly don't remember anything about that series, so it's just a vague feeling.


PC fails to start after installing AMD drivers

I am running Ubuntu 18.04 LTS on a custom PC and it was working great until I installed AMD drivers. I installed Crimson Edition 15.12 driver for ubuntu 32-bit. After the drivers were installed I can't even get the computer up and running to the boot menu it is simply just a black screen so I can't even get into the BIOS or recovery mode to try and fix the issue. I have tried booting it with the graphics card both installed and uninstalled. I am looking for a solution to get my PC up and running so I can remove the drivers. Any help would be greatly appreciated. Thank you.  Parts List:  Motherboard Supermicro X8DTL-i, Xeon 5680 X2, Sapphire ATI Radeon HD 7870 GHz, 32 GB ECC RAM, 750 Watt EVGA PSU, Seagate Barracuda 2TB Hard Drive.


I'm having some trouble proving that the Taylor series about the origin of the function $[Log(1-z)]^2$ to be $$\sum_{n=1}^\infty \frac{2H_n}{n+1}z^{n+1}$$ where $$H_n = \sum_{j=1}^n \frac{1}{j}$$  So far, I've been trying to use the definition of Log(1-z) = log|1-z| + iArg(1-z). I've also noted that the Taylor expansion for log|1-z| = $\sum_{k=0}^\infty \frac{-z^{k+1}}{k+1}$ from integrating the geometric series $\sum_{k=0}^\infty z^k$ given |z|<1.  Because log|1-z| = $\sum_{k=0}^\infty \frac{-z^{k+1}}{k+1}$ converges for |z|<1, I've tried to use this for the Cauchy product of [Log(1-z)]^2   $$[Log(1-z)]^2 = Log(1-z) Log(1-z)$$ $$=\left(\sum_{i=0}^\infty \frac{-z^{i+1}}{i+1}\right)\left(\sum_{j=0}^\infty \frac{-z^{j+1}}{j+1}\right)$$ $$=\sum_{n=0}^\infty \sum_{k=0}^n\frac{-z^{k+1}}{k+1} \frac{-z^{n-k+1}}{n-k+1}$$ $$= \sum_{n=0}^\infty \sum_{k=0}^n\frac{z^{n+2}}{(k+1)(n-k+1)}$$  Really lost here, so any clues would be helpful! Thank you in advance.


Are the electric charges of an electron and a proton equal or approximately equal?

I read in  (section 11.2) that the charge of the proton is, apart from the sign, approximately equal to that of the electron.. What bothers me is the word approximately, shouldn't $q_e=q_p$ because any small difference on the atomic scale will induce a huge electric charge for macroscopic bodies.


I answered the following question yesterday        I've noticed that the syntax highlighting of the razor code is somewhat broken.   Is there anything that can be done about this?  I don't think that there's anything wrong with the syntax since it highlights nicely in visual studio and executes without error.  I've checked the following post but can't see anything that mentions razor views


why is assigning '\0' causes segmentation fault?

I've tried this code snippet to assign '\0' to the last character of a C string  char *words = "words"; words[4] = '\0';   why is line 2 causes segmentation fault?


How can I determine if a date is between two dates in Java?

How can I check if a date is between two other dates, in the case where all three dates are represented by instances of java.util.Date?


Value of $x=\sum\limits_{n=1}^\infty {\frac{1}{10^n-1}} $ and location of second digit $1$ of $x$

What is the value of the series   $\sum\limits_{n=1}^\infty {\frac{1}{10^n-1}}$   and can one find closed forms for the sums   $\sum\limits_{n=1}^N {\frac{1}{10^n-1}}$?   I found that $\sum_{n=1}^N {\frac{1}{10^n-1}} $  =  $\sum_{n=1}^N (\lim_{m\to\infty  }{\frac{10^{-n}-10^{-nm}}{1-10^{-n}}})$  =  $0.111\ldots+0.0101\ldots+\ldots$ but I can't go farther.     The original question is: "Where does the second '1' appear?"


I'm trying to find the longest consecutive set of composite numbers

Hello and I'm quite new to Math SE.  I am trying to find the largest consecutive sequence of composite numbers. The largest I know is:  $$90, 91, 92, 93, 94, 95, 96$$  I can't make this series any longer because $97$ is prime unfortunately.  I can however, see a certain relation, if suppose we take the numbers like (let $a_1, a_2, a_3,...,a_n$denote digits and not multiplication):  $$a_1a_2a_3...a_n1,\ a_1a_2a_3...a_n2,\ a_1a_2a_3...a_n3,\ a_1a_2a_3...a_n4,\ a_1a_2a_3...a_n5,\ a_1a_2a_3...a_n6,\ a_1a_2a_3...a_n7,\ a_1a_2a_3...a_n8,\ a_1a_2a_3...a_n9,\ a_1a_2a_3...(a_n+1)0$$  The entire list of consecutive natural numbers I showed above can be made composite if:   The number formed by digits $a_1a_2a_3...a_n$ should be a multiple of 3 The numbers $a_1a_2a_3...a_n1$ and $a_1a_2a_3...a_n7$ should be composite numbers   If I didn't clearly convey what I'm trying to say, I mean like, say I want the two numbers (eg: ($121$, $127$) or ($151$, $157$) or ($181$, $187$)) to be both composite.  I'm still quite not equipped with enough knowledge to identify if a random large number is prime or not, so I believe you guys at Math SE can help me out.


Issues with Cancel Button in a Java message

I am trying to deal with the exception Cancel Button causes to my program, but I cannot find the answer. (line 77 is the while () sentence)  String response = JOptionPane.showInputDialog(myJframe, "Please enter your Customer Card Code to view your Account Information"); while ( (response.equals(null)) || (response.equals("")) )    // if user typed nothing or pressed CANCEL button {     JOptionPane.showMessageDialog(myJframe, "You must enter a Customer Card Code!!!", "Error", JOptionPane.ERROR_MESSAGE);     // display error message     response = JOptionPane.showInputDialog(myJframe, "Please enter your Customer Card Code to view your Account Information"); // ask again for the code until input is correct }   My main goal is to manage to deal with the exception Cancel button causes when it returns a null value if pressed.  EDIT: RETURNED ERRORS  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException     at MyWindow$2.actionPerformed(MyWindow.java:77)     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)     at java.awt.Component.processMouseEvent(Unknown Source)     at javax.swing.JComponent.processMouseEvent(Unknown Source)     at java.awt.Component.processEvent(Unknown Source)     at java.awt.Container.processEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Window.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)     at java.awt.EventQueue.access$500(Unknown Source)     at java.awt.EventQueue$3.run(Unknown Source)     at java.awt.EventQueue$3.run(Unknown Source)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.awt.EventQueue$4.run(Unknown Source)     at java.awt.EventQueue$4.run(Unknown Source)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.run(Unknown Source)


I want to install VLC. When I ask it to download in Ubuntu, it tells me to 'Choose an Application'.  What does it mean, and what should I do? Clicking on 'choose' gives me a list of my own files and I'm no wiser.


Launching a script in a new gnome-terminal

I am trying to make a script which is supposed to open a new gnome-terminal and issue a command (launch a jetty server). If I try only : gnome-terminal, a new gnome-terminal is opened. If I try : gnome-terminal -e ls, I get a warning message :  Option “-e” is deprecated and might be removed in a later version of gnome-terminal. Use “-- ” to terminate the options and put the command line to execute after it.  Here, the new gnome-terminal is not always opened. If I try this command fast 10 times, maybe 2 terminal will open... Same if I try with the recommended syntax : gnome-terminal -- ls. What is the correct way to achieve this?


How can I create matrices in general in LaTeX? As well as the one below?   Are there packages that are preferred over others?


Fantasy series with Celtic overtones, intermittent stone magic, and ongoing slow magic

I checked this series out of the library during college, maybe 15 years ago now.    It was based around 'stone magic' – magical stones that granted their bearers enormous power.  Unfortunately, the power of these stones is intermittent, they'll fade out for a long time then fade back in.  The main characters dealt with a 'master' stone of some sort, the first to restore, last to die.  It's also the key to granting other people access to their own powers – I think seals had magic fish they swallowed, which keyed off the master stone, and in the last book I think the character created magic staves for another race. It also had 'slow magic' – longer to set up, less apparently potent than stone magic, but the slow magic, given time to work it, could still be powerful and dramatic.  It just took time and preparation instead of brute force. In one book, the main character faces off against the source (or something like that) of magic, and is about to win when it's discovered she's pregnant.  The source – a dragon? – isn't allowed to harm anyone who doesn't come to it freely, so the main character is forbidden to finish the trial.  In the sequel, her daughter repeats the trial, and becomes immensely powerful by winning, but there was a cost of some sort, something that transformed her A lot of the naming made me think it had a Celtic root.


Accessing The Control Panel In Windows 8.1?

I usually use Search, to access the Control Panel, by typing in the words Control Panel on the Start Screen, and the search result for Control Panel is displayed even before typing the full words.    Or I use the Run command accessed by pressing Windows + R on the keyboard:    What other ways exist for starting the Control Panel in Windows 8.1 ?


Drawing/Sketching Tool for elaborating questions

More often than not I need to elaborate my question put up on Stack Overflow with a custom sketch, UML class diagram, flow chart.    It is in these times I have to open up a custom paint software, factor out some diagrams, export it as an image, attach it to Stack Overflow. I wouldn't know how complicated it is to invest in having such a sketching or drawing tool integrated, It could even be a basic pen stripped off all the advanced features leaving it a bare minimum.  Such a tool if incorporated into the Stack Overflow "ask question" UI would be certainly helpful.  As of Today this Question has been visited around 170 times and 7 answers, This was meant to be the voice of Stack Overflow users. Would you need a Drawing Tool for you on the Stack Overflow site, would it help you to express you questions and answers better? Sadly, only 2, or 3 answers are in the context of the question. The bounty was meant to be a bait and even that ends tomorrow. Hope you'll get the will and the zest to comment on this question today and in the future .


UK Visa while on short-term Schengen Visa

I am an Indian citizen visiting Germany for tourism on short-term (3 months)Schengen Visa. While in Germany, can I apply for a UK Tourism Visa in Germany (Munich/Duesseldorf)? I appreciate your answers.


What does it mean when we say that a domain is $C^k$, $C^{k,\alpha}$, Lipschitz, or smooth? Is there an intuitive understanding?


What are the rules for calling the base class constructor?

What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).


Theorem environment with a line break after label and before an enumerate environment

What I want to achieve is very similar to , but the solution offered seems not to work in precisely the cases I need it to work! I'm placing enumerate and itemize environments inside a theorem, definition, proposition, or example environment, and I want the first item to be in a new line after the label.  Here's a working example with multiple situations I have so far.  \documentclass{article} \usepackage{amsthm}  \theoremstyle{plain} \newtheorem{theo}{Theorem}%          Regular theorem env.  \newtheoremstyle{break}% name   {\topsep}%   Space above, empty = `usual value'   {\topsep}%   Space below   {\itshape}%  Body font   {}%          Indent amount (empty = no indent, \parindent = para indent)   {\bfseries}% Thm head font   {.}%         Punctuation after thm head   {\newline}%  Space after thm head: \newline = linebreak   {}%          Thm head spec \theoremstyle{break} \newtheorem{enumtheo}{NTheorem}%    Theorem env. for lists  \begin{document}  \begin{theo}[No list with theo environment] A little bit of text. \end{theo}  \begin{enumtheo}[No list with enumtheo environment] A little bit of text. \end{enumtheo}  \begin{theo}[List with theo environment] \begin{enumerate} \item A little bit of text. \item A little bit of text. \end{enumerate} \end{theo}  \begin{enumtheo}[List with enumtheo environment] \begin{enumerate} \item A little bit of text. \item A little bit of text. \end{enumerate} \end{enumtheo}  \begin{enumtheo}[List with enumtheo environment and a newline]$ $\newline \begin{enumerate} \item A little bit of text. \item A little bit of text. \end{enumerate} \end{enumtheo}  \end{document}   The output is the following:   I want something like NTheorem 3 but without the horrible gap. NTheorem 2 should have worked as intended, but apparently the enumerate environment messes it up and disables the linebreak.  I don't mind having to create an alternate environment for theorems, definitions, examples, and propositions, but I also want to have different labels for items (e.g. numbers, letters, itemize,...), so ideally there would be a solution that wouldn't involve creating over 4*3 different custom environments.


Prove $\gcd(a^n,b^n) = 1 \Rightarrow \gcd(a,b)=1$

Prove the following:  $ \gcd(a^n,b^n) = 1 \Leftrightarrow \gcd(a,b)=1,\;$ where $ a,b,n \in \mathbb{N}$.  I can show one side by using Fermat's Theorem and breaking them down into unique factorizations and then putting them to the power of $n$ but how do go the other way?


Can anyone explain me Difference between late night & early morning ?  "I slept early morning".Is this sentence correct ?  What time is called morning ? After 12:00 AM ?


How do I make text wibbly wobbly with animation nodes?

Only, I wish to learn using Animation Nodes for future motion graphics. Any assistance is appreciated.  You can do your own way of wobbling the text. I am not too exact as to how do you do it or what font style you use. I am only just keen on learning nodes for wobbling text for future projects. Thanks in advance.


Finding a sequence $a_n$ such that $\sum a_n$ converges but $\sum a_n^3$ diverges.

This is an exercise that was given to me, and I would like to emphasize that I am not looking for an answer, but rather a pointer or a hint in the right direction, since it appears I've reached a bit of a dead end. We are looking at sequences over the real numbers (at least that's my assumption, and that's where I've been looking).  I've come with various results to help me try such a sequence:   The ratio test has to be inconclusive, as does the root test.  Since $a_n$ converges to $0$, so does $a_n^3$ The sequences $|a_n|$ cannot be monotone decreasing, otherwise $\sum a_n^3$ will converge.   Other various things I've noticed:   It's very easy to find $a_n$ such that $a_n$ converges but $a_n^2$ diverges. Is it possible to use that fact? Let $u_n$ be such a sequence. I tried to construct a sum of two sequences so that when we take the third power, $u_n^2$ appears in the binomial expansion. That "naive" approach didn't get me too far however. We can make the following observation:  \begin{align} \sum a_n^3 &= a_1^3 + a_2^3+a_3^3+a_4^3\cdots \\ & = (a_1+a_2)((a_1-a_2)^2 + a_1a_2) + (a_3+a_4)((a_3-a_4)^2 + a_3a_4) +\cdots \end{align} This hasn't taken me anywhere.    Other things I've thought about:   I think a natural form for the sequence would be the product of two functions, $f$ and $g$, such that one converges to $0$ much faster than the other. By using the comparison test, we could try to require that $(fg)^3 > k_n$ for all n for some sequence $k_n$ whose associated series is divergent. I think it is unlikely we could find such a product though, since if $fg$ plummets fast enough, then $(fg)^3$ will plummet even faster.   I've tried a few things for lack of better options, using exp, trig functions, polynomials, none of my tries have worked so far, almost always as a product of two functions.    If someone could suggest a possible step forward, I would be very grateful!


How to calculate the improper integral $\int_{0}^{\infty}\Big(\frac{x}{\mathrm{e}^x-\mathrm{e}^{-x}}-\frac{1}{2}\Big)\frac{\mathrm{d}x}{x^2}$

How to calculate the improper integral $$\int_{0}^{\infty}\Big(\frac{x}{\mathrm{e}^x-\mathrm{e}^{-x}}-\frac{1}{2}\Big)\frac{\mathrm{d}x}{x^2}$$ Do you have same idea?


Are there any flights which permits a Sikh to carry a kirpan?

I am a religious Sikh from Jalandhar, India. I have not travelled outside of the country for a single time so far. However, my family is pestering me to take them for a jolly holiday trip to a different country.  I have a problem with that. I am deeply religious and I carry the  always with me wherever I go, keeping in line with the tenets of my religion. However, I can foresee that flight security are likely to view the kirpan as a dangerous weapon and will not allow me inside the airplane.   How can I overcome this? Is it possible to excuse me for religious reasons? Is there some tolerant flight/country which will empathize with my religious needs?


If ls [ab]* lists all files with names that start with a or b, Then ls [*a]* will list all files with names that start with * (everything) or a.  So why does it only list file with names starting with a?


Originally my farm (sheep and chickens) was at ground level with fences around it. I noticed that when logging into the game the animals would teleport themselves outside the fences. They don't seem to do it if you stay logged in for long periods of time but as soon as you go out and then back in there is potential for it to happen. In an attempt to fix this problem I dug the pen down two blocks deep   This seems to keep them from freeing themselves but now they glitch into the wall and suffocate. At least this what I assume is happening, I've seen them go into the wall and turn a very dark almost black color before, but when I am watching it happen they always pop back out after a second or two. But I am definitely losing them (I used to have many more), and I just found some lime green wool on the ground when I returned back to the pen after spelunking for a while so I know the lime sheep died.  My question is: What design can I use for my pen that will prevent my animals from escaping and keep them from dying randomly as well.


USB pendrive : the copy takes about 3 minutes but the unmount takes a very long time : 10 to 12 minutes

I'm using Ubuntu 17.10.  I formatted an USB pen-drive to NTFS to prepare a Windows7 USB Installer.  I set the bootable flag on this pen-drive and copied the files into it.  EDIT 1: The USB pen-drive is automatically mounted by udev.  umount /dev/sdb1 takes from 10 upto 12 minutes to complete.  Here are the mount options :  $ mount | grep sdb /dev/sdb1 on /media/mansfeld/Win7_USB_Installer type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)   EDIT 2: The cp operation is not INSTANTANEOUS at all, it took 3 minutes to copy the files to the USB pen-drive.  EDIT 3: The sync operation (done right after the cp) took 12 minutes to complete ! But then the umount will be instantaneous.  For FAT32, (with sync also disabled during mount), I notice the same behaviour.  Any ideas why it takes so long to unmount NTFS USB pendrive ?


How to display table if you have more than 50 columns

I need suggestion on how to display table if you have more than 50 columns on a page.


Will my Battery get harmed if not used for long time?

Will my MacBook's battery be damaged if I do not use for next couple of months?  I bought a new Macbook Pro (March 2015) a month back. So far I have not started using it yet. It's charged and box packed as I do not currently have time to set it up for my development work.  Update: It's charged 90%+ but not being used.


How to find count of repeated ids and also display different ids using sql query?

How to find count of repeated  country names and also display different country names using  single sql query?  I have table Source_country_Table  INDIA SPAIN JAPAN INDIA US UK US SPAIN JAPAN INDIA


Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

I have used find the element by Xpath in my code, I get the error as ElementNotVisible.  <div class="loginBtn">     <input style="width: 59px; height: 20px" id="SubmitCreds" onclick="clkLgn()" type="submit" value="" name="SubmitCreds"> </div>   I try search the attribute value for id "SubmitCreds" its available in 3 different locations so used xpath.


In this sentence:     The insurance premium is small potatoes compared to what we'd have to pay if the house burned down.   "Small potatoes" is a plural noun, but why is the auxiliary verb "is" not "are"?


Transfer of money from old Apple ID to new Apple ID

Is there anyway I can transfer my iTunes giftcard from my old Apple ID account to my new Apple ID account?


Equation numbers are shown in reverse parentheses

I am using   \begin{equation} a = b \end{equation}   to write the equations in my paper. However, the problem is that the number related to each equation is not shown in the correct format like the picture   How can I fix this?  This is what I have at the first of my code:  \usepackage{graphicx} \usepackage[justification=centering]{caption} \usepackage{float} \usepackage{url}% typeset urls \usepackage{times} \usepackage{url} \usepackage{latexsym} \usepackage{fontspec} \usepackage{multirow} \usepackage{listings} \usepackage{setspace} \usepackage{listings} \usepackage{fontspec} \usepackage{amsmath} \usepackage{polyglossia} \usepackage{color} \usepackage{bidi} \newfontfamily\faFont[Script=Arabic]{Yas}  \newenvironment{Fa}{\begin{RTL}\faFont}{\end{RTL}} \newcommand{\fa}[1]{{\faFont\RL{#1}}} \newcommand\Mark[1]{\textsuperscript#1} \definecolor{backcolour}{rgb}{0.95,0.95,0.92} \definecolor{darkblue}{rgb}{0.95,0.95,0.92} \setmainlanguage{english} \setotherlanguage{farsi} \newfontfamily\farsifont[Script=Arabic]{Yas}


How do I pull a value from a Paragraph field and put it in a template?

I would like to pull a value from a field I have in Paragraphs.   I have a content type called "Landing Pages" (landing_pages)  I have a paragraph type called "Landing Page" (landing_page)  The field in the said paragraph type that I would like to pull is called "Background Color" (field_background_color)  As you can probably guess, I would like the user to be able to set the background color of the individual Paragraph. I have figured out how to get the template to display said inline style, but I am puzzeled on how to get the value in the "style=background-color:" tag.   Any help would be appreciated


c++ RPG - Handling buffs / equipment stats

I'm trying to develop a character calculator for a RPG, and it could evolve into a turn based combat / text based RPG. One of my concerns is how to handle the equipment stats / buff system.   Currently each of my buffs / equipment object and my character object itself has a member bonusstats, which is a struct containing a (potentially) very large amount of possible modifiers (attributes, misc_skills, protections, secondary_stats, etc and their multiplier versions).  struct BonusStats {     int attribute[8], misc_skill[30], protection[9], HP, MP, ... ;     //define constructor, operator+=, reset function }   And everytime an actualize call is requested every stat is recomputed:  Character::Actualize() {     this->bonusstats.reset();     for /*iterate through vector of buffs and equipped items*/ {         this->bonusstats += item->getBonusStats();     } }   While this is a rather simple approach I am concerned about two things mainly:  1.- Is it performance-wise acceptable? I get the feeling that having to sum two structs containing 100 elements just to add a buff is not a very good practice. Would there be any practical advantage in using a function like Character::ApplyStats( std::function<void(BonusStats*)> itemstats) instead?  2.- How could I implement more complex buffs than stat modifiers? For example, reflecting x% damage when blocking a melee attack. The thing that comes to my mind is to create complex stats like percent_damage_reflected_on_melee_block and check its value everytime conditions are met. Is it a good approach?


Boats from Manaus, Brazil to Leticia, Colombia?

I've heard of and met a few people who have done this route, and I hope to do it at the end of this year or early next year.  However, the descriptions were mostly sketchy, and I'm wondering if it's a regularly scheduled service, or more ad-hoc.  So I guess the question is, how can I find out which boats go from Manaus to Leticia, and when they go?  Ideally this wouldn't be a tour, but a 'locals' boat.


Birthday paradox with a (huge) twist: Probability of sharing exact same date of birth with partner?

I share the same birthdate as my boyfriend, same date but also same year, our births are seperated by merely 5 hours or so.  I know that the chances of meeting someone who was born on the same date than me is fairly high and I know a few people with whom I share my birthday although for the little I've read about the birthday paradox, it doesn't take same year into account.  We've argued before about the probabilities and I am still not satisfied. My point was that the chances are tiny if you consider the probabilities of being in a relationship (+ being successful at it for X amount of time). I find the amount of factors to take into account quite vast (up to a point, gender and age, availability, probabilities of separation in our region, etc.)  Is it even possible to calculate the probabilities on something like this? How would you go about it?


Override a page's CSS when put in an iframe

Is it possible to take a web page that lets say has CSS that makes the header position:fixed, then use php and use either cURL or file_get_contents, and apply my own CSS file to change that header to position:absolut?


This is a homework question. $d,n\ge 2$.  Let $L=\{(x_1,...,x_n)\in (\mathbb{R}^d)^n: x_i\in \mathbb{R}^d,  x_i\ne x_j \forall i\ne j\}$.   I tend to think it is not path connected because if you assume $d=1$, this is the case. But I cannot prove for $d\ge 2$.  Any help will be appreciated! :)


Posting only once every 40 minutes even for experienced users?

I have low rep on Physics & Woodworking, but not so on Stack Overflow.  I just tried to ask < 40 minute interval on those two and got hit with the :    I posted once on Woodworking, then ~5 minutes later tried to post on Physics, and was denied because of the 40 min rule. So apparently the system looks cross-network to assess this rule.  It seems the system is looking at my lowest cross-network rep when applying this rule rather than highest rep? What is the point of this very conservative approach? It would seem there is very little chance that a user with high rep on ANY site is likely to spam or abuse the lower-rep sites. And obviously this discourages participation across the network.  Furthermore, an improvement at least would be to warn the user ASAP so they aren't stuck with a nicely worded question in their browser window only which could be forgotten, lost, etc. As it is you only get the warning when you click [Post Your Question].


What is the correct form?      1) It can contain      2) It can contains


Let S be a finite set of vectors $S\subseteq V$ with a vector space V over a field F. I have two alternate definitions of span(S): $span(S)=\bigcap_{S\subseteq M\subseteq V} M $ and $span(S) = \left \{ \sum_{i=1}^{k}\lambda _{i}v_{i}: k\epsilon \mathbb{N}, v_{i}\epsilon S, \lambda _{i}\epsilon F \right \}$. Why are these two definitions equivalent?


I don't have administrator account anymore - macOS 10.13.4

I tried the answers on the similar previous question but nothing worked. Obviously Apple removed the critical file .AppleSetupDone in the last Security Update. Is there anybody who could help getting my administrator account back?


What are the magic links for Meta Stack Overflow, Meta Super User, and Meta Server Fault?

I found out that the Meta Stack Overflow magic link is not included in  nor . There are generic links that follow the pattern [<something>.se] -> [meta.<something>.se]. For example, [worldbuilding.se] -> [meta.worldbuilding.se]. However, sites with their own domain have their own type of links, for example, Stack Overflow is [so]. I expected the magic link to follow the first pattern but [meta.so] does not actually work. Through trial and error in the sandbox I found out that the the magic link that expands automatically is [metaso] by : [meta.so], [metaso], [meta.so.se], [meta.stackoverflow], [meta.stackoverflow.se], and [mso]. However, that leads to Meta Stack Exchange instead which seems to be . Was hoping to find magic links to the metas and to to update the list. I also checked:  Super User (base link: [su]). : [meta.su], [metasu], [meta.su.se], [meta.superuser], [meta.superuser.se], and [msu] Server Fault (base link: [sf]): : [meta.sf], [metasf], [meta.sf.se], [meta.serverfault], [meta.serverfault.se], and [msf]  None of these actually conjure up the link to the relevant meta. I can't even find any other documentation than the one I want to update. Are there magic links for the metas of Stack Overflow, Super User, and Server Fault? And if there are, what would they be?


While using the Unity desktop under 17.04 I used CompizConfig to allow window tiling with keyboard shortcuts.  The feature I most liked and relied on was the ability to tile windows to the 4 corners, left or right, top or bottom with keyboard shortcuts (I adjust mine to be ctrl + super + [1 - 9]) where each of the numbers placed a window in a tile position similar to the placement of the number on a 3 x 3 number pad.  So, ctrl + super + 1 would place a window in the bottom left corner, ctrl + super + 8 would place a window on the top half of the screen, ctrl + super + 6 would place a window on the right half of the screen, etc.  Is there a way to get this functionality in GNOME? Either through using CompizConfig somehow or by using another GNOME extension?


What's the difference between declaring an arraylist as List or as ArrayList

okay so i understand that List is an interface that ArrayList implements but what's the actual point of doing it ? what pros do i get from naming it as List not ArrayList ? first example ArrayList<String> x= new ArrayList<String>(); second example List<String> x= new ArrayList<String>();  what'd be a real life example where it's better to use either ?


Remote login with graphical display manager (GDM, LightDM)

Is it possible to remotely (via ssh) make a login to GDM? I'll explain a situation in which I'd need this: I'm on my laptop and connect to my desktop via ssh. I realize there are some updates available. I install them all, but I need to reboot the computer. The problem is that once the desktop has rebooted, there will be no GDM session available, since it's necessary to log in. Can I somehow perform the GDM login remotely from my laptop?  Edit: I can't find FreeNX for Maverick, and I haven't been able to configure x11vnc + vncviewer to work. Isn't there an easy way?


Find the shortest distance between two lines in 3D

Question :      The line $l_1$ passes through the points $( 0 , 0 , 10 )$ and $( 7 ,0 ,0 )$ and the line $l_2$ passes through the points $( 4, 6 ,0 )$ and $( 3 , 3 ,1 )$. Find the shortest distance between $l_1$ and $l_2$ .   I found that \begin{align}l_1 : r &= ( 7 , 0 ,0 ) + a ( 7 , 0 , -10 )\\ l_2 : r &= ( 3 , 3 ,1 ) + b ( -1 , -3 ,1 )\end{align} for $a,b\in\Bbb R$  Help me solve this question , thank you so much !


Better Visual indicator for time limit on comment upvotes

Background:   Summary of that thread: "Can we change the 5 second limit on up votes?" Status: "Declined." My interpretation of the reason: An altered time limit might lead to more noise in the signal, the very thing the mechanism is designed to avoid.  My take is this:  The problem is not the time limit, the problem is the failure message behavior.  I believe the "you can't upvote on a comment again so soon" message's BEHAVIOR is complete overkill, though I understand the necessity for the underlying time limit mechanism.  Problems with the current error:   Brings up a popup. Displays the most visually noisy red error I have yet seen on the site, total overkill. Remains open until you manually click to close it. Provides no indication of when the functionality will actually be available again.   All just to tell you that you're being a bit too eager in your non-value-changing upvoting.  So I argue that the problem isn't the mechanism, it's the presentation, and I think that we can propose something better and much less annoying.  What alternatives can we come up with?


I have an exFAT partition on my external hard drive which I'd like to grow. GParted doesn't support resizing exFAT partitions, but is there another way to do it? I'm using Ubuntu 13.04.


The /etc/issue of my Debian testing references : stretch, which is supposed to be testing, and sid, aka unstable. What does that mean? That I have a mix of packages from the two of them?  $cat /etc/issue Debian GNU/Linux stretch/sid \n \l


Search ec2 instance by its name from aws command line tool

I have an instance named dev-server-03. Now how can I search all dev-server-* instances from command line?  I am using aws cli tool.


What are all the branches of mathematics? I want to know this so that I can compare between them, so if you can give me with them a brief look of what they are about that would be awesome.


The question is to prove, by long polynomial division, that: $(2^{2^{(n+1)}}−1) | 2^{(Fn - 1)}−1$ $Fn = 2^{2^n}+1$


How do I not accidentally eject external drives?

I have a Mac Mini with a few external drives connected that I use as a home server. Normally the Eject buttons next to the drive icon are really handy as they let me eject an external drive very easily (compared to Windows for instance).  However on a Mac server, this comes as a detriment. I have some pretty mission critical stuff on external drives and there's a lot of scripts etc. I have set up that are dependent on those drives being there. Being able to so easily accidentally eject those drives makes me rather uneasy.  So far I've just chosen to not show them in the Finder sidebar, that way at least they're a bit harder to eject. However that isn't very ideal because: (1) I need to go to my Mac in the sidebar to access the drives rather than have the drives accessible directly and (2) the eject buttons still show in open/save dialogue boxes for those drives.  Ideally, I'd like a way for them to behave the way internal drives do: no option to easily eject from the finder, but still possible to unmount through disk utility.


I'm interested in finding a nice closed form expression for the sum $\sum_{k=1}^n\frac{1}{k}\binom{n}{k}$. I've tried using the Binomial Theorem to get  \begin{align*} \sum_{k=1}^n\frac{1}{k}\binom{n}{k}x^k & =\int_0^1\frac{(1+x)^n-1}{x} \, dx\\ &=\int_1^2 (1+u+\cdots+u^{n-1}) \, du \end{align*} using the substitution $u=1+x$ but I can't quite to simplify this integral either. I have also not been able to come up with a combinatorial approach, which may not exist since the summation and its terms are in general not integers. Any help in evaluating this sum would be appreciated, thanks!


Following a reference from "Elementos de Topología general" by Angel Tamariz and Fidel Casarrubias.     Since the sum and the product of real continous functions, defined in any topological space, are continuous we can easily prove that every metric space is a Tychonoff spaces. So we suppose that $(X,d)$ is a metric space and we consider a closed set $F$ a point $p\notin F$ and so we define a function $f:X\rightarrow[0,1]$ by the condiction    $$ f(x)=\frac{d(x,p)}{d(x,p)+d(x,F)} $$   where $d(x,F):=\mathscr{inf}\{d(x,a):a\in F\}$. So we observe that $f(p)=0$ and $f(x)=1$ for any $x\in F$; then $f$ is continuous, since any function $g:X\rightarrow\mathbb{R}$ defined as    $$ g(x)=d(x,A) $$       for any $x\in X$ and for any fixed $A\subseteq X$, is a countinuous function and so $f$ is continuous  function, since the sum and the ratio of continuous function is a continuous function.       Well by definition of Tychonoff space we can claim that the metric space $(X,d)$ is a Tychonoff space.   Well unfortunately I don't be able to prove that the function $g$ is continuous: could someone help me, please?


Is the void set (∅) a proper subset of every set?

I am a bit confused about the concept of proper subsets,precisely whether to include one or both of the void set and the set itself.  An extract from my module goes like this :  Obviously,every set is the subset of itself and the void set $\emptyset$ is the subset of every set. These two subsets are called improper subsets.  It also includes a theorem which states that "Let A be a finite set having n elements. Then the total number of subsets of A is ($2^n$) and the number of proper subsets of A is ($2^{n}-1).$"  Then again in a sample solution of this problem "If A = {a,b,c},then the number of proper subsets of A is ?"  Total no of subsets of {a,b,c} = $2^3$ = 8. But each set have two improper subset, so number of improper subsets are 6.  Is this solution correct ? If so please explain the concept.


Can students finish much of their PhD thesis before applying to a PhD program?

Are students allowed to complete a large portion of their research independently, then enroll in a PhD program, apply for a defense panel within the first semester, and quickly finish the thesis? Has this been done before?  Update: Question trimmed. I'm looking for an answer whether students can be admitted with much prior work on the thesis already complete, to finish in a short time (perhaps one year fix and improve the work), and whether there are real examples of people who did this. I not asking whether I myself am personally capable of completing this prior work to sufficient quality.


Incremental Sieve of Eratosthenes using unstable generators

I am in the process of learning Rust and am still having some issues with borrowing and ownership. I find myself trying to borrow mutable references that are already borrowed as immutable references etc...  I noticed that when I try to iterate over the primes without owning them, I encounter issues trying to modify the composites hash map. I was able to get around this by calling to_owned on the vector. Is this the right way to handle this?  This uses the .  cargo -V  cargo 1.35.0-nightly (0e35bd8af 2019-03-13)   #![feature(generators, generator_trait)]  use std::collections::HashMap; use std::ops::{Generator, GeneratorState};  let mut sieve = || {     let mut x: u32 = 2;     let mut composites: HashMap<u32, Vec<u32>> = HashMap::new();      loop {         match composites.get(&x) {             Some(primes) => {                 for _prime in primes.to_owned() {                     composites                         .entry(x + _prime)                         .and_modify(|v| v.push(_prime))                         .or_insert(vec![_prime]);                     composites.remove(&x);                 }             }             None => {                 yield x;                 composites.insert(x * x, vec![x]);             }         }          x = x + 1;     } };


I am trying to obtain the ID (primary key with auto increment) of the last inserted data. But my query seems to be empty after using SCOPE_IDENTITY(), while the entries are inserted correctly into the database. What is causing the problem? Thank you! QSqlQuery query; query.prepare("INSERT INTO list (file) VALUES (?); SELECT SCOPE_IDENTITY()"); query.addBindValue(file); qDebug() << query.exec(); qDebug() << query.first(); query.value(0).toInt();  Console Output:  true false QSqlQuery::value: not positioned on a valid record


If I let $n \geq 1$ be an integer and use a $2 \times n$ board $D_n$ containing  $2n$ cells, each side has a length of 1. T  The brick can be vetical or horizontal containg $2$  cells(explained in the bottom part of the above picture).  The tiling of board ($D_n$) is placed with bricks so that :  1.item the bricks exactly cover $D_n$ and  2.item no two bricks overlap.  So for $n \geq 1$, we let $x_n$ become number of different tilings of the  board $D_n$. Now I have to determine the value of $a_n$  I know there are only two ways to cover the left-most two squares: either a single vertical brick, or two horizontal bricks and that if you cover those two left ones with a single vertical brick, after that you have to choose any covering of the other $n-1$ columns and the only way to do this is precisely $x_{n-1}$. So, there are $x_{n-1}$ arrangements in which you cover the left two by a vertical brick and if you need two horizontal bricks, Then you've knocked out two columns, and need to pick a covering of the remaining $n-2$ columns. So now what would $x_n$ equal I think $a_n = a_(n-1) + a_(n-2)$ I am I right?


Java Map interface, method remove takes object

I have the following code snippet:  Set<Short> map=new HashSet<>(); short i=1; map.add(i); map.remove(i-1)   It ignores removal because I-1 was automatically casted to integer. But, why there is no remove(V) method with generic? It's bad, I should see an exception or this method should be generic. Doesn't make any sense. Why was it designed this way?  The question is:  If we have Set, why don't we have method remove(E e) inside it? I found that it's because internally there is an array of Object. But why? If we have Set  of E generic type, why don't we have E[] as internal storage? For me it's absolutely doesn't make sense.  For example I expected:  class Set<E>{    private E[] values;     public void add(E e);     public void remove(E e);  }   But I got:  class Set<E>{    private Object[] values;     public void add(E e);     public void remove(Object e);  }   Why not to do this?  class Set<E>{    private E[] values;     public void add(E e);     public void remove(E e){        for(E v:values){          if(v.equals(e)){             //remove element          }       }     } }   ????


Showcase of beautiful typography done in TeX & friends

If you were asked to show examples of beautifully typeset documents in TeX & friends, what would you suggest? Preferably documents available online (I'm aware I could go to a bookstore and find many such documents called 'books'). Extra bonus for documents whose LaTeX source is available.  This is not an idle question. Seeing great examples of any craft is both educational and inspiring, let alone explaining why we prefer TeX to Word or other text editors.  For instance, I like how Philipp Lehman's  looks. I don't know enough LaTeX to realize how much customization was done, but the ToC looks polished.  Your nominations, please ...


an example for $\pi$-quasinormal subgroup but is not normal

Can you give me an example about a $\pi$-quasinormal subgroup but it is not normal subgroup? P.s: $H$ is $\pi$-quasinormal subgroup of $G$ iff $HP=PH$, $\forall P$ is Sylow $p$-subgroup of $G$. $K$ is normal subgoup of $G$ iff $Kg = gK$, $\forall g \in G$. Thanks.


If $x\notin\mathbb Q$, then $\left|x-\frac{p}{q}\right|<\frac{1}{q^2}$ for infinitely many $\frac{p}{q}$?

This appears on problem 1 of chapter 1 in Stein & Shakarchi's Real Analysis:     Given an irrational $x$, one can show (using the pigeon-hole principle, for example) that there are infinitely many fractions $p/q$, with relatively prime integers $p$ and $q$ such that $$\left|x-\frac{p}{q}\right|\leq\frac{1}{q^2}.$$   However, prove that the set of all $x\in\mathbb R$ such that there exist infinitely many fractions $p/q$, with relatively prime integers $p$ and $q$ such that $$\left|x-\frac{p}{q}\right|\leq\frac{1}{q^{3}} \text{ (or} \leq 1/q^{\epsilon+2})$$ is a set of measure zero.   The last part of the exercise is easy using the Borel-Cantelli theorem. However I have no idea why the first part is true.


I want to create a database shape in tikz that looks something like this:    I need the two arcs in the middle, so I cannot directly use cylinder, as suggested in .  Ideally, I would like to start from the cylinder shape and just add a few arcs, but I cannot figure out how to do this? Is the code of the cylinder shape available somewhere? Or is there a better way to achieve this?  I have looked at  that asks how to create a shape for a camera, but it is quite far from what I want.


Possible Duplicate:          I came across  in the 10K tools, which was flagged as not an answer.  Since it's only a link, I re-flagged.  The flag was declined as      flags should not be used to indicate technical inaccuracies, or an altogether wrong answer   I can't stress strongly enough my lack of concern for the lost flag weight—as Shog has said, losing flag weight is like burning monopoly money.  But should link-only answers be flagged?  Part of the description for the "not an answer" flag is that the answer should be a comment.    Was this just a result of a mod being distracted on a Friday afternoon?


It happens to me that I start answering a question, and hit some snag. So I abandon the partial answer, knowing that I can go back to it later and complete it (many thanks for that!).  But I variously use my tablet, the PC at home or another one at work to participate here. And some of the sites (MSE is a particular culprit here) often have hundreds of new questions a day, and the original question (if not "favorite") is thus hopelessly lost.  Is there a simple way to get at a list of all of my drafts?


What is a good algorithm for a stock market simulation?

I am making a text game about investing in the stock market, however I need a better algorithm, as the current simulation just goes up and down randomly. How can I make it so that its a more realistic simulation in python.   I've looked at the answer to the question "", but I want the stock price to be influenced by the users actions, and based on non random actions that they have done. For example, if they buy a massive quantity of an item in the game, the value will go up


Apex error : You have uncommitted work pending. Please commit or rollback before calling out. I get the above error when I try to make two http callout one after the other and store the result in database in between the http calls. Below are the apex steps which are done:  DML statement to get the number of HTTP callouts to be made. For ex: if it has two HTTP calls to be made. The first HTTP call is made and then store the result of HTTP callout. Make the next HTTP callout and then store the result of the HTTP callout.  I can't make the HTTP callout as future as I require the output to be displayed to the end user for all the HTTP callout. Please let me know if the question is not clear, and  how we can handle this scenario.


Why do we still use points as a measurement of type size?

I'm in the UK, which uses metric units for pretty much everything now except road distances and beer (obviously best kept apart).  Page sizes have been metric here and in most of the rest of the world for many years.  Can anyone suggest any reasons why printed type is still always measured in points, e.g 11pt (= 11/72 inch) rather than say millimetres?  In counterpoint, does anyone use anything else?    Edit: Obviously points have worked fine for centuries. But there would seem to be significant advantages measuring type in the same metric units as you measure the page it's placed on, especially if setting up a grid.    Edit: Wikipedia has a page on , and there's a bit more context on use in Germany and Japan on the main  page.


Wrong Documentation beta score in Area 51

In , in , I see my total reputation is suddenly increased.   Hover on the each community in the score board, I see the Documentation beta reputation is 4,662 (the same reputation as Stack Overflow), actually I scored only 175 in the documentation beta.  So the Stack Overflow reputations and badges are duplicating in the Area 51 score card.  As I know the  from Documentation beta to Stack Overflow is in-progress. But this is looking like a bug to me.  Screenshot for reference.


I am currently using MySQL with PHP but am looking to start MySQLi or PDO  I have while loops like:  $sql="select from ... "; $rs=mysql_query($sql); while($result=mysql_fetch_array($rs)) {     $sql2="select from table2 where id = $result["tbl1_id"] "; }   If I put my MySQLi or PDO queries into a function how can I run things like the above? Doing while loops with queries inside the while loops?  Or is if easier to not do the functions at all and just run the prepared statements as normal?


Do $\sqrt{A}BA^*B\sqrt{A}$ and $ABA^*B$ have the same eigenvalues? where $A$ is a 4 by 4 positive-semidefinite hermitian matrix and $\text{tr}A=1$ and $B=\begin{bmatrix} 0 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0  \\ 0 & 1 & 0 & 0  \\ -1 & 0 & 0 & 0 \end{bmatrix}$.


How to access mounted file systems as a guest user?

In Ubuntu 11.04 I could mount a file system in /media/foo and run chown guest:guest /media/foo/bar -R and have full access in the guest account. After the upgrade to 12.04 I changed my routine to reflect the new guest usernames (chown guest[id]:guest[id] /media/foo/bar -R) but I still can't access it as a guest user, as I don't have access privileges to /media as guest:     ls: cannot open directory /media: Permission denied   (Very interestingly this does work if I su into the guest account as root). I understand this is meant as a  but I don't see how it is done. ls -l / reports   drwxr-xr-x  11 root root  4096 Sep  9 22:28 media   Thus my two questions: How does this restriction work and how can I access a mounted file system as a guest user, ideally without allowing access to all of the other mounted file systems?


Does anyone know where ifconfig is for SLES made in SUSE studio?  It does not exist in any of the main repositorys, or in the included repos for ZYPPER. As well it cannot be found in /sbin/zypper where it normally is for suse linux.


Okay so I have Ubuntu command prompt and I've done  sudo apt-get install ubuntu-desktop sudo apt-get install build-essential   and many other things, but I still cant get Ubuntu GUI (on my desktop). Can someone help me?


macOS Mojave (10.14) - how to get a full installer without using the macOS Mojave Patcher Tool

I just want to install macOS Mojave (10.14) on one of my Macs without an internet connection. Therefore, I need an "offline" installer.   With previous versions of macOS I used the createinstallmedia command without any problems. However, this time I can't use this because when I download the installer from the Mac App Store on another Mac I only get a file that is 22 MBs in size.  I am aware of the "macOS Mojave Patcher Tool" but for my own reasons do not want to use this.  In summary, how do I create/obtain an offline installer without having to use the macOS Mojave Patcher Tool in a situation that downloading from the Mac App Store isn't possible?


How to set pointer to the last position in C

In C, if we declare an array, we can use sizeof() to get the length of the array. If I get a pointer, sizeof() will return the size of pointer to me, so how I can get the size of array pointed by the pointer or how to set the pointer to the last position? I know char * can use strlen, what about other type?  Thanks


Editors/IDEs for LaTeX documented source (.dtx) files

Similar to the question "," I'm curious if there are any editors or add-ons that directly support the LaTeX documented source (.dtx) format.  I imagine such an editor would support syntax highlighting for both the implementation as well as the documentation, perhaps with different backgrounds to increase contrast between sections. Just as most editors will preserve indentation on newlines, it would also be helpful to preserve the leading % in documentation mode. Extra bonuses to support for Doc-specific macros.  Does such a thing exist? Do enough people actually edit .dtx files for there to be sufficient demand?


Pronunciation of "Celt": /kɛlt/ vs. /sɛlt/

Both /kɛlt/ and /sɛlt/ are considered acceptable pronunciations of the noun  and similarly of the adjective . Is there a reason for the different pronunciations? Which is the more common? Is each variant perhaps particular to a geography? Scottish vs. Irish, maybe?


public static void handleCaseComment(CaseComment caseComment) {    User[] users = [SELECT LastName FROM User WHERE Id = caseComment.CreatedById LIMIT 1]; }   This gives me the following error:  unexpected token: 'caseComment.CreatedById'   How do I use the value of the variable caseComment.CreatedById in a SELECT statement?


Is there something or There is something?

If I want to make a question, shall I start using Is there or There is?  For example I want to say: Is there a way to calculate energy produced by the combustion of an hydrocarbon? but I am not sure if I have to say There is a way to calculate energy produced by the combustion of an hydrocarbon?


When $G = K_n, n \ge 3$ and  $n$ is odd, then from the edges of the $G$ can be built edge-disjoint Hamiltonian cycles. Is it true?


The first upvote on my answer is not recorded in achievements

For my answer to this question, I got an upvote after a few minutes. However I didn't see it until I checked because it didn't show up in the achievements. I did get reputation for it.  The second upvote is recorded as one upvote on the achievements, +10.


Created CMake static library has no symbols

My project looks like this: include/util/safety.h include/opcodes/8bit_load_opcodes.h include/CPU.h src/util/safety.cpp src/CPU.cpp src/main.cpp src/opcodes/8bit_load_opcodes.cpp CMakeLists.txt  With the CMake script below cmake_minimum_required(VERSION 3.17) project(gameboy) enable_testing()  FIND_PACKAGE(Boost 1.65.1 COMPONENTS unit_test_framework REQUIRED)  if(NOT Boost_FOUND)     message(FATAL_ERROR "Boost Not found") endif() set(CMAKE_CXX_STANDARD 20) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})   INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/opcodes) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/util)  ADD_LIBRARY(cpu_util src/util/safety.cpp)  ADD_LIBRARY(cpu src/CPU.cpp src/opcodes/8bit_load_opcodes.cpp)  TARGET_LINK_LIBRARIES(cpu ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(cpu cpu_util)  add_executable(gameboy src/main.cpp)  TARGET_LINK_LIBRARIES(gameboy cpu)  When I run make I get: Scanning dependencies of target cpu_util [ 14%] Building CXX object CMakeFiles/cpu_util.dir/src/util/safety.cpp.o [ 28%] Linking CXX static library libcpu_util.a [ 28%] Built target cpu_util Scanning dependencies of target cpu [ 42%] Building CXX object CMakeFiles/cpu.dir/src/CPU.cpp.o [ 57%] Building CXX object CMakeFiles/cpu.dir/src/opcodes/8bit_load_opcodes.cpp.o [ 71%] Linking CXX static library libcpu.a [ 71%] Built target cpu Scanning dependencies of target gameboy [ 85%] Building CXX object CMakeFiles/gameboy.dir/src/main.cpp.o [100%] Linking CXX executable gameboy CMakeFiles/gameboy.dir/src/main.cpp.o: In function `main': /home/cedric/Programming/gameboy/src/main.cpp:6: undefined reference to `unsigned short validate_argument<unsigned short>(unsigned short, unsigned short)' collect2: error: ld returned 1 exit status CMakeFiles/gameboy.dir/build.make:106: recipe for target 'gameboy' failed make[2]: *** [gameboy] Error 1 CMakeFiles/Makefile2:154: recipe for target 'CMakeFiles/gameboy.dir/all' failed make[1]: *** [CMakeFiles/gameboy.dir/all] Error 2 Makefile:114: recipe for target 'all' failed make: *** [all] Error 2  Running nm appears to show an empty output: $ nm libcpu_util.a   safety.cpp.o:  Why aren't there any symbols in libcpu_util and how can I fix this make error? For reference: safety.cpp #include <stdexcept> #include "util/safety.h"  template<typename T> T validate_argument(T value, T mask) {     if((value & mask) != value)         throw std::runtime_error("Value outside of mask!");      return value; }  safety.h #ifndef GAMEBOY_SAFETY_H #define GAMEBOY_SAFETY_H  template<typename T> T validate_argument(T value, T mask);  #endif //GAMEBOY_SAFETY_H


XeLaTeX and Biber do not Produce a *.bbl File

MiKTeX (updated); TeXworks Used to do this a couple of months ago, now after PC and MiKTeX reinstall (Win7) bibliographies on old files seem not to be working any more. Read many similar questions, no help.      \documentclass{article}      \usepackage{fontspec,xunicode,xltxtra}     \usepackage[lithuanian]{babel}     \setromanfont{Times New Roman}     \usepackage[bibstyle=authortitle]{biblatex}     \addbibresource[datatype=bibtex]{refs}      \begin{document}     \pagebreak      Polish citation\footcite[21]{bogucka84}.     Ukrainian citation\footcite[181]{блануца07}.      \end{document}   For refs.bib I used this:      @book {     bogucka84,     author      = "Maria Bogucka",     title       = "Gdańscy ludzie morza w XVI-XVIII w.",     date        = "1984",     publisher   = "Wydawnictwo Morskie",     location    = "Gdańsk",     }      @book {     блануца07,     author      = "Андрiй Блануца",     title       = "Землельнi Володиння Волинцькоï шляхти в другiй половинi XVI см.",     date        = "2007",     publisher   = "Iнститут iсторiï Украïни НАН Украïнии",     location    = "Киïв",     }   Once I try XeLaTeX+Bibtex+XeLaTeX all but citations work. I come from humanities, so I guess I'm easily baffled by such things; nevertheless, baffled I am.


Which one is correct?  "All the apples on the tree are ripe" or "All apples on the tree are ripe".


When I print to my Canon LBP2900, Ubuntu shows printing completes, but nothing is really printed.


Extract parts of current working directory as variable

I googled for several hours and could not find a solution for the following issue (at least I did not find one I could understand and adapt).  My cwd is:  /home/ubuntu/data/modelling/Iamvariable/Var1/PRODUCTION/ANALYSIS/Var2/DIHEDRALS   and I need to extrakt the "text" behind Var1 and Var2.   I would like to scan the pwd output from right to left since the file path starting could change but the path starting after Iamvaribale will stay always the same. By means of number of elements in path and except Iamvaribale (and of course Var1 and Var2) also the folder names will stay the same.  How can I achieve this in a bash sricpt?  Var1 =  Var2 =   edit:  /home/ubuntu/data/modelling/Iamvariable/Var1/PRODUCTION/ANALYSIS/Var2/DIHEDRALS   basically everything in capital letters is fixed. If there is no easy solution where   /home/ubuntu/data/modelling    is not fixed this is OK to be set as fixed. But it would be better to have it not fixed, to have it more flexible.


>>> a = 1 >>> b = 2 >>> c = 3 >>> a+b is not c False   Close python, start new session to be sure variables aren't being re-used or anything  >>> a = 293 >>> b = 2 >>> c = 296 >>> a+b is not c-1 True   Why are these different?    4 is not 4 - False (correct)  295 is not 295 - True (incorrect)   EDIT: sorry I don't think I was clear in my question. i'm not asking if is not should be used for value comparison, or if it's equivalent to !=, I'm asking why it produces inconsistent results that vary based on the integer values being evaluated.


Equivalent of Java's String.getBytes() in C++?

I need to implement a decrypt method in c++ from a Java encrypted string passed to me from a server. The Java encrypted method is this:  public String crypt (String strMsg)throws CryptUtilException{     byte bytePosition;     int intMsgLen = strMsg.length();     int intKeyLen = strKey.length();     byte[] aByteMsg = strMsg.getBytes();     byte[] aByteOutMsg = new byte[intMsgLen];      if (intMsgLen==0) {         throw new CryptUtilException("In String is null.");     } else{         for (int i=0; i<intMsgLen; i++) {             bytePosition = (byte) (i%intKeyLen);             aByteOutMsg[i] = (byte)((aByteMsg[i] - iCharOffSet) + (byte) strKey.charAt(bytePosition) + bytePosition);             if (aByteOutMsg [i] < 0) aByteOutMsg [i] = (byte) (aByteOutMsg [i] + 128);         }          String strOutMsg = new String (aByteOutMsg);         return strOutMsg;     } }  My work colleague use that code for encrypt and the following code for decrypt a string and suggest my to replicate this Java code into my C++ project: public String decrypt (String strMsg)throws CryptUtilException{     byte bytePosition;     int intMsgLen = strMsg.length();     int intKeyLen = strKey.length();     byte[] aByteMsg = strMsg.getBytes();     byte[] aByteOutMsg = new byte[intMsgLen];      if (intMsgLen==0) {         throw new CryptUtilException("In String is null.");     } else{         for (int i=0; i<intMsgLen; i++) {             bytePosition = (byte) (i%intKeyLen);             aByteOutMsg[i] = (byte)((aByteMsg[i] + iCharOffSet) - (byte) strKey.charAt(bytePosition) - bytePosition);             if (aByteOutMsg [i] < 0) aByteOutMsg [i] = (byte) (aByteOutMsg [i] + 128);         }          String strOutMsg = new String (aByteOutMsg);         return strOutMsg;     } }  I have a lot of difficulty doing it because I don't find a valid method for replicate the Java getBytes() method. In addition, I have a very old version of C++ and for this I can't use the "byte" or the "wstring_convert" method and I'm not working on windows OS.


Having watched the latest Game of Thrones episode (""), I feel I've had a small epiphany. There's rumor and theory going around that in the books, Robb got Jeyne pregnant. Jeyne didn't attend the RW, and afterward was swept away. In the show, we know that Talisa is a replacement for Jeyne. And we find out that Talisa is pregnant. Looking over the credits, Martin himself wrote this episode (all except the bear scenes). Is it now safe to assume that Jeyne is pregnant?  EDIT  So, with last nights episode, how are we to interpret Jeyne's fate? Will GRRM take that into consideration when writing about Jeyne in the future? Or will he just say "eff em", and write that Jeyne was pregnant, had the heir, and he kicked face? Did GRRM have any say in the "Rains of Castamere" episode at all?


Suppose that a dataset $(x_1, \cdots x_N) =X \in \mathbb R^{d \times N}$ gives rise to the PCA (principal components analysis) result $\tilde X^\top \tilde X = U^\top DU$ where $\tilde X = (x_1 - \bar x, \cdots x_N - \bar x)$ is the centered matrix with $\bar x = \frac1N (x_1 + \cdots + x_N)$, $U$ is a symmetric matrix, and $D = \text{diag}(\lambda_1, \cdots \lambda_N)$ is a diagonal matrix of the principal values. Here, we may assume that $\lambda_1 \ge \lambda_2 \ge \cdots$. Question. How does one choose a number $k$ representing the intrinsic dimension of $X$ so that we only use the top $k$ principal components (the column vectors from $U$)? It seems that there are a few ways to do this, for example by taking the maximum $k$ such that $\lambda_k \ge \epsilon$, where $\epsilon \ge0$ is an error threshold. Analogously, one can bound the tail sum instead: $\lambda_{k+1} + \cdots + \lambda_N < \epsilon$, or the $L^2$ analogue: $\sqrt{\lambda_{k+1}^2 + \cdots + \lambda_N^2} < \epsilon$. There are more involved methods too, such as . However, I am curious of what is the most canonical method, either in practice or in theory.


Control the Action popup page width in Lightning Experience

I have an action on Contact page which opens a lightning component. The component opens as a popup/modal window, at a specific width. How can I change this width to make it wider?


Time dilation explained using a light-pulse clock

I found an explanation of time dilation using a light-pulse clock in the book 'Concepts of modern physics' by Arthur Beiser:    In this explanation, the clock is moving in a direction perpendicular to the light ray. What if the clock is moving in the direction of light ray. Will the time dilation change? How can we see the time dilated in this case?


which one is correct?  I don't like egg? or I don't like eggs?  After "don't like" we should use singular or plural form.


In practice, do large prime generators account for difference in gaps between primes?

It is my understanding that a method for creating large primes is to:   pick a random large number, check the number against trial division of a set of smaller prime numbers, check with something like Miller-Rabin if not prime increment by 2 and repeat   Is this method used in practice? And if so, does it matter that the method is biased towards primes that follow large gaps? How would you alter the method to make it more fair?


How to delete to trash via terminal (with mv command)?

I would like to know how can I delete a file and/or move it to trash with mv command?  I know where the trash located is, then I tried with this commands to move it to trash:  mv somefile /home/username/.local/share/Trash   this command work fine, but when I open trash in launcher it's still show empty. I can undo this deleted file in original location with:  mv /home/username/.local/share/Trash/somefile ~/   but if this location /home/username/.local/share/Trash isn't for Trash then where is moved my file?  I know rm will permanently delete file and not send it to a trash folder and there is no flag in man rm to delete file to trash.


Number of all bijective functions from A to A.

Find the number of all bijective functions from A to A. Given set A   has n elements   First number of one-to-one functions from A to A is n! as first element has choice of n elements, but second element has only n-1 since by definition of one-to-one it can't go to the first element choice..... Now with onto functions I am stuck how to do .  I notice this question has been answered previously by induction, I just think a counting proof would be more helpful for me to learn. Also I am unable to follow that argument there.


how to reset to commit while discarding untracked files?

I'd like to reset to a commit and, if there's any new file in my working directory, it should be deleted.  That was the behavior I've expected from git reset --hard [<commit>] but it simply ignores new files while reverting changes on modified files to how it was.  Consider the following example, where I do the following:   delete file main.c commit this change create file main.c revert to previous commit   And expected main.c to no longer exist.  $:~/dev/gittests$ ls main.c $:~/dev/gittests$ rm main.c $:~/dev/gittests$ git add * fatal: pathspec '*' não encontrou nenhum arquivo $:~/dev/gittests$ git status No ramo master Mudanças a serem submetidas:   (use "git reset HEAD <file>..." to unstage)      deleted:    main.c  $:~/dev/gittests$ git commit -m "deleted main" [master 84de2d3] deleted main  1 file changed, 0 insertions(+), 0 deletions(-)  delete mode 100644 main.c $:~/dev/gittests$ ls $:~/dev/gittests$ touch main.c $:~/dev/gittests$ ls main.c $:~/dev/gittests$ git status No ramo master Arquivos não monitorados:   (utilize "git add <arquivo>..." para incluir o que será submetido)      main.c  nada adicionado ao envio mas arquivos não registrados estão presentes (use "git add" to registrar) $:~/dev/gittests$ git log commit 84de2d30505cb6526a2f28918c8b37e4c086db59 (HEAD -> master) Author: ****** Date:   Wed May 15 01:34:27 2019 -0300      deleted main  commit 04382fc20f2fe6dc36ce4443c97f83b786f87781 Author: ***** Date:   Wed May 15 01:14:02 2019 -0300      initial commit $:~/dev/gittests$ git reset --hard 84de2d HEAD is now at 84de2d3 deleted main $:~/dev/gittests$ ls main.c


Tabbing multiple lines of code in stack overflow?

Can I tab multiple lines of code in stack overflow? When I copy and paste code into the code sample part, the alignment throughout the code is usually always off.


I withdrew money from my Roth IRA (let's say $5K in contributions and $6K in earnings) to buy a house, and then I didn't buy a house. Oops. How can I return or undo this withdrawal to avoid paying taxes and penalties at the end of the year?


Brief moment about Beta function from Rudin

Am I right that here before using Holder's inequality we must prove that beta-function always converges for $x>0,y>0$. Right?


VMWare ESXi 3.5 "Could not power on VM: No space left on device"

We have several VMWare ESXi boxes, and on some we get this message when trying to power on virtuals:  "Could not power on VM: No space left on device   Failed to power on VM"  The Datastore is 67G, we have two 25G virtuals and 16G free. the other datastores, also have ~10...20G free  any idea how VMWare handles disk space?


Why is my user name (number) displayed in the search box in Firefox on Ubuntu 12.04 LTS?

I am using Stack Overflow from my Ubuntu 12.04 LTS. Why do I get my username displayed in the search box in the top right top?


In order to demonstrate my problem, I created a simple scene with a cube and I used Vertex Paint to color one corner.    When I export to COLLADA, I make sure that "Include Material Textures" is checked.    The vertex colors are not saved properly.  I've verified this by importing the COLLADA file back into a new Blender file and also by importing it into MeshLab, Sketchup, Photoshop and 3DS Max, none of which showed colors.  I know the Stanford PLY format also supports vertex colors (and it worked well for this same cube), but the actual scene I'm dealing with has thousands of little complex objects and PLY can only export one object at a time.  I could write a script to export each object, but I'd rather get into one file.  (using Blender 2.69, Linux 64-bit, any more info needed?)


Google Sitelinks Working but not when searching the name of the site

My website sitelinks are only working when I Google example.com. If I Google search just the site name, it returns my site as number 1 but without the site links.  Is there any way I can make sitelinks appear for my site even when you Google only the site name?


Surjective function from $\mathbb{N}$ to $\mathbb{Q}$

I want to find some simple surjective function from $\mathbb{N}$ to $\mathbb{Q}$.  Since $\mathbb{Q}$ is countable, it should be possible.  Can someone find such function?


What is the red confetti for on my nearby PokeStop?  It appears to have confetti flying around it.


Probability that median falls within a range?

If I draw 5 samples from a distribution that is cont., what is the probability that the median of the population is between the xmin and xmax of the draw samples?  What is the formula to apply here?


Custom Permalinks for Custom Taxonomies/Post Types -> Top Level Pages not working

I have created a custom post type called "artists". These are categorized by the custom taxonomy "style". I do have this:  ./photography/edward-example (single page with details) ./photography/ (archive page which lists all artists in "category"/custom taxonomy "style" "photography")  (for example: photography as style, Edward Example as artist) I achieved this because I used the technique described in  for the custom taxonomy. The problem is, now my other pages (e.g. "./about") will not work. Can anybody help me out?


A "binomial" generalization of harmonic numbers

For positive integers $s$ and $n$ (let's limit the generality), define $$H_s(n)=\sum_{k=1}^{n}\frac{1}{k^s},\qquad G_s(n)=\sum_{k=1}^{n}\binom{n}{k}\frac{(-1)^{k-1}}{k^s}.$$ The former is ; the latter is what I'm wondering about. I met it in a number of contexts. Say, if $X_1,\ldots,X_n$ are independent random variables distributed exponentially with parameter $1$, then $s!G_s(n)$ is the $s$-th moment of $\max\{X_1,\ldots,X_n\}$. I was looking for an expression of $G_s(n)$ in terms of $H_s(n)$. Here are examples: \begin{align}    G_1(n) &= H_1(n), \\ G_2(n) &= (H_2(n)+H_1^2(n))/2, \\ G_3(n) &= (2H_3(n)+3H_2(n)H_1(n)+H_1^3(n))/6, \\ G_4(n) &= (6H_4(n)+8H_3(n)H_1(n)+3H_2^2(n)+6H_2(n)H_1^2(n)+H_1^4(n))/24 \end{align} (the first one is seen in the linked article and in some  on this site). The general formula appears to be  $$G_s(n)=\sum_{\substack{a_1,\ldots,a_s\geqslant 0\\ 1\cdot a_1+\ldots+s\cdot a_s=s}}\prod_{k=1}^{s}\frac{H_k^{a_k}(n)}{k^{a_k}\cdot a_k!}.$$  How would one prove it best? Can it be seen from $$\sum_{s=0}^{\infty}G_s(n)t^s=\prod_{k=1}^{n}\Big(1-\frac{t}{k}\Big)^{-1}\tag{$*$}\label{helpeq}$$ which is easy to prove (here $G_0(n)=1$)?


Stack Overflow site shows a mobile version on desktop

I use Safari on macOS Mojave Version 10.14  When I browse Stack Overflow, it shows a mobile version. I tried to switch to Safari private mode, it's working fine.  All other website displays a desktop version, even Stack Exchange and other sites.  Is there an account-specific option? Or site-specific maybe?  I might have to ask on ask different site since it might be caused by Safari, but since other sites are working properly, I asked here first.


Smooth functions and functions with continuous derivative

What is the relationship between smooth functions and functions with continuous derivative?  How does a function having continuous derivative makes it smooth? i.e no rough edges.  How can i interpret this geometrically?


One would use the word 'serendipity' to characterize something that happened out of the blue, without a prior expectation for it to happen. For example, a person finding a $100 dollar bill on the floor of a public corner would be serendipitous.  Assuming this definition of 'serendipity', which certainly has a positive connotation, what are some antonyms? For example, the word (antonym here) would describe a person working hard for a full day to earn a $100 dollar bill.


MySQL query several records from certain date range

here's my recordset:  id   date ----------------------- 1    2017-01-11 2    2017-01-12 3    2017-01-14 4    2017-01-15 4    2017-01-16   i'd like to query all records within the date range 2017-01-14 to 2017-01-16  currently i'm using:  SELECT * FROM foo WHERE (date='2017-01-14' OR date='2017-01-15' OR date='2017-01-16')   is there a better way (which would be probably faster for bigger ranges)? thanks  PS: i'm aware i could use:  SELECT * FROM foo WHERE date >= '2017-01-14' AND date <= '2017-01-16'   but the problem is that i don't want "gaps" between each day.


How can I prove the identity $\frac{1}{1-x} = (1+x)(1+x^2)(1+x^4)(1+x^8)\ldots$ for $|x|<1$? I am preferably looking for a derivation rather than using the RHS. I have tried using binomial expansion, but it only seems to give the LHS back. I also tried taking the logarithm of $\frac1{1-x}$ on seeing a product and using the Taylor series of $\ln{(1+x)}$, but this appears to be a dead end.


Unavailable Network Share causes Explorer (and its dependants) to hang for huge amounts of time

So, I have a laptop, and a desktop, both Windows 8.1. The laptop follows me wherever I go, and the desktop doesn't. The desktop has 5 external drives, and I am using Storage Spaces to pool the drives together. I have shared the resultant drive (REFS format) on my network, and have mapped to a drive letter on my laptop. So far, so good.  However, when I take the laptop off my home network to, say, the office, whenever I try to open a program that enumerates drives, the system hangs while it tries to connect to the drives. When I open Explorer at the office, it shows the network drive as available, but hangs for a long time, then discovers the network drive is not present.  I have confirmed that this hang is being caused by the mapped drive, because after disconnecting it, the hanging stops and everything goes back to normal.  I have experienced the hanging with the following software:   Explorer FileZilla (takes about 2 minutes to open) Skype (when saving a file) Sublime Text 2 (first time a file dialog box is opened) Oxygen XML Editor (any file dialog operation)   Is there anything I can do to either change the timeout when testing a network drives existence, or telling the system to ignore mapped drives unless specifically called?  I have tried working with just shortcuts to the network shares, but with some of the software I use, they don't support explicit network shares (Oxygen XML), and manual intervention would completely undermine the file version history tracker I have set up (would only index bulk commits made during a manual copy, rather than each and every change as I go along).    Additional  I found this issue originally in FileZilla last year at some point, and after raising a case with FileZilla, they came back saying that the hang was being caused by a lower level system component. The only difference between then and now is, then, I was on Windows 8, and the network drive was a single drive instead of storage spaces drive. Sadly, I can't find the case, but there are many others like it.  At that point, I gave up and resigned myself to slow FileZilla startup times, however, the hanging at that time was around 30 seconds, and now it has jumped to 2 minutes, so I really want this problem solved.


Identification of a short story with a sentient weapon

I am searching for the title of short story I have read several years ago. I think it was included in one of the Isaac Asimov Presents The Great SF Stories (or maybe some Nebula or Hugo short stories collections) but I have searched for it in any possible manner and didn't find it, so I'm probably wrong. I remember anyway that I was immensely surprised by this story as it didn't seem to fit in the period it was written: it was just too advanced.  What I recall of the story:   It was a about a super powerful sentient weapon built by aliens eons ago. This machine required a sentient being to operate even if it was fully capable of independent thinking. It was extremely powerful. The machine was extremely evil but needed to be connected to a lifeform to operate. Regardless every race that used the machine ended up fighting for it and being destroyed. During the eons of its existence the machine destroyed several different races (one for each chapter), one of them similar to the usual arachnid style races with different queens and eggs. The POV of the story alternated between the machine and an impartial narrator with some memories of the machines about its previous masters. Humans had just found the machine. I think one of the squad members, a member of the military, was the protagonist of another sci-fi cycle. The machine had to adapt to the humans to be operated and one of the first things she taught was that humans were just too inferior to control her, claiming that "they were just apes"   This story is a jewel!  Thanks for any help!


(Exercise 1.1.5 in Real Analysis 2 by Terence Tao) Let $n\ge1$, and let $a_1,a_2,...,a_n$ and $b_1,b_2, ..., b_n$ be real numbers. Verify the identity   $$(\sum_{i=1}^n a_ib_i)^2 + \frac12\sum_{i=1}^n\sum_{j=1}^n(a_ib_j - a_j b_i)^2 = (\sum_{i=1}^na_i^2) (\sum_{j=1}^nb_j^2).$$    This is a part of Exercise 1.1.5, and I am struggling with it. Can you give some hint?


How to display error message on the same page even with attachment

I have been trying to figure this out for days with no luck. I am working on Sharepoint 2013 application. In my application, the fields will be validated and display the error if the input is wrong. Just like the picture below:   However, when I attach any document, the error is NOT displayed on the same page. Instead it will direct to a new page:    This only happens when there is attachment.   My code which is called by ItemAdding() is below:  private bool ShowError(SPItemEventProperties properties)     {         if (errorMsg.Length > 0)         {             string temp = errorMsg.ToString().Replace("\r\n", " | ");              properties.Status = SPEventReceiverStatus.CancelWithError;             properties.ErrorMessage = temp;              return false;         }         return true;     }   Please advise. I want the error to be displayed on the same page just like without attachment.


WHEN and HOW OFTEN sanity testing is performed in a testing cycle?

I have read several posts regarding smoke and sanity testing. All are almost confusing. Neither explaining them clearly,just repeating the matter except some two or three posts and based on that two or three posts i concluded that following is the formal process:  Smoke testing(generalized health checkup)---then--> Sanity Testing(checking functionalities to deepest level)(Specialized health checkup)----------------then--------> Functional testing(full functionality checking)  Am I right in above concept?  I have confusion regarding when sanity is performed. Smoke is performed when build comes very first time. But when sanity is performed? Is sanity is performed only after every smoke OR it is performed every time build undergoes some change(i.e. even when smoke is not performed because smoke is performed only first time build comes) OR in both cases?  [EDIT]i want to made it clear here that i am not asking here for difference between smoke and sanity as many people are marking it duplicate for another question in which user has asked for difference between two. Here i am asking WHEN and HOW OFTEN sanity is performed in testing life cycle.  [EDIT] Thanks all for giving time to this question. Though it is not duplicate still marked duplicate. Anyways. I found my answer .


How to bind event to appended element in jQuery

When loading the page I bind the click event of a list of element. then I append new items to the same list with same element but event not binds with the newly added elements.  This problem with me from a long time and I usually reload that location after I appended element, but it is not giving me the benefit of using ajax.  Common answer with sample code will appreciated.


I am trying to understand the solution to the below puzzle      There are 13 Red, 15 Green, and 17 Blue Chameleons at some point of   time. Whenever two Chameleons of the different colors meet both of   them change their color to the third color. Is it ever possible for   all Chameleons to become of the same color?   I am able to figure out "manually step by step" that it is not possible to get all in one color.  However I don't understand the more formal solution using the modulo, for example Solution 1 .    I realize that after every change the differennce between the second and first terms is -3, 0 or 3.    What are the vectors (2,2,2) representing?  I don't understand the final statement there:  We see that, with the initial vector (1, 0, 2) modulo 3, the only possible combinations of colors on the island are (1, 0, 2), (0, 2, 1), and (2, 1, 0), and these occur cyclically with period 3.  Can anybody explain in simple way this solution to the problem?


Installed Win7 after Ubuntu, Win removed Ubuntu boot option

Completely 100% new to Linux.  I recently partitioned my drive to run Windows and Ubuntu simultaneously. Ubuntu installed fine, but then I installed Win7 and suddenly Ubuntu disappeared from the boot options.  This is probably semi-duplicate, but the answers to the other questions insinuated there was something wrong with "GRUB" something. The suggested solution seemed to depend on the Linux terminal. Maybe I'm missing something trivial, but I don't see how I access the terminal at this point. Can I fix it via Windows somehow?


What is Pythonic way to test size of a generator, then display it?

Yesterday I have been implementing a small Python scripts that checks difference between two files (using difflib), printing the result if there is any, exiting with code 0 otherwise.  The precise method, difflib.unified_diff() is returning a generator on the diffs found. How can I test this generator to see if it needs to be printed? I tried using len(), sum() to see what was the size of this generator but then it is impossible to print it.  Sorry to ask such a silly question but I really don't see what is the good practice on that topic.  So far this is what I am doing  import difflib import sys  fromlines = open("A.csv").readlines() tolines = open("B.csv").readlines() diff = difflib.unified_diff(fromlines, tolines, n=0) if (len(list(diff))):     print("Differences found!")     # Recomputing the generator again: how stupid is that!     diff = difflib.unified_diff(fromlines, tolines, n=0)     sys.stdout.writelines(diff) else:     print("OK!")


I'm having a lo-gin   page in that i just want to clear suggestion box like if 10 users lo-gin from that lo-gin page and when 11 user try to lo-gin from same lo-gin page and when he click on that input field he gives all 10 the names as suggestion  i don't want that user know the  name of previously lo-gin users please help i already tried autocomplete in input field as well as on form but it won't help I'm a fresher if i made any mistake in writing please consider...  <input class="input-field" id="userName" name="userName" type="text">.


I recently got over a problem. For short ranges, the properties dialog displays relative timestamps like "2 hours ago". Normally I am fine with that, but at internet shortcuts I cant see the exact date anywhere.    Is there any way to turn this feature off?


Change field type with hook_update_n for a module

Hello I need to update the field type of one of my content types. The content type is of a module so I need to do this with the Drupal API for let users update the module for their 7.x-1.0 branch.  This is the hook for update the field, I need to change it from Integer to Decimal like this:   /**  * Change field_inq_description field from Integer to Decimal  */ function field_updates_update_7100() {   // Manual database changes.   db_query("UPDATE {field_config} SET type = 'number_decimal' WHERE field_name = 'field_rin'");   db_change_field('field_data_field_rin', 'field_rin_value', 'field_rin_value', array(     'type' => 'numeric',     'precision' => '10',     'scale' => '2',   ));   db_change_field('field_revision_field_rin', 'field_rin_value', 'field_rin_value', array(     'type' => 'numeric',     'precision' => '10',     'scale' => '2',   ));   // Clear caches.   field_cache_clear(TRUE);   // Apply the new field instance configuration. }   After I apply the update with update.php script I get these notices everywhere in the test website.  Notice: Undefined index: precision in number_field_schema() (line 35 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install). Notice: Undefined index: scale in number_field_schema() (line 36 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).   What Im I doing wrong?


Why does US Customs & Immigration ask the purpose of my trip when I'm returning home?

As a US citizen, when I re-enter the US, I am often asked where I was, how long I was there, and the reason for my visit.  Why am I asked these things?  Am I required to answer? Don't I have a legal right to enter the US (as long as I'm not doing or carrying anything illegal)?  If I were to refuse to answer these questions, would I be permitted entry?  Note: I'm not really bothered by the questions (except when the agent asking them is especially rude), I'm just curious.


Launch only one instance of a java application

I have a javafx application that I packaged and installed on my pc.  The first launch of the application is working fine.  If I keep the application running, is there a way to handle the second launch of application to show the first one like skype for example ?  Thank you so much in advance  Update:  I tested the ManagementFactory example, it's only working on the IDE (I'm using netbeans) but when the application is installed(Windows 8), the class name and the command line are empty ! So the comparison is not good.  For the file locking, I'm already using this approch for protecting a file when the application is launched but it does not throw an exception when launching the second instance ! (Besides, on Oracle forum , they said if there is a power cut, the file will be still locked).  For server socket, I think it's not a good approch because it's a desktop application, so I can't guess which port is not used !


What is  the value of $\Gamma(\mathrm{i})$ ? $\Gamma(z)$ is Gamma function. Here $\mathrm{i}^2=-1$.Can you help me with this problem ?


How can I check if my server is using ssl 3?  When I run openssl version command I get this.  OpenSSL 1.0.1 14 Mar 2012  Thanks.


How can I tell Windows what my physical location is?

I've found that some Windows 8 programs such as Weather and Maps can be granted permission to access my physical location. However, I couldn't find a place to define this. Windows currently seems to guess it from my IP address or something like that.  I can tell the Weather application what my location is, but I would prefer to make use of the information being centralised and provided by the OS for convenience.


Problem with sudo apt get update: The repository cdrom... does not have a Release file

Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS


Finding the SObjectType from the SObjectField

As part of the implementation of an API, I would like to be able to find the SObjectType from the SObjectField:  public class MyClass {     // Fields are from various SObjects     public void myMethod(SObjectField[] fs) {         for (SObjectField f : fs) {             DescribeFieldResult dfr = f.getDescribe();             SObjectType t = ...;             ...;         }     } }   but even in the describe results it does not appear to be present. Am I missing something?


I am looking to build a smart censor in PHP using Regex for a message board.  Basically, I have an array the bad words (in Regex) along with the substitution to be used for each.  I detect spaces in between the letters to prevent bypassing the censor, but I'm hung up on someone having any of the bad word's letters wrapped by HTML tags.  So, if "shit" is blocked, I can catch "s  h  i  t" with any number of spaces, but if someone does sh<b>i</b>t (with the i wrapped with bold tags), it gets through.  That obviously can't happen, so I'm stumped here.  Here is what I have so far:  $bad_words = array('/s\s*h\s*i\s*t/i'=>'s***'); $new_string = preg_replace(array_keys($bad_words), array_values($bad_words), $string); return $new_string;   I've thought of wrapping $string with strip_tags() but because the rest of the post contents (not just the bad words being sought after) can contain HTML, that will destroy the whole message board post on return.  Any help or insight provided would be greatly appreciated!


Physical interpretation of $\frac{\partial \rho}{\partial t} + \frac{\partial j}{\partial x}=0$

What is the physical interpretation of $\frac{\partial \rho}{\partial t} + \frac{\partial j}{\partial x}=0$? Here $\rho$ is the probability density and $j$ is the probability current of a particle of mass $m$ moving in one-dimension.


Where is this "overused" piece of ending originated from?

Here it is:   Here's an , jump straight to the end (at 11:07).  It is literally heard everywhere, mostly used as an improvisation, e.g. to add a fun and humorous twist in any piece of music. Because of being used everywhere, I have no clue where/what song or music piece it was originally taken from.


Platform-independent GUID generation in C++?

What is the best way to programmatically generate a GUID or UUID in C++ without relying on a platform-specific tool? I am trying to make unique identifiers for objects in a simulation, but can't rely on Microsoft's implementation as the project is cross-platform.  Notes:    Since this is for a simulator, I don't really need cryptographic randomness.  It would be best if this is a 32 bit number.


Create files in folders created by other users

I would really appreciate any help you guys can give me with the problem im having. First of all, im pretty comfortable with command line but by no means an linux expert so I would appreciate some detail in any answers you give if possible. Thanks!!  I am trying to set up a file server running Ubuntu 14.04. I have a folder /files and within that I will be creating a few folders that will all be shared with different permissions. I have samba running and can access the shares from machines on my network. I have changed the the owner of the files directory to be my admin user and a new group I have created, for simplicity ill call it mygroup.  I have chown'd the /files directory to myuser:mygroup and then created new users in Ubuntu and added them to mygroup as there primary group. I have also chmod'd the files directory to 770 so that both my admin user and mygroup have full write access. I then have samba users for each group and allowed them access to my shares in samba (im using a GUI by the way but happy to get stuck in with command line if I have to).  All of this so far is good, my users can connect to the samba shares from both mac and windows and they can even create directories.   The problem is, if a user creates a new directory within the share, it is created with 755 permissions meaning that other users in mygroup can read and execute but cannot write to that directory.   I have read up about ACL and have run the following command against the /files directory:  setfacl -m "g:mygroup:rwx" /files/   Then if I run:  geftacl /files/    I can see group:mygroup:rwx in the list, and the same is true if I test the subfolders of /files. As far as I am aware, this should set the permissions for any new files being created within that directory to at least be x7x?  I have also seen within smb.conf the create mask and directory mask settings, I have tried changing these to be 0775 (and uncommented them) but it is still created with the same permissions.  Can anyone recommend anything else to try?