« first day (1592 days earlier)      last day (3361 days later) » 

12:00 AM
okay so I should test OnPropertyChanged then
 
so if I passed it an enumerable (1,2,3,4) and the values 1,2,3,4 then checked that each value corresponded to the given value in the enumerable, I'd have checked every possibility that the random generator call could produce, and be confident that the public method would work correctly
 
I told you testing the properties was trivial...
 
Has anyone had an issue where you add a reference, intellisense picks up the reference and you type out your code but once you go to build VS tells you that the namespace in your using statement could not be found?
 
@ginkner but you can't pass those values!
 
Wtfffffff
 
12:00 AM
the rng is generating them
 
I know but I'd like to get a simple test up an running using OnPropertyChanged to start
 
you can IF you test the private method
 
so I have my ` LoginVM.UserName = "Brian V";`
then what?
 
and not the public method
 
Ok... look through what we've talked about before...
@ginkner I see what you are saying
At the same time, a unit test won't usually cover the entire input range anyways
 
12:02 AM
^_^
 
and in your case you could just mock the random
 
yes. This isn't a particurlarly intruiging example
god my spelling sucks
 
@BrianJ I've shown you how to set up events at least 3 times
so think a little bit, this is a direct application of what we have already done
 
@BradleyDotNET and in this case I could theoretically use statistics to verify the output.
 
If you really felt like doing that...
Your sample size would have to be so large, and the allowed error great enough, it would really suck
 
12:05 AM
right. Which sucks
and still really wouldn't garuntee it was working. Only make it much more likely
 
exactly
When I had to test some nasty random based math, I really did mock out the RNG
Which was pretty simple for me, because I was already designing for an external program to be that RNG
so I got lucky on the unit tests :)
 
I also personally like the idea of testing protected virtual members explicitly rather than subclassing and exposing them, but that seems more a matter of style
 
@BradleyDotNET so thisis the updated test, I know this is not how you aserrt property chnaged:

https://gist.github.com/BrianJVarley/17dd331d819018ab579e

but this must be heading in the right direction?
 
and yeah.
 
Hello!! Is there someone familiar with graph theory??
 
12:07 AM
@BradleyDotNET:
 
indeed
@MaryStar I'm familiar with graph paper :)
 
@MaryStar I know the basics
 
one way to redesign this would be to make a subclass that just had a GenerateIndex protected member
 
seriously, unless its simple, you might consider CS.se
 
CS.se?
 
12:08 AM
here's what I know about graph theory:
 
Computer Science SE
 
:D
 
They love all that theory stuff over there
 
SE. the SE is what im confused about. Is it cat based?
 
but feel free to ask, it just may go over our heads :)
just simple software engineers here
 
12:09 AM
@BradleyDotNET not sure how to assert the property changed, as you can't call it like Assert.
 
not that
@BrianJ at all
You are testing the other class
you don't define your own event
listen for the other classes event!
seriously, how does what you wrote make any sense?
 
@BradleyDotNET @Pheonixblade9 @ton.yeung I am looking at this:

Let $G$ be a graph. A clique in $G$ is a subgraph in which every two nodes are connected by an edge. An anti-clique, also called an independent set, is a subgraph in which every two nodes are not connected by an edge. Show that every graph with $n$ nodes contains either a clique or an anti-clique with at least $\frac{1}{2} \log_2 n$ nodes.

Could you give me some hints how I could show this??
 
Word Salad.
 
@MaryStar Talk to a mathematician, or a CS graduate student :)
 
@MaryStar the brute force way is to construct a minimum spanning tree (kruskal's or Prims or A* algorithm) and compare the sizes
@ton.yeung (not on the west coast, still 4pm here)
 
12:12 AM
@BradleyDotNET gotcha, I should listen for the property changed event in UserLoginModel not create my own
 
@BrianJ right
 
@ton.yeung my working hours are "we don't care as long as you get your 40 billable" :)
I got here at 9:30 and it's only 4:15!
 
