[quote user="CodeWhisperer"]the 'modified postfix traversal' method.[/quote]
I must say I haven't heard (had success with google) of that method before. Can you elaborate?
[quote user="CodeWhisperer"]the 'modified postfix traversal' method.[/quote]
I must say I haven't heard (had success with google) of that method before. Can you elaborate?
All this talk gave me an idea on how to store hierarchical data more efficiently. I've written up a small article at http://orangebeta.blogspot.com/2006/11/on-storing-ordered-hierarchies-in-sql.html
Well.. One could denormalize all the way. Have a table containing id, depth, ancestorId, order and level information. This way you have a record handy for every question. Sure it's lots of records but this is TDWTF right?
If your data is mostly static and/or you don't need to support versioning you might look into the object path option. The basic idea is to have each object contain a complete path to itself eg. object id4 path might be id1/id2/id3/id4/. This way you can query for object's child object or descendants in single like query eg. select * from table where path like 'id1/%'. It's a pain to maintain the correct path for each object but it pays off if you need quick retrieval. It's a trade-off. Either you read fast or you write fast :)
Then there's always Celko's nested sets .
According to wikipedia:
1.0 Beta 2 | 1.0.2914.0 | 2001-07-01 |
And I was wondering the same at http://thedailywtf.com/forums/thread/95924.aspx
[quote user="UncleMidriff"]
How would you all go about generating unique (per course) invitation codes that are shorter than UUIDs. Of course, the invitation codes shouldn't be easily guessable.[/quote]
1. Generate a random sequence of chars.
2. Get the next auto-incremented number.
3. Mix the two in a predefined way.
Eg.
1. sd3kea
2. 000001
3. sd3kea000001 or s000d300kea1 etc...
This way 1. Gets you a random key that is hard to guess and 2. Gets you uniqueness.
@Bob Janova said:
I'd love a language where threading and parallel coding was more 'designed in'.
We are experts in html, seo, and java?
Where is xml?
@Fred said:
@db2 said:@Nick said:[Obvious joke about mysql not being a real database]
[Lame recommendation to try postgresql, oracle, sqlite, etc]
[obligatory varchar2 dig]
[varchar2 retort]
[general, unrelated stab at the uselessness of VB, in any situation, and how <programming-language> solves all my problems]
@CDarklock said:
So it goes in a try() block with a corresponding catch().
2. YOU are an idiot who doesn't understand exceptions...