i am familiar with python and also familiar with mysql and SQL. I am also clear on con, cur and commit, but my problem here is that im trying to make a small program in python (no need for a gui) to insert data into a mysql database, and bring it on my console or file. I'm confused where to start, i tried seeking google but i couldn't find any toturials about my issue, any help? a link or where to start. Also:  i know the python program can be written in an IDE or a text file, but how does it connect to mysql database? if im wrong please correct me.
How do I connect to a MySQL database using a python program?
I want to know how EXACTLY the WPA password gets encrypted  I have been searching through and I was able to catch:   The actual password is converted to some hash Salting is applied to the hash The operation is not reversible The hash comes with the 4-way handshake   So what kind of hash is it converted? like, SHA1? MD5? and how the salting process is done? like, is the SSID appended to the password before the hashing operation?  Or maybe I have some misunderstanding here? Minecraft's got an "Open to LAN" feature, which can be used to set up a local server when two computers running Minecraft are on the same network. Some young relatives of mine use this to play together whenever they're in the same house, but they'd like to be able to play together from their respective residences.  A server is not optimal because it's a bit complex. I've tried using Tunngle to spoof that the computers are on the same connection to no avail.  How can I convince Minecraft's "Open to LAN" that their two separate computers are on the same network? Getting No module name exifread error from QGIS Photo2Shape plugin? Showing 2 Distributions are the Same Let $X_1, X_2, \dots$ be i.i.d. exponentially distributed RVs. For $n = 1,2,\dots$ consider: $Y_n := \max(X_1, X_2, \dots, X_n)$ $U_n := \sum_{i=1}^{n}\frac{X_i}{i}$ Show that $Y_n$ and $U_n$ have the same distribution   What I've tried: $P(Y_n&lt;y)= P(X_i&lt;y)^n = (1- e^{\lambda y})^n =&gt; P(Y_n=y) = n(1- e^{\lambda y})^{n-1}$ But I get stuck with $U_n$. I tried an MGF, $U_n$ evaluates nicely but then $Y_n$ gets messy. Any thoughts? What's the difference between Wubi and a regular "alongside Windows" installation? What are these stamps in my passport after I was advised to divert via the UK but didn't have a visa? I am from Myanmar. I was on my way to Venice from Brussels while holding Schengen visa (single entry). I bought a British Airways ticket to fly from Brussels to Venice. Unfortunately, on that day, all BA flights from Brussels were canceled. British Airway's customer service centre told me to go to from Brussels to London by train, where I could catch my flight to Venice. I took a taxi to Bruxelles-Midi train station and bought a ticket to London. A Brussels immigration officer inspected and approved my passport.   Then I had to to through UK Border Immigration. There, they said I can't enter to get my flight. Although I explained the situation with the airline and made clear of my destination (I already reserved my hotels in Venice, Switzerland and France as described in my travel itinerary), they detained me for some hours and also took my fingerprints on paper and photo.   They asked questions concerned about my finances and gave me a refusal letter for not having a transit visa. So I had to re-enter Brussels where the immigration officer put the below stamp in my passport. As I had a single entry Schengen visa, I had to buy another airline ticket to Venice and complete my Europe trip.   What do the stamps below mean on my passport?   Can they affect me and, if so, how and why, when I apply for another Schengen visa? Plot an elliptic curve in Latex I have a DB Server running CentOS 6.4 and MySQL 5.5 from RPMs (not source).  I have dozens of databases but one of them is being hit quite hard with large selects which locks out other updates which in turn locks out other selects (at least I think this is what's happening!)  To alleviate this I would like to replicate one of the databases onto the same server so that the writes can write to the "master" and reads can be done on the "slave". I don't have the luxury of additional hardware.  I have found a lot of guides on the internet describing how to replicate to a different server, and one () describing how to replicate to the same server but it doesn't seem to be geared towards retrofitting this functionality to an existing database with 10s of GB of data in it already. It also talks about compiling MySQL from source.  Does anyone know how I can retrospectively convert my MySQL 5.5 config to replicate one of my databases on the same server?  My existing DB runs on port 3306 so I feel it should be as easy as firing up another instance of MySQL on port 3307 and making some changes to my.cnf but not sure what changes.  Thanks in anticipation. A problem from Isaacs' FGT This is problem 3B.12. from the afore mentioned book. It asks to show that, if $G$ is a solvable Frattini-free group (that is, $Φ(G)=1$) and $H$ is a subgroup of some maximal subgroup $M$ of $G$, then $G$ contains a subgroup of index $|M:H|$. It is easy to see that, if   $N \unlhd G$ and $M\cap N=1$, then $G=MN$, $M\cong G/N $ and $H\cong K/N $ for some $ K \leqslant G $, where $K$ contains $N$. Then $|G:K|=|G/N:K/N|=|M:H| $ and we are done. However, the hypothesis will not necessarily hold. But, if $N$ is minimal among normal subgroups of $G$ (in the sense of containment), then $N$ is elementary abelian, hence nilpotent, which implies that $M \cap N \lneq N_G(  M \cap N ) \cap N $. Thus, $M \lneq N_G(  M \cap N )$ and by the maximality of $M$ we deduce that $M \cap N \unlhd G$. So, for this particular $M$, if it is not true that there exists some normal subgroup of $G$ with which it intersects trivially, then $M \cap N = N$ by the minimality of $N$. Hence $M$ contains every minimal subgroup of $G$.     How should I proceed from here? Acro package provides "! Missing number, treated as zero." after update to acro-v2.7b How do I create a list of Python lambdas (in a list comprehension/for loop)? I want to create a list of lambda objects from a list of constants in Python; for instance:  listOfNumbers = [1,2,3,4,5] square = lambda x: x * x listOfLambdas = [lambda: square(i) for i in listOfNumbers]   This will create a list of lambda objects, however, when I run them:  for f in listOfLambdas:     print f(),   I would expect that it would print  1 4 9 16 25   Instead, it prints:  25 25 25 25 25   It seems as though the lambdas have all been given the wrong parameter. Have I done something wrong, and is there a way to fix it? I'm in Python 2.4 I think.  EDIT: a bit more of trying things and such came up with this:  listOfLambdas = [] for num in listOfNumbers:     action = lambda: square(num)     listOfLambdas.append(action)     print action()   Prints the expected squares from 1 to 25, but then using the earlier print statement:  for f in listOfLambdas:     print f(),   still gives me all 25s. How did the existing lambda objects change between those two print calls?  Related question: How to build Blender as a Python module? I have seen this question now many times and every question here and on other forum points to  experimental tutorial by . Now sadly a lot of answers are invalid right now because this central link is down. I couldn't find anything by Googling so if anybody has a fork of the tutorial or a second source that would be great? The link can't be gone for too long, I saw an answer with it 4 months ago.  The only other thing I have found is , but it also references the now missing tutorial. Any ideas how to find it? How do I install Ubuntu as the only OS on a MacBook?  That is, I'd like to completely remove Mac OS X and install Ubuntu. I've tried dual-booting, but I've had so much trouble that I prefer to have only Ubuntu installed. How can I find maximum power transfer using Thevenin equivalent Positive operator is bounded For a real Banach space $X$ let $A:X\rightarrow X^*$ be a positive operator in the sense that $(Ax)(x)\geq 0$ for all $x\in X$. Show that $A$ is bounded.   I don't know how to do that, maybe it's an application of the closed graph theorem? How can an encryption scheme be indistinguishable with multiple messages but vulnerable to an adaptive chosen-plaintext attack? In order to be indistinguishable with respect to multiple messages, wouldn't the scheme need to be nondeterministic? How would this then possibly be vulnerable to an adaptive CPA? I am compiling LaTeX files with Texmaker on Ubuntu 12.04 system.   When I run pdflatex and then view the pdf file (internal), it does not show me the exact place where I am editing on Texmaker i.e. the generated pdf file does not show me the position of the cursor.   But some days before it was working fine. I don't know what causes this problem.  I already tried uninstalling and then reinstalling, I did update and upgrade too. But the problem still persists. Solvability of $a \equiv x^2 \mod b$ packed vs unpacked vectors in system verilog Looking at some code I'm maintaining in System Verilog I see some signals that are defined like this:  node [range_hi:range_lo]x;   and others that are defined like this:  node y[range_hi:range_lo];   I understand that x is defined as packed, while y is defined as unpacked.  However, I have no idea what that means.  What is the difference between packed and unpacked vectors in System Verilog?  Edit: Responding to @Empi's answer, why should a hardware designer who's writing in SV care about the internal representation of the array?  Are there any times when I shouldn't or can't use packed signals? How do I set a featured image (thumbnail) by image URL when using wp_insert_post()? While looking through the , I noticed that there's no parameter in the array it requires which will allow me to set the 'Featured Image' for a post, displayed as the  in my theme.   I have looked into functions like , as suggested by Mr. Bennett, but this seems to be a relatively new addition to WordPress itself and the WordPress codex. As such, there aren't any sources that I can find which explain how the $thumbnail_id parameter should be acquired and supplied. If this really is the function to use, in what way could I provide it with a valid $thumbnail_id parameter when all I have is an image URL?  Thanks in advance!