Friday, January 24, 2014

Compression curiosities

Compression curiosities

This page will list several compression curiosities. 

Extremely high compression ratio

What is the best compressor to get really extreme compression?' is a question often asked on the internet. The achieved compression ratio of course depends on the quality of the compressor used, but the type of data that is being compressed is much more important. To show this I created a tiny 115 byte rar file. When you decompress it, it will turn into a textfile of almost 5 MB (a compression ratio of 99.998%). Here it is: test.rar. Note: Turtle 0.07 compresses the same file to 49 bytes, Hook09c (with switches 3 1 1 1) to 36 bytes and UHBC (with switches -b128m -m3) to 24 bytes!!.


Compressing a file makes it smaller?

Most of the time yes, but not always. A file containing pure random data is not compressible at all (the resulting archive might even be bigger!). A compressor works by finding repeating patterns inside the file it is compressing, random data does not have these patterns, so it will not compress. The same goes trying to compress precompressed data like RAR and 7z-files. Also certain movie formats like mpeg and avi are already highly compressed, which make those files very difficult to compress even further. A pure random file can be found here: a.bin. Try to compress it with your favourite compressor/archiver and look at the resulting file size...

High and low compression with one file?

Does there exist a file which is extremely compressable by one archiver, but almost incompressable by another one?. I thought the answer was no, but Nimda Admin did sent me a file with these very strange properties. Please download and extract the rarred file strange.rar and try to compress it with (win)rar and (win)zip. You will see compression is RAR is extremely good, but compression in ZIP is almost 0%!. Just when you think you understand compression, someone sends you this file.

Update: Several people analysed the file and concluded it's optimally compressed using double delta compression.


A compressed file decompressing to itself

There have been some discussions in the past about whether it's possible to have a file in gzip format or another compression format that decompresses to itself. Someone called Caspian Maclean, created such a file a couple of years ago. Here it is: selfgz.gz. A real master piece.


Source:


Monday, January 20, 2014

This is how evolution works !

This is a well-developed evolutionary experiment performed by MiorSoft (reexre). The algorithm is made, of course, in the great Visual Basic 6.0 language. The source codes for this experiment can be downloaded from here:

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=74127&lngWId=1

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=73944&lngWId=1

The binary files can be found here (the download source is safe):

https://dl.dropboxusercontent.com/u/51621154/MIORSOFT/PRJ/prjEVOLUTION.html











Saturday, January 18, 2014

World wide positive reactions of programmers regarding the motions for reintroduction of Visual Basic 6.0

Reviews and discussions on a 2014 Planet Source Code post called: "Motions for reintroduction of Visual Basic 6.0 on the market, in parallel with Visual Studio line"





The user comments on the PSC post:

1/15/2014 3:44:50 AMRobert Rayment

Thanks for bringing this to our attention. I have commented on the codeproject.com article.

(If this comment was disrespectful, please report it.) 

 
1/15/2014 4:47:57 AMBonnie West

In the (very likely) event that Microsoft still won't listen, VB6 fans' plan B could be to write a new IDE + compiler (see http://www.vbforums.com/showthread.php?728505-VB-Classic-(A-True-VB-7-0)) along with the help of Olaf Schmidt's vbRichClient framework (http://www.vbrichclient.com).
(If this comment was disrespectful, please report it.) 

 
1/15/2014 5:45:30 AMDave Carter

Forget Microsoft, invest energy in PLAN B for more satisfying outcome :D
(If this comment was disrespectful, please report it.) 

 
1/15/2014 12:35:18 PMCap. Picard


I think we are too quiet and passive in our actions to restore VB6. I have great respect for the people who have the strength to scream in the Microsoft's ear. We all must do the same because we are a huge community!

@Robert Rayment

Good idea, we have to be aggressive. I'll post a coment, I'll post on Twitter, FaceBook and G+.

@Bonnie West

Thanks for bringing into focus the forum discussion, it helps me. I'm working on an article on the same theme: "Power back to VB6". God bless this initiative.

@Dave Carter

We must look for the original programmers that made Visual Studio 6.0, to attract them in the B plan initiative. Who knows their names?


(If this comment was disrespectful, please report it.) 

 
1/15/2014 1:06:17 PMBonnie West

Regarding the original VB6 creators, search Google for "VB6 Easter Egg".
(If this comment was disrespectful, please report it.) 

 
1/15/2014 1:15:25 PMBioMeg


I am very happy :). Thank you!

(If this comment was disrespectful, please report it.) 

 
1/15/2014 2:12:41 PMCap. Picard

@Bonnie West

Extraordinary, many people worked to made VB6. They are the heroes. I did not knew about "VB6 Easter Egg", shame on me.

(If this comment was disrespectful, please report it.) 

 
1/15/2014 3:40:34 PMDr. Intel

Microsoft is making a boatload of money with visual studio. So VB6 I'm afraid is not going to come back 
(If this comment was disrespectful, please report it.) 

 
1/15/2014 4:23:26 PMCap. Picard


Microsoft would made twice as much money with a new version of Visual Basic 6.0. Do not be so pessimistic!

Does anyone know the real name of Kinex ? Someone said in some comments on Visia Compiler that he is Kinex ... is it him ?

(If this comment was disrespectful, please report it.) 

 
1/15/2014 8:58:13 PMWilksey!

Unfortunately I do not believe that after all the time and money Microsoft has invested in .NET we will ever see a return of VB6 even if it is due to the fact that it will over take .NET.
I use C# quite heavily in my Windows projects these days rather than VB.net, it is quite over bloated with it's myriad of libraries, but it is a good framework nonetheless.

I would love to see MS make a new version of VB "Classic", but I don't think it will ever happen for the above reasons.

VB6 as well as .NET has always had the limitation of no cross platform support, so even back in the days of VB6 I was using Java and wxWidgets to create Linux and Windows cross platform apps, this was VB's #1 pitfall (but you can't blame MS for limiting the output to Windows after all!).
(If this comment was disrespectful, please report it.) 

 
1/15/2014 8:58:29 PMWilksey!

Nowadays people don't mind downloading a few MB's for an IDE, so I would suggest as a starting idea to perhaps find a cross platform development environment, whether it be Java or wxWidgets or even QT, or and develop an IDE, then maybe embed a compiler such as FASM (small, fast, and works on everything(someone even got it compiling on MAC OSX)) as a resource so when compiling, you compile a assembly (or set of) source codes, making it truly independent of any libraries, or even a small GNU C compiler with a separate function DLL like MSVBVMx.dll?

The only limitation is owner drawn controls will have to be rendered using graphics and Windows might have slightly more work (Active-X, COM, etc).

anyway, just my thoughts.
(If this comment was disrespectful, please report it.) 

 
1/16/2014 2:10:25 AMLednor9

Nothing would make me happier than a reintroduction of VB6
(If this comment was disrespectful, please report it.) 

 
1/16/2014 4:25:53 AM__

point is the same - microsoft don't care about the users or the developers. 30 year ago I must started in C. but gwbasic + bascom was used in my first job and here I am. I must keep running the impossible to convert VB6 code until they blow someday because MS just wanna that. 
(If this comment was disrespectful, please report it.) 

 
1/16/2014 11:35:58 AMDr. Intel

You could re-create a VB6 platform. But beware. Microsoft does not like copies of it's software. In a court of law it goes like this (My late farther in law) stated this "He who has the most money for legal power WINS. Just be careful where you tread.
(If this comment was disrespectful, please report it.) 

 
1/16/2014 12:30:45 PMBioMeg

@Wilksey!

I recently talked to a lawyer. He said, as a community we could sue Microsoft for the reintroduction of Visual Basic 6.0 to the market (is a very good lawyer).

Best regards,

BioMeg
(If this comment was disrespectful, please report it.) 

 
1/16/2014 4:07:28 PMWilksey!

@BioMeg
Why was that pointed at me? Dr. Intel posted the comment about law.

Plus, your comment doesn't make sense, why would we sue MS for reintroducing VB6 (which they haven't)?
(If this comment was disrespectful, please report it.) 

 
1/16/2014 5:20:05 PMBioMeg


@Wilksey!

I accidentally addressed the statement to you, sorry. I wanted to say: We can sue Microsoft to oblige them to introduce VB6 back to the market! :). Sorry for the misunderstanding.

(If this comment was disrespectful, please report it.) 

 
1/16/2014 9:01:37 PMWilksey!

@BioMeg
No worries, just wanted to clarify :)

The trouble is, from a business perspective,.NET 2012 / 13 is effectively VB .NET Version 11/12, they would need a reason to rekindle the "classic" VB and make a VB7, as a company their main reason is monetary purposes, but also they wouldn't want to over shadow their existing .NET frameworks.

I am not sure you can sue someone for taking their product off the market , especially when the reason is that people prefer it to the new one, which essentially is the argument, the new one is different and isn't VB.

I wouldn't be surprised if MS did do something, purely for the reason that they are still "supporting" VB6 on their newer OS's (they don't event support the earlier .NET frameworks, but they do VB6? Bizarre!), so they obviously know that people are still using it!
(If this comment was disrespectful, please report it.) 

 
1/16/2014 9:45:41 PMCap. Picard


I understand that there is a need of 12,000 votes on Microsoft's site to bring back VB6. For now there are 2,618 (and I do not think many people know of this link):

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/ 3440221-bring-back-classic-visual-basic-an-improved-versi

(If this comment was disrespectful, please report it.) 

 
1/16/2014 10:40:28 PMBioMeg


@Wilksey!

Microsoft must have a popularity purpose also. Although for many years it has gain popularity, and largely thanks to VB6, of course :), and Windows 7,8 and Office, they will gain popularity worldwide for reintroducing VB6 even more.

And yes, we as a community can sue Microsoft for the removal of VB6 product from the market. When you put a language on the market, someone loses time learning that language, doing projects ... and that time translates into money. I hope I make sense.

The pressure from the VB6 community was hell for Microsoft, that is why "it still works", and what will come from the VB6 community will probably be more inferno ... until they market a new VB6 version (and I hope as quickly as possible).

(If this comment was disrespectful, please report it.) 

 
1/17/2014 1:40:20 AMTakaten

WOW!
I will support that motion!
(If this comment was disrespectful, please report it.) 

 
1/17/2014 2:45:20 AMVB

Thanks to this initiative, the union is strength, let our voices be heard!
(If this comment was disrespectful, please report it.) 

 
1/17/2014 4:33:39 AM__

I guess uservoice.com is NOT microsoft site
(If this comment was disrespectful, please report it.) 

 
1/17/2014 4:35:16 AMMikeB

@ Cap. Picard,
I've just posted the following, in the Microsoft's blog you suggested. Thank you for let me know about it.
---------------------
Please, bring back VB6 classic, possibly adding more and updated features.
Please understand that programmers like me that INVESTED 15 years of professional life learning, using, pushing VB6 in any kind of project even not directly related to the pure software industry, cannot be just putted in a corner after believing in a company like Microsoft.
Please understand that being forced to learn again everything from scratch (because THIS means by using .Net) probably the best choice is then to invest time and money somewhere else, like Java/Linux. And this is not my opinion only.
(read more here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/%203440221-bri ng-back-classic-visual-basic-an-improved-versi)
(If this comment was disrespectful, please report it.) 

 
1/17/2014 4:58:04 AMDave Carter

hmmm, not quite sure how to say this but ...
Am I alone in not trusting Microsoft any further than I can Fart?
(If this comment was disrespectful, please report it.) 

 
1/17/2014 5:54:40 AMWilksey!

@BioMeg

Yes, I understand the learning curve was expensive (in time and money for some companies / individuals), those of us who are self taught, like me, spent a lot of time getting things to work especially the "impossible" things that people kept saying VB couldn't do, so I understand the argument regarding that.

I wouldn't trust Microsoft, no,and VB6, in my opinion is the best thing to come out of them.

I understand your passion, I was once distraught that VB was to become .NET, and refused point blank to use it, the the inevitable happened, but to this day I still do not use VB.NET, I much prefer C# as it is closer to Java and C/C++ which I use nearly every day, I even preferred VB over Delphi and C Builder as the GUI building was much more simpler in VB, and you were still limited to Windows under Borland.
(If this comment was disrespectful, please report it.) 

 
1/17/2014 5:54:52 AMWilksey!

I would love to see VB come back and I would start to use it again, I just can't help but feel that MS didn't listen before and it will take a miracle to make them listen and act this time!
(If this comment was disrespectful, please report it.) 

 
1/17/2014 8:57:02 AMCap. Picard


There is a link to bring VB6 back:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/34402 21-bring-back-classic-visual-basic-an-improved-versi[^]


An
 interesting idea in the comments of the article, the author says: "In protest, we can write an author statement inside each project that we publish in VB6, in which, we prohibit porting our source codes to VB .NET.". Can we do that ? 
(If this comment was disrespectful, please report it.) 

 
1/17/2014 9:07:35 AMCap. Picard


Another guy says: "We need 4000 people to get to 12000 votes. Now 2,636/3 = 878. Then 4000 - 878 = 3122 people needed for vote. We get there, and fast!"


http://visualstudio.uservoice.com/forums/121579-visual-studio/suggesti ons/3440221-bring-back-classic-visual-basic-an-improved-versi[%5E]

(If this comment was disrespectful, please report it.) 

 
1/17/2014 9:07:56 AMNanni

If this were to come true would be great.
(If this comment was disrespectful, please report it.) 

 
1/17/2014 10:14:52 AMCap. Picard


If we all fight for it then it will happen! :)

