« first day (2146 days earlier)      last day (2797 days later) » 

user47589
12:44 AM
is it a nice bike rack?
 
yeah
 
@codeman, how's Microsoft? What are you working on now?
 
same thing :)
it's good
bought a house, closing sept 25th
 
Nice! Congrats!
 
1:03 AM
thanks :)
 
1:18 AM
lol doncha hate it when you want to do something and just can't find a decent example to get you started?
 
1:55 AM
Microsoft is larger than the name implies
 
 
2 hours later…
4:05 AM
 
 
1 hour later…
5:09 AM
morning
 
 
2 hours later…
6:54 AM
@Codeman long time no see! What have you been up to? Congrats on the new house!
 
7:12 AM
o/
 
\o
 
o^
 
Morn all
 
how be this glorious day y'all?
 
@ElieSaad Hot and humid and sweaty and disgusting, thank you very much. And yours?
 
7:27 AM
@AvnerShahar-Kashtan Rainy and hot and stomach destroyed from a hot night sleep. Thank you as well.
 
At least the terror of August will be over tomorrow.
Of course, September is merely the continuation of August by pretty much the same means.
 
Hahaha, yeah in a mean .. Over here the weather is on its period. Very moody, if I may say. no offense to any mean of periods.
 
............................................... < mob of triggered periods
 
Morning everyone
 
7:46 AM
Hi guys, I have an error regarding the asp.net mvc
pastebin.com/w10Qtx0r
 
check this
2
Q: How does one avoid a NullReferenceException in a foreach loop within a View when my model is null?

EcnalyrI get a "NullReferenceException was unhandled by user code" error with the following code in my View when I pass in a null value via my controller. There are situations where I want to pass in a null value, but I do not want an error thrown when this happens. What should I change my code to? O...

 
Oh thanks. I think he has the issues as mine. Thanks man @ElieSaad :D
 
@mark check which is null. Item, the whole enumerable?
 
its google my friend. Oh, and change your name :P
Maybe to mark1 or whatever so i can tag you.
 
@ntohl I don't know I just playing around here. But when I try to view my created details without the foreach, I'm able view it on the single page view.
@ntohl immediately man. I'm gonna update my name for you :D
 
7:52 AM
Yeah he's telling you what to do next time. Put a debug point in your call and check what is going wrong. From there on it will be easier for whatever you wanna search for. You might fix it on your own, who knows.
 
I created now. :D
mark333...333...333 looks unique. :D
Thanks @ElieSaad for the advice. Honestly I'm new in asp.net mvc 5 hehe I just working around. :)
I was Laravel guy but since I started to love C#, I need to adjust on C# environment :D
 
There are great documentation on the web, you should make the room your last resort, for you to learn the best.
 
Thanks @ElieSaad man :D
 
@mark333...333...333 finally i can tag you :D
bless you young one.
 
Hahah :D haha freshly updated :D
 
user1804599
 
@mark333...333...333 do you not think that it is a bit long now? :P
 
@ElieSaad I think it's fine man. I'm very unique now, uniquely long. Haha
 
@RoelvanUden Hi Sensei!
 
Well ^, that is an original name :P
 
ikr :D
Miles A. was the old one :)
 
8:10 AM
Haha yeah man :D
 
Oh sht, i felt that was u. Calling roel sensei and shit :P
 
haha :D
One has to stay recognizable
 
Oh hehe call me sama. :D
senpai
@ElieSaad i have a new name for you man.
Senpai @ElieSaad
 
what the heck is sama?^^

I just know it from little koribuh's "Naruto the abriged seeries"
 
8:14 AM
@mark333...333...333 youtube.com/watch?v=0Qc17YOGFe4 here, treat urself^^
 
@Nerdintraining Ahm I watched it in anime. Something to address but I don't know the equivalent of that. Haha
 
sama is something for respect to another person.
@mark333...333...333 i really don't know if i am worthy enough of such a thing ..
 
Yeah, Haha it's funny because in our country "sama" means "join"
 
8:15 AM
@rightfold It's an interesting read. Always interesting to see language designers clearly explain their motivations and considerations.
 
@ElieSaad Haha
 
@mark333...333...333 so it's like saying Sir :D
 
Yeah @Nerdintraining I see :D
Let's stick to "sir" haha
 
Sir yes Sir!
 
@AvnerShahar-Kashtan What changed .. Java didn't have var? I couldn't really grasp the article.
 
8:18 AM
Is that real? by the way, what's new in c# 6 anyway :) I just want to hear some glimpse. :)
 
