« first day (2110 days earlier)      last day (2843 days later) » 

2:00 PM
Im getting this Error from the following code: *Unable to create a constant value of type. Only primitive types or enumeration types are supported in this context.*

var user = context.Users.Where(x => x.LastnameDotNumber.ToLower() == lastnameDotNumber.ToLower()).SingleOrDefault();

IQueryable<Story> searchQuery = context.Stories.Where(x => x.IsRetracted == false || user.StorySubmisssions.AsQueryable().Contains(x));
 
@War it can't be stylish as a first release, since few companies are in it. But the concept is groundbreaking honestly. I love it.
 
War
@ElieSaad yeh I know what you mean :)
 
I've read a little about the error, and someone suggested that It was because I am mixing the query from a database collection & in memory collection
 
@AdrianK. I kinda prefered Krakow but Warsaw was nice too
 
Anyone have experience with this error or know how to avoid it?
 
War
2:01 PM
@Michael yeh you can't do that
 
@Griffin Haven't been quite often in Krakow, but I understand why people might like it
 
@War It seems odd, because I feel like i do similar stuff like that all the time.
 
War
I had this last week ... had to refactor in to sets of primitives then match on those
you can do this with linq in memory just not with linq to SQL or linq to Entities
 
@AdrianK. Have you been to the salt mines? They're amazing.
 
@ElieSaad you don't change the model class to a partial class from the edmx. You basically extend it in a different file that sits outside of the folder that would be destroyed
 
2:03 PM
@War So you are saying I can do this as long as the comparison is between database in memory primitive types?
@War like i need to get a list of ids from user.StorySubmisssions?
 
@Griffin I haven't, unfortunatelly. My friends always had a laughter when heard that the other guy started to work there.
 
War
@Michael I don't really enough about the situation but you basically have 2 options ... take the db stuff out of the db and do as is or take the bits from the in memory compares in complex types and build primitive collections then do compares using those
 
@AdrianK. Because he works in the salt mines?
 
@War alrighty. thank you!
 
@Griffin Yeah, they've treated it like a punishment. Oh how their faces went sad when it appeared that he earned more than them..
 
War
2:06 PM
the situation I had was something like ...
var result = db.Stuff.Where(x => someComplexCollection.Contains(x));
that you can't do in linq to entities
but if you break it down like this ...
 
Is it true there's a real lack of developers in Poland right now?
 
@Michael I think you can do what you want if you ToLower() the variable first.
 
brain drain + outsourcing demands
 
@Bardicer Yeah i am googling about extending a partial class, thanks for the guidance
 
War
var ids = someComplexCollection.Select(x => x.Id).ToList();
var result = db.Stuff.Where(x => ids.Contains(x.Id));
that should work
 
2:07 PM
@War yeah I will just able to fix it by getting a list of Ids
List<int> userSubmissionIds = user.StorySubmisssions.Select(x => x.ID).ToList();
searchQuery = context.Stories.Where(x => x.IsRetracted == false || userSubmissionIds.Contains(x.ID));
 
War
See what I mean @Michael ?
 
thanks :)
 
War
:)
 
partial class CoolClass { RestOfYourStuff() }
 
Entity Framework can translate Contains and ToLower in most cases, but not all.
 
War
2:08 PM
it's something about objects and SQL
 
oh... nm. ignore me.
you're doing a contains on a complex type.
 
War
I guess it's because rows don't have x.Equals(y) like objects do so it can't be translated
 
@MichaelEdenfield right :P
 
Contains translates to a SQL IN clause, it needs primitive types.
 
@MichaelEdenfield right. We fixed it. all set now :)
 
War
2:10 PM
@MichaelEdenfield yeh that was my thinking, and the reason is like I said ... to do with object.Equals(other) not being a thing in SQL ... all matching is done on keys rather than "logic"
it makes sense ... just gotta think about the problem a little differently on the C# side to compensate :)
 
i kinda feel like you'd be better off doing a join instead of a contains but I'd have to think how to linq that.
I always forget how to left join in linq
 
I'm not looking for 5 minutes and you're talking about C#? Really guys, can't we just stay off-topic please?!
 