(If this comment was disrespectful, please report it.) 

 
1/17/2014 1:36:04 PMEuropean good man

I will support that motion! long live the VB6 King!
(If this comment was disrespectful, please report it.) 

 
1/17/2014 2:26:01 PMWilksey!

You can put any disclaimer in the source code that you want, but whether people adhere to it or not is another matter.

There are always people who will try and make money from something free, if the worlds governments could charge for air then they would! I would say that if you really do not want someone doing something specific with your code / project then don't post it on a code library like PSC, as once it hits their servers you have no control over how it is used.
(If this comment was disrespectful, please report it.) 

 
1/17/2014 5:36:49 PMJason Costa

Yes. Yes. Yes.

I took a look at my Microsoft Updates list and Visual Studio has a Service Pack 1 waiting in there. I refuse to download it, and am thankful my autodownload isn't on or I would have missed it. Right there in the documentation it clearly states that one of the new "features" in SP1 for VS2010 is that they are REMOVING Left/Mid/Etc from the language.

This is an ANCIENT piece of code, back even before QBASIC, and it is STANDARD to the language. Yet some big gun decided it needed NERFED/TRIMMED/REMOVED. Why remove it? What's the reason? What does it hurt to leave it?

Simple answer: they're going the wrong way.
(If this comment was disrespectful, please report it.) 

 
1/17/2014 5:37:23 PMJason Costa

COMMENT PART 1

So my thoughts:

VB6 is faster than 2010 .NET apps, the code is easier to write (in my opinion), and if a few small problems were fixed we could use this for decades:

Think - UNICODE support, multi-threading, NEW directX compatibility, cell phone app creation, multi-processor computing and GPU, compatibility with any link library, and a few bug fixes here and there. Maybe allow ASM/C++ injections and the new version will never go obsolete.

(If this comment was disrespectful, please report it.) 

 
1/17/2014 5:37:46 PMJason Costa

COMMENT PART 2

It's pretty much perfect how it is, except for a few details. It's a microsoft product aimed to bolster the microsoft systems, so it makes sense to incorporate the new microsoft technologies into it (DirectX 11, etc).

Instead of expecting Microsoft to do it, how hard would it be to do it publicly? BASIC is one of the oldest languages in computing, there are a plethora of open compilers out there. Hell, this is how Gates did it. How hard could it be to incorporate the VB6 feature and language set into a powerful modern compiler?

Ironically, you could probably build the frontend IDE in VB6 LOL
(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:56:45 AMDave Carter

Way to go Jason :D
(If this comment was disrespectful, please report it.) 

 
1/18/2014 1:03:22 PMDr. Intel

Is it possible that Microsoft would consider making Visual Basic 6 "Open Source" ? That would solve a lot of problems. Or the UNIX community develop there own visual compiler?
(If this comment was disrespectful, please report it.) 

 
1/18/2014 2:49:14 PMdave carter

part 1
i used to think, oh no, not another Windows OS, is my stuff gonna work?
Essentially, my stuff HAD to work!!!
Microsoft's statement, 'VB6, It just works!' was OK most of the time except when implementing on Servers where the playing ground was somehow different, no problem though, just some tweeking here and there after a nightmare debug session.
Sooner, or later, I realised that Microsoft had to support my crappy 32 bit VB6 systems, and everyone elses, or pay the price.
(If this comment was disrespectful, please report it.) 

 
1/18/2014 2:49:44 PMdave carter

part 2
I don't care what OS Microsoft puts out, it can, in no way, invalidate a decade's worth of successful systems software, developed with VB6, by way of not keeping with the 'it just works', of course it blooming well works, Microsoft would get skinned alive otherwise!!!
Just think about it, how many small to medium size businesses would be forced to stay with MS-OS-Whatever because Microsoft won't support their critical systems anymore in MS-OS-WhateverNext2000AND3BILLION. Make no mistake, even Corporations would have to work around and with the issue so you can add the Network Techies to the Very Dis-Gruntled.
From what I've seen on Classic VB in PSC land, all the key skills exist to make our own VB6 IDE + COMPiLER probably a Multi-Platform Compiler at that!
Sisters and Brothers, Whad'ya Say?
(If this comment was disrespectful, please report it.) 

 
1/18/2014 3:34:18 PMWilksey!

No, as far as I am aware MS have never released anything as big as VB open source, and they have no reason to start, they may sell it to you for a hefty price!

Microsoft technically hasn't done anything wrong apart from ignore what people want, for example, they are still supporting VB6 applications on their OS's and people can still use it if they have it, I think the only way forward is to make your own version.
(If this comment was disrespectful, please report it.) 

 
1/18/2014 3:48:47 PMSimulanics

If you want VB6 again, goto Xojo.com it's cross-platform VB6 and you code once...compile to Windows/Mac/Linux/Web and soon iOS. Xojo also fixes many of the problems which VB6 had including true full COM and Object Oriented Code. Xojo is free to use and requires a license to build. Lets see..Microsoft VB6 $3000/license or Xojo $100/license and build on any platform? Microsoft cannot compete and will not ever re-introduce VB6 since they failed. They stopped producing VB6 as Xojo formed along side VB6 and quickly was capable of doing more. Even better Xojo sytax is almost VB6 sytax..to about 99%. The only deviance in Xojo sytax is areas where VB6 lacked true Object oriented code. Stop complaining and look at why they discontinued, and go with the competitor that won out over VB6.
(If this comment was disrespectful, please report it.) 

 
1/18/2014 3:52:49 PMdave carter

@Simulanics
Yeah Bro', did I say that loud enough
YEAH BRO
Keep on Keeping On
(If this comment was disrespectful, please report it.) 

 
1/18/2014 3:58:04 PMBioMeg


@Wilksey!

This is why I add heavy VB6 source codes to PSC, for those from other programming communities (Java, C++, and others) to see that VB6 is truly the best. A second reason is to make other VB6 programmers to comment and defend VB6 all over the internet. I think the programmers who post and posted VB6 codes on PSC are heroes and I love them! I think we all feel and think the same thing when it comes to VB6, but we don't discuss between us.

Long live the VB6 King! :)