@ElieSaad Still doesn't.
> Nearly all other popular statically typed "curly-brace" languages, both on the JVM and off, already support some form of local-variable type inference. [..] Java is nearly the only popular statically typed language that has not embraced local-variable type inference; at this point, this should no longer be a controversial feature.
@mark333...333...333 6? C# 7 is right around the corner.
The features in C# 6 I'm really missing (we're still on 5 here) is the null propagation operator and string interpolation.
 
Is Console.WriteLine($"Value: {num} "); new in c# 6.0 Feels new.
 
@Froxer Yeah, that's the string interpolation.
 
What comes in C# 7.0 ?
 
Oh cool! Thanks for the info. Now I search the C# 7 . Please read guys :) blogs.msdn.microsoft.com/dotnet/2016/08/24/…
 
8:21 AM
@Froxer Decomposable tuples is something I'm looking forward to.
 
Hmm, ok
 
public Tuple<int, string> MyMethod()
{
    return (5,"test");
}

var myInt, myString = MyMethod();
 
Oh @AvnerShahar-Kashtan that's cool
 
IS the result either 5 or the string "test" - or both?
 
both
 
8:23 AM
it should be var (myInt, myString) = MyMethod();
 
myInt will be 5, myString will be "test"
 
judging by the example in the link above
 
War
dam java is a pile o balls
 
@milleniumbug Yeah, ok. I didn't go over the exact syntax. :)
 
ok, so it takes the first value into the first variable, then next value to the next value ?
and so on
if there is more values, variables.
What if there is more values / vars ?
 
8:25 AM
Tuples are some op shits. But isn't that something like out, in the parameters instead of in the return?
 
lool. Wildcards. Nice
 
@ElieSaad out parameters are quite annoying
 
@Froxer Behind the scenes, the function returns a Tuple<int,string>.
 
can't use them in Func<arg, arg2, arg3, ret>
problematic to use in LINQ
 
im gonna have to fuck around with it probably to understand it completely.
 
8:26 AM
You do
 
