473,785 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bzip2 Question

I have a query about Bzip2 in PHP. Let's say that i have a paragraph
like:

abcdbc nnotp iidhdmmc;
uuidpssa

-------End-------

Now, i compress it using bzcompress() and store it in a mysql
database.

Now suppose i want to search for the string abcd in the database so if
i encode "abcd" in bzip2 then use the LIKE SQL query; will it fetch me
the result ?

Nov 4 '07 #1
6 1388
..oO(Nilesh)
>I have a query about Bzip2 in PHP. Let's say that i have a paragraph
like:

abcdbc nnotp iidhdmmc;
uuidpssa

-------End-------

Now, i compress it using bzcompress() and store it in a mysql
database.

Now suppose i want to search for the string abcd in the database so if
i encode "abcd" in bzip2 then use the LIKE SQL query; will it fetch me
the result ?
No, this can't work. Why do you want to store compressed strings at all?

Micha
Nov 4 '07 #2
On Nov 4, 3:21 pm, Michael Fesser <neti...@gmx.de wrote:
.oO(Nilesh)
I have a query about Bzip2 in PHP. Let's say that i have a paragraph
like:
abcdbc nnotp iidhdmmc;
uuidpssa
-------End-------
Now, i compress it using bzcompress() and store it in a mysql
database.
Now suppose i want to search for the string abcd in the database so if
i encode "abcd" in bzip2 then use the LIKE SQL query; will it fetch me
the result ?

No, this can't work. Why do you want to store compressed strings at all?

Micha
Saving database space. :D

Nov 4 '07 #3
..oO(Nilesh)
>On Nov 4, 3:21 pm, Michael Fesser <neti...@gmx.de wrote:
>>
No, this can't work. Why do you want to store compressed strings at all?

Saving database space. :D
That's usually nothing to worry about. If the strings are really short,
compression might even lead to a _longer_ string.

Micha
Nov 4 '07 #4
On Nov 4, 4:12 pm, Michael Fesser <neti...@gmx.de wrote:
.oO(Nilesh)
On Nov 4, 3:21 pm, Michael Fesser <neti...@gmx.de wrote:
No, this can't work. Why do you want to store compressed strings at all?
Saving database space. :D

That's usually nothing to worry about. If the strings are really short,
compression might even lead to a _longer_ string.

Micha
I meant that for longer strings.

Nov 4 '07 #5
Nilesh wrote:
I have a query about Bzip2 in PHP. Let's say that i have a paragraph
like:

abcdbc nnotp iidhdmmc;
uuidpssa

-------End-------

Now, i compress it using bzcompress() and store it in a mysql
database.

Now suppose i want to search for the string abcd in the database so if
i encode "abcd" in bzip2 then use the LIKE SQL query; will it fetch me
the result ?

Try comp.database.m ysql for mysql questions.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Nov 4 '07 #6
..oO(Nilesh)
>I meant that for longer strings.
Even then I don't think it's necessary, especially since it makes
searching and pattern matching impossible. You would always have to
decompress the string before you can perform a search on it.

Micha
Nov 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5043
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
2665
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask it differently. FOUR QUESTIONS: The background: I got three (3) files
3
3091
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
10
3441
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
10
3738
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
0
1205
by: itzel | last post by:
Hello!! In using tarfile to group thousands of small files from a directory and then compress it. I already compress a group of files in my pc, but I need do it in a server and I'm testing the same procedure, but it doesn't work . A "ReadError" appear: "not a bzip2 file". I'm using this script: import os import tarfile
7
2434
by: giuseppe.cannella | last post by:
i need to read a row on a bzip2 file like the fgets function does on a text file can you help me to find this function thank
232
13349
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
0
1271
by: Geky | last post by:
I'm trying to use BZip2 library but I receive always an access violation error. I use two different codes: bz_stream bzstream; ZeroMemory(&bzstream, sizeof(bzstream)); bzstream.bzalloc=NULL; bzstream.bzfree=NULL; bzstream.opaque=NULL;
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.