Programming :: Write Little Quiz To Give Different Answer When Given Yes Or No Reply?
May 20, 2010
I am trying to write little quiz to give different answer when given yes or no reply, however I got stuck with this. I am very very new to Python so please have patience. Can someone give me a sugesstions?
This is my code so far:
name = raw_input("
What is your name")
print "
Hello, " + name + "."
[Code]...
View 8 Replies
ADVERTISEMENT
May 5, 2010
When i enter ip or address nslookup does not reply any answer. It shows no server found. "servfail". This is my named.conf file:
[Code]....
View 3 Replies
View Related
May 18, 2010
How can I set the outgoing port for the socket? In wireshark, my outgoing port is 1024, and i want to set it to 6800 (or a similar port) I see the outgoing broadcast-message in wireshark, but no answer. There are three ECU's in the LAN, which should answer. The following code is a mixture of C/C++ and jointed from different articles:
[code]...
In wireshark I can only see the outgoing message. But the "recvBuffer" (in the lower part of the code) contains the same content as the sendBuffer. Is it right, that I need a sender and further more a receiver? Or should I receive the broadcast-answer on the same socket on which I send the bc?
View 5 Replies
View Related
Feb 25, 2011
I am trying to write a perl script which will give an interactive session to a user to execute command on the server. I have written a small script to do this :
Code: !/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $host = '192.168.1.1';
my $username = 'user';
my $login_passwd = 'test123';
[Code]...
View 2 Replies
View Related
Dec 22, 2010
It could run on my computer. But there is no result.
[code]...
View 1 Replies
View Related
Jun 20, 2010
i m using atoi() to convert char value to int. and then passing that int as a swtich variable.switch goes in a case and exectuing that particualr function but returning 0 value....for example: i am finding no of process() and system up time().when switch program goes in system up time it gives right values means correct no of days, hrs , min and sec but when it goes in no of process() it gives 0 answer.
View 8 Replies
View Related
Feb 3, 2011
on the following link [URL] section 2 says
Quote:
The following directories need to be readable, writeable and executable for everyone:
* dokeos/main/inc/conf/
* dokeos/main/upload/users/
* dokeos/main/default_course_document/
* dokeos/archive/
[Code].....
I am not at all convinced by the idea of giving permissions to read,write and execute as these Learning Management Systems say. Let me know what you people have to say? What is the best practise in such situations? I have to get all these LMS run on same web server.
View 2 Replies
View Related
Mar 20, 2010
how do i give group write permissions in fstab? i'm trying to mount a virtualbox shared folder. currently my fstab looks like this Code: Share_Name /mnt/point vboxsf rw,uid=1000,gid=1000 0 0 i want to give both the owner and group, write permissions. currently, only the owner has write permissions, and group read with these mount options.
View 3 Replies
View Related
Aug 6, 2010
Just finished downloading a game in .run format, i downloaded it to my Home>Downloads folder and ran these commands in terminal: (game is tremulous if it matters)
chmod +x tremulous.run
./tremulous.run
It started it up in the terminal and i began working my way through the installation process, and i tried to install it into my Home>Games folder. (Is it supposed to be home>games or your username>games?)
and it said PERMISSION DENIED. No write permission to Home/Games/
How do i give myself read and write permissions to my game folder?
View 3 Replies
View Related
May 22, 2010
Code:
tupe=("File",("Open","Open a file"),"Edit",("Cut","Cut a file"),("Paste","Paste a file"),"About",("About","About the program"))
menutitle=""
menupos=0
for items in tupe:
if type(items)==str:
[Code]...
I'm trying to understand how to make "File" be the parent information for "Open","Open a file" and "Edit" to be the parent of "Cut, Cut a file" and "Paste", "paste a file". Does anyone have a suggestion for accessing the a nested tuple in this manner? The above code does not quite do what I want it to. The above code is for visual purposes, but I'm learning how to refactor for wx.python.
View 3 Replies
View Related
Mar 23, 2011
is there a way to give an application (controlaula) write access to a folder /var/lib/monitorprofe and files on that folder.
View 3 Replies
View Related
May 9, 2011
There is a folder that is owned by user tomcat6: drwxr-xr-x 2 tomcat6 tomcat6 69632 2011-05-06 03:43 document. I want to allow another user (ruser) write permissions on document folder. The two users (tomcat6 and ruser) does not belong to same group. I have tried using setfacl: sudo setfacl -m u:ruser:rwx document
but this gives me setfacl: document: Operation not supported error.
View 1 Replies
View Related
Feb 18, 2011
i want to write shell script that give a number between 1-3444 from user and if user enter out of range number give error e.g number must between
read -p "plz Enter Number " p
while [ $p != [1-9] -o $p != [1-9][0-9] -o $p != [1-3][0-4][0-4][0-4] ]
do
read -p "plz Enter Valid Number" p
done
but this have an error in while statement ! two many argument
View 3 Replies
View Related
Jan 24, 2011
I'm trying to create an SSL certificate and answer the questions inside a bash script. The command used to create the SSL certificate
Code: openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
The first question asked is. Country Name (2 letter code) [AU]:
View 4 Replies
View Related
Jun 22, 2011
am getting an error "java.net.SocketException: Malformed reply from SOCKS server" when trying to create a socket to an ip.but when i use localhost,its working fine
Error
Socket skt=new Socket("192.168.1.18",4000);
working
Socket skt=new Socket("localhost",4000);
View 1 Replies
View Related
Apr 23, 2011
I Have Configure Samba server in Centos, I need give permission like for some user(5User) can able to read and write the particular folder, and again i need give some another user(6user) can only read permission for same folder.
View 1 Replies
View Related
Nov 4, 2010
I have a simple BASH script that I want to make it execute USERNAME and PASSWORD to another bash script and htdigest. But After passwd, with htdigest and the script rustart, I have to manual enter the answers.
#!/bin/bash
echo -n "What is the user name?"
read -e USERNAME
[code]....
Quote:
This will ask me for username and password, but I want it to take the username and password from $USERNAME and $PASSWORD
service rustart restart
Quote:
This script needs a username to restart another exec, but I don't wana have to manually type in the username, I just want it to automatically fill in the $USERNAME
View 4 Replies
View Related
May 11, 2009
I am new in linux,I installed apache-tomcat on fedora.I can view all web pages on localhost:8080 but when I try to view them by server's url address from another computer, I don't get respond.Can it be a firewall problem or something else?
View 4 Replies
View Related
Aug 8, 2010
I was wondering if possible in bash for a variable to take the value of a function, I mean the function returns a value and a variable will take it. example:
[Code]....
View 3 Replies
View Related
Aug 29, 2010
How can I give www-data permission to use sudo? I used to assign permission to users to use sudo using KDE but don't know how to do it on a headless server.Basicly I have a web application running that wants to call a command that needs root privs. When it calls this command it's running as www-data. I guess it's not working as www-data is not allowed to use sudo. If it can use sudo I could for example...Code:echo "password" | sudo -S "some admin command here"I could be wrong but i'm petty sure I just need to give www-data permission to use sudo?
View 5 Replies
View Related
Feb 20, 2010
Feel free to just link to another thread where this is (pre)solved; I can't search the forum for the word "for," because it's too short (or maybe the search engine dislikes prepositions).
Is there a way to give the 'for' command a range? Here's what I mean:
Code:
#for i in (1-5); do echo $i; done
Certainly, meat space user; I understand exactly what you're thinking.
1
2
3
4
5
True, I realize I could use
Code:
COUNT=1 ; while [ $COUNT -lt 6 ]...
...but if I can avoid the extra preparatory step I'd prefer to do so.
View 2 Replies
View Related
May 14, 2011
Does declaring variable inside a function give an extra overhead on an application? Would it be better to declare the variable globally and just reuse it? Example
Code:
#include <blah>
char mybuffer[2048];
int main()
[code]....
The only difference is the declaration of my variable. Since myfunction() will be called many times will it add an additional overhead if it will create mybuffer[2048] over and over?
View 5 Replies
View Related
Feb 19, 2009
I'm writing a perl script to remove a test database and part of that is of course getting rid of all files. So I wrote this to do the job:
Code:
This always results in an "Could not open /u00/app/oracle/product/10.2.0/rdbms/dbs for reading: No such file or directory" (that directory is the one ending with the $spfile_dir variable) message, although that directory exists and the executing user has writing rights on it.
The same behaviour if I create the directory array like this:
Code:
The problem does not occur when one of the directories is the only element in the array though. Of course I could copy and paste that part of the script for the second directory, but I don't like that workaround.
View 1 Replies
View Related
Jun 24, 2010
I just started messing around in Linux programming, and I wanted to create a simple test program to open a file, read to it, and write to it. I can open and read it, but write always gives errno = EBADF. I've messed with file creation permissions and I can figure out why write() thinks it's a bad file descriptor but not read().Here is my code:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
[code].....
View 1 Replies
View Related
Mar 10, 2011
I need to write a GUI for the web to gather the following info:
Username
Password
SomePlainText
Path1
PathN
Of course, I then need an 'submit' button. I then want to have the user upload all paths supplied from their machine to my server. I hope to work with this data as arguments for a bash script. Also, I need to work with all possible client OSes consistently. What language should be used?
View 3 Replies
View Related
May 30, 2010
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
View 6 Replies
View Related
Mar 31, 2009
I've been working at learning how to write makefiles and I'm a bit stuck.
I've got a fairly simple project that will eventually be a framework for TCP/IP Communications in evolutionary algorithms that I've been using Eclipse to develop.
For personal development I want to learn how to write makefiles by hand but have gotten kind of stuck
Here is the makefile as it stands now:
Code:
Port and Mailbox are a virtual class and a template class respectively.
I get these errors when I run make:
Code:
So for some reason every single function in the Connection class has been defined multiple times. I assume because it's included as a dependency for multiple targets, but I've seen this in numerous examples that apparently work.
Everything in libpthread is undefined because I'm not linking in the library. I've tried adding the library options to the LDFLAGS variable but that doesn't seem to work either.
View 3 Replies
View Related
Jul 16, 2010
I want to learn to write an USB driver on linux 2.6.x I tried to find some documents but i could not find documents for it . Most of it gave direct driver code as reference.
View 1 Replies
View Related
Feb 26, 2010
I want to write a program (in C), which does 4 or 6 simultaneous calculation. Is there away of doing something like:
do at the same time{
Core 1 do:
this_thing_1
[code]....
View 3 Replies
View Related
Feb 25, 2010
I am trying to write a gui app with python2.6.4 and wx on win XP. I am attempting to resize an image with Imagemagick from within the program using os.popen and os.system in a thread.
Code:
os.popen("mogrify -resize " + str(x) + "x" + str(y) + "!" + " images/static/" + my_ref + ".gif")
orCode:
os.system("mogrify -resize " + str(x) + "x" + str(y) + "!" + " images/static/" + my_ref + ".gif")
they both work as far as resizing the image but when os.system is used a command shell opens during the mogrify and when os.popen is used the command shell does not show but the rest of the program freezes until mogrify is done.
I would prefer that the program did not freeze during this process and the command shell did not show.I have tried using wx to scale the image but the scaled image looks crappy.anyway is there a way to use os.system and not have the shell show?
View 2 Replies
View Related