I didn't understand a word @Pheonixblade9 said
and I am very happy about that
 
LoginVM.PropertyChanged("UserName"); but I can't call it like this, must be a different way of calling
 
lol, my working hours are "do I have the ability to work right now?"
 
12:13 AM
@BradleyDotNET I paid attention in school :D
 
Not calling, listening
@Pheonixblade9 My school didn't teach that, thankfully :)
 
@BradleyDotNET seriously? It's data and file structures 101 type stuff
 
Oh, I know what a graph is, how to use one and set one up
But none of that crap
 
@MaryStar here's a couple (shitty examples) of how to implement those algorithms in C# I wrote: github.com/pheonixblade9/KruskalsAlgorithm github.com/pheonixblade9/PrimsAlgorithm
 
Perhaps knowing it would make me a better engineer.... but I doubt it
 
12:15 AM
@BradleyDotNET it's useful domain knowledge
 
Graph?
 
@BrianJ you need to listen for the event
@Pheonixblade9 I'll take your word for it :)
 
what kind of graph are we talking about? Pie? Line? Scatter?
 
okay I don't hear anything, what does it sound like? :P
 
I have yet to use a graph in production code, let alone need to calculate anything about one
 
12:16 AM
sorry baad joke
 
@Pheonixblade9 Holy ugly nested fors with no brackets batman!
 
@BradleyDotNET for example... I interviewed for Zillow... that sort of thing is really important for GIS data
@RyanTernier this was sophomore year code in college
forgive me
 
@ginkner software graph
 
ah
 
Time to head to the gym... first time in 3 years. Wish me luck
 
12:17 AM
Like a linked-list, but way crazier
 
@RyanTernier don't work too hard!
 
connected nodes
 
you'll get DOMS
 
right
those things are awesome
 
@ginkner graphs are easy, digraphs are difficult.
@ton.yeung I have a bike trainer and I never use the damn thing
 
12:17 AM
@Pheonixblade9 I'm sure it is :). (note to self. do not interview at zillow :) )
 
one of the really nice fluid trainers, too
 
@ton.yeung Why would I do that when the Gym at my office is free.. and there's a Fertility clinic on the top floor with a lot of nurses who go to the gym/walk by the gym
 
@ton.yeung would rather go ride on the roads
 
@Pheonixblade9 Suffice it to say I would be doing a lot of research if I needed to calculate whatever you guys were talking about
 
@RyanTernier my building just opened a gym that is free, but I don't really have the logistics of getting my laptop bag + gym bag, etc. on the bus
@BradleyDotNET shrug it's pretty basic stuff, something you could learn in a couple hours
 
12:19 AM
the most advanced thing I did with a graph was Dijkstras shortest path. And I forgot how to do that long ago
 
@Pheonixblade9 Leave 3 pairs of shorts + shirts at hte office. When you go tot he gym just wear them home
 
@BradleyDotNET Djikstra's was one thing we did
 
see, I even forgot how to spell it :)
 
@RyanTernier I live out of my bag, I don't really have a personal desk
when this contract is up next week, I'll be moving offices
 
@RyanTernier - If it were me I would feel bad for putting those people through my smell after the gym.
 
12:19 AM
which is too bad because I have a really nice spot...
@SpencerRuport there are showers and free towel service and lockers at my gym
and yeah, I have a 30 minute bus ride home :P
 
@Pheonixblade9 - Overnight lockers?
 
