Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, June 11, 2012

How do I make an http request using cookies on Android?


I'd like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequent requests). It'd be nice to preserve any and all cookies, but really the only one I care about is the session cookie.

Why doesn"t Java offer operator overloading?


Coming from C++ to Java, the obvious unanswered question is why didn't Java include operator overloading?

Get an OutputStream into a String


What's the best way to pipe the output from an java.io.OutputStream to a String in Java?

Seeking clarification on apparent contradictions regarding weakly typed languages


I think I understand strong typing , but every time I look for examples for what is weak typing I end up finding examples of programming languages that simply coerce/convert types automatically.

C++ versus D


Is the D language a credible alternative to Java and C++? What will it take to become a credible alternative? Should I bother learning it? Does it deserve evangelizing?

java.util.Date to XMLGregorianCalendar


Isn't there a convenient way of getting from a java.util.Date to a XMLGregorianCalendar?

Best practices for configuring Apache / Tomcat


We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using mod_proxy_jk as the connector.

Sunday, June 10, 2012

Efficient way to implement singleton pattern in Java


Efficient way to implement singleton pattern in Java?

Why does Maven have such a bad rep?


There is a lot of talk on the internet about how Maven is bad. I have been using some features of Maven for a few years now and the most important benefit in my view is the dependency management.

Weaknesses of Hibernate


I would like to know which are the weak points of Hibernate 3. This is not pretended to be a thread against Hibernate. I think it will be a very useful knowledge for decide if Hibernate is the best option for a project or for estimating its time.

Is there anything like .NET"s NotImplementedException in Java?


Is there anything like .net's NotImplementedException in java?

Friday, June 8, 2012

Initialization of an ArrayList in one line


I am willing to create a list of options to test something.

Why would iterating over a List be faster than indexing through it?


Reading the Java documentation for the ADT List it says:




The List interface provides four methods for positional (indexed) access to list elements. Lists (like Java arrays) are zero based. Note that these operations may execute in time proportional to the index value for some implementations (the LinkedList class, for example). Thus, iterating over the elements in a list is typically preferable to indexing through it if the caller does not know the implementation.


What is the most frequent concurrency issue you"ve encountered in Java?


This is a poll of sorts about common concurrency problems in Java. An example might be the classic deadlock or race condition or perhaps EDT threading bugs in Swing. I'm interested both in a breadth of possible issues but also in what issues are most common. So, please leave one specific answer of a Java concurrency bug per comment and vote up if you see one you've encountered.

Joins are for lazy people?


I recently had a discussion with another developer who claimed to me that JOINs (SQL) are useless. This is technically true but he added that using joins is less efficient than making several requests and link tables in the code (C# or Java).

Tuesday, June 5, 2012

Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?


I'm hoping someone can provide some insight as to what's fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need for a Global Interpreter Lock (GIL), while Python necessitates such an evil.

Good Java graph algorithm library?


Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend?

Why use Gradle instead of Ant or Maven?


What does another build tool targeted at Java really get me?

Why are static variables considered evil?


I am a Java programmer who is new to the corporate world. Recently I've developed an application using Groovy and Java. All through the code I've used quite a good number of statics. I was asked by the senior technical lot to cut out on the number of statics used. I've googled about the same, and I find that many programmers are fairly against using static variables.

How can I convert my Java program to an .exe file?


If I have a Java source file or class file (*.class). How can I convert it to an .exe file?