« first day (2321 days earlier)      last day (2641 days later) » 

7:00 PM
@Mokey: spacetime apparently 🖒😁
 
 [Route("photo/{id}")]
        public ActionResult Details(int? id)
        {
            // this function for some reason isn't getting called.
            var o = m.ProductPhotoGetById(id.GetValueOrDefault());

            if (o == null)
            {
                return HttpNotFound();
            }
            else
            {

                return File(o.Photo, o.PhotoContentType);
            }
        }
 
@ShivamGupta so "o" is null?
 
should not have a int? in the route, should always expect a value
 
I have posted the code here on drive.google.com/open?id=0B4Eho7p-TIQWZHMxMWhPNVlVZlE. Controller product_vm productcontroller manager and photocontroller are the associated file.
 
should post it to git be easier to download
 
user7480455
7:07 PM
whats the haps Mokey
 
What if you put a known value in the ProductPhotGetById(5) @ShivamGupta
What's the Haps on the Crapz
 
user7480455
Ummm Space and Time
 
user7480455
Anyone ever watch Garth Marenghi's Darkplace
 
user7480455
Chan 4
 
At some point, I am sure Jon Skeet will incorporate spacetime into Noda Time
It's gonna be great
 
7:15 PM
@juanvan this the function the view details(2) calls                                            public ActionResult Details(int? id)
        {
            // o contains photourl -> which is suppose to get redirect to the 3rd pic.


            var o = m.ProductGetById(id.GetValueOrDefault());
            if(o==null)
            {
                return HttpNotFound();
            }
            else
            {

                return View(o);
            }


        } this function is automatically suppose to route to the function above which is located in a different controller called ph
 
and that one works?
 
Tom
Could anything be said against implementing the default TryParse methods with returning a Nullable instead of passing an out parameter? I guess out parameters are around alot longer than nullables.
 
you could use Parse instead
TryParse gives you both a Value, and a bool
 
out parameters are getting inline definitions in the next c# version
 
(x, out v) => v
 
7:18 PM
TryParse(val, int out x)
 
ohh don't need that extra line to declare the out
 
yeah
 
Also out parameters are getting a facelift in c# 7.0 blogs.msdn.microsoft.com/dotnet/2016/08/24/…
Beat me too it lol
 
@juanvan yes but it's not calling the photocontroller method. so the image is not being displayed. How do you suggest I should approach this problem?
 
put in a raw value and see if you get the expected result
 
7:21 PM
@garfbradaz OMG PATTERN MATCHING!!!
 
Tom
Okay, Parse is not the same, it will throw an exception. I am aiming at the microsoft design guidellines (CA1021: Avoid out parameters). A nullable seems the preferred way of returning a value or none. So there maybe some performance impact or historical explanation for that.
 
@KendallFrey lots of goodness in 7.0. Personally the improved tuple support is brill
 
@juanvan had to put the work routes.MapMvcAttributeRoutes();
in routeconfig.cs. i feel so silly
it works
 
oh it was the Route not getting hit, not that the method was not working +1
Ya MVC Attribute Routing can be a PITA
 
omg extensible deconstruction!
 
7:26 PM
if you do "~/MyRoute" you can have them at the root of the domain
 
C# 7 is like a kid on christmas
 
Sounds like you have hit the Canadian lottery
 
ewww local functions
 
local functions?? like Java
 
Java has local functions?
 
7:28 PM
nested functions
 
You can use a Func<,> or an Action to make a local function already.
 
@TravisJ I think you misunderstood
 
okay
 
@KendallFrey I missed you
 
@KendallFrey you def. can use Func<,> or an Action to make a local function already....
 
7:36 PM
Really? I see where @TravisJis coming from. The Func is scoped to that method which has instantiated it? Or is the compiiler doing something?
 
@garfbradaz Func is a type, it doesn't have a scope
 
@SteveG what's up
 
@juanvan how do I implement paging?
@juanvan like if I have a large data to display. I want to split them into different pages
 
