Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Oct 20, 2018 10:49 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: MBS Plugins - Compression plugin
PostPosted: Wed Aug 03, 2011 8:21 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Does monkey bread compression plugin always generate a corrupt zip archive? Even the standard rzb example in the compression examples generates a corrupt zip archive. Winrar states that the crcs are invalid (00000) and the standard windows zip reader says "invalid archive" id love to buy a commercial license.. If and only if MBs plugins has a fix for this? Perhaps because it's the unlicensed IDE only version until licensed it creates bad archives?? Antibes input would be appreciated. I've sent example applications to mbsoftware support with the same question but no response as of yet.

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Thu Aug 04, 2011 2:24 am 
Offline

Joined: Fri Sep 30, 2005 10:01 am
Posts: 283
Location: Germany, Munich
I'm curious how my Zip Classes compare to that.

Could you download them from http://www.tempel.org/RB/ZipPackage and run the Demo to create a zip file? What does WinRAR say about it?

_________________
User of RB since first version. Provider of many free and outdated plugins.
Code for sharing: http://www.tempel.org/RB/Resources
Arbed, a unique tool for editing projects: http://www.tempel.org/Arbed
Zip compression classes: http://www.tempel.org/RB/ZipPackage


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Thu Aug 04, 2011 2:54 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
CRC is not 0 for me. This value is written to the file after data has been written.
Are you sure the file was closed?

I tried with our zip and unzip examples for this.

And license has nothing to do with functionality.

PS: I found a bug with UnZipFileInfoMBS class here which will be fixed in the next plugins.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Thu Aug 04, 2011 10:47 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
MonkeybreadSoftware wrote:
CRC is not 0 for me. This value is written to the file after data has been written.
Are you sure the file was closed?

I tried with our zip and unzip examples for this.

And license has nothing to do with functionality.

PS: I found a bug with UnZipFileInfoMBS class here which will be fixed in the next plugins.

Greetings
Christian


Unless the rbz library example is coded wrong, it too has errors.. All the compression examples do the same... I have sent u a copy of the software I wrote and it acts the same. I've tried it on windows 7, Linux, and Mac leopard with the same results. If you'd like to view the code to the compiled app I sent to support at mb email me and we can collaborate.. Admin @ simulanics .com

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Thu Aug 04, 2011 12:54 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
I have emailed you a copy of the code rendering the errors and thank you for your quick response.

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Mon Aug 08, 2011 9:18 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Thank you temple plugin worked great! no errors and easy to use :-)

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Mon Aug 22, 2011 11:36 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
tempel wrote:
I'm curious how my Zip Classes compare to that.

Could you download them from http://www.tempel.org/RB/ZipPackage and run the Demo to create a zip file? What does WinRAR say about it?


Hi Tempel!!

I see you just released another update for your TTSZipPackage. I did a modification on my end that I believe would be beneficial for you to add to the main package. simply, add the sub into the method section of the startup constructor and it will check to see if ZLIB is installed already on a windows machine, and if not, it will put it there... :-) I wrote a neat little tool that can do this with all files, I've been working on a new method for REALBasic plugins where entrypoints will be no more :-)

Sub CreateZLIB()
'=============================================
' ZLIB Creation By Matthew A. Combatti
'admin@simulanics.com
'=============================================
Dim ResourceData(5) as String
Dim f as FolderItem
Dim c,k, iLen As Integer
Dim iByte As Integer
Dim s As String
Dim b as BinaryStream

f = SpecialFolder.System.Child("zlib1.dll")
If (f <> Nil) And f.Exists Then
Exit Sub
End If

