Skip to main content

Blast From The Past: June 22, 2026

Mon Jun 22 01:04:57 UTC 2026 Ah, a brand mew day is here! This I can handle. I didn’t hear from the kids, kinda expected that. I never hear from them on Father’s Day. It’s whatever. I deal with it and move on is all. Nothing big. Nothing major. Nothing too crazy. I really shouldn’t be surprised by any of this. I mean it is what it is. I know I can call them but they’re probably celebrating that other man who they call Dad. Gah! I hate overthinking this. It’s like this every year. I need to stop thinking about it. That’s all there is to it! Mon Jun 22 08:10:05 AM MDT 2026 Welp! Back to work I go. Doesn’t mean it’s not useful of course, work is a good thing at times. I wonder how it all would go down if there wasn’t work? I mean that could be kind crazy right? Yeah, that’s what I’m thinking! Well, the kids did eventually call last night, around 10 PM. They didn’t have much to say. They never do. They never know what they’re doing or are up to. It can be frustrating at times. Maybe ...

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.

Comments

Popular posts from this blog

Schizoaffective Disorder

I want to say it first began in High School when I thought I was trying to beat the devil. Now when I say I was "trying to beat the devil", I mean I actually thought I was hearing the devil speak to me at night and that I had to find some way to overcome him. Looking back I should have sought professional help then. I remember telling a friend about this experience, and he looked at me like I was nuts. Talk about craziness right? Yeah something like that. I believe my first mental break was when I was serving a mission for The Church of Jesus Christ of Latter-Day Saints . I wanted to go home so bad. It could have just been homesickness . But...there was something more to it. About halfway through I was just done with it all. I had had enough of rejection and wanted to go home. But I was afraid that I was unable to because I would simply be told no . I know that sounds silly to people. But that's what happened. I didn't b...

Temptation Bible vs Book of Mormon

In the Bible in 1 Corinthians 10:13 we find: There hath no temptation taken you but such as is common to man: but God is faithful, who will not suffer you to be tempted above that ye are able ; but will with the temptation also make a way to escape, that ye may be able to bear it. But what might seem as a contradiction is found in Alma 13:28 But that ye would humble yourselves before the Lord, and call on his holy name, and watch and pray continually, that ye may not be tempted above that which ye can bear , and thus be led by the Holy Spirit, becoming humble, meek, submissive, patient, full of love and all long-suffering; So, which is it? Either God tempts you to a point and stops, or you have to actively pray not to be tempted beyond that no return point. Which is it?

Didn't Sleep

 What's the point of sleep anymore if I can't sleep? I don't think I slept any good last night. I was awake at 3 am wondering to myself, what on earth am I doing awake? Yeah, that happened. It doesn't make any sense. Fortunately, it's the weekend. So, I can catch up on sleep tonight. I don't have to be anywhere tomorrow, so it's a good opportunity to actually sleep for once. Whatever the case, I hope I'll be able to fall asleep and stay asleep. We will see what happens.