Java – Blackjack Game

Alright Mr. Bturnip, while you’re out galavanting around NW Arkansas, I’m spending my time working on a Java program and I’ve got a rough working version of a blackjack game. I started with some classes I found online for a game of hi-low and modified them on my own to make a blackjack game. Right now it just plays one hand at a time and you either win or lose. My next step is to add betting. This is graphical too, not just text window stuff.

I think I could easily put it in a web page too, but I don’t have anywhere I can post stuff like that. What’s the best way to do this? I can send you the files and you can post it somewhere? I’d like to see if we could get it up on the web sometime. (Right now I’m running it in an appletviewer.)

Posted in learning java | Leave a comment

vacation

Hola, friends!
A quick note to say that I will be on vacation from today until the 21st. Skip for exquistite corspe, etc. If Jason can’t seem to get on the blog, have him re-register under a different name. Any of you guys who are already at level 3 can raise his permissions up to 3 as well. (Try clicking “Login”, then “Users”- you can figure it out from there)
See ya next week!

Posted in general | Leave a comment

Buffer Overflows (sort of)

This goes back to a question Danny was asking me earlier today. I don’t think this is exactly a buffer overflow, but it’s an interesting way of abusing a TCP/IP stack to make the OS allow things it shouldn’t. Note to The Man, we are only trying to learn these things as good responsible citizens, and with no harm. Also note that I’m only citing references that are already in the public domain.

Packet Fragmentation Attack
Packet fragmentation can be utilized to get around blocking rules on some firewalls.

This is done by cheating with the value of the Fragment Offset. The trick is to set the value of the Fragment Offset on the second packet so low that instead of appending the second packet to the first packet, it actually overwrites the data and part of the TCP header of the first packet.

Let’s say you want to `telnet` into a network where TCP port 23 is blocked by a packet filtering firewall. However, SMTP port 25 is allowed into that network.

What you would do is to send two packets:

The first packet would:
Have a Fragmentation Offset of 0.
Have the DF bit equal to 0 to mean “May Fragment” and the MF bit equal to 1 to mean “More Fragments.”

Have a Destination Port in the TCP header of 25. TCP port 25 is allowed, so the firewall would allow that packet to enter the network.

The second packet would:
Have a Fragmentation Offset of 1. This means that the second packet would actually overwrite everything but the first 8 bits of the first packet.

Have the DF bit equal to 0 to mean “May Fragment” and the MF bit equal to 0 to mean “Last Fragment.”

Have a Destination Port in the TCP header of 23. This would normally be blocked, but will not be in this case!

The packet filtering firewall will see that the Fragment Offset is greater than zero on the second packet. From this data, it will deduce that the second packet is a fragment of another packet and it will not check the second packet against the rule set.

When the two packets arrive at the target host, they will be reassembled. The second packet will overwrite most of the first packet and the contents of the combined packet will go to port 23.

source: http://www.linuxsecurity.com/docs/Hack-FAQ/data-networks/packet-fragmentation.shtml

There’s a good explanation on that page about the contents of the IP headers and an example of fragmentation.

Posted in computers/programming | 1 Comment

JDBC

I wanted to piddle around with database stuff last night and failed miserably. From what I read I gather that some JDBC stuff comes as part of that package we downloaded. Some info is at this link:JDBC Info Provided with Netbeans

Having said that, I can’t really figure out what it is, how to use it, or if it’s even really there. In the IDE window there is a tab for “runtime” and when I click on that there is a ‘database’ choice with something there, but hell if I know what to do with it.

If there is in fact a database there, do you think it’s a virtual db that comes with the Java run-time environment and we would just use that? As opposed to say using Access or whatever and then having to connect to it? Whenever you get around to it you might take a look and help push me in the right direction.

Posted in learning java | 2 Comments

Java Books

Thought I would start a new thread just for this. I haven’t done much research, but I too like O’Reilly books and I read up a little on “Java in a Nutshell” at amazon.com. It gets only three stars in user reviews and sounds like it’s probalby more or a reference than anything, but some of the reviews also say that “it’s for beginners” (which is me) and that it does have a comprehensive appendix that covers every available Java library package. I have a lot of faith in O’Reilly books and I’m thinking even if it is mostly a reference it could come in handy and be a worthwhile addition.

