« first day (1320 days earlier)      last day (3854 days later) » 

19:00
or please don't kill me
user1804599
Wait.
user1804599
I have a better one.
Enumerable.Range(0,99).Skip(50).Take(50);
user1804599
Enumerable.Range(0, n).Select(i => i * myString.Length / n).Select(i => myString.SubString(i, myString.Length / n))
user1804599
inb4 off-by-one error
19:03
I thought we were sequencing
user1804599
Enumerable.Range y u no take step you piece of shit.
.Select(x => x*step)
Enumerable.DoWhatIWant()
19:17
Anyone works with ASP.net ? Should I learn ASP.net Web Forms and than move into ASP.NET MVC ? or they are independent of each other ?
Web Forms was made for people who didn't understand the web.
Then Microsoft realized that any decent developer doesn't want that, and made MVC.
So, go MVC, for all that is good and nice in this world.
user1804599
Indeed! Any decent developer doesn’t want the web. :)
3
user1804599
Roel it’s okay I still love you <3
I wuvv you too!
user1804599
19:22
I should write another blog post.
@rightfold 'How to wuvv a Roel without sounding gay'?
user1804599
By being a girl!
I have no idea~ some people are like that.
user1804599
Hahaha I'll laugh my ass off if you go through with that one
user1804599
19:25
I probably won’t.
@drch Are you still in vancouver?
whats the easiest way to explain how a linq/lambda query works to someone ?
can C# interfaces be partial?
@ton.yeung I'm moving there in July
@RyanTernier He's in Germany, lol
user1804599
19:39
@JohanLarsson Yes.
user1804599
As well as structs.
did you know or try?
user1804599
I looked it up.
user1804599
24
Q: Partial Interface in C#

GravitonDoes C# allows partial interface? i.e., in ManagerFactory1.cs class, I have public partial interface IManagerFactory { // Get Methods ITescoManager GetTescoManager(); ITescoManager GetTescoManager(INHibernateSession session); } and in ManagerFactory.cs class, I have: public partial interf...

@ton.yeung Yea, 4 hours to my kids now intsead of 9.
@ton.yeung My girlfriend also got accepted into the advanced nursing program (2 years instead of 4, only if you already have a health degree)
so we're moving for her
user1804599
19:40
Not allowing partial interfaces would be a needless arbitrary restriction.
@rightfold ty sir :)
Fat Fingers + Stupidity vs the Cloud
@ton.yeung She has 2 kids, they're walking germ factories that spread germs that create germs, they're the Zerg of germs
hard to be a germaphobe if you have kids :P Mommy, look i stepped in poo. It smells like...
mom: HOLY F236@#^ WHAT DID DYOU JUST PUT ON MY NOSE
yup. My kid did a Poocaso spree. Hated his diaper... he craped in it, then took it off and painted the walls, crib, floor, everything with it.
posted on May 28, 2014 by Scott Hanselman

I worked in Java for a number of years at Nike, writing an order management application that would run on 4 platforms. We used to joke that we'd "write once, debug everywhere." Now, this was the early days of Java, but the thing was, everything was 'owner draw.' That means a button looked the same everywhere because it wasn't a button as far as the operating system was concerned. It was a pi

