Search Results

Search found 2495 results on 100 pages for 'tom rom'.

Page 52/100 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Django multiple many to many fields?

    - by Tom
    Hello everybody I am building a news app for my website. I want to use a sort of tag system. Each news article can have different and multiple tags. All tags are saved in a tag model, and i want to connect the tags to the newsarticle. Now is this possible with: tags = models.ForeignKey( TagsModel ) for one tag, but how i can do this with multiple of them? Thank you!

    Read the article

  • what does driver program mean?

    - by Tom
    there is a quote from Algorithms for Java (sedgwick 2003) p. 135: "we commonly use driver programs when developing or debugging adt iplementations" what is meant by driver program? google just gives me loads of info about programming drivers, clearly not related

    Read the article

  • Revalidate JPanel's parent frame

    - by Tom Brito
    I need show/hide some fields of my panel, and I want the panel to fit the frame. How could I notify to the parent frame to revalidate? I think in pass the frame to my panel's constructor, but I think may have a way this is already done. I remember that there was a protected attribute in JPanel, but there isn't.. maybe i remembering the wrong component.

    Read the article

  • C# convert binary dara to string?

    - by Tom
    Hi, just going through the registry retrieving values and binary is making my file outputer fall. I was wondering how could i convert Subkey.getValue(value[i]) into a String if the Value type is binary? Thank you in advance

    Read the article

  • Warning: cast increases required alignment

    - by dash-tom-bang
    I'm recently working on this platform for which a legacy codebase issues a large number of "cast increases required alignment to N" warnings, where N is the size of the target of the cast. struct Message { int32_t id; int32_t type; int8_t data[16]; }; int32_t GetMessageInt(const Message& m) { return *reinterpret_cast<int32_t*>(&data[0]); } Hopefully it's obvious that a "real" implementation would be a bit more complex, but the basic point is that I've got data coming from somewhere, I know that it's aligned (because I need the id and type to be aligned), and yet I get the message that the cast is increasing the alignment, in the example case, to 4. Now I know that I can suppress the warning with an argument to the compiler, and I know that I can cast the bit inside the parentheses to void* first, but I don't really want to go through every bit of code that needs this sort of manipulation (there's a lot because we load a lot of data off of disk, and that data comes in as char buffers so that we can easily pointer-advance), but can anyone give me any other thoughts on this problem? I mean, to me it seems like such an important and common option that you wouldn't want to warn, and if there is actually the possibility of doing it wrong then suppressing the warning isn't going to help. Finally, can't the compiler know as I do how the object in question is actually aligned in the structure, so it should be able to not worry about the alignment on that particular object unless it got bumped a byte or two?

    Read the article

  • Jquery: Calling functions from different documents

    - by Tom
    Hi, I've got some Jquery functions that I keep in a "custom.js" file. On some pages, I need to pass PHP variables to the Jquery so some Jquery bits need to remain in the HTML documents. However, as I'm now trying to refactor things to the minimum, I'm tripping over the following: If I put this in my custom.js: $(document).ready(function() { function sayHello() { alert("hello"); } } And this in a HTML document: <script type="text/javascript"> $(document).ready(function() { sayHello(); }); </script> ... the function doesn't get called. However, if both are placed in the HTML document, the function works fine. Is there some kind of public property I need to declare for the function or how do I get Jquery functions in my HTML to talk to external .js files? They're correctly included and work fine otherwise. Thanks.

    Read the article

  • Flex - Cancel drag operation via keyboard

    - by Tom
    Hello I would like to be able to cancel a drag operation with the Escape key. The following did not work so far: calling stopDrag() on the component -- nothing happens calling DragManager.acceptDragDrop(null) -- nothing happens calling mx_internal function DragManager.endDrag() -- drag partly stops, the drag proxy image disappears but now the drop indicator shows at row 0, and also there's a null error when finally releasing the mouse Anybody else had any luck with this? Thanks!

    Read the article

  • PHP Populating array with $variables

    - by Tom
    Hi, I'm trying to create a basic shopping cart, having an issue with the product page allowing users to add more items to their cart then are in stock (I have code in place to prevent this on the view cart page, just not the view product page) This is what I have so far; for ($i = 0; $i < $numItem; $i++) { extract($cartContent[$i]); $subTotal += $price * $cartQuantity; $cartLimiter[$itemNo => $cartQuantity]; Using an array so the position number becomes the item number and the cart quantity becomes the assigned value, however it doesn't seem to like it and throws out on the bottom line of code: Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ']' Thanks

    Read the article

  • Problem at JUnit test with generics

    - by Tom Brito
    In my utility method: public static <T> T getField(Object obj, Class c, String fieldName) { try { Field field = c.getDeclaredField(fieldName); field.setAccessible(true); return (T) field.get(obj); } catch (Exception e) { e.printStackTrace(); fail(); return null; } } The line return (T) field.get(obj); gives the warning "Type safety: Unchecked cast from Object to T"; but I cannot perform instanceof check against type parameter T, so what am I suppose to do here?

    Read the article

  • How to limit manytomanyfields on a model ?

    - by Tom
    I would like to check that I get not more than 3 relations set on a manytomanyfield. I tried on the clean method to do this : if self.tags.count()>3: raise ValidationError(_(u'You cannot add more than 3 tags')) But self.tags returns not the current updates... only saved objects. Do you have an idea to access to them ? Thanks

    Read the article

  • Can an out-of-process COM object determine its parent process?

    - by Tom Williams
    From an out-of-process COM object (LocalServer32) can I determine the client process that requested the creation of the object? - to be specific I need to get hold of the client processes command line. This question arrises because (due to poor standardisation, implementation and support) the potential 3rd party clients of the object have a variety of idiosyncracies which the object needs to workaround. To do this the object needs to be able to identify its current client. Extending the interface of the COM object so that the client can identify itself is unfortunately not possible ... or to be more precise the interface can be extended but I won't be able to get the clients to call the extension.

    Read the article

  • prolog - infinite rule

    - by Tom
    I have the next rules % Signature: natural_number(N)/1 % Purpose: N is a natural number. natural_number(0). natural_number(s(X)) :- natural_number(X) ackermann(0, N, s(N)). //rule 1 ackermann(s(M),0,Result):- ackermann(M,s(0),Result). //rule 2 ackermann(s(M),s(N),Result):-ackermann(M,Result1,Result),ackermann(s(M),N,Result1). //rule 3 The query is: ackermann (M,N,s(s(0))). Now, as I understood, In the third calculation, we got an infinite search (failture branch). I check it, and I got a finite search (failture branch). I'll explain: In the first, we got a substitue of M=0, N=s(0) (rule 1 - succsess!). In the second, we got a substitue of M=s(0),N=0 (rule 2 - sucsses!). But what now? I try to match M=s(s(0)) N=0, But it got a finite search - failture branch. Why the comipler doesn't write me "fail". Thank you.

    Read the article

  • Java: how do I get a class literal from a generic type?

    - by Tom
    Typically, I've seen people use the class literal like this: Class<Foo> cls = Foo.class; But what if the type is generic, e.g. List? This works fine, but has a warning since List should be parameterized: Class<List> cls = List.class So why not add a <?>? Well, this causes a type mismatch error: Class<List<?>> cls = List.class I figured something like this would work, but this is just a plain ol' a syntax error: Class<List<Foo>> cls = List<Foo>.class How can I get a Class<List<Foo>> statically, e.g. using the class literal? I could use @SuppressWarnings("unchecked") to get rid of the warnings caused by the non-parameterized use of List in the first example, Class<List> cls = List.class, but I'd rather not. Any suggestions? Thanks!

    Read the article

  • Floating not right in ie ?

    - by Tom
    Hi, i want to do like the following format: So this is what i did : <style> .toptitle{ font-size:14px; } .toprating{ background:yellow; float:left; font-size:12px; } .topcontainer{ border-bottom:1px #CCCCCC solid; } </style> <div class="topcontainer"> <div class="toprating">256</div> <div class="toptitle">Lorem Ipsum...</div> </div> <br> <div class="topcontainer"> <div class="toprating">256</div> <div class="toptitle">Lorem Ipsum...</div> </div> Now, in firefox,chrome,safari, this works perfectly, but in IE the title goes about 30 px down. Is there a mistake in the code, or is there any better code to do this?

    Read the article

  • RSA implementations for Java, alternative to BC

    - by Tom Brito
    The RSA implementation that ships with Bouncy Castle only allows the encrypting of a single block of data. The RSA algorithm is not suited to streaming data and should not be used that way. In a situation like this you should encrypt the data using a randomly generated key and a symmetric cipher, after that you should encrypt the randomly generated key using RSA, and then send the encrypted data and the encrypted random key to the other end where they can reverse the process (ie. decrypt the random key using their RSA private key and then decrypt the data). I can't use the workarond of using symmetric key. So, are there other implementations of RSA than Bouncy Castle?

    Read the article

  • How do I manage dependencies for automated builds on my build server?

    - by Tom Pickles
    I'm trying to implement continuous integration into our day to day workings. In our team, we're moving from just building our code in Visual Studio on our workstations and deploying, to using MSBuild.exe and automating on our build server (which is Jenkins) without the use of Visual Studio. We have external dependencies to references such as Automap in our projects. Because the automap (for example) dll isn't on the build server, the msbuild execution fails, for obvious reasons. There are other dll's which I need to be part of the build, I'm just using automap as an example. So what's the best way to get any dependencies onto the build server as part of the automated build? I've seen references to using a 'lib' folder, but I don't really understand where I should be putting it (in my project, filesystem, SVN ...?), and how the build server will get to it. I've also read that NuGet can do something with dependencies, but my build server isn't connected to the internet, and I don't understand how I can get my build to pull a NuGet package I may have created, and how it works together. Edit: I'm using subversion and we cannot use TeamCity as we would have to buy it and there's zero chance of funding.

    Read the article

  • Interpolation not working on Rails generator

    - by Tom
    For some reason the code I have included below does not interpolate the variables into the template. It simply copies the file over verbatim. I cannot figure out why. https://gist.github.com/60484f7b57b06b6eb3e3 The Rails version is 2.3.4. Thanks in advance!

    Read the article

  • Is Dynamic Casting Possible in Java

    - by Tom Tucker
    So I have a class of overloaded methods like this: class Foo { public void test(Object value) { ... } public void test(String value) { ... } } I need to pass a property value of a bean to one of these methods depending on its type, but I don't know the actual property type until the runtime. e.g. public void run(Object bean, String propertyName) { Foo foo = new Foo(); foo.test(PropertyUtils.getProperty(bean, propertyName)); } BTW, PropertyUtils.getProperty() is a helper method that returns a value of the specified property on a bean. PropertyUtils.getProperty() returns an Object, so that test(Object value) will be always called and the actual property type will be ignored. I can figure out the propery type in the runtime, even if its value is null. Is there such a thing as dynamic casting in Java? If not, is there a way to have an overloaded method with the correct parameter type called?

    Read the article

  • c# - Object reference not set to an instance of an object.

    - by tom
    Line 30: sUsername.Trim(); Line 31: sPassword.Trim(); Line 32: string ConnectionString = WebConfigurationManager.ConnectionStrings["dbnameConnectionString"].ConnectionString; Line 33: SqlConnection myConnection = new SqlConnection(ConnectionString); Line 34: try Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Any ideas? I don't understand the error.

    Read the article

  • What could cause xmlrpclib.ResponseError: ResponseError() ?

    - by Tom
    Hi, I am experimenting with XML-RPC. I have the following server script (python): from SimpleXMLRPCServer import SimpleXMLRPCServer server = SimpleXMLRPCServer(('localhost', 9000)) def return_input(someinput): return someinput server.register_function(return_input) try: print 'ctrl-c to stop server' server.serve_forever() except KeyboardInterrupt: print 'stopping' and the following client script: import xmlrpclib server = xmlrpclib.ServerProxy('http://www.example.com/pathto/xmlrpcTester2.py') print server.return_input('some input') I have tested this locally and it works fine. All it does it spit out the input fron the client script, which is right. However, when I try to do it on a remote server I get the following error: Traceback (most recent call last): File "client.py", line 4, in <module> print server.return_input('some input') File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1489, in __request verbose=self.__verbose File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1253, in request return self._parse_response(h.getfile(), sock) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response return u.close() File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 836, in close raise ResponseError() xmlrpclib.ResponseError: ResponseError() Any ideas what could cause this? Thanks in advance for your help.

    Read the article

  • Dynamic width of DIV (offsetWidth issue).

    - by Tom
    Hi all, I face issue with retrieving (via javascript) width of the div which content is changed (just before reading the widht via offsetWidth) in dynamic way (via changing innerHTML or using createTextNode). Here is some sample code: var con = document.getElementById('avContent'); //content div within page var temp = document.createElement('div');<br /> var text1 = document.createTextNode('CCCCC');<br /> temp.appendChild(text1);<br /> con.appendChild(temp);<br /> var length1 = temp.offsetWidth;<br /> var text2 = document.createTextNode('CCCCC33333333vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv');<br /> temp.removeChild(text1);<br /> temp.appendChild(text2);<br /> con.removeChild(temp);<br /> con.appendChild(temp); var length2 = temp.offsetWidth;<br /> The length1 and length2 do have the same width.. (the same result I get while using innerHTML instead of createTextNode). Looks like it's the same issue like described in following discussion: http://www.webdeveloper.com/forum/showthread.php?t=187716 Does anybody have answer (work around)? Thanks much for help in advance.

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >