Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Design

Design

Scheduled Pinned Locked Moved The Lounge
databasequestioncomdesignsysadmin
17 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L l a u r e n

    thats what i just told him ;)

    "there is no spoon" {me}

    M Offline
    M Offline
    Member 96
    wrote on last edited by
    #6

    I was going to say great minds think alike but you being a drummer and all... ;)


    "110%" - it's the new 70%

    L E 2 Replies Last reply
    0
    • M Member 96

      I was going to say great minds think alike but you being a drummer and all... ;)


      "110%" - it's the new 70%

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #7

      :laugh:

      "there is no spoon" {me}

      1 Reply Last reply
      0
      • M Member 96

        I was going to say great minds think alike but you being a drummer and all... ;)


        "110%" - it's the new 70%

        E Offline
        E Offline
        El Corazon
        wrote on last edited by
        #8

        John Cardinal wrote:

        but you being a drummer and all...

        and what is the matter with a drummer?? harumph!! ;P Actually, I have a drum, but have used it for maybe 30 minutes in the last 6 months.... Not your usual drum though....

        _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

        1 Reply Last reply
        0
        • M Miszou

          Soooo, I have a little website that contains all my digital photos so that my family can see them without me having to constantly send images as email attachments. This works really well, as I am living in California and my family are in England and France - it really makes it easier to share the images. All I have to do is copy the contents of my digital camera into a folder on my server and the photos automatically appear on the web site. Family members have to login to see most of the images, and I've recently starting creating accounts for other people to be able to login and see photos they might be interested in. For example, my sons soccer team have an account, and they can only see soccer related images. Now, this is all working perfectly, so I decided to add a feature to allow people to leave comments on the images. So far, so good. The comments are stored in an XML file in the same folder as the image. So, for example image1.jpg might have an associated image1.xml file containng all the comments. I stored the comments in XML files instead of a database for several reasons:

          • I can rename folders without breaking links to files in the database.
          • When I archive folders onto CD, the comments will automatically be copied (and readable) without having to mess with a database export.

          And now comes the great design shortcoming... I want to add a feature to the front page of the album that shows the last 5 comments added, with hyperlinks to the image. However, in order to do this, I will need to store the full path to the image somewhere, so that the hyperlink will work. I could create another XML file that gets updated whenever a comment is added, or I could just shove all the comments into a database and build my list from there - which would render my XML files rather pointless! :doh: Either way, I've just created a load of work for myself. If I had used a database from the beginning, then building the list of recent comments would be trivially easy, but I would lose the freedom of renaming folders and moving files. Without wishing to wander too far into "programming question" territory, what suggestions would you have for moving forward from here - XML index file or SQL Database or something else entirely?


          Sunrise Wallpaper Project | The StartPage Randomize

          K Offline
          K Offline
          Kevin McFarlane
          wrote on last edited by
          #9

          Why not just use something like Picasa Web Albums (or Yahoo! Photos) - unless you especially want to program all this stuff?

          Kevin

          M 1 Reply Last reply
          0
          • M Miszou

            Soooo, I have a little website that contains all my digital photos so that my family can see them without me having to constantly send images as email attachments. This works really well, as I am living in California and my family are in England and France - it really makes it easier to share the images. All I have to do is copy the contents of my digital camera into a folder on my server and the photos automatically appear on the web site. Family members have to login to see most of the images, and I've recently starting creating accounts for other people to be able to login and see photos they might be interested in. For example, my sons soccer team have an account, and they can only see soccer related images. Now, this is all working perfectly, so I decided to add a feature to allow people to leave comments on the images. So far, so good. The comments are stored in an XML file in the same folder as the image. So, for example image1.jpg might have an associated image1.xml file containng all the comments. I stored the comments in XML files instead of a database for several reasons:

            • I can rename folders without breaking links to files in the database.
            • When I archive folders onto CD, the comments will automatically be copied (and readable) without having to mess with a database export.

            And now comes the great design shortcoming... I want to add a feature to the front page of the album that shows the last 5 comments added, with hyperlinks to the image. However, in order to do this, I will need to store the full path to the image somewhere, so that the hyperlink will work. I could create another XML file that gets updated whenever a comment is added, or I could just shove all the comments into a database and build my list from there - which would render my XML files rather pointless! :doh: Either way, I've just created a load of work for myself. If I had used a database from the beginning, then building the list of recent comments would be trivially easy, but I would lose the freedom of renaming folders and moving files. Without wishing to wander too far into "programming question" territory, what suggestions would you have for moving forward from here - XML index file or SQL Database or something else entirely?


            Sunrise Wallpaper Project | The StartPage Randomize

            B Offline
            B Offline
            BrianJElliott
            wrote on last edited by
            #10

            I didn't see any actual answers to your question - so here goes. (I'm going to assume .net - but most languages would support this structure) Make a service that ties into the FileSystemChanged events - monitor the directories of yon files. When an xml file changes, update a master xml that keeps this list of 5. This allows you to keep your structure, but also respond to changes in lots of files without bothering the actual process (and quickness) of single xml files per pic. Hope this gives you an idea. Brian

            M 1 Reply Last reply
            0
            • M Miszou

              Soooo, I have a little website that contains all my digital photos so that my family can see them without me having to constantly send images as email attachments. This works really well, as I am living in California and my family are in England and France - it really makes it easier to share the images. All I have to do is copy the contents of my digital camera into a folder on my server and the photos automatically appear on the web site. Family members have to login to see most of the images, and I've recently starting creating accounts for other people to be able to login and see photos they might be interested in. For example, my sons soccer team have an account, and they can only see soccer related images. Now, this is all working perfectly, so I decided to add a feature to allow people to leave comments on the images. So far, so good. The comments are stored in an XML file in the same folder as the image. So, for example image1.jpg might have an associated image1.xml file containng all the comments. I stored the comments in XML files instead of a database for several reasons:

              • I can rename folders without breaking links to files in the database.
              • When I archive folders onto CD, the comments will automatically be copied (and readable) without having to mess with a database export.

              And now comes the great design shortcoming... I want to add a feature to the front page of the album that shows the last 5 comments added, with hyperlinks to the image. However, in order to do this, I will need to store the full path to the image somewhere, so that the hyperlink will work. I could create another XML file that gets updated whenever a comment is added, or I could just shove all the comments into a database and build my list from there - which would render my XML files rather pointless! :doh: Either way, I've just created a load of work for myself. If I had used a database from the beginning, then building the list of recent comments would be trivially easy, but I would lose the freedom of renaming folders and moving files. Without wishing to wander too far into "programming question" territory, what suggestions would you have for moving forward from here - XML index file or SQL Database or something else entirely?


              Sunrise Wallpaper Project | The StartPage Randomize

              B Offline
              B Offline
              Bob Nadler
              wrote on last edited by
              #11

              I did my family albums with Gallery [^]. It has all the features you'll ever need or want. My problem was that my family was e-mailing me all of their photos that I had to move to the site. Gallery allows them to create and maintain their own albums. Very nice and works great. It easily integrates into an existing site and is very customizable. -- Bob

              1 Reply Last reply
              0
              • M Member 96

                Hmmm..personally I would have written it to store both the comments and the photos in a database but maybe that's just me. :)


                "110%" - it's the new 70%

                M Offline
                M Offline
                Miszou
                wrote on last edited by
                #12

                John Cardinal wrote:

                store both the comments and the photos in a database

                But that's the complete opposite of what I want to do! :| The purpose is to add web browsing ability to an existing file structure. There are over 12,000 images in numerous directories, and I already have a couple of simple ASP.NET pages that can navigate the directory structure and display the images. Why would I want to make it even less portable and obfuscate all the images into a database? Because the files are in the file system, they are not only accessed via the web interface. For example, my media player in the living room uses a 3rd party screen saver to cycle through the images when it is idle.


                Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                M 1 Reply Last reply
                0
                • K Kevin McFarlane

                  Why not just use something like Picasa Web Albums (or Yahoo! Photos) - unless you especially want to program all this stuff?

                  Kevin

                  M Offline
                  M Offline
                  Miszou
                  wrote on last edited by
                  #13

                  Kevin McFarlane wrote:

                  Why not just use something like Picasa Web Albums (or Yahoo! Photos) - unless you especially want to program all this stuff?

                  I have over 12,000 images and a couple of ASP.NET pages that navigate the directory structure and display images. It is all working just fine so far, but I wanted to make it a little more interesting. So yes, I do want to program all this stuff :-D


                  Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                  K 1 Reply Last reply
                  0
                  • B BrianJElliott

                    I didn't see any actual answers to your question - so here goes. (I'm going to assume .net - but most languages would support this structure) Make a service that ties into the FileSystemChanged events - monitor the directories of yon files. When an xml file changes, update a master xml that keeps this list of 5. This allows you to keep your structure, but also respond to changes in lots of files without bothering the actual process (and quickness) of single xml files per pic. Hope this gives you an idea. Brian

                    M Offline
                    M Offline
                    Miszou
                    wrote on last edited by
                    #14

                    That's kind of what I was thinking... although I don't think I need to go as far as writing a service. Since there's only one page that allows users to add comments, I can just write to comments.XML and index.XML at the same time, whenever a new comment is added. The only problem with this of course, is multiple users updating at the same time... So then I started thinking about using MS Access to maintain the index, but something about that didn't seem to fit right - especially as I have SQL Server available. But then I've come full circle and I'm right back at using a database again! I think I'll just maintain an XML index and be done with it!


                    Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                    A 1 Reply Last reply
                    0
                    • M Miszou

                      John Cardinal wrote:

                      store both the comments and the photos in a database

                      But that's the complete opposite of what I want to do! :| The purpose is to add web browsing ability to an existing file structure. There are over 12,000 images in numerous directories, and I already have a couple of simple ASP.NET pages that can navigate the directory structure and display the images. Why would I want to make it even less portable and obfuscate all the images into a database? Because the files are in the file system, they are not only accessed via the web interface. For example, my media player in the living room uses a 3rd party screen saver to cycle through the images when it is idle.


                      Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                      M Offline
                      M Offline
                      Member 96
                      wrote on last edited by
                      #15

                      Well you code what you know I guess. To me your system sounds fragile and complex and un-portable where a database solution would be nice and clean and much easier to modify in future. There is no right or wrong answer, just different approaches.


                      "110%" - it's the new 70%

                      1 Reply Last reply
                      0
                      • M Miszou

                        That's kind of what I was thinking... although I don't think I need to go as far as writing a service. Since there's only one page that allows users to add comments, I can just write to comments.XML and index.XML at the same time, whenever a new comment is added. The only problem with this of course, is multiple users updating at the same time... So then I started thinking about using MS Access to maintain the index, but something about that didn't seem to fit right - especially as I have SQL Server available. But then I've come full circle and I'm right back at using a database again! I think I'll just maintain an XML index and be done with it!


                        Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                        A Offline
                        A Offline
                        Andy Brummer
                        wrote on last edited by
                        #16

                        If you are really concerned about concurrency issues then open the file exclusively for writing or use a mutex.


                        Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you. -Chris Maunder

                        1 Reply Last reply
                        0
                        • M Miszou

                          Kevin McFarlane wrote:

                          Why not just use something like Picasa Web Albums (or Yahoo! Photos) - unless you especially want to program all this stuff?

                          I have over 12,000 images and a couple of ASP.NET pages that navigate the directory structure and display images. It is all working just fine so far, but I wanted to make it a little more interesting. So yes, I do want to program all this stuff :-D


                          Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                          K Offline
                          K Offline
                          Kevin McFarlane
                          wrote on last edited by
                          #17

                          Fair enough. :)

                          Kevin

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups