woooee 814 Nearly a Posting Maven

If you are using a Linux system, then it should be /dev/ttyS0, etc. If it is a USB connection, try PyUSB

woooee 814 Nearly a Posting Maven

Take a look at "Function Arguments" and "The Return Statement" Click Here You can also Google for instance objects (also called instance variables) if you want to learn more about classes.

woooee 814 Nearly a Posting Maven

Tkinter does not have a Circle class; you use create_oval with circle dimensions. Note that you call the function once and have it call itself recursively for as many times as you want.

try:
    import Tkinter as tk
except:
    import tkinter as tk

class TestAfter():
    def __init__(self):
        self.root=tk.Tk()
        self.ctr = 3
        self.canvas = tk.Canvas(self.root, width=500, height=500)
        self.canvas.grid()
        self.root.after(750, self.update)

        self.root.mainloop()

    def update(self):
        colors = ["black", "red", "green", "blue"]

        if self.ctr > 0:
            start = 50*self.ctr  ## use same values for x & y
            end = start+50
            self.canvas.create_oval(start, start, end, end,
                               fill=colors[self.ctr], width=2)
            self.ctr -= 1
            self.root.after(750, self.update)

TA=TestAfter()
woooee 814 Nearly a Posting Maven

GUI's have their own "sleep" type methods that should be used. However each GUI uses a different function name so it depends on the GUI toolkit you are using.

woooee 814 Nearly a Posting Maven

use canvas.create_image instead of configure, and then place whatever objects on top of it.

woooee 814 Nearly a Posting Maven

One single class and a for loop will work fine for that. Just open the file under the for loop and use those parameters. If you want to save something, say references to the specific panels, use a dictionary: key=panel number, pointing to a list of whatever you want.

woooee 814 Nearly a Posting Maven

To set the background from a list for example would be like the following, and you would use other input parameters in a similar manner, although I don't think I understood your question correctly.

import wx

class mainFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title,style=wx.MINIMIZE_BOX|wx.SYSTEM_MENU|wx.CAPTION)

        mainBox = wx.BoxSizer(wx.VERTICAL)
        tiles = wx.GridSizer(3, 3, 60, 60)

        colors = ("red", "blue", "green", "yellow", "white",
                  "lightgreen", "lightblue", "purple", "brown")
        for ctr in range(0,9):
            panel = wx.Panel(self, -1, style=wx.DOUBLE_BORDER)
            txt=wx.StaticText(panel, label="title "+ str(ctr+1))
            panel.SetBackgroundColour(colors[ctr])
            tiles.Add(panel, flag=wx.EXPAND)
        mainBox.Add(tiles, 1, wx.EXPAND | wx.TOP| wx.ALL, 30)
        self.SetSizer(mainBox)

        self.SetBackgroundColour(wx.Colour(120,200,200,10))
        self.Maximize()
        self.Show()


app = wx.App(0)
frame = mainFrame(None, -1, 'System Overview.py')
app.MainLoop()
woooee 814 Nearly a Posting Maven

I agree that you are doing it the hard way. Note that dollars is multiplied by two after the print and the addition to total

#get the ending limit
days = int(raw_input('How manys days were worked? '))
total = 0
dollars = 0.02
#print table headings
print('\nDays\tDollars')
print('------------------------------')


#print the days and the amount of money that was earned that day
for today in range(days):
    total += dollars  ## 0.02 on first pass
    print(today+1, '\t', '$',format(dollars,',.2f'))
    dollars *=  2  ## set for next pass
print('the total amount of money you earned is: $',format(total,',.2f'))
woooee 814 Nearly a Posting Maven

Python does have a goto add on Click Here but it was an April Fool's joke so I don't know if it works or not (and don't care as I will not be using it).

woooee 814 Nearly a Posting Maven

Python does have os.linesep which is perhaps what the OP was referring to. In Python, "\n" will be converted to the proper end of record termination for the OS used.

woooee 814 Nearly a Posting Maven

Does the file have more than one taxon? In the example you posted there is only one so all of the solutions are for one only. Try this as a hint, although there are other ways to do it.

handle = open(fname, "r")
all_data = handle.read()
print all_data.split("taxon")
woooee 814 Nearly a Posting Maven

event.x and event.y have to be within the boundaries of the label. An example using a canvas but similar to what you want

try:
    import Tkinter as tk     ## Python 2.x
except ImportError:
    import tkinter as tk     ## Python 3.x

def point(event):
   x = event.x
   y = event.y
   print "x, y", x, y, type(x)

   ## draw a point at the mouse click location
   canvas.create_oval(x, y, x+5, y+5, fill="black")

   ## calculate the square clicked based on event.x and event.y
   ctr_x = 0
   while x > 100:
      ctr_x += 1
      x -= 100

   ctr_y = 0
   while y > 100:
      ctr_y += 1
      y -= 100

   print "in square (%d, %d)" % (ctr_x, ctr_y)

##-----------------------------------------------------------
root = tk.Tk()
root.title('Canvas Test')
canvas = tk.Canvas(root, width =300, height=300)

canvas.create_line(1, 100, 300, 100, width=3)
canvas.create_line(1, 200, 300, 200, width=3)

canvas.create_line(100, 1, 100, 300, width=3)
canvas.create_line(200, 1, 200, 300, width=3)

canvas.create_text(50,50, text='0', fill='blue', font=('verdana', 36))
canvas.create_text(150,150, text='X', fill='yellow', font=('verdana', 36))

canvas.pack()
canvas.bind("<Button-1>", point)
root.mainloop()
woooee 814 Nearly a Posting Maven

Please mark the the thread "Solved" so as to not waste other's time looking at an already solved thread.

woooee 814 Nearly a Posting Maven

Once you get the value it is a normal variable and you can do anything with it that you can do to a normal variable. I would suggest that you consider putting everything under one class instead of here's a function, there's a class, here's another function, etc.

try:
    import Tkinter as tk     ## Python 2.x
except ImportError:
    import tkinter as tk     ## Python 3.x

def another_function(input_var):
    print "another function", input_var

class TestClass():
    def __init__(self):
        root1 = tk.Tk()
        root1.title("Vreme")
        naziv = "Vreme"
        L1 = tk.Label(root1, text="Zadržavanje: ")
        L1.place(x=10, y=30)
        self.E1 = tk.Entry(root1, bd = 2)
        self.E1.insert(0, "Test string")
        self.E1.place(x=100, y=30)
        root1.geometry("300x100+300+200")
##    tk.Button(root1, text="OK", command = lambda: izmeni(E1.get(),root1,vreme1,naziv), width=10).place(x=130, y=65)
        tk.Button(root1, text="OK", command = self.izmeni, width=10).place(x=130, y=65)
        root1.mainloop()

    def izmeni(self):
        value = self.E1.get()
        print "izmeni -->", value
        another_function(value)
        self.function_in_class(value)

    def function_in_class(self, input_var):
        print "functionin_class -->", input_var

TC=TestClass()
woooee 814 Nearly a Posting Maven

You should be able to come up with a generic function that takes any number of dictionaries of any length and calculates the average.

a = {1:[1, 2, 3],
     2:[3,4,5],
     3:[6,7,8]
     }

b = {1:[3,7,4],
     2:[8,2,9]
     }

c = {1:[4,7,1],
     2:[5,5,9],
     3:[2,3,7],
     4:[9, 10, 11]
     }


def average(tuple_of_dicts):  ## or list of dicts
    """ receives a tuple of one or more dictionaries and
        averages the grades
    """
    total_grades=0
    total_num=0
    for each_dictionary in tuple_of_dicts:
        for key in each_dictionary:
            grades_list = each_dictionary[key]
            for grade in grades_list:
                total_grades += grade
                total_num += 1
    return float(total_grades)/total_num

print "One dictionary =", average([a])  ## can use a tuple or list
print "Two dictionaries =", average((a, b))
print "Three dictionaries =", average([a, b, c])
woooee 814 Nearly a Posting Maven

I would suggest that you use a button instead of a label, which can execute a funtion when it is clicked. Also, the name "list" is already used by Python so you should not override it, although you never use the variable "list" in the code posted so the "list" code can just be deleted.

woooee 814 Nearly a Posting Maven

There is a typo in get_average that you should be able to run down from the error messages, or at least begin to learn how. Using descriptive variable names would help you with this, as well as help us understand the program. Print the return from get_average and see if it can be summed. Note that get_average returns a kind of sum of averages, not the average. Also, you should loop through containers like a dictionary so your funtion can handle containers that have any number of items instead of

return average(p[1]) + average(p[2]) + average(p[3])

Usually we test programs with known values that should produce known results to tell if the program is calculating correctly or not, so what are the results supposed to be?.

woooee 814 Nearly a Posting Maven

April Fools Day

The timing of this day of pranks seems to be related to the arrival of spring,
when nature "fools" mankind with fickle weather, according to the Encyclopedia
of Religion and the Encyclopedia Britannica.

woooee 814 Nearly a Posting Maven

First, remove punctuation (? , . etc). Next all words should be lower() case as an upper case word is different to the computer than a lower case word. To print use the dictionary's key as below, although this code does not do any of the other above suggestions

data="""I love the python programming
 How love the python programming?
 We love the python programming
 Do you like python for kids?
 I like Hello World Computer Programming for Kids and Other Beginners."""

count = {}
for word in data.split():
    if word not in count:
        count[word] = 0
    count[word] += 1

## access the dictionary by key
for word in count:
    print "The word", word, "was found", count[word], "times"

print "\nThere are %d unique words (if Upper and lower case," % (len(count))
print "and words with punctuation, are different words)"
woooee 814 Nearly a Posting Maven

It would be something like

    cipher = short_str.find(letter, cipher)
    if cipher > -1:
       print cipher + 1,    
    else:
      print "_",
woooee 814 Nearly a Posting Maven

It appears that user name or password are None as the program prints the message and then exits, but it should be sys.exit(0) instead of exit(0).

woooee 814 Nearly a Posting Maven

You can get around the "Enter problem" by catching the input as a tuple and testing for length.

lit="\nPlease enter odometer reading and gallons used (odometer gallons) [Enter if done]: "
ret_tuple=input(lit).split()
if len(ret_tuple) > 1:
    odom = int(ret_tuple[0])  
    gallons = int(ret_tuple[1])
    print odom, gallons

## test while loop input with exit="Enter"
repeat="0" 
while len(repeat):
    repeat=input() ## can be string or tuple as long as it has a len()
    print repeat
woooee 814 Nearly a Posting Maven

You append everything to converted as one list, i.e. you have to use a sub-list and append it each time the list breaks.

eq= ['MPNRRRCKLSTAISTVATLAIASPCAYFLVYEPTASAKPAAKHYEFKQAASIADLPGEVLDAISQGLSQFGINL',
      'MQLVDRVRGAVTGMSRRLVVGAVGAALVSGLVGAVGGTATAGAFSRPGLPVEYLQVPSPSMGRSELPGWLQA',
      'GLVGLAGGAATAGAFSRPGLPVEYLQVPSPSMGRDIKVQFQSGGNNSPAVYLLDGLRAQDDYNGWDINTPAFEWACGKAGCQTYKWETFLTSELPQWLSANRAVKPTGSAAIGLSMAGSSAMILAAYHPQQFIYAGSLSALL']

polarity = { 'A': 0.000, 'R': 52.000, 'N':  3.380, 'D': 49.700, 'C':  1.480,  
             'Q': 3.530, 'E': 49.900, 'G':  0.000, 'H': 51.600, 'I':  0.130,  
             'L': 0.130, 'K': 49.500, 'M':  1.430, 'F':  0.350, 'P':  1.580,  
             'S': 1.670, 'T':  1.660, 'W':  2.100, 'Y':  1.610, 'V':  0.130, 
            }

each_list = []
for x in seq:
    converted = []  ## zero elements for each new "x"
    seq2 = x[0:39]   
    for y in seq2:
        converted.append(polarity[y]) 
    each_list.append(converted)  ## as sub-list
for convert in each_list:
    print convert
woooee 814 Nearly a Posting Maven
  1. ask for each value separately. Otherwise "Enter if done" returns a "need 2 values to unpack" error.
  2. you can do something like what is in your program but it returns a string

       odom2, gallons = input("\nPlease enter odometer reading and gallons used (odometer gallons) [Enter if done]: ").split()
        print odom2, type(odom2), gallons, type(gallons)
    
  3. this works but seems very cumbersome

    odom2, gallons = (int(x) for x in raw_input("\nPlease enter odometer reading and gallons used (odometer gallons) [Enter if done]: ").split())
    print odom2, type(odom2), gallons, type(gallons)
    
woooee 814 Nearly a Posting Maven

You can do it several ways. I would replace the run_tests function with a function that contains the menu and calls the other functions. The purpose of a class is to encapsulate everything in one object. So, you open the file once in the beginning, do all the transactions/menu within the class, and save/pickle the file at the end. One of the tutorials on classes Click Here.

woooee 814 Nearly a Posting Maven

I don't know anything about shelve. This is a simple, cobbled together example that pickles a list of lists.

import pickle
import random

class Account:
    def __init__ (self):
        self.open_file()
        self.run_tests()

    def deposit(self, amt, comments=""):
        self.balance += amt
        self.data.append([self.balance, amt, 0, self.user, comments])
        print "depositing  %9.2f --> balance is now %9.2f" % (amt, self.balance)

    def exit_program(self):
        with open("./test_accounts.text", "w") as fp_out:
            pickle.dump(self.data, fp_out)

    def open_file(self):
        """ record layout = 
            [balance, amount_added, amount_withdrawn, user_id, comments]
        """
        with open("./test_accounts.text", "r") as fp:
            self.data = pickle.load(fp)
        latest_transaction = self.data[-1]
        self.balance = float(latest_transaction[0])
        print "testing open_file", self.balance, latest_transaction

    def print_all_recs(self):
        print "\n  Balance   Deposit  Withdraw       User  Comments"
        for rec in self.data:
            for ctr, fmt in enumerate(['%9.2f', '%9.2f', '%9.2f', '%10s', '%s']):
                print fmt % rec[ctr],
            print


    def run_tests(self):
        """ simulate transactions
        """
        self.user = 123
        for ctr in range(10):
            dollars = random.randint(1, 100)
            cents = random.randint(1, 99)
            amt = dollars + cents/100.0
            if ctr % 2:
                self.withdrawal(amt, str(ctr))
            else:
                self.deposit(amt, str(ctr))

        self.print_all_recs()

        ## simulate exit menu option
        self.exit_program()

    def withdrawal(self, amt, comments=""):
        if self.balance >= amt:
            self.balance -= amt
            self.data.append([self.balance, 0, amt, self.user, comments])
            print "withdrawing %9.2f --> balance is now %9.2f" % (amt, self.balance)
        else:
            print "\n%9.2f amount too large. You can only withdraw a maximum of %9.2f"\
                  % (amt, self.balance)

## initial balance
## do on first run only
initial=[[100.00, 0, 0, 999, "Initial balance"]]
fp=open("./test_accounts.text", "w")
pickle.dump(initial, fp) 
fp.close()

A=Account()
woooee 814 Nearly a Posting Maven

You do not test for the password for the user so if any user's password is found it will return True. This works for me but again will accept any user's password (and note the added print statements to see what is happening).

import crypt

line="victim: HX9LLTdc/jiDE: 503:100:Iama Victim:/home/victim:/bin/sh"
cryptPass = line.split(':')[1].strip(' ')
salt = cryptPass[0:2]
print "cryptPass",  cryptPass, salt

test_file="""apple
orange
egg
lemon
grapes
secret
strawberry
password"""

dictFile = test_file.split("\n")  
for word in dictFile:
    cryptWord = crypt.crypt(word, salt)
    print "     ", cryptWord, cryptPass,
    if cryptWord == cryptPass:
        print "FOUND",
    print
woooee 814 Nearly a Posting Maven

As Tony said getters and setters are not used in Python as it is inefficient to create a function just to change or return some variable when that can be done directly as the following example illustrates

class Priority():

    def __init__(self, priority):
        self.priority = priority

Pr = Priority(1)
print Pr.priority     ## getter
Pr.priority = 9       ## setter
print Pr.priority     ## getter

There are many discussions on the web like this one if you want to read more about it.

woooee 814 Nearly a Posting Maven

I can't seem to get pickle.dumps (or f.write..tried that earlier) to save without saving over itself.

     f =open('pettycash.txt', 'wb')

Instead of write mode, which creates a new file each time, open the file in append mode: see the example at Click Here where these lines are explained

def logError(msg):
   err = open("Errors.log","a")
woooee 814 Nearly a Posting Maven

names = nmls
means let both point to the same block of memory, so both get updated.
names = nmls[:] note the colon
means names is now a copy (complete slice) of nmls. You can also use copy() and deepcopy() to get a copy of the list Click Here .

woooee 814 Nearly a Posting Maven

Glad to know you figured it out. Good luck with programming in the future.

woooee 814 Nearly a Posting Maven

Your code can return one, two, or three values. The error occurs when less (or more) than three vaules are returned (i.e. dice1, dice2, dice3 and only two are returned from the function). Usually you would catch the return with a tuple Click Here since you want to catch any number of dice returned.

dice1, dice2, dice3 = numb(dice)
## becomes
dice_returned=numb(dice)
print len(dice_returned), "created"
## and to print or use individually
for dy in dice_returned:
    print dy

Also, you can use a for() loop in the function

def numb(dice):
    return_list=[]
    for ctr in range(dice):
        dy = random.randint(1, 6)
        return_list.append(dy)
    return return_list
woooee 814 Nearly a Posting Maven

For starters, your recursive call has no exit point so could easily go beyond the length of the list

    isloopy(nextcownum,data,did)

This doesn't happen because the
1: '0', 2: '4', 3: '1'
is a repetitive loop if I read this correctly (3 goes back to 1), so

    if cownum in did:
        return True

is executed. Add some print statements to show what is being processed and the contents of the lists. As I said, I am not sure I understand what you are trying to do, but think you want to return the result of the recursive call instead of "None" which is what is being returned now.

    return isloopy(nextcownum,data,did)
    ## Not
    isloopy(nextcownum,data,did)

Again, print statements will help tell what is happening.

woooee 814 Nearly a Posting Maven

That is a little complicated because I get an error on the first test lookup at

e = self.shelve[key]

because the keys are not correct. If it works for you then there is possibly a difference because of the Python version being used. If it does not work for you, take another look at Doug Hellmann's page as to how he adds data to a shelve object. Deleting is just del self.shelve[key], but you also have to set writeback=True for the changes to take place in the db. Also, Python is already using "string" and "list" and so using them in your program "redefines" them so you can not convert something to a list for example because "list" no longer points to a function. Finally, "b" will never equal 4 because it is set to one on the previous line

    def phonemenu(b):
        b = 1
        if b != 4:
jeremywduncan commented: Thank you. This homework is hard without a tutor! +0
woooee 814 Nearly a Posting Maven

You have to set writeback=True for changes to be made to the db. Doug Hellmann has a nice write up Click Here

woooee 814 Nearly a Posting Maven

The best you can do AFAIK is to bind the canvas to a button click and get the coordinates. You then check to see if the click was within the boundaries of the image. If you bind the Canvas object to a button click that calls the function clicked, the following will print the x,y coordinates. Also, the obvious, you can also attach an image to a button Click Here or a label. You can also get the coords() for the image and the bounding box Click Here

def clicked(event):
    print "image clicked", event.x, event.y
woooee 814 Nearly a Posting Maven

Try just a print statement in the if/else instead of creating tempStr. How you format the print depends on which version of Python you are using. For the "older", version 2.X way Click Here

            name_to_print = ""
            if categoryTotal <= 1:
                name_to_print = currentName

            print name_to_print, course, grade ## formatted correctly
woooee 814 Nearly a Posting Maven

You don't ever print tempStr.

TrustyTony commented: Observant +12
woooee 814 Nearly a Posting Maven

The following code does the same lookups using a list and a dictionary. Lists are sequential in memory, meaning that the program has to get the offset for the beginning of the item it wants to use, go to that offset, compare to what it wants to find, and go back and do it all over again for each element in the list. A dictionary uses a hash which creates small groups, for lack of a better term, so there is a relatively small number of lookups. For each tenfold increase in data, the dictionary's time increases by ten times also, but is still pretty fast. The list's lookup time increases by 100+ times for the same increase. One would expect the same increases for a tenfold increase in the size of each individual item being stored as that would also increase the anount of memory that has to be traversed. So it appears that you can't really decide on using a list vs. dictionary based on the number of items but have to consider the total amount of memory to be consumed.

import datetime

def add_to_list(num):
    a_list=[]
    start_time=datetime.datetime.now()
    for ctr in xrange(num):
        ##  lookup up each time to show the "cost" of lookups
        if ctr not in a_list:
            a_list.append(ctr)

    print "elapsed time:", datetime.datetime.now()-start_time


def add_to_dict(num):
    a_dict={}
    start_time=datetime.datetime.now()
    for ctr in xrange(num):
        ##  lookup up each time to show the "cost" of lookups
        if ctr not in a_dict:
            a_dict[ctr]=ctr

    print "elapsed time:", datetime.datetime.now()-start_time


for num in [1000, 10000, 100000]: …
woooee 814 Nearly a Posting Maven

Hopefully this is not confusing. You can also group all of the records for each name into a list and then process the list containing all of the records for that name.

## Not Tested
## assumes the file is already in name order
## and just reads and prints  each group

def startUp():
    print ("grade report\n").center(60).upper()
    print "name".upper(),"course".rjust(22).upper(),"grade".rjust(32).upper()
    print "-" * 60
    previousName = ""
    list_of_grades=[]
    gradeFile = open("grades.txt","r")
    for rec in gradeFile:
        name, course, grade=readRecord(rec)  
        if name != previousName:
            previousName=name
            if len(list_of_names):
                gradesLoop(list_of_names)
            list_of_names = []  ## remove previous recs
        list_of_names.append([name, course, grade])
    if len(list_of_names):
        gradesLoop(list_of_names)

def readRecord(rec_in):
    currentName = rec_in[0:20].strip()
    course = rec_in[20:50].strip()
    grade = rec_in[50:51].strip()

    return currentName, course, grade

def gradesLoop(list_of names):
    grades_total = 0
    for name, course, grade in list_of_names:
        print name
        print "    ", course, grade
        grades_total += float(grade)
    print "Testing: total of all grades", grades_total

     print "-" *60
 #-----------------------------------------------------------------------
startup()

raw_input("\nRun complete. Press the Enter key to exit.")
woooee 814 Nearly a Posting Maven

What and where do you and to print. I don't see anything in the program that prints name, etc. See Click Here for more info on reading files. Instead, we generally use something like

fp_in = open(file_name, "r")
for record in fp_in:
    # do some stuff
    print record
woooee 814 Nearly a Posting Maven

For future reference, the error was eliminated because you added the plus signs. Also, include the entire error message in the future.

print('Ok,'chara,
print('Ok, '+ chara +
woooee 814 Nearly a Posting Maven
woooee 814 Nearly a Posting Maven

A hint

from string import ascii_lowercase as letters
print letters[-1:]
print letters[-2:]

print
location=25
print letters[location:]
location -= 1
print letters[location:]
woooee 814 Nearly a Posting Maven

Two from Einstein

“Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.”

“If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk a sign?”

woooee 814 Nearly a Posting Maven

10 Great Headlines courtesy of the 2013 Farmer's Almanac
1. Hospitals Sued by 7 Foot Doctors
2. Police Begin Campaign to Run Down Jaywalkers
3. Panda Mating Fails: Veterinarian Takes Over
4. War Dims Hope For Peace
5. Astronaut Takes Blame for Gas in Spacecraft
6. Juvenile Court to Try Shooting Defendant
7. Something Went Wrong in Jet Crash
8. New Study of Obesity Looks for Larger Test Group
9. Cold Wave Linked to Temperatures
10. Typhoon Rips Through Cemetery: Hundreds Dead

diafol commented: funny +0
woooee 814 Nearly a Posting Maven

Has anyone used the PIL fork Pillow and is there any reason to change?

woooee 814 Nearly a Posting Maven

Continuing on with the code you posted `

for row in xrange(height):
    for col in xrange(width):
         print row, col   
    print

This will print what is available. As you can see there is no 15 so it is impossible to change 15. First, check the input to see that it is not outside the range of the board. Then come up with a function to change a space based upon arguments passed to the function.

woooee 814 Nearly a Posting Maven

The early bird gets the worm, but the second mouse gets the cheese.

woooee 814 Nearly a Posting Maven

You don't have a [0, 15] in the example you posted, you have [0, 0] through [3, 3]. If you have a
board = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] --> 16 zeros
then you can access the 15th. Show us some code, especially the code that creates the board, for more info.