I have created a form in PHP and MySQL. After submitting the data, it is saved into the MySQL table. But I have got a problem: If the form contains an apostrophe then there will be an error while inserting the data, so how can i remove the apostrophe from the post variable?  $description=$_POST['description'];
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?
Derivative of function with 2 variables I've leart in Calculus 1 that the derivetive of $f(x)$ is:  $$\lim_{h\to0} \frac{f(x+h) - f(x)}{h}$$.  suppose $f(x,y)$ is a function with 2 variables,  does $$f'(x,y) = \lim_{h\to0} \frac{f(x+h, y+h) - f(x,y)}{h}$$ ?  If not , what is the derivetive of function with 2 variables? How do you measure pedal axle/spindle size?  Replacement pedals and accessories specify a size like 9/16" or 1/2".  How do I measure my current pedal to see what I need?  Is it just a matter of putting the pedal threads in a caliper and measuring the outer diameter of the threads across the axle/spindle?  Or do you need to measure the solid part, excluding the threads? Facebook OAuth Data Capturing Is there an easy way to tell if a graph can be embedded on a Möbius strip (with no edges crossing)?  A specific version of this: if a simple graph with an odd number of vertices has all vertices of degree 4, can it be embedded on a Möbius strip?    Answer summary:   There are  for the Möbius strip that are   and drawn on . There are  for the Möbius strip, they are , and even better there are only .   I have not yet answered the second question, but Jim Belk's excellent explanation has given me good ideas. Removing file / folder link after using "Save As..." then "Web Page, complete" When you right-click save-as a web page in FF, the page is saved along with a folder containing any associated media that page needs (images, js, etc).  My problem is that I want to reorganise the associated media folder, but wherever I move this folder, the saved .html file is moved as well. ARGH!   I can rename each folder, which breaks the "link" between html file and media folder, but there must be a cleaner way to do it. Does anyone else know? Grant Select on a view not base table when base table is in a different database I have a view which is selecting rows from a table in a different database.  I'd like to grant select access to the view, but not direct access to the base table.  The view has a where clause restricting the number of rows.  Can I grant select to the view and not the base table, or do I need to switch to a stored procedure? I would rather not do it the latter way. Calculating projected area of polygons with field calculator in ArcMap? Imaginary line on the Earth is straight or not? I was watching Google map. Saw a line which is joinging north to south pole. It is going between middle of China and Mexico. But, the line is not straight. Tried to search in net but not able to get anything. Can anyone check and let me know  or "thanks for flagging" popup gets messed up when the comment is automatically deleted For some comments, the comment is automatically deleted when you raise a flag. This includes certain keywords and short +1 comments. But when you raise that flag with the new comment flag interface, the "thanks for flagging" shows up in the top right when the comment is deleted:      As opposed to what happens when you raise a flag on a comment that doesn't auto-delete: 554 5.7.1 : Relay access denied centos postfix I have problem in send mail from postfix in centos  I have following  for sending mail but I am getting error.  As in the link I tried following commands  telnet localhost smtp  Trying ::1... Connected to localhost. Escape character is '^]'. 220 mydomain.com ESMTP Postfix ehlo localhost 250-mydomain.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:&lt;domain.com&gt; 250 2.1.0 Ok rcpt to:&lt;test@gmail.com&gt; 554 5.7.1 &lt;test@gmail.com&gt;: Relay access denied   Edit-1  In terminal this works  echo TEST | mail -v -s "Test mail" testing@gmail.com   my postconf -n shows belog information  alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = localhost inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = dummy.com myhostname = dummy.com mynetworks = all mynetworks_style = host myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550   What configuration I have to perform to send mails from my server. Let $V,W$ be nonzero normed spaces over $\mathbb{K}$ such that $V$ is finite-dimensional.  Let $E$ open in $\mathbb{K}$ and $p\in E$.  Let $f:E\rightarrow W$ be Gâteaux-differentiable at $p$.  Is $f$ necessarily Fréchet-differentiable at $p$ in this case?  I think this is not true in general, but cannot find a counterexample. What would be a counterexample? Show that $R/I\otimes_R R/J\cong R/(I+J)$ Let $R$ be a commutative ring with identity and $I$ and $J$ be ideals in $R$.     Show that $R/I\otimes_R R/J\cong R/(I+J)$ as $R$-modules.   This is what I tried.  Define a map $f:R/I\times R/J\to R/(I+J)$ as $f(\bar r, \bar s)=rs+(I+J)$. This is a well-defined bilinear map.  By the universal property of tensor products, we get an $R$-linear map $F:R/I\otimes_R R/J\to R/(I+J)$ which sends $\bar r\otimes \bar s$ to $rs+(I+J)$.  This map is surjective.  So all we need to show is that the kernel of $F$ is $0$.  But I am unable to do this. Change bounding box of math glyphs in LuaTeX I'm trying to use the Garamond-Math font in LuaTeX (despite the documentation saying I should use it with XeTeX only :-). It's working more or less OK with LuaTeX, except for some unfortunate glyph combinations, mostly at the end of inline math, such as “where $T$ is the period”.  I used \fbox to draw the bounding box of the glyph and noticed that the bounding boxes are different in LuaTeX:        and in XeTeX:        In XeTeX the glyph fits almost entirely in the bounding box, but in LuaTeX it overshoots far too much.  I'm not a font guy, so I have no idea why this happens. I thought the bounding box was a property of the font, so in my imagination the result should be the same. Thus the first question is: what actually happens that the bounding boxes are different?  The second question, in the title, is: can I change the bounding box of specific glyphs (using LuaTeX) so that the output looks more like XeTeX's?  I tried manually adding some spacing after the glyphs, but this looks hideous and will go down the drain if I happen to change the font or engine, so I'd really like not to do that. I also tried using the italic correction \/ but it seems to have no effect in math.  Here's the code to produce the pictures above:  \documentclass{standalone} \usepackage{unicode-math} \setmathfont{Garamond-Math.otf} \begin{document} \fboxrule=1sp \fboxsep=0pt In Lua\TeX{} this \fbox{$T$} looks horrible, but the \fbox{$X$} looks OK. \Huge\fbox{$T$}\quad. \end{document}   I'm using TL 2018:  This is LuaTeX, Version 1.07.0 (TeX Live 2018)  (format=lualatex 2019.3.29)  13 APR 2019 12:43  restricted system commands enabled. **test.tex (./test.tex LaTeX2e &lt;2018-12-01&gt; Lua module: luaotfload-main 2019-02-14 2.96 luaotfload entry point Getting disk i/o statistics for single process in Linux Birthday Problem applied to collisions I'm trying to extend the birthday problem to detect collision probability in a hashing scheme. Here is my problem. I use the letters and numbers [A-Z][a-z][0-9] to make a set of keys by randomly choosing from that set 10 times and concatenating them all together. So A24cv30kf2 could be one key for example. This implies that the base set has $62^{10}$ possible keys. Next, I want to compute the probability that I would see a collision if I picked a key from that set and issued it to $n$ users. If $M$ represents the size of the set (= $62^{10}$) and $P(M,n)$ the probability then  $$P(M,n) = \frac{M!}{M^{n}(M-n)!}$$  This follows by replacing 365 in the well known birthday problem shown   What I want to understand is the following: I want to check and see if my choice of concatenating 10 is right, when I know that my $n$ is of the order of a few millions and my $1 - P(M,n)$ needs to be less than 0.0001 or some small number. The large values of M &amp; n make the above intractable to compute. Is there an easier way to compute this? Adding Favorites to the Stack Exchange global inbox We're considering adding favorite notifications to the global inbox, and are looking for feedback on the idea (as we're not completely sold on it).  But first, some history.  Favorites are kind of like bookmarks, in that they're kept in a handy centralized place.  They also follow you across browsers.  Ok, ok... "bookmarks, on the internet" is not the most compelling feature, but Favorites also opted you into notices for those questions as if you were the owner (edits and new answers, at least).  This was probably the most confusing part (though a  feature) of the old envelope behavior judging by erroneous bug reports, so a way to opt out of this .  Now, favorite updates go nowhere.  But we could* put them into the inbox.  Here's how we envision this feature working:   Every current user has their "notify me on favorite changes" preference cleared (new users start with it cleared). The first time someone favorites a question, they're prompted to opt-in to favorite notices. Whenever a question is commented on or answered (or, possibly, edited) a new notice is pushed into the inbox of users who have favorited it, and have opted in.   Opt-in would be per-site, and it would remain possible to opt-out from your profile page.   This is not a final design, but the basic idea is correct  As I mentioned above, we're not 100% sold on this idea.  We've had a policy to date that nothing goes into the inbox that isn't specifically targeted at a user; this would be tweaking that policy.  *We could also put changes into their tab on the user page, but that reduces their visibility. What is the datatype of facebook userid How to disable the keyring for SSH and GPG? An example of the nucleus of an atom being in an excited state is the , which was a theory devised by the Astronomer Fred Hoyle to help describe the vast quantities of carbon-12 present in the universe, which wouldn't be possible without said Hoyle State.  It's easy to visualise and comprehend the excited states of electrons, because they exist on discrete energy levels that orbit the nucleus, so one can easily see how an electron can excite from one energy level into a higher one, hence making it excited.  However, I can't see how the nucleus can get into an excited state, because clearly, they don't exist on energy levels that they can transfer between, but instead it's just a 'ball' of protons and neutrons.  So how can the nucleus of an atom be excited? What makes it excited? BOOLEAN FUNCTIONS: generate a function $f: \{0, 1\}^n \rightarrow \{0, 1\}$ from a $n \times n$ S-Box I want to calculate the hamming weight of a S-Box using this formula: $\text{hw}(f) = \sum_{x=0}^{2^n-1} f(x)$. Where $f: \{0, 1\}^n \rightarrow \{0, 1\}$  My problem is that I don't know how to get the $f$-function.  I found that helpful paper: . At Page 9 (18) boolean functions are described. But she only prints the truth table (Table 2.1) without describing her $f$-function. She only says $f$ is a linear function, therefore I think $f$ depends on my S-Box?  For example, if I have this $2 \times 2$ S-Box:  0    1    2    3  1    3    0    2    $00 \rightarrow 01\\ 01  \rightarrow 11\\ 10  \rightarrow 00\\ 11  \rightarrow 10$  What are the $f$-functions and what is the hamming weight?