I have developed 3 simple blogging system in PHP/Apache/Mysql, Python/Ngix/Postgresql and in Erlang/Yaws/Mnesia.
How can I measure performance on my server for this 3 different configuration ?
Hi guys,
I am trying to create a shell script/command that find error_log files created by PHP, check their file sizes and remove them if over a certain size.
I have only gotten as far as printing the files and file sizes with the code below
for i in `locate -r 'error_log$'`;do echo "$i|" `stat -c %s $i`;done
Can anyone help?
Thanks in advance!
can someone tell me how to convert apache iis7 mod_rewrite .htaccess file to the equivalent web.config in MS Url Rewriter?
Here is the .htaccess file I have:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
Hello, I have no access to the httpd.conf. How can I redirect the users if the type one folder more like - http://www.example.com/folder/folder2/ -- redirect 404 to the main page.
The users should only have access to this root http://www.example.com/link+custom1+custom2/
and if they type something like that http://www.example.com/link+custom1+custom2/onemorefolder/orTwo/ -- redirect
how can I do that only with .htaccess and without php?
My programming experience is limited to xhtml, css, php, sql and some javascript. The books I have are:
Programming in Objective-C 2nd Edition
Beginning iPhone Development
Cocoa(R) Programming for Mac(R) OS X (Paperback)
Is there anything else I will need to get started on my journey into iPhone/OS X development?
I'm just learning how to do things, and want to start using some sort of version control for a web app.
What's most appropriate for deploying a python or php web app on my own? I'm using linux and have a linux server.
Thanks!
hi created a custom music player.But when i play the song the player head appears cut off at both sides.I haven't written any code to modify its default positon.Have no idea how to do.
Kindly help me with this
http://www.freeimagehosting.net/image.php?eb2dc1e342.jpg
I have a folder with custom classes in a ZF 1.10 application. The folder is located in public/library. How can I tell ZF where they are? Both application.ini and index.php set the path to the library but then ZF can't find the files.
Thank you
I'd like (g)vim to draw pipe symbol '|' on each 4th space of indentation to show something like vertical indentation line.
I found this plugin: http://vim.sourceforge.net/scripts/script.php?script_id=628
but it works only for 'tab'. I'm using spaces instead of the tabs.
My .vimrc contains:
set ts=4
set sw=4
set expandtab
set softtabstop=4
Thanks for help
Hi All,
I have tried for "unload" and "beforeunload" binding in following code, but none of the browser is sending a request:
$(window).bind('unload', function(){
$.ajax({cache: false,
dataType: "script",
url: "test.php"
});
});
Any suggestion?
Thank you.
On my site a number of operations can take a long time to complete.
When I know a page will take a while to load, I would like to display a progress indicator while the page is loading.
Ideally I would like to say something along the lines of:
$("#dialog").show("progress.php");
and have that overlay on top of the page that is being loaded (disappearing after the operation is completed).
Coding the progress bar and displaying progress is not an issue, the issue is getting a progress indicator to pop up WHILE the page is being loaded. I have been trying to use JQuery's dialogs for this but they only appear after the page is already loaded.
This has to be a common problem but I am not familiar enough with JavaScript to know the best way to do this.
Here's simple example to illustrate the problem. The code below fails to display the dialog box before the 20 second pause is up. I have tried in Chrome and Firefox.
In fact I don't even see the "Please Wait..." text.
Here's the code I am using:
<html>
<head>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.dialog.js"></script>
</head>
<body>
<div id="please-wait">My Dialog</div>
<script type="text/javascript">
$("#please-wait").dialog();
</script>
<?php
flush();
echo "Waiting...";
sleep(20);
?>
</body>
</html>
I'm trying to remove all BBCode Tags from a string.
[url]www.google.com[/url]
becomes
www.google.com
I have a regex that works in php to find them all, just dont know how to remove them in .net
RegEx to Find BBCode
|[[\/\!]*?[^\[\]]*?]|si
I'm using the following to render the_tags() in Wordpress 2.9.2, currently developing a theme on localhost:
<?php the_tags('<ul class="postmetadata"><li>','</li><li>','</li></ul>'); ?>
and would like to have same -near-semantic- output from the_category(), which doesn't seem obviously attainable (having looked at the relevant codex page).
I'm trying to use pydiction to autocomplete Python/Django statements in VIM Editor.
When I try to add django modules to complete-dic using this:
python pydiction.py /usr/lib/pymodules/python2.6/django
or:
python pydiction.py /usr/lib/pymodules/python2.6/django/__init__.py
I receive this error:
Couldn't import: (...). Import by filename is not supported.
Thanks!
Pydiction: http://www.vim.org/scripts/script.php?script_id=850
I just installed Google's Page Speed plugin to Firebug, and everything looks good except for caching. I have set headers to cache my JS and CSS files, but it says the images aren't being cached. How can I make sure the images get cached for 30 days? These are static images, so I can't just add the headers with PHP like I did with the other files.
In Prototype I can show a "loading..." image with this code:
var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars,
onLoading: showLoad, onComplete: showResponse} );
function showLoad () {
...
}
In jQuery, I can load a server page into an element with this:
$('#message').load('index.php?pg=ajaxFlashcard');
but how do I attach a loading spinner to this command as I did in Prototype?
After I discontinued programming in C++ while entering into web authoring I was spoilt by PHP's high level constructs like hash tables or its dynamic, weak typing. I remembered the angst of C/C++ pointers and the maze of low-level Win32 API handles and message loops and that prevented me from utilizing environments like Code::Blocks for desktop applications. I am also not very fond of bulky, statically-typed C#/.NET environment. Any other ideas?
How to make from your Custom HTTP Module a stand aloun TCP\HTTP server capable of for example runing near to any other HTTP server (on same port, just taking some URL namespace like www.example.com/myModule/blabla?id=anyID, and not beeng rood to my other servers like apache HTTP server with PHP (so I can steel call it www.example.com/myApach/blabla?id=anyID) and with my other C\C++ based servers.)?
I need CODE examples...)
I am having a problem with this stored procedure:
Delimiter //
Create procedure(in varchar(50))
Begin
Select * from employees where email = eml;
End//
Delimiter ;
I don't get errors when I run this procedure but when i call it in my php script it returns nothing.
Hi guys,
I spend a lot of time trying to figure out what's wrong with this .htaccess rewrite with no success. It produces a "500 Internal Server Error" :(
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/(([^/]+/)*)gallery/
RewriteCond %{DOCUMENT_ROOT}%1gallery/cache/$0 -f
RewriteRule ^.+ cache/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* index.php/$0 [L]
Can anyone see any problem?
Thanks in advance,
Constantin TOVISI
I'm working with C# and WPF and I would like to study something related to web programming. I already know HTML and CSS, and since I'm working with WPF, I am wondering if going into Silverlight is a good choice to start web developing. Can it be a substitute of server-side programming languages, like PHP or ASP .NET?
What do you suggest?
Thank you very much
Hi all, Is it possible to use MySQL local? I mean NOT at a server. I read a lot about MySQL on a webserver with PHP, Joomla etc.
I want to program a piece of software and use a database local to store results. Can I use MySQL for that?
If so, is ther anyware on the net a good tutorial how to do that?
Hello.
This may sound easy, but I've been trying - in vain, apparently - to figure out how I can make a query with MySQL that checks if the value (string $haystack ;) ) in a certain column contains certain data ( $needle ;) ), like this:
mysql_query("
SELECT *
FROM `table`
WHERE `column`.contains('{$needle}')
");
In PHP, the function is called substr($haystack, $needle), so maybe:
WHERE substr(`column`, '{$needle}')=1
Thanks in advance!
Hi everyone,
I have changed the Configure::write('Security.salt', '############'); value in the file
config/core.php
file to a '256-bit hex key'. Is it safe or a good practice to change these lines for every different installation of cakephp application or shall I revert back to the original ?
I also changed the Configure::write('Security.cipherSeed','7927237598237592759727'); to a different one of more length.
Please throw some light on this.
Thanks
We have a browser based application written in PHP in which I want to drag-n-drop files from the windows explorer or directly email attachments(this would be very cool). On dropping the files in the browser application, it should save it on a particular folder on the server. Any help on how this can be achieved would be really appreciated.