Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Joe

Pages: 1 [2] 3 4 ... 56
16
Tutorials, References, and Examples / [PHP] Organizing a JSON Array
« on: April 12, 2010, 02:46:52 am »
This is a neat little script that'll take a series of array objects, such as coordinate pairs, [123,123] and take all the nonsense out, and format them pretty, 4 to a row, lined up with tabs. I'm using it to get all the coordinates of mining nodes off of WoW head into an array for.. purposes. :) This could pretty easily be changed to sort any kind of array, though.

Code: [Select]
<?php

    
if(!isset($_POST['array'])) {
        
printf('<form act=' $_SERVER['PHP_SELF'] . ' method="POST">');
        
printf('<textarea name="array" cols="100" rows="25"></textarea><br />');
        
printf('<input type="submit" name="submit" />');
        
printf('</form>');
    } else {
        
$data str_replace(" """$_POST['array']);
        
preg_match_all("(\[.*\],)"$data$data);
        
$data explode("],["implode(""$data[0]));
        
        
printf("<pre>");
        for (
$i 0$i count($data); $i += 4) {
            
printf("[%s],\t",  $data[$i 0]);
            
printf("[%s],\t",  $data[$i 1]);
            
printf("[%s],\t",  $data[$i 2]);
            
printf("[%s]\n"$data[$i 3]);
        }
        
printf("</pre>");
        
    }
    
?>

17
General Discussion / Official April Fools Day Thread
« on: April 01, 2010, 03:06:52 am »
Google: [spoiler]How long does it take for your search to execute?[/spoiler]

xkcd: Command-line interface! If you want to know all the commands, I cleaned up most of the JavaScript. I especially like [spoiler]sudo make me a sandwich.[/spoiler].

YouTube: High resolution text-only videos.

x86: We're not kicking Newby out this year.

Battle.net: Matchmaking service.

19
Joe's Bunker of Pie / iPhone Development Stuffs
« on: February 24, 2010, 11:38:58 pm »
So the other day I got bored and decided "I'm going to learn a new technology". Then I got unbored. A few days later, I decided on Core Location, the iPhone GPS framework.

I don't actually have an iPhone, only an iPod touch, which doesn't have a true GPS but relies on nearby routers to get coordinates. Apparently it downloads all nearby MAC addresses because I was able to keep a fix for a few minutes after leaving school with no internet connection.

Anyhow, using Core Location and Map Kit, I tossed together a cool little app that drops a pin wherever you are, whenever you get a GPS fix (technically, every time Core Location updates your coordinates). A few tidbits of code are here, but the coolness is the end product. See attachment. :)

This is probably going to be my "I did something new that doesn't deserve it's own thread" thread.

20
JavaOp Board / 2.1.3 rc 1
« on: February 18, 2010, 01:51:56 am »
Due to the crash-and-burn-ness of recent releases, I've decided to put 2.1.3 in release candidate before releasing it, so that I don't look so retarded when I have to post three different final versions.

Go ahead and check out the subversion from googlecode, and type ant in the checked out directory, if you have J2RE installed. If not, I'll post the compiled JARs eventually.

21
Blizzard, WoW and Bots / WarCraft 3?
« on: February 12, 2010, 04:06:23 am »
Hey guys, I just started playing WarCraft 3 again on Azeroth. I'm level 7 right now, playing 3v3 or 4v4.

22
Joe's Bunker of Pie / New stuffs
« on: February 09, 2010, 09:14:46 pm »
First, iago's server is a psychopath.

Second, I got a job tutoring at school. My life just went from eat, sleep, homework and school to eat, tutor, homework and school.

Third, I've started playing WarCraft III on Battle.net extremely casually. I joined Clan BoT (Bitches of Thunder) on Azeroth. /f a joe[x86].

Fourth, I forgot what's fourth.

23
JavaOp Board / JavaOp 2.1.3 running changelog
« on: January 20, 2010, 09:20:55 pm »
General:
This is the "Snow Leopard" of JavaOp. Hardly any new features, but the bot is overhauled to be harder, better, faster, stronger.  Some key issues addressed are enhancements to SwingGui for OS X, and general fixes to many issues. I also removed a ton of old debugging code that was spamming the console. Also, with StayConnected, the bot should be 100% more robust.