They also offer a companion book called “Java Examples in a Nutshell” that gets five stars and sounds very useful in providing walkthrough examples from a lot of different aspects of Java.

amazon.com:

Java in a Nutshell – $26.37
Java Examples in a Nutshell – $27.17

Barnes & Noble:

Java in a Nutshell – $31.96 ($28.76 for members)
Java Examples in a Nutshell – $39.95 ($35.95 for members)

Overstock.com (I like this site)

Java in a Nutshell – $23.19
Java Examples in a Nutshell – $23.19

($2.80 shipping for two items at overstock)

Posted in learning java | 4 Comments

Exq Corpse 2

Here’s the latest addition, single sentence style this time:

The bewildered gambler delicately inserted his greasy manservant.

Posted in exquisite corpse | 1 Comment

isnoop.net :: Hosted by Wasabi Hosting

isnoop.net :: Hosted by Wasabi Hosting
This is a nice clean looking website with several neat little features. The one that may appeal to the most people is the gmail invite spooler. It collects extra invites that people can’t get rid of and makes them available to those who want them.
Despite having turned down invites prolly half a dozen times, I filled out a request, just to check it out. I will followup if anything exciting happens.

Posted in general | 2 Comments

Exquisite Corpse

Hey,
Here’s the first email Exquisite Corpse. We based this on one sentence. I’ve added each of our initials following the sentence(s) we added.

+

The box of birds was starting to rattle. (je) A dozen orphans were sauntering to their hoosegow. ™ The oldest was doing a barely adequate job of concealing an irregularly shaped package under his dirty shirt. (da) With little left to lose, the ersatz patriarch of this ramshackle family finally took their prospects in hand, hustled what was left of his motley crew out the door, stuffed a few crumpled bills from the cash register into his pockets, dragged the hapless security guard’s corpse behind the counter and set the whole place ablaze in an exquisite conflagration of whiskey, wood and squandered innocence. (gj)

Posted in exquisite corpse | 6 Comments

Mama, You’ve Been On My Mind

Adding a post based on a discussion Greg and I are having in regards to the Dylan song below and the one by Leonard Cohen in which he reminisces “I don’t mean to suggest that I loved you the best. I don’t keep track of each falling rock. (A nice additional dis, there). I remember you well in the Chelsea Hotel. That’s all, I don’t even think of you that often.”

This is basically an open-ended discussion about the reflection of past relationships in song by these poetical masters. In contrast to that dumbass song “you’re so vain, you probably think this song is about you” when in fact the song clearly IS about “you” (James Taylor) Our conclusion is that both Cohen and Dylan are much deeper and more mature in their approach to the subject matter.

Mama, You’ve Been On My Mind – by Bob Dylan

Perhaps it’s the color of the sun cut flat
An’ cov’rin’ the crossroads I’m standing at,
Or maybe it’s the weather or something like that,
But mama, you been on my mind.

I don’t mean trouble, please don’t put me down or get upset,
I am not pleadin’ or sayin’, “I can’t forget.”
I do not walk the floor bowed down an’ bent, but yet,
Mama, you been on my mind.

Even though my mind is hazy an’ my thoughts they might be narrow,
Where you been don’t bother me nor bring me down in sorrow.
It don’t even matter to me where you’re wakin’ up tomorrow,
But mama, you’re just on my mind.

I am not askin’ you to say words like “yes” or “no,”
Please understand me, I got no place for you t’ go.
I’m just breathin’ to myself, pretendin’ not that I don’t know,
Mama, you been on my mind.

When you wake up in the mornin’, baby, look inside your mirror.
You know I won’t be next to you, you know I won’t be near.
I’d just be curious to know if you can see yourself as clear
As someone who has had you on his mind.

(from Greg’s e-mail):

Particularly interesting, as regards our discussion of understatement, is his use of the double negative in the fourth stanza. “pretendin’ not that I don’t know”. That is, he’s admitting to himself that he’s thinking about her, even though he goes to great pains to say, “Hey, I’m not that serious or anything, you know”. This would all make good subject matter for that blog page of Danny’s.

Posted in music | 4 Comments

Famous First Lines

I was stumbling around in my old web page area and ran across this page of famous first lines from literature. Thought you guys might enjoy. I have the answers on another page and I’ll post that link as well so you can check your own knowledge.

Famous First Lines

Link to the answers:

Answers

Posted in art & lit | Leave a comment