« first day (1475 days earlier)      last day (3472 days later) » 

8:00 PM
even if it's as simple as getting a pointer to an open heap space
 
@CharlieBrown Nice code.
 
<stab face>
 
@KendallFrey The point is, might as well use a ctor.
 
@LewsTherin - Are you wrapping IntPtr handles in IDisposable?
 
@TravisJ Nah, this isn't me -_- I was just curious as I've never had to implement Dispose.
 
8:01 PM
@LewsTherin getting a reference is something the ctor can't handle anyway
 
MS recommends using SafeHandle for IntPtr
 
@TravisJ The OP had a dictionary of unmanaged resource. And was wondering if the finalize for the Dict can execute before its wrapper. However, Dict doesn't have a finalize. So it is safe.
 
Its Dispose still uses GC.SuppressFinalize though
 
@KendallFrey A reference to?
 
@LewsTherin the new object
 
8:03 PM
@CharlieBrown The code itself is fine. The use of generics is stupid. And overcomplicating it. Just use an interface ffs.
 
OK this is gonna be random but I legit have nowhere else to ask.. (sql chatroom is deader than Kenny).. I am being forced to use an aggregate function (AVG, SUM, MIN, MAX) in my sql query.. is there an aggregate that I can use that won't do any math, but instead just return the godamn value? If I don't add one, it throws me the error "The column xx is invalid in the select list because it is not contained within an aggregate function or by the group by clause" What can I do it is such a piss off
 
its not even that, this is used instead of calling new() on an object. All ctors are private
 
@KendallFrey Then how does it gain access to this? :S
 
its the dumbest bit of indirection i have seen this year
@QuestionQuestion just add the column to the group by
 
@QuestionQuestion what goddamn value? If it's not an aggregate function, there is a list of values
 
8:05 PM
it will have the same effect
 
the median!!
and really :O
 
Wait.. the ctors are private, how is he using new Ctor(T x)?
 
@LewsTherin my point exactly. the ctor must be run with an existing object reference
@QuestionQuestion Then use a median aggregate function
 
I meant *internal, with internal visibles to other assemblies
 
I used the percentile_cont query instead
but yah, fuck me sideways that totally worked.
adding the column to the group by..
thank you
 
8:06 PM
Guys, what is the good place to set app culture ?
 
@KendallFrey So you are saying this is passed into the ctor like any other non static method... if so OK.
@CharlieBrown I see
 
@LewsTherin yep, .ctor is an ordinary method
 
Thanks Charlie
You da man
u too ken doll
kendall
 
With exception for readonly and maybe more
 
Why would readonly be an exception? That's move to the ctor space anyways.. at least I think it is
 
8:08 PM
@Charlie
@CharlieBrown, after I added that to the group by, my "distinct" after SELECT became useless.
 
@LewsTherin normal methods can't modify readonly fields
btw, exception, not Exception
 
and that's cuz I didn't add it after select
THANKS CHARLIE
 
@KendallFrey Uh, I didn't say Exception
 
I thought you might be confused
 
Lulz
 
