What do you guys think? Should constants be capitalized? Or is that an archaic practice? So...
const int MY_CONSTANT = 5;
vs.
const int myConstant = 5;
According to this question it seems like you can do this for Methods. What I want to know is why it doesn't work when I try it with properties.
public class Foo
{
public virtual object Value
{
get;
set;
}
}
public class Foo<T> : Foo
{
public override object Value
{
get
{
return…
I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installed. What could be the problem?
…
There's no shortage of questions and answers about centering but I've not been able to get it to work given my specific circumstances, which involve floating.
I want to center a container DIV that contains three floated input elements (split-button, text, checkbox), so that when my page is resized wider, they go from this:
||.....[ ][v] …
Hey all
Are there any pre-made scripts that I can use for PHP / MySQL to prevent server-side scripting and JS injections?
I know about the typical functions such as htmlentities, special characters, string replace etc. but is there a simple bit of code or a function that is a failsafe for everything?
Any ideas would be great. Many thanks :)
A requirement for a program I am writing is that it must be able to trust a configuration file. To accomplish this, I am using several kinds of hashing algorithms to generate a hash of the file at compile time, this produces a header with the hashes as constants.
Dependencies for this are pretty straight forward, my program depends on…
There is a previous question ("Is a masters degree overkill?"), which is about the types of jobs available and the value of a masters when trying to get a job. What I am curious about the impact of programming ability.
I know you usually write a masters thesis on some topic, which I imagine forces you to specialize. Do your…
Hi,
I include several images of eps format in latex. After latex command, there are some of the images missing in the dvi file. Not sure if it is related to the image size, most of the images missing have size around 83kB while those shown up have a size less than 40kB. After conversion from dvi to ps, the images are all back.…
Rumour has it that this;
SELECT * FROM lineage_string where lineage like '%179%' and lineage regexp '(^|/)179(/|$)'
Would be faster than this;
SELECT * FROM lineage_string where lineage regexp '(^|/)179(/|$)'
Can anyone confirm ? Or know a decent way to test the speed of such queries.
Thanks
I'm building an iPhone application where I detach some threads to do long-running work in the background so as not to hang the UI. I understand that threads need NSAutoreleasePool instances for memory management. What I'm not sure about is if the threaded method calls another method - does that method also need an…
If I pay someone to write some software for me and our contract doesn't specify, do I own the rights to the source code, or does the company who wrote the software? Who does the intellectual property belong to in this situation?
I'm specifically interested in the answer as it applies in the United Kingdom.
I'd like to be notified when a file has been created, deleted or changed, but not using polling mechanism.
I have surveyed related Java API that can use.(EX:JNotify, JPathWatch and JXFileWatcher)
Those APIs provide file monitor by using native component on OS. But I met the same problem is that they can't run on…
This question is similar, but does not show how to add a recipient.
How do I do both?
We'd like the widest support possible for as many Windows platforms as possible (from XP and greater)
We're using visual studio 2008
Essentially we want to send an email with:
pre-filled destination address
file attachment …
I am working on .NET ClickOnce project that uses Sql Server 2005 Compact Edition to synchronize remote data through the use of a Merge replication. This application has been live for nearly a year now, and while we encounter occasional synchronization errors, things run quite smoothly for the most part.
…
Is there a difference, or are the terms synonymous?
Sorry if this has been asked before, I could only find the difference between a full postback and a callback. I'm already aware of how a full postback is different.
In using ASP.Net 2.0, if that matters. (By the way, does it matter? Or are these…
Hi all,
I have this regex that allow all php files :
^.*\.([Pp][Hh][Pp])
how can I exclude a specific file, for example test.php ?
Thanks for your answer,
Best regards
[edit]
I omit to say that it is a reg from a htaccess file, the /i doesn't seems to work, and the ? neither.
[Edit2]
the…
I know that if I want to have requests for MyPage.aspx go to the class called MyHandler in the assembly called MyAssembly, I can add this to my web.config file:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="MyPage.aspx" type="MyHandler,…
Hi,
I have a wide and long table. I am not sure how to put it in my thesis. Since it is wide, sidewaystable may be the choice. Meanwhile it is also to long to fit in one page, so longtable comes into my mind. However, I cannot make sideaystable and longtable working together for one…
I have a program written in C that has to input and output JSON over a local domain socket. I've found several C / JSON libraries that 'almost work' through searches. Prior to taking one of the libraries that I found .. I want to be sure that I'm not over-looking a library that is…
In a Visual Studio Add-In, I'm enumerating over the members of a class in the current source file. When I encounter a property (e.g. CodeElement.Kind == vsCMElement.vsCMElementProperty) I cast that CodeElement to a CodeProperty and I can see the property's name and type.
What…
I have a list of training dates saved into an XML file, and I have a little javascript file that parses all of the training dates and spits them out into a neatly formatted page. This solution was fine until we decided that we wanted another web-page on another sever to access…
Hi all,
i'm trying to make SwfUpload working. In some cases, I've a strange behaviour.
So I would like to inspect the flows sended and received by the flash component. And I've tryed to use fiddler to do that, but I can't capture data comming from flash or going to flash.
Is…
I must be missing something very basic in the CSS. My jQuery anchor button is functional, but it's rendering as a simple underlined label, not asa rounded-corner UI button. I would be grateful if someone could point out the error in this simple example.
Thanks
!DOCTYPE HTML…
The company I am working for has a flash component (using flex and cs4) that crashes intermittently in chrome, FF and IE. (so far only win32 platforms)
I submitted a bug report to Adobe but have not heard anything back from them. Their support process seems like a black…
When signing up for an account on one of my apps, we need to store the time zone is in. We're using the time zone selector, which is fine, but I'd like to set the default value to something that it likely the user's current time zone.
Is there an easy way, either on the…