(If this comment was disrespectful, please report it.) 

 
1/18/2014 3:59:01 PMBioMeg


A possible protest should look like:

1) post a source code at least once a month.

2) we must write articles (as the above mentioned) showing all the qualities and reasons why VB6 should be put back on the market.

3) where we see bad comments on VB6, we must answer with heavy examples (links to extremely good source codes)

4) When we see articles on VB6 we have to comment / vote.

5) we must have our blogs, where to post about VB6.

6) To create VB6 projects unseen in other programming languages, as we did until now.



(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:00:12 PMBioMeg


What can we do to MS?

1) we can write individual letters to Microsoft.

2) We can create a petition for a new VB6

3) We can sue Microsoft for a new VB6 (I think Planet Source Code can do that).

(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:02:05 PMCap. Picard

@Jason Costa

True, Microsoft is going the wrong way.
VB6 is more than just a language, is a phenomenon.


@Dr. Intel

If they make Visual Basic 6 "Open Source", it will be fire
For as many ASM programmers VB6 has, the new VB6 can be ready in 2-3 months.
As dave carter said, all the key skills exist to make our own VB6 IDE + COMPiLER probably a Multi-Platform Compiler at that!


@dave carter

You are right, I'm sick and nervous at every new OS too, so I think we must force them for a new VB6.

Long live the VB6 King ! 
(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:02:59 PMdave carter

4) We can write our own VB6 and tell Microsoft where to shove it!
(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:15:35 PMCap. Picard

@dave carter

How would you like to see articles like:

"The new Visual Basic 6.0 cross-platform is here !" or

"Visual Basic 6.0 is stolen from Microsoft's back garden by hackers" or

"Designers slap Microsoft with a new Visual Basic 6.0".

That is neither far nor impossible ...


(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:21:15 PMdave carter

Thanks Cap. Picard
You can Code Bro' please don't underestimate what you can do!
For myself, I was always taught that VB6 ain't real programming, well sod it, if what I do is a million miles from C++, a proper programming language, then pooh on my grave :D baby!
p.s. my previous comment was to follow BioMeg's 'What can we do to MS?'.

(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:26:42 PMdave carter

I'm just saying that VB6 has everything in it that anyone could need to make it their own!
VB6 is really that Brilliant! and Microsoft is sick that they let it go pre, managed code and all that!
(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:32:51 PMdave carter

Syntax is Syntax, when U know the rules anything is possible!
happy coding :)
(If this comment was disrespectful, please report it.) 

 
1/18/2014 4:47:40 PMdave carter

@ Cap. Picard
I know you are better than the dark forces have led you to believe...
Rise Brother Picard and Shine The Light that is You :D
peace and love, dave
(If this comment was disrespectful, please report it.) 

 
1/18/2014 5:30:44 PMCap. Picard

:))))))))))))

peace and love and VB6 !
(If this comment was disrespectful, please report it.) 

 
1/18/2014 5:38:47 PMdave carter

yeah Man! VB6!
(If this comment was disrespectful, please report it.)