Quick question for you guys, as I am new to c#
What exactly is going on in the following code segment? translatebutton.Click += (object sender, EventArgs e) => {};
user1804599
It adds a new event handler to the Click event.
19:48
you subscribe to an event
user1804599
And the event handler does nothing.
It's 1. an event handler and 2. a lambda expression
You can google both those terms
@rightfold it could be leaking :)
Excellent, thank you for the fast response
user1804599
myButton.Click += (object sender, EventArgs e) => { Console.WriteLine("button clicked"); }; would print a message when the button is clicked.
19:49
is the syntax correct?
user1804599
Yes.
I write += (_, e) => {}
user1804599
That works as well.
user1804599
Time to write a video game.
@rightfold Up yours, I've been toying with making a compiler
user1804599
19:52
I have made a compiler.
What does it compile to?
user1804599
To JavaScript, duh.
user1804599
Everyone compiles to JavaScript.
19:53
I've written compilers to .NET
I want to write a compiler to native though
user1804599
Me too.
user1804599
To LLVM you mean.
I don't think so
user1804599
Hmm, what programming language shall I use for my video game?
@rightfold JavaScript, duh
user1804599
19:54
Eww, no. I’d rather write it in a language that isn’t horrible.
@rightfold Ada95
@ton.yeung Native i386 for starters
COBOL
happy birthday to me! free cake on my desk, yippee!
user1804599
I was thinking of Erlang or Haskell.
user1804599
19:55
But I don’t know how good Haskell websocket libraries are
I'm working on learning ELF, and if I'm lucky I'll find time for PE
I need a language to compile though
user1804599
Because break is imperative and Haskell is functional.
19:56
I don't want to copy C
user1804599
@KendallFrey Go.
user1804599
Go is simple as fuck.
I don't want to copy any language
oh yes, bootstrapping as well
user1804599
I will use Erlang.
you mean "Erlang will I use" right?
20:09
@RoelvanUden - Did you already finish your line sequencer?
@TravisJ jjus
It turned out a little different, 2 lines, but meh.
user1804599
@RoelvanUden If it’s more readable then that’s okay.
It's not really all that interesting Johan :P
Just noticed ReSharper has some slightly different edition options in their licensing.
"C# Edition: Provides Full Edition functionality but doesn't work with VB.NET source code."
Is there supposed to be a downside?
20:11
// Initialize the pieces.
var pieces = new List<string>(line.Split('\0'));
// Ensure suffient pieces are available.
while (pieces.Count < persistenceVersion) pieces.Add(string.Empty);
// Add the pieces.
persistence.Add(pieces);
It was more readable that the Linq magic.
user1804599
Now make it into a function!
No need. This one method does quite a lot of magic, so a little more is fun!
user1804599
Ik ga poepen.
20:37
With a Windows Forms application, when you release a new version of the application, should you simply manually change the assembly/file version to match your own versioning system?
is there a way to annotate the properties on an object?
an instance object.
@MillieSmith - There isn't but if you give an example I'm sure someone could suggest a way to solve whatever problem you're having.
@MillieSmith - Annotate with filters?
the background is that I'm diffing two objects and I want to be able to reuse the code that populates the views without checking whether it's the diff or not
I feel like I don't belong in here anymore =( I've been in Obj-C world for 3 days now =( I miss C#
20:43
@EvanL why not Xamarin?
So I want to be able to tag each property as "modified" or not
and for enumerables, i want to be able to mark each item as added, removed, or present in both sets
@MillieSmith We have a bunch of older apps that were coded in Obj-C. We use Unity now for anything new, but I'm on the CE team so have to debug and fix old code.
fun stuff @EvanL
i do not envy you. obj-c seems very painful sometimes
@TravisJ what do you mean by filters?
[ActionFilter]
Will those work at an instance level @TravisJ?
I didn't understand your use of the word annotate
@Spencer - Depending on the framework you are using they can
20:47
I've found that each time you change the assembly/file version of a WinForms app, it creates the user.config in a new folder in %AppData%. This effectively resets all user settings when they install a new version. How might one resolve that? Create my own settings file in a consistent location?
maybe i'm missing something, but it doesn't look like they work at the instance level
code helps :)
@MillieSmith - They don't directly. However it is possible to use the instance and the property as a key for a shared look up to store state/diff/history related information.
ah, good point
i'd hate to annotate every property on the necessary objects though
Or you could use a similar approach as nHibernate to create a child class on the fly and override the appropriate members with accessors that observe changes to the property.
20:50
that just makes everything messy
i'm not really observing changes as they happen
i have two objects, created at completely different times
maybe i'll just maintain a separate dictionary and hash the instance and append that to the fully qualified property name and use that as the key into the dictionary
it won't work if it's a list of booleans, but i don't have lists of non-custom objects, and i don't currently see a better way
21:34
It would be interesting if there were a way to profile a question to forecast how many views it was going to get over the next six months
@MillieSmith - I wish you had a snippet of code you could show
Even just how the desired effect would be called
@MillieSmith - I recognize you don't need the history but IMO writing a bunch of boilerplate code to observe when a property is altered is going to cause more headaches in the future. It means every one of your accessors needs to maintain the same code to set the dictionary values and if someone forgets or does it incorrectly you're going to have a hard time tracking it down.
Also should the logic ever need to change you're going to have a substantial refactor on your hands.
Automating the behavior is the best solution in the long run.
What ever happened to using IObservable?
Or events?
You still have to manually type out all that code.
You accessors become the largest part of your class definition.
Why does no one mention linq shouldn't be used to cause side effects? stackoverflow.com/q/398871/1026459
If no one there does, then does that mean I am incorrect?
Even Jared Par offers a solution for using linq to cause side effects
mind *blown*
anyone ever have to make the decision between using a FixedDocument vs. FlowDocument?
21:51
ok all I want to do is have the name of my items show up in this damn datagrid and It keeps crashing.
Do I use dataMember? or what?
nevermind, i don't think I can put a datagrid in a flowdocument -_-
@猫肉かわいい oh dude, that's easy. Just use dataGrid.ShowMyShitYouPieceOfShit(fuck);
hahaha
you beat me to it
@Pheonixblade9 I might as well type that, might get further
For large sets, for example:
var total = 82300;
var numList = Enumerable.Range(0,1000).ToList();
21:56
@TravisJ worst case O(n!), yeah
yeah worst case
at least OP is responsive
it's not a bad question
would be better in se.math
Its freaking rough. I started to code it, got like 3 recursive levels deep and was like f this I am not implementing an NP-Hard algorithm for a random answer
:)
the fact that it's ordered makes it tough
@Pheonixblade9 That reminds me of the guy in JS that was asking for CSS that was not responsive.
21:59
How about an easier question, such as how do I have things show up in a datagrid? :)
3
Q: Getting all possible sums that add up to a given number