@SpencerRuport the overnight lockers are always full, there are only a couple banks :(
 
@Pheonixblade9 - Ah bummer.
 
@BradleyDotNET my understanding is that this line is listening for the change
OnPropertyChanged("UserName");
 
I think I just need to bring my gym clothes in one of those little nylon drawstring bags and shower after, that should work
 
12:21 AM
but I can't call it like this in the method as its out of context
 
I just don't wanna stink up my work bag lol
 
@BrianJ No, thats raising it
listening for it is myEvent += someListener
 
aka subscribing
 
where my event is the OnPropertyChanged
 
no, the event is PropertyChanged
OnPropertyChanged was a method you wrote to invoke that event
OnPropretyChanged could have been an event
but in your instance it isn't
 
12:25 AM
yes but listening for the event like this PropertyChanged +=
doesn't bring up any options to create an event handler
nwm
figured it out
so I listen for the event
then..
assert inside the event that the property has changed, correct?
@BradleyDotNET
 
So this is the tricky part
 
when I created the event there is no method body as you can see, so this PropertyChanged won't do anything
 
you usually should just set some state in the event handler
 
eg
 
then assert after causing the event to be raised (in your case, by invoking the property setter)
 
12:29 AM
okay I'm gonna have to pick this up tomorrow, 12:30 here, thanks for your help
 
so your event handler might look like:
ChangedPropertyName = e.PropertyName
ChangedPropertyValue = e.NewValue
then you could assert on ChangedPropertyName and ChangedPropertyValue
 
both would be strings correct?
 
NewValue is an object IIRC
you'll have to cast
the name is a string though
Sorry, its been a while since I manually listened to PropertyChanged
 
so that will check that the new value ie `LoginVM.UserName = "Brian V";
` is equal to the property name "UserName", doesn't seem right
 
ok, looks like it doesn't give you the new value
so you would assert that the correct property name was raised
ie: "UserName"
and then you could assert that the property value was updated if you wanted to, though that definitely should never break.
 
12:34 AM
UserName is just a blank string until its populated by the user logging in..so not sure how this test is working
Facebook api handles that the correct name is raised
I think asserting that property value was updated
would suffice for now
could you give a snippet of what this would look like? @BradleyDotNET
the code prior to the event seems fine, just asserting within the event is what I don't understand
okay gotta leave it at that, pick this up tomorrow, bye
 
I already did...
see you later brian
 
ugh
all over this code I see:
 
12:50 AM
I am currently frightened by what comes next
this code is taking far too long to paste :)
 
List<ResultType> list = new List<ResultType>();

var query = from a in this.DBContext.WhateverTable select a;

if(query !=null)
    result = query.ToList();
else
    throw new CustomException("blah blah blah");

return result;
I have thusly shortened it to:
var result = (from a in this.DBContext.WhateverTable select a).ToList();
return result;
of course I could just return it. I kept result in for debugging purposes.
I wish I could talk to the original developers (another company, thank god) and tell them that QUERY WILL NEVER EVER EVER EVER BE NULL
 
I'm more concerned with the completely unnecessary list declaration :)
 
dude you don't even know
they wonder why the DB is super slow to query stuff... there are no FK's anywhere. Not even nonclustered indices in most cases
this code was written in C# by people that I'm pretty sure mostly write Java using DB2 or Oracle or something
 
factories... factories everywhere
 
12:55 AM
when the factories have factories.... run!
 
I've seen it before, not yet here
 
@Pheonixblade9 yeah, i have the solution architect doing that all over its killing me
if(list.any()) {
   return list.First();
}
 
@CharlieBrown yeah, factories are fine, but you don't need a factory and an interface for _every_single_class
@CharlieBrown I mean... that at least COULD make sense?
 
Well, that too...but his linq code makes me want to punch kittens
 
but srsly use .FirstOrDefault()
 
12:59 AM
I have no idea where people got the interface for every class thing, i have literally never seen a blog or tutorial promoting that
 
go read some Java books from the 90's
it is taken to an extreme
 
Can I ask a question about image editing here?
 
you cant try
 
Alright! Here goes. I've never really done a lot of image editing. I need to know how to make the background of an image transparent. I know there's something I'm missing.
 
@BradleyDotNET couldn't rest until I get this figured out
 
1:05 AM
It must be png or gif 32 format
 
kk
 
aka cant be done in windows paint
 
alright. bummer...
 
@BrianJ pushed some stuff now still WIP. Huge hack in the dial for the angular gauge.
 
@Ethan you can try Paint.Net, its free and works pretty good
 