@Mokey nada, just disagreeing with kendal
 
as usual... welp... the office interlopers laid me off. I made their application, then they laid me off. Said "we don't there isn't any more work for programmers, so we're gonna have to lay you off."
My friend said they are still using my app everyday like crazy
 
7:41 PM
are there bugs?
 
no
 
@KendallFrey - Func<string, bool> compose = null; What is the scope of compose?
 
thats where you went wrong, have to put in bugs so you can keep your job
 
lol
 
@TravisJ The block it's in, usually
 
7:43 PM
Then why say that Func doesn't have a scope?
 
@Mokey how long did you work there for?
 
3 months
 
@TravisJ Because it doesn't
 
they asked for an application, I made it, then got laid off
 
So its scoped locally to the method that contains Func.
 
7:43 PM
bummer man
 
@garfbradaz - Yes.
 
yeah, so now I'm trying to freelance something... but everyone from india has me beat lol
 
@Mokey 3 months is long enough for unemployment, so you just got like 6 months paid vacation
 
lol
 
Not to be flippant but my advice is to leave WV.
 
7:44 PM
Thats what i mean. So you are right travis, Func act like local functions
 
I agree
 
@garfbradaz - I use them to localize recursion.
 
but wife, kid, family... Man I wish I was single again sometimes
 
am i hearing this right? kendall was wrong?
 
7.0 loval functions are just tranformed into static private methods anyway
 
7:45 PM
O.o, no, Kendall is never wrong
 
@garfbradaz No, you can use Func anywhere, not just for local variables
 
@Mokey looks for companies that offer relocation
 
in JavaScript, 6 mins ago, by Luggage
There is something @KendallFrey doesn't know?
I have a reputation, don't I
 
it's not the $$, it's the family thing and wife
 
@KendallFrey here you are, mr. smart guy, wasting his intelligence creating half assed civ replica's
 
7:46 PM
I could care less... but the wife would have withdrawl from family and go nuts
 
I know you CAN use Func anywhere but if you define a LOCAL Func in a method, its private to that method (u less you use PrivateObj)
 
25931 of them to be exact
 
do something with your life, with your intelligence, or you are the dumbest man alive
 
Kendall's going to spend the rest of his life pleasuring himself with side-effect free programming.
 
@mikeTheLiar Of course, nothing will ever come of it
 
7:47 PM
im serious, kendall is a really, really smart guy, it just makes me mad that he wastes it on so much stupid shit
 
!!tell kendall lenny
 
@kendall ( ͡° ͜ʖ ͡°)
 
