Clan x86

Technical (Development, Security, etc.) => General Programming => Botdev => Topic started by: mikeownage on September 30, 2007, 05:49:04 pm

Title: Database.ocx
Post by: mikeownage on September 30, 2007, 05:49:04 pm
it's a battle.net database control. loads the database, saves the database, checks for basic commands and such.

http://www.clangdn.com/mike/dbOCX.rar

i will still add some more things to it! but i guess this is the first version Smiley

any ideas on how to improve what i have done so far?

 tested the code (in a simulated environment).

I am not asking for you to use it or if you think it's a good idea. I am asking for ways to make this "IDEA" better. not if it's valid to your stand points. why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects. I released it here so other people could use it as well if they wished.
Title: Re: Database.ocx
Post by: Joe on October 01, 2007, 12:42:13 am
why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming. You've got part of the idea right in making your code reusable, but writing a Class to use the code and copy+pasting it to each of your projects is a better idea, thus keeping the code internal, instead of in a dependency. I'm not sure how it would work for efficiency, but I can only assume it'd improve.
Title: Re: Database.ocx
Post by: Camel on October 01, 2007, 03:06:46 am
I already said this on the VL forums, but I might as well bring it up here as well: that argument doesn't hold much ground, Joe. I'm not saying it's a great approach, but depending on an OCX is roughly as boggy-downy as depending on a DLL (because OCX files are special cases of DLL files); it ultimately boils down to assembly calling other assembly, and there's nothing inherently inefficient about that. Sure, it degrades the optimizer's ability to do things like inline short functions, but come on, we're talking about VB here. You're better off spending your time finding and optimizing your O(n-squared) algorithms.
Title: Re: Database.ocx
Post by: mikeownage on October 01, 2007, 06:32:27 am
Wow, do people have a problem with staying on topic? I asked for ideas to improve the code. not if the concept of the code was to your liking. the only one who gave any tips on 3 different forums was camel. and i thank you :)
Title: Re: Database.ocx
Post by: mikeownage on October 01, 2007, 06:36:43 am
umm, crap stupid double post! well added basic winamp control.
Title: Re: Database.ocx
Post by: rabbit on October 01, 2007, 09:12:58 am
My point, iago, (and it's already come true) is that he's going to get the same feedback here as he did at vL.
Title: Re: Database.ocx
Post by: iago on October 01, 2007, 09:36:59 am
My point, iago, (and it's already come true) is that he's going to get the same feedback here as he did at vL.
The vL thread turned into a bunch of crap, so I'll try to keep this one cleaner. :P
Title: Re: Database.ocx
Post by: warz on October 01, 2007, 11:36:10 am
why do i write a control to do this? because i don't ever want to have to write anything related to it again in the future for any of my projects.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming.

Sometimes you just have to wonder where, and how people learned to program. The OCX is for exactly the reason that he stated.
Title: Re: Database.ocx
Post by: Joe on October 01, 2007, 12:04:36 pm
Wow, do people have a problem with staying on topic? I asked for ideas to improve the code. not if the concept of the code was to your liking.

I just told you how to improve your code. If you're that ignorant, I'll waste my time elsewhere.

For the record, that's got to be one of the most horrible reasons. I don't mean to insult you personally, but making OCX requirements for that kind of functionality is poor programming.

Sometimes you just have to wonder where, and how people learned to program. The OCX is for exactly the reason that he stated.

Yes, but for example, when I wrote my classes for manipulating RichTextBoxes, I could have exported them into a C# DLL. However, I elected to remove the extra DLL dependency and put them right inside my program, where I could simply import that class itself into a new program. As for an OCX, you have an extra dependency floating around.
Title: Re: Database.ocx
Post by: Camel on October 01, 2007, 02:42:41 pm
@Joe: You're not wrong, but consider this: Every time you use a built-in control in VB, you're importing that control out of a windows DLL similarly to the way OCX controls work. Even the winsock control (which I'd go out on a limb and say that 99% of people use in favor over raw api calls) is in an OCX.

If you were writing an application suite, and a lot of your code was re-used throughout, wouldn't you want to have one place that the code was imported from? It cuts down on the number of places you have to update when you find a bug in it, and it cuts down on the disk space used to store the application suite. If you fix a bug, it means you only have to re-distribute one file instead to ten.

There are cases where the strategy is an inappropriate solution, but this is not one of them!
Title: Re: Database.ocx
Post by: Warrior on October 01, 2007, 09:47:58 pm
This needs to be looked at in the context to which it's being applied.
There is never a golden rule of when/where to reuse code, it's all about what you're doing in the project overall which is the deciding factor.

I think it's really great you're into code reuse, it's a nice mindset to get in. Perhaps you can invest your time into a more powerful language (you know I mean C#)
Title: Re: Database.ocx
Post by: Camel on October 02, 2007, 01:47:29 am
C# is cool, but I like Java because it's so portable. Its greatest benefit is what some consider it's greatest flaw. If you actually benchmark it, you might be surprised how slow it isn't.
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 05:07:46 am
C# is cool, but I like Java because it's so portable. Its greatest benefit is what some consider it's greatest flaw. If you actually benchmark it, you might be surprised how slow it isn't.

C# and the .NET Framework are just as portable as Java, considering that both of the specifications have been released (and C# is an EMCA Standard)

Mono reimplements C# and the .NET Framework pretty well.
Title: Re: Database.ocx
Post by: Camel on October 02, 2007, 05:13:19 am
Warrior: my battle.net bot works flawlessly on my phone. Don't feed me that crap.
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 05:17:07 am
Warrior: my battle.net bot works flawlessly on my phone. Don't feed me that crap.

And? You're mistaking the fact that something is NOT implemented with it being impossible to implement.
Ever hear of the .NET Compact Framework? Ever hear of XNA and Programming on the XBox 360? Mono? DotGnu?
Silverlight? Moonlight?

Silverlight 1.1 uses a portable .NET CLR and works on Mac, Windows, and with Moonlight it works on Linux.

How much more portability do you want?
Title: Re: Database.ocx
Post by: rabbit on October 02, 2007, 07:43:42 am
I want my toaster to be able to connect to Battle.net.
Title: Re: Database.ocx
Post by: iago on October 02, 2007, 09:34:55 am
Mono reimplements C# and the .NET Framework pretty well.
"pretty well" isn't good enough. Until it can implement it perfectly, it's not going to be stable enough for every day use.
Title: Re: Database.ocx
Post by: Sidoh on October 02, 2007, 11:04:45 am
From what I've seen, Silverlight is crap compared to Flash. :|
Title: Re: Database.ocx
Post by: Camel on October 02, 2007, 11:05:30 am
How much more portability do you want?

I want it to work on my phone.
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 07:33:01 pm
Mono reimplements C# and the .NET Framework pretty well.
"pretty well" isn't good enough. Until it can implement it perfectly, it's not going to be stable enough for every day use.

That's not the fault of Microsoft, C# is an EMCA standard. They have the documents, it's up to them to implement it.

@Sidoh: I have not messed with Silverlight personally (Myndfyre has), but I can already tell you it's better for the Web. It's an open platform, as opposed to Flash which has yet to deliver a Linux 64 Bit player.

Silverlight1.1 also is way more powerful than Flash could ever dream of becoming, due to it being powered by the .NET Framework.


@Camel:

What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.

Microsoft has even released portions of the .NET Framework (All you need to get started on the road to implementation when used in conjunction with C# EMCA Standard) downloadable under a Microsoft Shared Source License.

You know, just so we're clear it's the lack of initiative by third parties and not the fault of Microsoft.
Honestly, Java was religiously closed source until recently what's with the change of heart and opinion about them all of a sudden? .NET has been portable for the beginning.

It's a flawed argument, if you're going to blame .NET/C# for Portability issues, they all apply to Java as well.
Title: Re: Database.ocx
Post by: iago on October 02, 2007, 07:53:35 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.
So if you take code you've already written, and re-write parts of it, it'll work fine. That's no good for the "write once run everywhere" style that Java tries to go for.

You know, just so we're clear it's the lack of initiative by third parties and not the fault of Microsoft.
Honestly, Java was religiously closed source until recently what's with the change of heart and opinion about them all of a sudden? .NET has been portable for the beginning.

It's a flawed argument, if you're going to blame .NET/C# for Portability issues, they all apply to Java as well.
Speaking of flawed arguments, you say that Java was closed source and .NET was portable. Why compare apples to oranges?
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 08:20:24 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.
So if you take code you've already written, and re-write parts of it, it'll work fine. That's no good for the "write once run everywhere" style that Java tries to go for.

I'm not sure of the differences between the two, but I don't think they're that ground breaking. Obviously some unneeded features (full extent of Windows.Forms) were excluded from the Compact Framework but all of the language is still there.

Speaking of flawed arguments, you say that Java was closed source and .NET was portable. Why compare apples to oranges?

I'm questioning that myself, why would Java be called portable? It's only availible on other platforms through extensive reverse engineering (except maybe Cellphones). If it were truely portable, Hobbyist OSes (SkyOS, Haiku, etc.) would probably already have implemented. On the flip side, I see a complete Mono Implementation (With System.Windows.Forms) on SkyOS.

What gives?
Title: Re: Database.ocx
Post by: iago on October 02, 2007, 08:26:52 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.
So if you take code you've already written, and re-write parts of it, it'll work fine. That's no good for the "write once run everywhere" style that Java tries to go for.

I'm not sure of the differences between the two, but I don't think they're that ground breaking. Obviously some unneeded features (full extent of Windows.Forms) were excluded from the Compact Framework but all of the language is still there.

Speaking of flawed arguments, you say that Java was closed source and .NET was portable. Why compare apples to oranges?

I'm questioning that myself, why would Java be called portable? It's only availible on other platforms through extensive reverse engineering (except maybe Cellphones). If it were truely portable, Hobbyist OSes (SkyOS, Haiku, etc.) would probably already have implemented. On the flip side, I see a complete Mono Implementation (With System.Windows.Forms) on SkyOS.

What gives?
There is an opensource Java environment available, although I forget what its' called (cafe? kafe? something like that..), which I'm sure you could use on those operating systems.
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 08:29:01 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.
So if you take code you've already written, and re-write parts of it, it'll work fine. That's no good for the "write once run everywhere" style that Java tries to go for.

I'm not sure of the differences between the two, but I don't think they're that ground breaking. Obviously some unneeded features (full extent of Windows.Forms) were excluded from the Compact Framework but all of the language is still there.

Speaking of flawed arguments, you say that Java was closed source and .NET was portable. Why compare apples to oranges?

I'm questioning that myself, why would Java be called portable? It's only availible on other platforms through extensive reverse engineering (except maybe Cellphones). If it were truely portable, Hobbyist OSes (SkyOS, Haiku, etc.) would probably already have implemented. On the flip side, I see a complete Mono Implementation (With System.Windows.Forms) on SkyOS.

What gives?
There is an opensource Java environment available, although I forget what its' called (cafe? kafe? something like that..), which I'm sure you could use on those operating systems.

Yep, they considered porting it. It was however, an incomplete implementation.
Title: Re: Database.ocx
Post by: Camel on October 02, 2007, 09:47:36 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.

Java runs in WinCE as well. It's more portableed than .NET, period.
Title: Re: Database.ocx
Post by: Warrior on October 02, 2007, 10:11:36 pm
What part of ".NET Compact Framework" escapes you? It is certainly possible to develop .NET Applications on Windows Mobile phones, and it has been done with great success.

Java runs in WinCE as well. It's more portableed than .NET, period.

That was never the argument, now you're changing it. The argument was if .NET was portable, which you were quick to dismiss.

It's a fact that SINCE they both carry a runtime, they are portable in regards of which platform implements the runtime. The "run anywhere" is a deceptive term used to promote the pseudo-portability of both platforms.

The real question to be asking is: Which specification is more accessible? This should be changing with the recent GPLing of Java however.
Title: Re: Database.ocx
Post by: Joe on October 03, 2007, 01:29:50 am
I'm waiting for the day we can debate this out without getting personal.

Apparently, it isn't here yet.
Title: Re: Database.ocx
Post by: Warrior on October 03, 2007, 06:01:02 am
I'm waiting for the day we can debate this out without getting personal.

Apparently, it isn't here yet.

I don't think it's gotten anything out of the norm, I certainly wouldn't insult someone like Camel over something so stupid.
Title: Re: Database.ocx
Post by: Sidoh on October 03, 2007, 11:55:25 am
I'm waiting for the day we can debate this out without getting personal.

Apparently, it isn't here yet.

Can you point out which post was personal?  I don't think anyone crossed a line here...
Title: Re: Database.ocx
Post by: mikeownage on October 03, 2007, 01:46:09 pm
How did we go from my silly little database.ocx to whats more portable? atleast no one has gotten around to insulting my lame usage of the list box :) or the fact that it doesn't offer to much yet. as for any personal insults i don't see any.
Title: Re: Database.ocx
Post by: Sidoh on October 03, 2007, 01:50:33 pm
How did we go from my silly little database.ocx to whats more portable? atleast no one has gotten around to insulting my lame usage of the list box :) or the fact that it doesn't offer to much yet. as for any personal insults i don't see any.

We tend to go off topic.  Staying on topic is pretty boring! :)
Title: Re: Database.ocx
Post by: Chavo on October 03, 2007, 03:45:41 pm
Fucking list boxer.
Title: Re: Database.ocx
Post by: Hdx on October 03, 2007, 06:01:03 pm
I want my toaster to be able to connect to Battle.net.
http://www.theregister.co.uk/2001/06/04/bread_as_a_display_device/
Wouldnt be to hard to get a java bot running on a toaster ;)
~Hdx