8:10 PM
@CharlieBrown NVM :( still duplicates
 
Holy shit. Quarter past 8 -_-
Night
 
only 4:11pm here
wait qp8 isn't even that bad
 
I have TV to watch. And girls to talk to.
 
OMGTechy goes to bed at like 4am
 
do you "have" too?
 
8:13 PM
he lives in the UK and I go to bed before him
 
@KendallFrey I used to do that. Then I grew old
 
I stay up 36 hrs a week
 
@QuestionQuestion Absolutely
 
straight
 
@QuestionQuestion You bloody machine.
 
8:13 PM
then normal times
when I was 16 on ritalin I could do 54 hours straight
long nights of runescape...
 
Anyone have an idea on how to fix Visual Studio, it won't install?
 
which version
are you admin
 
@QuestionQuestion Yeah.
 
That's a remarkably specific question
 
2013
 
8:15 PM
bananas
 
Basically, it has been stuck on Hotfix for Windows (KB2664825) for the past twenty five minutes.
 
never experienced that before....
 
Sure I have
But for all installations in general
Fecking PITA
 
one issue i had with vs2013 is that i tried to install it in another drive, D: instead of the default drive
 
8:17 PM
Well, I need to fix. Well, I'm installing on the local C:
 
What installer are you using?
 
I downloaded one straight from Microsoft's web-site.
 
Are you using the web installer?
 
https://social.msdn.microsoft.com/Forums/vstudio/en-US/57e30c3e-edff-464b-9087-a065c92ad112/hotfix-for-windows-kb2664825-catastrophic-failure-installing-vs-2012?forum=vssetup
found this, it's maybe helpful
 
If so, don't use that. Afaik, it is supposed to be buggy but supposedly "fixed"
 
@CharlieBrown Why did my distinct function become useless when I added the second field to the GROUP BY??
 
@LewsTherin What should I use?
 
@QuestionQuestion without looking, unsure
 
@Greg I'm not sure if there is an ISO, if there is use that instead.
 
can I show you?
@CharlieBrown can I show you with a screenshot?
 
8:20 PM
Hm
 
just paste the code or sumfin
 
@LewsTherin Just triggered it to work, I tried to force the user / computer policy to update with gpupdate /force and it fixed it.
 
select distinct srt.Name,

	cast(sum(sr.price) as int) as AvgCost,
	cast(sum(sr.cost) as int) as AvgTransCost,
	cast(avg(sr.TotalTimeSpent) as int) as TotalTimeSpent,
	percentile_disc(.5) WITHIN GROUP(ORDER BY (sr.price)) OVER(PARTITION BY srt.Name) 		AS MedianSpend

from ServiceReq sr, ServiceReqTemplate srt
 
@Greg Dunno what that is.. but cool!
 
8:22 PM
group by srt.Name, sr.price
order by 1
@CharlieBrown I excluded the date parameters that's why I forgot the group by at the end
 
so you want group on price and name?
 
I am trying to construct async method in WP8 TaskAgent for downloading JSON from API but the DownloadStringCompleted is not being hit please?
   WebClient client = new WebClient();

                    client.DownloadStringCompleted += (sender, e) =>
                    {
                        dynamic result = JsonValue.Parse(e.Result);
                        bitstampLast = result["last"].ToString("#.##");

                    };

                    client.DownloadStringAsync(new Uri("https://www.bitstamp.net/api/ticker/"));
 
well I just want the median value, without having to have AVG,SUM,MIN,MAX
if I don't add one of those, I get the not contained in an aggregate or group by clause error
 
your ordering by something that doesnt exist arent you?
 
I didn't think so?!
what doesn't exist
srt.Name or sr.price?
 
8:25 PM
sr.price
 
you told me to add sr.price to the GROUP BY
that's the only reason I did
it did work, but its now giving me duplicate rows with different values
like it gave me the Median
but not the correct median, because the names were to be grouped, and then calculated together to get the median
 
so remove the sr.price from the group by
 
and change the ORDER BY (sr.price) to ORDER BY (sum(sr.price))
 
but I don't want the sum
i just want the median
 
8:29 PM
Can someone help me. When I try to use public async Task<int> getNumberAsync(string site) here z = await test.getNumberAsync("Google"); it gives me The 'await' operator can only be use within an async method. Consider making this method with the 'async' modifier and changing the return type to 'Task'
 
@QuestionQuestion median is an aggregate function
 
the order by requires something from the select, you are selecting sum(price) not price
 
is theres 11 similar named rows, i want the 5th value to be the median
 
Why?
 
because that's the median??
 
8:30 PM
Why would you want median though?
There are very few use cases for median
 
i.t director...
hates avg
 
I assume you're ordering the data before grouping it?
 
yep
its all correct
its just i can't seem to get it to display correctly
ill be back
 
Is there a place where I can suggest a syntax idea for future C#?
 
microsoft connect
 
8:36 PM
@CharlieBrown nice thanks
C# doesn't seem to be in the "product directory"
 
hm. no idea then
 
so I can't use async if the two functions are in different class?
 
@LearningC yes you can - you can only use await in a method that's marked async, though
that's the problem in your code above.
async/await tends to "bubble" all the way up the call chain when its used
 
@ReedCopsey awesome thanks, idea posted
 
link? I'm curious...
 
it's a really tiny idea, but I quite like it :P
 
9:00 PM
@ReedCopsey but isn't my getNumberAsync function is marked as async? It is async Task<int>
@ReedCopsey or does my z has be marked as async?
 
if you use await in a method, that method has to be async
so the method where you call it needs to be async, too
 
ohh gotcha thanks
 
@ReedCopsey I was trying to explain some GC stuff earlier, but I got myself confused. Care to take a look?
 
what am I looking at?
 
hang on, let me make that syntax highlighted
There's a bit of a dilemma around line 50
I'm not sure what the correct solution to this is
 
9:08 PM
why would you get an exception?
The NullReferenceException?
(also, you should just use List<T> - there's no reason to make your own list disposable, as it does nothing)
 
@ReedCopsey Because MyCollection may get finalized before MyObject
 
@KendallFrey would this not suffer from the same issue as before since List<T> is a managed object being accessed inside the finalizer?
You've just moved the list from one object to another
 
@Kendall It can't, since MyObject has a strong reference to it
 
@ReedCopsey I know, but what about a use case where there is a reason to have a separate object?
 
besides wchih, the finalizer/dispose is useless there - it just sets to null
 
9:10 PM
@ReedCopsey It did in my test
@ReedCopsey I know, it's a PoC
 
The right way to do it is to use msdn.microsoft.com/en-us/library/…
but that being said, why would you get a NullReferenceException when cleaning up your handle?
that seems like a separate bug
 
@ReedCopsey The way I understand it, MyObject and MyCollection are both unreachable during a GC, so they both get placed in freachable, and both have their finalizer run
If MyCollection's runs first, handles.Items is null
 
you really should only have the finalizer in the class that actually owns the resources
so, in your case, only in the collection class
the other class doesn't need it - it can call dispose - but doesn't need a finalizer
because the one on the internal collection will handle that case
 
problem is, it can't
 
why not?
 
9:15 PM
It doesn't know how to clean up its resources
MyObject creates them, and it has to clean them up too
 
you should wrap the individual resources in finalizable classes - ie: SafeHandle
it sounds like you're violating SRP, and it's biting you in the ass
make the wrapper that handles the handle, and finalizes it, as low level as possible
that's where SafeHandle is typically the right approach...
 
It appears that the antipattern is storing unmanaged resources outside of the object that creates them.
Am I right?
 
@ReedCopsey - Is a finalizer in side of IDisposable good practice in case the first call to Dispose throws an exception?
 
@KendallFrey effectively, yes- you should always wrap anything unmanaged in a wrapper that does nothign but manage its lifecycle
@TravisJ Dispose and the finalizer should, typically, do the same thing. It's more about handling the case of Dispose() not being called
 
@ReedCopsey a large list of SafeHandles would seem to cause a lot of finalizer overhead though
 
9:20 PM
@KendallFrey as long as you dispose them, the finalizer doesn't run on it
it's only a problem if you don't dispose - in which case, the finalizer's a good thing
 
If the list was a native array (rather than a managed wrapper like List<T>) would that reference become null depending upon order finalizers are pleased?
 
oh, yeah, that good practice I forgot about :/
I'm guessing it's a bad idea to store unsafe handles in an array in all situations
given what I learned today
 
ohhh, but
that's a good point... what if each unsafe is wrapped in an otherwise pointless class
easy to have an array of those right?
 
I think so yeah
an array of SafeHandles is perfectly fine
 
@ReedCopsey so just to get the return integer I simply cant do int z = z = await test.getNumberAsync("Google");? I will have to make a async Task Task_MethodAsync() { int z = z = await test.getNumberAsync("Google"); ?
 
9:25 PM
That is a good solution to the problem I was having :D
 
wassup guys
does it matter the order of access modifier
static public void DisplayNotifyIcon(string message, int seconds)
or
public static void DisplayNotifyIcon(string message, int seconds)
 
no
 
they both compile
 
and there is no difference.
 
thakns
 
9:31 PM
I prefer the second one, ftr
 
second one my preferred one also
 
thats the more formal way right
 
Why can't I create an asp project in vs2013 pro? Do I need to install something?
 
@LearningC No - but the method where you call that has to be async
 
@Tokencodingnewbie ASP.NET, you mean?
 
9:40 PM
Yah
 
do you have web?
there are many different versions to choose from in vs
 
I'm not sure?
I figured pro had everything :(
 
Isn't that just Express?
 
Is it?
Now I am not sure
 
I thought it was too.
 
9:42 PM
I have no reason to have web, yet I can create web projects (Premium)
Templates > Visual C# > Web > ASP.NET Web Application
 
There is no web section for me.
 
new project, visual c#, web, .net
 
Do you have Windows? Cloud? Reporting? Silverlight? Those are some of the ones I see
maybe the installed templates are an option during setup
Try the Online section
 
I did try the online section, nothing
 
9:46 PM
lol nvm
I see what I did wrong, fucking lollll
 
I was opening my old vs express instead of pro
Cool now to learn how to make a webservice.
 
Can someone explain to me why this doesn't work.
string preference = GetShippingPreference();
if(!string.IsNullOrEmpty(preference))
    switch(drpLstShipByMethod.Text)
    {
        default:
            drpLstShipByMethod.Items.FindByValue(preference).Selected = true;
            break;
    }
    private string GetShippingPreference()
    {
        int i = Account.CurrentAccount().ShippingOption;
        string preference = string.Empty;
        if(!Page.IsPostBack)
            switch(Account.CurrentAccount().ShippingOption)
            {
                case 10:
                    preference = "Hold for Pickup";
                    return preference;

                case 11:
                    preference = "Store Truck";
                    return preference;

                case 12:
 
if the switch has no case then it is not useful
 
Well, let me rephrase that. The code finds what it is supposed to. But it doesn't actually change the drop down selection.
 
9:59 PM
@Greg there are also selectedValue and selectedIndex
you can try that
 
@meda Yeah, might have to.
 
    var item = drpLstShipByMethod.Items.FindByValue(preference);
    if (item != null)
    {
        drpLstShipByMethod.SelectedValue = item.value.ToString();
    }
Somthing along these lines @Greg
 
Well, what I'm trying to ensure is that when it grabs the string value it will basically match the string value to that drop down.
So that it selects that by default.
I mean shouldn't .Selected = true trigger it to actually choose?
 
10:22 PM
How bad would it be to invoke GC.SuppressFinalize(this) from the context of a finalizer? Yes it's completely redundant, but will it go bang?
 
@LeaHayes I personally wouldn't do that.
 
@Greg probably best not to, just trying to avoid having to double up on dispose functions :P
 
Hey, do you know of a project that fills yours classes from a database? I don't want to use Entity Framework because it's to expensive on load-time (even with pre-generated views).
I didn't need to measure it. It just takes seconds
After everything is generated, it's fast.
EF is not slow, just the startup is annoyingly so.
I wasn't using ASP.NET in this instance. This was on desktop.
Sorry ;(
You don't experience this?
I see, well EF is the most marketed one haha
thanks for the names
 
10:41 PM
@ton.yeung Any thoughts on the above for the drop down not selecting correctly?
 
Oh and on SO I found this answer for you: stackoverflow.com/questions/13633256/…
I think this is what you want: cbxJobType.SelectedItem = cbxJobType.Items.FindByValue("Value #2");
 
@ton.yeung It won't actually modify the drop down.
 
@Greg It's for making your code more readable though.
Good practice is important
 
Do you have an example?
 
10:56 PM
I've linked a question for you
I think i'll help
 
@Measuring I tried that earlier, didn't work.
 
@Greg I see :(
 
@ton.yeung It is populated in the front-end though.
 
@Greg If so, I think your backend selection code is working before the field is populated with the data (because frontend happens after backend).
 
11:26 PM
What is an application server used for? and what is a good one?
(explain it to me like i'm 5) :P
Well I'm doing a web service tutorial and it said to download one, is it essential for webservices? It recommended apache geronimo.
I would like to make a lot of money!
They wont let me talk in the android room!
Bunch of pricks.
normally I code in c#
but someone asked me to write something for tablets, so I am kind of having to do Java and I guess the only way to make Java and SQL play nice is a webservice? A lot of new stuff to me.
Deploy to?
It just pisses me off, I come there for help and they say I can't talk because I haven't asked any questions about android on SO. I just feel segregated man!
I guess I would keep the server on my computer? It's a really small company, and I'm just doing it for learning purposes.
I don't know D:
They don't have anything to run it on.
In fact there is a chance he wont even use it, but it was mentioned in passing and I'm doing it just to learn.
No.
Just to expand my knowledge.
 
@Tokencodingnewbie - Is this still the all in wonder where are my people app?
 
@TravisJ Yeah pretty much.
oh brb dinnerrrrr
 
!! suspicious or coincidence?
 
@TravisJ coincidence
 
There you have it lol
The bot never lies
!! Caprica lies or Caprica doesn't lie
 
11:41 PM
@TravisJ Caprica doesn't lie
 
42.
haha truth
also, I find it interesting that both times was the second option
!! first or second
 
@TravisJ second
 
!! random or broken
 
@TravisJ random
 
fuuuuuuuuuuuuuuuuuuuuuuuu
 
11:44 PM
@TravisJ Not too long ago someone was noticing that she was always picking the first one
 
gambler's fallacy
 
humans are really good at spotting 'patterns'
that reminds me of a TED talk
 
@ton.yeung lol it was a coincidence my asparagus was done! Had to put my steak on :P
 
@KendallFrey - W at ar ou rea in ?
 
oh it gets better
 

« first day (1475 days earlier)      last day (3472 days later) »