I am working on an Encryption Project and have used PyCrypto module in Python for all the Cryptographic algorithm.  When I connect PHP with MongoDB, at the user sign up I need to link each user with a specific public and private key, the code for RSA Key generation is in Python and I am using PHP to store all the user information in MongoDB.  How to call Python scripts and use the output in PHP without executing the script in shell first as it is a time taking process?  Is there any cross-compiler present for both PHP and Python so that I can execute on the same compiler ?
I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.  I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script.  Any better ideas? Thanks in advance!
jQuery Datepicker with text input that doesn't allow user input How does Java's serialization work and when it should be used instead of some other persistence technique? I've been lately trying to learn more and generally test Java's serialization for both work and personal projects and I must say that the more I know about it, the less I like it. This may be caused by misinformation though so that's why I'm asking these two things from you all:  1: On byte level, how does serialization know how to match serialized values with some class?  One of my problems right here is that I made a small test with ArrayList containing values "one", "two", "three". After serialization the byte array took 78 bytes which seems awfully lot for such low amount of information(19+3+3+4 bytes). Granted there's bound to be some overhead but this leads to my second question:  2: Can serialization be considered a good method for persisting objects at all? Now obviously if I'd use some homemade XML format the persistence data would be something like this  &lt;object&gt;     &lt;class="java.util.ArrayList"&gt;     &lt;!-- Object array inside Arraylist is called elementData --&gt;     &lt;field name="elementData"&gt;         &lt;value&gt;One&lt;/value&gt;         &lt;value&gt;Two&lt;/value&gt;         &lt;value&gt;Three&lt;/value&gt;     &lt;/field&gt; &lt;/object&gt;   which, like XML in general, is a bit bloated and takes 138 bytes(without whitespaces, that is). The same in JSON could be   {     "java.util.ArrayList": {         "elementData": [             "one",             "two",             "three"         ]     } }   which is 75 bytes so already slightly  smaller than Java's serialization. With these text-based formats it's of course obvious that there has to be a way to represent your basic data as text, numbers or any combination of both.  So to recap, how does serialization work on byte/bit level, when it should be used and when it shouldn't be used and what are real benefits of serialization besides that it comes standard in Java? I have a fairly modern desktop computer, an AMD Athlon II X2 based silent PC, that does not work.  When turned on, it will start physically (all fans are rotating, disks start up...) but not give a signal on any of the graphics ports (DVI, VGA, and HDMI, I tried all three). Also, the reset button does not seem to have any effect.  I have stripped the mainboard bare of all SATA connections, extension cards, and the one 2GB RAM chip to eliminate them as the problem source, but to no avail, so I think it's fair to assume it's either the mainboard or the processor that are at fault.  However, I have neither a replacement mainboard, nor a replacement processor handy to identify which one is broken. The cause of the defect is unknown, so for all I know, it could be both. Therefore, I'm reluctant to buy replacement hardware blindly before knowing more.   Is there any way to further diagnose (or at least get some indication) which component is broken without buying replacement hardware? How to start a GUI application from cron? Right identity and Right inverse implies a group My settlement was attacked by some Raiders and my defenses took care of them along with some of my NPC's. It seems like the Raiders didn't make it through to any of the buildings. What happens when they do?  Can you lose your items if you stored them in a house?  Can the NPC's die?  Do the enemies destroy your buildings? Using SQLite3 with Python 2.5, I'm trying to iterate through a list and pull the weight of an item from the database based on the item's name.  I tried using the "?" parameter substitution suggested to prevent SQL injections but it doesn't work. For example, when I use:  for item in self.inventory_names:     self.cursor.execute("SELECT weight FROM Equipment WHERE name = ?", item)     self.cursor.close()   I get the error:     sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied.   I believe this is somehow caused by the initial creation of the database; the module I made that actually creates the DB does have 8 bindings.  cursor.execute("""CREATE TABLE Equipment      (id INTEGER PRIMARY KEY,      name TEXT,     price INTEGER,      weight REAL,      info TEXT,      ammo_cap INTEGER,      availability_west TEXT,     availability_east TEXT)""")   However, when I use the less-secure "%s" substitution for each item name, it works just fine. Like so:  for item in self.inventory_names:     self.cursor.execute("SELECT weight FROM Equipment WHERE name = '%s'" % item)     self.cursor.close()   I can't figure out why it thinks I have 8 bindins when I'm only calling one. How can I fix it? File upload to Heroku not working When should I use \input vs. \include? There are two different commands to incorporate another file into the source of some document, \input and \include. When should I use one or the other? What are the differences between them? Are there more things like them to be aware of? How small does a land-mass have to be before you live "on" it, rather than "in" it? I'm sure virtually everyone agrees that people live on the Isle of Wight, but in Ireland.  Apparently the usage depends somewhat on physical size, but that can't be the whole story. How exactly do we decide which form to use? And are there any really glaring 'outliers' that don't fit the normal pattern?  LATER - I must just add that the most uncertain case I've found so far is The Falklands. Most people go for in there, but a substantial minority (about 1 in 3) opt for on. How to call shell script from php that requires SUDO? Do the Imperials know they are evil? How is "Can anyone tell me how can I solve this" wrong? How do I remove the limit on PC keyboard button presses? Drawing a triangle from medians How to yield from parallel tasks in .NET 4.5 Intuitive explanation of binomial coefficient formula I'm  trying to create a FPS game in blender game engine. When I do KeyBoard[Spacebar] sensor and hook it up to a simple motion of z +1 or something like that, the guys pops up really fast as if he didn't have any motion between being on the ground and being in the air. Is there a way to make a more realistic, more slow jump in BGE? Proving the countability of algebraic numbers I am trying to prove that algebraic numbers are countably infinite, and I have a hint to use: after fixing the degree of the polynomial, consider summing the absolute values of its integer coefficients, and setting the sum less than or equal to $m$, for each $m \in \mathbb{N}$. I am also allowed to use the fact that every polynomial has a finite number of roots. I am not sure where to begin... Perhaps after fixing the degree of the polynomials, I could try enumerating them, and after proving countability of the set that contains the roots of all polynomials of a certain degree, I could state that the union of infinitely many ($\bigcup_{n=1}^{\infty}$, $n \in \mathbb{N}$) countably infinite sets is countable, and thus the algebraic numbers are countably infinite, too, but I am not sure if this is a good approach/how to enumerate the polynomials. Thanks! how does the circuit of a basic Variable speed electric drill work? i am trying to 'automate' the control of an electric drill motor that im taking from a garden variety Variable Speed drill (from Harbor Freight)  it has a universal AC motor which I basically undertand and a DPDT switch to reverse direction and a triac citcuit to vary speed    Question 1 . i see 4 wires going to the 'field/Stator coil(s)'. Are there 2 seperate field/stator coils here? is this to provide low/high power.  I think in theory , you only need 1 coil with 2 wires and that coil is wired in series with the brushes... is that right?   how does this circuit work with 2 coils.  Question 2 . how does this variable speed circuit work.  is the wiring diagram correct (it doesnt show a variable resistor and it doesnt show what drives the control input of the traic? why are there two switches in the thing? does switch 2 close at high speed and thus shunt around the triac?  please see the attached 4 diagrams