419 Archived Topics

Remove Filter
Member Avatar for lewashby

I have a 120 Gig iPod classic but I think it's HD must be getting some bad places, it at leat 3 years old, but I think a few years older. A lot of the songs will not play, I have to plug it into my Mint desktop and delete …

Member Avatar for rubberman
0
147
Member Avatar for lewashby

greens = dict(green="#0080000", olive="#808000", lime="#00FF00") >>> print("{green} {olive} {lime}".format(**greens)) -> #0080000 #808000 #00FF00 In the program above what are green, olive, and lime in the dict function? I've seen and read about supplying a function with keyword arguments but only when the function was written with default argument. Even then …

Member Avatar for TrustyTony
0
166
Member Avatar for lewashby

I'm trying to create this site with a solid black top bar the extends from the left img all the way to the right of the screen, then add some text on top of the horizontal block. I created the block just find but when I went to add text …

Member Avatar for JorgeM
0
249
Member Avatar for lewashby

I have a Ubiquiti radio in the house and I think it's a 5.2 GHz. I did a scan to see if it could see my router's SSID but it could not. Could that be becaue my router may be a 2.4 GHz AP? Can one see the tother, does …

Member Avatar for lewashby
0
109
Member Avatar for lewashby

Server #!/usr/bin/python3 import socket from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR = (HOST, PORT) udpSerSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) udpSerSock.bind(ADDR) while(True): print('waiting for message...') data, addr = udpSerSock.recvfrom(BUFSIZ) udpSerSock.sendto(data, addr) print('...received from and returned to:', addr) udpSerSock.close() #END# Client #!/usr/bin/python3 import socket HOST = …

Member Avatar for JasonHippy
0
356
Member Avatar for lewashby

echo ${NUM:0:2} The above is just an example of the kind of code I'M using. I need a way to represent the end of the string. Is there a way to start from the right side of a line of text instead of the left? What I'M trying to do …

Member Avatar for cfajohnson
0
203
Member Avatar for lewashby

In this line -> `tcpSerSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)` what is the first 'socket' after the '=' sign, is that refering to a socket class making tcpSerSock an object or just to a module called socket? After reading the documentation I see that socket.accept returns a connection and an address pair, …

Member Avatar for lewashby
0
906
Member Avatar for lewashby

In the following program how does the line `r.size = 150, 100` actually set the values using this line -> `size = property(getSize, setSize)`? property has two arguments, getSize & setSize, it seems to me that would only allow it so get one value and set one value. #!/usr/bin/python3 class …

Member Avatar for Gribouillis
0
215
Member Avatar for lewashby

I know python is an interpreted language but is there a way to compile your code? What if you write a program in python 3 and the user has python 2.x, or worse yet, doesn't have python at all. How can you create an executable via compiling or any other …

Member Avatar for TrustyTony
0
325
Member Avatar for lewashby

class MemberCounter: members = 0 def init(self): MemberCounter.members += 1 # m1 = MemberCounter() # m1.init() # MemberCounter.members -> 1 # m2 = MemberCounter() # m2.init() # MemberCounter.members -> 2 # m1.members -> 2 #m2.members -> 2 # m1.members = 'Two' # m1.members -> 'Two' # m2.members -> 2 In …

Member Avatar for lewashby
0
182
Member Avatar for lewashby

I'm having trouble understanding the keyword 'this' in php. When and where does it need to be used? Why can you not simply use the variable name as you would normally do when not placing a variable inside a class? In the small test case program below I can't even …

Member Avatar for minitauros
0
193
Member Avatar for lewashby

How can I write bash script to force pre-written sql quaries and inserts into my sqlite3 DB? I am currently having to run my page in a browser and then the sqlite4 DB gets edited by php commands then I have to go back into sqlite3 and manually set everything …

Member Avatar for rubberman
0
255
Member Avatar for lewashby

In my home network I have my desktop wired (eth0) to a Netgear range extender that is wirelessly linked to my Linksys AC1200 router. If I do ip route show I get the IP address of my router but not the Netgear range extender that has the association with the …

