CCleaner :- Defraggler

Background

Using Microsoft Windows Computer Manager \ Disk Administrator.

Trying to change my logical disks size by shrinking one volume and expand an adjacent volume unto the availed space.

 

Computer Management

Disk Administrator

Images

Outline

  1. Querying Shrink Space
  2. Shrink Space ( 6 GB )
  3. Error
    • You cannot shrink a volume beyond the point where any unmovable files are located.

Image – Querying Shrink Space

Image – Shrink Space ( 6 GB )

 

Image – You cannot shrink a volume beyond

Image

Textual

You cannot shrink a volume beyond the point where any unmovable files are located.

See the “defrag” event in the Application log for detailed information about the operation when it has completed.

 

Defraggler

Download

Downloaded Defraggler from CCleaner’s web site.

The URL is https://www.ccleaner.com/defraggler ( Link )

 

Installed

Installed Defraggler.

Use

Outline

  1. Launch Defraggler
  2. Select Drive
  3. Analyze Disk
  4. Defrag Disk

Image

Image 01

 

Image 02

 

Image 03

 

Summary

De-fragmenting the disk uncluttered our files and created “whole” unused storage area.

Rebooted the machine.

And, we were able to return to Computer Management, and shrink the disk volume.

java – Log4j

Background

Playing around with Hibernate got me staring at the screen reviewing console messages; especially SQL statements.

Log4j

Time to implement better logging; mostly instead of having it show up on the console, placing it in log files.

Download

Artifacts

log4j is available here ( https://logging.apache.org/log4j/2.x/download.html ).

Version

The current version is 2.11.2

Download

Please download and extract the files.

I am on Windows and chose apache-log4j-2.11.2-bin.zip.

Project Configuration

Eclipse

This is a simple test and so started a new project.

Project Configuration

In Eclipse, please access the Java Build Path.

Files

  1. log4j-api-2.11.2.jar
  2. log4j-core-2.11.2.jar

Image

Configuration Files

Log4j

Sample

log4j2.property.20190518.0147PM

Java

Outline

  1. Import packages/classes
    • Apache – log4j
      • org.apache.logging.log4j
        • import org.apache.logging.log4j.LogManager;
        • import org.apache.logging.log4j.Logger;
    • Network
      • java.net
        • Import java.net.InetAddress
        • Import java.net.UnknownHostException
  2. Instantiate Logger
    • LogManager.getLogger
  3. Use Logger
    • Invoke Log
      • log.info
      • log.error

Sample


package log4j2;

import java.util.Map;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public final class hello
{

	private static final Logger log
				= LogManager.getLogger
					(
							log4j2.hello.class
					);

	public static void main(String[] args)
	{

		// TODO Auto-generated method stub
		String computerName = null;

		computerName = getComputerName();

		if (computerName != null)
		{

			computerName = getHostName();

		};

		//computerName = null;

		if (computerName != null)
		{
			log.info("Computer :- " + computerName);
		}
		else
		{

			log.error("Unknown Computer!");

		}

	}

	static private String getHostName()
	{

		String hostname = null;

		try
		{
		    InetAddress addr;
		    addr = InetAddress.getLocalHost();
		    hostname = addr.getHostName();
		}
		catch (UnknownHostException ex)
		{
		    System.out.println("Hostname can not be resolved");
		}

		return (hostname);

	}

	/*
	 *
	 * https://stackoverflow.com/questions/7883542/getting-the-computer-name-in-java
	 */
	static private String getComputerName()
	{
	    Map env = System.getenv();
	    if (env.containsKey("COMPUTERNAME"))
	        return env.get("COMPUTERNAME");
	    else if (env.containsKey("HOSTNAME"))
	        return env.get("HOSTNAME");
	    else
	        return null;
	}

}

Output

Source Control

Git

log4j.2.sample
Link

Summary

A couple of quick points.

A lot of the Log4j sample configuration files available on the Internet are based on the original implementation.

The current version of Log4j is version 2, Log4j2.

Its XML Schema is quite different than Version 1.

Please look for samples that explicitly mention and reference, Log4j2.

 

Java – Set – Method – Remove – Null Exception

Background

Trying to familiarize myself with Collection classes in Java.

With Hibernate being an ORM tool that encapsulates database processes, one has to have a good grasp of records and set operations.

Error

I ran into a blocking error.

It simply read null.

 

Code

Original Code

Java Snippet


Set cities = new HashSet();

for (City city:cities)
{

	if (city != null)
	{

		removeCity(city);

		//Doing this raised Exception
		//Exception Message is null
		cities.remove(city);

	}		

}

Output

Exception


Exception Message is null
StackTrace

Revised Code

Java Snippet


Set cities = new HashSet();

Iterator iterator = cities.iterator();

while (iterator.hasNext())
{

	City city = iterator.next();

	removeCity(city);

	iterator.remove();

}

 

Summary of Change

In the erroring code :-

  1. We iterated the set using the for-each construct
    • Process each node
    • Attempt to remove the processed node via invoking the remove method
      • Hashset.remove
        • Failed
          • null exception

The revised code :-

  1. Instantiated an iterator against the collection
  2. Checked for next node via the hasNext method
  3. If hasNext is positive :-
    • Invoke next against the Iterator, receive back the node
    • Process the node
    • Invoke remove against the Iterator

References

  1. java tutorial
    • Interfaces
      • The Set Interface
        Link
  2. java references
    • java.util
      • java.util.HashSet
        • Class HashSet<E>
          Link
    • java.util
      • java.util.Iterator
        • Interface Iterator<E>
          Link

Hibernate/Annotation – Error – “Schema-validation: missing column”

Background

Adding more functionality to a POJO ( Plain Old Java Object) class that relies on Annotations.

Error

But, here ended up with an error!

Error Message


Schema-validation: missing column [bResetDependantEntityCountryIDOnDelete] in table [dbo.country]
Failed to create sessionFactory object.org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [bResetDependantEntityCountryIDOnDelete] in table [dbo.country]
Exception in thread "main" java.lang.ExceptionInInitializerError
        at sakila.helloDB.dbWork(helloDB.java:166)
        at sakila.helloDB.run(helloDB.java:55)
        at sakila.helloDB.main(helloDB.java:42)
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [bResetDependantEntityCountryIDOnDelete] in table [dbo.country]
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:136)
        at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
        at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:192)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73)
        at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:309)
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
        at sakila.helloDB.getDBSession(helloDB.java:82)
        at sakila.helloDB.dbWork(helloDB.java:116)
        ... 2 more

Error Image

SchemaValidationMissingColumn.20190516.0828PM.PNG

Code

Outline

  1. “Decorate” variable declaration with the keyword @Transient

Code


    private Boolean bResetDependantEntityCountryIDOnDelete = true;

    public Boolean getResetDependantEntityCountryIDOnDeleteFlag()
    {
        return bResetDependantEntityCountryIDOnDelete;
    }

    public void setResetDependantEntityCountryIDOnDeleteFlag(Boolean value)
    {
    	bResetDependantEntityCountryIDOnDelete = value;
    }

Revision


    //object.org.hibernate.tool.schema.spi.SchemaManagementException:
    //Schema-validation: missing column
    @Transient
    private Boolean bResetDependantEntityCountryIDOnDelete = true;

    public Boolean getResetDependantEntityCountryIDOnDeleteFlag()
    {
        return bResetDependantEntityCountryIDOnDelete;
    }

    public void setResetDependantEntityCountryIDOnDeleteFlag(Boolean value)
    {
    	bResetDependantEntityCountryIDOnDelete = value;
    }

Bishop Robert Barron – “Priest, Prophet, King”

 

Videos

  1. “Priest, Prophet, King” Sample – Lesson 1
    • Profile
      • A sample video from “Priest,Prophet,King”, a dynamic new video series from Fr. Barron debuting in August 2014. Learn more at http://PriestProphetKing.com.
    • Videos
      • Video #1
        Channel :- Bishop Robert Barron
        Published on May 8, 2014
        Link
  2. Bishop Barron on the Devil
    • Profile
      • Bishop Barron on the Devil
    • Videos
      • Video #1
        Channel :- Bishop Robert Barron
        Published on :- 2012-July-25th
        Link
  3. Bishop Barron on The Prosperity Gospel
    • Profile
      • Another part of a video series from Wordonfire.org.
      • Bishop Barron will be commenting on subjects from modern day culture.
    • Videos
      • Video #1
        Channel :- Bishop Robert Barron
        Published on :- 2010-April-8th
        Link
  4. Bishop Robert Barron – 2016 CBE Keynote Speech
    • Profile
      • The Catholic Church’s social teachings about capitalism were the topic of Bishop Barron’s keynote address. “Every single pope in the church has affirmed the most central element of the market economy: private property,” he said. “Private property is grounded in the dignity and freedom of the individual. Private property allows the diffusion of power, not concentration in the hands of a few. The Church likes the entrepreneurial spirit.” Yet the popes have noted that because God made the world for everyone, the common good must be uppermost in the minds of capitalist Christians.
    • Videos
      • Video #1
        Channel :- The Orange Catholic Foundation
        Published on :- 2016-Mar-18th
        Link
  5. Fr. Robert Barron on the Temple: Mundelein Seminary Lecture Series
    • Profile
      • Fr. Robert Barron is discusses the theology of the Jewish Temple and why it is the meeting of Heaven and Earth.
    • Videos
      • Video #1
        Channel :- Mundelein Seminary
        Published on :- 2014-Sept-9th
        Link
  6. Bishop Barron: Sainthood, sanctity and what makes us holy
    • Profile
      • Bishop Robert Barron gives an excellent keynote address at the Adoremus Eucharistic Congress 2018 in Liverpool reflecting on sainthood, sanctity and what makes us holy.
    • Videos
      • Video #1
        Channel :- Catholic Church England and Wales
        Published on :- 2018-Sept-12th
        Link
  7. “The Mystery of God” – Sample Lesson
    • Profile
      • Lesson 1 from Fr. Robert Barron’s “The Mystery of God” film and study program. Learn more at http://MysteryOfGod.com. This sample lesson is on “Atheism and What We Mean By ‘God'”.
    • Videos
      • Video #1
        Channel :- Bishop Robert Barron
        Published on :- 2015-Jun-27th
        Link

 

