|
Drastic Actions posted:The easiest thing to fix right now is getting rid of hard coded strings and putting them into the resources files. They originally did not have any and everything was hard coded into English in the XAML. I built the English and Japanese Resw files DON'T USE RESW DIRECTLY! You should have the single primary language in RESW, and then use XLF files (from the Multilingual App Toolkit) for all other languages. XLF+MAT is the only sane way to manage your translation workflow.
|
# ? Aug 28, 2014 16:33 |
|
|
# ? May 15, 2024 20:05 |
|
ljw1004 posted:DON'T USE RESW DIRECTLY! My PSN FoulPlay app use XLF, but they won't let me use it here. From what I recall you have to install the Multilingual Toolkit if it's being used, they did not want to have contributors have to install more extra tools just to compile the app (considering I'm the only one at this point who cares about localization). Nevermind the fact that they don't really have any contributors, but whatever. I'm not sure if there was any other reasons not to. But yeah, XLF and the toolkit make it much easier to actually handle updating everything. I should start pushing for it again. And also note, these are people who won't update the C++ VCLibs up to version 12, because it causes issues with the app validation and instead of trying to fix it just use the unsupported 11. I just roll with it at this point.
|
# ? Aug 28, 2014 16:47 |
|
I still don't know LINQ to SQL for poo poo.code:
Furthermore, I'm not quite sure how to make it into a nice easy to handle associative array to serialize for some knockout for a selectedOptions binding. XYProblem Explanation: I've got a big hunk of lovely data. Meh. I want to allow the user to select a bunch of "types" to help drill down queries. Most of the types in the types table are never used. So, select distinct on the actual table of crap, find the unique types that are actually used, join them on the type table to see the description of them, pass that to user. Also, a lot of the types are duplicated - there are three which are categorized as "File", three as "FILE," etc. Input validation didn't occur to anyone apparently! Trying to help drill down with that might be fun. I figure I just might let the user select "File" and just return for all 3 types that match, etc. Nobody has any documentation about it, they just want it to work. Soon. I usually use sprocs and ADO.net, but figured I might as well use a little LINQ and make use of the EF scaffolding this project has in it, as I've never done it before and thought I might learn some new things. I'll get a LINQ book (or just a good .net book) tomorrow when I finally get that first direct hire paycheck Fuck them fucked around with this message at 19:34 on Aug 28, 2014 |
# ? Aug 28, 2014 19:29 |
|
gently caress them posted:I still don't know LINQ to SQL for poo poo. Pedantic terminology note: LINQ to SQL is not interchangeable with Entity Framework, they are similar-but-different ORM platforms. L2S is dead, EF is not. You probably mean LINQ to Entities.
|
# ? Aug 28, 2014 19:33 |
|
Ithaqua posted:Pedantic terminology note: LINQ to SQL is not interchangeable with Entity Framework, they are similar-but-different ORM platforms. L2S is dead, EF is not. You probably mean LINQ to Entities. I'm the only one here who actually cares about staying current at all, so that's actually useful knowledge to have for when I decide to take the next step and leave this bubble!
|
# ? Aug 28, 2014 19:36 |
|
gently caress them posted:I still don't know LINQ to SQL for poo poo. If you're using Entity Framework here is an example of a Linq query that does a lot of what you need to do: code:
code:
Knyteguy fucked around with this message at 19:41 on Aug 28, 2014 |
# ? Aug 28, 2014 19:38 |
|
I think stopping to take a break helped me get it. FIGURES.code:
I really need to nag work into getting me a linqpad license.
|
# ? Aug 28, 2014 19:41 |
|
gently caress them posted:I think stopping to take a break helped me get it. FIGURES. Ah sorry forgot it was VB.
|
# ? Aug 28, 2014 19:43 |
|
Knyteguy posted:Ah sorry forgot it was VB. I'd like to forget it is too
|
# ? Aug 28, 2014 19:45 |
|
Holy poo poo the generated SQL from this: http://pastebin.ca/2836448
|
# ? Aug 28, 2014 19:59 |
|
Do you need every property from both of the joined tables?
|
# ? Aug 28, 2014 20:07 |
|
That generated SQL isn't that bad (other than obviously the SELECT *--you probably don't need every column), it just boils down to this:code:
|
# ? Aug 28, 2014 20:10 |
|
Yeah, every time I see columns with Something1, Something2, Something3 that usually indicates a normalization problem.
|
# ? Aug 28, 2014 20:29 |
|
Am I the only one who thinks chaining dot-notation function calls is a gently caress of a lot easier to read? Or is that my C++ background showing? C# code:
|
# ? Aug 29, 2014 04:39 |
|
I think it is, until you want a bunch of range variables sugared. VB makes it more awkward, though - it doesn't allow you to place the periods at the beginnings of lines like that.
|
# ? Aug 29, 2014 05:37 |
|
Ciaphas posted:Am I the only one who thinks chaining dot-notation function calls is a gently caress of a lot easier to read? Or is that my C++ background showing? Nope, I was writing sql for years before linq was a thing, and I just don't like the way it looks. I always get tangled up mentally translating its syntax back to actual sql and it pisses me off to need to hit google for every goddamn query I try to write that way, so I always end up either writing a view for complex joins / selects and doing the dot notation thing like yourself for the basics. I'm lucky in that I'm able to write my own views and procs etc I guess, seems like I might be in the minority in here? Don't know how I'd get on if I wasn't able to do that.
|
# ? Aug 29, 2014 08:44 |
|
I definitely prefer the fluent (dot) notation. It looks cleaner and more structured, everything separated out clearly into methods, which you can order the way you like (for me, that means in a way that's as close to an SQL query as possible, since I'm familiar with those to begin with; Select -> Where -> OrderBy -> etc.). Beyond that, the fluent notation has a bunch of extension methods that do not have an equivalent in the query notation, so if you need any of those, you're using the fluent notation anyway. FirstOrDefault, Take and Skip immediately come to mind. Or you can be a horrible horrible monster and do something like: C# code:
Che Delilas fucked around with this message at 15:50 on Aug 29, 2014 |
# ? Aug 29, 2014 15:46 |
|
I only use the fluent notation because I don't use LINQ for database operations so I figured that if I'm writing C# it might as well actually look like C#.
|
# ? Aug 29, 2014 16:14 |
|
Assuming the resulting IEnumerable or whatever is the same, the order of your fluent-syntax calls doesn't have an effect on performance, does it? Like doing the .OrderBy() before or after the .Select() or whatever?
|
# ? Aug 29, 2014 16:37 |
|
Ciaphas posted:Assuming the resulting IEnumerable or whatever is the same, the order of your fluent-syntax calls doesn't have an effect on performance, does it? Like doing the .OrderBy() before or after the .Select() or whatever? That's a very strong assumption. Can you give an example of when it holds that you're talking about?
|
# ? Aug 29, 2014 16:42 |
|
Ciaphas posted:Assuming the resulting IEnumerable or whatever is the same, the order of your fluent-syntax calls doesn't have an effect on performance, does it? Like doing the .OrderBy() before or after the .Select() or whatever? At least with LINQ to Objects, the answer is "of course it makes a difference." I can't speak to the SQL generated by LINQ to Entities. It's usually fairly smart about that kind of thing, but it's safer to assume it's dumb. Let's say you do this: code:
If you do code:
|
# ? Aug 29, 2014 16:56 |
|
Ithaqua posted:At least with LINQ to Objects, the answer is "of course it makes a difference." I can't speak to the SQL generated by LINQ to Entities. It's usually fairly smart about that kind of thing, but it's safer to assume it's dumb. So, with Linq to Objects, it actually executes each method immediately, rather than waiting for the results to actually be accessed (the way I understand it does with EF)?
|
# ? Aug 29, 2014 16:59 |
|
Che Delilas posted:So, with Linq to Objects, it actually executes each method immediately, rather than waiting for the results to actually be accessed (the way I understand it does with EF)? I don't believe so. code:
|
# ? Aug 29, 2014 17:09 |
|
Ithaqua posted:At least with LINQ to Objects, the answer is "of course it makes a difference." I can't speak to the SQL generated by LINQ to Entities. It's usually fairly smart about that kind of thing, but it's safer to assume it's dumb. That was kind of what I figured, but I wanted to be sure. So much of C# and .NET seems like frank witchcraft to me still
|
# ? Aug 29, 2014 17:13 |
|
epalm posted:I don't believe so. Right. LINQ to Objects methods execute lazily. In the example above, it doesn't start executing the Where or the OrderBy until you start accessing the values in result. New Yorp New Yorp fucked around with this message at 17:21 on Aug 29, 2014 |
# ? Aug 29, 2014 17:18 |
|
gently caress them posted:I think stopping to take a break helped me get it. FIGURES. Change this to: code:
|
# ? Aug 29, 2014 18:13 |
|
Ithaqua posted:Right. LINQ to Objects methods execute lazily. In the example above, it doesn't start executing the Where or the OrderBy until you start accessing the values in result.
|
# ? Aug 29, 2014 18:27 |
|
Sedro posted:OrderBy is a little special because you need to materialize the entire collection in order to produce the first item. It might as well return a list. Right, because it can't know what the first element to return should be until it's reached the last element.
|
# ? Aug 29, 2014 18:49 |
|
How many of you guys use ILSpy? I started using it because it was easier than getting my employer to pay for Reflector licenses and I've always found the UI a bit clunky. I've started using some of my free time to fix issues that I personally have; does anybody else have any grievances that they'd like someone to look at?
|
# ? Aug 31, 2014 02:16 |
|
Smugdog Millionaire posted:How many of you guys use ILSpy? I started using it because it was easier than getting my employer to pay for Reflector licenses and I've always found the UI a bit clunky. I've started using some of my free time to fix issues that I personally have; does anybody else have any grievances that they'd like someone to look at? dotPeek is available for free too.
|
# ? Aug 31, 2014 02:53 |
|
Is there a good way to integrate certain CMS features into an existing site without having to full on use a CMS? I don't want the CMS taking over the site and disrupting what has already been written, I just need a small portion of that site to support say, creating and displaying articles, with the other site pages / part of the homepage undisturbed. Are there libraries out there that make it easy to add these kinds of features into an existing site or is the best way just to write it all myself? I'm using MVC.
|
# ? Sep 1, 2014 16:20 |
|
spiderlemur posted:Is there a good way to integrate certain CMS features into an existing site without having to full on use a CMS? I don't want the CMS taking over the site and disrupting what has already been written, I just need a small portion of that site to support say, creating and displaying articles, with the other site pages / part of the homepage undisturbed. Well, depends what you want to do but maybe you can have the two products communicate with a plain old REST API.
|
# ? Sep 1, 2014 16:29 |
|
spiderlemur posted:Is there a good way to integrate certain CMS features into an existing site without having to full on use a CMS? I don't want the CMS taking over the site and disrupting what has already been written, I just need a small portion of that site to support say, creating and displaying articles, with the other site pages / part of the homepage undisturbed. I think it's possible to convert an existing MVC site into an Orchard module, maybe you could look into that? Or if that's too complicated, why not just make parts of the site dynamically generated, and only provide editors for those specific parts?
|
# ? Sep 1, 2014 16:36 |
|
chmods please posted:I think it's possible to convert an existing MVC site into an Orchard module, maybe you could look into that? If that's all you're looking at it's hard to see what the CMS is really giving you over throwing TinyMCE or something over a textbox.
|
# ? Sep 1, 2014 16:37 |
|
RICHUNCLEPENNYBAGS posted:Well, depends what you want to do but maybe you can have the two products communicate with a plain old REST API. That's what I was thinking about doing initially, so I'll probably just go with that if there's not some other obvious solution I'm not thinking of.
|
# ? Sep 1, 2014 20:04 |
|
If it is basic "we want humans to do formatted text" we have gone with markdown, perhaps with a raw html saftey valve. Much, much cleaner to deal with than the poo poo the rich text editors spit out. Another approach is to use some reverse proxy voodoo to poke holes in the CMS-based site for your app. If the parts are self-contained this works real good. Another thing we are doing a lot of these days is building the custom bits as an mvc specialized content manager serving a web api and then handing the api off to the web hippies to integrate. The main challenge has been that the web hippies suck at specifying what they need to come off the API so you usually get to build that part 3 times. The massive advantage is we can let the web hippies use whatever they want to smoke that week without having to inhale.
|
# ? Sep 2, 2014 22:34 |
|
This is a relatively simple question, but I can't seem to google-fu my way to an answer. I'm reading a CSV file like so:code:
code:
http://social.msdn.microsoft.com/Fo...orum=vblanguage According to the documentation I can find, TextFieldParser should keep going until EOF, since it apparently ignores empty lines. I had thought my IF statement above would skip the offending line(s) and keep beavering on, but apparently not. Has anyone run into something like this and have a solution?
|
# ? Sep 4, 2014 03:41 |
|
Does anyone have any ideas on how to take a querystring like so:code:
code:
Edit: gently caress me, just figured out a way to post this data as json instead, now I don't need to do this at all. 15 years of cutting code and I still miss the basics sometimes! mortarr fucked around with this message at 05:04 on Sep 4, 2014 |
# ? Sep 4, 2014 04:38 |
|
Scaramouche posted:This is a relatively simple question, but I can't seem to google-fu my way to an answer. [snip] It looks like TextFieldParser doesn't actually buy you much in this situation, and is more trouble than it's worth. I'd do it like this: code:
|
# ? Sep 4, 2014 04:51 |
|
|
# ? May 15, 2024 20:05 |
|
mortarr posted:Does anyone have any ideas on how to take a querystring like so: What have you tried, and what's not working?
|
# ? Sep 4, 2014 04:53 |