1:07 AM
Gimp is also ok.
 
@JohanLarsson looking forward to implementing it tomorrow, are the props any different from the linear gauge?
 
Alright. I've heard of that program, but I was wondering if there was another way (besides downloading special program, because like I said, I rarely work with images
Thanks
 
@BrianJ The angular gauge has MinAngle & MaxAngle in addition to the ones in the linear.
 
@JohanLarsson cool, aesthetically how does it look?
@BradleyDotNET so the first bit of code I should add to the event is:
 
assert PropertyName.value = e.PropertyName
 
Did not spend many minutes styling it
 
I would assert outside the event handler
and what is PropertyName.value??
 
I was assuming that PropertyName.value?? would be the "UserName" inside PropertyChanged
@BradleyDotNET so what goes inside the event handler, as atm its blank
no wait
this goes inside
ChangedPropertyName = e.PropertyName
ChangedPropertyValue = e.NewValue
 
right
though the second line won't work
If you do that with a lambda, ChangedPropertyName can be local to the function
since it will close over that variable
 
1:13 AM
but what is ChangedPropertyName
 
just some string variable
 
@CharlieBrown also, there's destructors everywhere for some reason
I didn't even know C# had destructors. Stupid tildes.
 
huh
so you comparing two string variables that have been hardcoded?

string ChangedPropertyName = "";

[Test]
public void TestUserNameProperty()
{

MyoTestv4.Home.UserLoginModel LoginVM = new MyoTestv4.Home.UserLoginModel();
LoginVM.UserName = "Brian V";
LoginVM.PropertyChanged += LoginVM_PropertyChanged;

}

void LoginVM_PropertyChanged(object sender, PropertyChangedEventArgs e)
{

ChangedPropertyName = e.PropertyName;


}
@BradleyDotNET
 
@Pheonixblade9 yeah, the code im doing for this client is so aweful sauce
 
If by "hardcoded" you mean a hardcoded string in your test against a hardcoded string in your actual code, then yes
like I said, PropertyChanged isn't a terribly useful thing to test...
looks great
Now at the end of your test method, you can assert that ChangedPropertyName is what you would expect
 
1:15 AM
the above is correct? but LoginVM.UserName = "Brian V"; is never used
okay so I assert the two values
 
Oh, make sure to do the event registration before you assign the value
 
only the L33T hardcode everything. b/c there code is so good it will never change
 
np to hardcode it in a test imo
 
everything in a test should be hard-coded
 
okay
but its still not right
 
1:17 AM
@BradleyDotNET I had lots of tests that would grab data from the DB to make sure the correct data was used in the test
 
@Pheonixblade9 You were right the first time. C# doesn't have destructors :)
 
I can't access LoginVM.UserName = "Brian V"; from within the event, to assert the values of that and ChangedPropertyName
 
66
Q: What does the tilde before a function name mean in C#?

Keith SirmonsI am looking at some code and it has this statement: ~ConnectionManager() { Dispose(false); } The class implements the IDisposable interface, but I do not know if that is part of that the tilde(~) is used for.

 
It's the C++ destructor syntax, but it doesn't behave like a destructor, and it's called a finalizer.
 
@Pheonixblade9 So you had an intentional dependency on a DB? Ugh
 
1:20 AM
@BradleyDotNET they were called unit tests. They were much closer to integration tests. Create account, load products into DB, run feed, compare feed with what you expect it to generate
 
ah, thats a bit different
 
they worked quite well, actually.
I increased the coverage of our code significantly when I was working there
 
I have DB unit tests too. I just hate them :)
@BrianJ Don't assert there!
 
am I supposed to assert `LoginVM.UserName` and `ChangedPropertyName` from within `LoginVM_PropertyChanged`? @BradleyDotNET

problem is, LoginVM.UserName is out of context within the event
 
Assert in the actual test
 
1:21 AM
They call it a finalizer becuase if you use it, thats the last straw. your fired.
 
There is no reason to assert in the event handler
 
