Why is it that if you open up an EXE in a hex editor, you will see all sorts of things. If computers only understand binary then shouldn't there only be 2 possible symbols seen in the file? Thanks
In Java, to create and show a new JFrame, I simply do this:
public static void main(String[] args)
{
new JFrame().setVisible(true);
}
However, I have seen many people doing it like this:
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
new JFrame().setVisible(true);
}
});
}
Why? Are there any advantages?
Why public InputStream getResourceAsStream(String name) is in Class class? It just give inputstream of file which is in jar file and there is no relation with Class class. so it can be static method and it can be in any class.
I have a homework assignment with a number of questions. One is asking why the strcpy() function doesn't need the call by reference operator for CStrings. I've looked through the book numerous times and I can't, for the life of me, find the answer. Can anyone help explain this to me?
It is an array of sorts so I would think you would need the call by reference.
Hi guys.
Dose anyone knows why I have to use -use-network=false in my Flex Builder?!?!?!
This is set inside the Project Properties and is Additional compiler argument.
This is only when I want to read in a external file like XML.
Others in my team doesn't have to have -use-network=false ????
I have found myself doing a lot of work to get nHibernate setup and am left wondering: Why use a framework like Hibernate/NHibernate? I am sure that quite a few people love the framework but I am unclear on the advantages and disadvantages. What are the advantages and disadvantages of lazy loading, and are there other features to Hibernate? Is there anything that makes a framework like this easier to use (best practices, other frameworks, etc)?
if we supposed that "A.B." is a value for an xml element called given-names
the following code converts this value to "A.tempspacetempspaceB." instead of "A. B."
foreach (XElement initial in doc.XPathSelectElements("//given-names"))
{
string v = initial.Value.Replace(".", ". ").TrimEnd(' ');
initial.SetValue(v);
}
So why tempspace comes here instead of literal space??
thank you for any help.
The following code prints randomly 634, 635, 636, each time I run it. Why its not constant?
public static void main(String[] args) throws Exception {
KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA", "BC");
keyPairGen.initialize(1024);
RsaKeyPair keyPair = new RsaKeyPair(keyPairGen.generateKeyPair());
System.out.println(keyPair.getPrivate().getEncoded().length);
}
Hi Experts,
I am clueless to find out why should we use static method with JSON. Is it possible that I click a button and I load a gridview with JSON ??
Thanks in advance
I have used Microsoft.SqlServer.Smo.dll and Microsoft.SqlServer.ConnectionInfo.dll in a number of VS2008 projects but they don't appear in the VS2010 Add Reference dialog. Why did they disappear and how can I add them to my VS2010 project?
I asked a question earlier about ESBs written in Erlang or Java, and there didn't seem to be anything in Erlang, and only products in Java.
http://stackoverflow.com/questions/2453641/what-would-be-the-best-language-in-which-to-write-an-esb/2453683#2453683
I guess I find it difficult to understand why a language like Erlang has no such middleware products, especially seeing as it should be ideally suited to the job.
1.What is the point of creating a class that can't be instantiated?
Most commonly to serve as a base-class or interface (some languages have a separate interface construct, some don't) - it doesn't know the implementation (that is to be provided by the subclasses / implementing classes)
2.Why would anybody want such a class?
For abstraction and re-use
3.What is the situation in which abstract classes become NECESSARY?can anyone brief it with an example?
Why doesn't the compiler automatically put break statements after each code block in the switch? Is it for historical reasons? When would you want multiple code blocks to execute?
I know there is the perl regex that is sort of a minor de facto standard, but why hasn't anyone come up with a universal set of standard symbols, syntax and behaviors?
I noticed that in Linux kernel 2.4 setscheduler doesn't force need_resched. Why is that? is it just some convention, or does that happens somewhere else?
Why is CompareAndSwap instruction considered expensive?
I read in a book:
"Memory barriers are expensive, about as
expensive as an atomic compareAndSet()
instruction."
Thanks!
Hello,
I am just wondering why programmers who program in C++ for windows always use Visual Studio 6 instead of Visual Studio 2008?
Isn't the compiler in 2008 much better than the one in VS6?
The reason I ask as I have used many sdk's that are always written in VS6?
Many thanks,
Steve
I believe the expression T() creates an rvalue (by the Standard)
However the following code compiles (at least on gcc4.0)
class T {... };
int main()
{
T() = T();
}
I know technically this is possible because member functions can be invoked on temporaries and the above is just invoking the operator= on the r-value temporary created from T().
But conceptually this is like assigning a new value to an r-value.
Is there a good reason why this is allowed?
Can someone please enlighten me as to why it makes sense to develop websites that work without Javascript enabled? This is 2010 and besides some mobile browsers on antique phones and a few paranoids who limit Javascript I cannot think of a good reason to spend energy on this.