Member Avatar for JorgeM
0
119
Member Avatar for lewashby

Is there a function that I can use to find out if a file is a block device? And another for a character device. I'm trying to create a funtion that will build a string the is exactly like the result you get from running ls -l for a slightly …

Member Avatar for woooee
0
540
Member Avatar for lewashby

Does anyone know how I can set the default group for /var/log/apaches/error.log to be a part of my users group each time it is created by apache?

Member Avatar for lewashby
0
221
Member Avatar for lewashby

(Linux) `output = os.listdir()` In the above line of code I'm getting the name of the file(s) in a given directory, but how can I also get the permissions? This is what I want to see. -rwxr-xr-x 1 garrett garrett 158 Nov 23 10:49 dirlist.py drwxr-xr-x 2 garrett garrett 4096 …

Member Avatar for lewashby
0
149
Member Avatar for lewashby

<!DOCTYPE html> <html> <head> <link type='text/css' rel='stylesheet' href='style.css'/> <title>Get Started!</title> </head> <body> <p><?php echo ""; ?></p> </body> </html> I thought css needed to be imbeded or linked from the <sript> tag?

Member Avatar for JorgeM
0
56
Member Avatar for lewashby

When I run: ---`mysql> SET PASSWORD FOR 'garrett'@'localhost' = PASSWORD('abc123');` I get: ---`ERROR 1133 (42000): Can't find any matching row in the user table` Also, when I run: ---`mysql> UPDATE mysql.user SET Password=PASSWORD('abc123') WHERE User='garrett' AND Host='localhost';` I get: ---`Query OK, 0 rows affected (0.00 sec)` ---`Rows matched: 0 Changed: …

Member Avatar for lewashby
0
430
Member Avatar for lewashby

Linux Mint 15 I'm trying to run this small script located in /etc/cron.hourly/ in order to learn how to use cron but it's not running, any ideas? And the "test" script in this case has already been set to executable. garrett@garrett-bedroom /etc/cron.hourly $ cat test touch /home/garrett/Desktop/CRONTABWORKED!.txt #ENE#

Member Avatar for Spencer_1
0
634
Member Avatar for lewashby

In the code below how do I get sed's find and replace value to cary over into the output that gets redirected to the .txt file at the end? Everything else gets replaced but everything in the if statement gets left behind. # example: ./configure input-file, SSID, IP, device-name, gateway, …

Member Avatar for praom2104
0
257
Member Avatar for lewashby

I just purchased a new ASUS desktop with a 1TB HD loaded with Window$ 8. I plugged in my two linux drives (OS & home DIR) but the screen was black and nothing would show up, I removed them again and now Windows is starting up again. Any ideas?

Member Avatar for rubberman
0
103
Member Avatar for lewashby

In the following code blocks I don't see any affect that my java scipt is having on my form. Any ideas? Thanks. Form: if($row['password'] == $passwd) { echo "<html>"; echo "<body>"; echo "<script src='check.js'></script>"; echo "<form id='form1' action='changepassword.php' method='post'>"; echo "<table>"; echo "<tr><td>"; echo "New Password<center><input type='text' name='newpassword1'></td></tr></center>"; echo "<tr><td>"; …

Member Avatar for lewashby
0
269
Member Avatar for lewashby

http://www.w3resource.com/javascript/form/string-length.php In the above link I see two different JS areas, Javascript function to restrict length of user input, & Javascript code. All I'm trying to do is validate that the users password of choice is at least x characters in length. Which one of these examples is what I'm …

Member Avatar for JorgeM
0
101
Member Avatar for lewashby

delete hash from users where email='emailaddress@hotmail.com'; Why is the above line not working? I want to delete the value in the hash column in the row the contains the specified email.

Member Avatar for pritaeas
0
100
Member Avatar for lewashby

In the following program can someone please tell me why my script is skipping the first else clause and never printing "You have already changed your password"? Everything else is working fine but when I enter in a username and password that have already been entered into the system it …

Member Avatar for lewashby
0
214
Member Avatar for lewashby

$userEmail = $db->query("SELECT email FROM users WHERE email='$email'"); $userPsswd = $db->query("SELECT password FROM users WHERE email='$email'"); Can someone tell me what I've done wrong in teh two lines above? I'm getting the following errors. PHP Warning: SQLite3::query(): Unable to prepare statement: 1, near &quot;@hotmail&quot;: syntax error in /var/www/ET/password/accounts.php on line …

Member Avatar for Atli
0
2K
Member Avatar for lewashby

PHP Parse error: syntax error, unexpected end of file in /var/www/ET/password/changepassword.php on line 27 Can someone please tell me what I'm doing wrong in the following code to get the error above? <?php $db = new SQLite3('./users.db', SQLITE3_OPEN_READWRITE); if(!$db) { echo "Could not open/access DB"; } else { $userPsswd1 = …

Member Avatar for lewashby
0
525
Member Avatar for lewashby

In the following program the first strpos() function is working just just fine when searching for a matching email address in the text file as long as it's on the first line but the second entry it jumps streight to the else clause and echos "Unknown user name" even though …

Member Avatar for pixelsoul
0
176
Member Avatar for lewashby

(Linux) In the following program I'm trying to process the file accounts.txt line by line searching for a match to the form supplied variable '$email'. The function fgets() is stepping though the file line by line correctly but my attempts at using preg_match() and or strpos() to determine if that …

Member Avatar for lewashby
0
159
Member Avatar for lewashby

(Linux) In the following code all I'm trying to do is open a file but evertime I run this script the fopen function jumps right to the die() function. Any ideas? The file accounts.txt does exist in the same directory, and I also tried refrencing the file via ./accounts.txt . …

Member Avatar for lewashby
0
167
Member Avatar for lewashby

In the script below second & third line are working but not the first and fourth. The reason is because I am replacing the whole line, I actually only need to replace what's to the right of the '=' sign. Any idea on how I can accomplish this in sed? …

Member Avatar for djbobyd
0
254
Member Avatar for lewashby

I'm getting this -> [Tue Sep 10 10:42:46 2013] [error] [client 127.0.0.1] PHP Warning: SQLite3::exec(): unable to open database file in /var/www/ET/insert.php on line 21, referer: http://localhost/ET/ I changed the owner of the DB file (et.sqlite3) to www-data and now this is what I'm getting. Before I changed the owner …

Member Avatar for lewashby
0
4K
Member Avatar for lewashby

In the following code the Submit button actualy says "Submit Query" on my page but I can not find anywhere that I have written "Submit Query" in the file. Any ideas? I would like to change the second one. <html> <head> <title>Simiply Query</title> <link rel="stylesheet" type="text/css" href="mystyles.css" media="screen" /> </head> …

Member Avatar for lewashby
0
102
Member Avatar for lewashby

In the following small c++ program I'm trying to add '0' (zero characters) until the number of characters in the users input can be evenly divided by 3. I'v got it working except that it doesn't work when only on character is feed to the program. input -> 123 -> …

Member Avatar for vijayan121
0
182
Member Avatar for lewashby

I created a small table with one entrey with three columns but I can't get it to show up in my php code. I'm not really doing anything with the form variables right now I'm mainly focused on getting the code below that to query my SQLite DB. <?php // …

Member Avatar for pritaeas
0
384
Member Avatar for lewashby

I can not get a page to load from the following php program. When I load the page in the browser all I get is a blank white page. I also looked in the /var/log/apache2/error.log file and found this line -> [Sun Aug 25 21:36:37 2013] [error] [client 127.0.0.1] PHP …

Member Avatar for pritaeas
0
278
Member Avatar for lewashby

I'm getting `sed: -e expression #1, char 35: unterminated s' command` when I try and run the following script. Any ideas? #/bin/bash # # # This script is to be used to re-write a configuration file # replacing select values, SSID, IP, device name, gateway, # and frequency with the …

