Hello!
Using reflection on Java classes to access all field, methods, and so on:
Is there a standardized order of these elements (which is specified in some standard)?
Of course, I could check it empirically, but I need to know if it's always
the same.
EDIT:
I waited for the question: What I need the order for ;)
Long story short: I h...
This is an issue that recently came up for me while writing a new XSLT for some XML generated by an application with XTHML embedded using CDATA. Normally I've been able to use disable-escape-output to render the results correctly.
However, in Firefox, everything was being displayed as escaped (i.e. &) as opposed to rendering as expe...
Reading the FTP RFC (RFC959), I notice some modes that I've never seen used, and indeed don't seem to be implemented by popular FTP software (vsftpd for example). In particular, for the STRU command, only file mode "STRU F" is commonly used, and for the MODE command, only stream mode "MODE S" is commonly used.
So the question is, when ...
What I really want is a ||= operator.
old_value = old_value || possible_new_value;
old_value ||= possible_new_value;
The second line is a compiler error (c++ doesn't have a ||= operator).
So what are my other options?
old_value += possible_new_value;
old_value |= possible_new_value;
While I'm on the subject how does bool behave wi...
The GNU C++ (g++ -pedantic -Wall) accepts this:
typedef int MyInt;
class Test
{
public:
MyInt foo();
void bar(MyInt baz);
};
int Test::foo()
{
return 10;
}
void Test::bar(int baz)
{
}
int main(void)
{
Test t;
t.bar(t.foo());
return 0;
}
Is it legal C++? Are other compilers likely to accept it?
...
I have a feeling this XML is not valid, can someone please explain why?
I think it has something todo this the dot i the element name?
estate_price.price_suggestion
Any thing else not valid about this XML?
XML
\\ <?xml version="1.0" encoding="UTF-8"?>
<iad>
<DataTag>
<element id="0">
<changed_string>content</changed_st...
Note: I completely reworked the question to more properly reflect what I am setting the bounty for. Please excuse any inconsistencies with already-given answers this might have created. I did not want to create a new question, as previous answers to this one might be helpful.
I am working on implementing a C standard library, and am c...
At some point I remember reading that threads can't be safely created until the first line of main(), because compilers insert special code to make threading work that runs during static initialization time. So if you have a global object that creates a thread on construction, your program may crash. But now I can't find the original art...
I have a Full Speed device that specifies the max packet size as 256 bytes. This is not USB compliant since the maxiumum packet size for a Full Speed Device should be 64 bytes. I can read (ReadFile) and write (WriteFile) to the device just fine, but I'm wondering if there could be issues that could arise that I'm just not seeing other ...
Hi,
I've want to know what is the best practice or approach in dealing with multiple and complex columns with a form inside.
here's an example of the form I'm dealing with
http://img96.imageshack.us/img96/5658/complexform.jpg
How to properly write a HTML markup for this? If I wrap every form element with a 'DIV' for every column it...
Why are JS scripts usually place in the header of a document? Is it required by standards, or is it just a convention with no particular reason?
...
After reading this post on comp.lang.c++.moderated, I was completely surprised that it compiled and worked in both VS 2008 and G++ 4.4. The code:
#include <stdio.h>
int main()
{
int x = 10;
while( x --> 0 ) // x goes to 0
{
printf("%d ", x);
}
}
Where in the standard is this defined, and where did it come ...
Hi all,
I'm trying to compile a Mac version of our lib for a customer that wants to include it in a Photoshop plugin, and he is having trouble linking our lib into his app. More detailed info: His plugin is built against the CS4 Photoshop SDK, which means the Mac OS base SDK should be 10.4. My lib is a static one, compiled with the Inte...
Take this page for example, is it possible to insert a child into mydiv such that it will cause mydiv's height to grow beyond 500px?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<body>
<div id="mydiv" style="width:500px;height:500px;border:4px solid red">
...
Hi,
The following simple piece of code, compiles with VC2008 but g++ rejects the code:
#include <iostream>
class myclass
{
protected:
void print() { std::cout << "myclass::print();"; }
};
struct access : private myclass
{
static void access_print(myclass& object)
{
// g++ and Comeau reject this line but not VC++
...
I have a web page that is the parent to a bunch of pages that are loaded with in using the following code.
function loadContent(elementSelector, sourceURL) {
$(""+elementSelector+"").load("http://url.com/"+sourceURL+"");
}
To call this I would have a href like
href="javascript:loadContent('#content','page.php')"
How can you val...
I'm trying to motivate my team members to get our code to validate, but there seems to be some disillusionment because we are required to still support IE6.
Do you guys have any thoughts to this end?
This is what I'm going for:
Semantic code - YES
Validating code - YES
Works in IE6 - YES
Let's not argue over semantics ...
All,
I've noticed that asp.net includes a closing slash on the viewstate form field:
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="blah blah blah" />
How can I prevent this from happening? We're rendering html 4.01 strict and this seems to be noncompliant.
...
For practice I decided to rewrite string.c in C.
I can not find online (via google or other search engines) a test suite for either the entire standard or for specifically string.h
More specifically I am looking to see if my strcat(), strncat(), strchr(), strrchr(), strcmp(), strncmp(), strcpy(), strncpy(), strlen(), and strstr() func...
I don't have the (expensive) SQL standard at hand; what are updatable queries in SQL core/foundation?
I see that PostgreSQL doesn't support them, but some other databases do; can you point me to the documentation on how they work in those databases?
PostgreSQL has query rewriting and updatable views with the rule system; is this very d...