In url query with id I use is_numeric($_GET['id']) for security issues. But in query with for example category name, is urlencode() a right way for security?
Thanks in advance.
Here's an example of the type of background image I'm talking about...
Clearly, there's a pattern in it. My question is, if this were an iPad app and the background image was twice the size, would there be any significant benefits to taking advantage of this pattern by tiling the image? Or would it really make no difference in terms of performanceand just be easier to load the entire image into a UIImageView?
Thanks in advance for all your wisdom!
Apple, for memory management issues, recommend defining outlets on properties, not in the attribute declaration. But, as far as I know, declaring properties exposes the class to external classes, so this could be dangerous.
On UIViewController we have the main view definition and the logic, so MVC is slightly cheated in this cases.
What is the beteer approach, Apples's recommendation for memory-management or armored classes?
I have a div, containing text and a few links. I want to trigger an onclick event, only if the click occurs anywhere in the div, but not on any of the links.
What would be the best way (performance wise) to implement this using jQuery?
The one I use is
$('#div').click(function(){
});
but it disables all the #div a
I'm trying to execute this on MS-SQL but returns me an error just at the Group by line
update #temp
Set Dos=Count(1)
From Temp_Table2010 s
where Id=s.Total and s.total in (Select Id from #temp)
group by s.Total
Do anyone knows how can I solve this problem having good performance.
If a compiler doesn't "support" RTTI, does that mean that the compiler can not handle class hierarchies that have virtual functions in them? Or have I been misunderstanding the literature about how RTTI isn't portable, and the issues lie elsewhere?
I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing back to the server.
Has anyone dealt with this that can give me some pointers?
Intro
When saving png images through GIMP, I've always used level 9 (maximum) compression, as I knew that it's lossless. Now I've to specify compression level when saving png format image through GD extension of PHP.
Question
Is there any case when I shouldn't compress PNG to maximum level? Like any compatibility issues? If there's no problem then why to ask user; why not automatically compress to max?
There are situations that we like to ignore a specific exception type (commonly ObjectDisposedException). It can be achieved with those two methods:
try
{
// code that throws error here:
}
catch (SpecificException) { /*ignore this*/ }
catch (Exception ex)
{
// Handle exception, write to log...
}
or
try
{
// code that throws error here:
}
catch (Exception ex)
{
if (ex is SpecificException) { /*ignore this*/ }
else
{
// Handle exception, write to log...
}
}
What are the pros and cons of this two methods (regarding performance, readability, etc.)?
I'm coming up with a web app which will want me to store more than 80 Lakh (8 million) rows. Will it be fine to handle those many number of rows with MySQL without having any performance degradation?
Assume my RAM to be 4 GB and Infinity GB Harddisk space. Also, the main fields have been indexed.
I have grown tired of all the little issues with paste template, it's horrible to maintain the templates, it has no way of updating an old project and it's very hard to test.
I'm wondering if someone knows of an alternative for quickstart generators as they have proven to be useful.
Right now I cant find a way to generate a callback between lines 1 and 2 here:
f = Foo.new
f.some_call
f.save!
Is there any way to simulate what would be effectively an after_new callback? Right now I'm using after_initialize but there are potential performance problems with using that since it fires for a lot of different events.
class Base
{
public:
type1 m_Pants;
};
class Derived : Base
{
public:
type2 m_Pants
};
This essentially didn't get flagged as an error, but was creating all kinds of clobbering andissues throughout a project.
Does anyone know of a technicality that wouldn't flag this?
Hi,
Can anybody detail some approach on how to save private data in social websites like facebook, etc. They cant save all the updates and friends list in clear text format because of privacy issues. So how do they actually save it?
Hashing all the data with user password so that only a valid session view it is one possibility. But I think there are some problem with this approach and there must be some better solution.
I was wondering, is the size() method that you can call on a existing ArrayList<T> cached?
Or is it preferable in performance critical code that I just store the size() in a local int?
I would expect that it is indeed cached, when you don't add/remove items between calls to size().
Am I right?
I'm new in python and I'm having some issues doing a simple thing.
I've an array (or list as it's said in pyton) like this:
list = [ 'NICE dog' , 'blue FLOWER' , 'GOOD cat' , 'YELLOW caw']
As you see each element of this array contains some words. These words is both lowercase and uppercase.
How I can delete from this array each lowercase words?
For example I'd like to have as result this list:
list = [ 'NICE' , 'FLOWER' , 'GOOD' , 'YELLOW']
For my year-end pet project, I'd like to analyze investment advices and their correlation to the stock market performance.
The problem is, where do I get the dump of investment advice data (free) ?
something like stackoverflow.com data dump will be nice.
Or maybe it's easier to do distributed crawling and crawl the public finance webpages for investment advices?
Investment advice is buy/sell advice for stocks/forex, issued by institution/investment advisor.
OK, so we all saw the lists of "funny" or "bad" comments.
However, today, when maintaining an old stored proc, I stumbled upon a comment which I couldn't classify other than "refreshingly brutally honest", left by a previous maintainer around a really freakish (both performanceand readability-wise) page-long query:
-- Feel free to optimize this if you can understand what it means
So, in the first (and hopefully only) poll type question in my history of Stack Overflow, I'd like to hear some other "refreshingly brutally honest" code comments you encountered or written.
I've got eclipse workspaces for my full time job and my home test work that are both set up with ivy (and using ivyDE).
However, I'm finding that I'm getting strange behaviour and conflicts between the different workspaces - issues like not being able to find certain dependencies, or not compiling etc.
Is there a way in ivy or ivyDE to set the home .ivy2 directory so that I can split my workspaces? At the moment, I'm alternating different directories for my .ivy2 cache.
I am using SQL server and ODBC in visual c++ for writing to the database. Currently i am using parameter binding in SQL queries ( as i fill the database with only 5 - 6 queries and same is true for retrieving data). I dont know much about stored procedures and I am wondering how much if any performance increase stored procedures have over parameter binding as in parameter binding we prepare the query only once and just execute it later in the program for diferent set of values of variables.
I have so many problems with using crystal reports over the internet.
I admit that the web viewer looks good and the reports you can produce with it are really good but...
I have issues with diffrent versions on diffrent servers
The development tools are worse than access
I dont understand it.
Does anyone have any good alternatives for displaying and outputting reports over the web?
I have programmed an emulator, but I have some doubts about how to organizate it properly, because, I see that it has some problems about classes connection (CPU <- Machine Board).
For example: I/O ports, interruptions, communication between two or more CPU, etc.
I need for the emulator to has the best performanceand good understanding of the code.
PD: Sorry for my bad English.
Hi bit of a silly question.
Are there any png transparency issues with backgrounds to submit buttons or inputs of type image? Or do they behave fine just like img tags with a png image as the source.
I understand for IE6 you need a hack for png transparency to work.
I have seen a few mentions of this idiom (including on SO):
// Deliberately empty subscriber
public event EventHandler AskQuestion = delegate {};
The upside is clear - it avoids the need to check for null before raising the event.
However, I am keen to understand if there are any downsides. For example, is it something that is in widespread use and is transparent enough that it won't cause a maintenance headache? Is there any appreciable performance hit of the empty event subscriber call?
I have created NPAPI plugin, which is workig fine on linux where I have created the .so file but when I deployed this plugin on our production device where we have linux environment with limited resources(due to performance constraints) , following error is thrown
'/usr/lib/mozilla/plugins/npPluginTest.so' is not an ELF executable for sh
FYI:so file created on 32bit linux box.
how can I resolve this issue?