Search Results

Search found 1872 results on 75 pages for 'tom genoni'.

Page 45/75 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Sanitizing MySQL user parameters.

    - by Tom
    What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \r and \n. Are there others?(I don't have the option of using a smart connector that accepts parameters so I have to build the query myself and this will be implemented in multiple programming languages, including some obscure ones so solutions such as mysql_real_escape_string in PHP are not valid)

    Read the article

  • Conversion of DOM element selection code to jQuery

    - by Tom McDonnell
    I have a large Javascript codebase to convert to jQuery. The code is structured such that DOM elements are created in Javascript (using a library called DomBuilder), and saved to variables if they will be needed later, before being added to the DOM. Eg. var inputs = { submitConfirm: INPUT({type: 'button', value: 'Submit'}), submitCancel : INPUT({type: 'button', value: 'Cancel'}) }; document.appendChild(inputs.submitConfirm); Then later for example... inputs.submitCancel.style.display = 'none'; inputs.submitCancel.addEventListener('click', onClickSubmitCancel, false); My problem is that jQuery seems to lack a way of manipulating DOM elements directly, as opposed to selecting them first (with for example $('#submitCancel'). Can anyone suggest a way to directly translate the last two Javascript lines given above to use jQuery, given that the DOM elements are already available, and so do not need to be selected?

    Read the article

  • Load two instances of the same DLL in Delphi

    - by Tom
    Here's my problem: I would like to create two separate instances of the same DLL. The following doesn't work because Handle1 and Handle2 will get the same address Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll.dll'); The following works, but I have to make a copy of the DLL and rename it to something else (which seems a bit silly) Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll2.dll'); Is there a way to have only one DLL file, but load several instances of it?

    Read the article

  • Patterns for wrapping a command line tool in another language

    - by Tom Duckering
    I'm currently writing some Java to wrap around an extensive command line tool. It feels like I'm writing a lot of similar code. I'm wondering if there are any established patterns for wrapping command line tools - passing arguments and handling output and so on. Specific examples in Java would obviously be great, but any general suggestions or pointers are welcome too.

    Read the article

  • Defined outlets, connected them, everything looks fine, nothing works.

    - by Tom
    Hi! I'm trying to play with a WebView. I made an outlet: IBOutlet UIWebView *browser; Defined it as a property: @property (nonatomic, retain) IBOutlet UIWebView *browser; Synthethized it: @synthesize browser; Finally, I connected it in Interface Builder, really it is. Then I try to do something with it i.e.: [browser loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com"]]]; Or also: Etape *etape = [[Etape alloc] init]; NSString *html = [etape generateHTMLforEtape:[current_etape objectAtIndex:0]]; [browser loadHTMLString:html baseURL:nil]; [etape release]; I get no errors, I tried to Build & Analyse, no notices or warnings or errors.. I've been searching for one whole day, please help me :/ Thanks a lot! EDIT: Here's screenshots of my connections for my WebView:

    Read the article

  • In what package should a "Settings" class be?

    - by Tom
    I've in the middle of building an application but found myself too easily creating new packages without keeping the project's structure in mind. Now, I'm trying to redo the whole project structure on paper first. I am using a Settings class with public properties, accessed as settings for several other classes around the project. Now, since this Settings class applies for the whole project, I am unsure if it should be packaged and if so, in what kind of package should it exist? Or should it be in the root (the default package) with the main application class? I've been thinking about putting it in my utils package, then again I don't think it really is an utlity. Any strategies on how to decide on such package structure for example for a Settings class?

    Read the article

  • 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

  • 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

  • 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

  • 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

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >