I am trying to create a shortened mysqli_real_escape_string function  code works when used directly, but get errors when trying to turn into a function  this works perfectly: '''  $conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname); $username = $conn->real_escape_string($_GET['user_name']);   ''' BUT using the following code: '''  $conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname); function cleanstr($cleanval){     $cleanval= $conn->real_escape_string($cleanval);     //$cleanval =mysqli_real_escape_string($conn, $cleanval);     return $cleanval; } $username = cleanstr($_GET['user_name']);   ''' I get errors:  ........................  ( ! ) Notice: Undefined variable: conn in C:\wamp64\www\Data\reg\functions.php on line 21 Call Stack #   Time    Memory  Function    Location 1   0.0004  403064  {main}( )   ...\verify_email.php:0 2   0.1575  420064  cleanstr( ) ...\verify_email.php:10  ( ! ) Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in C:\wamp64\www\Data\reg\functions.php on line 21 ( ! ) Error: Call to a member function real_escape_string() on null in C:\wamp64\www\Data\reg\functions.php on line 21 Call Stack #   Time    Memory  Function    Location 1   0.0004  403064  {main}( )   ...\verify_email.php:0 2   0.1575  420064  cleanstr( ) ...\verify_email.php:10   .......................................... Am i doing something wrong, or is there no way to use real_escape_string is in a custom function

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


i need to upload data to MySql table by CSV file with Hebrew language data, its saving but showing as Question mark (???), i need to display it in hebrew.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


Checking the content of /etc/X11 dir, I saw that xorg.conf file is missing. Is that normal? I only have xorg.conf.failsafe configuration file with the following lines:   Section "Device"     Identifier  "Configured Video Device"     Driver      "vesa" EndSection  Section "Monitor"     Identifier  "Configured Monitor" EndSection  Section "Screen"     Identifier  "Default Screen"     Monitor     "Configured Monitor"     Device      "Configured Video Device" EndSection   Is, the one above, a correct configuration file? Or, I have to restore the xorg.conf file? If yes, how can I do that? The current driver used is:  sudo lshw -c display | grep driver [sudo] password di michele:         configuration: driver=i915 latency=0   and   lspci | grep -E 'VGA|Display|3D' 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT] (rev ff)   A few hours ago, after rebooting my OS, I got a black screen with message:      your system is running in low-graphics mode   but after restarting the pc, all strangely returned as before.  Thanks!

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


I need to clean my desktop, it is full of dust. Is it safe to use a compressor to clean it? I mean, can I have problem with static, water, dirty, moisture or other stuff been blown on the hardware?

I've been arguing with a colleague whether it is a sensible solution to clean dusty PCBs with compressed air. While I think this is the best solution (nothing touches the PCB), he claimed that spraying off the dust can cause ESD, because the charges that may have accumulated in the dust win't bleed off in the process (and it's better to leave everything as it is). I'm not really convinced by this argument and my (limited) knowledge of ESD production doesn't help getting peace of mind in this matter. What is your input?


It is well known that if we have two groups/rings/vector spaces (over same field), then we can embed them in a common corresponding object. It is natural to consider for fields.   However, if we take two fields of different characteristics, then we can not embed both in a common field. With this remark, I will shorten my problem in a simple case.  Question: If $F$ is a field, and $E_1,E_2$ are any two extensions of $F$, then does there always exists a field $E$ which is extension of both $E_1$ and $E_2$?

Let $F$ be a field, $E_1$ and $E_2$ are two distinct extension fields of $F$. Is it the case that we can always somehow find a field $G$ that contains both $E_1$ and $E_2$? In other words, could extensions of fields have different 'direction's such that they are incompatible?  Edit: I began to think about this problem while reading a proof. $F$ is a field. $a$ and $b$ are algebraic over $F$. $p(x)$ and $q(x)$ are two polynomials in $F[x]$ of minimum degree that respectively make $a$ and $b$ a zero. The proof claims that there is an extension $K$ of $F$ such that all distinct zeros of $p(x)$ and $q(x)$ lie in $K$. For a single polynomial, I know this kind of field exists because of the existence of splitting field, why it is true for two polynomials?


Suppose I have a normal A4 paper sheet and I bend the paper in two. My question is:     Why the paper now have this line and why the paper didn't lose naturally this line?   My conjecture: I was thinking that the paper is a isotropic (relatively) material and then the atoms do not have a proper direction. So when I bend the paper I put work in to it so that some preference direction of the atoms is created. And one couldn't undo this new constraint, only if you insert more (an huge amount of) work, such as another process of creating a new paper or burning the paper.  Is this correct?

What exactly happens when a material (particularly paper or even cloth or a metal) is folded to form a crease? Why is it that a creased material tends to retain form, while a lightly folded one, 'might' just happen to revert to an original configuration? Are bonds being broken here, then to what extent? Are they along a single molecular line or break on a  bulk basis? Also, why does a rolled sheet retain shape through a variety of radii? Is there a critical radius to this sheet regaining its flatness? Thanks.


I was thinking, perhaps after 100 reputation or something, that you should be able to post questions anonymously on  kind of like the way people can on   Then you would be able to delete or edit the question for say, 24/48 hours, but then after that, there would be no server-side trace of the question to that user's account, whether the user is logged in or logged out. And perhaps reputation is rewarded within the 24/48 hours, but not afterwards, due to it not being possible.  The reason for this is that, with the way things currently are, people could easily leave a Hansel & Gretel 'breadcrumb trail' of their security habits, actually making it easier for them to be attacked - the opposite of the intention of security.stackexchange!  On the other hand, I suppose people could simply use 'burner' accounts instead? Though I'd suppose those burner accounts would still have server side records of IP addresses, e-mails, etc. which introduces a point of failure?  I suppose I'm trying to find a solution to the issue of anonymity that a rewards based system such as Stack Exchange can facilitate.

I think sometimes there is a need to post question as anonymous, reason being to avoid linking content of a question with the identity of the questioner. This may not be so evident or required on technical sites like stackoverflow.com but sometimes is a necessity on sites like  or maybe in future depression.stackexchange.com  On such sites user may not want to link his identity to some questions where he may detail about his being over-weight or skinny or maybe some other attribute which he may like to keep private and avoid making his concerns public, but still want to ask a question with valid data.  I am not suggesting that user asking question should not be registered or not responsible for content. I think all down-votes or up-votes should still be attributed to user, but this way most users would not suffer , and reputation could even be used for a bounty. The only change should be that while asking question a valid registered user can hide his identity (the whole user signature block/user card and the reputation should be replaced by "identity-hidden") and that question should not be listed in his public profile.  Anyway identity of questioner doesn't add much value to question. If we think such anonymous question may reduce social nature of Stack Exchange sites, and maybe majority of questions will become anonymous we can curb that by putting a daily or monthly limit per user or put a price of say 50 reputation per anonymous question.  PS: I don't think this is duplicate of        because motive for question and reason for feature request are different, and I propose a different solution too, because creating another account for asking such questions has many problems which having a single account doesn't have    I don't have to manage other account If I keep single account I still may want to keep my details to be linked to my non-anonymous questions I may want to use reputations I earned as bounty for anonymous questions    also allows anonymous questions and may be we can take some hint from there.


I have a script that is using ajax to consume an api. My current script looks for a script tag with an id of "test-api" and passes the data attribute (an id) to the ajax call to complete the url for lookup.  <script src="./bundle/src/js/api.js" id="test-api" data-client="2"></script>   Inside my script:  var clientId = $('#test-api').data('client'); //short hand  axios.get('http://url_to_api.com/clients' + clientID) .then()   All of this works quite well, but I have now run into an issue. This script might be duplicated on the same page (as I might need to pull in other "clients") so I need to have ids for all of the scripts.  <script src="./bundle/src/js/api.js" id="test-api" data-client="2"></script> <script src="./bundle/src/js/api.js" id="test-two-api" data-client="5"></script> <script src="./bundle/src/js/api.js" id="test-three-api" data-client="6"></script>   I tried using  var script = document.currentScript; script = script[script.length - 1]   but I keep getting null returned (also regarding this, my script is being placed via a gtm, so it is not always the last script). As I understand, it is null due to this being placed in an .then() function (running after another script finishes).  I guess my question is it possible to actually get the id of the current script without really know what ID is present (not hardcoded into the script)? Unfortunately, I do need to support IE as well so I assume .currentScript is out of the question as well

How can I reference the script element that loaded the javascript that is currently running?  Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD tag.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript" src="scripts.js"></script>   There is a script in "scripts.js" which needs to be able to do on-demand loading of other scripts. The normal method doesn't quite work for me because I need to add new scripts without referencing the HEAD tag, because the HEAD element hasn't finished rendering:  document.getElementsByTagName('head')[0].appendChild(v);   What I want to do is reference the script element that loaded the current script so that I can then append my new dynamically loaded script tags into the DOM after it.  <script type="text/javascript" src="scripts.js"></script> loaded by scripts.js--><script type="text/javascript" src="new_script1.js"></script> loaded by scripts.js --><script type="text/javascript" src="new_script2.js"></script>


I was trying a program in which I declared a 2D array named grid of size 5 x 5 globally in python. grid = [[0] * 5] * 5  def main():     global grid     n,m = map(int,input().split())     for i in range(n):         li = list(map(int,input().split()))         for j in range(m):             if j < 5:                 grid[i][j] = li[j]     print(grid)  if __name__ == "__main__":     main()  Modifying the grid gives a weird answer. For example if the input is :- 2 3 1 2 3 4 5 6  2 rows and 3 columns (n and m) It gives the following output:- [[4, 5, 6, 0, 0], [4, 5, 6, 0, 0], [4, 5, 6, 0, 0], [4, 5, 6, 0, 0], [4, 5, 6, 0, 0]]  Even when I remove the line global grid from the main function, output remains the same. What is going on? I want it to update grid according to the input and leave the extra cells untouched i.e value 0. If input is of size 2 x 3 then only the first 2 rows and 3 columns of the grid should be modified according to the input and rest of the elements should remain 0.

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


If a photon was approaching earth, after 1 minute(from earths reference frame) an asteroid comes on the photons path. And it hits the asteroid, but from the photons reference frame time doesn't pass so there shouldn't have been an asteroid in the first place (from the photons perspective).So it shouldn't have collided. So does the photon feel(assuming it can) that it got absorbed without hitting anything?

To an an external observer it appears that time has stopped for photon. But this relation is reflexive, so for an observer travelling with the photon it appears the universe has stopped everywhere.  Is this right?  Space also gets distorted parallel to the direction of motion, but not perpendicular to it.   Does this mean that for an observer travelling with a photon sees spacetime as a flat plane?  Note 1: I'm using language vividly not literally when I say a photon experiences space and time. Not that I'm against idealist or panpyschist interpretations of matter or energy come to that.  Note 2: Since it's been pointed out that an inertial frame can't be boosted into the frame of a photon and moreover there is no limiting behaviour here - no matter what frame you are boosted into, light will always appear to travel at c. Nevertheless, when an external observer watches a train chasing a photon by gradually increasing its speed, he will note that the train speed is approaching the speed of the photon (but will never match it) and when he looks at the clock inside the train he will not too that it is gradually slowing down (but never actually stops). Using this picture, we can attempt the thought experiment - if not one that can be carried out - of what a world looks like to a photon.


I have a dual boot Ubuntu on my Lenovo X230. Linux One is unencrypted on sda2 (family, guests, tinkering), Linux Two (work) is encrypted within sda5:  NAME                    TYPE  FSTYPE      MOUNTPOINT sda                     disk ├─sda1                  part  ext2        /boot ├─sda2                  part  ==> my Linux One (Elementary OS) └─sda5                  part  crypto_LUKS ==> my Linux Two (Ubuntu-Mate)     └─sda5_crypt          crypt LVM2_member     ├─ubuntu--vg-root   lvm   ext4        /     └─ubuntu--vg-swap_1 lvm   swap        [SWAP]   Question: If I boot from my Windows 10 boot media, install Windows to sda2 (overwriting my Linux One), what bad things will happen, that I need to look into before/after windows 10 install?   What about the boot partion? What about restoring the bootsector afterwards? (I believe, I am on UEFI, on this 4-year-old machine…) Can the Win10 install harm the other partitions? (within the W10 setup, of course I will go for „expert mode“ and picking the partition to install to...) I'd assume, I better boot with a linux stick before and backup /boot/grub before?   What will I have to do after windows install?

I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only!


Pi = C / D (circumference / diameter) . I have read that if circumference can be expressed as an integer then diameter cannot and vice-versa, so that the ratio can never be expressed as a/b where both a,b are integers & hence Pi is irrational.  However as far as i know a ratio of two decimals can always be expressed as a ratio of two integers by adding 0s after the deciaml. eg- 56.89 / 23 can always be written as 5689/2300 . So we should also always be able to express C/D as integers . Why then is Pi irrational ? Can't we always measure the diameter and circumference accurately and express them as integers in the ratio ?

$\pi$ can be represented as $C/D$, and $C/D$ is a fraction, and the definition of an irrational number is that it cannot be represented as a fraction.   Then why is $\pi$ an irrational number?


Is it possible to get each char from STDIN once it is provided (without waiting for return key)?

How can I get a single keyboard character from the terminal with Ruby without pressing enter? I tried Curses::getch, but that didn't really work for me.


In 1988 I read a short story about a man who was on his way to work. He meets a friend at the bus stop and they engage in small talk, then get on the bus and go to work. They come home and go to sleep. The next morning, the guy goes out to the bus stop and meets his friend, and is surprised to hear his friend saying the exact same things he said the day before.   All day at work things happen exactly as they did the day before. The next morning is a repeat of the same, and he begins trying to get his friend to see that they are living in some kind of time loop, but his friend doesn't know what he's talking about.  The guy ends up staying home the next day, hiding in his house. Finally someone comes to his door and tells him he has been part of an experiment. Every night when they go to sleep their minds are erased. Scientists are observing behavior to see if in a given scenario there is any deviation in word or action  if a person is subjected to the same stimuli repeatedly, if they have no knowledge of ever having done it before. For some reason, they forgot to erase his memory and he began remembering the previous days.   He doesn't believe what he is being told until he looks out the window and sees a giant in a lab coat. Turns out his house is just a small model on a train-type layout sitting on a table and he is one of many miniature "people" the scientists made to test their theories.  No idea who the author is or what the title was. I took a science fiction class in high school and this was one of the stories we had to read and then answer questions about.

I may be conflating two separate short science-fiction stories here, so please bear with me. I definitely read this more than 10 years ago and it's likely to be older than that (60's, 70's?)    A man wakes up one day to discover that the world is subtly different. His wife acts strangely and there's a weird "groundhog day" vibe.    He discovers that his house is actually made entirely of painted metal, including things that should be wood (a boat that he made by hand, for example). He comments that in the real world, it's the fact that stuff doesn't work properly that shows you that you're living in reality (a wobbly doorhandle may have been mentioned?) He's constantly beset by advertising; brands of washing powder, political messages, etc. and people keep asking him what he thought about them. At one point, the advertisers start getting very aggressive, literally invading his house to dirty his clothes and driving around with megaphones to shout slurs about their political competitors. He finally breaks out of the town (with the assistance of his secretary?) and they discover that they're...      ...actually robots living in a simulated town used by advertisers to test slogans, etc.   The final twist is that...     ...the town fits onto a desktop and is encased in glass. Even if he could escape, he could never live in the real world since he's very tiny.


In many pieces of literature, light is said to travel like a "wave". Does this mean the light literally propagates through space like a wave as in up and down and so on or does light move linearly through space? Also, if it move linearly, why do we say photons are a wave then?

In diagrams I often see light waves depicted as little sine waves that travel through space.  And often when describing polarizers, the explainer will angle their hand to show the angle of polarization and bob it up and down in a sine wave action, apparently emulating the amplitude of the wave.  My questions is, is the amplitude of light really like this?  Where it moves up and down or side to side in space?  Or, is the sine wave relationship just an analogy?


Do you have any idea how I can get the cumulative distribution function (CDF) for inverse-normal (Gauusian) distribution? Modeler 18.2 doesn't have that specific function, and I need it to calculate a Vasicek test.

I know that an easy to handle formula for the CDF of a normal distribution is somewhat missing, due to the complicated error function in it.  However, I wonder if there is a a nice formula for $N(c_{-} \leq x < c_{+}| \mu, \sigma^2)$. Or what the "state of the art" approximation for this problem might be.


For a decreasing and non-negative sequence {$a_n$}, we have:   if $\displaystyle \sum_{k=1}^{\infty}2^k \cdot a_{2^k}$ converges, then $\displaystyle \sum_{k=1}^{\infty}a_{k}$ also converges.  Is the converse of this statement also write? That is:  If $\displaystyle \sum_{k=1}^{\infty}a_{k}$ converges, does $\displaystyle \sum_{k=1}^{\infty}2^k \cdot a_{2^k}$ also converge? And why?  Thank you in advance.

I have to prove the  by tomorrow and I am really unconfident about what I did:  $$\sum_{n=1}^\infty a_n\text{ converges } \iff \sum_{n=1}^\infty 2^n a_{2^n}\text{ converges}$$  I did the following:  Let $(b_n)$ be a sequence as follow: $b_{2^k+m}:=a_{2^k}$ with $k\in\mathbb N_0$ and $0\leq m<2^k$.  It's $a_{n+1}\leq a_n$ and so $0\leq a_{n+p}\leq a_n$ for all $n,p\in\mathbb N$.  So $\sum\limits_{n=1}^\infty b_n$ converges by the majorizing series $\sum\limits_{n=1}^\infty a_n$. And it's $\sum\limits_{n=0}^\infty b_n=\sum\limits_{n=0}^\infty\sum\limits_{m=0}^{2^n-1}a_{2^{n+1}}=\sum\limits_{n=1}^\infty 2^{n-1}a_{2^n}$ so $\Rightarrow$ is done.  For $\Leftarrow$ consider $c_{2^k+m}:=a_{2^k}$ with $k\in\mathbb N_0$ and $0\leq m<2^k$.  It's $|a_n|\leq c_n$ and $\sum\limits_{n=0}^\infty c_n=\sum\limits_{n=0}^\infty\sum\limits_{m=0}^{2^n-1}a_{2^{n}}=\sum\limits_{n=1}^\infty 2^{n}a_{2^n}$ and so $\sum\limits_{n=1}^\infty a_n$ converges by the majorizing series $\sum\limits_{n=0}^\infty c_n$.  Is this in form and content correct?


For $n\ge1$, let $\phi(n)$ be the number of positive integers $\le n$, which are relatively prime to $n$  i. Find all $n$ such that $\phi(n)=\frac n2$ ii. Find all $n$ such that $\phi(n)=4$.  I know the formula for suker totient function but that is not telling me anything. Please help.

For which Natural $n\ge2$ does this occur with?: $\phi(n)=n/2$


I don't know any identity that'd help me simplify it. I know of Brahmagupta's identity and tried using but no good. Any hints?  Edit: So far I've tried various things,  $(x^2+1/2)^2 + (y^2 +1/2)^2 -1/2$ This doesn't get me anywhere. I tried solving in x as a quadratic so as to get an insight or something but that didn't help too. I even tried writing general polynomials of degree too and then getting the solution by comparing coefficients, but that wasn't elegant and was too computational.

Prove that $$p(x,y) = x^4 + y^4 + x^2 + y^2$$ can be written as a sum of squares of three polynomials over $x,y$ for real numbers.


I'm running some tests that take some time in Command Prompt. When you type Ctrl+C Command Prompt on Windows 7, it appears as ^C (or while the program is running it pauses the program and kills the tests).  How can I copy it in a more efficient manner than just typing it all into notepad and then copying it?

Is there any way to copy text that's shown in the Command Prompt window C:\Windows\system32\cmd.exe to the clipboard?


I was trying to come up with the reason for why light refracts upon entering a new medium and after consulting with the internet I believe my theory is known as the marching soldiers analogy. This analogy describes how when light hits a boundary at an angle, the near side of the light beam will slow down first whereas the far side will take longer to get to the boundary and slow down. Obviously, this causes a change in direction dependent on the time it takes for the far side to get to the boundary, which directly correlates with the angle at which the beam of light is incident upon the boundary.  My question is, does this work with just a single photon? If one particle/wave of light crosses a boundary between media, will it refract? The only way I could imagine this happening is if you took the photon to be a wave and thus have a little width (the distance between opposite peaks). Is this right or would a single photon just pass through with only a change in speed, not direction?  Edit:  After reading more about Fermat's Principle I have a lot more questions but I'll read more so I can narrow them down.

This was discussed in an answer to a  but I think that it deserves a separate and, hopefully, more clear answer.  Consider a single photon ($\lambda$=532 nm) traveling through a plate of perfect glass with a refractive index $n=1.5$. We know that it does not change its direction or other characteristics in any particular way and propagating 1 cm through such glass is equivalent to 1.5 cm of vacuum. Apparently, the photon interacts with glass, but what is the physical nature of this interaction?  Let's not consider high-order effects like Rayleigh/Raman scattering.


I haven't seen anything in the PHB or the DMG (although I admit I haven't looked in every nook and crank) to the effect that a warlock can displease their patron. Warlocks seem to be just free to do whatever they fancy.   Contrast this with the cleric, that also has a patron that grants their magic, but enforces a particular ethos. A cleric can displease their deity and be punished.  Is there any way for a warlock to displease their patron? Or are they free to act as they will?

I would like to know whether a warlock can directly confront his patron without risking to lose his powers. And generally in which case the patron is allowed can take his "gift" back. I've tries searching for relevant lore but couldn't find anything. I'm playing the 5th edition.  The backstory:  I'm going to introduce a warlock into a campaign that is already running. During previous events the party has accidentally released a devil into the mortal plane and now is on a quest to kick him back. We've decided with DM that it would be interesting if that devil were my character's patron. It makes the new character a good lead to find the devil and the party wouldn't know whether to trust the new member, making things even more interesting.  However, I can't have a character that is directly allied with the party's enemy. I have a backstory that would support antagonistic relationship between my warlock and his patron so that his interests are aligned with party's. But at the same time the warlock wouldn't risk losing his powers, hence my question – can a patron take back the powers given to a warlock?  In my case I want to follow the 5th edition handbook so that the character mades a pact/contract with the devil himself.    As @Theik mentioned in the comments, in previous editions warlocks were able to inherit the power from some ancestor who made the pact, and I bet our DM would allow it. But I'd prefer to not to take this path as the character making the pact himself works better for the rest of the background I made for him.      In the end we went with the inherited powers that the devil cannot revoke.


I have a CentOS7 installed in a virtual machine. By default, the file system of it was XFS both of the "/" and "/boot". Now I want it to change the file system of the "/boot" to ext3. The reason why I want to change it is I have here a backup server that requires an ext3 file system for it to be able to back up the Linux server. Can I change the XFS to ext3?

I have a fresh Lucid Lynx (Ubuntu 10.04) running on a laptop. where I defined the filesystems as:   mount point / on ext4 (46 Gb) mount point /home on jfs (63 GB) swap as 3 Gb   I left the machine over night to do some task, without AC power supply. next day in the morning I found it on standby, task completed, but filesystem was not reachable. it gave me I/O error  it seems that there is a problem with jfs and standby.  anyways, to avoid any hassle, I want to move this mount point from jfs format to ext4.  can I do this without losing data and without the need to place the data in a temporary location until transformation is done?  sorry to mention that, but I recall back in the windows days, we would change a FAT16 to FAT32 or a FAT32 to NTFS without having to lose the data. I hope this is available on Linux.  Update The /home filesystem was xfs not jfs, and it seems there is a bug with this filesystem for some reason, I had to re-install the OS twice until I ended up with ext4 for the entire /   However, as a conclusion, it seems that there is no way to make a conversion


I am a programmer, if i get stuck, most of the time the question/answer is easy and already to find here (ie. stackoverflow)   But sometimes there are questions, like 'shall I go right or left' (name a variable like something or not, use a '_' as starting char for a func name, or so)  The point is, I want to ask for other opinions to compleete my picture (this is a basic thing in human kind - I think)    Probably I get only 'go left' or something like 'You have overseen the pit fall, if you go right, you will get stuck')  I understand (and accept fully) why 'plain' opinion based questions are not ok, and not wanted here - like "what is the best IDE/OS/country" ore like  On the other hand - sometimes I want to ask something like 'how would you do that?'  Is there a way/cahnce to ask for others experience, even if it is an other(s)  opinion?

On a few occasions I've wanted to know about experiences in a certain situation, only to get close votes because the question resembles a similar question answered by hard facts.  On other occasions those same questions are shot down because they are non constructive.  Programming often is not an exact science. There are multiple solutions for a problem and often those solutions all have their pro's and con's.   I do understand why those type of questions can run against some opposition, they do tend to end up in a meta-discussion, actually exactly why meta.stackoverflow.com exists.  My question however is: How would one ask a question of which the answer is highly debatable, even though the opinions of people is actually the answer you are looking for.  Typical examples of this types of questions: - Use REST or SOAP for for a webservice - What is currently the best IDE of choice? - What programming language would currently be best to learn.


If $ \lim_{x \to x_1}(f(x))$ exists but $\lim_{x \to x_1}(g(x))$ doesn't, then can we say whether or not $\lim_{x \to x_1}(f(x)+g(x))$ exists?

If  $\lim f(x)$ exists and $\lim g(x)$ do not, when $x$ approaches $a$, why $\lim[f(x)+g(x)]$  does not exist?  need some help over here, to prove the above statement