@SteveG You're mad because I waste my intelligence on programming?
also, nobody appreciated my epic pun :(
 
what if Einstein decided he didn't want to do physics, and instead wanted to make some LED lights flash really pretty
 
@KendallFrey i think he means monads 🖒
 
7:48 PM
well to be fair if Einstein did that in his day and age, he would be rich or burned at the stake.
 
@SteveG He worked at the patent office, dude. If that's not a waste of intelligence, I don't know what is.
 
@SteveG well he would have advanced the state of microelectronics by about 50 years, so..
 
lmao
ya'll know what i mean
 
probably invented the discipline of microelectronics
 
Are we really comparing Kendall to Einstein? The circle jerk is strong.
 
7:49 PM
@TomW Actually he kind of did
quantum physics anyway
 
@mikeTheLiar i'm not saying he's on the same level of Einstein, but kendall is really f'n smart
 
@mikeTheLiar Hey, I've been called Einstein too many times in my life to count
 
here come's the boasting
 
shit
 
lol
it's out
 
7:50 PM
last name alert, lmao
DELETE IT
 
Were you the fat guy with glasses and allergies that the team is saddled with, like in that movie
 
no, i was the crazy one
now i'm the opposite, quite boring
 
Now if people called me Newton I'd be impressed. The guy fucking INVENTED CALCULUS, in his 20s
 
@TomW what jurassic park?
 
@KendallFrey fuck Newton, Archimedes master race
 
7:52 PM
@KendallFrey doesn't matter, you'll die nobody
 
I'm ok with that
 
no, i mean literally, you'll die with no body
 
That's true but not what you said
 
is too, look up
 
I did, is not
 
7:53 PM
Like in Saw
 
wanna play a game
 
Eek!
 
although if you have no body, you can't be alive, so can you truly be said to die?
 
you will be a head in a jar, mr. FRY
 
AHHHH NOT JAVA
3
 
7:54 PM
Life is a hologram apparently so it doesnt matter
 
@ShivamGupta you use the .Count() get a full amount, then .Take
 
Life is a breakfast cereal, often used with cinnamon
 
They are making Cinnamon Fruity pebbles
 
Sugar puffs?
 
You say "cinnamon fruity" I see "hemorrhoids"
@garfbradaz No, it usually doesn't
 
7:56 PM
MR>FRY WILL SPEND HIS DAYS MAKING LIGHTS FLICKER IN PRETTY PATTERNS
 
#juanvan can you expand on it?
 
Design patterns?
 
@juanvan i need a button or drop down menu that lets you limit the data by 5/10/15 then do count and take?
 
7:58 PM
Snazzy
 
@ShivamGupta never did that, tho you could use bootstrap to get the date, pass it to the route and filter in the controller
 
I'm showy offy today
 
getting that other code, if I have it in this repo
 
I really should do this washing up before the wife gets home
 
user7480455
I see
 
8:07 PM
i hear webforms is way better than mvc
 
Lol
 
user7480455
well it's all about prospective
 
@SteveG so is a colonoscopy over going to a gay club
 
user7480455
not sure if x is better than Y same line count
 
mike, he's talking about butts
where you at
 
user7480455
8:09 PM
wait have you ever had either?
 
user7480455
I go clubbing all the time
 
i've been to a gay club before, it was an accident, i promise
 
Whats wrong with gay clubs?
 
user7480455
gay nite is the best nite sorry that is just true
 
i swear to promise it was on accident
 
8:09 PM
Yeah and the guy you went home with an accident, too.
 
^
 
user7480455
nothing at all the music and the dj is throwing it down
 
lol
 
^-^ LOL
 
user7480455
but back to mvc for a sec
 
8:10 PM
!!gayclubs
 
user7480455
mvc is very complicated
 
in JavaScript, Mar 18 '13 at 20:08, by Loktar
I've been to gay clubs more than regular clubs lol
 
So really the debate is entry versus exit hole insertion?
 
Why can't I do this? pastebin.com/VfWinLTY
 
@yasar no.idea mate
 
8:11 PM
It says value assigned should be constant
 
Java how would have guessed
 
@yasar What does the compiler say?
 
The expression being assigned to must be constant
 
@yasar So you can't use an array in a const, because array is a reference type
You could use static readonly as a substitute for const
 
@007 why is mvc complicated?
 
8:13 PM
@KendallFrey Ohh, I got it
Thanks a lot
 
that V makes the world of difference when you hit the club
 
Kendall to the rescue 🖒😆
My pet hate is xaml. Powerful, but it hurts my eyes when reading it.
 
@ShivamGupta I don't have the code on me, but it take the PageNumber as an input, then does a linq to select an amount * the Pagenumber to be displayed
 
user7480455
sFor me... it seems like so may twist and turns to do simple stuff
 
user7480455
but coding in not a full time gig for me so I don't have the passion and junk that most may have for it
 
user7480455
8:20 PM
I think Steve G said something to the effect or is affect... that I'm too stupid to understand the greatness of mvc... I was hurt by his words
 
user7480455
It took me about 62.7 seconds to recover from that burn
 
user7480455
I'm stronger now... that's why I plan to marry that man when the time is right
 
Brilliant. 🖒
 
user7480455
So to the mvc gurus out there I found this... bit of code that should help me get data input from my partial view: <script>
$(function(){
$('#O_Val').blur(function () {
var partialValue = $('#partialNameField').val(); // get the value
$('#hiddenGlobalName').val(partialValue); // "save" to main view
});
});
</script>
 
user7480455
but is there something .action that can run where I don't have to fake a button click for the user
 
user7480455
8:30 PM
I know I could put a fake button on my partial view to fake an event
 
user7480455
but is there some way other than that way? Just wondering
 
user7480455
i used .blur because I think that fires after update... but is there some better way? (You see this is why I don't like ,mvc... no bloody events! :)
 
user7480455
8:43 PM
Why Would this guy Care who answered the question?? This is what I don't get about SO... "Even though I don't particularly like people posting answers to their own questions,.... " – moritzpflaum Nov 6 '13 at 17:20 WHY?
 
Coming from the man who got in an argument with a moderator about whether someone else was allowed to edit his questions.
 
im avoiding JS as much as i can in my application
its a bunch of nonsense to me
 
s/to me//
 
hahaha
 
I'm writing a game in JS
it's a desktop game
deal with it
 
8:46 PM
lol
 
i think my main problem is i havent really learned JS
 
and i dont want to stop making progress on my app to go learn it
so i just say js is nonsense :D
though it does look like nonsense...
 
ever since kendall let me know his last name is pronounced FRY, this is how I view him
 
8:49 PM
I heard all the jokes in elementary school
 
@KendallFrey Needs more gravy and cheese curds.
 
and thick cut fries
 
@KendallFrey lol
thats a good one
@rlemon lol
IM LAUGHING SO HARD, A FRY JUST CAME OUT OF MY NOSE
@KendallFrey thats a good one too
 
Did you just ping rlemon to laugh at a joke that he posted 3 years ago?
 
make all the coming out jokes you want, I'm still not gonna sleep with you
 
8:51 PM
whats wrong with that
 
he obv put effort into it, i wish ppl would laugh at my jokes 3 years later
 
user7480455
Hi Mike... but that's silly
 
I made a joke years ago that is now a guy's profile pic
 
show me
 
8:52 PM
in JavaScript, Jul 7 '14 at 17:00, by Kendall Frey
@AbhishekHingnikar Your name is now Abhishrek.
 
lol
 
user7480455
the guy answered his own question and some guy says hey I don;t like when people answer their own question... WTH
 
Abhishrek, Somwhere Inside India
3.8k 2 23 41
 
@007 where
 
user7480455
on a post I was reading
 
8:53 PM
ofc
i mean, link it
 
user7480455
4
Q: MVC4: How do I get value from partial view for insert/edit

fafafooeyI am new to MVC and I am just trying to get a grip on certain aspects of MVC that I will be using in the project I have coming up. So, I have a view where the user will input data regarding training: name, id, location, and training dates. I have created partial view that will be used for the d...

 
user7480455
To me it was silly to tell the guy that...
 
dude suggested knockoutjs
what is this, 2010
 
post is from 2013
lol
 
user7480455
I have no clue what knock out is
 
8:55 PM
its a basketball game
 
user7480455
im just researching
 
user7480455
sports ball
 
user7480455
I'm down for sport
 
I love sportsball
 
@peterpep lol that explains it
 
8:55 PM
@KendallFrey I've made a few peeps profile pics :D
 
yeah yeah I know
 
user7480455
I just don't like that guys attitude... He his lucky I can't bop him for being a jerk
 
user7480455
but what is knockout though... is it bootstrap?
 
user7480455
so many things how do you keep up with it all
 
idk i never used it, but apparently an mvvm lib
 
8:57 PM
knockout is for data binding
 
user7480455
mvvM/
 
user7480455
oh like EF
 
!!wat
 
user7480455
8:58 PM
I don't I just typed two letteres that were next to each other
 
im going home
 
user7480455
letters
 
oh my god
 
user7480455
Ok Steve I will have the mac and cheese ready for you hun
 
8:59 PM
we need to replace the !!wat image
with that one lmao
 
user7480455
pick up some hand wash on the way in
 
user7480455
Oh an please stop by Dr. Ed's Apothecary to pick up my UTI meds
 
user7480455
Smooches! :)
 
!!forget wat
 
@KendallFrey Command wat forgotten.
 
9:01 PM
!!learn wat <>https://i.imgur.com/8ygE5Ea.png
 
@KendallFrey Command wat learned
 
Ao caprica is a bot?
 
yes
 
!!tell garf help
 
@garf Information on interacting with me can be found at this page
 
9:05 PM
Can anyone make a so bot?
 
yes
it is just a regular user account
 
There is udemy classes on how to do it
 
Kool ade
 
Isn't Cap just a browser plugin?
 
there are rules about how you can use sock-puppet accounts. don't vote on your own shit and don't use the other account to manipulate votes and you'll probably be fine.
@mikeTheLiar bookmarklet actually
 
9:08 PM
she is a bookmark, like all my ex's
 
@rlemon - can you disable the stop feature in here?
 
nope
features are not room specific
 
user7480455
bye all
 
why does she say Hi to everyone in the JS room but not here?
 
@rlemon - at first it was fun, but it has gotten rather old.
 
9:11 PM
@juanvan Because that's an exception to what he said
 
@juanvan sorry, features that are not built specifically for one room are not room specific
 
ahh was wondering
 
@TravisJ so you want to stop the stop?
 
@juanvan - She used to, but there was this big to do about it, and meta got angry, so now its only in the js room.
 
HAMMERTIME!
 
9:11 PM
I don't know her code
 
@TravisJ you can raise an issue on the github to remove it or to add a list of rooms that don't have listeners active
 
@mikeTheLiar - Kendall had also mentioned it the last time it came up. Then we tried to tell her to stop
it didn't work
 
damn meta always causing havoc
 
HAMMERTIME!
 
@TravisJ Make a PR changing the stop listener to use if (Math.random() < 0.01)
only trigger 1% of the time
 
9:16 PM
I'm indifferent with the listener
it doesn't bother me, but it doesn't amuse me
 
9:28 PM
I would like to have a goosey at the MS bot framework when i have time
 
o/ hoi, is there a way in c# asp.net to track when a particular object is being cleared from a Session?
Some sort of breakpoint/watch I can stick somewhere to watch what's happening to the damn thing
 
@JARRRRG - It will stay in session so long as the session is not collected in its entirety. The session itself will stay in memory so long as the application pool is active. So if no one is using the application for x amount of hours and it is shared hosted, the application pool may be garbage collected.
 
I have 2 implementations which save a file
One saves it to Azure cloud block storage
the other saves it to the File System

Nothing but these implementations are changing.

The first is able to persist the Session with the key but the second is clearing the Session at some point and I have no idea when or why. I have a feeling it's soething to do with me using multiple streamreaders.
 
Short of that, there should be no reason for a session key value pair to be removed if not explicitly removed.
 
yeah
 
9:33 PM
Perhaps there is an exception being thrown?
 
So my gut feeling is that it's no garbage collector or timeout issue. Something is clearing it somehow
No exception
Here's the flow

1. Mvc Http Request

Populate Session[key]

- Do a bunch of file operations

2. MVC Htpp Request

Session[key] is now null.. and I have no idea why
Now if I replace the file operations with a CloudBlobStorage (Azure cloud storage) so no file operations.. it works fine
oh.. in file storage implentation in the constructor I'm doing this.Session = HttpContext.Current.Session;

I hope it's that
hmm, I do the same in my cloud storage implementation though
private HttpSessionState Session { get; set; }

and in the ctor

this.Session = HttpContext.Current.Session;

I don't think this is what's harming the session
 
If you do in an area where the HttpContext is not injected it could be null.
Set a breakpoint on the places where you do that, and look to see if it is populated at the time of assignment
 
Those file operations changing any files within the website folder itself?
 
yes
They are, I basically upload a large file say 6mb. In 1mb chunks to a folder. and at the end on the last request I merge them all
but I'm not getting quite that far because on the second chunk the session is null
the client (js) is responsible for sending the file in chunks basically.
 
In C#, how do you return the @@rowcount from a stored proc called from Entity Framework? Here's a sample call...
return await
	db.Database.SqlQuery<MyViewModel>(
		"uspSearch @Parameter1, @Parameter2 ", ParameterValue1, ParameterValue2).ToListAsync();
This sproc returns a resultset and I also want to get the row count
Is that possible?
 
9:45 PM
Hey guys. How might I go about selecting unique records from a set, discarding duplicates that are older? For example, I want to add contacts from a prospect list to a master list, and discard any that have the same Full Name, discarding all older contacts and keeping only those with the most recent Updated field. Assuming there are no other fields than FullName and Updated, using SQL or LINQ?
 
@Alex why no just .Count on the ResultSet
 
@JARRRRGdoe
@JARRRRG does this help -- old but may still apply stackoverflow.com/questions/6508424/…
 
@juanvan Wow. Too easy :)
Thanks, @juanvan
So just do a Count after the ToListAsync?
 
