« first day (2082 days earlier)      last day (2860 days later) » 

7:00 PM
vomit sweaty
 
Are CIL programs platform-independent?
 
@MoonOwl22 no they run on Mac as well as in Windows
no problem
 
Depends on the platform you're trying to be independent from.
 
Windows
I am stuck between going with QT and C++ and sticking with C# and GTK
 
There's Mono, but you have to decide if Mono fits your needs.
 
7:02 PM
@JABFreeware so when you say "no" you actually mean "yes"
 
@VeronicaDeane It must be opposite day in his timezone
 
@MoonOwl22 If you want a UI, go with HTML
 
@VeronicaDeane !false
!!true
 
@JABFreeware That didn't make much sense. Use the !!/help command to learn more.
 
does that even work?
I should try that
 
user47589
7:03 PM
!!> !!true
 
does what work
 
@Amy true
 
nice
!!> !!!!!true
 
!!> !!![]
 
@JABFreeware true
@GrantHill false
@JABFreeware false
 
7:03 PM
!! is a well-known shortcut to convert a value to a boolean in JS
 
@VeronicaDeane Certainly not
 
SHUT UR FACE
 
Pfft
 
!!> [] == ![]
 
@VeronicaDeane true
 
7:04 PM
get rekt skrubz
 
!!> 3 + "0"
 
@GrantHill "30"
 
@VeronicaDeane indeed forget that
 
@VeronicaDeane I'll think about it. Dankie
 
!!> 3 - "1"
 
7:04 PM
forgot
whats wrong with me today
 
@GrantHill 3
@GrantHill 2
 
my console.log is showing many errors
 
Try closing your eyes.
Then you won't see any errors.
 
Tell it to cover up, nobody wants to see that
 
@TomW It doesn't listen
 
user47589
7:05 PM
the same thing that's wrong with you every other day
 
@Amy every other as in tomorrow I will be fine or every day I have this problem?
 
user47589
i'm not sure how you go from "every other day" to "tomorrow"
 
user47589
this might be related to what's wrong with you. when was the last time you were debugged?
 
Sometimes "every other X" means "the Xs alternate"
 
@Amy I showered last night
exactly HillGiant
so if I'm buggy today will I be fine tomorrow
or does she think ims always buggggy
 
7:16 PM
    // Why can I do this
    class Stuff
    {
        public void Do() { Console.WriteLine("Yo"); }
    }

    class Thing : Stuff
    {
        public void Do() { base.Do(); }
    }

    // But not this
    class Stuff
    {
        public void Do() { Console.WriteLine("Yo"); }
    }

    class Thing : Stuff
    {
        public void Do() { }
    }

    class Item : Thing
    {
        public void Do() { base.base.Do(); }
    }
 
I don't think you're allowed to stack bases.
You can only go up one level at a time.
 
So it's impossible to access two levels up?
 
Well, you could have Thing's Do() call base.Do().
 
user47589
i dont know about impossible but its bad practice
 
That too, @Amy.
 
user47589
7:18 PM
none of your methods are overridable
 
public class SuperBase
{
    public string Speak() { return "Blah in SuperBase"; }
}

public class Base : SuperBase
{
    public new string Speak() { return "Blah in Base"; }
}

public class Child : Base
{
    public new string Speak() { return "Blah in Child"; }
}

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Child childObj = new Child();
        Console.WriteLine(childObj.Speak());
        Console.WriteLine((childObj as Base).Speak()); // casting the child to parent first and then calling Speak()
 
user47589
technically your Thing methods should have the "new" keyword to work.
 
lazy and google gave that which looks right
 
user47589
that's not quite the same thing
 
user47589
he's asking about using the base keyword.
 
user47589
7:21 PM
this isn't the C or C++ room.
 
user47589
Please ask in the appropriate room.
 
So I have started implementing infinite scrolling / pagination for a web app. I'm a bit stuck on how to gracefully handle resetting things like (eg. page count, a global js variable) if the content of the page changes.