SO HOW ABOUT THEM POKEMONS
GOTTA CATCH EM ALL
 
War
@RoelvanUden sorry ... my fault for thinking the wrong stuff again lol
I still get confused on occasion ... keep thinking this room is about C#
 
2:14 PM
@War get out man ... you are a disgrace already
 
I wrote some webforms datagridviews today :^)
 
War
:( ...
 
it was amazing
 
War
wait whut?
 
just kidding, pls kill me
 
War
2:14 PM
and i'm a disgrace? ... what idoes that qualify as?
 
i shall keep this to roel ... Words cannot describe.
 
Hello, does anybody here have any experience with DLL linking? I'm getting a very strange error for a DLL not being found.
 
Go ahead and dask
yes, daks
or that
 
dask away!
 
War
@David dll linking ... is that still a thing?
 
user47589
2:22 PM
axe us a question
 
Specifically, it doesn't find the DLL, so for debugging I added an AssemblyResolve event handler, which is called for finding the DLL, but then when I do a "RequestingAssembly.GetReferencedAssemblies()" it comes back with itself in the list, and twice, two different versions.
DLL that's "missing" is one called "HID Tester", and in the results...
[14]: {HID Tester, Version=1.0.6050.25570, Culture=neutral, PublicKeyToken=null}
[16]: {HID Tester, Version=1.0.6050.15991, Culture=neutral, PublicKeyToken=null}
 
my guess is it's being pulled in as a 2nd-or-more-level dep
from multiple places pointing to different copies
 
War
could be that the app domain has references to both
I usually use binding redirects to specify the version that the whole app domain can use
force a single version
can be done in config and may resolve this issue
 
Hmm, I do reference it directly, and I have another project that references it, but both are referencing by having the project in the solution, so it should point to the same one.
 
War
try doing a full clean
 
2:26 PM
Can't force a specific version. V1 is what it was when it was built by the build server, V2 is what it was when I did a rebuild (no code changes though).
 
I have created some .js files with various functions. Some of these functions need to contain url references to actions or methods in my Controller (asp.net mvc). For example:

in an Jquery Ajax function:
return $.ajax({
url: '/secure/home/User/Lookup',
dataType: 'JSON',
data: { someVar: someVar }
});

Is there an alternative to hard-coding the URLs?
 
War
by that i mean ... right click solution > clean ... then go to each bin folder and delete everything in them
 
@War, I tried that.
@War, didn't try it that manually. One minute.
 
War
sometimes a right click > clean doesn't remove everything
 
is this DLL strongly named?
 
War
2:27 PM
also check that the refs are pointing to the same version of the project (sounds daft but i've seen people refer to stuff in different branches before)
 
because if it's not strongly named, the different versions really shouldn't matter.
and if it is strongly named, wtf were you thinking using strong names?!
 
War
lol
@MichaelEdenfield yeh binding redirection should solve that
@MichaelEdenfield and yeh ... that's so 10 years ago lol
0
Q: Visual Studio Online CI Builds and Gated Check ins

WarI'm looking for a way to achieve something like this using VS online ... I have a lot of small solutions in the root of the repo that are structured a bit like ... Foo.sln "/Framework/xxx" "/Foo/*.csproj" Bar.sln "/Framework/xxx" "/Bar/*.csproj" ... There are generally some commo...

 
you don't need binding redirection.
 
War
brb
 
it shouldn't even care about the version number unless there's a strong name attached.
 
2:30 PM
DLL is not strongly named.
Not pointing to different branches (there's only one I have checked out)
 
I had a legit use case for binding redirection the other day
 
in VS2015 where can I set, if running unit tests which pane will be active after? It always open the "Error list" pane
 
@David what's the error message? if it's "Could not load file or assembly 'blah blah' or one of its dependencies"
Pay attention to the second part "or one of its dependencies"
 
@TomW, yeah, that one.
 
There's normally some additional information
"The system cannot find the file specified"?
Annoyingly it doesn't tell you which file it couldn't find. It isn't always the dll that it reports the problem with
 
2:36 PM
Is this one of those problems that require you to turn your build log verbosity way up?
 
@David have you used the assembly binding log?
 
Okay, this is really weird. Went and manually cleaned the folders. Rebuilt both the project, and the wrapper for it (that's why I reference it directly, and reference something that references it), and still have the issue, BUT: ...
[14]: {HID Tester, Version=1.0.6051.13574, Culture=neutral, PublicKeyToken=null}
[16]: {HID Tester, Version=1.0.6051.13622, Culture=neutral, PublicKeyToken=null}
New version numbers.
(Used to be 1.0.6050.*)
 
you have autoincrementing version number on that project?
 
is there any mean to create a metadata class by any means of right clicking a class and clicking extend? I read it somewhere, just can't find it anymore :/
 
search your entire hard drive for the file name?
 
2:38 PM
VS does that by default.
 
[AssemblyVersion("1.0.*.*")] or something like that
 
Yeah.
 
so it looks like it's being built twice as part of your project
 
Yeah, is it possible that something really weird is happening with the direct reference and the reference that is once-removed?
 
I haven't been following the conversation, are these file references or references to other projects?
Or both/one of each?
@David I'd suggest using the Fusion log viewer
 
2:40 PM
References to other projects. So, given three projects, A, B, and C.
A has a reference to B and C
B has a reference to C.
 
cmd > fuslogvw.exe
Remember to turn it off when you're finished with it or it'll absolutely kill your performance and fill your machine with gigs of log files
I've done that twice
 
Fusion has been super helpful before.
 
Yikes! :) I'm not familiar with this tool. How do I use it?
 
War
uh oh
 
War
2:44 PM
that's a massive can o worms
 
498
Q: How to enable assembly bind failure logging (Fusion) in .NET

user32736How do I enable assembly bind failure logging (Fusion) in .NET?

 
They aren't that easy to interpret but they will tell you why
Somewhere, in their obtuse style
 
Fusion once solved a duplicate assembly problem we were agonizing over for two days.
Turns out it was conflicting version numbers.
 
Hmm, so it should just give logs when it's run, right?
 
why is that there is no way to see the Test explorer after running tests? Is it so hard to just not *&#@ up, and stay on the pane?
 
user47589
2:49 PM
yes
 
I dunno what you're doing. My VS stays on the test explorer pane even when I don't want it.
 
non-deterministic software
 
always show error list if build finishes with errors is unticked in the options...
 
only works the wrong way when you want it not to
 
@GrantHill can we swap computers please?
 
2:51 PM
@ntohl, you should be able to get it back by going to Test>Windows>Text Explorer.
 
it switches to error list
@David every time click 3 more, to see the result? no thanks
 
@ntohl, Pin it.
 
btw it's locked on the bottom pane
(pinned)
 
Can anyone help me how to capture keyboard press? not inside the textfields but anytime i pressed my keyboard it will capture?
 
Oh, then it should be there when the test is finished.
 
2:52 PM
@JesusErwinSuarez open Microsoft Word
@David it's there, just not focused
 
In c#
I am planning to create application that will capture the key value or key code pressed
in windows
 
Facepalm This makes no sense.
 
there is a way. Just You don't want to go through it...
23
Q: Global hotkey in console application

JoeDoes anyone know how to use the RegisterHotKey/UnregisterHotKey API calls in a console application? I assume that setting up/removing the hotkey is the same, but how do I get the call back when the key was pressed? Every example I see is for Winforms, and uses protected override void WndProc(...

 
With this setup
A has a reference to B and C
B has a reference to C.
B had copy local set to true.
Set it to false, and now it's working. WHAT?!
How does that even make sense?
 
The problem with an IDE, like any sufficiently complicated tool or abstraction, is that when it breaks, it often breaks in a difficult-to-diagnose way.
 
2:56 PM
Haha, well said.
 
its like implementing a language interpreter... as soon as you finish it and it works... you lose all debug support in the new language! Congratulations!
 
I need a second monitor. First in my life. Because of this shit bug in VS...
 
3:33 PM
holy crap!
Attached a debugger to an Azure WebAPI instance, loaded the Cordova android app on my phone which communicates with the API. It actually stops on breakpoints and I can step through shit.
it actually works :o
 
good (ugt) night
good job debugger!
 
Is there anyway to specify what *should* be the base url of the application in the web.config file for ASP.net?
Because I'm running into issues where on my dev environment things work fine because js, and such reference the base url (eg. domain.com/) but on test and production servers, the url looks like domain.com/secure/projectname
 
o/ @ntohl :)
 
@Squiggle neat
Whoops, sorry, that's in my language. Anyway, you get the point.
 
3:36 PM
Should I be using html to define that? instead of web.config?
 
3:51 PM
the base url is defined ~/?
 
@juanvan js isnt able to use ~/ i dont think
 
what does the js look like now?
 
@juanvan in some js files I might specify a url like: '/User/Lookup'
this will be relative to the base url. which works fine when domain.com/ is the actual base url.
but on our prod, test server the base become domain.com/secure/projectname/
 
think this is the best answer
http://stackoverflow.com/questions/25203124/how-to-get-base-url-with-jquery-or-javascript
 
@juanvan thank you. I'll try that
 
4:11 PM
I think we lost the Javascript chat...
 
user47589
4:28 PM
i hope you find it again
 
blaaaaauehghflhepa<mashing keyboard wildly>
 
@Squiggle pralem?
 
noprollum
just boredaf
 
user47589
has @Squiggle lost it finally?
 
i.imgur.com/36DVbRG.gif <flails arms wildly>
 
4:32 PM
hahaha
Is that Team America?
 
could it be anything else?
 
I've never seen Team America
 
wow
 
I need to make a list on IMDB
Of shit I need to watch
 
user47589
great movie
 
user47589
4:40 PM
the kitten scene is the best
 
Morning guys. Coffee time!
 
How can I set up my app so that in my dev environment url references will work fine with the base url: localhost:#####/ and on a test/production server url references will work with a different base path servername.com/secure/
"~/" seems to work for getting the right path with c# code, but in JS "/" takes me to the actual root of the path instead of servername.com/secure
 
@Michael you mean relative URLs?
 
@KendallFrey yeah.
 
What I've done in the past is have, in my 'root layout', something like:
<script>window.appRootUrl = @ResolveUrl("~/");</script>
 
4:55 PM
./ and ../ work relative to the current page
 
@Luggage so you'd have to use razor?
 
that's as good as you can get without reverting to absolute paths, I think
 
then: function resolveUrl(url) { return url.replace('~', window.appRootUrl); }
@Michael I assumed razor. just use what you have
 
@KendallFrey yeah, may have to resort to something like that.
@Luggage thanks that might work too
 
Luggage's solution looks good
 
4:56 PM
Many apps just assume a specific path because of this.
 
absolute paths, but not hardcoded
 
Just wish js could do it natively somehow
 
js can't because the concept of "this path of the path is not my application" is not it's job.
but just by outputing one variable, the root path to resolve all others, you can make it.
 
@Michael Problem is, JS has no concept of an app's root path (or apps in general), only a root path for the domain.
 
I see
 
4:58 PM
there is some html <base> tag that supposedly does this.. but I never see it used and assume it doesn't really work right.. or not used for ajax.. or something.
 
@Luggage I just tried the <base> tag thing. but it didnt seem to work quite like how i wanted
 
yea, not surprised.
 
@Michael JS will never have that sort of power, it would be exploited too easily. There are many ways to work around this, many good ways.
 
exploited?
 
JS is a client language, meaning if you put in java script c:\foo, it would look on the clients computer at c:\foo (not the server) (this is blocked by default in every browser)
 
5:04 PM
Nope.
If that was the case, there is nothing stopping you from doing that right now.
 
@RyanTernier do you have any better ways than what was suggested above?
 
Very similar back in 2000 when people were really jumping into the interweb, and forums would allow you to put HTML in, people would do:
<iframe src="c:\" /> and it would freak everyone out because everyone's C: was visible on the web, but just because the HTML - which is renderd on the client - showed the C:
@Michael Why not work with your hosts file:

dev.myapp.com
staging.myapp.com
www.myapp.com
 
That was 16 years ago and does not apply here.
 
java script and HTML are always renderd on the client.
 
so? adding an "app root" features does not expose any vulnerabilities that don't already exist
 
5:07 PM
Any Razor syntax or ".net" syntax will be rendered on teh server, then pushed to the client as HTML. The client then renders that HTML locally
I think with @Michael 's question, my question is why does he need it.
I have an idea, as I went through these growing pains before.
 
because things like an API endpoint address are often absolute paths, not relative to the current one. But he needs it to be relative to his 'app root'.
 
@RyanTernier I am able to determine which server is currently being used, but that doesnt seem to help with dynamically adapting to the base app root
 
@Michael I can understand that, but to what end? What if the code is deployed on another server or a laptop for demo purposes?
WHy not use the web.config to contain the "server" it's being deployed on, which would then give the settings needed
 
@RyanTernier how can I do that using webconfig?
 
you can't.
 
5:12 PM
@RyanTernier using webconfig I could specifiy that mysite.com/secure/project is the base root?
 
asp already knows where it's mounted. you don't need to hard-code that in a web.config, usually.
 
yeah, its not really and asp.net issue. its really just the JS urls
 
you problem is about getting that server-known info into the JS so that your JS code knows.
 
exactly
 
If you need the mysite.com/ you have to get .NET to generate that for you
 
5:13 PM
are you generating the main html on the server?
 
Javascript will never be able to know what the URI is
 
@Luggage yes
 
Them, just generate a little code that puts the root path in a variable that you can use and make a JS-equivelent of resolveUrl().
in c#, you'd have to call ResolveUrl('~/blah') to get a full path, so do the same in JS. Make it work the same and it won't be confusing.
 
@Luggage okay I see what you are saying
I'll try that real quick
 
but the generated <script> tage that contains the root path variable before all others.
 
5:19 PM
@Luggage right. do you think it makes more sense to do a resolveURL function. like you wrote above: function resolveUrl(url) { return url.replace('~', window.appRootUrl); }

or just concatenate that variable with the rest of the path on an as needed basis:
url: appRoot + '/something/action/'
 
I vote for a function. It's easier to change its behavior later in one spot.
 
@Luggage is @ResolveUrl actually a thing?
 
It was something like that in razor. I don't use that anymore, so I don't remember the exact name
 
alrighty. thank you so much for the help
 
but I know there are functions in asp.net that take a ~ and replace it with the app root
and you do too, you mentioned them back in the JS room a while ago. :)
and, if you aren't using razor, there are equivalents in 'raw asp.net' or something.
 
5:23 PM
@Url.Content("~/") should work i think.
Is there a reason you put it in window.someVariable instead of just a generic variable ?
 
if you declare a variable outside of a function scope it goes to the global scope. That global scope in a browser is "window". So I am just being specific to be clear.
 
I see.
 
user47589
JS has weird scoping rules
 
"Everything's global unless you use var or let, so have fun with that."
 
5:39 PM
just always use var or let. There is no reason to ever not.
then the scoping rules are simple.
 
Damn. So @Url.Content("~/") return with "/" as the root
 
user47589
strict mode helps with this.
 
on localhost
 
user47589
can anyone help with a weird CSS issue? my nth-child(even) selector is acting funny in one menu but not the other. imgur.com/a/WoSWs
 
user47589
5:52 PM
in the second menu, the "Datacard" and "Templates" items act like a single item (i.e. hover over one, it thinks you've hovering over both)
 
user47589
but the HTML in both menus has the same structure
 
@Amy its wrapping as 1 word?
 
user47589
nothing's wrapping
 
because you have it defined as a single line item
<a class="row" ui-sref="configuration.datacardtemplates"><div class="columns small-12">DataCard Templates</div></a>
 
user47589
that is a single item
 
5:56 PM
right
 
user47589
oh i see
 
user47589
thank you
 
user47589
i've been staring at this for so long!
 
user47589
you're right, its wrapping
 
I hate when that happens. Usually taking a brief walk outside to reset my brain helps a bit
 
user47589
5:59 PM
yeah
 

« first day (2110 days earlier)      last day (2843 days later) »