|
Thanks for ur sarcasm....
But if u are aware i have already deleted my previous post wic i had posted in the VB forum....
See properly and then post dude....
Even i know to speak sarcasm and seriously
|
|
|
|
|
Sorry if i was rude....
But i was extremely tensed with my task.
I was expecting some help, but i get to see such posts, i got tempted.
SOrry once again....
Good bye to this forum....
|
|
|
|
|
Hi guys,i need a PHP script for my project in which i have to demonstrate how examination results of any school or university are stored and fetched from a web-server using PHP and MYSQL.I've read "PHP for dummies" almost but can't find my solution.
Plz can anyone give me a ready script for my project and also any good book in which able to make complex applications myself.
|
|
|
|
|
Aren't you the guy, that asked the same thing in Quick Q&A? I told you there, that nobody will give you the script. It's your task, so do it yourself. If you have a specific problem, people will help you, but they are not going to do your work.
peter432 wrote: I've read "PHP for dummies" almost but can't find my solution.
Then maybe you have to do some further reading?
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
For your second question my answer is http://php.net and google.com
the answer for your first question is when have started my first point then you would be ready to find the solution for your first point.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I got a form with the method POST , the action sends a VAR to a someone URL out of my host, this var creates an XML into the URL out of my host.
how can i read the XML if i try with simplexml_load_file($url_out_of_my_server) but it returns 0
how can i do.
|
|
|
|
|
I am not sure you can do that, sound like your are sending post data to a sever that is not yours and/or you do not have access to files on that server. This also sound like cross-site scripting...a big NO NO for security reasons.
|
|
|
|
|
hi, in the first part you have a reason , but now i can do it by the CURL, send a post data and i get the answer in the same page without refresh etc.
thanks
|
|
|
|
|
you have three main functionality to do this.
1.fsockopen, 2.file_get_contents and the third is CURL.
for the first two you need to remove the headers in the response.
were as in curl you will get only the body of the response and not the header.
Now you can use xmldom functions to manipulate xml data.
Use php.net and google to fine some info.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hi, yeah! i make it with CURL!
Thanks
|
|
|
|
|
i would like u to help me write a python function that takes a string and returns true if the string is a palindrome,false otherwise.
|
|
|
|
|
Homework, huh?
Ok... what have you tried to do?
We are using Linux daily to UP our productivity - so UP yours!
|
|
|
|
|
nanjekye joannah wrote: python function that takes a string and returns true if the string is a palindrome
So...
A quick and dirty solution:
Start slicing off first and last letter of the string, and check if they are the same. If you find a mismatching pair, return false immidiately. Carry on until you're left with at most one letter, at which point you return true, as the string is a palindrome.
Φευ! Εδόμεθα υπό ρηννοσχήμων λύκων!
(Alas! We're devoured by lamb-guised wolves!)
|
|
|
|
|
Try this:
def isPalindrome(s)
return s == s[::-1]
Steve
|
|
|
|
|
Hi Steve
I'm just getting started in Python, and came across your response to the "Palindrome" problem whilst browsing the forum to pick up tips.
It's a really elegant compact solution - I wish I could write code like that! - but there seems to be a heck of a lot of stuff going on in that one short line, and as a newbie I confess that I don't fully understand the syntax.
I know it is using string slicing, but haven't seen a string slicing command take 3 parameters before, and also be part of a conditional Boolean statement in the same line of code.
It would really help my understanding if you could describe exactly how your statement does its magic!
Many thanks in anticipation
Dave
(Swansea, UK)
|
|
|
|
|
Been playing with string slicing... think I get it now...
I didn't realise that you could specify a third parameter for string slicing.
In fact the syntax for string slicing parameters seems very similar to that used in the "range" function - i.e. "[start:stop:step]".
So [:] means "include characters starting from character index 0 (i.e. start from the very first character) and end at the character at index (end-1) (i.e. finish at the last character) - i.e. "take the whole string"
...and [::-1] means "take the whole string of characters, but read it starting from the end and stepping backwards one character at a time"
So if the string equals itself written backwards, Boolean s == s[::-1] is True, and isPalindrome returns "True"
If the string is not equal to itself written backwards, Boolean s == s[::-1] is False, and isPalindrome returns "False".
Easy when you know how, and very neat!
Thanks again
Dave
|
|
|
|
|
I'm new to Python and string objects. I can manipulate them but this trick is really cool. This is what I through together using recursion real quick:
def isPalindrome(str):
"""Parses string and tests if palindromic; Returns True or False"""
if len(str) <= 1:
return True;
if str[0] != str[-1]:
return False
return isPalindrome(str[1:-1])
But using your simpler method:
def isPal(str):
return str == str[::-1]
Thanks a lot for that post!
modified on Thursday, February 24, 2011 11:55 AM
|
|
|
|
|
Hi,
I have a device(mote) that monitor temperature, light and sound. It transmit the data to PC using wireless and store in a database (PostgreSQL). After storing the data, i have it exported out becoming a .sql extenstion file. I will be only able to view the data via a program provided by the device company.
The main aim of my project is to make data viewable on html where im able to publish it online.
Where i will be using the output data (.sql file) and publish it on html using PERL and CGI.
Any helps on how i can make the .sql file readable in PERL or do i need another program to read the database output(.sql file) then making PERL script able to read the filen and then publish it online?
The device I'm using which is made by Xbow and im running Win XP.
Any help would be greatly appreciated.
Regards
Joseph
|
|
|
|
|
You can read the database using perl. There are libraries for that.
You can create html using perl. There are libraries for that.
And of course perl does CGI.
Presumably you already have a way to host on the internet that supports CGI.
|
|
|
|
|
So, a while ago I wrote here about starting to experiment with Django, and now I have come to a stop...
I usually map my Django projects on the root, but this time I tried something different and failed very badly...
I tried to map it to http://foo.com/django and encountered two problems, I hope you guys can help me with...
Problem 1:
If I go to address http://foo.com/django (without trailing slash) I get an Internal Server Error.
Log shows this info:
File "/var/lib/python-support/python2.5/django/middleware/common.py", line 41, in process_request
if settings.APPEND_SLASH and (old_url1-1 != '/') and ('.' not in old_url1.split('/')-1):
IndexError: string index out of range
If I include the trailing slash it works (at least it seems to).
APPEND_SLASH is (obviously) set to True.
Problem 2:
Let's go with urls.py that looks like this:
from django.conf.urls.defaults import *
from djangobook.views import hello
urlpatterns = patterns('',
(r'^hello/$', hello),
)
Instead of going to http://foo.com/django/hello I get redirected to http://foo.com/hello. I presume I'm missing a setting or something to make it relative to the project's starting URL?
We are using Linux daily to UP our productivity - so UP yours!
|
|
|
|
|
When you deploy on a subdirectory you will need to make sure you account for that in your url patterns. Take a look here.[^]
And above all things, never think that you're not good enough yourself. A man should never think that. My belief is that in life people will take you at your own reckoning. --Isaac Asimov
Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell
|
|
|
|
|
So, all the url patterns have to start with '/django/ ' ?
Besides, there are no instructions for mod_wsgi, or I can't see them?
We are using Linux daily to UP our productivity - so UP yours!
|
|
|
|
|
You shouldn't need to make any mod_wsgi changes. And don't copy the apache config on the link, it looks like it would kill you app since it seems to be a mod_python set-up. So, try to leave you apache config alone and start with your patterns.
And above all things, never think that you're not good enough yourself. A man should never think that. My belief is that in life people will take you at your own reckoning. --Isaac Asimov
Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell
|
|
|
|
|
Ok, so what I just figured is that I get redirected from foo.com/django/hello to coo.com/hello only if I leave the trailing slash.
How can I make django append the trailing slash in the URL? APPEND_SLASH is set to true.
We are using Linux daily to UP our productivity - so UP yours!
|
|
|
|
|
Hello All,
My co-worker has a script that was caught in a infinite loop... during one run of the script. It has not repeated this behaviour since.
After reading the docs online (w3schools http://www.w3schools.com/php/func_directory_dir.asp[^]) I see this returns a directory stream.
I am wondering if you use the objects function "read()" as the condition of a while loop...
<br />
$dir = dir('/pathway/to/directory');<br />
while($dir->read()!==false)<br />
{<br />
... process files...<br />
}<br />
...is it possible to cause an infinite loop when a new file is added via a different script to the same directory during this scripts execution?
the scripts run on a lamp system with ample resources.
Ideas?
|
|
|
|