|
i just want to say www.igolfyoo.comwith PHP,but i don't now how to amend!
Can you help me?
Thanks!
|
|
|
|
|
Hello all
I want to learn php language for web developing, would you give me a good ebook or reference? I Googled my will but can't find anything useful although I want a good reference and I couldn't decide what was good for me.
T.I.A
While (true) { Human.isLearnable = true; }
|
|
|
|
|
|
|
|
hi dear pedram!
since i know you are an amateur i recommend you PHP 5 for Dummies this book start your PHP engine!good luck
|
|
|
|
|
Hello Hamid,
Can you give me a link of that eBook?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
http://www.freebooksclub.net/php/278-php-5-for-dummies.html
|
|
|
|
|
I'd recommend this book as well as looking at http://www.php.net - that's how I learnt PHP
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Hi,
I am working on c++ in a linux system ( Fedora core 4 ),
kernel version - 2.6.11-1.1369_FC4
gcc version - 4.0.0 20050519 ( Red Hat 4.0.0-8 )
In my code i am creating a vector to store pointers of type structure "SAMPLE_TABLE_STRUCT" ( size of this
structure is 36 bytes ). I create an instance of structure "SAMPLE_TABLE_STRUCT" using operator "new" and push back
into the vector,this is done inside a for loop for 204800 times. After i come out of for loop i observe the memory
consumed by the process using the command "pmap -d pid". The memory consumption increases by approximately 8 MB.
After this i delete all the contents of vector using "delete" operator. Now if i observe the memory consumed by the
process ( using "pmap -d pid" command ) it shows no reduction in the memory even after deallocating the memory in
the code.
But it shows memory reduction after deleting vector contents if i store the "char *" elements into the vector
instead of "SAMPLE_TABLE_STRUCT *" elements.
Am not able to figure it out why it does not show memory reduction ( after deleting vector contents ) in case of
vector of type "SAMPLE_TABLE_STRUCT *" whereas it shows reduction in memory for vector of "char *" type elements(
after deleting vector contents )...?
Can anyone please help me out here...?
Here is the piece of code where am facing the problem -
[CODE]
#define ALTERNATE
#define MAX_STRING_VEC_SIZE 134
#define MAX_STRUCT_VEC_SIZE 1024*200//134
#define MAX_MEM_SIZE 1024*50
/*vector of char * type*/
void Function()
{
std::vector< char * > v_pData;
#ifdef ALTERNATE
v_pData.resize( MAX_STRING_VEC_SIZE, NULL );
#endif //ALTERNATE
bool bFlag = true;
while( bFlag );
//Allocate Memory
for( int nInd = 0 ; nInd < MAX_STRING_VEC_SIZE; nInd++ )
{
char * pData = new char [MAX_MEM_SIZE];
memset( pData, 0, MAX_MEM_SIZE );
#ifdef ALTERNATE
v_pData[nInd] = pData;
#else //ALTERNATE
v_pData.push_back( pData );
#endif //#endif //ALTERNATE
}
bFlag = true;
while( bFlag );
//Release all the Memory
for( int nInd = 0 ; nInd < MAX_STRING_VEC_SIZE; nInd++ )
{
delete [] v_pData[nInd];
}
v_pData.clear();
}
/*vector of SAMPLE_TABLE_STRUCT * type*/
void Function1()
{
std::vector< SAMPLE_TABLE_STRUCT * > v_pData;
#ifdef ALTERNATE
v_pData.resize( MAX_STRUCT_VEC_SIZE, NULL );
#endif //ALTERNATE
//Allocate Memory
for( int nInd = 0 ; nInd < MAX_STRUCT_VEC_SIZE; nInd++ )
{
SAMPLE_TABLE_STRUCT * pData = new SAMPLE_TABLE_STRUCT;
#ifdef ALTERNATE
v_pData[nInd] = pData;
#else //ALTERNATE
v_pData.push_back( pData );
#endif //#endif //ALTERNATE
}
//Release all the Memory
for( int nInd = 0 ; nInd < MAX_STRUCT_VEC_SIZE; nInd++ )
{
delete v_pData[nInd];
v_pData[nInd] = NULL;
}
v_pData.clear();
}
[/CODE]
|
|
|
|
|
i need some help and direction on how to go about creating a unix shell in c++. Any pointers? help?
|
|
|
|
|
Basically you need to extensively learn system calls using C. Also you would need to learn features like forking processes (typically used in pipes) etc. You also should figure out I/O Streaming support. When you are done with this, you can design the shell and depending on commands typed, fork processes, deal with I/O, make system calls etc
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
For instance, I've got this form:
<html>
<head>
</head>
<body>
<form name="f_prof" id="f_prof" action="chooseOption.php" method="post">
Choose an Option:
<select name="selectedOption" id="selectedOption">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
<option value="2">Option 3</option>
<option value="3">Option 4</option>
</select>
<input type="submit" value="Send" name="ok" id="ok">
</form>
</body>
</html>
And choseOption.php is like this:
<?php
echo ("The option selected was: '$selectedOption'");
?>
The form work fine but when I choose an option and submit it I get this
The option selected was:''
It is supposed that variable $selectedOption is created implicitly but it does not print its value. As you can see, I'm starting in php and web programing, so I'm kind of lost.
Any help would be appreciated and excuse my english.
Regards
Iván Cruz
|
|
|
|
|
blackhattrick wrote: echo ("The option selected was: '$selectedOption'");
You can't get values from forms just like that.
You need to get the value via the POST method:
$selectedOption = $_POST['selectedOption'];
echo ("The option selected was: '$selectedOption'");
?>
That should work.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
|
When you POST variables, they are encapsulated in a $_POST array. Each value can be called by its key or $_POST['name of field']. In your example, $_POST['selectedOption'] would contain an integer 1-4. For more information, you can take a look at:
http://www.w3schools.com/php/php_post.asp[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
rviswakumar@hostmysite.com
HostMySite.com[^]
|
|
|
|
|
I notice its popular for some scientific and ai programming which perks my interest but I've never tried it and wikipedia and other sites are kind of vague about what it can do. So what can python do or do better than a language like vb.net or c#?
|
|
|
|
|
There are many great things about python, a few key points are:
1. well implemented internal data structures
2. great brevity of code - constructs like list comprehensions allow very concise and easy to read code
3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)
4. it's interpreted and yet it is really fast
5. simple integration with C.
If you agree with the idea that the cost of development is directly linked to the number of lines of code (which there are a lot of studies to support) then Python is a winner. I would generally expect to be able to write a Python app in about 20% of the lines required for C#.
Python was designed as a teaching language and so it is very "pure" and orthogonal (ie no shortcuts to enhance performance). This makes it easy to learn and write and yet it is suprisingly fast when executing. For tight-loop, time critical sections it is easy to implement function in C that can be mapped in Python.
Some people prefer Ruby (which is sort-of an evolution of Python).... but especially in the case of Ruby-on-rails the performance tends to be very limiting.
Paul Coldrey
http://www.lumient.com.au/
|
|
|
|
|
Thanks for your reply, I'll have to look into it. I'm not sure what you mean by statement 3 though.
Paul Coldrey wrote: 3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)
thanks,
Mike
|
|
|
|
|
Lots of languages have restrictions on certain types that stop you treating them as genuine objects. For example C# won't let you inherit an int or override any of its methods. The reason they do this is for speed because it means that for these "special" types they don't need to do any virtual function lookups. In Python everything is a "real" object. Hence when you say 1+1 Python goes off and does a virtual function lookup for the (int) + (int) function,... and you can override this function if you are insane. The clever thing is that because Guido knew this could be a performance issue he optimised the VF lookup really well and this is part of the reason why Python is so much faster than you would expect. All the VF lookups (And other object oriented overheads) are outrageously fast and they more than offset the extra calls that are required to keep the language clean. Obviously making 1+1 implement 1-1 is not a good idea,... however, suppose you want to count how many additions are happening in a given piece of code as an optimisation metric,.. in Python you can override '+' and add some code to count the number of times it is called. Sounds like a small thing,... but you would be surprised how many optimisation-based limitations there are in C# and some of them get really annoying when you are trying to write pretty mundane code.
Paul Coldrey
http://www.lumient.com.au/
|
|
|
|
|
I agree.
I would add that it has a LARGE library to chose from, so for many things, you don't need to write new components/libraries, but just find the one that fits.
Also, from my point of view (C++ programmer) Python is just fun to code in. Not sure why, but have noted others say the same thing.
-Mike
|
|
|
|
|
Some cool apps are written in Python -- Mozy backup, lots of the Google apps, Eve (if I remember right -- MMORPG space multiplayer game) and others.
Lots of neat libraries and such. Fun to program in.
As to what it can do better than vb.net or c#, not totally sure, but that would be like asking the same of any language. The answer will depend on what you think and like of any of the languages.
Check out Guido van Rossun's (creator of Python) site http://www.blogger.com/profile/12821714508588242516[^]">Python blogs "History of Python" and Neopythonic for some interesting insights from him.
-Mike
|
|
|
|
|
Python doesn't have a claim to fame.
Unlike the languages you referred to - C#, VB, and many others,
Python is a scripting language.
I know this site is primarily about Microsoft technologies, but Python isn't from Microsoft!
It's very easy to learn, and has a great many uses.
Projects than incorporate/written in Python:
mod_python (Apache's python module)
Sid Meier's Civilization IV
Gentoo's Portage package management system
Various NASA systems
A large percent of Google products and in-house systems
Youtube
Mercurial (Hg)
PyPy
and a great many others.
Enjoy!
|
|
|
|
|
Python is NOT 'just a scripting language' - It can be compiled just the same as any java program, you can have it interpreted or whatever you like. It can use c libraries and can even be embedded into c programs.
py2exe compiles windows python apps
freeze compiles the linux equiv
and py2app compiles the mac equiv.
|
|
|
|
|
i want information about kernel module programing, how to insert & compile own module in linux kernel? and i want code of address resolution protocol in linux
|
|
|
|