Search results

  1. M

    Javascript doubt...

    Yes, there will be trouble. In particular, if you call the global setCurr, it will only affect the last lava lamp, even though you may be trying to call it on a different lava lamp. The $li.click handlers will still work properly, since they call the local setCurr. There's a potential gotcha in...
  2. M

    wordpress database can not connect

    Connection information is now available on the X10 wiki article "How to connect to a database on X10".
  3. M

    Javascript doubt...

    Do you have a link to a live page? Did you call lavaLamp before trying to call setCurr? Taking a closer look at the original source code, there's a problem with what you're trying to do: each element that lavaLamp is called on (each lava lamp) defines its own setCurr. If you try to store...
  4. M

    Content Based Image Censoring Class

    There was a time when neural networks were all the rage for this sort of problem, though I don't know as though they're as highly thought of these days. You could explore image similarity algorithms. Sample images of interest (pornographic, artistic nudes, beach-goers &c). See how similar...
  5. M

    Visual Basic 2010

    The ASP.Net 2.0 quickstart tutorials are nice, if a bit old. Why VB and not C#? VB makes me feel unclean (though I do like that it supports XML literals; reminds me of E4X).
  6. M

    Javascript doubt...

    window.setCurr()=function(el){...} will call window.setCurr, then attempt to assign an anonymous function to the result, which isn't a valid operation in JS. Leave out the parentheses. Take a closer look at my previous code sample.
  7. M

    Javascript doubt...

    Assign them to globals, or to properties of a global. Assigning them to properties of window is equivalent to assigning them to global variables, but is more explicit. (function () { ... // is 'bar' a local or a global? bar = function () { ... } // 'baz' is a...
  8. M

    User Submission Video Embed Parse HTML tags

    Having users enter HTML is unnecessary for you and adds needless complexity for them. The safest approach would be to let users enter only the video URL, height and width. If need be, have different templates for different video hosts. If you still wish to allow HTML, you could use strip_tags...
  9. M

    What are the top 10 common security risk of a new site? What are the countermeasures?

    Re: What are the top 10 common security risk of a new site? What are the countermeasu Did you mean to include addslashes? Rolling your own sanitization function is bad practice, as you can easily forget an edge case or simply not be aware of a vulnerability. Even with DB provided quoting...
  10. M

    C# sorting a list with O(N) performance

    No, that won't work. Your loop is basically one iteration of a bubble sort. It will place the maximal element at the end of the list, and bubble a few other elements upwards, but won't sort the list. Try the list 2,1,0. All comparison-based sorts have a lower time-complexity bound of...
  11. M

    Sanitising file content for Blob storage

    Don't roll your own sanitization. Unless you really know what you're doing, there's an edge case you'll miss. Rather than sanitizing, use a prepared statement. You won't have to worry about truncation, which might be causing the problems you're experiencing and can also be used for some...
  12. M

    What are the top 10 common security risk of a new site? What are the countermeasures?

    Re: What are the top 10 common security risk of a new site? What are the countermeasu A few links to get started: 2010 CWE/SANS Top 25 Most Dangerous Software Errors PHP Freaks Security Tutorial Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes Information...
  13. M

    Just trying to create a simple PDO query function

    No worries. The forum misbehaves from time-to-time. As for the getCell usage example, it may cut down on the amount of data transferred for non-super users, but it increases the cost of retrieving data for super users, as each statement that is prepared and each query executed has overhead...
  14. M

    Saving a file to hard disk Actionscript 3.0

    You should implement your own persistence layer only if the data needs to be accessed by non-Flash-based apps. Otherwise, use local shared objects.
  15. M

    How to put a php variable into javascript

    Note that you shouldn't put a require (or any statement that might generate an error) in the middle of an embedded statement (in this case, the JS myChart.setDataURL). If there's an error, the result will be a ill-formed document, which will cause all sorts of parse problems and quite possibly...
  16. M

    Just trying to create a simple PDO query function

    Note that this advice comes from what I can only guess is the purpose of GetCell. The reason I keep asking what the purpose is (you should still answer, in a little more detail and at a higher level) is because what you're trying to use it for might be a bad idea. As the sig says, my questions...
  17. M

    Just trying to create a simple PDO query function

    You still haven't answered my question as to the purpose of GetCell. If you're using it to fetch fields from the DB, one at a time, don't. The performance will be terrible. Don't use multiple queries when one will do. If you're on free hosting, your site will likely be suspended for high...
  18. M

    My free web hosting account stena has been suspended.

    Searching or checking the FAQ (the first sticky thread in this forum) would lead you to High Resource Usage FAQ. There's also a page on HRU suspensions in the wiki, though it doesn't (yet) have instructions on how to unsuspend yourself.
  19. M

    Help required on my script php Dom xml

    You shouldn't use sizeof here. sizeof (like count) return the number of items in an array. for loops (make sure you read that documentation) loop over values, typically a range of integers, but any finite, computable sequence would work: for ($x=0; $x < 10; $x += 2) {/* even whole...
  20. M

    Just trying to create a simple PDO query function

    The error handling. As I said, my best guess is that you're using a database name where you should be using a table name, but there isn't enough information. Use error handling to find out the exact problem. As for just getting a site up-and-running, it'd be best to use a PHP framework. It...
Top