Search Results

Search found 484 results on 20 pages for 'typeerror'.

Page 11/20 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • ActionScript: Type coercion problem with BlazeDS/AMF and class interfaces

    - by mike
    Hi, I've got a problem with type coercion in a Java/Hibernate/BlazeDS/Flex-Setup. First of all, my classes look like this: --- JAVA --- Interface I (Abstract) Class A implements I Class B extends A --- ActionScript --- Interface I Class A implements I Class B extends A I got RemoteClass-Meta-Tags in all ActionScript-Classes/Interfaces I, A and B. Package structure and Class/Interface names are exactly the same. Now here's the problem: My Java Service successfully retrieves objects of class B from my database via Hibernate. I got another class C which has a member property of interface type I, so it should be possible to assign an object of type B. But for some reason i get the following error message: TypeError: Error #1034: cannot convert Object@28b44a89 to package.name.I I checked the Java object type in the service and it is of type B and seems to be totally fine. Why can't the object of type B be assigned to a member variable of type I? This is driving me nuts. Thanks in advance.

    Read the article

  • GWT application throws an exception when run on Google Chrome with compiler output style set to 'OBF

    - by Elifarley
    I'd like to know if you guys have faced the same problem I'm facing, and how you are dealing with it. Sometimes, a small and harmless change in a Java class ensues strange errors at runtime. These errors only happen if BOTH conditions below are true: 2) the application is run on Google Chrome, and 1) the GWT JavaScript compiler output style is set to 'OBF'. So, running the application on Firefox or IE always works. Running with the output style set to 'pretty' or 'detailed' always works, even on Google Chrome. Here's an example of error message that I got: "((TypeError): Property 'top' of object [object DOMWindow] is not a function stack" And here's what I have: - GWT 1.5.3 - GXT 1.2.4 - Google Chrome 4 and 5 - Windows XP In order to get rid of this Heisenbug, I have to either deploy my application without obfuscation or endure a time-consuming trial-and-error process in which I re-implement the change in slightly different ways and re-run the application, until the GWT compiler is happy with my code. Would you have a better idea on how to avoid this?

    Read the article

  • Error running celeryd

    - by Eric Palakovich Carr
    I'm posting this question (and answer) so if anybody else has this problem in the future, you'll be able to google it. If you are trying to run celeryd in Django like so: python manage.py celeryd You can receive the following error immediately after it has started: celery@eric-desktop-dev has started. Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) <... snip ...> File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 134, in __init__ self._x_start_ok(d, login_method, login_response, locale) File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 704, in _x_start_ok args.write_longstr(response) File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/serialization.py", line 352, in write_longstr self.write_long(len(s)) TypeError: object of type 'NoneType' has no len() A rather cryptic error message, with no real clue as to where to go to fix the problem. See below for the answer so you don't waste a bunch of time on this error like I did today :)

    Read the article

  • How should I do custom sort in Python 3?

    - by S.Mark
    In Python 2.x, I could pass custom function to sorted and .sort functions >>> x=['kar','htar','har','ar'] >>> >>> sorted(x) ['ar', 'har', 'htar', 'kar'] >>> >>> sorted(x,cmp=customsort) ['kar', 'htar', 'har', 'ar'] Because, in My language, consonents are comes with this order "k","kh",....,"ht",..."h",...,"a" But In Python 3.x, looks like I could not pass cmp keyword >>> sorted(x,cmp=customsort) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'cmp' is an invalid keyword argument for this function Is there any alternatives or should I write my own sorted function too?

    Read the article

  • Flex ; get the value of RadioButton inside a FormItem

    - by numediaweb
    Hi, I'm working on Flash Builder with latest flex SDK. I have a problem getting the value radioButton of the selceted radio button inside a form: <mx:Form id="form_new_contribution"> <mx:FormItem label="Contribution type" includeIn="project_contributions"> <mx:RadioButtonGroup id="myG" enabled="true" /> <mx:RadioButton id="subtitle" label="subtitle" groupName="{myG}" value="subtitle"/> <mx:RadioButton id="note" label="notes / chapters" groupName="{myG}" value="note"/> </mx:FormItem> </mx:Form> the function is: protected function button_add_new_clickHandler(event:MouseEvent):void{ Alert.show(myG.selectedValue.toString()); } I tried also: Alert.show(myG.selection.toString()); bothe codes show error: TypeError: Error #1009: Cannot access a property or method of a null object reference. and if It only works if I put : Alert.show(myG.toString()); it alerts : Object RadioButtonGroup thanx for any hints, and sorry for the long message :)

    Read the article

  • Flash Hates Me. Error #1009: Cannot access a property or method of a null object reference

    - by sol
    I simply create a movie clip, put it on the stage and give it an instance name of char. Here's my document class, simple as can be: public class Test extends MovieClip { public function Test() { char.x = 1315; char.y = 459; addEventListener(Event.ENTER_FRAME, mouseListen); } private function mouseListen(e:Event) { char.x = mouseX; char.y = mouseY; } } And I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.me::Test/::mouseListen() How in the world is it possible that it knows what "char" is in the constructor but not in the mouseListen function? What else could it be?

    Read the article

  • Python Decorators and inheritance

    - by wheaties
    Help a guy out. Can't seem to get a decorator to work with inheritance. Broke it down to the simplest little example in my scratch workspace. Still can't seem to get it working. class bar(object): def __init__(self): self.val = 4 def setVal(self,x): self.val = x def decor(self, func): def increment(self, x): return func( self, x ) + self.val return increment class foo(bar): def __init__(self): bar.__init__(self) @decor def add(self, x): return x Oops, name "decor" is not defined. Okay, how about @bar.decor? TypeError: unbound method "decor" must be called with a bar instance as first argument (got function instance instead) Ok, how about @self.decor? Name "self" is not defined. Ok, how about @foo.decor?! Name "foo" is not defined. AaaaAAaAaaaarrrrgggg... What am I doing wrong?

    Read the article

  • Beginner having a problem with classes

    - by David
    I'm working through O'Reilly's "Learning Python" and having a problem with classes. I think I understand the concept, but in practice have stumbled upon this problem. Fron page 88-89: >>> class Worker: def __innit__(self, name, pay): self.name=name self.pay=pay def lastName(self): return self.name.split()[-1] def giveRaise(self, percent): self.pay*=(1.0+percent) Then the book says "Calling the class like a function generates instances of a new type ...etc" and gives this example. bob = Worker('Bob Smith', 50000) This gives me this error: TypeError: this constructor takes no arguments. And then I start muttering profanities. So what am I doing wrong here? Thanks for the help.

    Read the article

  • Catch $.getJSON error

    - by Switz
    I've been trying to figure this out for hours. I have a DYNAMIC youtube search, which I use Youtube's JSON api for. It works usually, but there are times that it won't find anything. Is there a way to figure out if it finds nothing, and then end the function because otherwise it stops the entire code. I tried jsonp, but that didn't seem to be correct. Somewhere I read that error catching is built into the newest jQuery getJSON, but I couldn't find it. The code is really tedious so I'd rather not post it unless it comes to that. I'd appreciate any help! Thanks guys. error showing that json didn't return anything jquery-1.4.4.min.js:32 TypeError: Result of expression 'j' [undefined] is not an object.

    Read the article

  • Trigger a form submit from within an AJAX callback using jQuery

    - by Yarin
    I want to perform an ajax request right before my form is submitted. I want to trigger the form submit from my ajax callback, but when I try to trigger the submit, I get the following error: Uncaught TypeError: Property 'submit' of object # is not a function Here is the entire code: <form method="post" action="http://www.google.com" > <input type="text" name="email" id="test" size="20" /> <input id="submit" name="submit" type="submit" value="Submit" /> </form> <script> function do_ajax() { var jqxhr = $.get("#", function(){ $('form').submit(); }); } $(function() { $('#submit').click(function (e) { e.preventDefault(); do_ajax(); }); }); </script> Stumped.

    Read the article

  • SpineJS and RequireJS

    - by ot3m3m
    I am using require.js 2.0. I have the following code that is called initially by require: app.js requirejs.config({ paths: { app: '..', spine: 'spine_src/spine', cs: "cs", }, shim: { 'spine_src/route': { deps: ['spine'] } } }); // Start the main app logic. requirejs(['cs!app/StartApp_Admin', 'spine','spine_src/route'], function (StartApp_Admin, Spine, Route) { { new StartApp_Admin(); } }); And the following controller: StartApp_Admin define () -> class StartApp_Admin extends Spine.Controller constructor: -> @routes "/twitter/:id": (params) -> console.log("/users/", params.id) Spine.Route.setup() When I execute the application I get the following error in my spine route library file (route.js). The application breaks when I call Spine.Route.setup() Uncaught TypeError: Object function (element) {return element;} has no method 'extend' Any help would be greatly appreciated

    Read the article

  • Cannot call method 'wsl_wordpress_social_login'

    - by David Allen
    Hi I'm using a wordpress plugin to allow user to comment using facebook and twitter accounts. This is the page i am testing the plugin on http://blog.pcpal.co.uk/2012/03/london-underground-wi-fi-connectivity-due-within-months/ When i click the facebook icon its opens up a windows where i sign into facebook ad then directs to a blank pages which has a JS error see code below <html><head> <script> function init() { window.opener.wsl_wordpress_social_login({ 'action' : 'wordpress_social_login', 'provider' : 'Facebook' }); window.close(); } </script> </head> <body onload="init();"> </body></html> # Error is Uncaught TypeError: Cannot call method 'wsl_wordpress_social_login' of null If you can help then great.. Additional info Only seems to do it with chrome

    Read the article

  • How do you deal with the conflict between ActiveSupport::JSON and the JSON gem?

    - by Luke Francl
    I am stumped with this problem. ActiveSupport::JSON defines to_json on various core objects and so does the JSON gem. However, the implementation is not the same -- the ActiveSupport version takes arguments and the JSON gem version doesn't. I installed a gem that required the JSON gem and my app broke. The issue is that I'm using to_json in a controller that returns a list of objects, but I want to control which attributes are returned. When code anywhere in my system does require 'json' I get this error message: TypeError: wrong argument type Hash (expected Data) I tried a couple of things that I read online to fix it, but nothing worked. I ended up re-writing the gem to use ActiveSupport::JSON.decode instead of JSON.parse. This works but it's not sustainable...I can't be forking gems every time I want to use a gem that requires the JSON gem. Update: The best solution of this problem is to upgrade to Rails 2.3 or higher, which fixed it.

    Read the article

  • CouchDB Map/Reduce raises execption in reduce function?

    - by fuzzy lollipop
    my view generates keys in this format ["job_id:1234567890", 1271430291000] where the first key element is a unique key and the second is a timestamp in milliseconds. I run my view with this elapsed_time?startkey=["123"]&endkey=["123",{}]&group=true&group_level=1 and here is my reduce function, the intention is to reduce the output to get the earliest and latest timestamps and return the difference between them and now function(keys,values,rereduce) { var now = new Date().valueOf(); var first = Number.MIN_VALUE; var last = Number.MAX_VALUE; if (rereduce) { first = Math.max(first,values[0].first); last = Math.min(last,values[0].last); } else { first = keys[0][0][1]; last = keys[keys.length-1][0][1]; } return {first:now - first, last:now - last}; } and when processing a query it constantly raises the following execption: function raised exception (new TypeError("keys has no properties", "", 1)) I am making sure not to reference keys inside my rereduce block. Why does this function constantly raise this exception?

    Read the article

  • Python regex on list

    - by Peter Nielsen
    Hi there I am trying to build a parser and save the results as an xml file but i have problems.. For instance i get a TypeError: expected string or buffer when i try to run the code.. Would you experts please have a look at my code ? import urllib2, re from xml.dom.minidom import Document from BeautifulSoup import BeautifulSoup as bs osc = open('OSCTEST.html','r') oscread = osc.read() soup=bs(oscread) doc = Document() root = doc.createElement('root') doc.appendChild(root) countries = doc.createElement('countries') root.appendChild(countries) findtags1 = re.compile ('<h1 class="title metadata_title content_perceived_text(.*?)</h1>', re.DOTALL | re.IGNORECASE).findall(soup) findtags2 = re.compile ('<span class="content_text">(.*?)</span>', re.DOTALL | re.IGNORECASE).findall(soup) for header in findtags1: title_elem = doc.createElement('title') countries.appendChild(title_elem) header_elem = doc.createTextNode(header) title_elem.appendChild(header_elem) for item in findtags2: art_elem = doc.createElement('artikel') countries.appendChild(art_elem) s = item.replace('<P>','') t = s.replace('</P>','') text_elem = doc.createTextNode(t) art_elem.appendChild(text_elem) print doc.toprettyxml()

    Read the article

  • 'int' object is not callable

    - by Oscar Reyes
    I'm trying to define a simply Fraction class And I'm getting this error: python fraction.py Traceback (most recent call last): File "fraction.py", line 20, in <module> f.numerator(2) TypeError: 'int' object is not callable The code follows: class Fraction(object): def __init__( self, n=0, d=0 ): self.numerator = n self.denominator = d def get_numerator(self): return self.numerator def get_denominator(self): return self.denominator def numerator(self, n): self.numerator = n def denominator( self, d ): self.denominator = d def prints( self ): print "%d/%d" %(self.numerator, self.denominator) if __name__ == "__main__": f = Fraction() f.numerator(2) f.denominator(5) f.prints() I thought it was because I had numerator(self) and numerator(self, n) but now I know Python doesn't have method overloading ( function overloading ) so I renamed to get_numerator but that's not the problems. What could it be?

    Read the article

  • numpy.equal with string values

    - by Morgoth
    The numpy.equal function does not work if a list or array contains strings: >>> import numpy >>> index = numpy.equal([1,2,'a'],None) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: function not supported for these types, and can't coerce safely to supported types What is the easiest way to workaround this without looping through each element? In the end, I need index to contain a boolean array indicating which elements are None.

    Read the article

  • Parsing names with pyparsing

    - by johnthexiii
    I have a file of names and ages, john 25 bob 30 john bob 35 Here is what I have so far from pyparsing import * data = ''' john 25 bob 30 john bob 35 ''' name = Word(alphas + Optional(' ') + alphas) rowData = Group(name + Suppress(White(" ")) + Word(nums)) table = ZeroOrMore(rowData) print table.parseString(data) the output I am expecting is [['john', 25], ['bob', 30], ['john bob', 35]] Here is the stacktrace Traceback (most recent call last): File "C:\Users\mccauley\Desktop\client.py", line 11, in <module> eventType = Word(alphas + Optional(' ') + alphas) File "C:\Python27\lib\site-packages\pyparsing.py", line 1657, in __init__ self.name = _ustr(self) File "C:\Python27\lib\site-packages\pyparsing.py", line 122, in _ustr return str(obj) File "C:\Python27\lib\site-packages\pyparsing.py", line 1743, in __str__ self.strRepr = "W:(%s)" % charsAsStr(self.initCharsOrig) File "C:\Python27\lib\site-packages\pyparsing.py", line 1735, in charsAsStr if len(s)>4: TypeError: object of type 'And' has no len()

    Read the article

  • Get jQuery Error if PHP Breaks

    - by Norbert
    I have a PHP script that breaks if a variable is not populated and it isn't added to the database, but jQuery handles this as a success and I get this error: TypeError: Result of expression 'data' [null] is not an object. Here's the jQuery script: $.ajax({ type: "POST", url: "/clase/do-add", data: $("#adauga").serialize(), dataType: "json", error: function (xhr, textStatus, errorThrown) { alert('Try again.'); }, success: function(data) { var dlHTML = '<dl id="' + data.id + '"> [too long] </dl>'; $('form#adauga').after(dlHTML); $('#main dl:first').hide().fadeIn(); adaugaClasaSubmit.removeAttr('disabled'); adaugaClasa.removeAttr('readonly'); adaugaClasa.val("").focus(); } });

    Read the article

  • JQuery-tmpl Template Switching Not working.

    - by Mike
    I'm trying to implement "more/less" functionality using the official jquery-tmpl plugin. I've looked at the examples, but I cannot seem to get the functionality to work in my own implementation. When I click on one of my "More" buttons, I seem to get an error thrown of: Uncaught TypeError: Property 'tmpl' of object #<an Object> is not a function This is my implementation here From what I can tell, the example I'm trying to replace is doing the following: Render the "Master" template On-click: Find the corresponding template object (tmplItem) to the clicked element. Pass in reference to a new template. Call the update function to re-render. Have I understood the documentation wrong? From what I can tell I'm doing the same thing as the example on the official documentation.

    Read the article

  • [Python] How do I read binary pickle data first, then unpickle it?

    - by conradlee
    I'm unpickling a NetworkX object that's about 1GB in size on disk. Although I saved it in the binary format (using protocol 2), it is taking a very long time to unpickle this file---at least half an hour. The system I'm running on has plenty of system memory (128 GB), so that's not the bottleneck. I've read here that pickling can be sped up by first reading the entire file into memory, and then unpickling it (that particular thread refers to python 3.0, which I'm not using, but the point should still be true in python 2.6). How do I first read the binary file, and then unpickle it? I have tried: import cPickle as pickle f = open("big_networkx_graph.pickle","rb") bin_data = f.read() graph_data = pickle.load(bin_data) But this returns: TypeError: argument must have 'read' and 'readline' attributes Any ideas?

    Read the article

  • method __getattr__ is not inherited from parent class

    - by ??????
    Trying to subclass mechanize.Browser class: from mechanize import Browser class LLManager(Browser, object): IS_AUTHORIZED = False def __init__(self, login = "", passw = "", *args, **kwargs): super(LLManager, self).__init__(*args, **kwargs) self.set_handle_robots(False) But when I make something like this: lm["Widget[LinksList]_link_1_title"] = anc then I get an error: Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> lm["Widget[LinksList]_link_1_title"] = anc TypeError: 'LLManager' object does not support item assignment Browser class have overridden method __getattr__ as shown: def __getattr__(self, name): # pass through _form.HTMLForm methods and attributes form = self.__dict__.get("form") if form is None: raise AttributeError( "%s instance has no attribute %s (perhaps you forgot to " ".select_form()?)" % (self.__class__, name)) return getattr(form, name) Why my class or instance don't get this method as in parent class?

    Read the article

  • Python: User-Defined Exception That Proves The Rule

    - by bandana
    Python documentations states: Exceptions should typically be derived from the Exception class, either directly or indirectly. the word 'typically' leaves me in an ambiguous state. consider the code: class good(Exception): pass class bad(object): pass Heaven = good() Hell = bad() >>> raise Heaven Traceback (most recent call last): File "<pyshell#163>", line 1, in <module> raise Heaven good >>> raise Hell Traceback (most recent call last): File "<pyshell#171>", line 1, in <module> raise Hell TypeError: exceptions must be classes or instances, not bad so when reading the python docs, should i change 'typically' with ''? what if i have a class hierarchy that has nothing to do with the Exception class, and i want to 'raise' objects belonging to the hierarchy? i can always raise an exception with an argument: raise Exception, Hell This seems slightly awkward to me What's so special about the Exception class, that only its family members can be raised?

    Read the article

  • Calling a method with getattr in Python

    - by brain_damage
    How to call a method using getattr? I want to create a metaclass, which can call non-existing methods of some other class that start with the word 'oposite_'. The method should have the same number of arguments, but to return the opposite result. def oposite(func): return lambda s, *args, **kw: not oposite(s, *args, **kw) class Negate(type): def __getattr__(self, name): if name.startswith('oposite_'): return oposite(self.__getattr__(name[8:])) def __init__(self,*args,**kwargs): self.__getattr__ = Negate.__getattr__ class P(metaclass=Negate): def yep(self): return True But the problem is that self.__getattr__(sth) returns a NoneType object. >>> p = P() >>> p.oposite_yep() Traceback (most recent call last): File "<pyshell#115>", line 1, in <module> p.oposite_yep() TypeError: <lambda>() takes at least 1 positional argument (0 given) How to deal with this?

    Read the article

  • slicing 2d numpy array

    - by MedicalMath
    I have a 2d numpy array called FilteredOutput that has 2 columns and 10001 rows, though the number of rows is a variable. I am trying to take the 2nd column of FilteredOutput and use it to populate a new 1d numpy array called timeSeriesArray using the following line of code: timeSeriesArray=p.array(FilteredOutput[:,0]) I got this syntax from the following link. But the problem is that I am getting the following error message: TypeError: list indices must be integers, not tuple Can anyone show me the proper syntax for populating the 1d array timeSeriesArray with the contents of the second column of the 2d array FilteredOutput?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >