Simple Java Password Generator

hello there,

today im going to share with you a simple Java Class which is being able to generate passwords and their phonetics

I hope that you are going to enjoy it :D

import java.util.HashMap;
import com.google.gwt.user.client.Random;

public class PasswordGenerator {

     protected static char[] goodChar = { 'a', 'b', 'c', 'd', 'e', 'f', 'g',
          'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
          'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K',
          'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
          '2', '3', '4', '5', '6', '7', '8', '9',};

     static HashMap<String, String> nato = new HashMap<String, String>();
     static{
         nato.put("a", "alfa");
         nato.put("b","bravo");
         nato.put("c","charlie");
         nato.put("d","delta");
         nato.put("e","echo");
         nato.put("f","foxtrot");
         nato.put("g","golf");
         nato.put("h","hotel");
         nato.put("i","india");
         nato.put("j","juliett");
         nato.put("k","kilo");
         nato.put("l","lima");
         nato.put("m","mike");
         nato.put("n","november");
         nato.put("o","oscar");
         nato.put("p","papa");
         nato.put("q","quebec");
         nato.put("r","romeo");
         nato.put("s","sierra");
         nato.put("t","tango");
         nato.put("u","uniform");
         nato.put("v","victor");
         nato.put("w","whisky");
         nato.put("x","x-ray");
         nato.put("y","yankee");
         nato.put("z","zulu");
         nato.put("0","Zero");
         nato.put("1","One");
         nato.put("2","Two");
         nato.put("3","Three");
         nato.put("4","Four");
         nato.put("5","Five");
         nato.put("6","Six");
         nato.put("7","Seven");
         nato.put("8","Eight");
         nato.put("9","Niner");
     }

     public static String getNext(Integer length) {
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < length; i++) {
              sb.append(goodChar[Random.nextInt(goodChar.length)]);
            }
            return sb.toString();
          }

     public static String getNatoPhonetic(String s){
         String result = "";
         for(int i = 0; i < s.length(); i++){
             Character c = s.charAt(i);
             String x = nato.get(c.toString());
             if(Character.isUpperCase(c) == true){
                 x = nato.get(c.toString().toLowerCase());
                 x = x.toUpperCase();
             }
             if(result.equals("")==false)
                 result += " - ";
             result += x;
         }
         return result;
     }

     /**
     *@param argv
     */
    public static void main(String[] argv) {
            for (int i = 0; i < 20; i++) {
              System.out.println(PasswordGenerator.getNext(8));
              System.out.println(PasswordGenerator.getNatoPhonetic("hWE58llo"));
            }

}

}

Something i had to write

Standing on a cross road
I don’t know which way to go

To live my fantasies or to live my life
It is the answer for a question I couldn’t find

Time passed by me without saying goodbye
Is it true or it is just another lie

To love and to be loved is it real
Or it is just a story for sleepy dreams

I’m I fading away like a candle in a rainy day
Or like a picture from faraway

Void is the road to my hopes
Like Broken trees in winter storm

Did I sacrificed my life in vain
Or I’m I too selfish to be blamed

Am I real or just an empty frame on the wall
Or the secret eye on some body’s door

Hallowed cold nights I spent alone
Waiting for hope to awaken my soul

Being drift away from reality
And all that remains is some theories
And Unjustified practicality
Which lacks certainty and harmony

I can’t see the road From where I stand
Did I left my feet or they left me

Talking to it maybe it could understand
Since beings replaced their minds with sand

Fragments of memories all I have left
Which I feed on them when I’m hungry
Think of them when I’m angry
And play with them when they need me

I’m I insane or reality just passed away
In a grave of time where even the light strays from night

I take look around and all I see cognition cleansing
embryos children adults and elders are clinging
On some ideas of perfection

Women Rights – Part 2

So i stopped yesterday because i need to sleep, since I’m waking up early not as usual. Anyway back to our subject.

Why did I say that “women have the right to become a man on every aspect while not being a man”? In order to understand the term lets take a look what women wants now a days and how this diversity of needs altered women mind, how they think about their rights, and how this thing shacked the very core of society now a day’s.  I will use top bottom logic while addressing women needs, But before addressing their needs, we need to agree on the relation between being mature and being feminine if there is any relation, And the definitions of mature/feminine as an adjective.

I will start by defining feminine : this word came from latin word femina which means “Woman” and when it comes to mind the easy way to categorize is applying gender or sex concept, but to have a term as an adjective there should be more in the definition, and the definition says if feminine used as an adjective it means “having qualities or an appearance traditionally associated with women, especially delicacy and prettiness” delicacy and prettiness is something you have inside. Now what about the definition of mature: Mature came from latin word maturus which means “timely,ripe” and the definition will be

  1. “having reached a stage of mental or emotional development characteristic of an adult”
  2. “having reached the most advanced stage in a process”

After searching so many dictionaries about maturity I saw that they tend to refer to it as mental development

Now after we agreed on the definition since it is not mine; Do you believe that being mature and feminine is contradictory terms and you can’t have equal portions of them in one vessel . In other terms do you agree that being more mature makes you less feminine and vis-versa. If not; kindly prove me wrong supported by examples.

