smart-playlist

Random playlist algorithm

怎甘沉沦 提交于 2020-01-27 14:33:50
问题 I need to create a list of numbers from a range (for example from x to y) in a random order so that every order has an equal chance. I need this for a music player I write in C#, to create play lists in a random order. Any ideas? Thanks. EDIT: I'm not interested in changing the original list, just pick up random indexes from a range in a random order so that every order has an equal chance. Here's what I've wrriten so far: public static IEnumerable<int> RandomIndexes(int count) { if (count >

Random playlist algorithm

♀尐吖头ヾ 提交于 2020-01-27 14:30:08
问题 I need to create a list of numbers from a range (for example from x to y) in a random order so that every order has an equal chance. I need this for a music player I write in C#, to create play lists in a random order. Any ideas? Thanks. EDIT: I'm not interested in changing the original list, just pick up random indexes from a range in a random order so that every order has an equal chance. Here's what I've wrriten so far: public static IEnumerable<int> RandomIndexes(int count) { if (count >

Random playlist algorithm

女生的网名这么多〃 提交于 2020-01-27 14:30:04
问题 I need to create a list of numbers from a range (for example from x to y) in a random order so that every order has an equal chance. I need this for a music player I write in C#, to create play lists in a random order. Any ideas? Thanks. EDIT: I'm not interested in changing the original list, just pick up random indexes from a range in a random order so that every order has an equal chance. Here's what I've wrriten so far: public static IEnumerable<int> RandomIndexes(int count) { if (count >

Are there “Dynamic Playlists” of unit tests in Visual Studio?

回眸只為那壹抹淺笑 提交于 2019-12-23 22:22:14
问题 When working with unit tests in Visual Studio, it's possible to compile playlists that group the tests. This is useful, for instance, when developing a new feature for which we want to run only the related tests and not all the existing ones. However, it seems to me the playlists can only be maintained "manually", by explicitly adding/removing unit tests. It's better than nothing, but it would be great if I could some how "tag" my unit tests depending on some criterion (e.g. feature, test

Random playlist algorithm

丶灬走出姿态 提交于 2019-11-28 07:38:28
I need to create a list of numbers from a range (for example from x to y) in a random order so that every order has an equal chance. I need this for a music player I write in C#, to create play lists in a random order. Any ideas? Thanks. EDIT: I'm not interested in changing the original list, just pick up random indexes from a range in a random order so that every order has an equal chance. Here's what I've wrriten so far: public static IEnumerable<int> RandomIndexes(int count) { if (count > 0) { int[] indexes = new int[count]; int indexesCountMinus1 = count - 1; for (int i = 0; i < count; i++