Core:
users.Statstring: Removed debugging messages of raw statstrings, and checking for general bad data (NullPointerException's)
users.War3Statstring: Checking for bad data (NullPointerException's), changed icon resolving to using a dictionary which should highly optimize it. If that's not true in Java, blame MyndFyre for misleading me.

AutoRejoin:
Renamed from Auto-Rejoin.

ChannelProtection:
Renamed from Channel Protection.

BnetEventProcess:
Renamed from SimpleEventProcess.

BNetLogin:
versioning.Game: Removed left over CD-Key debugging output.
versioning.GameData: Allowing customization of the hash file directory. Please delete your current _GameData.txt file if you use local hashing.
cdkey.Alpha26Decode: Fixed a critical error that caused 26 character keys to not work. Also, fixed the key translation tables to fix the product value errors.
cdkey.Decode: LoginExceptions have been replaced with an IllegalArgumentException. I could say that it's because bad cdkeys are illegal arguments, but it's really so I could...
cdkey.Decode: Added a debugging method for printing key's values.
util.ServerSignature: Since the SID_AUTH_CHECK class was getting messy, all code related to server signatures has been moved to this class, so now validating the signature takes one line of code.

GlobalCommand:
Renamed from Global Command.

SwingGui:
JavaOpFrame: Now using native look-and-feel.
JavaOpPanel: Added margins to the ColorTextPane. Added customizable font. Check for it under global preferences.
JavaOpPanel: Caught exceptions won't be displayed if minimum display level is below Error.
GameIcons: Fixed issues where some game icons wouldn't show up.

StayConnected:
Finally fixed the plugin. Finally!

Under the hood:
- All revisited code will conform to my personal coding standards: line maximum of 80 characters, and curly braces go on the same line as their opening statement and following catch / else statement, except where their opening statement is more than one line long.
- All revisited code will have generics removed. It leaves the code open to bad plugins, etc.
- Removed all jardesc and manifest files. The bot is built using a new Apache Ant script, which I wrote in about 15 minutes.
- All plugins now run in their own namespace. The main class no longer has to be PluginMain -- it's specified as Main-Class in the JAR's manifest. I can't believe I did all that by hand.

24
JavaOp Board / JavaOp 2.1.2 released!
« on: January 19, 2010, 03:20:55 pm »
Last release: June 11th 2009. Just over 6 months!

General:
All plugin versions will correspond to the bot version they were last modified for.
The bot is built against Java 5.0. This has been the standard for many years.

Core:
bot.PluginMain - Changed socket timeout to 30 seconds for those with spartan connections like mine.
bot.PacketThread - When an exception occurs, the output will now be tagged [BNET] to prevent confusion with BNLS.
pluginmanagers.PluginManager - When no plugins are present, the user is directed to the new site. Ticket

BNetLogin:
versioning.Game: getFiles now returns all four versioning files, for when Lockdown comes to other clients.
versioning.CheckRevision - Corrected error in determining the MPQ number for ver-IX86-[0-7].mpq files. It's now possible to run local CheckRevision for any type of IX86 MPQ.
versioning.CheckRevision - An InvalidVersion exception will be thrown if you try to run CheckRevision on an unknown MPQ name.
versioning.Versioning - All version check formulas are handled as a byte array, since some are not String-safe.
versioning.Bnls - Updated BNLS server, again. I think this doesn't even need to be mentioned as it'll be updated with every release, as their average life span is a month.

BotMail:
PluginMain - Fixed a statement in plugin load that caused a NullPointerException if the setting wasn't present, preventing the plugin from loading.

Moderation:
PluginMain - Fixed an exploit that allowed bypassing of access checks. Ticket

SwingGui:
JavaOpPanel - Changed coloring of the send button to display correctly on Mac OS X. Ticket
JavaOpFrame - Removed KeyListener from JavaOpFrame. I'm not sure why it was there. Maybe it'll speed it up a little bit?


Since nobody wanted to fix the forum permissions, I'm hosting the download over at the GoogleCode site. Make sure you also get the updated BNetLogin.jar and replace the old one.

25
JavaOp Support Archive / Please report all current bugs on GoogleCode
« on: January 17, 2010, 08:34:53 pm »
http://code.google.com/p/javaop/issues/list

Also, please prefix all issues with either [versionNumber] or [svn].

It'll also help out if you could check if your bug has been fixed in the svn version, but if you don't know how to do that, that's okay.

Thanks!

26
General Discussion / 4th OWI in Wisconsin gets 30 days in jail
« on: January 12, 2010, 09:26:01 pm »
http://www.wiscnews.com/bnr/news/469407

Before I get accused of pulling a Craz3d, I'll explain.

Some guy is speeding down the street with his 6 and 2 year old's in the car. Office pulls him over, and he blows a .2, whereas Wisconsin's limit is .08. That's a misdemeanor, "driving with a prohibited blood alcohol content", plus a felony, "intoxicated driving with a minor in the car".

He shows up in court and pleads not contest ("yeah, I broke the law") to the misdemeanor, and the felony was dropped. It's his 4th OWI and he's driving drunk with kids, and his felony gets dropped. Yeah, it's not like he's a bad person or anything. The only bad people are the ones who sell little bags of marijuanna -- they're the real felons. We'll let the drunk drivers vote and have guns, but not drug dealers.

As if sitting in prison for a few years and then coming out a non-felon (and ready for his 5th OWI, this guy obviously didn't learn from the first 3) weren't bad enough, he gets 30 days in jail WITH work release, and then electronic monitoring. I'm not sure if that's house arrest or just monitoring, but either way, this guy should be behind bars.

Opinions?

Quote
must undergo alcohol and drug abuse evaluation and treatment under the direction of his probation agent, according to the records.

That's worked good for everyone so far. Pay $90 and sit through four weekly 3 hour classes. That'll cure you of alcoholism for sure, and stupidity to boot.

Quote
His penalty also includes three years revocation of his license and installation of a device in any car he owns to prevent the ignition from working if he is drinking.

This guy obviously doesn't have any regard for laws, so a license revocation will do nothing. The judge knows it too. If he didn't think so, he wouldn't need the device in his car, not that his kids won't blow it for him anyhow.

27
New Project Announcements / CocoaBot
« on: December 06, 2009, 09:56:31 pm »
Four reasons:
- I don't think anyone's written a bot in Objective-C yet.
- It tastes better than Java.
- Because I can.
- I feel like learning Objective-C and the Cocoa framework, and in my experience, a Battle.net bot is a hell of a crash-course.

That said, I'm not very far yet. Cocoa doesn't provide TCP sockets in it's framework, but since Objective-C is a superset of C, of course there's libraries. I'm personally using SmallSockets.

I'm also taking a new approach with this, which so far seems consistent with most Objective-C code, and that is that all functionality of objects is contained in the object. For example, instead of calling each get method on a ChatEvent, the ChatEvent itself is responsible for displaying it's contents to an NSTextView. This is a snippet for testing all Event ID's, as displayed in the screenshot.

Code: [Select]
- (IBAction)sendButtonClicked:(id)sender {

// Create new chat event
ChatEvent* event = [[ChatEvent alloc] init];

[event setUsername: @"TestUser"];
[event setText: [txtSend stringValue]];
for(int i = 0x01; i <= 0x17; i++) {
[event setEventID: i];
[event writeEventToNsTextView:chat];
}

[event release];

// Clear out the textbox
[txtSend setStringValue:@""];
}

My programming teacher recently gave the class an idea for a development technique, and that's to do it once and throw it away, then redo it when you know what you're doing. I think I'll do that with CocoaBot, since it's my first Objective-C project and I'm bound to do stuff totally wrong, and fixing them will take longer than rewriting the entire bot.

And lastly, if you haven't figured it out from the screenshot, it's for Mac. Objective-C can be compiled on Linux, but I don't know how much of Cocoa is open-source and how much is Apple code.

28
Botdev / Slackchat
« on: December 06, 2009, 07:51:29 pm »
Does anyone still have the source code?

29
General Programming / Entry-Level Programming Books?
« on: December 03, 2009, 09:12:42 pm »
I got asked a really good question the other day by my cousin, who's son wants to start programming. She asked what book(s) she should get him for Christmas. I drew a blank, since the best book I've ever found is Google, but you can't give Google for Christmas (yet).

Does anyone have suggestions? Keep in mind that he's 13, so it has to be something hands-on or it'll get shelved in 5 minutes. I'm guessing he's pretty motivated though, since he wants to be a programmer, not a fireman.

Thanks

30
General Discussion / 20% off at JC Penney, Dec 6.
« on: November 29, 2009, 04:14:46 pm »
http://f.jcpenneyem.com/i/2/95827765/1128_Friends_20120.html

A friend who works there emailed me this. I guess that makes you friend of a friend with them, so, go ahead. Just print off the barcode and you're good to go.

Pages: 1 [2] 3 4 ... 56