body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
On my laptop, I had Windows 7 Home Premium preinstalled. A year or so ago, I dual-booted it with Ubuntu 14.04 LTS. I now want to upgrade Windows 7 to Windows 10 (it's free, so why not?) when it's released. However, I'm unsure whether this will affect GRUB and stop me from accessing my Ubuntu partition. I need both operating systems and can't afford to lose either. If this will affect GRUB, how can I restore GRUB so I can access both operating systems? Thanks in advance. EDIT: Just to be clear, I already have a dual-boot set up, where Ubuntu was installed alongside a pre-existing Windows installation. I now want to upgrade Windows (from 7 to 10) but am worried it will affect GRUB and my ability to boot into Ubuntu. UPDATE: I installed Windows 10 and it ended up leaving GRUB alone. Selecting the Windows 7 option booted me into Windows 10.
I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install. What can I do to fix this?
I am trying to write an app that will trigger an pkg to open so the user can install this. I have the code and it is working well except for the following. When I try to open the pkg file using open /tmp/mypackage.pkg in most cases it will open the Finder to the users home folder not the package. I have checked and the package is present within the specified directory and the application is creating the correct command. The command i am using to do this is in python: subprocess.Popen(['open', '/tmp/mypackage.pkg']) application.close()
From the command line is it possible to open a package installer window (not install the application). I understand I could run the application using sudo installer -pkg ..... -target ....... Instead i would like to open the package in a similar way to if I double clicked the package within the Finder.
Let's say I have String type = "Integer" for example, and I have on the other side a public class MyType<T> with a constructor public MyType(){} How can I use the java reflection newInstance method in order to be able to do something along the lines: public static MyType<?> create(String type){ return /*new MyType<Integer>() if type was "Integer", etc*/; }
I read about Java's type erasure . When does type erasure occur? At compile time or runtime? When the class is loaded? When the class is instantiated? A lot of sites (including the official tutorial mentioned above) say type erasure occurs at compile time. If the type information is completely removed at compile time, how does the JDK check type compatibility when a method using generics is invoked with no type information or wrong type information? Consider the following example: Say class A has a method, empty(Box<? extends Number> b). We compile A.java and get the class file A.class. public class A { public static void empty(Box<? extends Number> b) {} } public class Box<T> {} Now we create another class B which invokes the method empty with a non-parameterized argument (raw type): empty(new Box()). If we compile B.java with A.class in the classpath, javac is smart enough to raise a warning. So A.class has some type information stored in it. public class B { public static void invoke() { // java: unchecked method invocation: // method empty in class A is applied to given types // required: Box<? extends java.lang.Number> // found: Box // java: unchecked conversion // required: Box<? extends java.lang.Number> // found: Box A.empty(new Box()); } } My guess would be that type erasure occurs when the class is loaded, but it is just a guess. So when does it happen?
I understand most of the proof except how it starts with that $p$ and $q$ in $\frac pq$ where $p$ and $q$ are integers and $q$ can’t equal $0$, that $p$ and $q$ must be coprime? Why must they be coprime? I don’t think it’s part of the definition of a rational number.
The proof that shows the square root of 2 is irrational starts by assuming, for a contradiction, that it is rational. It starts with the assumption that it can be written as p/q where p and q have no factors in common. Why do we start by assuming p and q have no factors in common? If we went on to find that they have factors in common, we could cancel them later on?
I'm trying to export around 20k records from a table in mysql to csv and as expected it crashes my system, is there any alternative to doing this as to avoid crashes? here's my current export code: $filename2 = "csv/leads_".date("M-d-Y",time()).".csv"; $fp2 = fopen($filename2, 'w') or die("can't open file"); $sql2 = $sql_getcustomers; $res2 = mysql_query($sql2); // fetch a row and write the column names out to the file $row2 = mysql_fetch_assoc($res2); $line = ""; $comma = ""; if($row2){ foreach($row2 as $name => $value) { $line .= $comma . '"' . str_replace('"', '""', $name) . '"'; $comma = ","; } $line .= ",crm_group"; $line .= "\n"; fwrite($fp2, $line); // remove the result pointer back to the start mysql_data_seek($res2, 0); // and loop through the actual data while($row2 = mysql_fetch_assoc($res2)) { $line = ""; $comma = ""; foreach($row2 as $index => $value) { $line .= $comma . '"' . str_replace('"', '""', utf8_decode($value)) . '"'; $comma = ","; } //** GET THE CRM GROUPS $sql_get_group = "SELECT a.crm_group_name, b.* FROM tbl_crm_members b JOIN tbl_crm_groups a ON (a.crm_gid = b.crm_groupid) WHERE crm_uid = ".$row2["uid"]; $sql_get_groups = mysql_query($sql_get_group); $res_get_groups = ""; while($sgg = mysql_fetch_object($sql_get_groups)) $res_get_groups .= $sgg->crm_group_name.";"; $line .= ",".trim($res_get_groups, ";"); $line .= "\n"; fwrite($fp2, $line); } fclose($fp2);
Is there an easy way to run a MySQL query from the Linux command line and output the results in format? Here's what I'm doing now: mysql -u uid -ppwd -D dbname << EOQ | sed -e 's/ /,/g' | tee list.csv select id, concat("\"",name,"\"") as name from students EOQ It gets messy when there are a lot of columns that need to be surrounded by quotes, or if there are quotes in the results that need to be escaped.
I would like to see the labels for every equations in pdf format? this is easier to refere later by looking for the labels in pdf format not in text file.
Working with documents with huge amount of equations it becomes cumbersome to go back and remind yourself what you labeled a certain equation to (I try to name them in a smart way, but there are too many). Is there a convenient way to have equations print the label along with the tag/number, so that I can easily check the label in the compiled document? Something like this would be perfect: x = y (14.1) eq:my_label
How long can HDD survive without power. I have three Samsung HD103SJ HDDs none of them were powered for few years. I took them from RAID 5 array and all of them were functional. Now I tried to make new RAD 5 array but they are death. All of them. Im not asking about data retention. I thought maybe some electrolyte capacitor died or some internal batery that helps actuator arm to get in safe position after sudden power off.
What lifetime can be expected of the typical hard disk? Or are there big differences between different types? And does it make a difference if it is used heavily instead of never being connected to system (for example serving as a backup medium)?
I have been making my first game, I have a number of levels I was thinking of making, around 20-30 but I'm not sure if this is too many. Is there a hard and fast rule for number of levels to include in a game?
One issue I grapple with across many of my games is trying to decide how many levels to put in my game. This is across genres and platforms. In general, constraints that may decide -- although they are not applicable in my case -- can include: Pre-determined schedule or release dates Fixed budget The game's story finishes/concludes (PCG games): difficulty becomes "impossible" These are all great, but not sufficiently constraining as to tell me how many levels to make. Another constraint that sounds good in theory but is hard to implement is game time -- for example, Mario or Super Meat Boy, I can guesstimate x minutes per level, and target y minutes of intended total gameplay, yielding y/x levels. But none of these seem quite right to me. It seems like there should be a better way to decide when to add more levels and when to stop.
<html> <head> <style> .tagging { border: 1px solid black; width: 20px; height: 30px; } </style> <script> window.onload = function() { var div = document.getElementsByTagName("div"); div[0].class = "tagging"; } </script> </head> <body> <div></div> </body> </html> This is my code. I wonder why it doesn't work when I assign class attribute via javascript, but it works when I assign inline directly in html <div class="tagging"></div>
How can I change the class of an HTML element in response to an onclick or any other events using JavaScript?
Please note, when we click on copy command on context menu in the file manager the selected file is copying. just like that i want to get the selected file in any folder to split vedio with ffmpeg command . i think you get my request for help please try to understand, for example i opened a folder and selected a file i want to know the command to store this file"s name with full path in a bash script variable
From time to time I come up with ideas of actions I'd like to have available in the context menu of Nautilus. How do I add them there? Is there something like a Thunar UCA plugin for Nautilus?
Apparently, it's not possible to create a nested directory in a single command? $ sudo mkdir x/y/z mkdir: cannot create directory 'x/y/z': No such file or directory
Is there a linux command that I'm overlooking that makes it possible to do something along the lines of: (pseudo) $ mkdir -R foo/bar/zoo/andsoforth Or is there no alternative but to make the directories one at a time?
"The irate customer asked for the chef." The irate customer asked something. (Noun phrase?) Since you can fill in something in place of 'for the chef,' does that mean it is a direct object and an adverb at the same time?
An example sentence from the : [I] He only lived a few days after the accident. [I] means "intransitive verb". He (subject) + lived (verb) + a few days (noun). What part of speech is a few days? From the : number 5 way of life[intransitive always + adverb/preposition, transitive] to have a particular type of life, or live in a particular way used 'transitive verb' like 'She lives a very busy life.' From the ELU question : She is 16 year old. '16 years' as acting as an adverb. My questions are: In "He lived a few days.", is a few days an object (noun) or an adverb? How is it different from "He lived for a few days."? "I walked ten miles." Number + measurement — how can I deal with 'part of speech'?
$$\lim_{x \to 0} \bigg(\frac{\sin x}{x} \bigg)^{\frac{1}{x^2}}$$ The task should be solved by using Maclaurin series so I did some kind of asymptotic simplification $$\lim_{x \to 0} \bigg(\frac{\sin x}{x} \bigg)^{\frac{1}{x^2}} \approx \lim_{x \to 0} \bigg(\frac{x - \frac{x^3}{6}}{x} \bigg)^{\frac{1}{x^2}} \approx \lim_{x \to 0} \bigg(1 - \frac{x^2}{6} \bigg)^{\frac{1}{x^2}}$$ How can we say answer that is $e$ in the power of $-\frac{1}{6}$. I want some proving of that fact. Thank you.
I am trying to evaluate the following but without result. $$\lim_{x\to0}\left(\frac{\sin x}{x}\right)^{{6}/{x^{2}}}$$ Can you please give me some hints? I have tried to put log to both sides but it hasn't lead me somewhere... Thanks a lot
I would like to show a big diagram (full page, coded as figure with \includegraphics) at the end of a Section (Section 1). Unfortunately, the text of Section 1 does not end at the bottom of a page and I have a big white-space before the diagram. Is there a way to start the text of of the next Section (Section 2) after the text of Section 1 and before the diagram to fill the white-space between Section 1 and the diagram? Thanks for your help!
How to influence the position of float environments like figure and table in LaTeX? This is a general question and should collect useful answers for all users. I hope we can use this as a reference
Im new to blender, I accidentally dragged what i think is the animation timeline at the bottom of the screen upwards, and now It covers the entire screen. I dont know how to put it back, I tried dragging down from the top but it doesnt work. Please help.
I would like to close some view windows that I opened accidentally. See the image below: Edit: another note: I tried searching for the solution, but only found things like "Join Area", which don't seem to work in this situation.
If I am a resident of the United States and I wish to run Google AdSense in my website, how many months old should my website be?
I have a blog which is only 35 days old. What are the requirements for Google AdSense? How many page views are required and how old does the site have to be?
Since I have some similar question to this one, I'll be happy to understand how to solve it. $G$ is a group and $A,B\le G$. I need to show that $A \cap B \le G$ (If $A, B,$ are subgroups of $G$, I need to show that $A \cap B$ is a subgroup of $G$, too.)
$P$ and $Q$ are subgroups of a group $G$. How can we prove that $P\cap Q$ is a subgroup of $G$? Is $P \cup Q$ a subgroup of $G$? Reference: Fraleigh p. 59 Question 5.54 in A First Course in Abstract Algebra.
Just starting out with Python Could anyone explain the reasoning behind why some built in string functions take arguments within their brackets like this: length = len("This is a string") whilst some other functions seem to just be "chained" on to the end of the string that they are operating on for example: uppercase = "lowercase string".upper() Probably a silly question but just wondered if there was a reason behind this that I'm unaware of.
I know that python has a len() function that is used to determine the size of a string, but I was wondering why it's not a method of the string object. Update Ok, I realized I was embarrassingly mistaken. __len__() is actually a method of a string object. It just seems weird to see object oriented code in Python using the len function on string objects. Furthermore, it's also weird to see __len__ as the name instead of just len.
I have created a 3D animated character in Mixamo and uploaded the .fbx file into Blender. What steps do I need to take to export it as an .mp4 file (Maybe there is a tutorial I could watch?) I'm new to 3D animation and Blender so any help would be much appreciated :)
So I made an intro using animation and it saves it as a .blend and I want it so save as a video like .mp4 or something like that. I've tried changing the codec because I tried opening the intro with windows media instead of blend. I didn't try all the codec's but I tried some of them.
So, one of the spellcasters in my group wants to cast invisibility on the thief to have him scout out a dungeon. The Players Handbook doesn't specifically say the caster must be in sight range of the target and there is a little bit of debate between group members on whether the caster needs to maintain sight range to maintain concentration on the spell, or whether it just works no matter what (checks willing) for an hour.
Does going outside the range of the spell or breaking line of sight between the caster and target break concentration or otherwise affect control over the spell? For example, a Heat Metal spell has a range of 60 ft. If I cast the Heat Metal spell on a an armored foe, and that foe runs outside the range of the spell (60 ft), or around the corner, does that break concentration and end the spell? Heat Metal also allows you to use a bonus action to cause the 2d8 of damage — would exercising that option be prevented by being out of range or line of sight?
In my header file I want to avoid using #include but my class will have a vector or a pointer to a vector. I'm content with just a pointer, but I can't figure out how to declare it. Will I have to declare it as a void* and always cast it? That would be lame. // What do I type here to forward declare vector? class Counters { Counters(); void inc(const char* s); void print(); void clear(); private: std::vector<int>* Counts; int total; }; Please note carefully that I only want a POINTER TO a container to be stored in my class, NOT a container. The size of pointers is known without needing to refer to the declaration of the container, so please do not answer that this can't be done because the compiler needs to know the container declaration.
Is it possible to forward declare an standard container in a header file? For example, take the following code: #include <vector> class Foo { private: std::vector<int> container_; ... }; I want to be able to do something like this: namespace std { template <typename T> class vector; } class Foo { private: std::vector<int> container_; ... }; Can this be done?
If dual of two normed linear space $X$ and $Y$ are isomorphic, then does this implies that these two spaces are also isomorphic? I encountered this problem while proving that if dual of $X$ is reflexive then it implies that $X$ is also reflexive. Dual of $X$: All bounded linear functional on $X$ $X$ is reflexive: Dual of Dual of $X$ is isomorphic to $X$, if the natural mapping from $X$ to Dual of Dual of $X$ is onto.
Let $X$, $Y$ be Banach spaces such that the duals $X^\ast$ and $Y^\ast$ are isometrically isomorphic. Are $X$ and $Y$ necessarily isomorphic? The answer to the question whether $X$ and $Y$ are automatically also isometrically isomorphic is no as the example $c$, $c_0$ which both have dual $\ell^1$ but are not isometrically isomorphic shows.
I am trying to open a TTY by Ctrl+Alt+F1 combination, but instead, I see the Ubuntu login screen, like if I have just logged out. It is a problem for me as I'd like to run twm instead of Gnome, but I just can't access the tty. SOLVED: Ctrl+Alt+F5 was the combination I needed to access terminal "out of" X.
After upgrading to 17.10 like a true pioneer, I found the old CtrlAltF1 no longer switches between console mode and GUI, and a quick Google search brought up nothing useful. Was this feature removed entirely?
Is it possible for one to triple boot three linux distros or (2 distros together with windows)?
I would love to triple-boot Windows XP Pro, Ubuntu 12.10, and Backtrack 5 R3, but is this safe for my harddrive/other OSs on the computer?
It is said that if we travel at the speed of light,we will go into future,please could you explain how?Is it possible to make a time machine ever? Please give an easy answer, a simple one!
I read somewhere that according to relativity, it is possible - involving black holes and other stuff - to jump into the past. Is it possible for anything to go back in time either continuously or by jumping?
I died in one of my worlds in my house and I respawned in a lava lake. I'm on survival. I'm using Minecraft PC v0.10.2
I landed in lava in Minecraft: pocket edition and died. I keep respawning in that lava. What do I do?
What is the best way to run a JavaScript function when a user reaches a certain point on a web page?
I'm loading elements via AJAX. Some of them are only visible if you scroll down the page. Is there any way I can know if an element is now in the visible part of the page?
When I try to use an image for the world sky material it doesn't show the image in viewport and render, instead it shows the base color and it's black in render view, it is only happening with new .blends , I tried opening other .blends and it works, as you can see in the picture, the sky is not showing correctly and instead it shows the base color of it which is purple-ish black
I have an object with an hdr for the background. What do I do in Cycles to render the background with my object? How is this different from an ordinary render in Cycles? The hdr is a big one, 350MB.
What advantages does Blender Render have? I personally always use Cycles Render, because I think the rendered material looks more realistic and node shaders are easier to use.
How does Cycles work and how is it different from Blender Internal? Which is better?
What book will teach the most rigorous way the regression analysis? I read as a mathematician myself, and now I have to improve my statistical skills to get a job. I would like to learn what kind of methods there are to measure how to fit model to data and why those methods work. I'm not afraid to work through proofs. Is, for example, "Applied Regression Analysis and Other Multivariable Methods" written by David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam and Keith E. Muller good for learning the subject rigorously? Are there books similar to "Statistical inference" written by Casella and Berger, but concentrated on regression analysis?
What is a good introduction to statistics for a mathematician who is already well-versed in probability? I have two distinct motivations for asking, which may well lead to different suggestions: I'd like to better understand the statistics motivation behind many problems considered by probabilists. I'd like to know how to better interpret the results of Monte Carlo simulations which I sometimes do to form mathematical conjectures. I'm open to the possibility that the best way to go is not to look for something like "Statistics for Probabilists" and just go to a more introductory source.
It's no longer in the File menu, it seems?
The manual for V. 2.80 says: "To open the User Preferences editor go To File ‣ User Preferences. " User Preference does not exist under File. I want to make paths to folders with filepaths Where do I find it?
I recently came accross the tag. It has not tag wiki. Looks like a meta tag for everything that involves characters/letters 0 followers Only 104 questions. Usages include: Device letters for Windows as synonym for character specific letters for a language (Greek letters) I believe it should be burninated.
I don't see any case where the tag could be useful (or for that matter). are always tagged with a programming language, which is much more pertinent. Should it be Burninated?
I've encountered an elder dragon at level 27 as a Breton. I have no dragon armor, no dragon weapons, no Wabbajack, no horse, no poisons or health based potions and I am over encumbered. How can I escape alive and/or defeat an elder dragon? I have a dwarven shield, armor, helmet and gauntlets, blade of woe (unimproved), Nightingale blade and orchish boots and none of them are enchanted. I have one improved item which is Elven bow (superior) and I don't have the dragonrend shout.
I finally got dragonrend and defeated Alduin, but I'm still too weak for fighting ancient dragons. Any certain weapon for killing them. (I've got lvl 20 one handed weapons and lvl 46 for archery, so the Dragonbane is out of the question)
Here is a very simple question about light. As far as I remember from the school program, each color is merely one of the frequencies of light. I also remember that each color's wave length is different. On the other hand, when talking about the speed of light, I've always heard only one value. Why is it so? Shouldn't it be like the red color's speed must be way higher (or lower) than, say, the purple color's speed? I am quite confused here. (Sorry if my question is too foolish, but it has bugged me for years and I was quite bad at physics at school and have never touched it since I finished school)
It is well known that a can "split light" by separating different frequencies of light: Many sources state that the reason this happens is that the is different for different frequencies. This is known as . My question is about why dispersion exists. Is frequency dependence for refraction a property fundamental to all waves? Is the effect the result of some sort of non-linearity in response by the refracting material to electromagnetic fields? Are there (theoretically) any materials that have an essentially constant, non-unity index of refraction (at least for the visible spectrum)?
Is there any software esp. forensics and such, that allow me to unlock a disabled iPhone from putting in too many wrong attempts. I know the correct PIN but I don't want to reset it since this contains VERY important data. The screen says iPhone is disabled, and connect to iTunes, but before I do that I just wanted to inquire.
A friend asked me to help her with her old iPhone 4 (she has upgraded to a 7). When I turn it on, it says, "iPhone is disabled" and "connect to iTunes." When I do so, iTunes reports that it is locked with a passcode, and that I need to type that in to continue. However, the iPhone does not display a keypad or allow any sort of input. Apple suggests the only solution is a wipe, but this will lose all of her photos. Can photos be retrieved (at a minimum) from a disabled iPhone 4?
Suppose that the joint probability density function of X1 and X2 is given by: $$f(x_1; x_2) = exp(−x_1 − x_2)$$ $x_1 > 0$; $x_2 > 0$ and $0$ $elsewhere$. We define Y1 and Y2 as follows: $$Y_1 = X_1 + X_2$$ and $$Y_2= \frac{X_1}{X_1+X_2}$$ Determine the distribution of Y2. SOLUTION: I have used transformation theorem to find the distribution of Y2. Firstly I found that $X_1=Y_2Y_2$ and $X_2=Y_1-Y_2Y_1$ Jacobian determinant yields $J = Y_1$ Finally, I get: $$f(y_1,y_2) = e^{y_1}\times y_1$$ QUESTION: How are the boundaries for the new joint distribution determined? I always have troubles to determine the boundaries/range in this kind of examples. Is there a technique? To determine the marginal distribution I "integrate out" the $y_1$ (assimung the boudary is $0<y_1<1$) as follows: $$ f(y_2) = \int_0^{1} e^{y_1}\times y_1 dy_1 = [(y_1-1)e^{y^1}]_0^1=-1$$ This doesnt seem right. I guess the boundry is where i am making the mistake?
Been crushing my head with this exercise. I know how to get the distribution of a ratio of exponential variables and of the sum of them, but i can't piece everything together. The exercise goes as this: If X,Y are independent exponentially distributed with beta = 1 (parameter of the exponential distribution = 1) then what is the distribution of X/(X+Y) Any ideas? Thanks a lot.
I want to create an Automator Service that will run an xattr Terminal command on a single or batch of files. I can do the operation in Terminal (kinda), but I didn't understand how to apply that to Automator. Basically I was trying to remove Where From extended attributes from an flv or mp4 file. In terminal I'd simply type: xattr -d com.apple.metadata:kMDItemWhereFroms /Path/To/File That threw an error, but it still worked. I'm running macOS 10.11.6, El Cap. I finally figured it out. It appears I didn't need to be as selective with the xattr command, since I just want to clear all the extended attributes. Here's an image of what appears to work: I still don't entirely understand the actual Shell Script language. I learned from reading a lot of other posts that unlike Terminal, you have to tell the shell script where xattr (the tool) is. /usr/bin/xattr I assume that "$f" is the file(s) that you select in the Finder. I continue to be confused by the difference between "Get Selected Finder Items" & Get Specified Finder Items." They both seem to pass whatever you choose in the Finder through. I chose the 1st option and it worked. Apologies if this all seems elementary to you guys, I have zero experience writing scripts. I just usually cut and paste someone else's work, and 9 times out of 10 that's done the job. Just couldn't find this particular explanation anywhere. Hopefully it will help someone else.
I want to create a service using Automator to run a shell script on all files in a folder, say delete all log files. What I have done is Created a new service in automator. Added a "Run Shell Script" action. I have change this to 'pwd' for now. Selected "Service receives selected folders". Tried to run it, but get a message. "To test this service within Automator, add the "Get Specified Finder Items" action to the beginning of your workflow. Remove or disable the action before running the workflow outside of Automator. OK. So I add "Get Specified Finder Items". Added a 'test' directory to the list of items. Now, when I run the script, the results window prints out my home directory. Elsewhere, I have read that I maybe need to add cd "$1" to the beginning of my script. I did that but it still prints my home directory. How do I get this thing to print the directory I have selected in "Get Specified Finder Items?" Edited to Add Here is a screen shot of a script that works. Here is a screen shot os a script that doesn't work. The usual way I would deal with the "no match found : *.log" error would be to redirect error output to null. Replacing the "rm" line by find . -name "*.log" -print0 | xargs -0 rm -rf Does work though. This seems more difficult than it should be.
Say I measure a quantum particle at some place, and then I find it at another place. According to my understanding of wavefunctions the particle can get from one place to another without traversing the space in between Is this phenomena a consequence of Quantum Mechanics or have i got it wrong?
My question isn't how they receive the energy to jump, but why. When someone views an element's emission spectrum, we see a line spectrum which proves that they don't exist outside of their orbitals (else we would see a continuous spectrum). Electrons can be released in the form of beta decay, thus proving that they are capable of traveling outside of orbitals contrary to the statement my teacher said that they stay within orbitals. Then, to add to the confusion, the older model of rings floating around a nucleus has, from what I can tell, been outdated, which would support this model. My teacher's explanation was that the electrons made a quantum jump of some kind. How do electrons move between orbitals or do we know how they jump, excluding the reason that energy causes them to jump, and why are positrons formed sometimes instead of electrons in Beta decay? When I'm asking "how do electrons jump" I would like to know how an electron can jump between each orbital such as how it moves and how it knows where to jump since it appears to be a jump where the electron doesn't slow into a orbital position. Specifically how they jump what is this Atomic electron transition, I understand that they jump and that they do this through absorbing and releasing energy but what is this Atomic electron transition other than what is already on the wikipedia article .
Show that the number of partitions of a positive integer n where no summand appears more than twice is equal to the number of partitions of n where no summand is divisible by 3 So I begin by formulating this problem in terms of generating functions. Let $a(n)$ be the number of partitions of $n$ where no summand appears more than twice and let $b(n)$ be the number of partitions of $n$ where no summand is divisible by $3$. If I showed that the $a(n)$ and $b(n)$ have the same generating functions then I am done, right ? Now the generating function for $a(n)$ is $(1+q +q^2)(1 + q^2 + q^4)(1+q^3 + q^6).... = \prod_{i=1}^{\infty} (1 + q^i + q^{2i})$ But now I am stuck here, How can I get the generating function of $b(n)$ ? and how would I show that the generating function of $a(n)$ is the same generating function as $b(n)$ ?
Let $p_\text{odd}(n)$ denote the number of partitions of $n$ into an odd number of parts, and let $p_\text{even}(n)$ denote the number of partitions of $n$ into an even number of parts. How do I prove that $|p_\text{even}(n) - p_\text{odd}(n)|$ is equal to the partitions of $n$ into distinct odd parts. Show that the number of partitions of $n$ for which no part appears exactly once is equal to the number of partitions of n for which every part is divisible by 2 or 3. Show that the number of partitions of $n$ for which no part appears more than twice is equal to the number of partitions of $n$ for which no part is divisible by 3.
I am writing a mod for 2ED and really wanted to include something I found in both the 3.0/3.6 Epic Level Handbook and a Pathfinder Bestiary. I wanted to include a Worm that Walks as the main boss, but am having problems with the conversion to 2ED, as it does not exist in any 2ED books that I am aware of. Can anyone offer any assistance?
I would like to know if I can convert monsters from 3.x editions (I already figured out how to convert monsters from the 1ed) into 2ed monsters.
Sometimes, when reviewing certain threads (for example, 'Suggested edits') I notice that there are series of edits from user (usually, low-rep.) with very minor changes. It's obvious that it is an attempt to increase reputation with such kind of edits - and it's not difficult to reject with too minor reason for me. But I think such edits are not useful for SO (and, as an addition, this causes load to reviewers) - and, therefore, it will be useful to restrict users from suggesting edits for certain period if they have too many rejected edits already (for example, If user has 10 rejected edits today, next edit he would be able to suggest only after 24 hours) Should we have such functionality? Same is to other review threads, I think. Something similar is discussed - but it's different in my opinion. Edit is very similar discussion - my point is still different, may be - because I think automatic restriction (not only mod. involvement) will be quicker. Or may be such functionality already exists?
I was on the Suggested Edit's review tab today, and noticed that this user (take a look at today's ), was putting in hundreds of edits adding the C# tag to questions that didn't really need it. He got over 275 reputation today. To me, this looked like spamming the edit system to get reputation. I started rejecting them as too minor, with also a custom message telling him this. Here's one example: Another: Another: And about 20-30 more. I hit my review cap for the day. Is this valid editing behavior, and, if not, would a mod please get involved? UPDATE: I've seen a couple of other meta questions about this in the last day, but it looks like the spike in gaming the system is passed.
I was learning about the relationship between the prime factors of a number and I came across this way to find the number of factors of a number. It goes like this if the prime factorization of a number $x= P_1^{L_1} P_2^{L_2} P_3^{L_3} \ldots$ then its number of factors is $(L_1 + 1)(L_2 + 1)(L_3 +1) \ldots$. My question is can someone find a proof of this?
I know that one way to find the number of divisors is to find the prime factors of that number and add one to all of the powers and then multiply them together so for example $$555 = 3^1 \cdot 5^1 \cdot 37^1$$ therefore the number of divisors = $(1+1)(1+1)(1+1) = 2 \cdot 2 \cdot 2 = 8$ What I do not know (and can't seem to find when I look) is WHY this relationship exists or a formula which shows its proof. Has anyone seen such a formula?
There came a situation in one game where there was a runner occupying first base (R1) and third base (R3), with one out. The batter then hits a ground ball to the left of the second baseman. He fields the ball and attacks R1, advancing to second base. R1 then stops and back pedals to first base to avoid the tag. The runner the second baseman then throws over to first base to get the battered runner out; with this, R3 advances home, and there is now a hot box between first and second because of R1. After the runner is tagged at second, the umpire had tried to stop play claiming that because R1 did not just stop but back pedaled to avoid the tag, he is automatically out, and no run scores. Was the umpire's decision right?
Here's a situation that came up during a back lot league softball game a few weeks ago. (Note: While our league has some of its own rules we try to defer to MLB rules in all causes that aren't specifically addressed.) There is a runner on second (R2) and a runner on first, with no outs. A ground ball is hit to the third baseman (3B) who cleanly fields the ball away from third base. Seeing that R2 is running toward him, 3B does not go to third and instead waits to tag the incoming R2. R2, in an attempt to buy some time for the other runners, stops advancing to third base. As soon as R2 stops, 3B declares R2 is out (without making a tag) and throws the ball to first to make a play. During the discussion after the play, the 3B claimed that any player advancing on a force cannot stop moving toward their next bag or they are automatically out (the same way a runner leaving the baseline to avoid a tag is considered out). Our rules don't have a specific clause that addresses this situation and I couldn't find anything in official MLB rules (though it's possible I missed something, as 3B claims it is an MLB rule). So, is 3B’s claim correct? That if a runner who is forced to advance to their next base stops (in particular to avoid/delay a tag) they are automatically out?
I have deleted the partitions of ubuntu from windows and also wrote the command: bootrec.exe /fixmbr from the advanced option which appears after holding the shift key while restarting. But, when I restarted the system, it only showed a Grub terminal mentioning: Minimal BASH-like line editing is supported. For the first word TAB lists possible command completions. Anywhere else TAB lists possible device or file completions. Please give some suggestions how can I boot into windows from grub.
I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows. How do I remove Ubuntu and reinstall Windows? Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.
This problem is quite easily solved by using logarithms and derivative and forming the function $f(x,y) = x^y - y^x$, however there are assertions that this problem can be solved without using either of the two. I can not see how one would proceed to solve this problem in the absence of logarithmic manipulation and differentiation. Can anyone shed some light on this?
I've been investigating the Cartesian graph of $x^y=y^x$. Obviously, part of the graph is comprised of the line $y=x$ but there is also a curve that is symmetrical about the line $y=x$. (We can prove this symmetry by noting that the function $x^y=y^x$ is self-inverse; all self-inverse functions are symmetrical about the line $y=x$.) An image of the graph is shown below: I decided to find the intersection point and arrived at an intriguing result: the intersection point between the two curves is at $(e,e)$. The following is my method: If the gradient of the line $y=x$ is $1$, the gradient of the curve at the intersection point must be $-1$ as it's a normal to the line (as it's symmetrical about the line). This means that at that point $\frac{dy}{dx}=-1$. Now to find $\frac{dy}{dx}$. We have $x^y=y^x$. I then used a very powerful tehnique for differentiating these sorts of functions. We know that eg $$x^y=e^{\ln{x^y}}=e^{y\ln{x}}$$ and $$\frac{d}{dx}e^{f(x)}=f'(x)e^{f(x)}$$ Applying it to our function $x^y=y^x$ and using implicit differentiation and the product rule gives us: $$(\frac{dy}{dx}\times \ln x +\frac{y}{x})x^y=(\ln y +\frac{dy}{dx}\times \frac{x}{y})y^x$$ So $$\frac{dy}{dx}x^y\ln x +yx^{y-1}=\frac{dy}{dx}xy^{x-1}+y^x \ln y$$ Extensively rearranging gives: $$\frac{dy}{dx}=\frac{y^x \ln y -yx^{y-1}}{x^y \ln x -xy^{x-1}}$$ Let $\frac{dy}{dx}=-1$: $$y^x \ln y -yx^{y-1}=xy^{x-1}-x^y\ln x$$ But we know $x=y$ since we are at the intersection point with the line $y=x$: $$x^x \ln x -x^x=x^x-x^x\ln x$$ So $2x^x \ln x -2x^x=0$ $$2x^x(\ln x -1)=0$$ This means either $2x^x=0$ or $\ln x -1=0$ but we know $x^x$ is always greater than $0$ so $\ln x =1$, leaving us with: $$x=y=e$$ So I have my answer, but is there any other method of getting it? I have heard there is. Any help will be very welcome. Thanks in advance
On the request of a publisher, I am trying to change from Chicago style bibliography to APA style. I had this working fine: \usepackage[backend=biber,authordate]{biblatex-chicago} I have tried this: \usepackage[backend=biber,authordate,style=apa]{biblatex} It fails with ! Package xkeyval Error: `authordate' undefined in families `blx@opt@pre'. I remove authordate: \usepackage[backend=biber,style=apa]{biblatex} It compiles first, but then after I ran Biber, it fails with ! Undefined control sequence. <argument> \mkbibdateapalongextra {year}{month}{day}\iffieldundef {endyear}{... Example: \documentclass[11pt,a4paper]{article} \usepackage{color} \usepackage{graphicx} \usepackage[hidelinks]{hyperref} \usepackage[UKenglish]{babel} \usepackage[lf]{venturis} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} % \usepackage[backend=biber,authordate]{biblatex-chicago} % works \usepackage[backend=biber,style=apa]{biblatex} % doesn't work \begin{filecontents*}{foo.bib} @article{denning2010computation, AUTHOR = {Denning, Peter J.}, TITLE = {What is Computation?}, JOURNAL = {Ubiquity}, YEAR = {2010}, DOI = {10.1145/1880066.1880067} } \end{filecontents*} \addbibresource{foo.bib} \usepackage{csquotes} \usepackage{tabularx} \usepackage{epigraph} \usepackage[shrink=10, babel=true]{microtype} \begin{document} foo \autocite{denning2010computation} \printbibliography \end{document}
biblatex-apa gives me this: ! Undefined control sequence. <argument> \mkbibdateapalongextra {labelyear}{labelmonth}{labelday}\iffieldu... I'm using the default (english) language, and have done the: \DeclareLanguageMapping{norsk}{norsk-apa} \DeclareLanguageMapping{english}{american-apa} thing. Here's a short example: \documentclass[english]{memoir} \usepackage{babel} \usepackage{roffe} \usepackage[backend=biber,date=short,maxcitenames=2,style=apa]{biblatex} \DeclareLanguageMapping{norsk}{norsk-apa} \DeclareLanguageMapping{english}{american-apa} \addbibresource{Papers2.bib} \addbibresource{R.bib} \begin{document} \cite{R-base} \printbibliography \end{document} This one replicates the problem.
The union of $x $ axis and the $y$ axis it's not manifold . It's a hausdorff second countable, but it's not locally euclidean. I was tryin to prove it by contradiction, but I can't , the issue sopposed to be with the (0,0).
Consider the subset $X = \{(x, 0) \mid -1 \lt x \lt 1\} \cup \{(0, y) \mid -1 \lt y \lt 1\} \subset \Bbb R^2$. It's just two open segments intersecting at $(0, 0)$. How do you show that $X$, equipped with the subspace topology of $(\Bbb R^2, \lvert \lvert \cdot \rvert \rvert_2)$, is not locally homeomorphic to an euclidean space because of the point $(0, 0)$ ?
Can someone please guide me through the solving of $\lim \limits_{x \to 0} {\sqrt{x+2}}=2$ using the Epsilon-Delta definition? I understand how to use $\epsilon-\delta$ in general cases and I know, so far, that: Let $\epsilon > 0,$ $$\left|\sqrt{x+2}-2\right|<\epsilon\ whenever \left|x-0\right|<\delta$$ $$-\epsilon<\sqrt{x+2}-2<\epsilon\ whenever -\delta<x<\delta$$ Let's solve for $-\epsilon<\sqrt{x+2}-2<\epsilon\\2-\epsilon<\sqrt{x+2}<\epsilon+2\\(2-\epsilon)^2<{x+2}<(\epsilon+2)^2\\\epsilon^2-4\epsilon+2<x<\epsilon^2+4\epsilon+2$ And here I'm stuck. Is this even the right way to do it ?
Prove that the function $\sqrt{x}$ is continuous on its domain $[0,\infty)$. Proof. Since $\sqrt{0} = 0, $ we consider the function $\sqrt{x}$ on $[a,\infty)$ where $a$ is real number and $s \neq 0.$ Let $\delta=2\sqrt{a}\epsilon.$ Then, $\forall x \in dom,$ and $\left | x-x_0\right | < \delta \Rightarrow \left| \sqrt{x}-\sqrt{x_0}\right| = \left| \frac{x-x_0}{ \sqrt{x}+\sqrt{x_0}} \right| < \left|\frac{\delta}{2\sqrt{a}}\right|=\epsilon.$ Can I do this?
Why is $\displaystyle\sum\limits_{k=0}^{n}(-1)^k\binom{n}{k}^2=(-1)^{n/2}\binom{n}{n/2}$ if $n$ is even ? The case if $n$ is odd, is clear, since $\displaystyle(-1)^k\binom{n}{k}+(-1)^{n-k}\binom{n}{n-k}=0$ (we have $(n+1)/2$ such pairs.) but if $n$ is even we have no symmetry, I tried to consider the odd and even terms separately but with no success. Do you have an idea ? Thanks in advance.
How can I prove the identity: $$ \sum_{k=0}^n\binom{2n}{2k}^2-\sum_{k=0}^{n-1}\binom{2n}{2k+1}^2=(-1)^n\binom{2n}{n}? $$ Maybe, can we expand $$ f(x)=(1+x)^{2n}? $$ Thank you.
I have used blender before, but h264 is not showing up any way to get it on?
Even when I start a brand new file in Blender, I only get four video output file options: AVI raw, AVI JPEG, Frame Server, FFMpeg Video. I am running version 2.78.5 (I'm using the beta so that I can use denoising. How can I get access to all the other video outputs other people have? Like this:
Are both these sentences correct, do they carry the same meaning? Can I place the adverb now in these positions? If not, why? Tensions submerged earlier have come to the fore, now Tensions submerged earlier have now come to the fore
Here's my problem: I've been confused about the placement of adverbs in present/past perfect phrases. For example, which sentence would sound better: "We had been slowly drifting down the river when a bear attacked." or "We had slowly been drifting down the river when a bear attacked." Personally, I'd go with the former, and this led me to believe that if the sentence contains both "had been" and a verb, the adverb should be placed after "had been"--if the adverb is indeed modifying the verb. This, however, led to me to think of other uses of the present/past perfect, where another verb isn't present. The is the best example I could formulate: "He has always been an academic and a charitable person." See, right there, always--an adverb of frequency--was placed in between has and been. Does this mean only adverbs of frequency (e.g., always, usually, etc.) should be placed in between such constructs? A final example to put this topic over the edge is "He had been either sick or exhausted." Now, if you were to move "either" in between "had been," would the sentence be grammatically incorrect? I've noticed that the former is used more frequently, but the sandwiched version doesn't sound wrong either. Thanks!
I want to verify an element present in screen or not and store result in variable if it is present I want an output like true or false in a variable and return this variable to flow (Power automate) Please suggest ideas how to do this ?
I have a scenario, in case of the user registration successful, it will display a success message on the next page otherwise an error message shows on the same page. How to automate the test case to return as passed if it is success and failure in case of error message comes up. Please help me out here.
Can't seem to find clarification on this, it always just directs me to the Mounted Combat rule. Mounted Combat [...] The initiative of a controlled mount changes to match yours when you mount it. It moves as you direct it, and it has only three action options: Dash, Disengage, and Dodge. A controlled mount can move and act even on the turn that you mount it. [...] Rules as written, can a rider attack, have the mount take the Disengage action and move, and make another attack on the same turn?
From "Controlling a Mount" on p.198 of the Player's Handbook: The initiative of a controlled mount changes to match yours when you mount it. It moves as you direct it, and it has only three action options; Dash, Disengage, and Dodge. A controlled mount can move and act even on the turn that you mount it. Does this mean that the rider and mount share a single turn?
Sometimes when I'm new to a SE site I end up having to come up with some tags for my question that don't really fit into what people normally use on the site. Is there any way we could have the "ask question" page make some suggestions for what tags you might want to use for a particular question based on the question text?
Can we modify "Ask question" to automatically suggests tags based on your question content. So instead that user needs to type "team-foundation-server" or "TFS" or "TeamFoundationServer" he will see list of tags auto-populated with ajax which he (or she) can then select and it will be associated with the question. So basically only thing we need is code which will cross-match question content with list of known tags while user is typing and display results in some nice ajax-enabled list/cloud/whatever UI control. This should be separate control for tags suggestions so user still has option to use standard tag list input to type-in tags. In this case, instead of three (or more) tag variations we would have only one tag for Team-Foundation-Server.
I added some paths to Windows environment variables in PATH, but everytime I restart/shutdown my PC it deletes these variables from Windows (My custom paths). I have to add them again. Why is this happening? For David, I saw the "duplicate" answer but I think he didn't read title. It is still ignoring my path variables even after restart or shutdown. If I apply any of noth, it deletes it. The question it's different because in my case, it's for restart/shutdown. Duplicate answer is not valid in my question.
I use a command line tools under windows 10. The path to the tool is set in the system PATH variable so that it can be started from the command line. Whenever a new version of the tool comes out, I store it to a new directory and update the system PATH to point to the new location. Restart the command window and everything is fine, the new version of the tool is used. After a ahutdown and start however, the PATH reverts back to the old value and the old version of the tool gets used. Opening the envoronment variable editor and clicking OK, without making any changes, solves the problem ... until the next shutdown. I have searched the whole registry, the old PATH value is nowhere found. It must be stored somewhere else. After some time, (I guess after a windows update gets installed, but I am not sure about this) the problem goes away and the new PATH value is remembered. In previous windows versions this worked without problems, I see this behaviour only after upgrade to Windows 10. How can this be fixed? Is there some way to make the effective PATH permanent?
I have read that most research Tokamaks fuse deuterium with tritium to form helium. I had a few questions if someone could kindly answer: 1) I have read that scientists want to harvest helium-3 from the moon for fusion on Earth. Since this will be an expensive endeavour I assume it is a better reaction than deuterium and tritium. Why? 2) More of an opinion from you guys but which method do you think will end up being used in nuclear fusion reactors once we crack the process of fusion - Tokamaks, laser initiated fusion?
I see that many websites and magazines with physics thematic are pretty excited about mining Helium 3 isotope on the Moon. But this seems to be a very hard-to-get resource. For more than one reason: There is not too much of it on the moon. 0.007% of the moon soil. Transport to earth would be also very VERY complicated in my opinion. to take care of the harvesters. Deuterium can be found in the seas as "heavy water". No spaceships needed. Now even when we get the Helium-3, I have a strong suspicion that it contains less energy than Deuterium but it will require more energy to start the fusion. Why I think it needs more initial energy to start the fusion? Deuterium contains one proton and one neutron. That makes a +1e core. Helium 3 has 2 protons and one neutron - That's +2 core. Now the worst problem with fusion reaction is, that once you pull the atoms so close, that the no longer shield the polarity of the protons they start repelling with electric force. Now if you're trying to pull +1 and +1 together it seems much easier than pulling +2 and +2 together. Just think about the standard equation: $F_e = k*\frac{|Q_1*Q_2|}{r^2}$ where $k$ is the permittivity constant and $Q_{1,2}$ are the proton charges. Repelling force must be 4 times as large. Why I think it contains less energy? This is even simpler to explain. In the fusion process we merge smaller cores to create larger. We normally start with hydrogen and create helium. Now when we already have Helium fused, it means that we missed one step in the fusion. Why would we do that? Can't actually Helium 3 core be one of cores that are created in Hydrogen fusion?
I am working on a simple example of how to numerically solve the time-independent Schrodinger Equation for the infinite square well. I've used the Euler Method to find values of the wave function, $\psi (x)$, but now I've just realized something - I have no clue how to determine the energies from this! I know that analytically this comes down to applying the Hamiltonian to the wavefunction, but how do I find the energies numerically?? I can provide more info if needed.
This is my first question on here. I'm trying to numerically solve the Schrödinger equation for the and find the energy eigenvalues and eigenfunctions but I am confused about how exactly this should be done. I've solved some initial value problems in the past using iterative methods such as Runge–Kutta. I've read that is the way to solve Schrödinger's equation but Wikipedia also describes it as an iterative method for initial value problems. How do I use it to solve an eigenvalue problem? This confuses me for the following reasons: Wouldn't iteratively solving the DE require knowledge of the energy eigenvalues to use as input to the calculation? I don't know the eigenvalues yet; they're precisely what I'm trying to calculate. If I did that, wouldn't I simply get a unique solution, instead of a family of eigenfunctions and eigenvalues? I've seen some mention of "tridiagonal matrices" being generated somehow, but am not sure what the elements of that matrix would be or how that applies to the problem. Leandro M. mentioned that "the discretization defines a finite dimensional (matrix) eigenvalue problem". This seems like the correct road I should be going down, but I haven't been able to find anything that explicitly explains this process or how the matrix is constructed. If this is the correct procedure, how is such a matrix constructed?
I am currently running 12.04 and I can't get Jupiter to install on my computer. These are the commands I am running to install it: sudo add-apt-repository ppa:webupd8team/jupiter sudo apt-get update sudo apt-get install jupiter This is the error I get after updating: W: Failed to fetch http://ppa.launchpad.net/webupd8team/jupiter/ubuntu/dists/saucy/main/binary-amd64/Packages 404 Not Found and finally after install jupiter, I get this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package jupiter Any ideas on how I can fix this issue? Or can anyone point me in the right direction?
I'm trying to install the Jupiter power settings app but, I read it is no longer compatible with the new kernel. Is there a similar program or a way to manage the power settings on 13.04?
I've just finished installing Ubuntu, and now have Ubuntu in one partition and Windows 8 in another. I was under the impression that when my computer starts, I would be able to choose from a menu which one to run. However, what happens instead is that Ubuntu runs automatically if I don't press anything, or if I press escape I get a menu which includes only ubuntu and something called memtest - no Windows. How am I supposed to run Windows? Please avoid too much technical language and give me step by step instructions wherever possible.
I've bought a Dell laptop with W8 pre-installed. I didn't like W8 much, so I wanted to try Ubuntu, but without uninstalling W8. So yesterday I installed Ubuntu, and it was extremely convoluted thanks to the gorgeous W8 UEFI boot mode. Anyway Ubuntu is now installed and working with no problem. However I cannot boot on W8 anymore, which is a serious issue. I tried Boot repair, first with the boot option in Legacy mode, then in UEFI. Boot repair tells me it got it fixed, but I still can't boot on W8. When I boot, I have two options to boot on Windows: Windows UEFI bkpbootmgfw.efi and Windows Boot UEFI loader. When I select any of them, I got the following error: No such device BCE6-E3C4 /EFI/Microsoft/Boot/bkpbootmgfw.efi not found. OR No such device BCE6-E3C4 /EFI/Boot/bkpbootx64.efi not found. I checked on my computer, and unexpectedly, I did find the two files, located at /boot/efi/EFI/Microsoft/Boot/bkpbootmgfw.efi or /boot/efi/EFI/Boot/bkpbootx64.efi. My computer has 2 hard drives. When I got the computer, the second one was empty, so I decided I'd install Ubuntu on my second hard drive, and keep W8 on my first one. Maybe that's the problem, maybe the bios or whatever it is is looking in the first hard drive for the efi files, while they are supposedly in the second one. I've tried lots of stuff on the Internet (like updating grub's config) but nothing's worked so far. Boot repair told me to paste this link if I need help, so here we go: I read but that didn't help me much. Does anyone know how to fix this? I can still access to my data on my first hard drive, but I still have many useful programs on Windows. I notably program in C++ for Windows, so I must, in order to compile for the OS, boot on Windows.
String s1 = "abcdef"; String s3 = new String(s1); if(s3 == s1){ System.out.printf("yes"); }else{ System.out.printf("no"); } Why is not print yes? Who can explain to me?
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference?
I know this is asked a lot, but right now (April 2016), what is the preferred method of storing passwords securely for my users? My data is not super-sensitive (it's just a game with no personal or financial details, but it would still be nice to have secure passwords). I've read a large amount of tutorials and questions tonight, but it's still unclear. I just want a fairly simple to understand but fairly safe way to take a created password, store it in my database and then retrieve it. I've tried several methods, they all work fine but then later somebody says it's not safe or things have moved on since then. It would be nice to see a couple of clear functions to just encrypt and decrypt the passwords. Edit - To clarify why the new answers are better than previous answers on stackoverflow. The language has been updated with password_hash() and password_verify() which hugely simplify and improve the situation. Previous answers gave manual solutions, saving salts, using different algorithms etc. None of that is needed now.
It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection. This question, suggests that hashing multiple times may be a good idea, whereas suggests using salt. I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters. The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?) Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer? In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism. Related questions that don't quite cover my question:
I came around this question: Show that if $a$, $b$, and $c$ are integers such that $(a, b) = 1$, then there is an integer $n$ such that $(an + b, c) = 1$, in the Chinese Remainder Theorem section of my textbook and wasn't too sure how I could break that up so I could use the CRT to solve it. Any hints would be greatly appreciated thanks!
I can't crack this one. Prove: If $\gcd(a,b,c)=1$ then there exists $z$ such that $\gcd(az+b,c) = 1$ (the only constraint is that $a,b,c,z \in \mathbb{Z}$ and $c\neq 0)$
vector<int> myVector; and lets say the values in the vector are this (in this order): 5 9 2 8 0 7 If I wanted to erase the element that contains the value of "8", I think I would do this: myVector.erase(myVector.begin()+4); Because that would erase the 4th element. But is there any way to erase an element based off of the value "8"? Like: myVector.eraseElementWhoseValueIs(8); Or do I simply just need to iterate through all the vector elements and test their values?
I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.
Is there a way to make the print_str function be more concise and becomes one line? def print_str(str): if len(str)>0: print(str + ", "+ "hi") else: print("hi") if __name__ == '__main__': print_str(("John")) print_str(("")) In java we can do something like print(str + (str.equals("") ? "" : ", ") + "hi");
If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?
I am looking for an adjective, a compound adjective or adjective phrase that would fill in the blanks below He is a [...] stamp collector. = He recently became a stamp collector. She is a [...] mailwoman. = She recently became a mailwoman. The meaning I am looking for is that of a person being new to an activity, which is now performed by them regularly, in a positive sense.
What is a word for someone who is totally new in something or participates in something for the first time?
I have a scene with a rocket launching, so obviously fire is pretty important. However, after setting up the shaders and simulation, I can't get the fire to render. Strangely, the smoke is still rendered and the fire still emits light on the rocket, but doesn't appear below the rocket or shade the resulting smoke. Even stranger, the rendered viewport (ie 3D View set to Rendered) renders the scene perfectly. I'm at a complete loss. Here's a photo of the two views and my domain material: And a closer image of the domain material after I redid it (still didn't work): How can I get the fire to render? Thanks!
When rendering volumes with Film > Transparent enabled, the alpha appears to be the wrong type (premultiplied/straight). In the 3D view it works as expected: This is a known . Is there any way to work around this?
I am working on a project in which i send a base64 encoded image from my app to a server where the processing happens. The image received on the server is like this: (this data is huge) b'\xff\xd8\xff\xe1\x02;Exif\x00\x00MM\x00*\x00\.....' So, now i want to convert it in this format: [255, 234, 70, 115, ....].
How can I convert a string of bytes into an int in python? Say like this: 'y\xcc\xa6\xbb' I came up with a clever/stupid way of doing it: sum(ord(c) << (i * 8) for i, c in enumerate('y\xcc\xa6\xbb'[::-1])) I know there has to be something builtin or in the standard library that does this more simply... This is different from for which you can use int(xxx, 16), but instead I want to convert a string of actual byte values. UPDATE: I kind of like James' answer a little better because it doesn't require importing another module, but Greg's method is faster: >>> from timeit import Timer >>> Timer('struct.unpack("<L", "y\xcc\xa6\xbb")[0]', 'import struct').timeit() 0.36242198944091797 >>> Timer("int('y\xcc\xa6\xbb'.encode('hex'), 16)").timeit() 1.1432669162750244 My hacky method: >>> Timer("sum(ord(c) << (i * 8) for i, c in enumerate('y\xcc\xa6\xbb'[::-1]))").timeit() 2.8819329738616943 FURTHER UPDATE: Someone asked in comments what's the problem with importing another module. Well, importing a module isn't necessarily cheap, take a look: >>> Timer("""import struct\nstruct.unpack(">L", "y\xcc\xa6\xbb")[0]""").timeit() 0.98822188377380371 Including the cost of importing the module negates almost all of the advantage that this method has. I believe that this will only include the expense of importing it once for the entire benchmark run; look what happens when I force it to reload every time: >>> Timer("""reload(struct)\nstruct.unpack(">L", "y\xcc\xa6\xbb")[0]""", 'import struct').timeit() 68.474128007888794 Needless to say, if you're doing a lot of executions of this method per one import than this becomes proportionally less of an issue. It's also probably i/o cost rather than cpu so it may depend on the capacity and load characteristics of the particular machine.
I've seen a lot of similar issues, but none have quite answered my question. To elaborate, I am trying to dual boot Ubuntu 12.04 alongside Windows 8. I am using a linux usb creator to boot linux. I have tried LiliUSB creator, pendrive linux usb creator, and unetbootin. All three have given me the same result. When I select my flash drive from the BIOS to boot into, it successfully shows the GRUB menu. The GRUB menu however, is black instead of purple that I've seen when normally booting Ubuntu. It displays the normal options to, try linux, intall linux, and boot repair. However, if i select any of these options they all result in a black screen and nothing happening. I am trying a new flash drive in a moment to see if this fixes it. If it doesn't though I would still appreciate any advice or answers I can get. If this is a solved issue please redirect me! Thank you! Also this is marked as a repeat question, but the question it was marked the same as was unresolved and all answers that were relevant were graphics driver solutions. Mine was a boot error and was resolved from me digging elsewhere in the askubuntu forum, so technically yes it's repeat, but not to that question, so I hope it gets remarked as a solved answer or re-linked to the appropriate question so others who encounter the same issue which isn't graphics related, might find help in this question. Extra info on my computer if it helps: ASUS x55c model intel hd 3000 graphics i3 duo core processor 4gb ddr3 Linux is not installed currently (hence my problem) Currently running: Windows 8
I am trying to boot Ubuntu on my computer. When I boot Ubuntu, it boots to a black screen. How can I fix this? Table of Contents:
There are three files in the directory and I need to verify if there all from the same set. This is based on the 3 files using the same naming structure. One file is slightly different. Here is an example: 2014_UMW.xxx 2014_UMW.yyy 2014_UMW_web.zzz 2014_UMW is just one example. It has to work with all data sets. I need to check that the three files match and have the same data set. I have written code to get the file names from the directory, drop the file extension and store the file name as a string. Now i need to compare the file names to see if they are equal. If they are equal the method should return true. I am having trouble figuring out how to deal with the file name that contains the _web. What is the best way to handle this issue. import java.io.File; import java.io.IOException; import org.apache.commons.io.*; public class Verify_FileName { private static void getAllFiles(File curDir) throws IOException{ File[] filesList = curDir.listFiles(); for(File f: filesList){ if(f.isFile()){ String File = FileUtils.readFileToString(f); FilenameUtils.removeExtension(File); String [] FileWithoutExtension = new String [filesList.length]; for(int i = 0; i < filesList.length; i++){ FileWithoutExtension[i] = File; } } } } public static boolean compareFileNames(String [] f){ } }
I would like to build a regexp in Java that would be passed in a FilenameFilter to filter the files in a dir. The problem is that I can't get the hang of the regexp "mind model" :) This is the regexp that I came up with to select the files that I would like to exclude ((ABC|XYZ))+\w*Test.xml What I would like to do is to select all the files that end with Test.xml but do not start with ABC or XYZ. Could you please add any resources that could help me in my battle with regexps. Thanks The following resource explains a lot of things about regexp
Suppose that $A$ is a commutative ring with $1$ and suppose that $\forall x \in A \exists n >1 \in \mathbb{N}$ dependent from x such that $x^n=x$. Prove that if $I$ is a prime ideal then $I$ is maximal. Proof: Suppose that $I$ is prime. Then $A/I$ is an integral domain. Let $a \in A/I$. Then we have that exists $n$ such that $a^n=a \implies a(a^{n-1}-1)=0 \implies a=0 \vee a^{n-1}=1$ because $A/I$ is a domain. Now, if $a \neq 0$ then $a \times a^{n-2}=a^{n-1}=1$ so each $a \in A \setminus \{0\}$ is invertible and then $A/I$ is a field, so $I$ is maximal. Does this proof seem legit? Thanks in advance. Can you suggest other ways to solve this?
Let R be a commutative ring with an identity such that for all $r\in$ R, there exists some $n>1$ such that $r^n = r$. Show that any prime ideal is maximal. (Atiyah and MacDonald, Introduction to Commutative Algebra, Chapter 1, Exercise 7.) Any hints?
I'm trying to unit test following piece of code using pytest: import json from typing import Any, Dict from confluent_kafka import Consumer def get_message(config: Dict[str, Any]): consumer = Consumer( { "group.id": config["KAFKA_GROUP_ID"], "bootstrap.servers": config["KAFKA_BROKERS"], "default.topic.config": {"auto.offset.reset": "smallest"}, } ) consumer.subscribe([config["KAFKA_TOPIC"]]) while True: collect = consumer.poll() if collect is None: continue try: message = json.loads(collect.value().decode("utf-8")) except json.JSONDecodeError: continue return message But I can't mock subscribe function. I tried: mock_subscribe = MagicMock(return_value='test') monkeypatch.setattr('confluent_kafka.cimpl.Consumer.subscribe', mock_subscribe) In result I got following error: TypeError: can't set attributes of built-in/extension type How to mock this function properly?
Ruby can add methods to the Number class and other core types to get effects like this: 1.should_equal(1) But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified? Update: Rather than talking about different definitions of monkey patching, I would like to just focus on the example above. I have already concluded that it cannot be done as a few of you have answered. But I would like a more detailed explanation of why it cannot be done, and maybe what feature, if available in Python, would allow this. To answer some of you: The reason I might want to do this is simply aesthetics/readability. item.price.should_equal(19.99) This reads more like English and clearly indicates which is the tested value and which is the expected value, as supposed to: should_equal(item.price, 19.99) This concept is what and some other Ruby frameworks are based on.
My teacher lists the following chaining operators: & && ( ) ; ;; | || new line How is ;; a chaining operator and what does it do?
If I try to run a;;b in sh, I get this error: sh: <number>: Syntax error: ";;" unexpected If I try a;;;b I get the same error, not ;;; instead of ;;, so I think that ;; means something, although I don't know what does it mean. Here is an example: $ echo A;;echo B sh: 1: Syntax error: ";;" unexpected $ echo A;;;echo B sh: 1: Syntax error: ";;" unexpected $ echo A; ;echo B sh: 1: Syntax error: ";" unexpected Here you can see that when I use ; ; instead of ;; the error is different, pertaining to the fact that I used ; without a command before. ;; seems to be a different operator, although I don't know what it applies to.
Supposedly Braid has support for the Xbox 360 controller (as it's an XBLA port), but it refuses to recognize mine. The controller shows up among my Devices & Printers, and works perfectly in Super Meat Boy, but Braid is totally oblivious. Edit: It somehow fixed itself after I played SMB, but I have no idea how. I didn't unplug/replug it between Braid, SMB and back again (though I had much earlier), or really do anything else at all.
So I asked about Braid on PC/PS3 a while back, and one of the answers pointed me to the MotionInJoy drivers that allows PS3 controllers to be used on a PC. I've installed them properly and have used my DualShock 3 in a few games, but I can't figure out how to enable it when I'm playing Braid! There doesn't seem to be any menu item to select an input type, which begs the question - is Braid not detecting my controller for some reason, or does Braid simply not allow you to use anything but the keyboard for input?
I am using Google Analytics to track the number of visitors coming on my page everyday. Yesterday, I happen to see the referrals and I saw This is a public website and when I visited it, I saw it has exact contents which I put on I thought this is not legal but how is it possible that people are copying the content without any kind of attribution. Is this right ? How can we prevent people from copying the content on their own website ?
of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under . For my fellow non-lawyers, that license basically means: Anyone can use any Stack Exchange posts at any time without having to ask for permission Making money off of the copied content is permitted You don't even have to copy stuff from here verbatim; you can just use it as a starting point and make whatever edits you want There are just two rules you have to follow: You have to provide . Simple links to the original post and author info are just fine. You have to and allow other people to use your content, as long as they follow these very same rules. How meta! (If you ever forget any of that, and want to refresh your memory, the license info is linked to in the footer of every page.) There are, in fact, a lot of people who republish varying amounts of our content for assorted reasons. Unfortunately, there are some Stack Content Republishers Attributing Poorly and/or Excelling at Ranking (SCRAPERs, for short). In this context, "attributing poorly" means any use that doesn't follow our attribution rules or make any other reasonable attempt at give credit. This can get pretty egregious; I've seen SCRAPERs that not only don't link back to SE originals, but also use fake author info and post dates to make it harder to find originals. By "excelling at ranking," I'm referring to copycat sites that end up higher in Google results than the original SE sites do for the same content. That's not necessarily wrong, but in some cases, it indicates inappropriate SEO hackery. So, the question is: what can you do if you spot a SCRAPER?
I'm running Kubuntu 17.10, upgraded from 17.04 in-place. I have a 2GB swap file on my SSD that was created by the installer when I first installed 17.04. Here's the contents of /proc/swaps (fresh after a reboot from running out of memory): Filename Type Size Used Priority /swapfile file 2097148 0 -1 How can I expand this swapfile to 4GB? I've found plenty of answers about resizing swap partitions and adding new swap files, but nothing about resizing existing ones.
Is there a way to increase my existing "swapfile" without having to destroy and re-create it? I would like to up my swap space from 1GB to 2GB. Currently it is set up as such: $ sudo swapon -s Filename Type Size Used Priority /swapfile file 1048572 736640 -1 $ ls -lh /swapfile -rw------- 1 root root 1.0G Nov 9 2016 /swapfile I'm using Ubuntu 14.04.
We can easily find commutative binary operations on a 2 element set from the truth table (if ab=ba then the operation is commutative, thus there are 8 commutative binary operations in a 2 element set). Is there a similar method or algorithm to find how many and what are the associative binary operations in a 2 element set? If there isn't a way to quickly check, we would need to test all 8 possible inputs independently (if not commutative) and only 4 (if commutative) - which is still a lot for a 2 element set - 96 total (16 operations, 8 are commutative, so 8*4+8*8=96). A generalization to an n-element set be very helpful.
Suppose we have a set $S=\{a,b\}.$ Obviously, the total number of binary operations on $S$ is the number of all the pairs such that $$*(a,b)=a \, \text{or} \, b,$$ which gives $ 2 \cdot 2 \cdot 2 \cdot 2=2^4$ possible ones. Is there a way to find which of these $16$ binary operations are associative without writing all the operation matrices and checking it by hand?
To score a RandomForestClassifier using GridSearchCV for multiclass classification, I decided to use Brier score. However, I could only manage to get the Brier score for each class. Is it reasonable to get the average of that as an overall performance measure? Or can you think of a better way instead? Edit: I am aware question is similar, so I'll explain why I think it's a different problem: When I run my model with brier_score as defined by that question's author (brier_multi), the score obtained for the best model is 202.3 However, when I apply the following code (made by me) def brier_score_multi(y_true, y_pred): y_true_bin = label_binarize(y_true, classes=[0,1,2]) y_pred_bin = label_binarize(y_pred, classes=[0,1,2]) score = mean([brier_score_loss(y_true_bin[:,0], y_pred_bin[:,0]),brier_score_loss(y_true_bin[:,1], y_pred_bin[:,1]),brier_score_loss(y_true_bin[:,2], y_pred_bin[:,2])]) return score The best score is 0.0432. As you can see, this is a big difference, and given the definition of a the brier score, I'm biased towards the second result. EDIT 2: Seeing as the first result is incorrect, I started thinking... maybe instead of the average between classes, the sum of the brier score between classes makes more sense?
tl;dr How do I correctly compute the Brier score for more than two classes? I got confusing results with different approaches. Details below. As suggested to me in a comment to , I would like to evaluate the quality of a set of classifiers I trained with the Brier score. These classifiers are multiclass classifiers and the classes are imbalanced. The Brier score should be able to handle these conditions. However, I am not quite confident about how to apply the Brier score test. Say I have 10 data points and 5 classes: One hot vectors represent which class is present in a given item of data: targets = array([[0, 0, 0, 0, 1], [0, 0, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 0], [0, 0, 0, 0, 1], [0, 0, 1, 0, 0], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0]]) Vectors of probabilities represent the outputs of my classifiers, assigning a probability to each class probs = array([[0.14, 0.38, 0.4 , 0.04, 0.05], [0.55, 0.05, 0.34, 0.04, 0.01], [0.3 , 0.35, 0.18, 0.09, 0.08], [0.23, 0.22, 0.04, 0.05, 0.46], [0. , 0.15, 0.47, 0.28, 0.09], [0.23, 0.13, 0.34, 0.27, 0.03], [0.32, 0.06, 0.59, 0.02, 0.01], [0.01, 0.19, 0.01, 0.03, 0.75], [0.27, 0.38, 0.03, 0.12, 0.2 ], [0.17, 0.45, 0.11, 0.25, 0.01]]) These matrices are coindexed, so probs[i, j] is the probability of class targets[i, j]. Now, the definition of the Brier Score for multiple classes is $$\frac{1}{N} \sum_{t=1}^{N} \sum_{i=1}^{R} (f_{ti} - o_{ti})^2$$ When I program this in Python and run it on the above targets and probs matrices, I get a result of $1.0069$ >>> def brier_multi(targets, probs): ... return np.mean(np.sum((probs - targets)**2, axis=1)) ... >>> brier_multi(targets, probs) 1.0068899999999998 But I am not sure if I interpreted the definition correctly. For Python the sklearn library provides . While the documentation states The Brier score is appropriate for binary and categorical outcomes that can be structured as true or false What the function actually does is pick one (or get one passed as an argument) of $n > 2$ classes and treat that class as class $1$ and all other classes as class $0$. For example, if we choose class 3 (index 2) as the $1$ class and thus all other classes as class $0$, we get: >>> # get true classes by argmax over binary arrays ... true_classes = np.argmax(targets, axis=1) >>> >>> brier_score_loss(true_classes, probs[:,2], pos_label=2) 0.13272999999999996 alternatively: >>> brier_score_loss(targets[:,2], probs[:,2]) 0.13272999999999996 This is indeed the , as can be shown by manually defining and running it: >>> def brier_bin_(targets, probs): ... return np.mean((targets - probs) ** 2) >>> brier_bin(targets[:,2], probs[:,2]) 0.13272999999999996 As you can see, this is the same result as with sklearn's brier_score_loss. Wikipedia states about the binary version: This formulation is mostly used for binary events (for example "rain" or "no rain"). The above equation is a proper scoring rule only for binary events; So... Now I am confused and have the following questions: 1) If sklearn computes the multi class Brier score as a One vs. All binary score, is that the only and correct way to compute the multi class Brier score? Which leads me to 2) If that is so, my brier_multi code must be based on a misconception. What is my misconception about the definition of the multiclass Brier score? 3) Maybe I am on the wrong track altogether. In which case, please explain to me, how I compute the Brier score correctly?
why does the speed of light in vacuum never change? Under any circumstances, The speed of light in vacuum never change, why?
This question is about why we have a universal speed limit (the speed of light in vacuum). Is there a more fundamental law that tells us why this is? I'm not asking why the speed limit is equal to $c$ and not something else, but why there is a limit at all. EDIT: Answers like "if it was not.." and answers explaining the consequences of having or not having a speed limit are not--in my opinion-- giving an answer to whether there is a more fundamental way to derive it from a law to explain this limit.
root@root:~# airmon-ng PHY Interface Driver Chipset phy0 wlan0 ath9k Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01) phy1 wlan1 ?????? root@root:~# root@root:~# lsusb Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 002: ID 0b05:1788 ASUSTek Computer, Inc. BT-270 Bluetooth Adapter Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 005: ID 04f2:b071 Chicony Electronics Co., Ltd 2.0M UVC Webcam / CNF7129 Bus 001 Device 004: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader Bus 001 Device 003: ID 2357:010c Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 002: ID 046d:c077 Logitech, Inc. M105 Optical Mouse Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub root@root:~#
I can not install the TP-LINK WN722N V2, which includes a 8188 EUS chip. Then I tried to install the backports v4.4.2,but do not want to recognize either. The TP-Link driver installation errors thrown out: man@kman-livve:~$ cd '/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417' kman@kman-livve:~/Documents/Tplink ...$ sudo make "******************************************" "NO SKRC,we will use default KSRC" "******************************************" make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.10.0-15-generic/build M=/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417 modules make[1]: Entering directory '/usr/src/linux-headers-4.10.0-15-generic' arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support make[1]: *** No rule to make target '722'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-15-generic' Makefile:1367: recipe for target 'modules' failed A method to know him, I do not know about. Thanks Model:TL-WN722N(EU)_V2_161112_Linux.zip Chipset:rtl8188EUS_linux_v4.3.0.8_13
I have an ArrayList of Question Class objects and I need to output the random selected question. everithing seems OK but when I run it, gives me a java lang nullpointerException public class GameBean implements Serializable { private Random random; private String question; private String answer; //above are the attributes METHOD public Question getQuestion() { int index = random.nextInt(questionList.size()); Question q = questionList.get(index); return q;}
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I have Ubuntu 14.04 Server with Apache. All I want if people enter to server IP like x.x.x.x forward to DocumentRoot /var/www/site1/html And if enter to my domain address like site.com forward to DocumentRoot /var/www/site2/html How could it possible?
I currently have all my websites as directories under /var/www. I would like to set up a virtual host http://foo/ that points to the /var/www/foo/foo directory (and still keep the default localhost behavior). I added the following file, foo, to /etc/apache2/sites-available/: <VirtualHost *:80> ServerName foo DocumentRoot /var/www/foo/foo # Other directives here <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/foo/foo> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> I then ran the following commands: sudo a2ensite foo sudo /etc/init.d/apache2 reload But when I go to http://foo/ it still returns an ISP search page.
So i want when i paste some text (Command + V), it always paste as plain text, without any formatting that could exist in the source. Currently if i copy a text in Word that has bold and italic, when i paste it on another app it will paste with bold and italic. What i want is to paste only the text, without any formatting. I know i could use another more complicated shortcut to do this, but i want to remap Cmd+V to do this by default. Is this possible ?
When pasting text, some applications (Chrome, Microsoft Office, etc.) will do what they can to re-render copied text with style, and some of those applications do not appear to offer an option to paste without style. This results in spending lots of time removing formatting (where it is even possible) and then cleaning up the mess left behind, just to get clean text. I want to prevent text styling from attaching itself to text that I copy and paste between applications. Is there an OS-level way to do this, i.e. one that can apply to all applications? Failing that, is there a per-application way to tell Chrome, Safari, Word etc. not to copy and/or paste with style?
I use iTunes on Windows and recently installed Ubuntu 16.04.1. How can I install the same iTunes version in Ubuntu? Thanks
I've tried different ways to install iTunes, but to no avail. I tried with Wine, but it didn't work. Is it possible to have iTunes on Ubuntu?
I'm Wondering how about do you solve this question. I'm using a software Called TValue 5 to double check my work. Principal = $100,000.00 Interest = 3% annual, Compounded Monthly Payment Frequency is Monthly And the Duration is 36 Months Months that will be skipped are September, October, November and Decemer The Loan Starts in February, But that doesn't Information isn't necessary. Calculate Monthly Payment Amount When I hit the Calculate Button, The Monthly Payment Amount is 4351.27 If anyone would Like to Double Check. I've tried a previous Method suggested to me but it was off by $200. If Someone could help to get closer that would be great
Hi I can compute a Basic Loan Amortization Schedule, But now I'm trying to Calculate a Seasonal Loan Amortization Schedule . So for example A loan starts at January And Will go on for 3 years, with Monthly Payments. Interest is at 3% Annually and is compounded Annually. During the months of September, October, November, December It'll only accumulate Interest But no payments and principal. Principal is 100000. How Do I calculate Payments and interest.
I retrieved the date from firestore saved in the timestamp format like this: Date retrievedDate = class.getDate(); the date saved in firestore format: //it is in timestamp format How to convert this date to a normal presentable format like : 7 June 2020, Sunday, 15:09 PM? Thank you in advance.
How to format correctly according to the device configuration date and time when having a year, month, day, hour and minute?
I'm planning to travel to Vietnam (Hanoi). I would like to make a local friend or travel companion there and vice versa.I'm willing to be a true travel accompany back in our country. Is there any website for this?
Is there an online community to find travel partners for mountain trekking or sightseeing, or anything else? I don't want to travel to foreign mountains alone, but I don't know where to search for company. There's a great community for accommodation (I mean CouchSurfing) so I think there should be something in "reverse" direction (searching not the place to stay but the people to go with).
Very new to programming and trying to understand why I'm getting a null pointer exception to my files in the R.raw folder. Android studio recognizes the files and I'm not getting any errors in the compiler. Thanks! public class MainActivity extends AppCompatActivity { private SoundPool mSoundPool; private int cID; private int dID; private int eID; private int fID; private int gID; private int aID; private int bID; i just tried redoing the programming in a new project because I'm not sure what I'm doing wrong. public void playC(View view) { mSoundPool.play(cID, 1.0f, 1.0f, 0, 0, 1 ); } public void playD(View view) { mSoundPool.play(dID, 1.0f, 1.0f, 0, 0, 1 ); } public void playE(View view) { mSoundPool.play(eID, 1.0f, 1.0f, 0, 0, 1 ); } public void playF(View view) { mSoundPool.play(fID, 1.0f, 1.0f, 0, 0, 1 ); } public void playG(View view) { mSoundPool.play(gID, 1.0f, 1.0f, 0, 0, 1 ); } public void playA(View view) { mSoundPool.play(aID, 1.0f, 1.0f, 0, 0, 1 ); } public void playB(View view) { mSoundPool.play(bID, 1.0f, 1.0f, 0, 0, 1 ); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); cID = mSoundPool.load(getApplicationContext(), R.raw.note1_c, 1); dID = mSoundPool.load(getApplicationContext(), R.raw.note2_d, 1); eID = mSoundPool.load(getApplicationContext(), R.raw.note3_e, 1); fID = mSoundPool.load(getApplicationContext(), R.raw.note4_f, 1); gID = mSoundPool.load(getApplicationContext(), R.raw.note5_g, 1); aID = mSoundPool.load(getApplicationContext(), R.raw.note6_a, 1); bID = mSoundPool.load(getApplicationContext(), R.raw.note7_b, 1); } }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
My FilePath.property file is as below. filepath1 = /var/log/Test filepath2 = /home/Backups I want to read this FilePath.property file inside my shell script and use filepath1 and filepath2 in my script for deleting old logs inside the Test and Backups folders.
What is the best way to read a config file in bash? For example, you have a script and aren't willing to fill in all the config manually each time you call the script. Edit 1: I think I didn't make it clear, so: what I want is... I have a configfile which is like variable_name value variable_name value ... and I want to read that. I know I could just grep it for the arguments I'm looking for or so... but maybe there's a more intelligent way :)
By letting $$ \theta = a \arcsin(x) \, , $$ $$ x = \sin\left(\frac{\theta}{a}\right)$$ If $\theta / a$ is the angle in a right triangle then the hypotenuse of length $1$, and the opposite side $x$. I want to find $\sin(\theta)$ as $ \theta = a \arcsin(x)$. For $a = 2$ and $a = 4$ this is quite simple. When $a = 2$: $$\sin(\theta) = 2 \sin\left(\frac{\theta}{2}\right)\cos\left(\frac{\theta}{2}\right)$$ As $\theta/2$ is the angle in our triangle we can simply substitute this in terms of $x$ So $$ \sin(\theta) = \sin(2 \arcsin(x)) = 2x\sqrt{1 -x^2}$$ repeating this process for $a = 4$ $$ \sin(\theta) = 2 \sin\left(\frac{\theta}{2}\right)\cos\left(\frac{\theta}{2}\right) = 4 \sin\left(\frac{\theta}{4}\right)\cos\left(\frac{\theta}{4}\right)\left( 2 \cos^2\left(\frac{\theta}{4}\right) -a\right)$$ In other terms $$\sin(4 \arcsin(x)) =4x\sqrt{1- x^2} (1-2x^2) $$ How can I attempt to generalise this at least for even values of $a$, thanks.
I'm wondering if there's a simple way to rewrite this in terms of $k$ and $x$, especially as a polynomial. It seems to me to crop up every so often, especially for $k=2$, when I integrate with trig substitution. But $k=2$ is not so bad, because I can use the double angle formula; it's the prospect of higher values of $k$ that motivates this question. I think the law of sines may help? Or maybe even De Moivre's theorem, to find the length of the hypotenuse as the length of the angle changes, if we think of the right triangle drawn from $\arcsin(x)$ with side1 = $x$, hypotenuse = $1$, and side2 = $\sqrt{1 - x^2}$ as a complex number, though I'm not sure how that might work.
Which is correct: If you have any questions in advance of the meeting, please don't hesitate to contact Mark Ingrao or me.
A question was asked in one of my friend's interview. The question was to determine the right form from the below sentences. Q. Correct form of English: Samuel was with Susan and I Samuel was with Susan and me Samuel was with I and Susan Samuel was with me and Susan None of these Now I vaguely remember a rule of thumb from my school days. That is "2-3-1" i.e. where all the persons are acting in a sentence, second person comes first, then third person and it is followed by first person. So according to this theory, 1 seems to be correct to me. Is this theory correct?
I've always seen MACs as a way to provide integrity and authentication. You would just append it to some message in clear. But this is clearly not the case when you're doing Encrypt Then Mac. When you do that you provide authentication to something that already has authentication (to decrypt we need to know the key). So why use a MAC when we can use a hash instead: $E(m | h(m))$? (i.e., encrypt the message appended to a hash of the message)
Most of the time, when some data must be encrypted, it must also be protected with a , because encryption protects only against passive attackers. There are some nifty encryption modes which include a MAC (, ...) but let's assume that we are doing old-style crypto, so we have a standalone encryption method (e.g. AES with CBC chaining and PKCS#5 padding) and a standalone MAC (e.g. with SHA-256). How should we assemble the encryption and the MAC? MAC-then-Encrypt: Compute the MAC on the cleartext, append it to the data, and then encrypt the whole? (That's what does) Encrypt-and-MAC: Compute the MAC on the cleartext, encrypt the cleartext, and then append the MAC at the end of the ciphertext? (That's what SSH does) Encrypt-then-MAC: Encrypt the cleartext, then compute the MAC on the ciphertext, and append it to the ciphertext? (In that case, we do not forget to include the initialization vector (IV) and the encryption method identifier into the MACed data.) The first two options are often called "MAC-then-encrypt" while the third is "encrypt-then-MAC". What are the arguments for or against either?
Find a number in the form of 111...1 (e.g. 111111) that is divisible by 2019. What I thought so far... I know of Fermat's little theorem, which states following: $a^{p-1}\equiv 1$ for $p \in \mathbb{P} \land a\in \mathbb{Z}$ 111...1 (with n 1's) can be written as $\frac{10^n-1}{10-1}$. Unfortunately, 2019 is not a prime. $\frac{10^n-1}{10-1} = 2019*k$ is also no solution to the problem since there are two variables. Can anyone give me a hint how to find the solution or at least how to proof that the solution exists? Thanks.
I need to prove that there are infinitely many numbers of the form $x = 111....1$ such that $31\mid x$ what I tried - I wrote x as $\sum_0^{n-1} 10^i$ I know that $(10,31) = 1 $ now I'm stuck .. any help will be appreciated
So I want to on mouse click of a row take data from this selected row in a JTable in one JFrame and insert the data into another JFrame with different JComponents. To this point I have set up the mouse listener and taken data from the selected row and stored it in variables. However I am having problems with setting the data to the JTextFields in the other JFrame. The problem is that 'JTextFields' are not showing any data nor is the println System.out.println(taskName); added to this after a mouse click I'm getting this exception Exception in thread "AWT EventQueue-0" java.lang.NullPointerException. Below is the mouse listener code, if anymore code is needed I can provide this. editFrame jtRowData = new editFrame(); tblCurrentTasks.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { int index = tblCurrentTasks.getSelectedRow(); DefaultTableModel model = (DefaultTableModel) tblCurrentTasks.getModel(); String taskID = model.getValueAt(index, 0).toString(); String taskName = model.getValueAt(index, 1).toString(); String taskDes = model.getValueAt(index, 2).toString(); String taskIm = model.getValueAt(index, 3).toString(); String taskFre = model.getValueAt(index, 4).toString(); String taskDr = model.getValueAt(index, 5).toString(); System.out.println(taskID); System.out.println(taskName); System.out.println(taskDes); System.out.println(taskIm); System.out.println(taskFre); System.out.println(taskDr); jtRowData.txtTaskName.setText(taskName); jtRowData.txtTaskDesc.setText(taskDes); System.out.println(taskName); jtRowData.setVisible(true); jtRowData.pack(); jtRowData.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); jtRowData.setBounds(200, 200, 550, 370); jtRowData.setLocation(new Point(700, 300)); } }); }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I want to delete an option from the wp-options table when clicked on a button in the back-end. i have created an option with this : get_option( string $option, mixed $default ); is there any method in WordPress to get this done? i want to set it back to $default so basically deleting the $option
I am writing a WP plugin. I have created a button for the user to click in thw WP dashboard. I need to run a function when a user clicks the button, shown with a red arrow. The code snippet for the button is:<p><button class="button button-primary">Update Media Titles and ALT Text</button></p>. I have already created the function in my class like so: public function kh_update_media_seo() { //update media files title and alt tags here } I can handle the code that goes in the function alone, I only need help making the button in the WP dashboard fire off this specific function when clicked. Pardon me if this sounds dump or straight forward. It's my first time doing this. My plugin is a one file plugin if that helps.
I have a cube (cube.1) parented to another cube (cube.2), and both cubes are dynamic bodies with the same properties. Both cubes have "box" collision bounds. Also, both cubes are inside a room. When I move cube.2 while in the game engine, it collides with the walls of the room and stops. But cube.1, which is parented to it, does not. Why is this happening? Also, what can I do to make cube.1 collide with objects and stop moving (stop going beyond their faces)?
I want to make a tree which is made of segments connected via parenting, i want the children have collision with the environment, atm the children will simply pass throught them. How can i make it. edit: described what i want in image
I found this awesome work designed by Kreativa Studio and I'm really curious about the effect of the woman picture. How to make an person image to blend into the background like this with photoshop.
I have seen such an effect being used in many places however I haven't figured out how to replicate it via Photoshop. I have tried desaturating the image, placing it under a layer of solid colour and then lowering the opacity of the colour. I have also tried a couple of blend modes, to no avail. The effect is nowhere near the same. Can someone please tell me the effect used on these images?
Since yesterday, my MacBook started to have rendering issues in the Finder app when I open specific directories. I managed to fix some of them by removing the .DS_Store file in those directories. But now I have one that occurs every time. Do you guys have an idea of how this can be fixed ? I bought this macbook one week ago so I don't know what to think.. MacBook Pro (15-inch, 2017) 2,9 GHz Intel Core i7 16 Go 2133 MHz LPDDR3 Radeon Pro 560 4 Go Intel HD Graphics 630 1536 Mo Mac OS High Sierra 10.13 (17A405)
I've had a very strange Finer error caused by recent macOS High Sierra betas that affected Macs running macOS 10.13 as well as macOS 10.12 Sierra. This error causes an entire Finder window to show visual artifacts when opening certain folders on either an APFS or HFS+ volume. After moving the cursor or the affected Finder window, the window may look something like this; Attempting to use Disk Utility to repair the affected volume does not resolve this issue, nor does restarting the affected Mac (even in Safe Mode). Without formatting this disk, how can I prevent Finder from exhibiting this graphical error when opening particular folders?
We know that light is an electromagnetic wave which follows the wave equation. We write the wave as $$f(x, t) = A\sin(kx - \omega t + \phi ),$$ which is sinusoidal. So my question is why can't it be a square wave or any other wave form which follows the wave equation?
I was researching sinusoidal functions when I realized that the wave produced by a wave function looks exactly the same as a light wave. Is a light wave a sinusoidal wave, and can a light wave be described as a sinusoidal function?
When I press F3 it only shows chunk-relative and up. How do I get the bottom back?
When I press F3 to see the debug screen in I use Minecraft 1.8.1, some information is missing. Most notably, there are no X, Y, Z coordinates. What happened to my debug overlay?
Quick question, most likely for a veteran will be easy, or maybe im asking for too much. i have this code for laravel in php, im not fan to do a foreach, is there a better way? i guess should be an existing function that replace my values of arr to the keys match on arr2, but i dont know Its really important not to change the order. $arr= ['filters', 'repeat', 'via', 'type']; $arr2= [ 'filters' => 'text1', 'repeat' => 'text2', 'via' => 'text3', 'type' => 'text4', ]; foreach($arr as $k) $res[]=$arr2[$k]; return $res;
Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing. $customer['address'] = '123 fake st'; $customer['name'] = 'Tim'; $customer['dob'] = '12/08/1986'; $customer['dontSortMe'] = 'this value doesnt need to be sorted'; And I'd like to do something like $properOrderedArray = sortArrayByArray($customer, array('name', 'dob', 'address')); Because at the end I use a foreach() and they're not in the right order (because I append the values to a string which needs to be in the correct order and I don't know in advance all of the array keys/values). I've looked through PHP's internal array functions but it seems you can only sort alphabetically or numerically.