Jūs esate

java

35% discount on Oracle certification exams!

Today during my casual trip to work by bus I found one very interesting page - Oracle Certification . It says that:

* Bonus Special Offer
Terms and Conditions

This offer is valid until 12/31/2016.

Keytool: Most Common Commands

I'm using Java's keytool command for working with keystores and Public-Private keys. So, I found a very good site about keytool command:

The Most Common Java Keytool Keystore Commands

How to generate public/private keypair with RSA?

I'm developing several projects which use public/private key cryptography. So, the question is simple: how to generate public/private key pair?

As for me, I use OPENSSL to generate RSA key pair. It's simple:

openssl genrsa -out mykey.pem 2048

And public key can be generated like this:


openssl rsa -in mykey.pem -pubout > mykey.pub


OCJAP 7. Tip 1: int ArrayList is valid name for variable

I'm currently preparing for Oracle Certified Associate, Java SE 7 Programmer (OCJAP 7) exam So, I would like to post some tips for myself and probably others.

Tip for today is quite simple: any class name might be used as variable name. For instance:

[geshifilter-java] // These are valid identifiers int ArrayList; boolean Boolean; char String; // ... public class TestSimple {} double TestSimple; [/geshifilter-java]

How to load Spring Application context for jUnit from WEB-INF?

I'm using jUnit for writing unit tests for my applications.

It's easy to load applicationContext.xml when it's in classpath:

[geshifilter-java] @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath*:applicationContext.xml"}) public abstract class DefaultApplicationContext { // Code [/geshifilter-java]

But how to load application context not from classpath, but from custom directory, for example WEB-INF?

Solution is to use Maven's path:

Default log4j.properties file

I have a problem - I always forget how to initialize Log4 module.

So, I always do some googling and always land at the same page: Short introduction to Log4j.

To save some time, here is example configuration for log4j.properties:

ActivityNotFoundException on Android?

I am creating a small Android client for my Master's theses. Unfortunately, I've encountered a problem: I get ActivityNotFoundException during runtime process. I just need to change the activity of my program (to show the help box). Maybe someone could give me a hint what I'm doing wrong?

My main file/activity looks like that:

package info.ernestas.uvrsclient;

Howto. Send SMS with JavaME

Here is our second program with JavaME.

Sony Ericsson SDK && Eclipse && JAVA

I tried to install Sony Ericsson SDK with my Eclipse IDE. I found awesome tutorial how to do that: http://randomconsultant.blogspot.com/2008/07/creating-j2me-app-with-eclipseme-and.html

Įrašų įterpimas į surikiuotą masyvą

private static void insertEntryIntoArray(int insertationIndex, int entry, int [] array) { for (int i = array.length - 1; i > insertationIndex; i--) array[i] = array[i - 1]; array[insertationIndex] = entry; } // Kodas.... int [] array = new int[5]; int numberToInsert = 7; int entriesFilled = 3; array[0] = 1; array[1] = 5; array[2] = 10; for (int i = 0; i < entriesFilled; i++) if (array[i] > numberToInsert) { insertEntryIntoArray(i, numberToInsert, array); entriesFilled++; break; } Gal kam pravers :)

Puslapiai

Subscribe to java