typeerror

ruby/mysql mysql_adapter.rb:505:in 'real_connect': cant convert String to Integer

I came in this morning, fired up my app in the same way as usual, and started getting this error. Since then, I have been down every road I can conceive - to the point of removing and reinstalling every piece of ruby/rails software on my machine, including mysql. I have stripped my application down to just the following. require 'ruby...

Python type-error issue

I'm writing a simple program to help generate orders for a game I'm a member of. It falls into the catergory of programmes I don't actually need. But now I've started I want it to work. It all pretty much runs smoothly but I can't figure out how to stop a type-error ocurring about half way through. Here's the code; status = 1 print "[b...

python logging into a forum

I've written this to try and log onto a forum (phpBB3). import urllib2, re import urllib, re logindata = urllib.urlencode({'username': 'x', 'password': 'y'}) page = urllib.urlopen("http://www.woarl.com/board/ucp.php?mode=login"[logindata]) output = page.read() However when I run it it comes up with; Traceback (most recent call last):...

Python Error

Hi all...First python script and I'm getting an error I can't seem to get around using a config file. The first part of the script takes user input and puts that into a mysql database with no problem..Then I get to the filesystem work and things go a bit pear shaped..I can get it to work without using the config file options but I'd like...

Python TypeError unsupported operand type(s) for %: 'file' and 'unicode'

I'm working on a django field validation and I can't figure out why I'm getting a type error for this section: def clean_tid(self): data = self.cleaned_data['tid'] stdout_handel = os.popen("/var/www/nsmweb/jre1.6.0_14/bin/java -jar /var/www/nsmweb/sla.jar -t %s grep -v DAN") % data result = stdout_handel.read() Do I have ...

Catch a type error in C++

Hello all! How do i check if a result is of the right type(int, float, double, etc.) and then throw and catch an exception in case it's not? Thanks all, Vlad. ...

Why do I have this TypeError when using tkinter?

so I upgraded to python 3.1.1 from 2.6 and i ran an old program of mine which uses tkinter. I get the following error message which I don't recall getting in the 2.6 version. Exception in Tkinter callback Traceback (most recent call last): File "C:\Python31\lib\tkinter\__init__.py", line 1399, in __call__ return self.func(*args) ...

parse.unquote_plus TypeError

I'm trying to format a file so that it can be inserted into a database, the file is originally compressed and arround 1.3MB big. Each line looks something like this: 398,%7EAnoniem+001%7E,543,480,7525010,1775,0 This is how the code looks like that parses this file: Village = gzip.open(Root+'\\data'+'\\' +str(Newest_Date[0])+'\\...

Problem with Sortables in Scriptaculous

I'm having a problem with getting my divs to become sortable using Scriptaculous's Drag and Drop Library. <pre id="leftcol"> <div id="id0"><h3>Date and Time</h3><div class="moduleContent"></div></div> <div id="id14"><h3>Calculator</h3><div class="moduleContent"></div></div> </pre> <script type="text/javascript"> Sortable.create("leftco...

TypeError when trying to upload Pictures from Google App Engine to Picasa with the GData API

I'm trying to write a small tool to upload Pictures from Google App Engine to Picasa. Fetching the image works, but when i try to upload it i get the error "TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str" The Code basically looks like this: def getfile(url): result = urlfetch.fetch(url) if re...

Qt Python Calendar: selected day direct access

Hi Everybody, I have calendar that is working fine. Here is the function that display the full date: def selectDate(self,date): self.fullDate = str(date.day()) + " / " + str(date.month()) + " / " + str(date.year()) print "full date: %s" % self.fullDate And here the code with the calendar: def TabCalendar(self): self.cal...

Uncaught TypeError: Property '$' of object [object global] is not a function ??

Uncaught TypeError: Property '$' of object [object global] is not a function in line 2: $(document).ready(function() { $('#tabs > ul').tabs({ fx: { opacity: 'toggle' } }); $('#featuredvid > ul').tabs(); }); problem appears local at 127.0.0.1 only, while same code OK online! - dazzeld... any idea? ...

saving python variable to .mat file with scipy.io.savemat

Hi all, Here is my python code. >>import numpy as np >>import scipy.io >>exon = [ np.array([[1, 2], [3, 4], [5, 6]]), np.array([[7, 8], [9, 10]]) ] >>obj_arr = np.zeros((2,), dtype=np.object) >>obj_arr[0] = exon[0] >>obj_arr[1] = exon[1] >>scipy.io.savemat('/tmp/out.mat', mdict={'exon': obj_arr}, format='5') But I am getting an err...

Multiple Inheritance in Python (Problem Specific)

Can anyone here identify why the TypeError is being raised at the bottom of this example shown below? >>> import threading >>> class SessionManager(threading.Thread, threading._RLock, dict): UPDATE = 60 * 60 def run(self): while True: time.sleep(self.UPDATE) with self: for key in...

TypeError when trying to use observers and STI

I'm trying to follow along with the thread on implementing an achievement system (located at http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror), and am running into a TypeError when the object is saved and the method awarded? gets called. The error looks like: TypeError (can't dump anonymous class C...

Why does GHC infer type of `IO b` for an application of `hSetBuffering`?

I am trying to use hSetBuffering in a Haskell program using GHC 6.10. When I try this very simple program: module Ctlc where import IO main :: () main = do hSetBuffering stdout NoBuffering return () I get a baffling error message: ctlc.hs:8:10: Couldn't match expected type `()' against inferred type `IO b' In a st...

Need help understanding "TypeError: default __new__ takes no parameters" error in python

For some reason I am having trouble getting my head around __init__ and __new__. I have a bunch of code that runs fine from the terminal, but when I load it as a plugin for Google Quick Search Box, I get the error TypeError: default __new__ takes no parameters. I have been reading about the error, and it's kind of making my brain spin. ...

GAE - Getting TypeError requiring class instance be passed to class's own method...

I'm really new to programming... I set up a class to give supporting information for Google's User API user object. I store this info in the datastore using db.model. When I call the okstatus method of my user_info class using this code: elif user_info.okstatus(user): self.response.out.write("user allowed") I get this error: un...

[ActionScript 3] Array subclasses cannot be deserialized, Error #1034

I've just found a strange error when deserializing from a ByteArray, where Vectors cannot contain types that extend Array: there is a TypeError when they are deserialized. TypeError: Error #1034: Type Coercion failed: cannot convert []@4b8c42e1 to com.myapp.ArraySubclass. at flash.utils::ByteArray/readObject() at com.myapp::MyAp...

TypeError: coercing to Unicode: need string or buffer, User found

hi, i have to crawl last.fm for users (university exercise). I'm new to python and get following error: Traceback (most recent call last): File "crawler.py", line 23, in <module> for f in user_.get_friends(limit='200'): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pylast.py", li...