@BradleyDotNET sure there is
 
Not in his case
 
i agree with that
 
1:22 AM
@BrianJ there you go
certainly you may have a reason to assert in an event handler in general
 
I'm curious why Jon Skeet says you don't need finalizers for sealed IDisposables
 
ASSert everything!
 
okay so another sleep deprived day tomorrow, for this little class, I hope I get faster at this before start work in the summer
 
Thats a good idea
 
slan
 
1:24 AM
A unit test should take 10 minutes, not 10 hours
(if that)
 
a unit test should take less than 1 second
 
well ya gotta start somewhere
sleep now
 
well, execution time anyways :)
 
"should" *sigh*
Our tests are pretty icky
 
1:39 AM
whoo
got something done today that I said would be done by the end of the week MAYBE
 
thats a good start to the week
 
Just thought I'd say thanks again. It worked perfectly! Can move on again....
 
1:54 AM
@BradleyDotNET yeah especially since it's for the client and I wasn't even sure if I'd get the feature done within the contract at all
 
I'm out of here. Have a good night all!~
 
me too. yay extra half hour billable, I get to leave early on friday
 
 
1 hour later…
3:14 AM
@CharlieBrown I know you named this IContextDataFactory what is that supposed to represent via that naming convention?
 
 
1 hour later…
4:32 AM
@CharlieBrown Also what does that InventoryItem represent in the Domain layer?
 
I've to generate report from 5 to 6 tables so I want crystal report to use datagridview columns n data to display them in crystal report. I do not want to connect to specific table in database expert
 
5:05 AM
posted on February 24, 2015 by Scott Hanselman

Middleman is "a static site generator using all the shortcuts and tools in modern web development." With any static site generator you can run it all locally and then push/FTP/whatever the resulting HTML to any host. However, static site generators are even more fun when you can host the source code in Git and have your static site build and deploy in the cloud. Middleman uses Ruby

 
 
1 hour later…
6:24 AM
mornink
 
hey
can anybody help me on 1 issue
 
6:39 AM
@MariaPithia Don't ask to ask. Ask your question and if somebody knows the answer, they'll answer :)
 