Basically the main page is a feed of news stories. The user can search, or filter by type. and all of it happens via ajax

Since the content can be changed via ajax at anytime by the user it makes it difficult for me to cleanly reset things.
 
@Amy but I'm so used to you guys and your clear answers
 
user47589
That's nice.
 
user47589
Please ask your question in the appropriate room anyway. thanks.
 
7:24 PM
Sorry for that
 
This FactorySubscriberMessage class takes a boolean and an int and returns an appropriate object to a unit test. It does this by going into a giant if/else if block with nothing but if (index == 1) else if (index == 2) etc. It's a shame nobody came up with a data structure to handle "I have this integer, please give me the thing it corresponds to." You could even give it a cool name like "an array".
 
@MoonOwl22 best of luck in the lounge. Hopefully you catch them in a good mood or are in their circle
 
user47589
"an array" is the coolest of names, if you ignore "the Fonzie"
 
I'd probably use List<T>s a lot less if I could declare Fonzies.
 
user47589
using Fonzies made my code 20% cooler
 
7:27 PM
Brb, subclassing Array
 
@JABFreeware Thanks
 
Back, apparently you can't do that.
 
user47589
lol
 
user47589
well you didn't try very hard
 
user47589
7:28 PM
put your back into it
 
What if I pull something?
At least zero Americans are injured in object-orientation accidents every year. Don't be a statistic.
 
user47589
@GrantHill that's a risk i'm willing to take
 
@GrantHill indians are?
 
user47589
are Zero Americans like Coca Cola Zero?
 
user47589
zero calorie alternatives to americans?
 
7:31 PM
nvm
 
@JABFreeware "SyntaxError: missing ; before statement"
 
Zero Americans has almost all the taste of Americans Classic.
 
@GrantHill inserting the panini the wrong way round, for example?
 
Paninis are dangerous. Every year, they injure at least as many Americans as the Hundred Years' War did.
 
user47589
indeed
 
user47589
7:36 PM
We are to Panera Bread as Don Quixote is to windmills.
 
ya know it is a bad day when you are writing this crap code
http://pastie.org/10893290
 
user47589
dear god
 
Have you considered loops?
 
user47589
its full of stars
 
Or, like, one loop.
 
7:38 PM
typeof(IEnumerable<>).IsAssignableFrom(typeof(List<int>)) returns false. Colour me intrigued.
 
to add the parameters humm guess I could have
 
user47589
well of course, @VeronicaDeane
 