I'm trying to make a simple bounds checked array in C++. I have declared a class in a header file, and defined the class in a separate source file. The compile step runs fine, but when I try to link the objects, I get the following error:  $ g++.exe -o a.exe src\main.o src\array.o src\main.o: In function `main': ../src/main.cpp:7: undefined reference to `Array<int>::Array(int)' ../src/main.cpp:9: undefined reference to `Array<int>::operator[](int)' ../src/main.cpp:10: undefined reference t o `Array<int>::operator[](int)' ../src/main.cpp:11: undefined reference t o `Array<int>::operator[](int)' ../src/main.cpp:13: undefined reference t o `Array<int>::operator[](int)' ../src/main.cpp:7: undefined reference to `Array<int>::~Array()' ../src/main.cpp:7: undefined reference to `Array<int>::~Array()' collect2.exe: error: ld returned 1 exit status   main.cpp  #include <iostream> #include "array.hpp"  using namespace std;  int main() {   Array<int> x(10); // compiler error    x[0] = 1; // compiler error   x[1] = 2; // compiler error   x[2] = 3; // compiler error    cout << x[1] << endl; // compiler error    return 0; }   array.hpp  #ifndef ARRAY_HPP_ #define ARRAY_HPP_  template <class T> class Array{ private:   T* array;   int length_; public:   Array(int);   ~Array();   int Length();   int& operator[](int); };  #endif /* ARRAY_HPP_ */   array.cpp  #include "array.hpp"  template <class T> Array<T>::Array(int size) {   length_ = size;   array = new T[size]; }  template <class T> Array<T>::~Array() {   delete[] array; }  template <class T> int Array<T>::Length() {   return length_; }  template <class T> int& Array<T>::operator[](const int index) {   if (index < 0 || index >= length_) {     throw 100;   }   return array[index]; }

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


My first style disagreement with another writer at a new job. I say the comma in the example below is superfluous because there is no introductory or non-restrictive clause. I think the options are: "Key takeaways from the press release include:" or "There are many key takeaways from the press release, including:" Context: This was included in an email to our marketing team announcing the distribution of a press release, so if any of us get questions we'll all have the same answer. As written:  Key takeaways from the press release, include: This thing digitizes stuff and simplifies workflows. This thing changes how we see stuff, and makes customers happy. This thing improves the integrity of our stuff. This thing helps people see how stuff is being used.

In the sentence     What’s funny is Cat’s dry humour.   Wouldn’t it be better to put a comma after “funny”:     What’s funny, is Cat’s dry humour.   This question entails a (at the time of writing) heated discussion in the .


When a user visits a question, the HTML page header contains the whole title of a question, prepended by a tag, one of those the question bears. How to determine which tag is displayed there, and how to choose a tag that an asker desires to be displayed in the page header?   This is also frustrating when you open multiple tabs of SO, searching for a problem regarding one language, then accidentally close the one you really needed because it displays some tag that's relevant to the question but is completely irrelevant to the problem you face. Is there a criteria which tag should be displayed if there are multiple tags assigned to the question? So far I am unable to guess which criteria is applied to select a tag that's displayed. For example,  on ruSO displays cmd tag, which is not most popular among selected tags (89 question against 540 for xml), is not the first and not the last tag listed under the question.

Take a look at this image:    It appears the page's title's is made up of someTag, dash, question title, but what tag is someTag?  This question has three tags, yet it shows the singlepage tag out of all three, so what is the tag that appears in the page's title and why?


I want to color only the symbol & in a text file named test.txt


Mark Wilson says that category and tag listings in a blog should be disallowed in order . I understand this.   However, I want to put internal links on keywords in the blog posts to the tag and category pages in order for the readers to find more relevant content.  I wonder whether putting those internal links to the category/tag pages which are disallowed in robots.txt is counted as useful from the perspective of SEO internal linking?

On my site, I currently have no special rules for search engines. It is a blog, statically generated using a Python program. When I search for some of my articles on Google, there is usually a tag or category page included in the results. Sometimes it even ranks ahead of the article itself. Obviously, as these links aren't always going to have the article on them, this aren't the results I want people to click on.  So, I'm thinking of setting noindex on these pages. Is there any possible downside to doing so? Is this possible to do via robots.txt, or do I have to add it to all the relevant templates? All I can find for robots.txt are ways to stop the search engine crawling those pages, which isn't what I want - while I don't want them indexed, it's still the only surefire way to find all my blog posts.


I found an older question saying to download Unetbootin which I did.  BUT when I get to this part...     Select the Ubuntu ISO file you downloaded and click the Open button.   HOW does one select the ISO file?      I clicked the bullet for disk image but the button with three dots that SHOULD let me see the desktop is showing a blank desktop.  Isn't it suppose to show me what's ON my desktop including the file I need it to see?   It's not. What do I do now?

I have a netbook that I want to install Ubuntu onto. I do have a good Mac computer that I can make a bootable USB drive from, but I'm confused on how to go about making it.


Does anyone know of a software that could be installed/compiled for linux that is able to cut video by the frame? Thanks.

I'm having trouble finding a cli application that can take a video file (avi, mkv, and mp4 preferably) and cut out very short clips (2-6 seconds) with precision time accuracy. I've tried ffmpeg, mencoder, avidemux, and mp4box but they all cut on keyframes which creates 6+ second clips. Is there a tool that will re-encode the input file and cut the accurate time or cut inaccurately, re-encode, and then cut accurately?


Can some please explain the difference 1) I spent a lot of time with my friends 2) I have spent a lot of time with my friends

I saw a dog.       I have seen a dog.   What are the differences between them? Did these events happen on the same day?


Which is better in terms of grammar and why, I wonder?      Once upon a time lived King and Queen...     Once upon a time there lived King and Queen...

There didn't exist computers.      Will there happen similar events in the future?   Are these sentences grammatical or is my mind making stuff up? I haven't been able to find much on the net.


How would one go about answering this question? Is there an example sequence we can use? Our TA suggested something about some value k for n that would make |a_n| >= a^2_n

I'm trying to re-learn my undergrad math, and I'm using Stephen Abbot's Understanding Analysis. In section 2.7, he has the following exercise:  Exercise 2.7.5 (a) Show that if $\sum{a_n}$ converges absolutely, then $\sum{a_n^2}$ also converges absolutely. Does this proposition hold without absolute convergence?  I'm posting about this here because my answer to that last question about whether the proposition holds without absolute convergence is "Yes", but my suspicions are raised by him merely asking the question. Usually questions like this are asked to point out that certain conditions are necessary in the statement of propositions, theorems, etc. I just want to see if I'm missing something here.  Anyway, here's how I prove the absolute convergence of $\sum{a_n^2}$, and note that I never use the fact that $\sum{a_n}$ is absolutely convergent:  Proof: Let $s_n = \sum_{i=1}^n{a_n^2}$. I want to show that $(s_n)$ is a Cauchy sequence. So, let $\epsilon > 0$ and $n > m$, and consider, \begin{equation}   \begin{aligned}     |s_n - s_m| &= |(a_1^2 + a_2^2 + \cdots a_n^2) - (a_1^2 + a_2^2 + \cdots a_m^2)|\\                 &= |(a_{m+1})^2 + (a_{m+2})^2 + \cdots + a_n^2|\\                 &= |a_{m+1}|^2 + |a_{m+2}|^2 + \cdots + |a_n|^2\\   \end{aligned} \end{equation} Now, since $\sum{a_m}$ converges, the sequence $(a_m)$ has limit 0. Therefore I can choose an $N$ such that $|a_m| < \sqrt{\epsilon/n}$ for all $m > N$. So for all $n > m> N$,  we have, \begin{equation}   \begin{aligned}     |s_n - s_m| &= |a_{m+1}|^2 + |a_{m+2}|^2 + \cdots + |a_n|^2\\                 &< \left(\sqrt{\frac{\epsilon}{n}}\right)^2 + \left(\sqrt{\frac{\epsilon}{n}}\right)^2 + \cdots + \left(\sqrt{\frac{\epsilon}{n}}\right)^2\\                 &< \left(\sqrt{\frac{\epsilon}{n-m}}\right)^2 + \left(\sqrt{\frac{\epsilon}{n-m}}\right)^2 + \cdots + \left(\sqrt{\frac{\epsilon}{n-m}}\right)^2\\                 &= \epsilon   \end{aligned} \end{equation} Therefore $(s_n)$ is Cauchy and $\sum{a_n^2}$ converges. And since $\sum{a_n^2} = \sum{|a_n^2|}$, the series $\sum{a_n^2}$ is absolutely convergent. ∎  Am I doing something wrong here? Am I right in thinking that $\sum{a_n}$ need not be absolutely convergent for $\sum{a_n^2}$ to be absolutely convergent?


He  Anyone know how to get the same ids here into one row along with the other column after the comma, so group by id where there is another record from other column.     SELECT     CONCAT(p.ID, ', ', '', s.[value]) 'id, OtherColumn'    FROM [Test].[Person].[Name] s   INNER JOIN [Test].[Person].[Nameref] sr ON s.Id = sr.ID   INNER JOIN [Test2].[Test2] p ON sr.Id = p.ID    GROUP BY p.ID, s.value  1, 4GL 1, Web 1, CCS   Needs to be:  1 , 4GL, Web, CCS   Thanks

Consider a database table holding names, with three rows:  Peter Paul Mary   Is there an easy way to turn this into a single string of Peter, Paul, Mary?


I am having issue with special character * in linux . when I do below I am having issue text='*'  if I do echo $text I am  getting list of all files in the directory. Please let me know how can I get * if I do echo $text. Thanks in advance

I often have to do a recursive search in files. Tired of typing the whole "find/grep" combination all the time, I just created a script with the following line:  find . -name $1 -exec grep $2 {} + 2>/dev/null   The idea is that I should be able to run it as, for example:  myfind '*' hello   The problem is, when '*' gets passed into the script, the script is expanding it to each file in the directory.  I tried putting a quote around $1:   find . -name '$1' -exec grep $2 {} + 2>/dev/null   However, this turns $1 into a literal string.  Would appreciate your help in finding the right syntax. Must be something simple that I am missing.


I have read this word quite often and always tried to elicit its meaning from the context and circumstances in which it was said.. More often than not I took it as a word for official ban or penalty.. until recently when I was watching an interview in which the interviewee felt offended over a question asked by someone in the audience and refused to answer it and said "she do not sanction impoliteness"...contextually meaning approval or consent.  When I googled its meaning, it offered me two usages :-   a threatened penalty for disobeying a law or rule; syn- penalty, ban, deterrent, correction official permission or approval for an action; syn- permission ,authority, agreement   Both of them are almost contradictory and do not offer an unambiguous understanding when used in  sentence.  For example: the court sanctioned the proposal.  Did the court approved or deterred?

Sanction is an unusual ambiguous word to me. In some cases it means to approve some action, while in other cases it means to prohibit or punish some action; and there being near opposite meanings, context is especially essential for correct interpretation.  What is interesting to me is: historically, how did sanction come to capture two opposite meanings like this? The etymology seems to trace back to the single Latin word sanctio, meaning a decree. But did sanctio have strong opposing meanings or connotations like our modern word sanction? Or how and when did the divergence occur over time?


I have a fixed-width file which is used by the interface as it is. Now, I have some 500 records for which one of the fields is blank. I have the information separately with me.   I was wondering if there is a way to convert the fixed width file into Excel, put the missing field in using Excel, and convert the file back to fixed-width without altering the layout. Is it possible? If yes, how? If no, is there an alternative method to do so?

Excel has the functionality to import fixed-width text files where it presents a dialog that lets you choose where the begins and ends of fields are which it puts into columns.  Does it also have functionality where, given an existing spreadsheet, you can export to a fixed-width text file?    If so, how do I access this? I have tried using Save As and choosing Text File but it seems to only save as Tab-delimited which doesn't help me.  This is Excel 2003 if it matters.


can any body please tell me how to integrate the following expression:  $$\int\frac{x}{1+x^4}\,\mathrm {d}x$$   please help...

Could someone take me through the steps of decomposing  $$\frac{2x^2+11x}{x^2+11x+30}$$ into partial fractions?   More generally, how does one use partial fractions to compute integrals $$\int\frac{P(x)}{Q(x)}\,dx$$ of rational functions ($P(x)$ and $Q(x)$ are polynomials) ?    This question is asked in an effort to cut down on duplicates. See .  Also see .


I need to write a testmethod that checks if the triggerHandler works fine. I have a Trigger on Users, a TriggerHandler that calls up a class and one of its methods, and a testclass.  But how do I check if a triggerHandler works correctly, what is the right approach?  Thank you in advance!

How do I write a unit-test / test class for a trigger?  What are my options?   Inline with the trigger?  New Class?


I was once told not to end "firstly [point 1], secondly [point2], thirdly [point 3]" in -ly and to leave them as first, second, third etc. Is this always true or only in certain situations? Is it ever correct to use the word "firstly"?  I came accross  where the author writes     Firstly: hogwash. (True, the oboe doesn’t have a built-in tuning   slide. But an oboist can “tune” by switching reeds, and can humor   individual notes sharper or flatter on the fly, just like any wind   player.) Secondly: if we tune to the principal oboe because it can’t   be tuned, then what is the second oboist expected to do?   Is it correct to separate the ordinal numbers into different sentences like this? Is there a specific name for the speech pattern where people are making multiple arguments to prove a point?

Which is more correct?     How do I love thee? Let me count the ways. First, thy eyes gaze deep into my soul. Second,...   or     There are four reasons why all should hail the Hypno-Toad. Firstly, his eyes gaze deep into your soul. Secondly,...


I'm using Lombok S1F4j to log my data and In order to avoid logging empty data , I check if the object is null or not . I want avoid this guys so my code is more robuste and so easy to test .  This is an example :    if (object != null)  { log.info("lalalalal", object) object1.set(object)  }   Is there anyway to avoid checking null and not logging if object is null ?

I use object != null a lot to avoid . What is an alternative to: if (someobject != null) {     someobject.doCalc(); }


If I do this, I get the result as expected.  for i in {125..129}; do echo $i; done 125 126 127 128 129   But when I do this? I get something weired.  for i in {$((1+(25-1)*500))..$((25*500))}; do echo $i; done  {12001..12500}   I wish to pass a variable inside the loop variables like $((1+($j-1)*500))

How do I iterate over a range of numbers in Bash when the range is given by a variable?  I know I can do this (called "sequence expression" in the Bash ):   for i in {1..5}; do echo $i; done   Which gives:     1    2    3    4    5   Yet, how can I replace either of the range endpoints with a variable? This doesn't work:  END=5 for i in {1..$END}; do echo $i; done   Which prints:     {1..5}


When I use the default overflow value, an
 element disappears. Here's a snipped I've tested with Google Chrome:    ul {   list-style-type: none;   background-color: #333333; }  li {   float: left;   color: white; }

Test

     However, when I add overflow: hidden; to
, it becomes visible:    ul {   list-style-type: none;   background-color: #333333;   overflow: hidden; }  li {   float: left;   color: white; }

Test

     As far as I know, the overflow property specifies if the overflow renders outside the element's box. Why the whole element is invisible when the default overflow: visible is set?

Although elements like
s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: If floated elements have non-floated parent elements, the parent will collapse. For example:

Div 1

Div 2

    The parent div in this example will not expand to contain its floated children - it will appear to have height: 0. How do you solve this problem? I would like to create an exhaustive list of solutions here. If you're aware of cross-browser compatibility issues, please point them out. Solution 1 Float the parent.

Div 1

Div 2

    Pros: Semantic code. Cons: You may not always want the parent floated. Even if you do, do you float the parents' parent, and so on? Must you float every ancestor element? Solution 2 Give the parent an explicit height.

Div 1

Div 2

    Pros: Semantic code. Cons: Not flexible - if the content changes or the browser is resized, the layout will break. Solution 3 Append a "spacer" element inside the parent element, like this:

Div 1

Div 2

    Pros: Straightforward to code. Cons: Not semantic; the spacer div exists only as a layout hack. Solution 4 Set parent to overflow: auto.

Div 1

Div 2

    Pros: Doesn't require extra div. Cons: Seems like a hack - that's not the overflow property's stated purpose. Comments? Other suggestions?


In Python 3 , the iterator protocol is defined as follows:     The iterator objects themselves are required to support the following   two methods, which together form the iterator protocol:      iterator.__iter__()      Return the iterator object itself. This is required to allow both containers and iterators to be used with the for and in statements.   This method corresponds to the tp_iter slot of the type structure for   Python objects in the Python/C API.      iterator.__next__()      Return the next item from the container. If there are no further items, raise the StopIteration exception. This method corresponds to   the tp_iternext slot of the type structure for Python objects in the   Python/C API.   I experimented with implementing it through individual object attributes:  class Empty: pass o = Empty() o.__iter__ = lambda: o o.__next__ = lambda: 42 for i in o: print(i)   and got a TypeError:  TypeError: 'Empty' object is not iterable   What is wrong?  Are there any precise rules somewhere about what objects can be used as iterable in for loop?

I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python.   I understand that it's not always good to do so. But how might one do this?


Let $G$ be a finite group, $H \leq G$ such that $[G : H]$ is the least prime which divides $|G|$. Show that $H$ is normal in $G$.  Can someone explain what information we get from knowing that $[G : H]$ is the least prime which divides $|G|$? By Lagrange, $|H| = \frac{|G|}{[G : H]}$. Since $[G : H]$ prime, then $|G|$ should be a power of that prime. By Sylow theorem $1$, then there is a Sylow $p$-group (where $p$ is the prime) with order $p^n$. I don't know if this is the correct path and I also don't know why we care about the least prime.  If someone can explain the solution for this exercise, I would be grateful. I've been banging my head on this for forever.

Generalizing the case $p=2$ we would like to know if the statement below is true.  Let $p$ the smallest prime dividing the order of $G$. If $H$ is a subgroup of $G$ with index $p$ then $H$ is normal.


Someone gave me the following riddle and I am really not sure what the answer is.  I have two boxes in front of me. One box contains $x$ Dollar, the other box contains $2x$ Dollar. The rules are as follows: I am allowed to open one box. I can now either keep the money I found in this box, or give this money back and take the money from the second box without knowing how much money I find in there.  The question is now: What is the best strategy to get the most money?  My first intuition was that it makes no difference. I do not get any new information after I opened the first box. I didn't now before how much $x$ was and now I also do not know whether the amount of money $y$ I found is $y=x$ or $y=2x$. So on average I should always get the same amount, namely $1.5x$.  What got me thinking was the following: Let's say I find $y$ Dollar in Box 1. If I change to box 2, I either get $2y$ Dollar or $y/2$ Dollar. Both events can happen with probability $1/2$, so on average I get $5/4 y$ Dollar, if I switch. This result would suggest that switching is better, because without switching I always end up with $y$ Dollars!  At first, this problem looked similar to the Monty Hall problem. But in the Monty Hall problem I actually get new information after I picked the first door, because one "goat door" is opened. In the box problem, however, I do not learn anything new.  So, what is the best strategy?

Suppose you're given two envelopes. Both envelopes have money in them, and you're told that one envelope has twice as much money as the other. Suppose you pick one of the envelopes. Should you switch to the other one?  Intuitively, you don't know anything about either envelope, so it'd be ridiculous to say that you should switch to the other envelope to maximize your expected money.   However, consider this argument. Let $x$ be the amount of money in the envelope you picked. If $y$ is the amount of money in the other envelope, then the expected value equals  $$E(y) = \frac{1}{2}\left(\frac{1}{2}x\right) + \frac{1}{2}\left(2x\right) = \frac{5}{4} x$$  But $5x/4 > x$, so you should switch!    The Wikipedia article says that $x$ stands for two different things, so this reasoning doesn't work. I say this is not a valid resolution.   Consider opening up the envelope that you pick, and finding $\$10$ inside. Then you can run the expected value calculation to get $$E(y) = \frac{1}{2} \cdot \$5+\frac{1}{2} \cdot \$20 = \$12.50$$  This means that if you open one of the envelopes and find $\$10$, you should switch to the other envelope. The $\$10$ doesn't stand for two different things, it literally just means $\$10$.   But you don't have to open up the envelope to run this calculation, you can just imagine what's inside, and run the calculation based on that. This is what "Let $x$ be the amount in the envelope" means. The problem with the argument is not that $x$ stands for two different things.   So what is the problem?    Previous questions on stack exchange have given the resolution that I just said I wasn't satisfied by, so please don't mark this as a duplicate. I want a different resolution, or a more satisfying explanation of why $x$ does stand for two different things.  Apparently there is still research being published about this problem - maybe it isn't so obvious?    I think there's something subtle wrong with the premise. Because there's no uniform probability distribution on $\mathbb{R}$, statements like "random real number" are not well-defined. Likewise, I think "one envelope has twice as much money as the other" assumes some probability distribution on $\mathbb{R}$, and perhaps our expected value calculation assumes that this distribution is uniform, which it cannot be ...


Why I can not use this instance?      class MainClass     {          List<int> d = new List<int> (5);         // d[0] error         public static void Main (string[] args)         {             // d[0] error          }     }   Why I can not use this object?

Consider:  namespace WindowsApplication1 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }          private void button1_Click(object sender, EventArgs e)         {             //int[] val = { 0, 0};             int val;             if (textBox1.Text == "")             {                 MessageBox.Show("Input any no");             }             else             {                 val = Convert.ToInt32(textBox1.Text);                 Thread ot1 = new Thread(new ParameterizedThreadStart(SumData));                 ot1.Start(val);             }         }          private static void ReadData(object state)         {             System.Windows.Forms.Application.Run();         }          void setTextboxText(int result)         {             if (this.InvokeRequired)             {                 this.Invoke(new IntDelegate(SetTextboxTextSafe), new object[] { result });             }             else             {                 SetTextboxTextSafe(result);             }         }          void SetTextboxTextSafe(int result)         {             label1.Text = result.ToString();         }          private static void SumData(object state)         {             int result;             //int[] icount = (int[])state;             int icount = (int)state;              for (int i = icount; i > 0; i--)             {                 result += i;                 System.Threading.Thread.Sleep(1000);             }             setTextboxText(result);         }          delegate void IntDelegate(int result);          private void button2_Click(object sender, EventArgs e)         {             Application.Exit();         }     } }   Why is this error occurring?     An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.setTextboxText(int)


I'm using the SE iOS app version 1.3.0.  This morning I woke up and checked the app.  It showed a red popup with "3" in the notification tray.  One was a comment so I went to it.  That should have cleared the "3" from the tray, but I noticed that whenever I closed the app and went back into it, the notification tray kept showing "3".  Even after I force closed the app and relaunched it, it still showed "3" in the notification tray.  Finally I went to SE on a desktop PC and clicked on the notification tray there.  Then I went back to the iOS app and the notification tray finally didn't show "3" anymore.

In the iPad app the inbox shows unread notifications as a badge. When you tap on the icon a list pops up with the unread notices subtly highlighted in light blue. After you tap on one of the notices the icon badge and blue highlight disappear... Until today.  Now the highlight does not reset, and the inbox icon badge reappears with the same number a few minutes later.  It's worth noting that all the notifications I'm seeing are old ones from a few days ago that I had already read.  On the web interface the badge is absent but the 'unread' highlight is visible.  After visiting the inbox on the web, the iPad is back to "normal" for now. The badge and blue highlighting is gone.


Wikipedia says that, but doesn't give any explanations.     The non-inverting input of the operational amplifier needs a path for DC to ground; if the signal source does not supply a DC path, or if that source requires a given load impedance, then the circuit will require another resistor from the non-inverting input to ground. When the operational amplifier's input bias currents are significant, then the DC source resistances driving the inputs should be balanced. The ideal value for the feedback resistors (to give minimum offset voltage) will be such that the two resistances in parallel roughly equal the resistance to ground at the non-inverting input pin. That ideal value assumes the bias currents are well-matched, which may not be true for all op-amps.   As far as I've concerned, it says just like it really must have this path in case the signal source does not supply a DC path. Then, it says about a consequence of making this path such as bias current which produce extra input offset voltage and so on.  Some people say the input does need to have DC path to ground. They say in case there is no path to ground and the non-inverting pin "hang in the air" for some unwanted unexpected reasons, the op-amp may go into saturation or something like this.  Other people say it doesn't need for the input to have this path. Opinions divided.  What do you think?  UPD: Added the schematic to avoid misunderstood. The schematics a little bit differs from the schematic in the question  So then maybe my question is not duplicated...?          – Schematic created using   The values of R2 and R4 (as well as value R1, though) are default cause they don't matter in this scope. We discuss the role of R1.  UPD:  I've found out one more opinion that seemed for me to be suitable.  They say, that this resistor (R1) can help to attenuate some noise which source has large internal impedance. Source of noise and this resistor forms some kind of voltage divider and this divider attenuates the noise significantly.   It seemed to be possible explanation.

In the circuit diagram below, why is there a 100KΩ resistor (NOT R2) connected to the capacitor? To my understanding the capacitor-resistor act as a high pass filter to block the DC offset of the microphone, but since only the capacitor blocks DC why is the 100k resistor used? According to the author of the video (link below) he said, the 100k is used "not to overload the microphone's un-amplified output". I don't get this part.  Also, can only a capacitor be used in this circuit or any other circuit without the 100k resistor?


I'm just starting with MySQL (version 5.7.20 on Xubuntu 16.04), and in playing around with it I changed the root password.  Now I can't log in as root -- I either forgot the password or didn't set it to what I thought I did.  This is my home hobby system, so I'm the only user.  I may as well start over.  But it's not clear to me how to do that.  On Ubuntu there are about 9 or 10 mySQL packages involved, and I'm not sure I can uninstall all of them cleanly.  I'm happy to just trash the database if I only knew the commands to start with a new one.  I could use some advice, preferably from someone who knows how it works on Ubuntu and it's variants, as these packages are managed by Canonical and are not necessarily like even the Debian ones.

I have installed mysql 5.7 on a Red Hat Enterprise Linux 5.5 server and when I tried to run following command after installation it is asking for a password for root@localhost.  /usr/bin/mysql_secure_installation   I have never set a root password and I'm logged in to Linux as root user.  Then I have found following documentation for resetting root password and followed that one too.    But even after starting the server with following command it is asking for a password  /etc/init.d/mysqld start --skip-grant-tables &   I have tried starting the server with init-file option, but no success.  Does anyone know how to reset the password correctly or default MySQL password?


Every search I have done for this, the answer involves \bar or \overline but those are math mode and thus result in the math font being used, which often differs from the main text font.  Ēostre - note the E has a bar over it. A Pagan Goddess. If I use math mode then the upper case E is a different font than the ostre which is typographically wrong.  How, using TeXLive with pdflatex compiler, so I add a horizontal bar over a latin letter without using math mode?  Thank you for suggestions.

I need to cite the journal "Sankhyā: The Indian Journal of Statistics" in a paper.  I would like to draw the ā character properly (i.e., I'd prefer, if possible, to avoid using some hack, such as \bar or \overline).  Question: How do I properly write ā in LaTeX?  I didn't have luck with  (after several attempts in both in capital and lowercase) nor The Comprehensive LATEX Symbol List (searching the file for "ā" and "india" revealed no hits).


I would to write the words of a song (for example "Immensamente" of the singer-songwriter Umberto Tozzi) with a typewriter font, with manual hyphenation, but the top should adopt either a mathematical mode or write the text and chords on different lines or use some packages that I don't know. I always hope that exists a package that can directly write the chords over the text including eventually the hyphenation. I have seen this question/answer of the user @Steven B. Segletes  that I have adapted with this MWE: \documentclass{article} \usepackage{stackengine} \usepackage{parskip} \usepackage{lmodern} \renewcommand*\familydefault{\ttdefault} \usepackage[T1]{fontenc} \begin{document}  In \stackanchor{\small \textbf{DO}}{me}, immensamente in me\\ \stackanchor{\small \textbf{LA}}{La} notte si è appena spenta\\ E sono qui senza di te\\ Più te ne vai\\ E più ti sento\\ Più non ci sei\\  \end{document}  with this screeshot:  that it is not very similar to the this picture:  My questions are:   How to have the whole words aligned? For example "me" is not aligned     How to have a strong bold of DO (for example)?   Better fonts to use, or other alternatives code/packages, and a longer line spacing to optimally insert chords are welcome. I hope my question isn't a bad one because I mentioned my favorite singer. 😄😄😄 I have seen also an old link of an user  with an MWE taken from this link , and that I add, \begin{filecontents*}{tabs.txt} A,X02220:001230 C#sus4,4:XX3341 Bb,X13331:012341 D,X00230:000123 E,022100:023100 F,133211:134211     \end{filecontents*}      \documentclass{book}     \usepackage{xparse}     \usepackage{songs}     \ExplSyntaxOn     \ior_new:N \g_fedelibre_get_tabs_ior     \prop_new:N \g_fedelibre_tabs_prop      \cs_new_protected:Npn \fedelibre_add_to_prop:w #1,#2!!      {       \prop_gput:Nnn \g_fedelibre_tabs_prop {#1} {#2}      }     \ior_open:Nn \g_fedelibre_get_tabs_ior {tabs.txt}      \ior_str_map_inline:Nn \g_fedelibre_get_tabs_ior      {       \fedelibre_add_to_prop:w #1!!      }      \DeclareDocumentCommand{ \fedetab }{ v }      {       \prop_get:NnNTF \g_fedelibre_tabs_prop {#1} \l_tmpa_tl        {         \fedelibre_gtab:nV {#1} \l_tmpa_tl        }        {         \msg_term:n {Maybe~ you~ have~ mispelled~ your~ tab!}        }      }     \cs_set_eq:NN \fedelibre_gtab:nn \gtab     \cs_generate_variant:Nn \fedelibre_gtab:nn { nV }     \ExplSyntaxOff       \begin{document}     \begin{songs}{}     \beginsong{First Song}     \beginverse     \[A]Sed ut perspiciatis \[E]unde omnis iste \[Bb]natus error     \[E] sit voluptatem \[A]accusantium doloremque \[Bb]laudantium     \endverse     \beginverse     \[A]Quis autem vel eum iure \[E]reprehenderit qui \[Bb] in ea      \[E]voluptate velit esse \[A]quam nihil molestiae \[Bb]consequatur     \endverse     \endsong      \beginsong{Second Song}     \beginverse     \[A]Sed ut perspiciatis \[D]unde omnis iste \[Bb]natus error     \[E] sit voluptatem \[F]accusantium doloremque \[A]laudantium     \endverse     \beginverse     \[D]Quis autem vel eum iure \[E]reprehenderit qui \[Bb] in ea      \[F]voluptate velit esse \[D]quam nihil molestiae \[Bb]consequatur     \endverse     \endsong      \end{songs}     % need code here to extract the list of all chords in the songbook     % that contains more than 300 songs     % with that list, I need the unique occurence of chords     % then proceed to print each chord with \fedetab     %for \fedetab info see this thread     % http://tex.stackexchange.com/questions/151004/songs-package-how-to-store-gtab-definitions-in-an-external-file/151102     {\bfseries\Large Chords used in the Songbook A  Bb  D  E  F}     \newline     \newline     \fedetab{A}  \fedetab{Bb} \fedetab{D} \fedetab{E} \fedetab{F}      \end{document}

I currently making a songbook and thus I want to display chords above lyrics. I have found several packages but I want to improve my TeXing skills so I wrote everything from scratch.  Until now, everything works fine apart from one thing: some chords are too long and overlaps with the next one.  I have some way to do it, by explaining each time what text correspond to each chord (see the second part of the minimal example) but it would mean rewriting all song I already have. So I wanted to know if there was a way to automatically add space when needed, without having to specify which text correspond to which chord!  Here is a minimal example (the whole code is much longer but I don't think it's needed here):  \documentclass{article}  \def\ch#1{%   \leavevmode\hbox to 0pt{\vbox{\hbox{\strut\tt#1}\kern.25cm}\hss}% }  \begin{document}   \parskip.15cm    \ch{A}Lorem ipsum \ch{B}dolor sit amet, \ch{C}consectetuer \ch{D}adipiscing elit.    \ch{A}Ut purus elit, vesti\ch{B}bulum \ch{C}ut, placerat ac, adipiscing vitae, \ch{D}felis.    \ch{A}Curabi\ch{B7sus4}tur \ch{C}dictum \ch{D7sus4}gravi\ch{E}da mauris.    \bigskip   \textit{I would want to have something that look like this:}\par   \def\foo#1#2{%     \leavevmode\vbox{\hbox{\strut\tt#1 }\hbox{#2}}%   }   \foo{A}{Curabi}\foo{B7sus4}{tur} \foo{C}{dictum}  \foo{D7sus4}{gravi}\foo{E}{da mauris}.  \end{document}   which gives   Note: I know that this might not be possible on justified multi-line paragraph, but we only have flushed/centered paragraph here (or even single lines), so the space between words should be fixed (I guess?).


i'm 20 years old, i am currently in my second year of study in the university in Algeria, i want to apply for General English courses in Liverpool school of English for 2 weeks so i need to apply for Short-term Student Visa but i have problem in financial requirements i need to seek advice for you please:   I have a bank account in my name with (1500£) plus fees of accomondation and application fees. My mother is a teacher for 3 years (200£ per month) and she has only savings account she has no bank account. My father is a retired teacher for more than 7 years (250£ per month) and he has no bank account or any account only post office account from where he get paid. My brother has a professional commercial Bank account in his name he was receiving a lots of money on it, he has a commercial register and everything but right now he has no money in his account for a bout 5 months he didn't received money on it.   My questions is : what should I put in my application for financial documents, should I put payslips for my parents or open bank accounts for them and make them my official sponsor, or should I extract my money from my bank account and put it in my brother's account and make him my sponsor or what to do please?  Thank you for advance!

The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled "other documents you may want to provide" (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is "bank statements" and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning "for example"; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me?


Is there any way to work normally with strings that can conatain "\0"? For example:  std::string a("abc\0def"); std::cout << a.length();   this produces output:   3   I understand that \0 is used in C to signal the end of an array of chars, but I didn't think it would work like this in c++ as well? I haven't been able to find this explained in detail anywhere.

If I want to construct a std::string with a line like:  std::string my_string("a\0b");   Where i want to have three characters in the resulting string (a, null, b), I only get one.  What is the proper syntax?


For some reason, the following code gives the error Symbol 'TemplateBase' could not be resolved.:  template <typename T> class TemplateBase {     TemplateBase(std::map<std::string, T>::const_iterator anIterator)     { } };  class SubClass : public TemplateBase<int> {     SubClass(std::map<std::string, int>::const_iterator anIterator) :         TemplateBase<int>(anIterator) //Error: Symbol 'TemplateBase' could not be resolved.     { } };   Strangely, no error appears when I remove the ::const_iterator and only std::map<std::string, int> remains:  template <typename T> class TemplateBase {     TemplateBase(std::map<std::string, T> aMap)     { } };  class SubClass : public TemplateBase<int> {     SubClass(std::map<std::string, int> aMap) :         TemplateBase<int>(aMap) //No error.     { } };   Additionally, the following function gives no error either, so it really seems related to the combination of a template base class call with a const_iterator:  void function() {     std::map<std::string, int>::const_iterator anIterator;     TemplateBase<int> aTemplateBase(anIterator); //No error }   Is there some rule against using const_iterator as an argument for base class template constructors that I'm unaware of? Or is this a compiler bug?  I'm compiling with MinGW 64bit 4.9.0 on Windows 7, using C++11.

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


This  spells out when to declare a type as a value type (struct) vs a reference type (class).  In particular, it says:     AVOID defining a struct unless the type has all of the following characteristics:         It logically represents a single value, similar to primitive types (int, double, etc.).   It has an instance size under 16 bytes.   It is immutable.   It will not have to be boxed frequently.         In all other cases, you should define your types as classes.   Then,  spells out some guidelines for overriding Object.Equals() on a type, including:     When a type is immutable, ... overloading operator == to compare value equality instead of reference equality can be useful because, as immutable objects, they can be considered the same as long as they have the same value. It is not a good idea to override operator == in non-immutable types.   So it seems to me, if a type is meant to be immutable, you would just declare it a struct and override ValueType.Equals().  But, if your type is declared a class, you only want reference semantics, in theory.   seems to support that.  So my question is, why would you ever bother overriding Equals() on a reference type?  Doing so is like saying that reference semantics aren't good enough for your reference type, which makes no sense to me.  The only example I can think of is if you have a large (>16 byte instances) class that has a mix of mutable and immutable fields, but even then it seems like reference semantics would be all you need.

I came across this recently, up until now I have been happily overriding the equality operator (==) and/or Equals method in order to see if two references types actually contained the same data (i.e. two different instances that look the same). I have been using this even more since I have been getting more in to automated testing (comparing reference/expected data against that returned). While looking over some of the  I came across an  that advises against it. Now I understand why the article is saying this (because they are not the same instance) but it does not answer the question:  What is the best way to compare two reference types? Should we implement ? (I have also seen mention that this should be reserved for value types only). Is there some interface I don't know about? Should we just roll our own?!  Many Thanks ^_^ Update Looks like I had mis-read some of the documentation (it's been a long day) and overriding  may be the way to go..  If you are implementing reference types, you should consider overriding the Equals method on a reference type if your type looks like a base type such as a Point, String, BigNumber, and so on. Most reference types should not overload the equality operator, even if they override Equals. However, if you are implementing a reference type that is intended to have value semantics, such as a complex number type, you should override the equality operator.


My ArrayList has been initialized, as you can see from the below code, but I am still getting a null object reference error.  String name; int health; int stamina; int magic; int strength; Integer picture; Integer croppedPicture; static ArrayList<item> treasures = new ArrayList<>();  public item(String name, int health, int stamina, int magic, int strength, Integer picture, Integer croppedPicture, ArrayList<item> treasures){     this.name = name;     this.health = health;     this.stamina = stamina;     this.strength = strength;     this.magic = magic;     this.picture = picture;     this.treasures = treasures;     this.croppedPicture = croppedPicture; }  static item[] adventurers = {new item("Forhum", 100, 5, 5, 20,R.drawable.forhum,R.drawable.forhum_cropped, treasures),         new item("Triton", 100, 5, 5, 20,R.drawable.triton, R.drawable.triton_cropped, treasures),         new item("Meravan", 100, 5, 5, 20,R.drawable.meravan, R.drawable.meravan_cropped, treasures)};  static item[] treasureList = {new item("Ring of Health", 10, 0, 0, 0, R.drawable.ring_of_health, null, null),     new item("Ring of Stamina", 0, 5, 0,0, R.drawable.stam_green, null, null),     new item("Ring of Strength", 0,0,0,5, R.drawable.ring_of_strength, null, null),     new item("Cup of Magic", 0,0,4,0, R.drawable.cup_of_magic, null, null),     new item("Invisible Necklace", 0,0,0,0, null, null, null),     new item("Necklace of Harming", -10, 0,0,0, R.drawable.necklace, null, null)};  public String getName(){     return name; }  public int getHealth(){     return health; }  public int getMagic() {     return magic; }  public int getStamina() {     return stamina; }  public int getStrength() {     return strength; }  public ArrayList<item> getTreasures() {     return treasures; }  public void setHealth(int health) {     this.health = health; }  public void setMagic(int magic) {     this.magic = magic; }  public int getPicture() {     return picture; }  public void setTreasures(int treasure) {     treasures.add(treasureList[treasure]); }  public Integer getCroppedPicture() {     return croppedPicture; }   It is getting the int from a combat class using this method:      public void turn(){        setText();        if(monsterHealth > 0) {           if (monsterMagic >= 5) {             monsterUseMagic();             setText();           } else {             monsterAttack();             setText();           }           if(item.adventurers[personNumber].getHealth() > 0) {             item.adventurers[personNumber].setMagic(item.adventurers[personNumber].getMagic() + 1);             monsterMagic++;             setText();           }           else{             died();           }        }        else {           Intent won = new Intent(this, itemSelect.class);           int treasure = rand.nextInt(6);           int view = 2;           won.putExtra("view", view);           won.putExtra("thing", treasure);;           item.adventurers[personNumber].setTreasures(treasure);           startActivity(won);        }   }   This is the error that I am getting.  2019-10-17 18:20:21.903 7907-7907/com.example.treasurehunt E/AndroidRuntime: FATAL EXCEPTION: main  Process: com.example.treasurehunt, PID: 7907  java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.add(java.lang.Object)' on a null object reference      at com.example.treasurehunt.item.setTreasures(item.java:75)      at com.example.treasurehunt.CombatScreen.turn(CombatScreen.java:118)   There is a lot more to the program that I" am making, but none of it pertains to this error. Any help is appreciated. Thanks in advance.

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 was using Ubuntu GNOME for years and I just tried new Ubuntu 17.10, and I absolutely hate it. Is there an easy way to get default GNOME?   Basically I want to:   Remove dock on the left Add top left hot corner Adwaita Theme

Some people (me) would prefer the straight GNOME experience as opposed to the Unity style desktop offered in Ubuntu 17.10.  How can I get the standard GNOME desktop and interface?


We talk about infinity (denoted with symbol $\infty$) when talking about the real numbers. For example the intervals $(-\infty, a]$, $[b, \infty)$. I guess $\infty$ can be understood to be the point added to $\mathbb{R}$ when doing the one point compactification, but then $-\infty = \infty$ (?).  Is it some ordinal number and if yes, what?  To my understanding, the point $\infty$ is just a symbol and can be like what ever, just a point that gets added. But is there a way to make a connection with the ordinal arithmetic? It could be $\omega$ (the countable infinity) since that is larger than any natural number and hence larger than any real number, but how about all the rest real numbers, what ordinal numbers are they? Then again, I think it should be the ordinal of continuum ($\cal{P}(\mathbb{N})$??). I sense this has something to do with well-ordering.  How about when we deal with limits of type $x\to \infty$, is there some ordinal stuff that applies there, or are these two realms ($\mathbb{R}$ and the ordinal numbers) completely separate?

For example, when we write $\lim_{x\rightarrow \infty} f(x)$ - which infinity is meant and why? Countable? If uncountable - which and why?


Let $f:\mathbb R\to\mathbb R$ differentiable such that $f(0)=0$ and $f'(x)=[f(x)]^2$ for all $x\in\mathbb R$. Prove that $f(x)=0$ for all $x\in\mathbb R$.   My thoughts:   Suppose, to the contrary, that $\exists a\in\mathbb R$ such that $f(a)\neq 0$. Assume $f(a)>0$ $\left(f(a)<0 \mbox{ is analogous}\right)$. Hence, $f'(a)>0$ and therefore there is $\delta>0$ such that $x\in\mathbb R$ and $a<x<a+\delta$ implies $0<f(a)<f(x)$. Thus $f(x)\neq 0$ for all $x\in(a,a+\delta)$. We have that $\dfrac{1}{f},h:(a,a+\delta)\to\mathbb R$ given by $h(x)=-x$ are primitives of the function $t(x)=-1$, $x\in(a,a+\delta)$ since $$ \left(\frac{1}{f}\right)'(x)=\frac{-f'(x)}{f^2(x)}=\frac{-f^2(x)}{f^2(x)}=-1. $$ and $h'(x)=-1,\; \forall x\in(a,a+\delta)$. Since primitives differ by a constant, it follows that $$ \frac{1}{f(x)}-h(x)= C \Longrightarrow f(x)=\frac{1}{-x+C},\quad C\in\mathbb R. $$  I stop here. My attempt was to be able to evaluate $f(0)=\frac{1}{C}\neq 0$, which would give a contradiction, but my function is defined only in $(a,a+\delta)$.

Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function such that $f(0) = 0$ and $f'(x) = [f(x)]^{2}$, $\forall x \in \mathbb{R}$. Show that $f(x) = 0$,  $\forall x \in \mathbb{R} $.  I first (unsuccessfully) tried using the Mean Value Theorem, but this is in the Integrals chapter so the solution probably involves them. Can't really see where integrals come in here though.  What I've got so far:   (i) Since $f$ is differentiable, thus it is continuous and, hence,  integrable. Therefore $f^2$ is also integrable and as $f'=f^2$, $f'$ is too.   (ii) $f' \geq 0$, $\forall x \in \mathbb{R}$


Some "non-continuous" verbs such as to be, to have, to own, to see, to   hear, to need, to want... can not be used with continuous tenses ()      He is needing help now. Not Correct      He needs help now. Correct      He is wanting a drink now. Not Correct      He wants a drink now. Correct      We use the Simple Present to express the idea that an action (that is   expressed by non-continuous verbs) is happening or is not happening   now. ()      I am here now.      She is not here now.      He needs help right now.      (v) [intransitive] to feel painful   My feet hurt.   I seldom hear people say "My feet is hurting."  And if "hurt" is a normal verb (can be used with continuous tense) people should say "My feet is hurting." to express a temporary action. But if "hurt" is a normal verb & if they say "My feet hurt.", then it sounds like "My feet hurt regularly.".  is the verb "hurt (v): [intransitive] to feel painful" a non-continuous verb?   I would say "(v) [intransitive] to feel painful" is a non-continuous verb but I am not sure

Once in a while I hear someone use the phrase I am hurting.  It appears to mean I am hurt, not I am hurting you.  For example, consider the text on this drawing:    When and why is it correct to say I'm hurting in the meaning of I'm hurt?  Is there any difference in meaning?


In the Stack Overflow community I see many questions related to MATLAB programs. I use both it and Mathematica for work, and I see that Mathematica has a separate community for its questions, that are always related to solve a problem with it or to do something with it.  Considering that MATLAB is a specific program, like Mathematica, Joomla, Drupal and so on, it can be useful to create a new community for it, or it's better to continue to ask questions of Stack Overflow community?

I have an idea or subject that should have a Q&A, and want to propose a new site. How can I do this?  Related:


I started installing Ubuntu with unetbooting then I got so excited about the install that I forgot my charger wasn't plugged in, then my pc died, immediately I plugged it in and switched it on it showed me up as usual then moves to a dark screen (not purple Ubuntu screen) that has a cursor at the top left corner that blinks infinitely it's been blinking for the past hour now please help. I'VE got really important projects to do. Pleaaaaaaseeeee help me.

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:


Is there any way to apply array modifier but with making each object separated and with right origin straight away? Here is the problem. Each my object (flower) contains different parts (petals, stem etc) which are not connected. So if I apply modifier and then do 'Separate by Loose Parts' it divides not my flowers but each part of it. And also I loose origin point. So I need to join together all parts of the flower and set origin point as well for each. And I have about 30 flowers so it's not very effective at all... So I hope anyone can tell me better and faster way. Thanks!

I have been looking for methods to create a set of objects from an Array Modifier. Normally one creates an Array, sets an Array Offset and manipulates it so that the transformation propagates to all the copies and most of the times the goal is to have a geometry as you don't care about the sub-parts own transforms but I do this time since my goal is to export these (empty in my case) transforms to a game engine. To expand a bit, I already know that I can Apply the modifier and then separate the meshes By Loose Parts but it's not what I want and the reason for that is that with that method, such loose parts will inherit all the same rotation and scale from the original object; in fact the matrix of the single copy of the array is lost when applying the array. My question is slightly different from this one:  in that I need the individual rotations and scales to be kept. What I need ideally is a workflow to go from an Array Modifier (but potentially parting ways from the Array Modifier) to create a big set (big enough to discourage manual duplication) of empty objects that keep their individual position, rotation and scale. How can I achieve that?


Evaluate:   $$0^0$$   Would you use this law of indices?     $$x^0=1$$   Or would you use that:     $$\frac{x^n}{x^n}=x^0$$ which would mean $$\frac{0}{0}=undefined$$

I have been a witness to many a discussion about numbers to the power of zero, but I have never really been sold on any claims or explanations.  This is a three part question, the parts are as follows...    1) Why does $n^{0}=1$ when $n\neq 0$?  How does that get defined?  2) What is $0^{0}$?  Is it undefined?  If so, why does it not equal 1?  3) What is the equation that defines exponents?  I can easily write a small program to do it (see below), but what about in equation format?    I just want a little discussion about numbers to the power of zero, for some clarification.    Code for Exponents: (pseudo-code/Ruby)  def int find_exp (int x, int n){     int total = 1;     n.times{total*=x}     return total; }


Is reflection of light from a smooth surface because of absorbtion and reemission of photons by surface matter? Or is it just wrong to ask this kind of a question because of wave and partical duality of light?

What really is ? Is it just the reemission of EMR? I asked my teacher, he said in quantum sense, it is true. But when I read something about emissivity in Stefan Boltzmann's equation, it states that if an object reflects most light, then it absorbs and reemits less. So what it said means reflection and absorption and reemission are different concepts.


I've been having trouble adding my own custom font my game, and was wondering why libgdx doesn't like drawing my new stage i've set up once my class is called?  The class is called whenever an item intersects with another and the main class calls this class's .render() method.  I want it to draw the string "game over" to the screen, however i am getting an error at stage.act(delta):  Exception in thread "LWJGL Application" java.lang.NullPointerException     at com.mygdx.game.GameOverScreen.render(GameOverScreen.java:70)     at com.mygdx.game.MyGdxGame.render(MyGdxGame.java:191)     at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:214)     at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)   Here is my code:  class GameOverScreen implements Screen {     Label gameoverstring;      private Stage stage;     SpriteBatch spritebatch;      BitmapFont white;     LabelStyle headingStyle;      @Override     public void show() {         stage = new Stage();         white = new BitmapFont(Gdx.files.internal("new.fnt"), false);         headingStyle = new LabelStyle(white, Color.WHITE);          gameoverstring = new Label("game ovaaaa!", headingStyle);         gameoverstring.setFontScale(3);         stage.addActor(gameoverstring);     }      @Override     public void render(float delta) {         //gameoverstring.setPosition(0, 0);         Gdx.gl.glClearColor(0, 0, 0, 1);         Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);         stage.act(delta);         stage.draw();     }      @Override     public void resize(int width, int height) {     }      @Override     public void pause() {     }      @Override     public void resume() {     }      @Override     public void hide() {     }      @Override     public void dispose() {     } }

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?


This question is similar to , but in my case I want to include the last element of the each previous sub-list, as the first element in the next sub-list. And have to take into account that the last element have always to have at least two elements.  For example:  list_ = ['a','b','c','d','e','f','g','h']   The result for a size 3 sub-list:  resultant_list = [['a','b','c'],['c','d','e'],['e','f','g'],['g','h']]

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


Let $$ f(x) = \begin{cases} 1 & \text{if } x=0\\ \frac{1}{q} &  \text{if } x = \frac{p}{q} \ \text{with } \gcd(p,q) = 1\\ 0 &  \text{if } x\in\Bbb{R}\setminus\Bbb{Q} \end{cases} $$ Find where $f$   is continuous.   So as the rationals are dense in the irrationals, and the irrationals are dense in the rationals, I believe that the function $f$ is nowhere continuous. Is this correct, and if so, how do you formally prove that (with $\varepsilon$-$\delta$ definition of continuity)?  Edit: @SpamIAm has pointed out that the function in fact is continuous at all irrationals. I would like to see a proof of that.

Consider the function:  $f(x)= \begin{cases}  1/n \quad &\text{if $x= m/n$ in simplest form} \\ 0 \quad &\text{if $x \in \mathbb{R}\setminus\mathbb{Q}$}  \end{cases} $  Prove that the function is continuous at every irrational point and also that the function is not continuous at every rational point.  Also, we can say that the function is continuous at some point $k$ if $\displaystyle\lim_{x \to k} f(x)=f(k)$.  I was thinking of doing an epsilon delta proof backwards using the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$ for rational points and irrational points.  Any ways on how to expand on this are welcome.


When given a binary in a terminal, you can launch it via  sh myapp   or  ./myapp   Are there any other ways to launch the app? Is there any difference between sh and ./ ? What do they denote/stand for?

Have a look at the code:  #!/bin/bash read -p "Eneter 1 for UID and 2 for LOGNAME" choice if [ $choice -eq 1 ] then         read -p "Enter UID:  " uid         logname=`cat /etc/passwd | grep $uid | cut -f1 -d:` else         read -p "Enter Logname:  " logname fi not=`ps -au$logname | grep -c bash` echo  "The number of terminals opened by $logname are $not"   This code is used to find out the number of terminals opened by a user on the same PC. Now there are two users logged on, say x and y. I am currently logged in as y and there are 3 terminals open in user x. If I execute this code in y using different ways as mentioned above the results are :  $ ./file.sh The number of terminals opened by x are 3  $ bash file.sh The number of terminals opened by x are 5  $ sh file.sh The number of terminals opened by x are 3  $ source file.sh The number of terminals opened by x are 4  $ . ./file.sh The number of terminals opened by x are 4   Note: I passed 1 and uid 1000 to all these executables.  Now can you please explain the differences among all these?