Kruptein 15 Posting Whiz in Training
OK thanks!
I've seen on a lot of sites that when you scroll down a text, the background image stays the same; If I scroll down the image stays on the place and the piece of text that can't fit on the image height is shown on a white background;
how can I make the image scroll down with the text?
Maybe you can use symlinks? if you are on ubuntu though I don't know if that exists on windows
I can access my apache server on my localhost, but not on my external ip
I don't know how I can make this possible in my Dlink router (DIR-825)
Can someone help me ?
I currently have my website running on a host: combell
but over a half-year I have to upgrade; caus I think it costs very much (although for a student) I'm thinking of start an own server on my laptop;
some problems:
please help me with those problems!
I tried Django because there is a realy handy tutorial on the site itself.
It was really fun to make the app, the tutorials I found about ruby where less attractive so I didn't do them (yet)
So now I've 2 problems:
Python Django: Good Tutorial
Ruby on rails: used by known sites (which probably has a reason)
Probably a friend of me will help me with programming, but he has never programmed before (except some excel vba @ school)
I saw ruby has a very good tutorial for beginners: http://tryruby.sophrinix.com/
which python doesn't have...
Still can't choose; please help me =)
I think it is just marketing. It took 15 years to go from 1.0 to 2.0
How can 3.0 appear so soon?
Because the web has become more and more important..
There are more internet users and more programmers/developers
?
I do php coding for some time and want to learn something new.
After some researsh I ended up with 2 languages/frameworks but I can't choose between them.
I'm a python programmer so python Django might be easier to start with.
But I don't know a well-known website which is made with Django, while there are a lot of sites using ruby (twitter,wakoopa,...)
They say python is faster, but ruby has better javascript/Ajax implementation
What should I choose?
What do you use? (probably ruby cause I post this on the ruby forum)
If you need to know how cron works: some info from a random site
To get the date:
<?php
// outputs e.g. somefile.txt was last modified: December 29 2002 22:16:23.
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>
src: php.net
I don't know with which file you want to compare so I can't say something about that..
If you don't get it just ask =)
I don't see the diference between them except the fact the second is better coded
and can I ask why you import __future__.division ??
Why would mysql support a version of a concurent?
you will probably using cron?
and I think you might be able to get the date (of the file) from the server
and then compare it with the local file.?
okay, and what is your question?
Ah, stupid, I did: str(i).split().strip("'")
instead of str(i).strip().split("'")
:f
thanks for the help anyway
I have the following code:
but for some reason it just won't work if I touch the i
the query self works, cause if I just do .Append(str(i)) without the split strip it returns all the tables..
def mysql_table(self):
self.list_box_3.Set([])
try:
self.cursor.execute("SHOW TABLES;")
self.query = self.cursor.fetchall()
except:
self.log("error")
for i in self.query:
i = str(i).split().strip("'")[1]
self.list_box_3.Append(str(i))
No...
Every FTP server has an other configuration, so it would be very messy to create a script to get what I want from the ftp.dir command
ftp.nlst works fine and gives me a list with all the files/dirs.
but I need something that when I give a name ftp will return what it is: folder or file.
Is this possible with the ftp.dir command if I have the filename?
(It would be handy if it was just for me, but it's a program I'm writing for a lot of people with different ftp servers.)
I'm fetching a list with all files/folders on a ftp-server,
I want to put a [F] before a folder, and leave files like they are,
but I can't find a way to check if it's a file or a dir...
I already tried:
from ftplib import FTP
import os
ftp = FTP(self.host)
listdir = self.ftp.nlst()
for i in listdir:
if(self.ftp.sendcmd(os.path.isdir(bool(self.ftpdir + "/" + i)))):
self.list_box_2.Append("[F] " + i)
But this ends in an error:
Traceback (most recent call last):
File "./DCM/dcm", line 714, in ftp_start
self.start_ftp()
File "./DCM/dcm", line 671, in start_ftp
self.ftp_show_dir()
File "./DCM/dcm", line 678, in ftp_show_dir
if(self.ftp.sendcmd(os.path.isdir(str(self.ftpdir + "/" + i)))):
File "/usr/lib/python2.6/ftplib.py", line 242, in sendcmd
self.putcmd(cmd)
File "/usr/lib/python2.6/ftplib.py", line 177, in putcmd
self.putline(line)
File "/usr/lib/python2.6/ftplib.py", line 170, in putline
line = line + CRLF
TypeError: unsupported operand type(s) for +: 'bool' and 'str'
It didn't work,
I tried: self.opframe = OptionFrame(MyFrame(self), -1, "")
But in commandline the program keeps running..
As far as I can see, I don't know why genieuk can find it confusing,
it is advanced regex and he wants to ask someone who knows MORE about regex? ehr.
(Their is not a thread about wakoopa yet so I thought I could make one)
If you don't know Wakoopa is a social website like facebook, but for computer applications. You download a tracker which 'tracks' which apps you use for how long and sends them to the site, you have a ranking system, ....
My question is: Do you use wakoopa and what is your rank?
Mine is Expert =D SNIP
It is very usefull!
I do have an invitation, but I don't have anybody to share my joy with :(
I don't have buddies =D
maybe google wave does?
CMS is very user friendly, but does it allow to write your own php code?
I mean the "X" button =)
I open it with:
self.opframe = OptionFrame(None, -1, "")
self.opframe.Show()
there is no code for closing it ...
btw OptionFrame is a class
class OptionFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: OptionFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
....
I have 2 frames in my wxpython program,
MyFrame and OptionFrame
if I start my program it shows MyFrame, and if I end it, the frame disappears and the program stops.
If I start my program and choose to show the option frame, it will show it, but if I now close both frames the program keeps running in the background..
How can I stop this?
well I found out,
it had to be: os.system("xterm ~/localhost.desktop")
You used an inner join after the where clause..
I found out the launcher is actually called: localhost.desktop
but if I do: os.system("~/localhost.desktop")
it just starts my standard editor and shows the script...
First: What is the error you get
Second: why are you using different indents?
this is a) very ugly and b) will give errors
How can I start a launcher from python?
if I do: os.system("~/localhost")
it just returns a number (probably a process id or something)
if this is not possible, how can I start from python a terminal window
and execute a code in that terminal?
(without closing the python script)
Thanks in advance =)
Nevermind I found it,
I had to do: if(dig_sum(arr[c]) > 100):
instead of if(dig_sum(i) > 100):
Stupid I forgot to do i += 1 :f
but I didn't find a digital_sum method on the internet so I made my own one :D,
okay now it gives me a result with a dig_sum of 93 :(
#!/usr/bin/python
def dig_sum(n):
''' Prints the digital sum of number n. '''
return sum([int(each_numeral) for each_numeral in str(n)])
def avo(i,j,k,c):
k = j
j = i + j
i = k
arr.append(j)
c += 1
if(dig_sum(i) > 100):
print "solved:" + str(arr[c])
else:
avo(i,j,k,c)
i = 1 #num 1
j = 1 #num 2
k = 0 #res
c = 1
arr = [i,j]
avo(i,j,k,c)
Hi I'm trying to find a way to find the first avogadro cipher whose digital sum exceeds 100,
I've come to:
#!/usr/bin/python
def dig_sum(n):
lst = list(str(n))
ln = len(lst)
sm = 0
while(i < ln):
sm += int(lst[i])
return sm
def avo(i,j,k,c):
k = j
j = i + j
i = k
arr.append(j)
c += 1
print arr
if(dig_sum(i) > 100):
print "solved:" + arr[c]
else:
avo(i,j,k,c)
i = 1 #num 1
j = 1 #num 2
k = 0 #reserve
c = 1 #turns
arr = [i,j]
avo(i,j,k,c)
but it just stops working after it has printed 21 :o
what have I done wrong?
Okay, now I do understand :)
Thanks a lot!
I will tell why I should use joins,...
I want to get the region_name field (so I already need table regions)
and I want only those regions that are from the nation_id I give,
(only regions with nation_id = 5 f.e.)
And from those I want to see if the region has both conditions..
I hope you get my point?
btw I still don't get why it should be OR, but If you say so, it will be =)
(I just don't get why you should OR when BOTH conditions are true.., for the rest I want to say thanks for telling me it should be or)
btw the 'OR' solved it :)
No I can't drop the nation_id :s
I will include some attachments..
Can you tell how you fixed it, to solve the same problem for other users.
But both conditions have to be true, :s?
try this:
for WORD in $SEARCHQUERY
do
GREPINPUT = $GREPINPUT + " | grep --ignore-case --files-with-matches -e '$WORD'";
done
btw do you get an error message? if yes, which one?
headers are the way to go
header('location:?Page=2');
// fullway: header('Location:./index.php?Page=2');
then to get the 2 you have todo: $page = $_GET['Page']; //$page will be 2
I have this table(building_lvl): lvl | building_id | region_id
And I want to get the region_id for which building_id=3 has lvl 2 and building_id=2 has lvl 5
SELECT * FROM building_lvl INNER JOIN regions ON regions.region_id = building_lvl.region_id WHERE ((building_lvl.building_id='3') && (building_lvl.lvl > 1)) && ((building_lvl.building_id='2') && (building_lvl.lvl > 4)) && (regions.nation_id = '17');
but this gives an empty set, why?
(and I'm sure there is a region_id which has this conditions)
Woohoow I received my test-account today =D
I can use the google wave preview version now
a) You have a problem with your defined br
b) You have to backslash your '
as you can see in your source code above there are large blue parts that are caused bye: Don't know
You should write that as: Don\'t know
I think it has to be: def func(string = "something.txt"):
You have to do:
echo '<form method ="get" action = "tele.php">
Phone:
<input type = "text" name ="number" value= "">
<input type="text" name="fname" value="' . $tesing . '">
<br>';
@woee: I did exactly the same in an other program and there wxglade does change!
P.S. it's wxpython not pygtk
@sneekula: I made a program with wxglade, I added some functions in the code, but when I ran the script the entry values are not updated like I thought they would...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Sat Nov 7 12:15:47 2009
import wx
# begin wxGlade: extracode
# end wxGlade
class game(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: game.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.extra10 = wx.StaticText(self, -1, "Name")
self.extra101 = wx.TextCtrl(self, -1, "")
self.extra11 = wx.StaticText(self, -1, "Money")
self.extra111 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.extra30 = wx.StaticText(self, -1, "Jackpot")
self.extra301 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.extra20 = wx.StaticText(self, -1, "Name")
self.extra201 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.extra21 = wx.StaticText(self, -1, "Money")
self.extra211 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.info10 = wx.StaticText(self, -1, "Name")
self.info11 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.info20 = wx.StaticText(self, -1, "Owned by")
self.info21 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.info30 = wx.StaticText(self, -1, "extra")
self.info31 = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY)
self.nextturn = wx.Button(self, -1, "Next Turn")
self.buybutton = wx.Button(self, -1, "Buy")
self.otherbutton = wx.Button(self, -1, "Other")
# Menu Bar
self.menubar2 = wx.MenuBar()
self.SetMenuBar(self.menubar2)
# Menu Bar end
self.status = self.CreateStatusBar(1, 0)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.next_turn, self.nextturn)
self.Bind(wx.EVT_BUTTON, self.buy, self.buybutton)
# end wxGlade
global names
global money
def __set_properties(self):
# begin wxGlade: game.__set_properties
self.SetTitle("frame_2")
self.buybutton.Enable(False)
self.otherbutton.Enable(False)
self.status.SetStatusWidths([-1])
# statusbar fields
status_fields = ["frame_2_statusbar"]
for i in …
Do You mean I have to give whole my code and/or a screenshot of my wxglade window?
Or will you even with that not be able to help me?
Yeah, I wanted to find it quickly, but on the internet there wasn't much help.
So I kept doing things until I finally found it :)
In that case I get the errors:
(python:25618): Gtk-CRITICAL **: gtk_entry_buffer_insert_text: assertion `GTK_IS_ENTRY_BUFFER (buffer)' failed
(python:25618): Gtk-CRITICAL **: gtk_entry_buffer_insert_text: assertion `GTK_IS_ENTRY_BUFFER (buffer)' failed
(python:25618): Gtk-CRITICAL **: gtk_entry_buffer_insert_text: assertion `GTK_IS_ENTRY_BUFFER (buffer)' failed
(python:25618): Gtk-CRITICAL **: gtk_entry_buffer_insert_text: assertion `GTK_IS_ENTRY_BUFFER (buffer)' failed
If I run the following code the textCtrl's aren't updated, they stay empty, but if I do print self.extra201.GetValue()
I get the value that is set with the code beneath.
self.extra101.SetValue(names[1])
self.extra201.SetValue(names[2])
self.extra111.SetValue(str(money[1]))
self.extra211.SetValue(str(money[2]))
Why isn't it update !! :(