for (int i = 1; i <= 57; i++) { cmd.Parameters.AddWithValue("?", row["Field" + i].ToString());
 
user47589
you can't assign values to open generic types. it doesn't matter what you pass to IsAssignableFrom, it will always return false.
 
7:45 PM
I have a type variable containing A<IEnumerable<Derived>> and a variable containing a IEnumerable<Base>. I can't figure out a way to cast this to a IEnumerable<Derived> based on the type variable, without doing a lot of ugly reflection.
@Amy I fully expected it to throw an exception.
 
user47589
i want to clarify the question first, is the first type A<IEnumerable<Derived>>?
 
user47589
or was that a typo
 
no, that's what it is
wait
yes
stop making me question myself
 
user47589
you can use the LINQ function OfType<blah>() to get an IEnumerable<blah>
 
user47589
i think there's also a Cast<T>() method, can't quite remember
 
7:47 PM
I know, but the type parameter isn't known at runtime afaict
 
user47589
you can still call the LINQ method by constructing the method at runtime
 
right
that's what's ugly and I'm trying to avoid
 
user47589
yeah
 
user47589
reflection is probably necessary
 
subproblem: the type variable is actually A<B> where B : IEnumerable<Derived>. Is it possible to get Derived given B, in the general case?
 
user47589
7:51 PM
you mean you have a type variable that contains A<B>, and you want to determine what type is used in the generic to close B?
 
um, idk
what does that mean
 
user47589
I'm not sure I understand your question.
 
user47589
can you give an example, in pseudocode?
 
Imagine a FooCollection : IEnumerable<Foo>
 
user47589
ok
 
7:52 PM
then given typeof(A<FooCollection>), is it possible to extract typeof(Foo)?
 
user47589
yeah
 
user47589
one moment
 
I think I figured it out
 
user47589
typeof(A<FooCollection>).GetGenericArguments()[0] will give you typeof(FooCollection). from there get the base type, then the generic argument again
 
Is it possible for a class to simultaneously implement an Interface and inherit a Base Class?
 
7:56 PM
Does anyone here know of a good .Net implementation of a fixed size Stack<T>? I am looking to implement something that would need a stack (first in, last out), but I need to limit it's max size, so say max size is 10, when I put an 11th item in, the oldest item (bottom of the stack) gets dumped.
 
.GetInterface(typeof(IEnumerable<>).FullName).GenericTypeArguments[0]
 
user47589
yes @catgocat
 
user47589
that also works, @VeronicaDeane, and is better than what i came up with
 
@catgocat yes, a class can extend zero or one base classes, and implement zero or more interfaces
@pstrjds Hmm, that's a peculiar requirement
 
 class MyClass : IInterface : BaseClass
Doesn't work
 
7:57 PM
syntax is wrong
 
It's class MyClass : IInterface, BaseClass
 
@pstrjds just wrap your own Stack and override the push to pop when the limit is reached?
 
MyClass : BaseClass, IInterface
 
Oh ok thanks
 
user47589
base classes must come before interfaces
 
7:57 PM
Put the class first, like Veronica did.
 
@CuddleBunny He said pop isn't what he wants, but yeah, custom class may be the way to go
 
user47589
don't put the class first, put yourself first. that's how you get ahead in life.
 
@VeronicaDeane - well I am implementing a simple undo/redo pattern in an application and I need to limit the size - I had thought of extending Stack, but thought if there is one out there already why reimplement the wheel.
 
@VeronicaDeane oh, you're right. then wrap a list and shift when you push past the limit.
 
@pstrjds ahh that makes a lot of sense now
 
user47589
7:59 PM
sounds like a Most Recently Used (MRU) use-case.
 
@Amy - yes - that is exactly what it is - it is for undo/redo, but I want to limit the history size as the data load could be quite large. This is for an editor type application.
 
What is the difference between double result1 = calculateAverage(); and double result1 = calculateAverage(null); when calling:
   static double calculateAverage(params double[] d)
        {
            double sum = new double();

            foreach (double doubleValue in d)
            {
                Console.WriteLine("In foreach");
                sum += doubleValue;
            }

            return sum/d.Length;
        }
 
I think I will just have to implement it myself. I have the option of either a fixed size array as the base or a LinkedList
 
Won't the calculateAverage() case give you an empty d, and calculateAverage(null) give you a null d?
 
user47589
8:02 PM
@pstrjds yeah a custom implementation would work best
 
Yes. Yes it will.
 
@GrantHill so calculateAverage() is passing an Array with 0 Elements?
 
@CuddleBunny - Thanks - that is basically what I was going to implement, was just wondering if anyone had seen a NuGet package or something that already had this
 
@pstrjds there probably is, but I always find that it takes longer to find one than roll one myself
 
@Amy I figured out how to add the user and the role
 
8:03 PM
@MatthiasHerrmann Yeah. params means "take the rest of the arguments and bundle them into an array".
 
user47589
@MatthiasHerrmann there is no difference. those calls are literally the same thing.
 
What's the name of those programs that evaluate an expression and show it to you like @GrantHill 's picture
 
public ActionResult Create()
        {
            var Role = new IdentityRole();
            return View(Role);
        }

        [HttpPost]
        public ActionResult Create(IdentityRole Role)
        {
            _context.Roles.Add(Role);
            _context.SaveChanges();
            return RedirectToAction("Index");
        }
 
A REPL shell?
 
Yes that
Is there such thing on visual studio?
 
8:04 PM
@Amy I'm getting an exception when passing null like calculateAverage(null) in the foreach loop
 
but how do I add my user to the role?
 
Rosy-chan has a repl
 
I hope so. That's what I used.
Built right into VS.
 
user47589
@MatthiasHerrmann well yeah, you can't iterate over a null object.
 
8:08 PM
So they're not literally the same thing?
 
That's what I meant :)
 
@GrantHill I don't have that on my VS, where did you get it?
 
@catgocat View > Other Windows > C# Interactive in VS2015
There's also an F# Interactive and a Powershell Interactive.
 
Yeah, not there
 
welp, 773 more tests are failing after my changes
 
8:15 PM
Oh, I think I need to install a VS Update.
 
8:26 PM
@VeronicaDeane I'm impressed you have 773 tests
I'd be impressed if our solution had 73 tests
 
We have 1039 tests, but most of them don't do much.
 
That's generally the idea.
 
We have 1069 active tests atm
 
Oh my god, Newtonsoft, stop generating conflicts
 
Xamarin.Forms question, I've got a ControlTemplate, how to I bind to a command globally rather than to one in the target viewmodel?
 
8:46 PM
0
Q: How do I add an Identity Role to my Application User from my RoleController?

SkullomaniaMy application uses AD authentication to log users in. In addition I have made it possible for my potential admins to add new ApplicationUser and `IdentityRole'. With the help of a nice tutorial I have also taken the additional step of doing some customized filtering for users who are part of sp...

 
@Skullomania whats not working?
 
Everything is working I do not know how to Add the role to the user
in the database from the controller
 
@Skullomania look into the UserManager
 
@Michael I tried this..
[HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult RoleAddToUser(string UserName, string RoleName)
        {
            ApplicationUser user = context.Users.Where(u => u.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
            var account = new AccountController();
            account.UserManager.AddToRole(user.Id, RoleName);

            ViewBag.ResultMessage = "Role created successfully !";

            // prepopulat roles for the view dropdown
however I get a object is not in reference
error
 
user47589
have you debugged it? you have a null object somewhere
 
8:57 PM
I will plug it back in and show you what it points to.
it points to
return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
 
Also it doesnt look like you are ever saving changes?
 
user47589
set a breakpoint on that line and see what is null
 
user47589
I'm guessing the result of GetOwinContext() is returning null.
 
user47589
but i dont see that line of code in the function you pasted above
 
that is in my account controller
 
user47589
9:02 PM
okay, back up. is the error happening in RoleAddToUser or not?
 
haha I found the greatest bug task ever
Steps to reproduce are: "check in code"
 
Everyone panic, I have return
 
Everyone rejoice, I have chocolate.
 
He's got return! Hit the deck!
 
Everyone stop
 
9:03 PM
HAMMERTIME!
 
user47589
@Michael no no no, you need to do
 
@Amy yes
 
user47589
sudo stop --everyone
 
Nah, I run Windows, so your sudo has no authority over me
 
user47589
9:04 PM
@Skullomania okay then, what line is throwing the exception? the line you pasted is not found in the RoleAddToUser method
 
!!sudo stop
 
HAMMERTIME!
@VeronicaDeane Okay.
 
user47589
@Darkrifts as with most pony things, this sudo is magical and affects windows too.
 
Nah
Windows 10 is too busy spying on me to care
 
Hey - any c# interop pro's around?
 
9:05 PM
will amateurs do?
 
@VeronicaDeane Only if they're barely legal.
 
@Amy no lines from the method is throwing the exception. The code I pasted to Michael was from an earlier project where I was trying to accomplish the same thing. I think it is outdated. So I was trying to do it from scratch(without a tutorial) using whatever I could find online
 
user47589
.... then please post the code that is throwing the exception
 
@VeronicaDeane maybe, I have something to implement that currently exists in c++ and looking thru the pros and cons and if it's a good idea to use interop for the GUI side of things
 
9:07 PM
That sounds like madness.
 
@Amy what, like he expects to actually get help with his issue?
 
That's just it...I do not know how to add the user I added via ApplicationUser to any of my Roles I created using IdentityRole
 
Did you forget to install your telepathy chip this morning?
 
user47589
I thought I was helping you with a NullReferenceException? the problem keeps changing
 
9:08 PM
no. here was my question
0
Q: How do I add an Identity Role to my Application User from my RoleController?

SkullomaniaMy application uses AD authentication to log users in. In addition I have made it possible for my potential admins to add new ApplicationUser and `IdentityRole'. With the help of a nice tutorial I have also taken the additional step of doing some customized filtering for users who are part of sp...

 
I don't even know what it was originally
 
it is the same problem I have been hacking away at for a week or 2 now.
 
Anyway @Cody yeah, that seriously sounds like over-complicating the issue and you're going to regret it
 
@Amy do you see what I am trying to do now?
 
@mikeTheLiar I don't have much experience with interop, care to explain?
 
user47589
9:12 PM
if you're doing C++, why is interop necessary?
 
I don't have much experience with it either but if you're making a GUI just WPF it like every other sane person out there. Attempting to port C++ through various bits of handwaving and magic is just going to set you up for a world of pain.
The shortest path is not always the fastest.
 
user47589
yea.
 
user47589
years ago i had the misfortune of writing an MFC application for a class in college.
 
user47589
its like 150 lines of code just to show a blank window.
 
well, the library exists in c++ - I don't really know c++. that library contains the code (establishing vpn connections)
 
9:14 PM
Yeah I had to do one of those as well @Amy
 
libraries DO exist for it for node, so that was my other option
 
We actually were supposed to make a basic operating system in WCF/Win32 API
 
user47589
if suitable libraries exist, there's no point in reinventing the wheel
 
WOW
 
user47589
wow neat @mikeTheLiar
 
9:15 PM
was the window resizable?
 
I am genuinely suprised
 
@Amy it was awful. I mean it was neat but it was also awful.
 
A whole 50 people thought it was a good idea to download Undefined.dll
 
user47589
@mikeTheLiar no doubt.
 
user47589
@Darkrifts add one to that.
 
9:15 PM
I didn't have nearly as much time as I needed and it was the beginning of the end for my mom's health.
 
lol
 
user47589
:)
 
ah well...ill just keep hacking away at it
 
@Amy not sure I understand, you meaning to also write the gui portion with c++ or just rewrite the logic in c#?
 
mikeTheLiar, that must have been fun
 
9:16 PM
What madman would download C#'s UUr function though?
 
@MoonOwl22 Oh yeah, my mom's slow decline into a mental fog was a blast
10/10 would recommend. Brain damage FTW
 
user47589
I would stick to C# as much as you can since its managed and because I dislike C++.
 
@mikeTheLiar No not that... I mean the operating system
@Cody You can write your UI in C# and everything else in C++
or just use C++/CLI if you're bent on using C++
Otherwise, what Amy said except I don't dislike C++.
 
I like C++ personally
 
I definitely don't want to use c++, just didn't think it would be trivial to rewrite what the library could do in c#.
 
9:18 PM
Much more manual memory management though
 
on another note, has anyone compared WPF apps vs apps running on electron?
 
Manual memory management is not a big problem. I believe there are more difficult problems out there
 
user47589
lol
 
user47589
manual memory management is a huge problem
 
> Build cross platform desktop apps with JavaScript, HTML, and CSS
wat
wat wat wat
 
user47589
9:20 PM
in any unmanaged app that's bigger than some basic college class application
 
If you're already using web development tools just make a fucking website
 
A big problem is making a UUr for Java :P
Have a V 1.1.0 in the works now though
 
lololololol
 
so a website that can talk to win32? or what :p
 
> If you can build a website, you can build a desktop app.
my sides
 
user47589
9:21 PM
oh, sorry.
 
user47589
removes harpoon from @mikeTheLiar's side
 
Good point, Amy, though I believe there are much more difficult problems that even the smartest people on earth are paid to spend their lives solving
 
what's p/invoke in javascript?
 
Aaaaand I'm afking for like ever now
 
user47589
9:22 PM
so sorry about that @mikeTheLiar
 
user47589
the person in charge of the harpoons has been sacked and harpooned
 
I want you to take that harpoon
 
I'm using a cross platform desktop app right now. In the sense that this chat is currently running on my desktop.
 
And ram it right in the eye of whoever thought building desktop apps with JS, HTML and CSS was a good idea
 
user47589
okay
 
user47589
9:23 PM
bbl. gotta fly to Washington.
 
user47589
i dunno where Electron is based, so i'll just harpoon someone in Washington.
 
At the end of the day, if you're not going to need to control any hardware, you can wank your way up onto any desktop if you use the browser as your client and your users won't care if its a web app or a desktop app if you design it well enough
 
Yes, thank you for joining the conversation. That's the exact point we've been making for the last five minutes. Your contribution is appreciated.
 
user47589
In other news, the sky is blue.
 
also don't bother building an app if you're gonna make me give you access to my contacts and all that other stuff
 
9:26 PM
Water is wet, fire is hot, Kendall's mom is promiscuous.
 
UUr functions do what they feel like
Fun fact: Java's UUr function is "safer"
 
user47589
@StevenLiekens according to Zuckerberg privacy is dead and you should stop fighting it
 
It only has 1/5 chance of crashing the whole application/thread
 
user47589
20% of catastrophic failure? i like those odds.
 
Can also end up waiting for 2.8147498e+11 seconds
OR it can spit out a string, even though it usually returns long
 
user47589
9:30 PM
I have written a program that solves the halting problem.
 
And my favorite one: print 1 to the screen
 
user47589
My program is a Schrodinger App - it is running and halted at the same time.
 
It has a return value of Object in Java
So you can't safely assume it returns long or String
Much harder to perform random **** in java actually, as it is very explicit from what I can find
Oh, and it also randomly calls garbage collection :D
 
If garbage collection in Java actually worked we wouldn't have to deal with Java anymore.
 
lol
I could also work on one for Python I guess
 
9:36 PM
Hey all. When deserialising an object I recieve from a TCP connection stream, How do I only accept the first object if the stream sends 2 objects in the same stream? for example, my Json object is:
{"X1":285.0,"Y1":226.0,"X2":285.0,"Y2":226.0,"thickness":5.0,"rgb":"gICA"}
but sometimes the stream is:
{"X1":285.0,"Y1":226.0,"X2":285.0,"Y2":226.0,"thickness":5.0,"rgb":"gICA"}{"X1":285.0,"Y1":226.0,"X2":285.0,"Y2":226.0,"thickness":5.0,"rgb":"gICA"}
Which is then excess data that my serialiser cant deserialise. any solution?
 
Can you stop processing after the first }?
 
You could truncate it :P
 
Hmmm... Ok yea that's a simple solution. But any proper way?
 
I know nothing of JSON :D
I pretty much only know chaos
 
Consume the additional object. Gain its power. Defeat your enemies.
 
9:38 PM
 
Maybe there's an option you can give to your serializer.
But if your problem is "redundant data", the solution is almost always "throw out some of it."
 
@Darkrifts Ironic that they made so many unnecessary sequels to that movie
 
lol
What language should I create a UUr for next?
 
Spanish.
 
lol
Idk, maybe JS?
Randomly close the tab?
AFK TIME
 
9:54 PM
hey paniners
I've been tasked with creating a dashboard for displaying different graphs taken from a JSON web service
What framework would be good for this and why?
My colleague suggested using plain HTML5 pages with bootstrap styling and JS, thoughts?
My thoughts are that it's better to use a framework like Angular
I see where he is getting at that the other approach would be lightweight
 

« first day (2082 days earlier)      last day (2860 days later) »