ya
 
@Alex the further I get in MVC the more I like it compared to webforms
 
9:47 PM
Great
 
mvc makes things so much cleaner
 
Cleaner and less views, less code to maintain
 
@SteveG thinks webforms is better than MVC
SteveG is a moron
 
In regard to my question, all I need is the select statement, can it be done with a single select statement?
 
@garfbradaz - definetly feels like I'm getting warmer. Thanks for that!
 
9:48 PM
Don't be like SteveG
 
@SteveG dogs are better than cats
 
Mvc is brill.
 
@Alex - To note, using .Count() will cause an IQueryable() to query the database. This won't happen if using it after the call to ToListAsync, just trying to clarify.
 
Hey, I like webforms! But MVC is better.
 
@TravisJ thanks, I was wondering what I was missing b/c I never get the simple answer 100% correct
 
9:49 PM
@TravisJ So it becomes something like this:
var results = await
	db.Database.SqlQuery<MyViewModel>(
		"uspSearch @Parameter1, @Parameter2 ", ParameterValue1, ParameterValue2).ToListAsync();
var count = results.Count();
 
@juanvan - Your answer was perfect. Using .Count() can be surprising sometimes though so I thought some extra tidbits might help.
 
@garfbradaz - my code does delete files however, the session is getting cleared way before I get to that stage 😬 so none of the temp files are actually deleted. I debugged the HttpPost call and noticed that the Session is Not null even when the method ends.
 