In depth

“Priest, Prophet, King” Sample – Lesson 1

  1. Early Christians took Three great archetypes from the Old Testament
    • Priest
    • Prophet
    • King

 

 

 

Rod Stewart

Background

There are so many good things to say about Soulful Rod Stewart.

Yet, it is so far better to have him say it himself.

 

Videos

  1. Some Guys Have All The Luck
    • Videos
      • Rod Stewart – Some Guys Have All the Luck / Addicted to Love (from One Night Only!)
        Channel :- Rod Stewart
        Published on :- 2016-Oct-5th
        Link
      • Video #1
        Channel :- Macik0073
        Published on Mar 3, 2012
        Link
  2. So far away
    • Videos
      • Video #1
        Channel :- nightfawn27
        Published on May 23, 2010
        Link
  3. Rod Stewart – Forever Young (Official Video)
    • Videos
      • Forever Young
        Channel :- Alberto Cruz
        Published on : – 2010-May-28th
        Link
  4. Rod Stewart – You’re In My Heart
    • Videos
      • Music video by Rod Stewart performing You’re In My Heart. (P) 2004 RCA Records, a division of Sony Music Entertainment
        Channel :- Rod Stewart
        Published on : – 2016-Oct-5th
        Link
  5. Rod Stewart – First Cut Is The Deepest (from One Night Only!)
    • Profile
      • Music video by Rod Stewart performing First Cut Is The Deepest. (P) 2004 RCA Records, a division of Sony Music Entertainment
    • Videos
      • Rod Stewart – First Cut Is The Deepest (from One Night Only!)
        Channel :- Rod Stewart
        Published on : – 2016-Oct-5th
        Link
  6. Reason To Believe
    • Profile
      • Music video by Rod Stewart performing Reason to Believe. (C) 2004 RCA Records, a division of Sony Music Entertainment
    • Videos
      • Video #1
        Channel :- Reason To believe
        Published on :- 2016-August-5th
        Link
  7. Jeff Beck, Rod Stewart – People Get Ready
    • Profile
      • Jeff Beck’s official music video for ‘People Get Ready’ ft. Rod Stewart.
    • Videos
      • Jeff Beck, Rod Stewart – People Get Ready
        Published on :- 2013-July-20th
        Link
  8. Rod Stewart – Have You Ever Seen The Rain
    • Profile
      • Rod Stewart – Have You Ever Seen The Rain (Official Music Video)
    • Videos
      • Video #1
        Channel :- Rod Stewart – Have You Ever Seen The Rain (Official Music Video)
        Published on :- 2009-August-25th
        Link

Lyrics

Forever Young

May the good Lord be with you down every road you roam.
And may sunshine and happiness surround you when you’re far from home.
And may you grow to be proud, dignified and true.
And do unto others as you’d have done to you.
Be courageous and be brave.
And in my heart you’ll always stay

Forever young. (Forever young)
Forever young. (Forever young)

May good fortune be with you, may your guiding light be strong,
Build a stairway to heaven with a prince or a vagabond.
And may you never love in vain.
And in my heart you will remain

 

Some Guys Have All The Luck

Alone in a crowd on a bus after working, I’m dreaming
The guy next to me has a girl in his arms, my arms are empty
How does it feel when the girl next to you says she loves you?
Seems so unfair when there’s love everywhere but there’s none for me

Someone to take on a walk by the lake Lord, let it be me
Someone who’s shy, someone who’d cry at sad movies
I know I would die if I ever found out she was foolin’ me
You’re just a dream, and as real as it seems, I ain’t that lucky
Some guys

 

So far away

So far away
Doesn’t anybody stay in one place any more?
It would be so fine to see your face at my door
And it doesn’t help to know you’re just time away
Long ago I reached for you and there you stood
Holding you again would only do me good
Oh how I wish I could but you’re so far away
One more song about moving along the highway
I can’t say much of anything that’s new
But if I could only work this life out my way
I’d rather spend it being close to you
But you’re so far away
Doesn’t anybody stay in one place any more?
It would be so fine to see your face at my door
And it doesn’t help to know you’re so far away
So far away, yeah, you’re so far away
Traveling around sure gets me down and lonely
Nothing else to do but close my mind
And I sure hope the road don’t get to own me
There’s so many dreams that I’ve yet to find

Alistair Begg

 

Videos

  1. Spiritual Warfare
    • Profile
      • Part One
        • By: Alistair Begg – Jesus secured salvation for all believers when He defeated Satan at the cross. Until Christ returns, however, spiritual warfare rages on in this world and should not be easily dismissed. In His mercy, God has provided the armor by which we can withstand such fierce opposition. In this overview of God’s protective provision, Alistair Begg exhorts us to resist Satan’s accusations, look outside ourselves to Christ, and recall the truth that in Christ, we already have the victory.
      • Part Two
        • By: Alistair Begg – Every believer dwells in the spiritual realm and will encounter battle with our adversary, the devil, until Christ’s return. Alistair Begg urges us to remain alert to Satan’s subtle, fiery darts, and outlines a practical strategy to employ in the midst of the struggle. As students of God’s Word, we can persevere—conscious of our weakness, but strong in the Lord; resolute because of His goodness; and with every confidence in our unity with the One who reigns victorious.
    • Videos
      • Spiritual Warfare, Part One
        • Video #1
          Channel :- Alistair Begg
          Published on :- 2018-May-23rd
          Link
      • Spiritual Warfare, Part Two
        • Video #1
          Channel :- Alistair Begg
          Published on :- 2018-May-23rd
          Link
  2. Prophet, Priest, King
    • Profile
      • Understanding the breadth of Christ’s finished work is essential for the Christian life. This study in Hebrews 1 reminds us that Jesus is the Prophet who revealed God finally and fully, the Priest who reconciled lost people to God by sacrificing himself, and the triumphant King who reigns over all that he has made.
    • Scripture
      • Hebrews 1
        • Prophets
          • In the past God spoke to our ancestors through the prophets at many times and in various ways, 2 but in these last days he has spoken to us by his Son ( Hebrew 1:1 )
        • Priest
          • After he had provided purification for sins ( Hebrew 1:3 )
        • King
          • But about the Son he says,

            “Your throne, O God, will last for ever and ever;
                a scepter of justice will be the scepter of your kingdom.
            You have loved righteousness and hated wickedness;
                therefore God, your God, has set you above your companions
                by anointing you with the oil of joy.”

            ( Hebrew 1:8-9 )

    •  Videos
      • Prophet, Priest, King
        • Video #1
          Channel :- Alistair Begg
          Published on :- 2012-Jan-4th
          Link
  3. The Peril of Spiritual Apostasy – Alistair Begg Sermons
    • Profile
      • The Peril of Spiritual Apostasy – Alistair Begg Sermons Hebrews 6:4 For it is impossible, in the case of those who have once been enlightened, who have tasted the heavenly gift, and have shared in the Holy Spirit.
    • Videos
      • Video #1
        Channel :- Christian Praise and Worship in Songs, Sermons, and Audio Books
        Published on Mar 21, 2014
        Link
  4. Signs of the Ends
    • Profile
      • Most of the time, when the topic is “the end of the world,” you hear a lot of speculation about dates and events and meanings. Mark 13 shows us a striking difference in the way Jesus approached this subject. Instead of speculating about dates, the Lord provided His followers with practical instruction – actions and attitudes that will equip us to face the future He has planned.
    • Videos
      • Video #1
        Channel :- Alistair Begg
        Published on Sep 20, 2012
        Link
  5. The Danger of Deception
    • Profile
      • When someone claims to speak on God’s behalf, it’s absolutely essential that we evaluate their message’s credibility. Join us on Truth For Life as Alistair Begg examines the apostle John’s warning to be on the lookout for deceivers.
    • Videos
      • Part 1
        • The Danger of Deception (Part 1 of 2) —5/18/2019
          Channel :- Alistair Begg
          Published on :- 2019-May-19th
          Link