dragon112I'm making an math app for the android. In one of these fields the user can enter an int (no digits and above 0). The idea is to get all possible sums that make this int, without doubles (4+1 == 1+4 in this case). The only thing known is this one int. For example: Say the user enters 4, I would...

@TravisJ I think it's easier to go the other way
find all sums that add up to that number
rather than find all numbers that add up to that sum
if that makes sense...
I think it's o(2n) => o(n) best case, O(n!) worst case
@Pheonixblade9 - The hard part was getting the smallest possible set of them
@TravisJ well, that's a sub problem. It's easier, so you drop that factor
it's easy to brute force, hard to do it efficiently
@Pheonixblade9 - Certainty is where the pain comes in.
the subproblem is O(N), much faster than O(n!)
22:06
@Pheonixblade9 - I suppose it depends on parameters. If the list of numbers is guaranteed to be sparse then it is a trivial endeavor.
just answerList.Min(a = > a.Count);
With larger numbers though, it is a lot harder to calculate all the sums.
If the list is not sparse, things start to get bad real quick
Consider this:
var total = 45023;
var numList = Enumerable.Range(0,25000).Where(i => i%6 ==0).ToList();
You would need at least 14 numbers, but there are a lot to choose from (over 4000).
Which 14 would you take?
That's a shit ton of entries.
Always gotta model the worst of the worst :)
It involves a lot of swapping
@TravisJ yeah I wish had a snippet of code too lol. it's really just T one; T two; T diff = Diff(one, two);
Then I pass diff.subobject to a new viewcontroller (ios app). then that vc checks subobject[4] to see if it's changed and sets the cell color to green if it's added and red if it's removed or white otherwise
22:15
@TravisJ that's a good optimization - start with large numbers as a subset.
@Pheonixblade9 - You would actually want to go the other way though I think. Start with the first n numbers of the set that equal the total. And then try to combine/replace them into other larger numbers in the set.
@TravisJ right - make it somewhat recursive, maybe?
I think partitioning or factoring is the correct answer to this
Always need recursion if you want a performent algorithm :P
@SpencerRuport it's just that it's not when a property is altered that I need to do anything. It's a specialized messaging app. There's a certain type of message that comes in occasionally that the users need to be able to visualize changes to. So the object's properties are not changing in real time. The accessors don't need to handle anything.
41
Q: Finding all possible combinations of numbers to reach a given sum

