Search Results

Search found 238 results on 10 pages for 'blankman'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • Can a python view template be made to be 'safe/secure' if I make it user editable?

    - by Blankman
    Say I need to have a templating system where a user can edit it online using an online editor. So they can put if tags, looping tags etc., but ONLY for specific objects that I want to inject into the template. Can this be made to be safe from security issues? i.e. them somehow outputing sql connection string information or scripting things outside of the allowable tags and injected objects.

    Read the article

  • loading an xml in web apps directory from a library dll

    - by Blankman
    my web application has an xml file here: /files/xml/test.xml I need to load a XDocument from within a class library project, how will I reference the xml? I don't want to pass any path parameters to this method. I want to assume the location is fixed at /files/xml/test.xml. How can I load a XDocument know this? I don't seem to have access to server.mappath either.

    Read the article

  • Java regex to get part number

    - by Blankman
    I have HTML that I need to extract a part number from, the HTML looks like: javascript:selectItem('ABC123 1', '..... I need to get the ABC123 from the above. My code snippet: Patterp p = Pattern.Compile("?????"); Matcher m = p.matcher(html); if(m.find()) partNumber = m.group(1).trim(); BTW, in the pattern, how do I escape for the character ( I now for quotes I do \" thanks allot!

    Read the article

  • blackberry versus iphone development

    - by Blankman
    For those of you who know/experienced both blackberry and iphone development, which platform did you prefer and why? I'm looking for things like debugging ability, api stability, UI development, deployment, IDE, documentations etc.

    Read the article

  • How to assign a value of a property to a var ONLY if the object isn't null

    - by Blankman
    In my code, is there a shorthand that I can use to assign a variable the value of a object's property ONLY if the object isn't null? string username = SomeUserObject.Username; // fails if null I know I can do a check like if(SomeUserObject != null) but I think I saw a shorthand for this kind of test. I tried: string username = SomeUserObject ?? "" : SomeUserObject.Username; But that doesn't work.

    Read the article

  • Want to add a new property to a class, can I use anonymous functions for this?

    - by Blankman
    I have 2 Lists: List<User> List<UserStats> So I want to add a property Count to User (it doesn't have one now, and I can't change the implementation at this point). For a web service call, that returns json, I want to modify the User object. Basically I add the Users to a collection. So I want to add a modified user class (via anonymous functions?) to the collection before I serialize it to json. So something like: loop users { user.Count = userstats[user.ID].Count; list.Add(user); } is this possible? how?

    Read the article

  • Don't understand multiple parameter declarations in objective-c

    - by Blankman
    can someone clarify this for me: When there’s more than one argument, the arguments are declared within the method name after the colons. Arguments break the name apart in the declaration, just as in a message. For example: - (void)setWidth:(float)width height:(float)height; So in the above: method is for instance variables returns void parameter#1 is a float, named width. parameter#2 is a float,named height. But why is it hieght:(float)height; and not just: - (void)setWidth: (float)width (float)height;

    Read the article

  • Does Ruby/Rails require more unit testing than say a PHP app?

    - by Blankman
    I don't find the unit testing push in the PHP market like I see/read in the ruby/rails arena. Could one just as easily NOT unit test in ruby/rails as in php, or is ruby just too bendable and breakable that it "more" recommended to test in ruby than in php? Meaning there are large code bases like vBulletin, and from what I can tell, they don't unit test. I hope you understand what I am asking here, not the pros/cons of testing, or whether one should test or not, but rather, does one language need to be tested more than another? maybe its easy to write buggy code, or break during refactoring etc.

    Read the article

  • Intercept click event on a button, ask for confirmation, then proceed

    - by Blankman
    Based on a variable SomeCondition, I need to intercept a click event on a button, and ask for confirmation, if they say ok, proceed, otherwise ignore click. So something like: if(SomeCondition) { // disable click on button var isOk = window.confirm("Are you sure?"); if(isOk) { $("#button1").click(); } } Note: button1 has already been wired up with a click event via javascript from an external .js file that I can't change. I don't know what the click event was bound too, so I have to disable the click if SomeCondition is true, then ask for confirmation, then continue with the click.

    Read the article

  • using Hibernate to loading 20K products, modifying the entity and updating to db

    - by Blankman
    I am using hibernate to update 20K products in my database. As of now I am pulling in the 20K products, looping through them and modifying some properties and then updating the database. so: load products foreach products session begintransaction productDao.MakePersistant(p); session commit(); As of now things are pretty slow compared to your standard jdbc, what can I do to speed things up? I am sure I am doing something wrong here.

    Read the article

  • How to copy an object by value, not by reference

    - by Blankman
    I want to make a copy of an object, then after some logic, re-assign the original object the value of the copy. example: User userCopy = //make a copy foreach(...) { user.Age = 1; user.ID = -1; UserDao.Update(user) user = userCopy; } I don't want a copy by reference, it has to be a copy by value. The above is just a sample, not how I really want to use it but I need to learn how to copy by value.

    Read the article

  • Split text at the first instance of a letter

    - by Blankman
    I have a bunch of product sku's that look like: abc234 asdf234324 adc234-b result: abc 234 asdf 234324 adc 234-b I want to split the text at the first instance of a letter. When I say split, basically I want to have access to both parts of the text, maybe in an array? What's the best way to do this?

    Read the article

  • What's wrong with this UPDATE FROM using a case statement?

    - by Blankman
    update p set p.storePrice = CASE WHEN p.costPrice BETWEEN 0.00 AND 1.00 THEN p.costPrice * 1.0 CASE WHEN p.costPrice BETWEEN 0.00 AND 1.00 THEN p.costPrice * 1.0 ELSE p.msrpPrice END FROM product p WHERE p.type = 1 The error says: Msg 156, Level 15, State 1, Line 9 Incorrect syntax near the keyword 'CASE'. I can't seem to see any issue with the sql?

    Read the article

  • if all my views are passed a strongly typed viewdata, if they have a baseviewdata class, can I set a

    - by Blankman
    I want all my views to inherit from a baseview data so I can set some shared properties that all my views will need. Can I set some properties in OnExecuting so I don't have to do it for all Actions? I want to then display the string value of the property in all my view pages. If yes, how can I do this? I need to hook into the base view data somehow? so i'll have: public MyViewData : ViewData { } And I need one for generics also?

    Read the article

  • How to extract product weight from this HTML

    - by Blankman
    My HTML looks like this: <td class="main"><b>Product Weight (2.83 lbs in 1 container)</b></td> I need to get the value 2.83 from the HTML. Need help with the regex. I have this: Pattern p = Pattern.compile( "<td\\sclass=\"main\"><b>Product\\sWeight\\s\\s((?:\\d+\\.)?\\d+ \\w{3})"); But doesn't seem to be working. Am I missing an escape or something?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >