|
Weird German B and weird Turkish I/i are essential parts of any text processing toolkit.
|
# ? Feb 2, 2019 09:58 |
|
|
# ? Jun 8, 2024 01:19 |
|
EssOEss posted:Sure. But I want to emphasize that I think that is only a small aside to the real issue - using letter-case APIs for comparison is bad software design already on general principles, even if they worked the same. That's a useful demonstration, thanks. Mr Shiny Pants posted:That is nice, I forgot about the umlaut. You mean the "ß"? That's a "sharp S" or Eszett. "Umlaut" is an alternative name for the diaeresis accent (two dots over a letter).
|
# ? Feb 2, 2019 14:39 |
|
SimonChris posted:In that case, I would make one API endpoint that returns a list of CharacterListItemDTO's for the listbox, and another endpoint that return a FullCharacterDTO, with all character data, including navigation properties. The latter endpoint would .Include() the navigation properties, whereas the former would just ignore them. That’s the direction I was heading. My DAL classes have Insert, Update and Delete methods, along with a Get method which returns an observable collection and a Read method which returns a single object (and some miscellaneous methods like RaceHasCharacters(int raceId) which is used to determine whether a race can be deleted). I’m thinking in this instance, Get returns a collection of CharacterDTO objects, where Read returns a FullCharacterDTO object. Edit: upon reflection, I think that will work pretty well. My homebrew mapping class copies properties based on the DTO class, so both DTO classes can get mapped from the same entity class, if I put all the navigation properties on the entity. Just need to make sure I .Include the right ones to avoid ContextDisposedExceptions. LongSack fucked around with this message at 01:11 on Feb 3, 2019 |
# ? Feb 3, 2019 00:58 |
|
Hammerite posted:You mean the "ß"? That's a "sharp S" or Eszett. "Umlaut" is an alternative name for the diaeresis accent (two dots over a letter). Crap, you are right.
|
# ? Feb 3, 2019 09:36 |
|
After giving up on trying to deal with WPF years ago, now I'm trying to get my head around MVVM and had a question about XAML and binding. Well, it's more of an intellisense question. It seems like intellisense works in some places, and not in others. For example, if I wanted to bind a TextBox to a property in my view model, I can use either of these methods, and I get full intellisense. When I type "Ti", I see the TileWidth property from my view model. code:
code:
|
# ? Feb 3, 2019 18:45 |
|
I last used XAML a few years ago but yes, it was definitely like that back then - intellisense worked very much part-time only. Just a part of working with XAML, unfortunately.
|
# ? Feb 3, 2019 20:32 |
|
Oh well, at least it does what I need it to do. Now my biggest issue is that the framerate is terrible on my 144Hz G-sync monitor. I enabled my monitor's on screen refresh rate display. Just moving the mouse cursor around when the window has focus and it averages between 30-40fps. It looks so janky. Click on the desktop and it's back to 144. If I move the window to my secondary monitor (60Hz), it runs at 60fps and looks smooth. Edit: Apparently this is a bug with using the G-sync for windowed and full screen mode setting. If I change to full screen only, then WPF apps are nice and smooth. I think WPF is trying to draw as few frames as necessary when nothing's happening. If I give it focus and don't touch anything, the fps slowly drops until it gets to 2, causing the monitor to drop its refresh rate to match. GI_Clutch fucked around with this message at 01:25 on Feb 4, 2019 |
# ? Feb 3, 2019 22:01 |
|
I'm a teacher trying to share my VB projects with young learners so they can modify it. Which files are actually important and which will be re-generated on running? The projects will be Windows Form or maybe Console Applications. I'm thinking... \NameOfMyProject \NameOfMyProject\NameOfMyProject.sln \NameOfMyProject\NameOfMyProject\*.vb, *.vbproj, *.config, *.resx \NameOfMyProject\NameOfMyProject\My Project\* And then delete the bin and obj folders which if I'm understanding are created at compilation and are specific to the computer it was built on anyway?
|
# ? Feb 6, 2019 10:02 |
|
If you ask Visual Studio to create a Git repository with a new project, it will create a .gitignore file that lists all the types of stuff that should not be uploaded to a code repository. You can use that as a reference.
|
# ? Feb 6, 2019 10:36 |
|
If you're able to just do everything through version control, it has the added bonus of getting new programmers into the habit of using it as a part of their workflow right away. Visual Studio has a decent GUI for Git so they don't have to tackle the command line if that's something you want to avoid. If you need the repos to be private, GitHub now has free private repos that allow up to 3 contributors, and Bitbucket allows private repos with up to 5.
|
# ? Feb 6, 2019 14:50 |
|
As far as I can tell, Azure's free offering can't be beat (unlimited free private git repos + lfs with devops)
|
# ? Feb 6, 2019 14:53 |
|
EssOEss posted:If you ask Visual Studio to create a Git repository with a new project, it will create a .gitignore file that lists all the types of stuff that should not be uploaded to a code repository. You can use that as a reference. This may be the same one but I always use the VisualStudio.gitignore hosted here: https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
# ? Feb 6, 2019 17:13 |
|
Is there a way to repeat a call to an async method when it completes? Here's a quick bit of pseudocode that illustrates what I'm trying to accomplish. Essentially, I just want a callback when my ParsePageAsync method completes that stores the result and fires up the method again on the same object. It looks like I could potentially do this with ContinueWith but I'm not sure exactly how to go about that. code:
|
# ? Feb 6, 2019 17:25 |
|
BIGFOOT EROTICA posted:Is there a way to repeat a call to an async method when it completes? Based on your comment: code:
|
# ? Feb 6, 2019 18:04 |
|
It seems like there would be abetter way to go about it than just having a big blocking while(true) that checks each task constantly to see if it has completed.
|
# ? Feb 6, 2019 18:17 |
|
BIGFOOT EROTICA posted:It seems like there would be abetter way to go about it than just having a big blocking while(true) that checks each task constantly to see if it has completed. Why would it have to be an infinite loop? while (<thing still has data>) { await <grab something and process it> } It's not blocking, because you're awaiting the result.
|
# ? Feb 6, 2019 19:02 |
|
Right but I don't just have one object making these requests, i have 10 (or however many) that each have different sessions/cookies etc for scrapingcode:
I could do code:
|
# ? Feb 6, 2019 19:55 |
|
BIGFOOT EROTICA posted:Right but I don't just have one object making these requests, i have 10 (or however many) that each have different sessions/cookies etc for scraping Inside of the doasync() method, put the while loop around whatever async logic you want to continue.
|
# ? Feb 6, 2019 20:15 |
|
Yeah I think you're overthinking this:C# code:
|
# ? Feb 6, 2019 21:00 |
|
Trying to learn EF Core / .NET Core, so I'm picking a fairly simple project to get started: A time tracking / reporting system. It's going pretty well so far, but I've run up against a bit of a roadblock. I want to produce a time report based on a date range and aggregating all the hours by category (project), so that when my boss ask me "How many hours did you spend on project Foo in February" i can spit out the numbers. Using LINQ and EF Core 2.1, and I can't quite figure out how to translate this SQL query (ignore the aliases): SQL code:
C# code:
is it doable? Or should I seek a different method (i.e., just load up all the time entries then work on aggregating / totaling them "manually") TIA
|
# ? Feb 6, 2019 22:04 |
|
LongSack posted:Trying to learn EF Core / .NET Core, so I'm picking a fairly simple project to get started: A time tracking / reporting system. It's going pretty well so far, but I've run up against a bit of a roadblock. I want to produce a time report based on a date range and aggregating all the hours by category (project), so that when my boss ask me "How many hours did you spend on project Foo in February" i can spit out the numbers. Question as an aside from the actual problem you're trying to solve: Is there a reason you're building your own time tracking software when there are literally dozens of applications that handle time tracking already? If it's just for education, that's fine, but if you're seriously rolling your own home-grown time tracking system for your job with the intent of using it for real, then ew.
|
# ? Feb 6, 2019 22:15 |
|
New Yorp New Yorp posted:Question as an aside from the actual problem you're trying to solve: It’s all about learning. To learn stuff (for me, at least), I need to come up with some concrete problem to solve, then solve it. But if you’re asking me whether I use my programs after writing them, then yes, I do. Primarily for two reasons: one, they do exactly what I need them to do, precisely how I need them to do it; and two, only by using them can I figure out what mistakes I’ve made.
|
# ? Feb 7, 2019 01:42 |
|
LongSack posted:It’s all about learning. To learn stuff (for me, at least), I need to come up with some concrete problem to solve, then solve it. But if you’re asking me whether I use my programs after writing them, then yes, I do. Primarily for two reasons: one, they do exactly what I need them to do, precisely how I need them to do it; and two, only by using them can I figure out what mistakes I’ve made. What you're doing right now is called "reinventing the wheel". It's a tremendous waste of time. If you're trying to solve the problem of "I need to track time spent on projects", then the solution is "spend 30 minutes finding a good time tracking application", not "spend dozens if not hundreds of hours writing my own bespoke time tracking application".
|
# ? Feb 7, 2019 02:54 |
|
LongSack, you are "reinventing the wheel", but I'd only go so far as to say it's a tremendous expenditure of time. Only you can judge if that time is worth it to you personally. (I also think it's probably not going to be worth it, but I'm just some guy on the internet, what do I know about what you value )
|
# ? Feb 7, 2019 03:16 |
|
You both miss the point. The point isn’t finding a time tracking app, that’s trivially easy. The point is writing a program that solves a problem and allows me to learn in the process. Edit: in case I’m not clear, the point isn’t the program, although they are all useful and I use them daily. The point is the process. The design, the coding, the debugging. The learning. As an example, the first version of my character portfolio app literally had methods that moved data from the screen fields to the database entity fields and back because I did not understand data binding. By version 10, I have learned a lot, including data binding, value converters, MVVM, and so much more. That is the point. All it costs is time, and if I’m learning, then it’s not wasted time. LongSack fucked around with this message at 05:01 on Feb 7, 2019 |
# ? Feb 7, 2019 04:50 |
|
Whenever I have tried to do "GROUP BY" with EF Core, it has just given up. I think the EF Core "code to SQL" translations only work on the most basic cases. For complex queries I just define views. Note that by default EF Core will give up on many queries, download the entire table and then perform the operation on the client side. You will want to ensure that you configure it to throw an exception when it tries to do this.
|
# ? Feb 7, 2019 06:35 |
|
EssOEss posted:Whenever I have tried to do "GROUP BY" with EF Core, it has just given up. I think the EF Core "code to SQL" translations only work on the most basic cases. For complex queries I just define views. Ok, so maybe for this instance, I fall back to ADO..
|
# ? Feb 7, 2019 06:50 |
|
EssOEss posted:Whenever I have tried to do "GROUP BY" with EF Core, it has just given up. I think the EF Core "code to SQL" translations only work on the most basic cases. For complex queries I just define views. SQL is a drat-near perfect language for what it does. This is supported by the fact that it remains, largely unchanged, one of the few languages out there that's both still in wide use and older than most software engineers. Sure, manually advancing a DataReader and assigning object properties from columns is boring an tedious, but that's why micro-ORMs exist. Building complex and efficient queries is a bit of an art, and someone even remotely competent with SQL can do a much better job than EFs bumbling, UNION ALL(UNION ALL(UNION ALL) )
|
# ? Feb 7, 2019 15:22 |
|
New Yorp New Yorp posted:What you're doing right now is called "reinventing the wheel". It's a tremendous waste of time. Reinventing the wheel is perfectly appropriate if you're studying wheel design.
|
# ? Feb 7, 2019 16:49 |
|
raminasi posted:Reinventing the wheel is perfectly appropriate if you're studying wheel design. Yeah I'm on Long Sack's side here, this is basically how I learn too.
|
# ? Feb 7, 2019 18:22 |
New Yorp New Yorp posted:What you're doing right now is called "reinventing the wheel". It's a tremendous waste of time. Why even work as a dev? Most things have already been written by someone, somewhere, to varying degrees of completeness.
|
|
# ? Feb 7, 2019 18:50 |
|
I've worked at and consulted at enough places where NIH syndrome resulted in everyone struggling to use clunky bespoke software that poorly implements a subset of the functionality of any number of robust, SaaS offerings.
|
# ? Feb 7, 2019 19:54 |
Good thing the original question wasn't "which robust saas time tracking app we can use in our company", then? It's not a particularly complex idea and a cool project to learn things on.
|
|
# ? Feb 7, 2019 20:04 |
|
New Yorp New Yorp posted:I've worked at and consulted at enough places where NIH syndrome resulted in everyone struggling to use clunky bespoke software that poorly implements a subset of the functionality of any number of robust, SaaS offerings. Despite my objections, I authored and maintain a clunky bespoke time tracking / ticketing system at my job and this entire topic touches my very soul. Also more power to Long Sack, let he who has not written a blog throw the first exception
|
# ? Feb 7, 2019 21:48 |
|
Potassium Problems posted:Despite my objections, I authored and maintain a clunky bespoke time tracking / ticketing system at my job and this entire topic touches my very soul. Also more power to Long Sack, let he who has not written a blog throw the first exception Back in the 90s I wrote my own CMS (powered by PHP, front end Javascript, worked by altering the raw HTML files on the server's disk) and I still like it better than any others...
|
# ? Feb 7, 2019 21:52 |
|
I made an EDI parser in Bash way back in the day using regex and I'm still pretty sure it's being used at that organization to extract order numbers called in a CRON job, despite them having an existing web application that does the same thing.
|
# ? Feb 7, 2019 22:41 |
|
I have a really annoying problem that I cannot wrap my head around. I have an interface that constructs concrete classes. I need to create a class that provides new instantiations of a given concrete implementation of the interface based on the string name of the concrete implementation. So the class should look like: [code=C#] class IConstructorFactory() { public IModelConstructor<IModel> GetModelConstructor(string modelConstructorName) } [/code} [code=C#] class ConstructorFactory(string typeName) : IConstructorFactory { public ModelConstructor<IModel> GetModelConstructor(string modelConstructorName) { //what is needed to return a new instance of new ModelConstructorName<IModel>(); } } [/code} What am I missing here? edit: I guess that didn't work edit2:updated names to make more sense and fixed syntax problems downout fucked around with this message at 05:33 on Feb 9, 2019 |
# ? Feb 9, 2019 05:31 |
|
downout posted:I have a really annoying problem that I cannot wrap my head around. I have an interface that constructs concrete classes. I need to create a class that provides new instantiations of a given concrete implementation of the interface based on the string name of the concrete implementation. So the class should look like: Not sure if this is your use case (I don't actually know why you need to load a class via string), but you can use reflection to get a type from a string and instantiate it e.g. code:
|
# ? Feb 9, 2019 06:20 |
|
Bruegels Fuckbooks posted:Not sure if this is your use case (I don't actually know why you need to load a class via string), but you can use reflection to get a type from a string and instantiate it The class has to load via string because the class that uses the class only has the string value to identify the type. Unless there is some way I'm missing that the type can be "registered" or recorded. That said the "Activator.CreateInstance" method you provided doesn't actually compile when using interfaces which is kind of the problem. The class that needs the new instantiation doesn't know the model or constructor and can only "get" it by the name of the model or constructor type. It's possible I'm missing some construction of <T> that would fix this. At runtime the client knows the type of those two details.
|
# ? Feb 9, 2019 06:36 |
|
|
# ? Jun 8, 2024 01:19 |
|
downout posted:The class has to load via string because the class that uses the class only has the string value to identify the type. Unless there is some way I'm missing that the type can be "registered" or recorded. That said the "Activator.CreateInstance" method you provided doesn't actually compile when using interfaces which is kind of the problem. The class that needs the new instantiation doesn't know the model or constructor and can only "get" it by the name of the model or constructor type. It's possible I'm missing some construction of <T> that would fix this. At runtime the client knows the type of those two details. code:
[edit] this still smells like a design problem, specifically a dependency inversion problem. Nothing should be "asking" for a specific type. The specific type should be determined and provided by the askee. New Yorp New Yorp fucked around with this message at 15:16 on Feb 9, 2019 |
# ? Feb 9, 2019 15:08 |