Jump to content

Wikipedia:Reference desk/Archives/Computing/2015 September 7

From Wikipedia, the free encyclopedia
Computing desk
< September 6 << Aug | September | Oct >> September 8 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 7

[edit]

Dynamic file hierarchy system

[edit]

I was discussing different methods of file hierarchies for storing data and I thought... Is there a file system that allows for a dynamic file hierarchy? This is a rather simplistic example... Assume that I have a few million photos. I know that I took one on Sep 7, 2014. So, I go to /date/2014/09/06/ and then I see the photos on that date. For another, I don't know the date, but I know it is a picture of my cat Smiley. So, I go to /subject/cat/smiley/ and then I see the photos of Smiley. For another, I know it was taken in Vancouver. So, I go to /place/canada/vancouver/ and I see the photos taken at that location. Every file system I've worked with uses a basic index system. You can make links from one file/folder to another, but you cannot dynamically resort all of the files at will. Therefore, I assume that nothing like this is available. It would have to be faked using an application and a database, but storing all files in a normal file structure. 199.15.144.250 (talk) 14:38, 7 September 2015 (UTC)[reply]

Yes, that's correct. You would want to either use multiple file systems with links pointing to the actual files, or use a relational database system which can find links that match a particular query. The first system wouldn't be very dynamic, but would allow you to access the files sorted in a few different ways. But if you want to be able to specify any query on the fly, that's where the database system would be best. Note that, in either case, somebody would have to spend a lot of time defining which photos match which keywords (like "cat pictures"). Maybe we are close to the point of having software recognize your cat and define those keywords automatically, though. However, other tags, like "My 20th high school reunion" would still be impossible for software to determine for you. StuRat (talk) 14:49, 7 September 2015 (UTC)[reply]
This is actually a longstanding idea, known as a semantic file system, or sometimes as a tag-based file system. Unfortunately our article on the concept is pretty stubby, but at least it includes a lot of useful pointers. Looie496 (talk) 15:01, 7 September 2015 (UTC)[reply]
What I do is to install a copy of MediaWiki and put photos in there - then the "Category" system can be used to place pictures into categories (and categories into categories). Check out how this works in WikiCommons, for example. SteveBaker (talk) 20:11, 7 September 2015 (UTC)[reply]
A UNIX/Linux file system does what you want too. In the simplest concept, a "directory" is just a list of filenames and corresponding 'inode' numbers. The actual files (and their attributes) are in a big, flat sea of files, each with a number. Directories are just files with lists in them. So it's trivial to have a file (or even a directory) appear to be in more than one place - just have multiple directories - each with that same inode in the list (either with the same, or different filename). The essential underlying set of files doesn't move or change in any way as you move files from directory to directory - and a file can trivially be in more than one place in the hierarchy. The only small cost is that the inode keeps a count of the number of times it's being referenced by a directory so that it can finally be deleted from the drive when there are no more links to it - so that counter is incremented or decremented whenever you refer or un-refer to it.
We generally think of this in terms of hard links - but in truth, that's how the file system actually works.
You can very easily build a dynamic directory tree on top of it and have a photograph simultaneously be in the "Holidays/2014/November" directory and in the "Animals/Cats" directory. SteveBaker (talk) 20:11, 7 September 2015 (UTC)[reply]
https://xkcd.com/981/ --Trovatore (talk) 21:17, 7 September 2015 (UTC) [reply]

C# how to enable audio device without using the audio device control panel?

[edit]

Hello everyone, how would I use C# and part of the Windows API to enable or disable different audio devices using only C#? I need to be able to do this without using the control panel. This would involve getting a list of audio devices on the system. Then simply calling something in the WinAPI to enabled a specific audio device. I can't use C++ but I can interoperate with the WinAPI in C#. I can't use the control panel settings for the audio devices because they are disabled by my admin, and I nor my admin has any way of enabling them. Thanks for your help in advance, —SGA314 I am not available on weekends (talk) 16:30, 7 September 2015 (UTC)[reply]

Can you do what you want with the Windows multimedia functions?--Phil Holmes (talk) 17:12, 7 September 2015 (UTC)[reply]
I don't think so. I looked at the page and I couldn't find any functions that would enable or disable an audio device. I also think that the functions that get a list of devices get only the devices that are enabled. —SGA314 I am not available on weekends (talk) 17:51, 7 September 2015 (UTC)[reply]
My point was: if you can select which audio device you use for a particular function, why would you need to disable some of them? Leave them all enabled and use the one you want to do whatever you're trying to do.--Phil Holmes (talk) 19:19, 7 September 2015 (UTC)[reply]
That's the thing, some of them are already disabled and in order to use them, I have to reenable them. I can't use the control panel like I said so I got the idea to do it via code. —SGA314 I am not available on weekends (talk) 14:16, 8 September 2015 (UTC)[reply]
Restrictive security policies will prevent you from programming device software. At the very least, your account needs privilege to access the device - and evidently, you don't even have that level of privilege. Furthermore, you will need to enable developer mode on your workstation if you want to perform normal tasks related to software development, and especially if you will be programmatically accessing hardware. If you are not the machine administrator, you cannot enable developer mode.
For perspective: hardware-device driver software usually has greater privilege than even the administrator account. If your organization's policies preclude you from having the software administator account privileges on a machine, you certainly should not have direct hardware access (as that level of access would allow you to completely circumvent software protection policies).
In plain english: you need to own and administer a separate development computer for this task. It is not a good idea to try to co-exist this type of software development with a secured computer environment. Nimur (talk) 17:33, 7 September 2015 (UTC)[reply]
Well, I can access the stream of any audio device that is enabled. I wasn't talking about writing device driver software, I just want to duplicate the basic functionality of the audio device settings in the control panel. If it just can't be done all the way around because of security policies, then oh well. Thanks for the help either way. —SGA314 I am not available on weekends (talk) 17:51, 7 September 2015 (UTC)[reply]

This month (or possibly a bit earlier) the Electronic Program Guide (EPG) in Windows Media Center (Windows 7) stopped providing data for me. I can choose to update the EPG, and the update 'succeeds' (at least according to the WMC GUI), but there is no data. Has something happened recently to the WMC EPG service in Sweden (Linköping, Östergötlands län), or is the problem entirely on my side? --Andreas Rejbrand (talk) 18:27, 7 September 2015 (UTC)[reply]