ResourceData(1) = "4D5A0 3 0 0 0 4 0 0 0 1C0000 1C0000 0 0 0 0 0 0 0 0 0 400 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 E 1FE 0 9 340 211 4C340 21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652ED D A 240 0 0 0 0 0 0 50450 0 4C1 9 0 104C0 434C0 0 0 0 0 0 0 0 0 0 E 23B 1 2 380 1E1 0 0 1 0 0 C 0 0 0 100 0 0 100 0 0 301 0 0 0 8000 620 100 0 0 2 0 0 4 0 0 0 1 0 0 0 4 0 0 0 0 0 0 0 0 0 1 0 0 4 0 0 622 0 3 0 0 0 0 0 200 0 100 0 0 0 100 0 100 0 0 0 0 0 100 0 0 "
ResourceData(2) = "0 1 0 5 0 0 0 0 1 0 4 0 0 0 400 1 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 405 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2E746578740 0 0 4C1C1 0 0 100 0 0 1E1 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 600 60602E646174610 0 0 5C0 0 0 0 301 0 0 2 0 0 0 221 0 0 0 0 0 0 0 0 0 0 0 0 0 400 300 2E72646174610 0 0 4A0 0 0 401 0 0 4C0 0 0 241 0 0 0 0 0 0 0 0 0 0 0 0 0 "
ResourceData(3) = "400 60402E65685F6672616D700 0 0 0 0 1 0 0 2 0 0 0 701 0 0 0 0 0 0 0 0 0 0 0 0 0 400 300 2E6273730 0 0 0 20A 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 400 2E65646174610 0 5 0 0 0 1 0 0 6 0 0 0 721 0 0 0 0 0 0 0 0 0 0 0 0 0 400 30402E69646174610 0 4 0 0 0 0 1 0 0 6 0 0 0 781 0 0 0 0 0 0 0 0 0 0 0 0 0 400 300 2E727372630 0 0 3 0 0 0 400 1 0 0 4 0 0 0 7E1 0 0 0 0 0 0 0 0 0 0 0 0 0 400 300 2E72656C6F630 0 405 0 0 0 0 1 0 0 6 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 400 30420 0 0 0 "
ResourceData(4) = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "
ResourceData(5) = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5550C0 C000 18458 1C0 44248 109000 621C0 44244 0 9000 624 2483C0 181 0 240 CD0 0 0 0 270 0 0 0 5550C0 C000 18458 1C0 44248 109000 621C0 44244 0 9000 624 248000 5F181 0 243 0 1 190 D0260 0 0 0 555000 53C000 14150 9000 62480 74341D109000 62B000 4 39680 77153 0 74C0000 1C0000 40B 150 9000 62B000 4 39680 76B240 14248000 1D181 0 1C0 5 0 9000 620 0 0 0 1C0 4 240 0 0 0 8000 F 181 "


If f <> Nil then
b = BinaryStream.Create(f, True)
For c = 1 To 5
iLen = ResourceData(c).Len
For k = 1 To iLen Step 2
s = Mid(ResourceData(c), k, 2)
iByte = Val("&h" + s)
b.WriteByte(iByte)
Next k
Next c
b.Close
End if
End Sub


I will post the tool I made here if you'd like a copy or come over to http://www.realdevspot.com :-) THANKS SO MUCH FOR YOUR AWESOME ZIP CLASS!!!!

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Tue Aug 23, 2011 12:51 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Here's the File Builder Utility I made :-) Package is Windows, Linux, and Mac. You can select any file and it will generate a Sub Method to re-create it by calling the sub anywhere in your code...

http://www.realdevspot.com/public/rbp/Simulanics_REAL_File_Packager-ALL.zip

Image

**Just have to make one slight adjustment to font size on mac and fix base dir file selection but linux and Windows versions run perfect :-D

I'm sure someone will stumble across this and find it more than useful...

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Tue Aug 23, 2011 1:34 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
That's pretty cool for a couple of small files.

Ironically, I use the zip packages to allow me to bundle a big zip file holding many heavily compressed files, and then unpack those at run time.
If I used this method, each packaged file would be bigger than the original because of the way the binary values would be held in the RB code.
But I can see the value. Well done!


Top
 Profile  
Reply with quote  
 Post subject: TTs Zip Package: including dll in the app
PostPosted: Tue Aug 23, 2011 3:01 am 
Offline

Joined: Fri Sep 30, 2005 10:01 am
Posts: 283
Location: Germany, Munich
That's a neat idea to include the rather small zlib directly and install it as needed. I'll definetely use that in the Demo app and add it to my Manual. Thanks!

_________________
User of RB since first version. Provider of many free and outdated plugins.
Code for sharing: http://www.tempel.org/RB/Resources
Arbed, a unique tool for editing projects: http://www.tempel.org/Arbed
Zip compression classes: http://www.tempel.org/RB/ZipPackage


Top
 Profile  
Reply with quote  
 Post subject: Windows DLL for Zip Package
PostPosted: Tue Aug 23, 2011 3:29 am 
Offline

Joined: Fri Sep 30, 2005 10:01 am
Posts: 283
Location: Germany, Munich
One more note on the inclusion of the DLL code: There's a newer version 1.2.5 of the DLL. You might want to use that one, it mostly deals with a few border cases of corrupt zip files that could otherwise crash the code.

Not something that usually matters, especially if you know the files you want to extract, but it can't hurt either to use the latest version.

_________________
User of RB since first version. Provider of many free and outdated plugins.
Code for sharing: http://www.tempel.org/RB/Resources
Arbed, a unique tool for editing projects: http://www.tempel.org/Arbed
Zip compression classes: http://www.tempel.org/RB/ZipPackage


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows DLL for Zip Package
PostPosted: Tue Aug 23, 2011 9:31 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
tempel wrote:
One more note on the inclusion of the DLL code: There's a newer version 1.2.5 of the DLL. You might want to use that one, it mostly deals with a few border cases of corrupt zip files that could otherwise crash the code.

Not something that usually matters, especially if you know the files you want to extract, but it can't hurt either to use the latest version.


I reuploaded the fixed code for mac/windows/linux to generate a module like the one above or for any file (ie fonts, images, resources), but heres the new 1.2.5 ready module :-)

(It's too many characters for pasting so here it is as a text file.)

http://www.realdevspot.com/public/rbp/zlib.txt

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Wed Aug 24, 2011 1:18 am 
Offline

Joined: Fri Sep 30, 2005 10:01 am
Posts: 283
Location: Germany, Munich
Matthew,
now I'm confused. Why is the new version so much larger? What did you contain in the first version? That wasn't the entire 1.2.3 DLL then, was it?

_________________
User of RB since first version. Provider of many free and outdated plugins.
Code for sharing: http://www.tempel.org/RB/Resources
Arbed, a unique tool for editing projects: http://www.tempel.org/Arbed
Zip compression classes: http://www.tempel.org/RB/ZipPackage


Top
 Profile  
Reply with quote  
 Post subject: Re: Windows DLL for Zip Package
PostPosted: Wed Aug 24, 2011 3:10 am 
Offline

Joined: Wed May 20, 2009 11:02 am
Posts: 423
In another thread, you wrote:
simulanics wrote:
if you use windows, I have a faster version I wrote (takes microseconds rather than 30 seconds for larger files )

Do you mind to share it?


Also, is there any advantage to creating a String variable (array of strings) from the file you want to incorporate into the application over drag and dropping it into the application in the IDE?

I have made an example of what I mean:

dim mb as memoryblock
dim bs as BinaryStream
dim f as FolderItem
dim i as integer

mb=ImportedData //ImportedData is the drag and dropped file, which can be any type of file.


f=GetSaveFolderItem(".dll","DllLibrary") //Get a folderitem, using getsavefolderitem or any other way.

If f<> Nil Then
bs=BinaryStream.Create(f,True)
for i=0 to mb.Size-1 //This may not be the most efficient way of passing the data to the binarystream, but I am new
bs.Write(chr(mb.Byte(i))) //to memoryblocks and binarystreams, and this is the first working method I found.
next
bs.Close
End if

_________________
Using RS2011r4.3 on Windows7.


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS Plugins - Compression plugin
PostPosted: Wed Aug 24, 2011 11:26 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Quote:
Also, is there any advantage to creating a String variable (array of strings) from the file you want to incorporate into the application over drag and dropping it into the application in the IDE?

Well, this isn't a project they're talking about, it's a separate component that you would include in a project, so they can't drop the dll into it. Just won't work.

In your sample code, you can just say
bs.write(ImportedData)

No need to loop over each byte.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group