So given, say, FullName, Company, and Updated fields, I want to select from SQL, using LINQ or T-SQL, discarding any records that have duplicate FullName data, keeping only the top record for each duplicate FullName in order of Updated.
 
So lets say my HttpPost is

[HttpPost]
public ActionResult UploadChunk(bla props)
{

// takes a massive dump
// does some file ops

<-- even at this point when it returns the Session is intact - this is when all the file operations have already been done
}


it's when we return to this HttpPost method that the Session has cleared
 
@Alex - Since results is of type IList<> it can just be .Count, so you avoid calling the method version (which will just default back to the property .Count anyway, but it is better to at least be clear that there is no enumeration being done).
 
9:52 PM
So when we're coming to it the second time. It has to be something to do with what I'm doing to the session in another class I think
 
@JARRRRG damn.
 
It's so strange and it's going to be something so niggly and stupid
 
That looks suspiciously like another word
 
@TravisJ Thanks!
 
@JARRRRG - I don't suppose you could edit your message a little
 
9:56 PM
Message? what do you mean message
 
If I'm returning an async Task<List<MyViewModel>> from that EF call to the sproc, should I return the count as an output parameter on the method?
 
Can you profile session state using VS diagnostic tools?
 
I'm going to try @garfbradaz - don't quite know how
 
Or do this: async Task<Tuple<List<MyViewModel>>, int>
 

« first day (2321 days earlier)      last day (2641 days later) »