Member Avatar for lewashby
0
323
Member Avatar for lewashby

Using Linux. I'm trying to learn PHP so I'm also going to need to learn some MySQL to work with my PHP code. Do I need mysql client or mysql server? I thought it was on my system but after issuing the command 'mysql' I got the following error. garrett@bedroom …

Member Avatar for Trap910
0
282
Member Avatar for lewashby

In the following code I'm trying to figure out what InitDB is? I need to reconfigure these files for a particular website and to use SQLite. http://www.html-form-guide.com/php-form/php-registration-form.html <?PHP require_once("./include/fg_membersite.php"); $fgmembersite = new FGMembersite(); //Provide your site name here $fgmembersite->SetWebsiteName('user11.com'); //Provide the email address where you want to get notifications $fgmembersite->SetAdminEmail('user11@user11.com'); …

Member Avatar for veedeoo
0
794
Member Avatar for lewashby

Any idea why this is happening? garrett@bedroom ~ $ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Member Avatar for lewashby
0
226
Member Avatar for lewashby

(Linux System) Everytime I try to log into MySQL or create a database I get "Access denied for user@localhost". I just recently installed mysql using apt-get install and I don't recal creating a password or anything for it when I installed it. Any ideas?

Member Avatar for 1stDAN
0
172
Member Avatar for lewashby

In the following script I need to know if the configuration files is for a 2.4 or a 5.2 radio. This info is found in the filename so I'm trying to use grep -l *2.4* to find out if it's a 2.4 config file or not. If it's not the …

Member Avatar for lewashby
0
413
Member Avatar for lewashby

I How can I get the output from grep into a variable? In the following program I've tried the SSID line two ways but I am not getting what I want. `SSID=$(grep) ${FILE} -o empty-ssid` Gives me this garrett@bedroom ~/Desktop/folder/project $ ./testScript.sh ../OLD-172.28.50.30-system.cfg Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep …

Member Avatar for lewashby
0
685
Member Avatar for lewashby

In the following program everything works fine when I enter 5 or 8, but if I enter 4 or 7 the program crashes with a Segmentation fault error. I'm just trying to add zeros until the number of characters in string is evenly divisible by 3 and I'm doing so …

Member Avatar for lewashby
0
172
Member Avatar for lewashby

How could I get the file name and the permissions to a file as a string? This is on a Linux system.

Member Avatar for james.lu.75491856
0
225
Member Avatar for lewashby

Any ideas on some good beginner projects for PHP? I'd like to at, some point in the future, get into front end development and although I have a little self taught programming knowledge I don't have any real work experience in I.T. or programming at all, just the programs you …

Member Avatar for diafol
0
179
Member Avatar for lewashby

I use Linux & Rhythmbox to manage my iPod but that is blocking me from being able to use the .aax audio book file from audible.com The .aax files work well with iTunes but since I don't use iTunes anymore I'm kinda out of luck. I could manually place the …

Member Avatar for lewashby
0
276
Member Avatar for lewashby

(Linux) In the following program when the command python permissions.ph is issued I simply get another prompt, but when python3 permissions.py is issued I get the error below. Why does python2 see tkinter but python 3 doesn't? garrett@bedroom ~/Projects/TestArea $ python permissions.py garrett@bedroom ~/Projects/TestArea $ python3 permissions.py Traceback (most recent …

Member Avatar for vegaseat
0
1K
Member Avatar for lewashby

I'm using LinuxMint 15. I'm getting the following errors when I tried to install the AMD CATALYS 13.1 Legacy driver. Any ideas what's wrong and what I can do? garrett@garrett-bedroom ~ $ cat /usr/share/ati/fglrx-install.log Detected a previous installation, /usr/share/ati/amd-uninstall.sh Dryrun uninstall succeeded continuing with installation. Check if system has the …

0
173
Member Avatar for lewashby

I'm looking throug the documentation at python.org for modules and functions allow me to do basic operations on in a Linux file system. I need to do simple things like list the file and folders in a directory 'ls' and change director 'cd'. I found these two pages that looked …

Member Avatar for lewashby
0
146

The End.