James PoulsonHow would you go about testing all possible combinations of additions from a given set of numbers so they add up to a given final number? Example: Set of numbers to add: {1,5,22,15,0,...} Desired result: 12345 P.S: Asking this problem as maths isn't my forte and wondering how this could be a...

22:17
@MillieSmith - Then I guess I still don't understand the problem. Why would you want to use annotation if you already have the old values and the new values to compare?
that solution is O(2^n)
lol dat 80s music
eww 2^n
I'm just trying to make it a generic solution
so that the UI code won't have to change down the line
I will at least have to propagate both objects through the hierarchy of UIs as I drill down through lists
which is half the battle
it's entirely possible i'm making this too difficult
i just want to be able to give it the diffed message or the regular message and have everything work, and all the code be the exact same for populating the UIs, except for the coloring code
Is it time to go home yet? :[
30 minutes for me
22:28
We had a meeting scheduled for a feature I'm supposed to be working on. I should have started like a week ago but there's some missing behavior that needs to be fleshed out. Nobody who knows how it currently works showed up to the meeting.
the object is a hierarchical object with lists and properties and sublists etc.... I suppose the question comes down to whether you think comparing and passing equivalent objects through quite a few UIs is a better approach than generically comparing the objects, passing the required object type into the UI, and then checking some dictionary for changed values in order to color code them
heh. If no one knows how it currently works, they'll believe anything you say :)
@MillieSmith - I'd create a model for the diff result which allows me to iterate through all the defined properties as strings and display them as altered by examining an associated boolean.
like a dictionary that contains dictionaries?
@Pheonixblade9 - The permutations are interesting, however, they do not show subsets.
as values obviously
22:37
return ComObject.IsPointInside[ref point, useBox];
ref as an indexer WTF
One thing I dislike about C#... there's no ^ operator
10^2... vs Math.Pow(10,2)
there is an ^ operator
F# has **
does it work in C#?
22:40
yeah
Ryan was referring to a "to the power of" operator
if you want ** in C#, go and add it in Roslyn
CodeHunt 1.10 is anoying
linear operation (hint)
22:46
@RyanTernier 1.10 sucked... so does 3.01 btw.
1.10 solved
didn't get the x/3
1.10 is ok compared to many of the others
if they want to make codehunt slower I think they need to sabotage the network card.
they must be saturated with animations.
Has anyone here worked with Universal apps yet in VS2013?
@MillieSmith - A dictionary of something. I'd prefer the dictionary have the Property path as the key and then use a custom object for the boolean and whatever other necessary data you require but yes.
22:58
This is what annoys me about professors. They provide slightly obfuscated code in order to confuse people so they seem smarter when explaining it. A Stanford professor explains simple permutation with this code:

public void RecPermute(string soFar, string rest)
{
	if(rest == "")
	{
		Console.WriteLine(soFar);
	}
	else
	{
		for(int i = 0; i < rest.Length; i++)
		{
			string next = soFar + rest[i];
			string remaining = rest.Substring(0,i)
							 + rest.Substring(i+1);
			RecPermute(next,remaining);
Thanks Spencer. I'll try that if what I'm working on falls through.
Do you think I'm over-analyzing this and trying to make it too generic too early?
Nope. Never a bad time to ask if it should be generic.
It obfuscates the string concatenation and uses non standard naming conventions..
I'm young, and I think I have a tendency to over-engineer
k
@MillieSmith I'm old, and I think I have a tendency to over-engineer :D
22:59
Look at this code, it does the same exact thing, but reads properly
public void Permutations(string read, string queued)
{
	if( queued.Length == 0 )
		Console.WriteLine(read);
	for( int i = 0; i < queued.Length; i++ )
		Permutations(read + queued[i],queued.Remove(i,1));
}
@MillieSmith - What you'll learn is that your employers will consistently pressure you to under-engineer and then complain when your timelines keep getting longer.
</rant>
haha, there goes my hope of it going away xD
yeah. my friend is going through that right now
the constant struggle of do it right or do it fast
Dijkstra's 41 rules of programming
do they still teach that?
not that i saw
they teach a lot of Dijkstra in multiple classes
23:00
If doing it correctly now takes an extra day but you can see it saving you a week over the course of a year it's worth it.
but I never saw his 41 rules of programming
and I graduated last year
@TravisJ there is/was a tumbler rant generator
I'm constantly dealing with that in my current project. They took shortcut after shortcut so stuff that should be simple ends up taking weeks and they wonder why we keep going over budget.
yeah. i need to start looking at what certain implementations buy me instead of trying to go with what i consider to be inherently better
lol. nice
So I guess no one?
23:03
@DemCodeLines - Not me. I haven't even used VS2013 yet.
@DemCodeLines we're only just starting to get 2012 rolled out to developers :(
I don't know if VS2012 has Universal Apps thing
I have 2013 WD at home but just for playing with new stuff
I don't believe it does.
what is a universial app?
23:03
we got 2013 almost immediately
but I've never messed with Universal.
@JohanLarsson Building a single codebase that works across Windows and Windows Phone.
And XBox
ty
how is win phone selling?
I bought one and I love it.
I want to start writing apps for it but I only have VS2010 at home.
@DemCodeLines a portable class library?
programming for Windows Phone would be nice. I'm pretty sure databinding with mvvm is supported.
23:09
I think WinPhone is great. Windows Phone 8.1 pretty much put WP on par with everything else out there if not ahead (CORTANAAAAAAA!!!!!!!!!)
@MillieSmith Kinda, it's basically porting made easier.
hmmm... that would be nice
I want to do some proper home automation - motion sensors, lights on & off at programmed but semi-random times, curtains opening and shutting. It's not so hard, just fiendishly expensive to get going
relays and actuators are expensive.
the guy I was working for 10 years ago was using it then. it helped that his wife was earning even more than he was
but yeah, you're right, that's the killer
you can make 'em cheaper, but they wear out faster
yup. and then you have to consider rigging. unless you're a talented mechanical engineer the way you attach all this stuff to whatever it's controlling is going to look shoddy and function intermittently.
i worked on a project where i was trying to get water fountains to sync up with music. it's surprisingly difficult.
I mean, I knew it wasn't easy but it just surprised me how much experience I lacked with regard to what I needed to get it to work the way I wanted it to.
23:26
you know those big water fountain & music displays you can go to see? The biggest one I've yet seen was in China - I think I was in Xi'an - and it was so big you could walk right through the middle of it. Possibly a quarter of a mile from one end to the other
nice
Yeah I started learning about all sorts of things I had never considered. Laminar flows, water hammer, direct acting valves versus diaphram valves, cutters etc.
If you want a fun project, sync your Christmas lights to music
whoosh
No mechanical worries
that was the sound of what you said going straight over my head
23:28
@KendallFrey - Well the mechanical aspect is what drew me to the project.
To each his own :)
T-60 and counting.
to what?
home time, I'm guessing
23:37
whereas it's bed time here!
zzzzzzzzzzzzzzzz

« first day (1320 days earlier)      last day (3854 days later) »