Is there an easy way (without downloading any plugins) to connect to a MySQL database in Python?
Also, what would be the difference from calling a PHP script to retrieve the data from the database and hand it over to Python and importing one of these third-parties plugins that requires some additional software in the server.
Hello,
Can some one tell me how the Chrome's Linux beta version carry out automatic version updation using debian package manager. I need to implement something similar to my application on linux and information provided here would be of lot of help. I am currently checking out the postinst script present in the debian control package and I can see Chrome uses PGP publish/subscribe model for getting automated version updates in Linux. I just clear understanding of how that works. Any help would be greatly appreciated.
Thanks
I have some JQuery code that shows or hides a div.
$("div#extraControls").show(); // OR .hide()
I initially want the div to be not visible so I used:
$(document).ready(function() {
$("div#extraControls").hide();
});
However, on the browser, the content loads visible for a second before disappearing, which is not what I want.
How do I set the hide the element before the page loads whilst keeping the ability to show hide it dynamically with a script?
I'm writing a Bourne Shell script to automatically edit a source file.
I get the line number I need like this:
line=`sed -n '/#error/=' test.h`
line=$[$line - 2]
Now I want to insert a few lines of text after this line number, how can I do this?
I have had some success using WES2009 and svn to control an XPECMD script, SLD files and their dependencies.
What's the best way to apply configuration management to Windows Embedded Studio projects?
I would like to display all the subjects of email received on a website. Is there an open source "pop to php" script? Or a service I can use directly?
Any help is appreciated! thanks!
Hi all,
I want to update/insert file by using upload box to the database but before that it will check for the file type thats only pdf can be upload. Somthing wrong with the codes and i dont know what..Please help
here are part of my updates codes:
$id=$rs['id'];
$qry = "SELECT a.faillampiran FROM {$CFG->prefix}ptk_lampiran a, {$CFG->prefix}ptk b WHERE a.ptkid=$id and b.id=$id";
$sql = get_records_sql($qry);
if($_POST['check']){
$ext = pathinfo($faillampiran,PATHINFO_EXTENSION);
$err = "Upload Only PDF File. ";
if ($ext =='pdf'){
$qry="UPDATE {$CFG->prefix}ptk_lampiran SET
faillampiran='".$faillampiran."'
WHERE ptkid='".$_GET['id']."'";
$sql=mysql_query($qry);
$qry = "SELECT a.faillampiran FROM {$CFG->prefix}ptk_lampiran a, {$CFG->prefix}ptk b
WHERE b.id = '".$rs[id]."' AND a.ptkid = '".$rs[id]."' ";
$sql = get_records_sql($qry);
foreach($sql as $rs){ ?>
<?=basename($rs->faillampiran); ?><br>
<? }
?>
<tr><td></td><td></td><td>
<input type="file" size="50" name="faillampiran" alt="faillampiran" value= "<?=$faillampiran;?>" />
<input type="submit" name="edit" value="Muat naik fail ini" /><br />
</td></tr>
}
else {
echo "<script>alert('$err')</script>";
}
} else {
foreach($sql as $rs){ ?>
<?=basename($rs->faillampiran); ?><br>
<? }
?>
<input type="file" size="50" name="faillampiran" alt="faillampiran" value= "<?=$faillampiran;?>" />
<input type="submit" name="edit" value="Muat naik fail ini" /><br />
<?}
Sori bout the messiness of the codes, im still a beginner in this languages.
thx
I have a problem with my index.php, i have this small script that decides what content to deliver
<?php $clase = $_GET['clase'];
if ($clase == empresa) {include ("empresa.php");}
elseif ($clase == productos) {include("productos.php");}
else {include ($_SERVER['DOCUMENT_ROOT']."/inicio.html"); }
?>
it works when i go to www.mysite.com/index.php
but when i go to www.mysite.com it doesnt and i cant just figure our why.
I'm using launching firefox from the command line in a script to get snapshots of pages. These pages have basic http authentication. When using:
firefox http://user:[email protected]
Either a dialog appears, or authentication doesn't work at all.
Is there any option to make firefox open the page without showing the dialog?
Is there a good way to do this? I'm writing an extension that interacts with a website as a content script and saves data using localstorage. Are there any tools, frameworks, etc. that I can use to test this behavior? I realize there are some generic tools for testing javascript, but are those sufficiently power to test an extension? Unit testing is most important, but I'm also interested in other types of testing (such as integration testing).
The title says it all. I want to create a bash script that will launch two processes and kill the second process when the first is done. Here's an example:
#fork first process
producer&
#fork second process
consumer&
#wait for producer to finish
...
#kill the consumer
...
I have a feeling this can get ugly but has a very simple solution. Please help me fill in the blanks.
how do you effectively debug on live server in rails, whether on a beta/production server?
I tried modifying the file directly on the server, and restarting the app, but the changes does not seem to take effect, or takes a long time to (caching?)
I also tried to do "script/server production" locally, but that is very slow
The other option is to code and deploy, but that is very inefficient.
Anyone has any insights as to how they do this efficiently?
I have a script that retrieves a file via SFTP, in some cases (hard to reproduce) the file arrives with only the 5 first characters of each row. Example:
<?xml
<resu
</res
Instead of :
<?xml version="1.0"?>
<results>
</results>
What can cause such behaviour?
Creating a cache file with writeBuffer() requires that webroot/js be world writable and allows a browser to cache generated script resources for any page.
how to make webroot/js be writable and allows a browser .....
How can I check if a user exists?
Im doing an installer for a mysql database, and I need to check if a user exits, if not create user, if yes delete user and create it again.
this so i can execute the script without worries.
thanks.
Hi,
I have a folder for downloads on my server, i want to prevent direct access to that folder so i am makin it pass-protected with htaccess and i will push download with a php script. But i have some questions regarding mkdir and file_exists
Do mkdir and file_exists works good for pass-protected folders ?
and
would i get any error while uploading file to that folder ?
AND
is this a good way of preventing direct access ?
thanks
I there a way how to take photos on laptop built-in camera controlling its control using flash? Our designer is making an application to take photos using flash action script or anything PL if not possible in flash.
I use the following for a jquery link in my <script> tags:
http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
Just wondered if anyone had discovered whether there's a link to the "latest" version:
Something like the following (which doesn't work):
http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js
(Obviously not necessarily a great plan to link your code to potentially changing libraries but useful in development)
I have a cookie that is formatted like partA:partB. The colon is not escaped in any fashion. I need to read this cookie in a JSP script, and request.getCookies() is only returning partA. I can't change the cookie because it is used in multiple applications, and fixing the cookie would break production code. Any ideas how I can read the full value of this cookie?
To clearly separate the Controller and View layers, I do not longer want to pass full objects to my views. Instead I want to pass only arrays and objects that contain the data but do not have any methods. Otherwise a view script would be able to delete Doctrine records or traverse in the object tree to data that was not intended for the view.
I need to find out what variables and values are being POSTed to a script that I'm debugging. It's doing something strange to them, and it needs to start a session so I can't ouput them right at the beginning. I'm hoping to find a plug-in for Firefox that will show me what they are directly from the browser. Does anyone know of such a thing?
Outside the standard mouse/keyboard combination are there any other peripherals that you use to make you programming more efficient?
One option that I have considered is using AutoHotKey to script the buttons on a Logitech Wingman to run different functions/keystrokes that are not available on the keyboard.
I'm using xdebug to profile some PHP code on Windows and using WinCacheGrind/Webgrind to analyse the output, but I'm getting some strange results. Specifically, the total cumulative time for a single method is greater than 100%! How is it possible that more time is spent executing this function's code and all the functions that it calls than the total time it took to execute the whole script? What am I missing here?