Wikipedia:Reference desk/Archives/Computing/2014 August 17

= August 17 =

Very large sets of permutations and their application in contemporary music theory
Twelve-tone music is based on an ordered set of 12, unique, pitch classes notated in music set theory as integers 0 … 11. Therefore there are 479,001,600 possible twelve tone rows (permutations of the ordered set). Even if it took just a millisecond to calculate each permutation it would still take about 326 days to perform that calculation, correct? Is there any hope at all that a searchable database of all twelve-tone rows can be constructed? --50.46.100.76 (talk) 00:31, 17 August 2014 (UTC)


 * Modern computers can do calculations far quicker than a millisecond. They can do more like millions or billions of calcs per second, depending on the complexity of the calculation and the computer used. But, even using your mere thousand calcs per second, I still get 5 and half days, not 326 (12!/1000/60/60/24). It looks like you forgot to divide by either the 60 seconds in a minute or the 60 minutes in an hour.


 * Also, I don't see any point in creating such a list. If I understand you correctly, there would be 12 notes in sequence, and the first could be any of the 12 notes, while the next would be any of the remaining 11 notes, etc., giving us 12! possibilities.  If you really wanted a list of all those possible sequences, it probably already exists online, but what use would it be ? StuRat (talk) 03:00, 17 August 2014 (UTC)


 * Thanks for the reply, and sorry for my arithmetic error. My interest in having this kind of collection would be to search and/or sort the resulting database for desirable characteristics such as certain kinds of symmetries in the hexachords, all-interval tetrachords, etc. For students of 20th-century music theory this actually has great importance and practical application. I'm not aware of a readily available tool to do this online. (In addition, it would be a proof of concept that I would want to expand into other, more interesting applications in the study of algorithmic composition.)
 * I know that finding all the permutations is probably the most brute force of many available approaches, however I would want to allow for very broad flexibility in what the user specified as a search criteria. Could a database of this kind be indexed in some way so as to make the search more speedy than the initial calculation by which it was created? And is there some way to split up a calculation of this kind over a number of computers to speed up the process? Finally, how can one calculate the memory size for a database from the number of sets generated? Thanks! --50.46.100.76 (talk) 04:38, 17 August 2014 (UTC)


 * I don't understand why you're searching. If every possible permutation of notes is in your hypothetical database, why do you need to search it?  Every conceivable combination is in there - so the answer to every search is "YES!" - so why search?!? SteveBaker (talk) 05:05, 17 August 2014 (UTC)


 * Steve, as a composer myself, I frequently want to see a selection of sets or chords with certain properties. This database would provide an analytical means of reviewing an inhumanly large data set and selecting appropriate musical material. Remember, we're talking about music represented by numbers. Perhaps the twelve-tone example is a bit obscure, but consider the set of all natural harmonics up to the 9th partial in the string section of the classical, western orchestra (also a set with close to half a million members if we only go up to hexachord-size subsets). Generating every combination of these harmonics reveals every possible chord in that set, each with its own expressive properties. That would be incredibly valuable in the field of contemporary sound art and algorithmic music composition. So, --50.46.100.76 (talk) 05:49, 17 August 2014 (UTC)


 * Yeah - but that list would also contain every possible jarring, grating, iharmoneous squawk. I'm no expert, but I bet there are 10,000 horrible sounds for every good one.  If you have an algorithm for making "useful" chords - then just generate those rather than all of them.  How are you going to search this list anyway?  The point is that STORING a predictable series is pointless when you can generate the Nth element of the series trivially easily.  It's kinda like saying: "I need to divide a bunch of number by 3 - so I'm going to generate a database of the first 100,000,000,000 multiples of 3 and search it to find the number I want to divide into." - there is simply no point in making the list.


 * If you're planning to generate every possible set of (say) 6 notes - then we can write you code that runs in a billionth of a second that'll produce the N'th element of that series. Pre-generating and storing makes NO sense whatever. SteveBaker (talk) 21:22, 17 August 2014 (UTC)


 * The thing is, twelve-tone rows are not chords. They're never or hardly ever heard in any perceptible form in a final composition. Instead, they are a kind of tool which could be used to construct an infinite number of compositions. The row imparts certain qualities to the resulting work, but is fairly unimportant to the sonic result. In other cases, such as the set of all natural harmonics up to the 9th partial in the string section of the orchestra, remember that the point of music is not to create "nice" sounds. Like all other arts, the point of "art music" is to express something. (That's debatable of course, but certainly the desire is to do SOMETHING beyond creating pleasant sounds.) What one composer finds ugly, another composer will find beautiful. Since the purpose is to make this tool available to all, it must be flexible enough to sort for any quality at all in the resulting sets. --50.46.100.76 (talk) 17:32, 18 August 2014 (UTC)


 * Sounds to me like what the OP is asking about is more of a sorting algorithm with the database (or else it'd be like assigning keywords or tags to certain combinations, like 'hex' and 'tetra' and so forth...) rather than simply a searchable database. And to add to the mix, s/he is sometimes using the term 'search' above when he seems to mean 'sort' -- or else 'search for the keywords as assigned previously...'. (I know he said 'search and/or sort,' but the conflation of terms after that is perhaps some source of confusion (?) though i can't pretend to know much about the music side of the question. El duderino (abides) 06:08, 17 August 2014 (UTC)


 * This sort of thing arises all the time in database programming -- that is, situations where you have a database most of whose index values don't have any entries associated with them. The standard solution is to construct what is called a hash table, which allows the database to be searched efficiently. Looie496 (talk) 14:29, 17 August 2014 (UTC)


 * As far as figuring out the size of the database table, take the number of records (479,001,600) and multiply it by the length of each record. To calculate the length of a record, since each of the 12 positions will hold one of 12 values, that takes 4 bits per position, since 2^4 = 16.  If the DB system doesn't support 4 bit integers, then hopefully it supports 8 bit integers, or at least 16 bit.  So, we have 12 times 4 or 8 or 16, for 48, 96, or 192 bits.  Now, you'll probably want to add some more fields to label this record.  These could be binary variables, noting whether this record is or isn't a certain type of combo.  So, one bit each would do.  If you have 8 of those, that's 8 more bits.  So, we now have 56, 104, or 200 bits.  Using an 8-bit byte, that's 7, 13, or 25 bytes per record.  Now we multiple by the number of records, to get 3.4GB, 6.2GB, or 12GB.  The lower two would fit on one side of a DVD, while the larger would fit on a two-sided DVD.  All would easily fit on modern hard drives, flash drives, etc.


 * There's also possible index space needed. That's typically much less than the data space, but if you put an index on every field, it could actually be more, considering that each data record is quite short.  To index each of 479,001,600 records, you'd need a 29 bit index, since 2^29 is the first multiple of 2 greater than that number.  However, you aren't likely to be able to do that, and will need to go to a 32 bit (4 byte) index, instead.  So, you multiply that by the number of records, and the number of indexes.  If you had an index on all 12 notes and 8 labels, that's 20×4×479,001,600, or over 38GB for the indexes.  You probably don't want to do that, but you could, if speeding up the searches is far more important than the space on the hard drive.  So, worst case scenario, we're at 50GB total, for data and indices.  You could also be more conservative and only put indices on the label fields, which would lower the index size to 15GB, and the worst case total size to 27GB.  If you need fewer than 8 labels, you could lower it even more.  StuRat (talk) 18:27, 17 August 2014 (UTC)

Please help me buy the right wire
I want to connect my computer to my TV and be able to watch video/movies on it. I have no idea what connection/wire type I would need to do this or if it's even possible, so I was hoping someone here could be specific and tell me what I need: what type of wire/what type of connection/any adapters and so on.

My TV is a brand new Sony Bravia and it's specs including its ports are here. I want to run to it from my iMac (iMac11,3 Intel Core i5 2.8 GHz). After a bit of research, looking at the back and the searching for what they are, my iMac has four USB 3 ports, an ethernet port, a FireWire port, a mini DisplayPort, an audio out, an audio in and in fact is identical to this.

Thanks much in advance, even if the answer is that I can't.--108.46.97.218 (talk) 01:15, 17 August 2014 (UTC)


 * Hmm, it looks rather incompatible. The inputs to the TV include HDMI, composite, and component video.  Both devices have USB ports, but I don't think you can send streaming video over that, it's used more for displaying stills, playing music, etc.  (Although maybe USB 3.0 can handle video, I'm not sure on that.)  I'd think your best bet would be to get a device to convert the mini display port output to HDMI format, but let's see what others have to say about it. StuRat (talk) 01:40, 17 August 2014 (UTC)


 * They could get a mini display to HDMI adaptor. Dismas |(talk) 01:46, 17 August 2014 (UTC)


 * Cool. So if I got this, and ran an HDMI cable from my TV to it, would it be as simple as (after changing the input on the TV to that HDMI connection) just turning on AVI/Quicktime/Wondershare, and playing the movie?--108.46.97.218 (talk) 02:30, 17 August 2014 (UTC)


 * There could still be some annoyances. For example, does the movie you are playing match the aspect ratio of the TV ?  If not, then you will have letterboxing, stretching, or part of the movie will be off the edge of the screen.  You can probably select which option you want using your TV remote.  Also, the iMac might not send the full 1920x1080 resolution the TV can display.  The TV may then create a smaller pic, or it could try to interpolate to "upscale" the image.  Again, the TV remote may have options for which approach it takes.


 * Also, you will want to switch to a full screen display of the movie on the iMac, or you will get all the window frame and other junk displayed around the edges on the TV. Note that you won't be able to use the iMac for anything else interactive while the movie plays, because anything you do will also display on the TV.  (You could run things in background mode, but they might cause the video or audio to pause or get out of sync.)  StuRat (talk) 02:47, 17 August 2014 (UTC)


 * Interesting. Worth a shot considering what a pain it is to burn movies to DVD which take up a lot of time (especially now that I always want 1080p).--108.46.97.218 (talk) 03:56, 17 August 2014 (UTC)


 * On a side note, you don't have to buy brand name retail, which includes huge markups. There are perfectly good adapters out there for under $5 if you don't mind waiting a few days for delivery. Same for the HDMI cables. You can find 25 foot HDMI cables for under $10 .  --  Tom N  talk/contrib 06:07, 17 August 2014 (UTC)


 * The specs for the TV say that it supports WiFi and Ethernet. Why not just network it and watch the videos directly from the TV, rather than via the iMac? --Phil Holmes (talk) 10:16, 17 August 2014 (UTC)


 * I am pretty sure that screen mirroring on Sony Bravia TVs is using a thing called Miracast which seems incompatible with Macs. ny156uk (talk) 12:29, 17 August 2014 (UTC)


 * Oh, that's interesting too! I really don't know where to begin though. So, um, it's a mac, so it only broadcasts via bluetooth right? I thought wifi and bluetooth were not compatible? Any suggestions on how I would "ask" the mac to send a movie that I have on it, and in a way a wifi capable tv would understand it--108.46.97.218 (talk) 12:10, 17 August 2014 (UTC)


 * I think assumed that everything you want to watch is streaming video from the Internet, such as Hulu, Netflix, YouTube, etc. If that's the case, your TV wouldn't be connected to your Mac but to your router, using WiFi or an Ethernet cable. In other words, your TV would be like another computer in your home network. TVs that have that capability provide a way to connect to the desired site and start the video, using the TV's remote control and on-screen menus. That should all be in the documentation for the TV.


 * If you're talking about other video sources such as files on your Mac and DVDs, etc., then the TV's networking support is of no value to you. That is, unless there's some kind of Mac app that I'm not aware of, that would allow you to send a stream from your Mac to the TV through your router.


 * Bravia is a family of television models. If you could provide your TV's model number, we could be referring you to specific pages in specific manual(s) on the Web.  Mandruss &#124; talk  12:41, 17 August 2014 (UTC)


 * Thanks Mandruss. It's a 48w600b. Yes, I am not thinking of using content from the internet directly, but videos on my computer. I have ordered the adapter and HDMI cable, for a grand total of about $14 (thanks Tom N!); thanks all!--108.46.97.218 (talk) 13:50, 17 August 2014 (UTC)


 * Cool. I'll mark this Q resolved for now, but please come back and tell us if it worked (repost if the Q has been archived by then). StuRat (talk) 17:09, 17 August 2014 (UTC)


 * Reporting back @User:StuRat], so I got the HDMI cord a few days ago, and the adapter today. Unfortunately, it's the wrong adapter. It does have the exact same symbol on it, but it's not even close to fitting the slot. Apple must have changed the configuration. My slot is sort of the shape of a "D" but the adapter fits a larger, rectangular opening. It was very cheap, Just lamenting that I have to wait for another to arrive. Researching the types of slots now.--108.46.97.218 (talk) 00:58, 22 August 2014 (UTC)


 * Is it a Mini DisplayPort you have?--Salix alba (talk): 02:04, 22 August 2014 (UTC)


 * Okay, after an amazing amount of time looking, I finally located what I have and thus that the seller simply sent me the wrong adapter. Sigh. It's a Mini DVI to HDMI adapter. D'oh.--108.46.97.218 (talk) 03:07, 22 August 2014 (UTC)


 * That sucks. I sure hope the seller agrees to pay the shipping costs both ways to resolve the mix up. StuRat (talk) 20:36, 22 August 2014 (UTC)

Automated accepting of cookies in EU
The EU passed a moronic law requiring each and every goddamned website to ask for permission to store cookies on my computer. I would like to grant permission once and for all - is there some way I can communicate this through a browser mod or user agent or some such thing? 129.215.47.59 (talk) 15:23, 17 August 2014 (UTC)


 * I think P3P does this, but it's not widely implemented.--Shantavira|feed me 06:08, 18 August 2014 (UTC)

XML support in databases
I wonder what FREE databases provide XML support. I know PostgreSQL does. What others are in this league? Thanks, --AboutFace 22 (talk) 16:04, 17 August 2014 (UTC)

Google Chrome - How to remove the white boxes
There are 8 white boxes in Google Chrome that are obstructing the theme I've chosen. Can I remove them and leave everything else the same? I've tried what you can do from Settings and a number of apps. The apps can remove them, but they also remove the background picture. Starfsmanna (talk) 16:53, 17 August 2014 (UTC)


 * I don't think so. However, there is a great extension called "New Tab Redirect". When you click on a new tab, instead of going to the boxes, it goes to the homepage of your choice, which can be a website or even a homemade html page on your hard disk. Mine is an html page with a bunch of links I use all the time. So, it is just like the 8 boxes, but I can choose what is there and what is not. Anna Frodesiak (talk) 16:59, 17 August 2014 (UTC)

Thank you, with your help and a continued search for a solution, I managed to come up with a workaround.

https://answers.yahoo.com/question/index?qid=20140817094306AAw8dmg

Starfsmanna (talk) 18:00, 17 August 2014 (UTC)