Back to our top bottom approach.

1. Work : why most of women nowadays wants to work and fight to work.in order to understand this thing we need to define the motives and the bases behind it

  1. Have to : some women work because they have responsibilities toward others and those kind of people I really respect because they put somebodies needs before their needs. Feeling responsibility toward others is a high moral value which is pretty unappreciated nowadays. Those are the good women
  2. Illusion of Have to: some women work because they want to feel independent, taking into consideration that  independency has a lot of forms and shapes, and I will mention only two of them because they are the most dangerous ones  financial independency ,and mental independency. The question is why do I need to be financially independent, if I’m planing to get married,have some kids and dedicate my time for them. Why do I need to be cognitively independent. do I believe that I can decide without asking advise, and I will be always correct. Back again to definitions :) . What is the meaning being independent ? . The definition in oxford dictionary is “being free from outside control; not subject to another’s authority, capable of thinking or acting for oneself” if you look closely you will find that the term as an adjective references the human selfishness in a way or another, it refers to individuality. Independency is pretty misleading concept such as the definition of freedom, it is very beautiful from outside but it is stinky from inside.
  3. Nice to do since every body is doing it: I really have no comment for those type of women, but I will try. Those women type love a lot of things but they have hard time prioritizing them, because the love toward things is not originated from within, there were no pure motive behind it. it has been taken as is from outside without having some sort of reasoning structure.

Based on above categories we could say that work for women is not one of her rights unless there is an urgency in doing it. Why I’m saying so ? We will see that in the next article

Women Rights – Part 1

i keep asking my self what is women rights from women perspective, and how it is different from our understanding, but before start jumping to conclusions lets take a look at women and their rights across the history, or at least the history that I am aware off, which is pretty short.I believe starting from greek civilization will be a good place.

Status of women in ancient greece varied from city to city, but they have one thing in common they don’t have the right for individuality, they always had a master, before getting married the master was the father or brother and after getting married the master is her husband. they have no right in owning properties, therefor they were not considered as full citizen, they are not allowed to have any political interference for the same reason which has mentioned before. Of course there were an exceptions but the general trend was that.

When rome came to power, they were pretty affected by greek philosophies and specially stoic philosophy which revolves around the relation between the cosmic determinism and human freedom, and produced a nice doctrine about sexual inequality contradicts the laws of nature, and based on it; men and women has the same capacity of virtue and equal obligation to act based on it. Stoic philosophy entered rome as a low by our beloved senator Marcus.

Middle ages came and english common law in 12th century says all properties of wife held  at the time of marriage will be expropriated to her husband while forbidding husbands from transferring properties without wife’s consent. Strange isn’t it, but who am I to judge. French married wives has always encounter restrictions in their legal rights such as selling and buying.

16th century came as decades passes by to allow more freedom to women during and after the reformation movements, but the idea of patriarchally  system was agreed as rule of thumb until 18th century when it has been discovered that there is matrilineally system exists in native north American people. On late 18th and the beginning of 19th century liberation movements started to take a shape such as freedom of religion, abolition of slavery and the most important thing for this article is women rights. Which reached to a critical place in Britain and france. Philosophers and thinkers joined hands to support the equality  and challenged the notion of theocracy which has been misinterpreted and has been generalized to both genders. I always remember what Rousseau says

“Women do wrong to complain of the inequality of man-made laws” and claimed that when she tries to usurp our rights, she is our inferior” .

In 1971 french politician De Gouges published the “declaration of the rights of women and female citizen”  which is pretty ironic because it addresses how the French revolution failed to satisfy the concept of equality. John Stuart Mill also was against inequality in 1869 he mentions something interesting in his essay “the subjection of women” describing the situation in Britain

“We are continually told that civilization and Christianity have restored to the woman her just rights. Meanwhile the wife is the actual bondservant of her husband; no less so, as far as the legal obligation goes, than slaves commonly so called”

Women started to get their right in europe starting from the mid of 20th century, and government started to put women rights laws starting from 1950 starting from Britain, France and USA and spanned across the glob after that

Why did I talked about all of this historical events in europe, and talked about Greeks and romans before that. I did that in order to shape the idea that women rights now a days was based on some philosophical dogmas from the very beginning, and it has took a shape after; when there where no wars, famines , plagues, … Etc, it started to take a shape when we are not busy enough to dedicate some place in our mind to think about it.

Human principles used to change across the history so what about philosophical doctrines . When I look at women rights I feel my self like being in Utopia with Plato arguing about the republic taking into consideration that he didn’t believe in this type of equality among genders.

Now all the women across the glob believes that they have the right of equality without knowing the origin of this equality and the conflicts it made across the history. And I really envy them in away they don’t know and they keep insisting on following what they don’t know and almost all of them thinks that they will find the absolution by doing so.

So forget about my boring introduction, and lets get back to the subject. What is women rights from their perspectives. I believe I could summarize it in one sentence

“women have the right to become a man on every aspect while not being a man.” and what I mean by not being a man, is to have man parts. Maybe you will say that I’m against women which is not, or I hate them which is not also, but any way who am I to judge me; you know better.

I will stop now, and I will continue tomorrow if I stayed alive until tomorrow.