• About
  • License

Jorge Code

~ Viewpoint of a programmer, Java, Ubuntu, etc.

Jorge Code

Category Archives: Java

How to Install Oracle Java 9 in Ubuntu

22 Wednesday Jun 2016

Posted by Jorge in Basic, Java, Ubuntu

≈ Leave a comment

JavaIn previous post I showed you how to install Oracle Java 8 and 7 but, come on! Oracle Java 9 it’s here and It’s stable in Ubuntu!.

This is the new and easy procedure!

Continue reading →

Advertisement

Predictions for Java 20

09 Thursday Jun 2016

Posted by Jorge in Humor, Java

≈ Leave a comment

java20

Humor pills for programmers!

Continue reading →

CuaimaCrypt, a Strong Cryptographic Alternative

17 Wednesday Feb 2016

Posted by Jorge in Advanced, Android, Java, News, Ubuntu

≈ Leave a comment

Tags

Cryptography, CuaimaCrypt, Secure file, Strong Cryptography

cuaimaCryptI think CuaimaCrypt is one of best cypher ever designed because it have such a strong algorithm that can resist an quantum computer attacks.

For this reason, I’m currently working to supporting this project; consequently, I share this link with you in order to explain what I’m refer to.

convert-icon

Go to Bolivartech article: CuaimaCrypt, a Strong Cryptographic Alternative

 

Jorge Fernandes is Bachelor in Computer Science experienced in telecommunications, security, banking and programmer since 1984. He works in Valhala Networks focused on high-level decisions about scientific and technological policies and strategies of projects oriented to develop web and standalone applications, as well as smart solutions at mobiles. He always oriented to produce innovator products.

java.lang.OutOfMemoryError and X options

03 Wednesday Feb 2016

Posted by Jorge in Advanced, Java

≈ 1 Comment

Tags

java.lang.OutOfMemoryError, memory allocation, X options, Xms, Xmx

memoryOne common indication of a memory leak is the java.lang.OutOfMemoryError exception. Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap and the garbage collector cannot make space to accommodate a new object, and the heap cannot be expanded further. Also, this error may be thrown when there is insufficient native memory to support the loading of a Java class.

If the java.lang.OutOfMemoryError is due to heap problem, a common solution to this error can be manage the memory allocation pool manually for a Java Virtual Machine by using x options previous to run you application.

The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.

This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory. For example, starting a JVM like below will start it with 128MB of memory, and will allow the process to use up to 1024MB of memory:

java -Xms128m -Xmx1024m

The memory flag can also be specified in multiple size units, such as kilobytes, megabytes, and so on.

-Xms1024k
-Xmx1024m
-Xmx2g

The default value of Xmx will depends on platform and amount of memory available in the system.

When using these settings, keep in mind that these settings are for the JVM’s heap, and that the JVM can/will use more memory than just the size allocated to the heap. From Oracle’s Documentation:

Note that the JVM uses more memory than just the heap. For example Java methods, thread stacks and native handles are allocated in memory separate from the heap, as well as JVM internal data structures.

Notice: The -X options are subject to change without notice.

 

Jorge Fernandes is Bachelor in Computer Science experienced in telecommunications, security, banking and programmer since 1984. He works in Valhala Networks focused on high-level decisions about scientific and technological policies and strategies of projects oriented to develop web and standalone applications, as well as smart solutions at mobiles. He always oriented to produce innovator products.

Credit Card numbers or IMEI in Java (Luhn Algorithm)

20 Wednesday Jan 2016

Posted by Jorge in Intermediate, Java

≈ 2 Comments

Tags

Credit Card, Credit Card Number, Hans Peter Luhn, IMEI number, Java Luhn, Java Luhn Implementation, Luhn, Luhn Algorithm, Test Credit Card, Test IMEI

Hans Peter LuhnSome people ask me about how banks or online retailer know when their credit card number is wrong without a regular request or how their mobile services provider or mobile apps know their smartphone or tablet identification(IMEI) are invalid due to initial system configuration manipulation.

What if I tell you the similarity between this identifications and the java code behind the scene?

It sounds really cool, yeah?

Continue reading →

Create a directory if doesn’t exist

09 Wednesday Dec 2015

Posted by Jorge in Basic, Java

≈ Leave a comment

coffee_bean

If you have to create a directory if doesn’t exist, you can use this code:
Continue reading →

Defensive programming

09 Wednesday Dec 2015

Posted by Jorge in Intermediate, Java, JavaScript, Sin categoría

≈ Leave a comment

Tags

Defensive programming

systemfailureI think that one of best coding practices I have learned over time which can help improve the quality of software is the defensive programming; consequently, I share this link with you in order to explain what I’m refer to.

convert-icon

Go to Bolivartech article: Defensive programming to mitigate security breach and unforeseen events

Video: What’s a computer programmer ?

02 Wednesday Dec 2015

Posted by Jorge in Android, Basic, Java, JavaScript, News, Ubuntu

≈ Leave a comment

Tags

Bill Gates, computer program, Mark Zuckerberg, Programmer, Steve Jobs

VideoI love this video!!!
It’s a short and beautiful presentation about what’s a computer programmer with short interviews with some personalities like Bill Gates, Mark Zuckerberg, Steve Jobs, etc. What although perhaps you are a programmer I recommend you to see it.

Enjoy!!!
Continue reading →

How to Install Oracle Java 8 or 7 in Ubuntu

13 Friday Nov 2015

Posted by Jorge in Basic, Java, Tips and tricks, Ubuntu

≈ Leave a comment

Tags

oracle java ubuntu install

In some sitJavauations you need to run applications developed in Oracle Java over Ubuntu.
If you try to do this with recommended open souce flavors like openjdk-8-jdk and/or openjdk-8-jre sometimes rise up errors or malfunctions.

You can correct this situations by installing original Oracle Java Version 7 or 8 doing this procedure in a terminal:
Continue reading →

Some simple Java convertions

12 Sunday Apr 2015

Posted by Jorge in Basic, JavaScript

≈ Leave a comment

People always ask me how to do trivial things like conversions, let’s start
here:

String to Integer:

String stringNumber = "5";
int number = Integer.parseInt(stringNumber);

Continue reading →

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 680 other subscribers
Follow Jorge Code on WordPress.com

Categories

  • Android (6)
    • Tips and tricks (4)
  • Humor (1)
  • Java (10)
    • Advanced (2)
    • Basic (5)
    • Intermediate (2)
  • JavaScript (4)
  • News (8)
  • Sin categoría (1)
  • Ubuntu (9)
    • Tips and tricks (4)

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 680 other subscribers
Follow Jorge Code on WordPress.com

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Jorge Code
    • Already have a WordPress.com account? Log in now.
    • Jorge Code
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...