php-general Digest 13 Nov 2009 19:36:37 -0000 Issue 6441
Topics (messages 299809 through 299814):
Re: uniqid() and repetition of numbers generated
299809 by: Ashley Sheridan
299811 by: tedd
Re: is Aptana taking a crap on the face of PHP?
299810 by: tedd
Re: creating combobox in excel sheet?
299812 by: Kim Madsen
299813 by: Jim Lucas
Dear [email protected] 73% 0FF on Pfizer.
299814 by: © VIAGRA ® Official Site
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Fri, 2009-11-13 at 14:30 +1000, Angus Mann wrote:
> > Here's part of the confusion:
> >
> > If you were to express the number of microseconds since 1970 in a
> > decimal number, it would indeed take 16 digits.
> >
> > But uniqid() returns a /13 character string/, not a 13 digit number. The
> > string is actually a hexadecimal number (and thus can express a greater
> > range of values than a decimal number within those 13 characters).
> >
> > -John
>
> Ahh! The moment when the penny drops. I was looking at the result as a
> number, not a string.
> Solution to problem = use uniqid()
>
>
>
You say you don't want to use the auto increment field for this 'unique'
value, but then you are considering using something which is likely to
produce the exact same value as someone else may have in their database,
and then you plan on merging the data!
If I were you I'd either:
a) find another way instead t create a number that is unique to you,
something like a namespace kind of thing
b) don't merge the data directly, but think of a smart way of adding it
that avoids collisions
Personally, I reckon it's best going with the latter. The other database
should have extra fields in: one for their own auto incremental field,
one to store the value of your auto increment (not unique to avoid
problems if they source data from many other exterior databases) and one
field to indicate where the data came from.
I really do think that a bit of work on the interface between your two
databases would reap dividends, as it could make it a whole lot easier
to determine where a problem came from if one occurs, and to my mind
makes things just a little bit easier in the long run.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
At 9:11 AM +1000 11/13/09, Angus Mann wrote:
Thanks Ashley. To clarify, the reason I don't want to use
auto-increment : different users with their own populated databases
may wish to merge some or all of their data. The unique identifier
needs to be carried along with the rest of the data, hence be unique
not only on the database it currently resides in ... it still needs
to be unique if it gets copied into another person's database, and
auto-increment will not meet that requirement.
What you are running into can be solved with proper application of
namespace and auto-increment. It's a problem that's been solved.
If you want something unique per database, then use the domain name
where the database resides.
That way when you merge two database together, they field could have
their on internal auto-increment that is guaranteed to be unique and
a field showing their domain name, which is also unique.
If using a domain name (i.e., string) doesn't fit with your design,
then where you merge databases together then have an assignment of
numbers to each domain in the parent database. For example;
example.com = 1
nowhere.com = 2
hereitis.com = 3
...
Then in your merged database you would have the following two fields
domain number | auto-increment number (specific for that domain)
231 | 459879
356 | 109374556
140847 | 456729
That way you can have a nearly unlimited number of databases each
contributing a nearly unlimited number of records. What more could
you want?
Remember, the IP's are 255 x 255 x 255 x 255 < that's a pretty big number.
If that doesn't solve your problem, then use the IPng, which is
4 billion x 4 billion x 4 billion x 4 billion.
That's a number 36 digits long.
To give you an idea of how large that number is, imagine the surface
of this planet divided into atoms and each atom having a billion
addresses assigned to it.
So, simplify your problem by using namespace and auto-increment -- it works.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 11:26 PM -0500 11/12/09, Bastien Koert wrote:
The issue here is that there are a lot of choices in the PHP space.
Eclipse, Aptana, Komodo, Zend, a host of various simpler text editors.
Aptana has chosen not to compete in this space and its their choice.
Personally, I use NetBeans or Komodo when I require something with a
bit of power. The biggest issue with IDEs that I have, is they are so
damn slow to start. Some of the smaller text editors are much quicker
to start and have most of what I need to do what we all have so much
fun doing.
--
Bastien
You also have apps like GoLive and Dreamweaver that make excellent
IDE's -- you don't have to use the WYSIWYG junk.
I'm learning to use Eclipse and it's great, but it doesn't handle the
hundreds of smaller projects together like GoLive does -- or I
haven't learn how to yet.
I've never noticed any delays in development except occasionally in
uploads -- and that I assume is a connection problem.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Hey
I'm working on creating excel sheets from these classes:
http://articles.sitepoint.com/article/pear-spreadsheet_excel_writer/3
http://pear.php.net/package/Spreadsheet_Excel_Writer/download/
Does anyone know how to create a combo box from PHP with these (or other
classes)? By combobox I mean the <select> / dropdown box in HTML.
--
Kind regards
Kim Emax - masterminds.dk
--- End Message ---
--- Begin Message ---
Kim Madsen wrote:
> Hey
>
> I'm working on creating excel sheets from these classes:
>
> http://articles.sitepoint.com/article/pear-spreadsheet_excel_writer/3
>
> http://pear.php.net/package/Spreadsheet_Excel_Writer/download/
>
> Does anyone know how to create a combo box from PHP with these (or other
> classes)? By combobox I mean the <select> / dropdown box in HTML.
>
Where will your combobox reside?
What will your combobox contain/display?
What are you going to generating your combobox with? Are you wanting to build
it with one of the two listed software packages?
Jim
--- End Message ---
--- Begin Message ---
Click here http://www.dolodsoy.cn to view as a web page.
View image in browser now http://www.dolodsoy.cn/1.gif
Unsubscribe at http://www.dolodsoy.cn
Change e-mail address at http://www.dolodsoy.cn
Privacy Policy at http://www.dolodsoy.cn
About Us at http://www.dolodsoy.cn
Copyright © 2009 grnqb Inc. All rights reserved.
--- End Message ---