@ElieSaad out parameters are a common way to do what returning tuples does more cleanly.
Until this feature, though, having to manually return a new Tuple<int,string>(5, "test") and then later decompose that with `var myInt = result.Item1; var myString = result.Item2", was ugly.
 
@Froxer for a practice task: create a function, that returns an int, a double, and a string 1, 1d, "blah", without using out parameters. Make it so You are able to modify the return values in the function without touching the calling method.
 
@milleniumbug I think on practice these will show.
@AvnerShahar-Kashtan so it used to return an object .. nice. :P
 
Also nicer syntax for avoiding those interminable check-type-and-then-cast blocks.
 
wait @ntohl . what do you mean with and a string 1, 1d, "blah", without using out parameters. ?
 
8:30 AM
if (obj is MyClass m)
{
    m.DoSomething(); // automatically defined in the is
}
Oooh, my pull request to the OpenLiveWriter project was finally processed.
 
@Froxer I mean there will be a method. It will be called somewhere. You can already do it in current C# version. The caller will have 3 results.
@Froxer 3 different type result
1 is int. Other is double. The third is string
for default implementation let's make that function return 1, 1d, "blah". Don't use out keyword in Your method
 
ok so
        Func<int, double, string> myFunc;
 
Ooh, this is new to me. You can have any type implement a Deconstruct() method (or even an extension method) and have it play nice with deconstruction.
 
@Froxer it's not good. Try to use it in a function, that will use all params.
 
So if I have a method that returns Point, and I add a Deconstruct(out x, out y) method, I can do var (x,y) = GetPoint().
 
8:37 AM
@Froxer show me an initialization code, and a calling code
 
ok, so predefine the vars - then create a method signature with the vars?
 
@Froxer this accepts one int and one double, and returns a string
 
@Froxer show me the codez. When You start implementing it, You will find out, it's not that easy (not like I understand what are You trying to do)
exactly what milleniumbu said
 
yea, hold on..
oh.. ye.. in. in, furthestToLeftOut
= func
so the way i made the func wont work
... i meant right
 
now use tuple
 
8:41 AM
But how ?
I mean
how do i return all 3 types in a func
:o
let me create a tuple instead..
(int, double, string) LookupName(long id) // tuple return type
{
... // retrieve first, middle and last from data storage
return (first, middle, last); // tuple literal
}

var ntohl = LookupName(id);
WriteLine($"found {ntohl.Item1} {ntohl.Item2} {ntohl.Item2}."); //Why is that DOT there !?
 
because it's string interpolation
 
WriteLine($"found {ntohl.Item1} {ntohl.Item2} {ntohl.Item3}.");
but.. i do string interpolation as
public class Program
{
    static void Main(string[] args)
    {
        var a = 10;
        var b = 20;
        Console.WriteLine($"Values : {a} {b}");
    }
}
I never used a dot before
 
@Froxer The expressions in string interpolation are just that - expressions. You can use a dot, call a method, whatever.
 
im retarde.
d
the dot is just apart of the expression string
weeeew
 
Console.WriteLine($"Values: {obj.GetValueFromWebService()}");
It would be dumb, usually, but you can.
 
8:53 AM
yea.
 
9:10 AM
I have Cordova app on Windows 10 with sqlite legacy plugin. I have DatabaseService that initializes database, which is injected in app.run after startup. When I put the breakpoint on .rrun the database initializes correctly, but when I let the program start without breakpoint I get : JavaScript runtime error: [$injector:modulerr] on all Injected services.
 
c# cross-thread operation not valid while using
`var t = new System.Windows.Forms.Timer();`
 
@RoelvanUden hello, don't you know why angular is having injection problems on .run? For UWP
 
9:28 AM
Has anyone ever seen a euro symbol replaced by ? with Oracle to crystal reports
 
oh, someone's violating unicode specification
 
War
@ARr0w that kind of timer is not thread safe you should use the one from System.Threading.Timers
 
The only reason to use the WinForms timer is if you want to automatically be assured that the timer function will execute on the UI thread.
 
@Froxer for the exercise write it in C# 6
(int, double, string) LookupName(long id) as method declaration does not compile
return (first, middle, last); neither
 
@Nerdintraining o/
 
War
9:36 AM
I'm probably the only person on the planet that thinks this stuff about tuples is a bad idea
 
@Marek Uhhh...? Context please?
@War Trust me, you're not.
 
@RoelvanUden you recognized ne :D
 
War
whats wrong with declaring a simple a dto or using an anon type and allow anon types to be implicitly of type dynamic
 
@Nerdintraining Yeah. There's only one person that goes all 'Sensei' on me, Kouhai-chan.
@War dynamic is bad, but a simple type would be good.
like f#
 
@RoelvanUden haha :D
it's all about respekt man :D
 
9:37 AM
record types iirc
 
ADH
I do not like tuples
 
@milleniumbug is that me or my suppliers?
 
ADH
Just use an object that is more descriptive.
Unless your goal is to make other programmers angry when trying to read your code
 
@Ggalla1779 whoever is replacing euros with question marks
 
War
@RoelvanUden yeh i agree
 
9:40 AM
you mean whatever...its either oracle or the Crystal driver
 
War
@RoelvanUden @ADH you guys made my day ... :) it's nice knowing i'm not alone
 
oracle seems to be set to $
 
War
C#'s better features include it's type safety
 
@War There's nothing really non-type-safe in the tuple literal and tuple decomposition features in C# 7.
Or, at the very least, it's as type safe as current versions of the language.
 
public IEnumerable<Model> iEModel { get; set; }
It's empty when I'm trying to fetch the value from database and model
foreach (var item in Model.iEModel )
{ // I get Null value // }
 
9:50 AM
Countdown until someone comments on the use of hungarian-ish notation... 5... 4... 3...
 
wow that hungarian notation is cancer
 
@mark333...333...333 Is Model null? Is iEModel null? Or is one of the values inside iEModel null?
 
(yep, I did that on purpose)
 
It's null. I don't know why.
 
Which one?
 
9:52 AM
because the underlying API returns null values
( :P )
 
@model IEnumerable<SampProject.Models.Model> here's the default in index page inside right?
but I'm using 2 models in 1 view so I created my viewmodel.
inside the viewmodel, I specified the "public IEnumerable<Model> iEModel { get; set; }" to call it whenever I want to display all the created list.
@AvnerShahar-Kashtan the problem is, I get null values. It's already hours but I don't know why it's null.
 
@mark333...333...333 Again, to be clear. The ieModel object isn't null, but it contains values that are null?
 
-\o/-
 
@AvnerShahar-Kashtan wait a secs.
 
10:00 AM
@AvnerShahar-Kashtan the iE thing
It's system blah blah blah null. hehe
The ieModel is null man.
 
@mark333...333...333 <- reference to the answer to the question "which is null". (answer was "I don't know") 2 hours ago
2 hours later we found out
 
@ntohl haha sorry man, I didn't notice your question.
Oh haha and 2 hours, I still haven't found a solution. Haha
 
You should set the IEnumerable to something
 
@mark333...333...333 First question, then - where are you instantiating it?
 
like iEModel = some linq query or any way to instantiate an enumerable
 
10:04 AM
@AvnerShahar-Kashtan I don't have. Just this one only public IEnumerable<Model> iEModel { get; set; } But when I try to break this part, the page doesn't fetch the iEModel
 
surprise
You want it to not return element?
 
@mark333...333...333 Take a step back to the basics. Just because you defined a property doesn't automatically mean it has a value. You have to assign a value to it.
 
I don't know why, @ntohl foreach (var item in Model.iEModel) is responsible for fetching.
 
@mark333...333...333 But it can't fetch anything when it is null
 
@mark333...333...333 in that code, that You posted, the Model.iEModel is not set. Where do You set it?
@mark333...333...333 write a code somewhere which starts with Model.iEModel = ... or iEModel = ...
 
10:08 AM
write a code somewhere which starts with Model.iEModel = ... or iEModel = ...
hehe I don't understand man.
 
@mark333...333...333 You want Your code to fetch from somewhere. You don't specify from where
 
@ntohl I understand. But I just copied the default mvc views
You know, in the default mvc page index, you can see the list of the details that you created.
The header of the index.cshtml is here.
 
I haven't seen default mvc page yet
 
@model IEnumerable<Project.Models.MyModel>
@ntohl it fetch the whole list without any instantiating.
 
check references of the real default mvc view, where it works. Where is the IEnumerable set?
 
10:12 AM
[TypeDependency("System.SZArrayHelper")]
[__DynamicallyInvokable]
public interface IEnumerable<out T> : IEnumerable
{
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
///
/// <returns>
/// An enumerator that can be used to iterate through the collection.
/// </returns>
/// <filterpriority>1</filterpriority>
[__DynamicallyInvokable]
IEnumerator<T> GetEnumerator();
}
That's inside the IEnumerable when I alt+12
 
not on the IEnumerable, the variable, that is of type IEnumerable
 
Oh okay, wait a secs
Oh wait, how can I see the variables ? hehe
@ntohl :)
 
ctrl k +r
 
I'm gonna hover the IEnumerable?
@ntohl
I got a dialog box that says "cursor must be on member name" :)
@ntohl
 
10:33 AM
-_-
@mark333...333...333 Did you initialize iEModel somewhere in your code (like this.iEModel = new List<>())
 
@Loetn No I didn't man.
Where do I need to put that? I tried it inside my ViewModel But it doesn't work
 
what does "doesn't work" mean
 
^
 
War
^
 
You have too, else looping over the list will give an exception
 
War
10:37 AM
@AvnerShahar-Kashtan know i just don't like the way it presents if you use it, feels cleaner to use a dto IMO
tuples present in a less type safe way if you know what I mean
 
@milleniumbug I got red wavy something after I added that like of code.
@Loetn where do I need to put that? :)
 
@mark333...333...333 What did you type?
 
public IEnumerable<Model> iEModel { get; set; }

this.iEModel = new List<>(); @Loetn here man.
I put them inside the viewmodel
I got an error.
 
well duh
put it in the constructor maybe
 
@War I know what you mean, but it's purely a matter of habit. I don't remember if you're of the "var is evil" camp too, but I think it's similar.
Reducing boilerplate code that doesn't actually give me real information.
 
10:41 AM
@milleniumbug contructor of index.cshtml?
brb
 
@mark333...333...333 No, of your VM
 
of whatever class your iEModel is contained in
 
Another example that comes to mind is the ? type suffix. Nullables could have been introduced to the framework without language support - just use Nullable<bool>, Nullable<int> everywhere. But it's a common enough and useful enough case to warrant syntactic sugar.
 
Functional.Maybe >> Nullable
 
Because basically (int, string) MyMethod() is the same as ValueTuple<int,string> MyMethod(). And return (5,"test") is just return new ValueTuple<int,string>(5,"test"). But knowing it's a ValueTuple<int,string> doesn't really give me useful information.
Because it's a specific framework type, and it's always the specific framework type, like Nullable<T>.
 
War
10:46 AM
@AvnerShahar-Kashtan i'm actually for var ... but i have a strict coding standard that states either the left orthe right hand side of any given assignment statement should declare the type for readability
var is one of things like dynamic / tuples that arguably can be used both badly and well
I think declaring a DTO is hardly a big deal here but for some reason the C# community seems to have this issue with the verbosity of the language
I love that it's more verbose than lower level languages, it's more descriptive and IMO that adds to it's maintainability when devs do stupid shit (basically a given in this world)
@AvnerShahar-Kashtan that stuff about Nullable<T> and ? ... I have a coding standard that I only use ? ... mainly because it's just descriptive and the extra wording doesn't add value ... but tbh, i'd be happy with either as long as the codebase used one or the other and not both (consistency IMO is really important)
anyone know about the crypto stuff in .NET
 
what kind of crypto stuff
I've seen a lot of badly written password hashing code if that counts for anything
 

« first day (2146 days earlier)      last day (2797 days later) »