Tuesday, March 19, 2024

Ever feel like no one is listening?

 Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The worst is when a psychiatrist says they're listening but all they do is toss medications at you. I mean yeah, the medications are good to work with, but when you don't feel seen or heard it can drop you down low.

I don't know if I'm making any sense right now. I do believe I'm going through an episode of sorts. It's not fun at all and I know that. Hell, anyone who goes through this illness knows that.

Wednesday, March 13, 2024

Life Ain't Easy

 Let's face it, this life isn't easy. Ther are things that we must do daily in order to survive. It can feel like you don't have any control over anything. Personally, I don't like feeling like this. Powerlessness is like the worst thing you can go through. Yet here we are wondering what there is to do about this life. Life has an interesting way to let you know you're alive.

I suppose it's that simple. If simple is even the right word to use here. I'm not quite certain.

There are days where this life feels like it's a chore. There's nothing going on that's important, and we are just doing our mundane things in and out. Every day the same thing. It's consistent, I'll give you that, but it can be boring.

Sometimes you just have to go with the crowd and see what happens. There isn't a reason for it not to work out I guess, but well what can you do about it? Not much I'm afraid, not much at all. That's alright though, you have the power within you to survive. That's what's important for the most part.

Friday, March 8, 2024

Ghosts - Halloween 3 - Carol Comes Back

 Okay, Ghosts this week was an interesting one. I hope they don't keep the Carol character around much and she gets sucked off quickly. But if she has to stick around, Pete isn't going to do well with that at all. So, the gist is, Carol died in the kitchen during a Halloween party. So now she's part of the property and can't leave. Poor Pete. I'm not a fan of Carol, let's face it.

And we find that Flower is in the bottom of well. When she was an owl, she must have fallen down there somehow, and poof gone. Or maybe she didn't get sucked off like we thought? She said she's been down in the well for a month and can't get out. So, who knows what's going on with that. I mean she might not have been sucked off at all. Interesting thought process.

Easy Way To Create HTML/XML String

A simple way to create html tags in Java.

It won't create a tree that you can parse, but it will create the text needed. You see we'll use the StringBuilder class along with the Formatter class to accomplish this. This provides a simple way to format a string without using String.format inside of a sb.append call.

import java.util.Formatter;
import java.util.Locale;

public class LocalMe {
    public static void main(String[] args) {

        StringBuilder sb = new StringBuilder();
        Formatter formatter = new Formatter(sb, Locale.ENGLISH);
        formatter.format("<%s>%s</%s>", "greeting", "Hello World", "greeting");
        System.out.println(formatter.toString());

    }
}

Thursday, March 7, 2024

Get Yesterday's Date

Here's an easy method to return yesterday's date:

import java.time.LocalDateTime;

public class DoIt {

    public static void main(String[] args) {
        LocalDateTime yesterday = LocalDateTime.now().minusDays(1);
        System.out.println(yesterday);
    }
}

As you can see it's quite straight forward and simple. You just minus the number of days you wish to get. You can do this on a LocalDate or a LocalDateTime object.

From there you can do whatever you want with your past date.



Tuesday, March 5, 2024

Ever Wonder

 Ever just sit and wonder about the things to wonder about? There are so many things that you can enjoy and think about or wonder about. It's just possible that you would be able to do such a thing. I'm not certain how it would go for you, as I am only a person. I don't know how you feel.

So here we are, just waiting for something amazing to happen. It doesn't happen all the time unfortunately. It can be annoying at best.

Friday, March 1, 2024

You Are Here

 

Oh, how small and insignificant we are! Look at that, each of us are a little spit of dirt that try our best and don't get very far. I mean we think we get pretty far but in the grand scheme of things we are really nothing.

It would be nice to be able to think that I am more than just one person doing their best to get through this life, I don't know how that will be. I mean all of these other people are also trying to get through life as well. You're not alone. You're never alone.

It's kind of a crazy concept to think of how small we are compared to the rest of the cosmos. I mean we are literally the size of an ant compared to everything else. A single piece of sand on the seashore. That's a good example, no? Yeah, that's what I was thinking.

Thursday, February 29, 2024

Oh Ghosts, When You Lie You Get Burned

 Jay's sister's boyfriend/husband (?) says he can see ghosts. He can't. It's that simple. Eric is his name he's trying to pull one over on Jay's sister. He felt Jay's sister was getting bored with him so to spice things up, he told her that he can see ghosts.

They're planning on making the "curse" go away. I have a feeling this won't work out. Eric is willing to go all out to make it appear as though his curse is gone. Yeah, like that'll happen.

Sub plot, Issac and his partner, Nigel, are squabbling about getting a prenup. So, there's a bit of back and forth about that.

When you don't want to see ghosts anymore you fall down a flight of stairs. Yep, that's the only way to get out of it, and make the lie even worse when your girlfriend finds out the truth thanks to Jay and Sam. Good job guys! The truth is always the best to say.

The 29th of February


Ah we have reached the 29th of February. That's right it's a leap year. For those born today, shame on you. Nah just kidding. But wouldn't it be interesting if it were a curse to be born on this day? I couldn't imagine what would happen. Kids would be taken from their parents. Possibly placed into some kind of concentration camp for lack of a better word. Now that's an interesting story to write. All because of the dumb luck of being born on leap year.

They'd be considered not real by the government, because their birthday only happens every four years or whatever it is. Yeah, I think I can go somewhere with this. I won't lie, it would be an interesting story to write for sure.

Wednesday, February 28, 2024

Nothing Matters At All


Nothing really matters anymore. Here we have life and we live it. So what. Would it be different if we lived on a different planet? I doubt it. No, we're here on Earth and we just have to wonder what's going on in this life. It would be better if there was something to actually figure out, but so far I've yet to find out what that was.

Maybe it would be better if we had some kind of common goal to reach while in this life. Is there a common goal that everyone has in common? There are billions upon billions of people in the world. Both who have lived an those who are living right now. You can't tell me that everyone has the same goals. They wouldn't be unique anymore.

Okay so scratch that. What more can there be to be talked about? Not much else I dobut it. There just needs to be more justice in this life. Something more where you're able to live and see what you want to see. Something like that. It's difficult to describe. But it's something.

Life in a Nutshell


Ever wonder what this life is all about? Some would have you believe that they know exactly what this life is all about. It's not an easy thing to grasp. Life comes at you in many different ways and angles. Before long you are engulfed in an argument with yourself. So, what do you do when that happens?

Well, you get out of the situation. There's no need for you to be arguing with yourself. Makes you crazy at times, doesn't it? I know it does me and I do argue with myself a lot on a standard basis. That is of course a story for another time. (Oh, but it's a good one!)

So, you just have got to try your best to get out of whatever mess you've gotten yourself in.

Ever Just Have a Day?


Ever wake up and you're still tired from the night before? Even though you went to bed at a decent hour? yeah that. That's how I'm feeling today. My sinuses are having their fun too. I guess there's nothing to whine about, or anything like that. But who's to say what's going on. I'm already having a day of it and the day is barely starting.

I'm sure it will go away and life will continue back to normal or some weird talking like that. Had some weird dreams last night, not sure what to do about those. Probably just ignore them like usual. Whew thanks for the talk I feel better already.

Monday, February 26, 2024

Sometimes This Life Hurts


Let's face it, life can hurt at times. Sometimes you have to deal with voices in your head, voices outside of your head, and just voices in general. You never know what will happen if those voices stop you from doing whatever you want to accomplish. So that's what this life can be about. Does that make any sense? I sure hope it does, because I'm not sure if it does or not. There are times where I am simply not able to understand if I am understanding what's going on correctly.

Sometimes the voices don't make sense to me. I don't know what's going on with this life. If that's acceptable then that's the way, it's meant to be. Personally, I wish the voices didn't come and visit or exist at times. They come and go anytime they please. That's really all there is to it. This life will come and go as it pleases. There isn't anything we are able to do regarding it. If we had the ability to make the voices, go away completely I do believe this life would be much better. It would be nice to be able to find a way to make the voices go away. But they still want to stick around contaminating our minds with whatever there is to contaminate them with.

You see, some voices are internal others are external. For the most part I hear the internal voices. At present they are fighting among themselves. It's distracting and exhausting at the same time. Somedays you just have to recharge after a day of hearing them constantly in and out of your mind. So, I find a quiet place to be and read a book. It helps, I swear.

There are times when I'm unable to recognize what's going on. It wouldn't be me if things were different. Sometimes an audio book is helpful. I can escape into the world of the book, that's all. It can be an enjoyable experience. That much is for certain. Waiting for something to happen.

The waiting, oh the waiting. It's nothing possible or impossible. Life doesn't make sense at times. I hate that feeling. To feel free would be the best feeling in the world. That's what I want out of this life is to feel free. Forget the voices, forget everything else. It all needs to become something different. This life can be arranged in a manner that doesn't make sense and yet here we all are. I'm not sure what that means exactly but, that's all-which matters, I guess.

Either way here we are, this life will continue the way it's meant to be, and we will be allowed to finish what we started. Until I think like the voices, I'm unable to figure out everything that was going on.

Sunday, February 25, 2024

Sass and his Power


So Sass can inject himself into dreams. That's his ghost power. Talk about fun! I hope they'll show more of it and him getting along with Jay in his dreams. It was a good episode.

I kind of miss flower. Let's face it, she was a fun character who got people high when they walked through her.

I have a feeling that the barn will have ghosts in it at some point. They're just...hiding at the moment? Maybe. It's possible they won't have any extra ghosts in the barn at all. There's always a possibility of that you know? Yeah.

Friday, February 23, 2024

Minecraft Feels

 Minecraft feels different now. I see why people are drawn to the beta versions of the game. I understand it now. There's lore in place in a game that was originally about block building. Why put lore into a game where all you do is chop down trees and build things out of them? Sure the monsters were there in the beginning, but that gave you something to do at night if you wanted to. Now there are things like the Warden and Phantom that comes out at night if you haven't slept. Sure they give you a way to turn these entities off which is nice, but still it's just not the Minecraft that I came to know and love.

I began playing Minecraft around version 1.8 (NOT beta) it was right before the combat update. I found it to be an amazing game. I wonder why they would need to add all of these unnecessary things to it. I don't know. It's annoying at best.

I took a screenshot of a world newly generated. It's beautiful as all get out.


There she is...with the beach and the calm water,. Fish probably swimming around in that water somewhere. A tree in the distance waiting to be harvested for a crafting table or whatever tool is needed. Yes those were the times to play Minecraft. I might go back to version 1.7.3 myself and take a peek.


Wednesday, February 21, 2024

My Only Request

 Nothing to think about, nothing to display. This day and every day goes away.

The way of the dinosaurs they don't stick around. Everything and everyone ends

up on the ground. It is but a moment in this life it would seem, no one wants

to be in that gleam. So toss away your thoughts, your considerations at best,

make life peaceful that is my only request.

Life Why Life

Life comes and goes
we don't understand it
it makes up its own mind
that's what makes life unique

Life matters to some
it doesn't matter to all
yet here we are
waiting for something to happen


Tuesday, February 20, 2024

Never Alone

 Never alone. That's how I see my life, the voices that come and visit me. I am never alone. Talk about an annoying process of it all. I wish I had the ability to overcome whatever there was, yet I don't have a clue. I want to have a clue, something that would make it all make sense to me. But there's no use for it to make sense I suppose.

If I had the ability to look out and change whatever there was to change, I would be able to fix everything in my life. I wouldnl't be ill anymore, I could walk around without seeing things behind me, I wouldn't hear things I don't wish to hear. It would be silent and peaceful. That would be blissful.

I feel psychosis coming on. I don't know exactly how to describe it. I don't feel a connection to anything really. It would be nice if I could feel something. But I can't, can't figure out what's happening to me. It's just a thing that happens, I guess. I'll have to make sure I don't go crazy on this trip.

Monday, February 19, 2024

My Whopper

 Created this beauty of a whopper tonight. In an effort to win 1 million dollars. Let's hope it gets me somewhere in the running.





No One Understands

Feels like no one understands. Like they don't get what I go through does that make sense? I sure hope it does. I mean think about it for a sec. Hearing things left and right. I don't know if they're real or if my mind's made things up again. I wish I didn't have such issues in this life. But I can't say I don't. It would be nice if family understood what was going on in my head. Well I don't even grasp what's going on in my mind most days. Ya know? Yeah it's that miserable at times. I just keep working towards some kind of hope that I can't give up on.

It would be nice to be able to grasp everything that there is to understand about this disease. I call it a disease, it should be considered as such. Not everyone understands or graps what happens when I hear things in my mind I guess there's no reason for them to. It would be rather nice if they did.

I need to remember patience, patience I must have and trust in myself that I am able to overcome whatever this nonsense is. Those two things would be a most wonderful idea/thought in order for me to keep going forward. Forward I must go and be able to figure out what's going on in this life.

Well it isn't nonsense now is it? No I dare say it's not. It's something quite real that is going on in my life. I don't have another way of saying it or expressing my feelings on it. It's something quite different, that is for sure.

So I'll just be here waiting till I understand what's going on in my head. I doubt I'll get an answer over night about it. There's no way in telling how long exactly all of this will last. Probably my entire life. Oh well, that's how the turkey tumbles.

Thinking About Life


So sleepy today, I don't know why that is. Trying to watch the Super Bowl, but I just feel like I want to fall asleep. Talk about nuts and crazy, yet here I am. I don't have a clue who I want to win the game. I've chosen to root for the 49ers only because I've been told that I have to choose. Haha! Yeah it's that crazy if you ask me. Oh well, I'm sure whoever wins the game it will all work outin the end.

I'm not feeling well. Let's face it, I could be having a mental break at the moment but I just don't know. I hope that's not the case, if it were then I have to figure things out and fix them. That's all there is to it. Nothing more than that. Storing these thoughts in a database is a good idea I think. I can query a database for certain key words and go from there. It's a good thing for sure. So yeah that's all there is to it.

With the thought of a 4th voice in my head/mind, I am afriad to go to sleep. What if it follows me around? What do I do about that? I don't think I can handle this thought process. But I have to sleep sometime I suppose. Gah, I don't have a clue of what to do! I'm sure it will go away eventually, maybe. What if it doesn't go away and it sticks around with me? Who's to say what I'm able to do with any of this. Stupid voices in my mind and head getting the better of me. I can't allow this. No, I can't allow any of it... But what am I supposed to do? Just not sleep? I could try that. We'll see how it goes. I am already falling asleep as I write this. So there's that!

Okay let's face it, life wasn't built in a day neither was Rome. Either way we are screwed. There's no other way to see it. I mean come on think about it. This life will end and we will all be on display in some kind of petting zoo. Maybe a petting zoo, who nkows what we'll be put on display as. Whatever the case, this life has got to be better somehow. I don't quite understand how it is not the best. However this life turns out, let's say I am quite interested in it.

Oh goodness. I took a muscle relaxer and I started to doze off, but each time I started to doze, I would hear a voice in my head. Sometimes it would tell me to wake up, other times it would tell me to watch what I'm doing. Where the hell did this voice come from? It's new for sure. It's not one of my main three that I usually have in my head. Do I have to deal with a 4th now? I'd rather not. I mean come on now. I don't want a 4th voice running around my mind. Interrupting my thoughts and whatnot.

Life comes to terms with the ability to become so much more. It's not if anything but persistant.

I'd like to think life would be much easier to get along with. But well it doesn't and that's all which matters.

SchizoAffective Disorder


It's a disease that so many people carry in the world. There are so many thought processes on it that I can't even count them all. So, I won't try. I have it myself. What's to say that hasn't already been said?

Stay on top of your medication. You never know what will happen when you go off of your medication. Speaking of which I haven't taken my meds today, I need to. That much is certain. But I haven't yet and I just need to be able to keep sane for one more. day.

Ah yes, one more day. It would be nice to be able to stay strong. But that doesn't always happen. No, somedays are better than others. We don't always have the ability to pick and choose our days. I wish it were that simple, but it's not. So, we must be able to try our hardest to just keep sane.

Keeping sane, sounds easy enough, right? Yeah, I wish it did. But it doesn't and there's no reason for it to. People are afraid when you bring up the fact you have schizoaffective disorder. They don't understand it. What people don't understand scares them. That's all there is to it. There's no reason to be scared. It's nothing I can pass onto someone else. I don't have that ability to share it. No, it's isolated to me. I'm not contagious.

The suicidal thoughts come and go from time to time. I doubt there's anything I'm able to ever do about those. It would be nice to be able to get rid of them...but I can't. All I can do is my best to deal with whatever comes along in my life. It would be nice to be able to simply figure everything out all at once. Again, that feels like a pipe dream.

So many things I wish for. So many things I simply wish I could do to escape everything that is out there. But I'm unable to. I'm held hostage at this point by this crippling disease. Yes, it would be nice to be able to figure things out, but I'm unable to for some reason. Why is that? Why can't I simply figure everything out and just move on? I don't know.

Until that time comes, I'll just have to keep trying to move forward and see everything that's out there.

Farscape I, ET

 I do believe I've found a favorite episode. For once we are considered the outsiders, the aliens. Talk about an interesting one. Love how they shocked Criteon out and he couldn't move. He's all uhhh I'll recover from this right? Fully? They just stare at him.

From the sounds of things this was actually the second episode not the seventh. Love how studios make the decision to air certain episodes before or after others instead of the order they're meant to air in. Kinda silly if you ask me.

I mean if you were writing a show, wouldn't you want it to air in the order that you created it? I can understand an episode like Star Trek where it's just an alien of the week and there's no order to any of it, but other shows need to have that right reserved.

I need to find a viewing order website for this show so I can watch them in the correct order. Yes I believe that would be helpful in my watching of this classic. Yeah I called it a classic, what are you going to do about it? Nothing. There's nothing you can do about it.

Trying to watch Farscape


So I bit back, I downloaded Farscape on Apple TV. The complete series including the Peacekeeper War movie. I've been trying to watch it now. I'm finding it difficult to get into for some reason. But I keep trying it out to see if I'll eventually enjoy it. I haven't a clue yet.

I am impressed by the makeup and the puppetry. So that's gotta say something about it.

That poor engineering gal stuck in engineering. Never leaving the ship. She hardly has any lines it would seem too. But to each their own I suppose.

It is interesting to see the crew trying to use human terminology. Woody vs willies etc. I don't think I have a favorite character yet. I'm sure it's only a matter of time before I'm able to figure one out that I enjoy. They're all so alien to me. Figuratively and physically.

Like I said, I'm sure I'll figure it out.

Sunday, February 18, 2024

California Class MSD

 Here we have the California Class MSD from Star Trek Lower Decks. I find the Cali class to be an interesting ship. I had written some fan fic based on a ship that was the U.S.S. Fresno. I wish the Cali class had been a thing back then, I would totally have designed it after that.


But it didn't exist back in 1998 so I had to come up with my own at the time. I really do like the look of the California class for sure. It's interesting and unique.

CommandLine Arguments

Here's an interesting way to check for commandline arguments. First we setup an enum that holds our commands. As you can see, I can pass in either -h or -helpK into my program. To do this we convert the values for a specific command into a HashSet and then compare the values to what was passed in. If what we passed in is in the HashSet then we return a true vlaue, otherwise we return a false value.

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public enum Commands {

    HELP("-h,-help");

    private final String values;
    Commands(String values) {
        this.values = values;
    }

    public String getValues() {
        return this.values;
    }

    public Set<String> getValuesAsArray() {
        return new HashSet<>(Arrays.asList(this.getValues().split(",")));
    }

    public boolean isSelected(String[] args) {
        for (String arg : args) {
            if (getValuesAsArray().contains(arg)) {
                return true;
            }
        }
        return false;
    }
}

In our main method of the program, we can check for values like this:

public class Main {

    public static void main(String[] args) {
        if (Commands.HELP.isSelected(args)) {
            System.out.println("Help");
        }
    }
}

At which point we perform whatever code we need to perform on it. There is a way to pass in parameters to the arguments that we are passing to the program too. But that's another story altogether.

I'm not saying this is the perfect or correct way of doing this, but it is a way of doing this for sure.

Serenity - Firefly

 


I've always been interested in ship schematics. The Firefly class Serenity is no different. You can see the schematics above. The ship is small and tight compared to the huge transport ships we see on screen under the care of the Alliance. She's a quick ship without any armaments.

To say she's a good ship would be an understatement. She really is a good ship.

Phone Broke

 Ever have a problem with your phone? Yeah, it sucks. My phone decided to stop working. Talking with phone support did nothing. They couldn't help me at all. So I get to wait till my new phone comes in the mail. New phone number, new phone. Yep that's just how everything tends to work. I'll be getting the new iPhone 15. I'm so excited.


I can't wait til I get my new phone. :-) I have always liked iPhones. I can install the programs I used to have on it back in the day...if I can remember which programs I had installed that is. I'm sure it went something like this:

  1. Pages
  2. Numbers
  3. Keynote
  4. Terraria
  5. Minecraft
  6. Gone Home
Those are the ones I can remember at the moment...not sure what else I initially had installed. I'll have to change my phone number in Apple as well. I hope I can get things setup without any problems.


Game Loop

 Found this gameloop somewhere, probably on the internet of course. Maybe YouTube? I can't remember. Putting it here so I can use it later:


long lastTime = System.nanoTime();
double amountOfTicks = 60.0;
double ns = 1000000000 / amountOfTicks;
double delta = 0;
long timer = System.currentTimeMillis();
int updates = 0;
int frames = 0;
while(running){
	long now = System.nanoTime();
	delta += (now - lastTime) / ns;
	lastTime = now;
	while(delta >= 1){
		tick();
		updates++;
		delta--;
	}
	render();
	frames++;
			
	if(System.currentTimeMillis() - timer > 1000){
		timer += 1000;
		System.out.println("FPS: " + frames + " TICKS: " + updates);
		frames = 0;
		updates = 0;
	}
}

Saturday, February 17, 2024

Been Rewatching Star Trek Deep Space Nine

 I'm in Season Six, well the last episode of Season Six. I think this is my favorite season. But I don't have much to say about it, other than the fact that there are some dang good story lines in it. The first six episodes of the season are my favorite, the battle to retake Deep Space Nine and the story lines behind not being on the station. Personally, I think the entire season should have been off of the station. But well, I don't make the decisions on making the show. That's up to people who get paid a lot more than I do. Oh well, it all works out like it should.

I still get upset over the death of Jadzia Dax; she was my favorite Dax. I mean yeah Ezri did just fine in the role, but she wasn't really the Dax we needed. Oh well, that's just what it is I guess.


This season also introduced the character of Vic Fontane. He was the closest thing we got to a counselor on screen. He helped Odo and Kira get together. He helps Nog in Season Seven. There's so much he is able to do.

Another favorite episode of the season was The Sound of her Voice. I really enjoyed that episode.

We get a hint of things going on in the lives of the officers on the station. I'm sure the war took its toll against them all. I can't imagine war not doing that. It is what it is, war is ugly that much is certain. There's nothing you can do about it when it comes down to it.

Friday, February 16, 2024

Want To Feel Normal


 There are days I just want to feel normal or be normal again. But what exactly is normal? I'm sure there can be many different words or phrases that anyone could come up with to be normal.

I for one do not have an idea of what normal is. I don't think I've ever known what normal meant. If I did? Life would be much different right now than it has turned out to be.

I mean look at this picture, people are wearing masks. Is that normal? It might be the new normal as it were. But it's def not normal like you would want to think. Ever since the pandemic hit, I doubt anything has been normal for a while now. It would be nice to figure things out for once. For finally. I don't even know what that means.

If we didn't know what normal meant, I don't suppose we ever will. I mean think about it for a moment or two. If you had an inkling of what normal meant, wouldn't you want to cling to that instead of whatever you have going on right now? Yeah, that's what I'm thinking.

I'm reminded of a quote from Star Trek: Generations.

"Normal is what everyone else is, and what you are not."

It was that more or less...yeah, I'm not sure I like thinking of life that way.

Thursday, February 15, 2024

Ghosts - Who Got Sucked off {spoilers}


 Just watched the season opener for Ghosts on CBS. Flower left the show. The show runners claim there was no bad blood between them, and she wasn't fired in any way or left because of differences. So that's a relief. I had an inkling that it would be her because she wasn't really showing up in the previews for the new season, till the very end. One promo didn't have her in it at all. So yeah, it was rather easily to guess who was leaving the show. But that's okay, they let you know who left rather quickly into the episode, so it doesn't really matter.

I keep wondering if they'll get some barn ghosts into the show at some point. That could be fun. Not exclusively of course because that would take away from the main characters. We can't have that. Having the basement ghosts all around this episode, kind of ruined the mood for me a little. I'm not a fan of the basement ghosts. But that's okay, they left by the end of the episode, in a cleaver in my opinion.

I enjoy the thought that Flower became the Owl in some kind of reincarnation form.

Next week we get to learn about someone's ghost power that we haven't heard about before, I guess. Should prove to be interesting.

Anxiety

 Oh Anxiety, you know the feeling. Some anxiety is okay, other anxiety is not. Some anxiety keeps you moving forward like it should, other anxiety makes it so you cannot move forward completely. The bad kind of anxiety is the constant worry about everything and anything that can be worried about. Someone always watching your moves etc. Well, that goes into more paranoia than anxiety. But the feeling that you're not good enough, the constant put downs etc. The world is going to end in any moment, and you don't have a decent clothing option to meet death.

Oh yeah all of those feelings are real and valid. It's nothing to be ashamed of though, so please don't think you have to be ashamed of having anxiety. It's just real and normal for some people. Well, I shouldn't use the term "normal", it's not normal at all in any way possible. That's why there are doctors that specialize in such issues and medicine. There's medicine that will help you out.

I've personally have had issues with Anxiety since 2003. That was the first time I was diagnosed with it. I had this fear of answering the phone at work I would throw up every morning just thinking about it. It really threw me for a loop, and I had no way of dealing with it. I enjoyed my work, it was fun, but I just couldn't deal with the phones for some reason.

Went to the doctor and he suggested to put me on some medication. It helped out a lot, I was so happy. Years later that medication no longer worked for me, so I ended up getting put on something else that I now use that makes me work and function like I should.

So bottom line. It's okay if you have anxiety. But please seek medical professional help if it's more than the usual things that people experience. There's help for you.

Wednesday, February 14, 2024

I Want To Scream

 

I know, what's there to worry about? Oh, what isn't there to worry about? There just feels like so many things are in the way of this life. I don't know how to go about fixing any of it. Does that make sense?

I hope it does make some kind of sense, because if it doesn't? Then we're in some serious issues. Like life-or-death kind of issues. Yeah, something like that. But I don't know how to express any of it.

I suppose I could begin with the story of me.

Yes, that would probably be a good starting point. The story of me. But how exactly to begin that story? I mean there are so many different aspects to it all. So many things that don't make sense but only to me.

I suppose I'll have to figure out some kind of way to make it all make sense. Then I can share it with you.

Tuesday, February 13, 2024

My Shoes Are Too Tight


There's a line in B5 where Londo says something to the effect that his shoes are too tight but that is okay for he has forgotten how to dance. When asked about it by Vir not understanding the statement, Londo says nor should he.

The answer to the quote is simple. Don't ignore the things in life that are enjoyable. Before long you won't be able to dance and explore those things, your shoes will be too tight.

I'd like to think I'm like Vir not understanding the statement, but I think I know better. Life has become a burden at times and there's nothing I can do to get around it.

Life, What Is It?


I asked Google what it was like when you die. It didn't have anything useful to say back to me. Oh well, I'm sure I'll find out someday what it's like, because we all get old and then we die. It did say you cease to exist. That was an interesting line come to think about it. I wonder what it's like to actually die. I'm not afraid of death, I'm more afraid of the process, going through that process has got to be a pain in the ass. For some that could be a literal statement.

But I don't know why I'm obsessed with death and the process of dying. I haven't a clue. I wonder why that is. It can't be a good thing, let me tell you. I just wonder what it would be like to cross over and go into the light, into a new world that awaits. I'm afraid that because I don't go to church when I die it's over and there's no coming back to God. Kinda scary if you ask me, maybe that's why I'm obsessed with dying. I don't want to go to Hell and all of that fire and brimstone kind of life. I don't know.

It would be nice to be able to see what's on the other side before you go. Is it peaceful? Is it terrible? Who's to say what's going to happen exactly? I just don't have a clue and that scares me. I've been known to say that I'm afraid of the unknown. Some people have related to that, others have just said tough luck and wished me on my way.

When I do go, I hope it's to a kind place of understanding.

Thursday, February 8, 2024

Mind Blown

I was looking at thelcars.com today, and wow am I impressed. There are no images, yet they are using css to build images... or something. I don't know. Everything is in a LCARS look and feel. LCARS is something straight out of Star Trek. Here's what it looks like:


LCARS

So that's what that's all about. Holy cow! I had to add it to my site. I don't know if it will just be a one page addition or if I'll make more pages. Who knows. Might be a good idea to purchase another domain and use that for Star Trek related material altogether. I don't know. But it looks like it came straight out of the television set.


Wednesday, February 7, 2024

Change Created Date of a File

Sometimes you want to be able to change the created date of a file. Don't ask me WHY you would ever need to do this, but well here's a way in Java.

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.time.*;

public class ChangeCreatedDate {

    public static void main(String[] args) throws IOException {
        if (args.length == 2) {
            File file = new File(args[0]);
            if (file.exists()) {
                file.setLastModified(System.currentTimeMillis());
            } else {
                file.createNewFile();
            }
        }

        LocalDate date = LocalDate.parse(args[1]);
        LocalTime time = LocalTime.now();
        Path file = Paths.get(args[0]);
        FileTime fileTime = FileTime.fromMillis(getMillisecondsSince1970(date, time));
        Files.setAttribute(file, "creationTime", fileTime);
    }

    public static long getMillisecondsSince1970(LocalDate date, LocalTime time) {
        ZonedDateTime zonedDateTime = ZonedDateTime.of(
                date,
                time,
                ZoneId.systemDefault());
        return zonedDateTime.toInstant().toEpochMilli();
    }
}

Looking back at it, I wonder why I didn't make it so you could update the time as well as the date. Interesting. I mean it would make sense to be able to update both the date AND time. But I didn't have that in this section of code. Oh well, I'm sure I'll change it someday.

I find it interesting that we're updating an attribute of the file. One would think it would be someplace else, or easier to access directly on the file object itself. But well, it's not. So that's just that.

Tuesday, February 6, 2024

Return The File Extension of a File

So this little method will return the file extension of a file. That is, it will look for the dot (.) in a filename and return the remaining characters after it.

Notice that it makes sure it's a file and not a directory.

/**
     * Returns the extension of a file
     *
     * @param filename the name of the file
     * @return the extension of the filename
     */
    public static String getExtension(String filename) {
        String ext = null;

        File file = new File(filename);
        if (file.exists() && file.isFile()) {
            ext = filename.substring(filename.lastIndexOf(".") + 1);
        }

        return ext;
    }

Pretty simple no? Yeah that's what I was thinking.

You can easily put this in a FileUtils class that you might be building. It could come in handy.

Please remember that the file extension does not dictate what the file type is. It's just an extension.

Backing Up A File

 Backing up a file in Java can be fairly simple and straight forward. Let's think about it for a second. You have a file.

  1. You want to be able to store a copy of that file somewhere on your file system.
  2. You either want to keep the original or delete the original.
  3. The format of the filename must be unique, so it doesn't collide with other backed up files.
There are just a few considerations to think about. Here's a solution I came up with in Java:


import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.File;
import java.util.Date;
import java.text.SimpleDateFormat;

public class Backup {

    public static void main(String[] args) {
        if (args.length == 1) {
            File file = new File(args[0]);

            if (file.exists()) {
                try {
                    File dir = new File("archive");
                    if (!dir.exists()) {
                        dir.mkdirs();
                    }

                    Date date = new Date();
                    SimpleDateFormat dt = new SimpleDateFormat("'.'yyyy-MM-dd-HH-mm-ss");
                    Path source = Paths.get(args[0]);
                    Path target = Paths.get(dir.getName(), file.getName() + dt.format(date));

                    System.out.println("Backing up file: " + source + " --> " + target);

                    Files.copy(source, target);
                    file.delete();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                System.err.println("The file you specified '" + file.getName() + "' doesn't exist.");
            }
        }
    }
}

As you can see I chose to delete the file at the end of the process. But let's take a look at what this does:

  1. We make sure at least one filenamne is passed in and if it exists we continue.
  2. We create a home for the archived file, in this example we call it archive.
  3. We create a date and format it.
  4. We set a source and a target and output that we are copying the source to the target.
  5. Using Files.copy we do the actual backup.
  6. Then we delete the file at the end of the process.

That's all there is to it. I'm sure there could be a way to refactor this so it's better somehow. I'll have to look into it.

Monday, February 5, 2024

Life Is Fragile

 If I've learned anything in this life, it's this. Life is fragile. So many things can go wrong in a person's life. Things that take them to the ER or worse. The grave. So, this life is very fragile.

There's nothing you can do about it. Unfortunately, it will do what it will do, and you have no control over whatever happens. It's a scary thought process if you ask me.

So live life to its fullest. Be screaming at the end that you had a wild ride.

That's all I've got.

Clear Screen

Sometimes when you're writing a program in Java you want to clear the screen. That is to remove all text from the screen.

Here's how we would do this in Java:

private void clearScreen() {
        try {
            if (System.getProperty("os.name").contains("Windows")) {
                new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
            } else {
                new ProcessBuilder("clear").inheritIO().start().waitFor();
            }
        } catch (IOException | InterruptedException ex) {
            ex.printStackTrace();
        }
    }

This takes into account both windows and non windows. cls for Windows, clear for linux etc.

Sunday, February 4, 2024

Determine if a number is Odd or Even

Sometimes you want to be able to check if a number is odd or even. Here's a simple method that will do just that.

public class OddOrEven {

  public static void main(String[] args) {
    int i = Integer.valueOf(args[0]);
    System.out.println(oddOrEven(i));
  }

  public static String oddOrEven(int number) {
    if (number %2 == 0) {
      return "Even";
    } else {
      return "Odd";
    }
  }
}

Naturally you'll want to do some value checking for the number input at the command line. It could easily throw an InvalidNumberFormat exception. I think that's the exception that would be thrown.

Other kinds of Argument checking

So we've talked about a possible argument checking in Java. What if you just want to pass in files to be worked on?

That's simple enough, just loop through your argument array and perform the work on the files in question. Here's a simple way of doing that.

public static void main(String[] args) {
    for (String arg : args) {
    	doSomethingSpecial(arg);
    }
}

You can easily save the results back out to the same file as well since you will have that current argument in your posession. Easy right? Yeah something like that.

What if you want to perform an action based if an argument is passed in?

Let's say that you pass the filename as the first argument, then you pass the operations you wish to perform on that argument in the following arguments.

You can easily get the first argument by doing args[0], and then you can put the remaining arguments in a HashSet and check one by one if the specified argument is there. If it is, then perform the specified operation on it that you define in your codebase. Let me see if I have an example of this:

public static void main(String[] args) {
        Set arguments = new HashSet<>(Arrays.asList(args));
        if (arguments.contains("doit")) {
            System.out.println("Doing it!");
        }
    }

Yep I did have an example. How's that for something? It all works out in the end. You can of course modify the code based upon whatever circumstance you need to work with.

Saturday, February 3, 2024

Command line Arguments in Java

I found the code I was looking for:

static class Args {

    public static Map<String, List<String>> parseArgs(String[] args, Set<String> validArgs) {
        Map<String, List<String>> map = new HashMap<>();

        List<String> options = null;

        for (String a : args) {
            if (a.charAt(0) == '-') {
                if (a.length() < 2) {
                    throw new IllegalArgumentException("Invalid Argument: " + a);
                }
                if (!validArgs.contains(a)) {
                    throw new IllegalArgumentException("Invalid Argument: " + a);
                }
                options = new ArrayList<>();
                map.put(a, options);
            } else if (options != null) {
                options.add(a);
            } else {
                throw new IllegalArgumentException("Invalid Argument: " + a);
            }
        }
        return map;
    }
}

I've modified this piece of code then was in the original post. You can pass this a Set of Strings that ensure only the correct proper argumetns are being passed into the program as to not waste the programs time trying to decide if they are proper later.

Command line Arguments

 Command line arguments are a thing that some programs need to take into consideration. Java allows for arguments to be passed into a program easy enough. But what if you want something more complex? I've found that you have to roll your own.

So, what can we do with regular command line arguments? Well, that's an interesting question now isn't it. I suppose the simplest use of a command line argument is to check for its existence. If it exists, then we do something with that knowledge.

That's fine and dandy if you ask me, but what if we want to do something more with command line arguments? Like if the argument takes a parameter or two, what then? A while ago I found an article on the internet that shows exactly what you can do with such arguments. You would call your program, and pass it a switch like this:


java test.jar -d 47

Now -d could be whatever you want it to be. It can literally represent whatever part of your program you want it to. The 47 being passed in could be whatever you need it to be as well. So, how do we go about doing this? That's a good question.

Here's some psudo code of how we would do that.

  1. Check to see if the argument starts with a dash.
  2. If it doesn't, throw an error and alert the user.
  3. If it does contain a dash, make sure that it's at least 2 characters in length.
  4. If it's not at least 2 characters in length then the user passed in a dash and that's it, then you would throw an error.
  5. Store the dashed argument in a map of some kind, and move onto the following argument. If it doesn't begin with a dash it belongs to your first argument as a parameter for that argument.
  6. Store that value in a list within the map. You can keep building this list up for that specific argument
  7. Repeat as necessary.

I'll have to dig out the code that actually makes all of this work. But for now you get the idea.

Hello World!

Sometimes you just want to say hello! This is how we say hello in Java.


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

Let's Talk Life

 Shall we? I think we shall. Let's simply talk about life for a moment. What is this life that we constantly refer to? I wonder about it all of the time myself. It goes from not being important to being quite important to me. I don't know how else to put it.

It would be nice to be able to simply not worry about this life as much as I do. But well, you can't do that can you. No, I didn't think so. So, we go about our day-to-day life worrying about this life and where it will lead us. Or, where it will leave us. It could just drop us off at the nearest part where we won't be able to move forward or backwards.

Yeah, that could be annoying at times don't you think? I mean think about it for a second and you'll see what I mean.

The music continues to play. What do I mean by that? Well, just that the music of our lives continues to play on repeat. We don't have control over the ability to stop the music in process of being played. It will continue to play no matter what we do. No matter what we try, the music will always be there and will always play.

Friday, February 2, 2024

Finding Old Content

 So, I've been hunting around web.archive.org for old content that I've written. Found some stories and what not that I've added to my website. I mean that's a good thing, right? Yeah, that's what I was thinking. I want to dig up all the poetry I'd written and see if that has a place on my site as well.

I want to really get this site up and running like it used to be. It doesn't have to be a blog, but I'd like it to be something. I don't know what I want it to be just quite yet. For now, it will just have to be all of my thinking that I can get out there.

Why

 So, I woke up early this morning. I'm not sure on the exact time, but around five something. I am so tired. I went to bed at a decent time...yet I am so tired. Exhausted would be a better word for it. I'm trying to stay awake but keep finding myself dozing off. This can't be good. I'm sure I'll wake up eventually sometime today. I mean I have to, right? Yeah, that's what I was thinking and hoping on. We shall see if the diet Coke I have will actually do its work like it's meant to.

Thursday, February 1, 2024

What Is This Life?

 It would be nice to be able to explore thoughts and feelings outside of our known thought process. I'm not certain that is possible with all of the things that happen left and right. It would be interesting to try it though. If such an attempt were possible, I wonder how far along it would get. Would it be shut down immediately? Maybe so. If that's the case, then we are but a challenge yet to be found and yet to be destroyed by our own undoing.

If, however, we are something more. Something to be described as an intelligent being then I could be persuaded to understand how the rest of it goes. Who's to know exactly what's going on in this life. I for one do not know or have the perception to be able to figure that out. It is an unfortunate thought process at best. One upon which I do not have any idea how this life will make it out in the end.

On the other hand, if we are nothing but people simply trying to get to a home type destination...then I suppose I could handle that thought process. I suppose it belongs in the category of who came first the chicken or the egg? If you can figure that question out, you can probably summerize the cosmos.

Why Is Television So Weird?

 Television is weird. I haven't had TV in a long time. I recently got cable. I know, cable of all things. I was relying on streaming services most of the time. But then football games came on and I couldn't watch the game on streaming, so I ended up getting cable. It made sense at the get go when I wanted to do that. Let's hope the prices don't increase. I'm sure they will though, who's to say what will happen. I'll just have to wait it out I suppose.

I forgot how commercials were. I'm used to ads. Which you can argue that ads and commercials are the same, they just have different names. Yeah they can be the same thing that much is for sure. I feel more anxious about commercials than I do ads. I'm not certain why that is, I just know that's what it is and that's what I'm dealing with.

Found some good shows to watch on cable though. Found some stations that have some old shows that I used to watch growing up. Oh yeah, I know what I'll be doing for sure.

So that's that, and with that it's all good.

Ever feel like no one is listening?

 Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...