7:33 AM
Using slice, instead of splice, not so good :-(
Morning @BenjaminDiele
 
8:01 AM
@scheien yo!
 
hi guys ...
@scheien : Hey man , how r u doin ?
guys Now, i have a Task that i need to create a Heartbeat thread , Which monitors different background Crons running over into my system(Desktop Application)
I have figured that the basic requirement : I need to Restart in case of any of them fails or gets into a Infinite loop
what else could you guys add upon the same ?
 
@bhuvin Good luck with finding out it's an infinite loop or a really long process.
 
@BenjaminDiele - Yeah man , I guess u can suggest something to know about the same ...
 
hey @bhuvin. I'm doing great. How are you?
 
8:34 AM
@scheien : doing good man
u temme
 
9:00 AM
Shame on me. I wrote code with dutch variable names, descriptions, etc. It felt bad.
 
@BenjaminDiele - I figured out a way for the same, I have my functions defined, in case if its long running those will update the same; Besides that any ways if the Pulse crosses the Threshold ( This is the Main Thinking part) it needs help ...
 
I'm sorry, but I totally don't understand your english.
 
@BenjaminDiele - Actually : I have my Cron's Main Functions which are suspected to take more time, are defined , so i update the Pulse internally from them also, besides that anywhich ways if the Pulse period elapses the Threshold the CRON needs some help ( like restarting the same )
 
@RoelvanUden: ai ai!
 
@bhuvin Is there a reason why you're building this yourself rather than using a proven utility to do this for you?
 
9:11 AM
I wasted a lot of time yesterday on a stupid stupid mistake. Meant to use splice() but typo got me, and it became slice(). bang head against wall
 
JavaScript I suppose?
 
yep
hehe
 
@RoelvanUden - are there any already existing HearBeat sort of utilities ?
 
9:27 AM
@bhuvin I'd bet there are tons. Auto-restarters are plenty around.
I tend to use forever but that's mostly for node.
 
9:37 AM
Can I bind a wpf margin to a double?
When typing in Margin="6" the converter kicks in automagically and does double > size
I'm trying to avoid writing a converter cos they are so ugly.
 
Hi All
Is any one working in Xamarine
 
@JohanLarsson Hm, maybe if you use Margin-Bottom or something like that?
 
ok I'll try, not sure it will work cos struct
 
Ah, yeah, I'm just guessing too.
 
not sure why I try this hard to avoid a simple converter
guess the object is so turnoff
 
9:54 AM
Hello daaaarlings
 
Howdy sailor!
 
I have a .xsd. Does anyone know of an easy way to generate xml test data?
or suggestions for good VisualStudio XML tooling?
I haven't XML'd properly for years
 
just the xml structure or with test data?
I've just used the xsd to create classes
xsd.exe
 
@Squiggle yes, try right mouse button on it.
 
aye I've done that with xsd.exe - I'm writing an XML import method. I just don't want to have to code an array of test documents by hand.
<-- lazy
 
10:07 AM
something like this then? xmlgrid.net/genXml.html
 
o/
 
lo @Sippy
 
o/
@scheien perfect!
 
Hi anyone!
Q.A stream of integers is coming. Find median of numbers received till now?
Approaches - 1.Insertion Sort (Time complexity is more)
Self Balancing BST(okay)
now my doubt is someone told me you can use two heaps
one max heap on the left and one right
I'm not sure if I understand how to do that...can someone elaborate it please?
*min heap on right
 
> Find median of numbers received till now?
return "No.";
Problem solved.
 
10:10 AM
@Sippy This is serious . I was hoping for a solution rather than a joke man!
 
@psychoCoder Storing all inbound data and recalculating on every digit received?
@psychoCoder or are you looking for a clever algorithmic approach?
 
14 hours ago, by Roel van Uden
Hah, this one is great http://www.jasonbock.net/jb/News/Item/7c334037d1a9437d9fa6506e2f35eaac
@RoelvanUden much lol
 
that's oooold
 
Funny tho
 
yes...I know using AVL trees..since it is self balanced so elements on the left will be smaller and elements on the right will be greater
@Squiggle though can you help me with heaps?
@Squiggle I Found this
8 down vote


You have to maintain two heaps one max heap ( which contains the smallest N/2 elements seen till now) and one min heap ( which contains the largest N/2 elements). Store the extra element aside if N is odd.

Whenever you call the function getNext(),

If N becomes odd, save the new element as the extra element. If necessary, exchange that element with one from the min-heap or max-heap to satisfy the following condition

max(max-heap) <= extra element <= min(min-heap).

If N becomes even, do the same as above to get a 2nd extra element. Then, add the smaller one to the max-heap a
but it's confusing me a bit can you elaborate a bit using an example
 
10:18 AM
It has 8 down votes?
 
@psychoCoder I don't really have the time to invest in this right now, and it's not my forte. Hang around and there'll be a couple of other chaps who are probably better adept.
I'm sure there will exist an optimal solution to this already. Somewhere...
 
@Sippy No it has 8 votes up!.
Never Mind I got it !
 
I haven't read that but I'm pretty sure it has your whole heap implementation in it.
 
F4z
10:57 AM
Let's say I have two 'items' used in my program. Let's give each of the two items a name:
- Trees
- Leaves

Now somewhere in my program I can manage these 'items' so If I want to rename them or delete them then I can do so. Let's say I'm using 'Trees' somewhere in my program. I decide then I want to rename the 'Trees' item to 'Reaves'. Now remember how I mentioned that I used 'Trees' somewhere in my program, but now that i've renamed 'Trees' to 'Reaves'. How do I automatically change all the 'Trees' to 'Reaves' since I renamed it? How can I identify this item and track and update it's changes?
 

« first day (1592 days earlier)      last day (3361 days later) »