[QUOTE=Lumaio;47472639]Please don't make it like popcorntime, that ui is clunky as all fuck. His ui is fine, I like it a lot more.[/QUOTE]
I mean in terms of the things you can do. Like, in his version he can add a series and check stuff he's watched. "Make it more like popcorntime" would mean being able to automatically download torrents from clicking on an episode (or automatically downloading an entire series) and then being able to play it from the app. And other things that you might want to do that popcorntime also does, like a search feature, automatic downloading of subtitles and so on...
Got down to 15 seconds, now the bottleneck is istringstream and ifstream, probably istringstream more than ifstream though.
[QUOTE=Berkin;47472668]You could use [URL="http://www.newtonsoft.com/json"]Json.NET[/URL] to cache the results. It's extremely easy to learn and set up. It also has a NuGet package, so you can install it from the package manager console.[/QUOTE]
Json.NET is magical.
So I've been meaning to write a utility for sorting images into categories for a while. Finally got around to doing it.
[vid]http://a.pomf.se/ijiqud.mp4[/vid]
The UI is still work in progress. Some of the buttons on the right-hand side have been deprecated with controls in the form elements, and then I still need to add the keyboard controls. I intend to have the up/down keys cycle through the images that are currently being viewed, with the left-arrow key adding it to the selected categories, and right-arrow key removing from the categories.
If I can figure it out, I would [b]also[/b] like to have tab cycle between the categories and the images, so I can have dual-functionality: if the categories are selected, up/down would cycle through the categories, right-arrow would set the category as being viewed, and the enter key would toggle the category as being selected.
Basically, I want to add power-user controls, and completely eliminate the use of the mouse for those who prefer the keyboard, or who intend to only have a few simple categories.
Next, though, I am going to work on saving and loading. It will most probably just save out to JSON a structure of category -> filepaths, since those are more or less the only relevant elements amongst my data-structures.
I'd say this isn't too bad for being done in under four hours, though. Especially since I had never touched Windows Forms before. Visual C# really made this painless.
[editline]fish[/editline]
Ooh, I just thought of another useful feature: an Export option, that will prompt for a root directory. Once provided, it will create a subfolder for each selected category, and then put copies of the images into each respective folder.
[QUOTE=NixNax123;47471643]I know that, but how do you handle roots, etc without making individual special cases?
I kind of just want to be able to handle symbol symbolic calculations (e.g. x + x -> 2x, x + 5 -> x + 5), and then I can focus on implementing rules of differentiation/integration.[/QUOTE]
They are essentially just fractional powers for the prime factors.
Of course you need a symbol to store [I]exp(x, y)[/I], but for normal numbers you can just set y to a whole number and use the same "special case".
You definitely need to use exact fractions for this though, [I]float[/I] precision is usually enough but it can still fail pretty badly.
When you print it out you can simply split it into the whole and fractional part again to make it look a bit nicer.
[editline]7th April 2015[/editline]
[QUOTE=KaPow!;47471777][
(That's my facepunch account, I logged out and forgot which email and password I used [IMG]http://fi.somethingawful.com/images/smilies/emot-v.gif[/IMG])
[...][/QUOTE]
Mods can see them (the email addresses at least), so you can probably just ask one of them to send the password reset email for you.
Also :v: is just [noparse]:v:[/noparse] because Garry stole it.
[editline]7th April 2015[/editline]
[QUOTE=ryan1271;47472543]Well I finally feel good enough about this to share it. I've been working on a TV series tracking program. Basically you add the shows you are watching, check off episodes you seen, and when a new episode is out you can see it. I dont watch TV live because its more convenient to downl- watch legally later so its a hassle to search episode release dates.
This uses themoviedb.org to fetch show information (seasons, episode names, release dates, whatever) and is build in C# using WPF. Its pretty much my first project in C# and WPF has a bit of a learning curve for me so internally its horrendous. My exceptions just say 'kill me'. Regardless, I'm happy that this is working (and that it isn't Java like all my other stuff).
[IMG]http://i.imgur.com/MIxCCCe.png/[/IMG]
I'm not sure where I want to take it from here. Its pretty inefficient currently. It has to fetch all the information each time its opened. I could fix this by saving the results and updating them as necessary but that would require me understanding XML serialization in C#.
Any suggestions or feature requests to give me some direction here? Thanks[/QUOTE]
Check out [URL="http://www.malupdater.com/"]MALUpdater[/URL], it's really useful and pretty similar, but obviously targets a very different database.
You probably need to make an account on [URL="http://myanimelist.net/"]MyAnimeList.net[/URL] to test it properly though. Also you can disable the [I]Sounds[/I] plugin to make it less moe.
(If you copy the progress bars [I]please[/I] make them sparse though. MALU's show which episodes are available by the one with the highest number.)
[editline]7th April 2015[/editline]
[QUOTE=Berkin;47472668]You could use [URL="http://www.newtonsoft.com/json"]Json.NET[/URL] to cache the results. It's extremely easy to learn and set up. It also has a NuGet package, so you can install it from the package manager console.[/QUOTE]
Isn't there something that does this but with a binary file format?
[editline]7th April 2015[/editline]
[QUOTE=adnzzzzZ;47472670][...] automatically download torrents from clicking on an episode (or automatically downloading an entire series) [...][/QUOTE]
Turn the whole torrent integration into a plugin you can disable completely though, like the one in MALU.
Last time I checked rights holders in Germany were rather quick on getting their attorneys involved, so I'd rather disable it completely and not have it show up non-functionally in the UI.
[editline]7th April 2015[/editline]
[QUOTE=Gmod4ever;47473067]So I've been meaning to write a utility for sorting images into categories for a while. Finally got around to doing it.
[...][/QUOTE]
Most image formats support tagging, so you could make it possible to manage those from your program.
Other image organisers like Picasa should pick them up then, if I'm not mistaken.
[QUOTE=Gmod4ever;47473067]So I've been meaning to write a utility for sorting images into categories for a while. Finally got around to doing it.
[vid]http://a.pomf.se/ijiqud.mp4[/vid]
The UI is still work in progress. Some of the buttons on the right-hand side have been deprecated with controls in the form elements, and then I still need to add the keyboard controls. I intend to have the up/down keys cycle through the images that are currently being viewed, with the left-arrow key adding it to the selected categories, and right-arrow key removing from the categories.
If I can figure it out, I would [b]also[/b] like to have tab cycle between the categories and the images, so I can have dual-functionality: if the categories are selected, up/down would cycle through the categories, right-arrow would set the category as being viewed, and the enter key would toggle the category as being selected.
Basically, I want to add power-user controls, and completely eliminate the use of the mouse for those who prefer the keyboard, or who intend to only have a few simple categories.
Next, though, I am going to work on saving and loading. It will most probably just save out to JSON a structure of category -> filepaths, since those are more or less the only relevant elements amongst my data-structures.
I'd say this isn't too bad for being done in under four hours, though. Especially since I had never touched Windows Forms before. Visual C# really made this painless.
[editline]fish[/editline]
Ooh, I just thought of another useful feature: an Export option, that will prompt for a root directory. Once provided, it will create a subfolder for each selected category, and then put copies of the images into each respective folder.[/QUOTE]
You don't need to still be using VS express any more, [url]https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx[/url] community is basically pro but free so you can use addons and such.
It's like some broken sharpen filter :v:
(What if you take top (max) and bottom (min) pixel and make average of it?)
[IMG]http://i.imgur.com/zwPAwAa.jpg[/IMG]
banned in Australia
I need a duplicate image finder to clean up my wallpaper collection, was about to start programming one but I thought I remembered seeing one on WAYWO a while back. Did that ever flesh out? Or should I go ahead with mine?
[editline]xx[/editline]
There's a few on github, but they look for pixel-perfect matches. Sometimes I have duplicates where one is PNG and the other is JPG... So looking for a fuzzy match.
After an interesting conversation with a friend of mine about randomness and probabilities, I made [URL="https://github.com/Spanfile/Pickle"]Pickle[/URL], a simple library for picking objects from a list based on set probabilities for each item.
Here's an example program:
[code]
enum MyEnum
{
Item1,
Item2,
Item3,
Item4
}
...
// create a new picker that returns MyEnums
Picker<MyEnum> picker = new Picker<MyEnum>();
// add the four enum values to it with their probabilities as percentages
picker.AddItem(MyEnum.Item1, 50);
picker.AddItem(MyEnum.Item2, 20);
picker.AddItem(MyEnum.Item3, 15);
picker.AddItem(MyEnum.Item4, 15);
// take a value from the picker and display it
MyEnum item = picker.NextItem();
Console.WriteLine("You got {0}!", item);
Console.ReadKey();
[/code]
[QUOTE=Tamschi;47473139]They are essentially just fractional powers for the prime factors.
Of course you need a symbol to store [I]exp(x, y)[/I], but for normal numbers you can just set y to a whole number and use the same "special case".
You definitely need to use exact fractions for this though, [I]float[/I] precision is usually enough but it can still fail pretty badly.
When you print it out you can simply split it into the whole and fractional part again to make it look a bit nicer.
[/QUOTE]
I was more wondering about how to handle symbolic calculations before I get into handing the numbers themselves. I guess this conversation is better suited for the help thread, so I'll go there.
[img]http://i.imgur.com/RqKNG1z.jpg[/img]
The first, very early version of [url=https://www.youtube.com/watch?v=62XVG60i364]my game[/url] is now available here: [url]https://www.dropbox.com/s/d6l22ztiznvffos/TheBricksperience.rar?dl=1[/url]
There are only four models right now. First I have to see if the community likes the concept else it might be not worth the effort.
[QUOTE=Tamschi;47473139]Isn't there something that does this but with a binary file format?[/QUOTE]
[url=http://www.newtonsoft.com/json/help/html/SerializeToBson.htm]You could use BSON serialization (Binary Json)[/url]
I built a pattern-building pattern in [URL=https://github.com/MathiasPius/Pattern]Pattern[/URL] and built a pattern that matches matches as 'match':
[cpp]
// Define the pattern
std::string pattern_definition = "+([Tordenskjold|DiamondStrike|Diamond|Strike]:match)";
// This generates an AST-like structure that describes the pattern
auto pattern = root(pattern_definition.begin(), pattern_definition.end());
// This creates the actual expr object to be used for matching
auto built_pattern = do_root(pattern.second.children[0]);
std::string second = "TordenskjoldStrikeDiamondStrikeDiamondTordenskjold";
// Apply the pattern
auto applied = built_pattern(second.begin(), second.end());
// Dump the results
applied.second.label = "results";
print_result(applied.second);
[/cpp]
Outputs:
[code]
results:
match: Tordenskjold
match: Strike
match: DiamondStrike
match: Diamond
match: Tordenskjold
[/code]
Yep...
[editline]7th April 2015[/editline]
The pattern-building pa-- You get the idea, can be found here: [url]http://pastebin.com/78FL474C[/url]
I moved my data generation over to F# because it lets me do more crazy stuff.
There is also support for generation of arbitrary union types. The generator is automatically constructed.
Here's an example.
[img]http://i.imgur.com/vbDsThu.png[/img]
[editline]7th April 2015[/editline]
It also, somewhat surprisingly, works for built in lists. I guess they really are implemented as plain cons lists in the background.
[img]http://i.imgur.com/oXp46kv.png[/img]
Darwin, I shall come to Croatian sea sometime with my laptop and I shall handcuff you and squeeze every functional knowledge out of you.
[QUOTE=Fourier;47476305]Darwin, I shall come to Croatian sea sometime with my laptop and I shall handcuff you and squeeze every functional knowledge out of you.[/QUOTE]
I'm actually much closer than you think.
[QUOTE=Berkin;47472668]You could use [URL="http://www.newtonsoft.com/json"]Json.NET[/URL] to cache the results. It's extremely easy to learn and set up. It also has a NuGet package, so you can install it from the package manager console.[/QUOTE]
I was originally using a API wrapper someone else had written (TMDBLib) which worked but had some quirks that were making things difficult for me. You inspired me to scrap that entirely and I spent the last few hours writing all the HTTP requests and JSON handling myself. Everything is a lot cleaner and I feel more confident about the project continuing.
You were right about Json.NET being simple to use. I was able to just write new constructors for Series, Season, and Episode and it all worked out.
[CODE]public Series(JObject json)
{
Name = (string) json["name"];
Id = (int) json["id"];
JToken[] jSeasons;
try
{
jSeasons = json["seasons"].ToArray();
}
catch (Exception)
{
Console.WriteLine(@"Partial series found");
return;
}
Seasons = new ObservableCollection<Season>();
foreach (var jSeason in jSeasons)
{
Seasons.Add(new Season(Id, jSeason));
}
}
...
public Season(int seriesId, JToken jSeason)
{
SeasonNumber = (int) jSeason["season_number"];
Episodes = new ObservableCollection<Episode>();
jSeason = RequestHandler.MakeCall(String.Format("tv/{0}/season/{1}", seriesId, SeasonNumber));
if (jSeason == null) return;
var jEpisodes = jSeason["episodes"].ToArray();
foreach (var jEpisode in jEpisodes)
{
Episodes.Add(new Episode(jEpisode));
}
}
..
public Episode(JToken episodeData)
{
Name = (string) episodeData["name"];
Id = (int) episodeData["id"];
EpisodeNumber = (int) episodeData["episode_number"];
Info = new ObservableCollection<string> { (string) episodeData["overview"] };
try
{
AirDate = DateTime.Parse((string) episodeData["air_date"]);
}
catch (Exception)
{
Console.WriteLine(@"No air date");
}
Watched = false;
}
[/CODE]
Now caching the data will be much less of a hassle.
I've been messing about with Roslyn to automatically generate bindings for the C# pinvoke wrapper for Duktape. Duktape has nice yaml based documentation, and each function has a prototype, [url]https://github.com/svaarala/duktape/tree/master/website/api[/url] . By taking the prototypes from these, and some horrible C# code using Roslyn and some bad parsing of C, I have managed to spit out [url]https://gist.github.com/benpye/51a52eba12f8b8a1aab2[/url] a C# wrapper that will manage the marshalling of UTF8 strings and can also have certainly parameters mapped to specific types, in addition to a global type map, and [url]https://gist.github.com/benpye/b78f96b5444b74a45ee9[/url] which is a C wrapper around all the functions that allows me to access the public API despite some functions actually being macros. Roslyn kinda suffers with a lack of documentation for the code generation though, and so some things gave unexpected results, such as all my code being enclosed in {} . If anyone cares you can see the mess of code that does this [url]https://github.com/benpye/Automate/blob/2f2e5a1229ac58aab6a37012671bc055d62c2310/DukSharp.BindingGen/PinvokeGenerator.cs#L187[/url]
Also, YamlDotNet sucks
[CODE]var deserializer = new Deserializer(namingConvention: new CamelCaseNamingConvention());
var protos = fileContents.Select(f => (deserializer.Deserialize<ExpandoObject>(new StringReader(f)) as IDictionary<string, object>)["proto"].ToString().Replace("{", "").Replace("}", ""));[/CODE]
[QUOTE=Sidneys1;47474251]I need a duplicate image finder to clean up my wallpaper collection, was about to start programming one but I thought I remembered seeing one on WAYWO a while back. Did that ever flesh out? Or should I go ahead with mine?
[editline]xx[/editline]
There's a few on github, but they look for pixel-perfect matches. Sometimes I have duplicates where one is PNG and the other is JPG... So looking for a fuzzy match.[/QUOTE]
I made dis: [url]https://github.com/ApexWeed/WallChanger[/url]
It won't change the wallpaper if you just use the library view but I wouldn't recommend using the delete buttons because I'm not 100% convinced that it deletes the right image. It has some tolerance for difference so it will detect a png and jpg or different sized images.
You can now write a static `arbitrary` function that provides a generator for your type and the automatic generator construction will take your custom generator instead of deriving a new one.
This was way harder that it should have been. The first time I had to fight the type system AFTER I gave up on it and `(object)`ed everything.
This code now works
[code]type Color = Red | Green | Blue with
static member arbitrary(_ : Color) = Gen.constant Red
type Test = {
X : Color
Y : Option<bool>
}
[<EntryPoint>]
let main argv =
let test = Derive.gen<Test> ()
printfn "%A" (ImmutableRandom.fromSeed 9 |> Gen.runGen (Gen.listOf test 20))[/code]
Normally, the X property of the Test record would vary between Red, Green and Blue, but the deriving mechanism sees that the Color type has the `arbitrary` function and uses it instead.
[code][{X = Red; Y = Some true;}; {X = Red;
Y = Some true;}; {X = Red;
Y = Some true;}; {X = Red;
Y = null;};
{X = Red;
Y = Some false;}; {X = Red;
Y = null;}; {X = Red;
Y = Some false;}; {X = Red;
Y = Some true;};
{X = Red;
Y = null;}; {X = Red;
Y = null;}; {X = Red;
Y = Some true;}; {X = Red;
Y = null;}; {X = Red;
Y = Some false;};
{X = Red;
Y = null;}; {X = Red;
Y = null;}; {X = Red;
Y = Some false;}; {X = Red;
Y = Some false;}; {X = Red;
Y = null;};
{X = Red;
Y = Some true;}; {X = Red;
Y = Some false;}][/code]
I hate it when I have these ideas flowing through my head, but I can't think of how to put them into action.
[QUOTE=ryan1271;47476911]I was originally using a API wrapper someone else had written (TMDBLib) which worked but had some quirks that were making things difficult for me. You inspired me to scrap that entirely and I spent the last few hours writing all the HTTP requests and JSON handling myself. Everything is a lot cleaner and I feel more confident about the project continuing.
You were right about Json.NET being simple to use. I was able to just write new constructors for Series, Season, and Episode and it all worked out.
[CODE]public Series(JObject json)
{
Name = (string) json["name"];
Id = (int) json["id"];
JToken[] jSeasons;
try
{
jSeasons = json["seasons"].ToArray();
}
catch (Exception)
{
Console.WriteLine(@"Partial series found");
return;
}
Seasons = new ObservableCollection<Season>();
foreach (var jSeason in jSeasons)
{
Seasons.Add(new Season(Id, jSeason));
}
}
...
public Season(int seriesId, JToken jSeason)
{
SeasonNumber = (int) jSeason["season_number"];
Episodes = new ObservableCollection<Episode>();
jSeason = RequestHandler.MakeCall(String.Format("tv/{0}/season/{1}", seriesId, SeasonNumber));
if (jSeason == null) return;
var jEpisodes = jSeason["episodes"].ToArray();
foreach (var jEpisode in jEpisodes)
{
Episodes.Add(new Episode(jEpisode));
}
}
..
public Episode(JToken episodeData)
{
Name = (string) episodeData["name"];
Id = (int) episodeData["id"];
EpisodeNumber = (int) episodeData["episode_number"];
Info = new ObservableCollection<string> { (string) episodeData["overview"] };
try
{
AirDate = DateTime.Parse((string) episodeData["air_date"]);
}
catch (Exception)
{
Console.WriteLine(@"No air date");
}
Watched = false;
}
[/CODE]
Now caching the data will be much less of a hassle.[/QUOTE]
Null propagation will make Json.NET a lot more fun to use!
Just added proper Progress<T> and IProgress<T> support to the MVVM in BatchImageProcessor. All very exciting, but it took me an hour to implement a taskbar progressbar. Why, you ask? That's like two lines of code, you say? Yes, yes it is. But no matter what I did it would not work. I tried the TaskbarItemInfo. I tried Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager. Nothing. I streamlined my threading, made things async/awaitable, used Invoke... Nothing.
Then I realized that Windows 10 only shows the progressbar if the window is inactive.
:suicide:
[editline]xx[/editline]
On the plus side, the CLI now has progress reporting :v:
On that topic, since this is a WPF app I have to do some funky API calls to attach the console to the CLI... There's an API method to attach to an existing console with a specific argument to attach to the parent process (-1 instead of PID), but when I do the console prompt shows between every Console.Write() and Console.Read()... So for now I create a new console window which works perfectly, it's just annoying. Changing the project type to Console App means a console window shows when it starts in GUI mode. Anyone have a solution to either one of these problems?
I made a thingy
[vid]http://puu.sh/h5HEW/57359df284.webm[/vid]
working on making a badguy to beat up next
[img]http://puu.sh/h5IDO/2810027034.png[/img]
[QUOTE=Sidneys1;47479381]On that topic, since this is a WPF app I have to do some funky API calls to attach the console to the CLI... There's an API method to attach to an existing console with a specific argument to attach to the parent process (-1 instead of PID), but when I do the console prompt shows between every Console.Write() and Console.Read()... So for now I create a new console window which works perfectly, it's just annoying. Changing the project type to Console App means a console window shows when it starts in GUI mode. Anyone have a solution to either one of these problems?[/QUOTE]
[url]http://www.pinvoke.net/default.aspx/kernel32/AllocConsole.html[/url]
I started writing an analogous version of my patterns using templates instead of lambdas, because the constant indirection caused by lambdas seemed to be the primary bottleneck in the project before, apart from the way searches were conducted.
The downsides to this are that I can't construct patterns are run-time (like in my previous post), and I'm stuck with doing pattern matching on the fundamental types like integers, chars, etc.. Oh yeah, and the errors are a lot more cryptic.
Nevertheless, I have managed to get the following example working:
[cpp]
int main()
{
struct mult_expr : public absorb<sequence <
absorb<select<is_digit>>,
select<exact<'*'>>,
any_of<
mult_expr,
absorb<select<is_digit>>
>
>> {};
std::string in = "1*2*3";
auto result = mult_expr{}.match(in.begin(), in.end());
print_result(result.second);
return 0;
}
[/cpp]
[code]
: *
: 1
: *
: 2
: 3
[/code]
Yay, students now get Xamarin Visual Studio support [url]http://blog.xamarin.com/xamarin-for-students-expands-to-visual-studio/[/url] . Pretty much exactly my complaint the other day, though it seems you may have to reapply to get an updated license?
I did some more work on my Cartoon Shooter. Added an editable tile based level and a simple enemy with pathfinding.
[video=youtube;r6qekts2mOE]http://www.youtube.com/watch?v=r6qekts2mOE[/video]
Sorry, you need to Log In to post a reply to this thread.