« first day (3112 days earlier)      last day (1838 days later) » 
00:00 - 11:0011:00 - 22:00

12:14 AM
Folks, is this a sensible line of code?
string stringValue = value as string ?? throw new ArgumentNullException(nameof(value));
 
 
2 hours later…
2:15 AM
Hello Nick! I don't think that it is valid to use ArgumentNullException here, I think ArgumentException at maximum because technically speaking value is not null even if it is not a string
 
 
3 hours later…
4:47 AM
damn.. I broke my foot again :(
 
foot.repair();
 
5:29 AM
How can a foot repair something? THat is not correctly object-oriented.
 
doctor.plaster(foot);
 
Better
 
//we use the term plaster to indicate putting a cast
 
Waaaait a minute
@Arphile Again?
 
mr5
5:44 AM
o/
 
6:11 AM
 List<string> TempImag = new List<string>();
ObservableCollection<ImageFileName> ImagePicker = new
ObservableCollection<ImageFileName>();
TempImag.Add(filename);
          image.ImageName = TempImag.ToList();
          ImagePicker.Add(image);
When the second item is add it have 2 item but the second item overwrite with first...it mean in 0 and 1 index both time second item ...what im making mistake
 
ohayou
 
@Proxy have you understand
@Squirrelkiller
@mr5
 
I'm trying. It's just...I gotta be honest it's sometimes exhausting to read bad english so I sometimes jsut ignore this stuff in chat, hoping osmeone else replies.
(Also I actually have work to do)
 
do not lie to the man @Squirrelkiller
 
I would never
 
6:24 AM
Ok again write
 
nut season is over
 
Where do you add the second item? I only see one
 
i am also not sure what you are asking
why do you assign list to image.ImageName?
 
i have issue when i add first item in observable list its fine...when add second item then it it override and list beocme same item in first and second item both will become same
 
eh
that is even more confusing then what you said before
 
6:27 AM
acutuly it is xamarin .when user pick first picture it add his name into list
 
also what squirell said where do you add the 2 item?
 
and when it pick second picture it again get his name and place into second postion
 
I do have a guess
but i'm gonna build a fiddle first
 
ok
 
Actually theree's more problems with your code, at least it seems like that
 
6:30 AM
just tell me im adding item in observable list is right or not...because observable list hold multile item when user want to add
 
@Squirrelkiller Building a fiddle is hard work. It involves a lot of expertise.
 
what type is image.ImageName ?
 
public class ImageFileName
{
public List<string> ImageName { get; set; }

public byte[] ImageBytes { get; set; }
}
}
 
Why do oyu put a list in it?
oh ok
 
    ImageFileName image = new ImageFileName();
 
6:31 AM
strange
Is it a list of several image names?
 
yes
i think you now got it
 
how about calling it ImageNames then
which framework? core? 4.7.2?
 
i have created the instanse of that class
ImageFileName image = new ImageFileName();

List<string> TempImag = new List<string>();
Create a List to add item then
TempImag.Add(filename);
and then this list add in observable list
image.ImageName = TempImag.ToList();
ImagePicker.Add(image);
 
Morning
 
6:38 AM
yes brother
im confuse how i handle
give me simple salution
 
Why are you creating a list TempImag, and then turning that into a list? It's already a list
@zubairz not enough information to answer. You've only shown code that demonstrates adding to an ObservableCollection once, so we can't know the source of the problem from that
 
That might make sense if you wanted to make an explicit copy of that list
but that would only make sense if you thought the list would change later and you wanted to avoid issues where the list was previously used
Also yeah, not so clear what you're trying to do here
 
Seriously i'm more confused
 
6:54 AM
@zubairz if you assign a list to an instance like ImageFileName, then you're not copying all of its values into a new list automatically
you're really simply just copying a pointer address to that list
This means, if you assign image.ImageName and modify the list you used, "both" lists change, because it's ultimately one and the same
this is default behavior unless you make a copy of that list
normally you don't need to make a copy though
 
@zubairz Build a fiddle from your code
 
Actually to copy the list that behaviour makes sense, but it's not particularly obvious
 
@Squirrelkiller can you give me link where i make fiddle ?
 
minimal verifiable code please :)
show us code which demonstrates behavior which you do not understand and write a comment indicating what you would have expected to have happened instead
 
7:00 AM
What was it, coreFx can use fullFx? fullFx can use coreFx?
thinking about which projects to port first for maximum backwarts compatibility during conversion
 
@Squirrelkiller are you xamarin android?
 
I am Human. Probably.
 
@Squirrelkiller have you experience in xamarin android
@Squirrelkiller sorry typing mistake
 
a bit. Though your problem isnt about xamarin.
system.coolections is netstandard.
 
its use in xamarin
its depends on xamarin
 
7:04 AM
Huh
.Net dont depends on Xamarin. Instead, Xamarin is depends on .NET.
 
@zubairz Which namespace is the class in?
 
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using Android.Animation;
using Android.App;
using Android.Content;
using Android.Database;
using Android.Graphics;
using Android.OS;
using Android.Provider;
using Android.Runtime;
using Android.Support.Design.Widget;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using Java.IO;
using Java.Util;
using SGDD_Portal.Model;
using SGDD_Portal.ViewModel;
 
You are quite new to development, aren't you?
 
The collection you're using
 
Im new
 
7:07 AM
What namespace is it in
I wan a FQN
Sorry, I'm fixing an error I made a week ago so I don't really have focus to teach right now.
 
Hover your mouse over the class and you'll get the FQN, that is, the namespace and the class name. What is it?
 
Ok Thanks For Participating Al of You have a nice day
 
Hey don't you run away now!
 
ok im pasting my all code here
public class ImageFileName
{
public List<string> ImageName { get; set; }

public byte[] ImageBytes { get; set; }
}
}
 
No, please don't. Think, and answer the question.
 
7:11 AM
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Java.Lang;

namespace SGDD_Portal.Model
{
class ImagePickerAdapter : BaseAdapter<ImageFileName>
{
private Activity activity;
private string[] GetImageText;
private byte[] ImageData;
ObservableCollection<ImageFileName> ImagePicker;

public ImagePickerAdapter(Activity activity, ObservableCollection<ImageFileName> ImagePicker)
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using Android.Animation;
using Android.App;
using Android.Content;
using Android.Database;
using Android.Graphics;
using Android.OS;
using Android.Provider;
using Android.Runtime;
using Android.Support.Design.Widget;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using Java.IO;
using Java.Util;
using SGDD_Portal.Model;
using SGDD_Portal.ViewModel;
 
We ain't here to fix yo code, but we can teach you to think independently and problem solve on yo own. If you take the time to bother, otherwise, well, f-off.
 
1)
!!tell zubairz format
 
Ok Im Trying
 
@zubairz Format your code - hit Ctrl+K before sending and see the faq
 
2) make an MCVE
 
7:17 AM
@zubairz listen to me carefully, as this will help you in the future. just because we're experts in this field doesn't mean we can glance at code for a couple seconds and know what it does without context or explanation
 
I have also commented the concern code
 
Dont spam codep lease
Have you read the rules?
 
I don't mean to come across as harsh, I just want you to know that what we need to help you is a very brief summary of the code causing the issue and what you expect it to do instead
 
!!welcome-c#
 
7:18 AM
0 Welcome to the C# chat! Please review the room guidelines and tips. If you have a question, just post it, and if anyone's free and interested they'll help.
 
@Squirrelkiller is im making some wrong....or violation of rules?
 
organize your thoughts, and give us the elevator version of your problem
@zubairz posting code more than 10 lines is against the rules, yeah
 
Yes. If you code is longer than 20 lines, make a gist or paste of code
or fiddle
ah 10? wow.
 
Ok Sorry i'm new and joined room yesterday....sorry avoid next time
 
@zubairz no problem, really!
 
7:52 AM
good morning :)
 
good morning
 
8:08 AM
good morning
 
Morning
 
8:23 AM
if I have a property that evaluates some data from DataGridView, is it better to assign the property to a local variable before using it multiple times in the same method?
for example:
private IEnumerable<DataGridViewRow> SelectedRows
        {
            get
            {
                return gv_TransDetail.Rows.Cast<DataGridViewRow>().Where(r => gv_TransDetail["col_Select", r.Index].Value.ToBool());
            }
        }
 
I would make a local variable for that
 
thanks
 
8:38 AM
I would also make a local variable for every property you access...
but meh
because every property that does a computation should be stored in a local variable if you use it multiple times
and you mostly cant know if a property is a computed property or not
 
I'm into this also
 
mr5
9:04 AM
question: is every square a rectangle?
 
Did nested lock dangerous in multi-thread environment?
 
@mr5 none of the squares are rectangles
but squares can pretend they are rectangles
so you can use a square as a rectangle
 
mr5
well, according to the first GSR,
> So a square is a special kind of rectangle, it is one where all the sides have the same length. Thus every square is a rectangle because it is a quadrilateral with all four angles right angles.
 
lock(a){lock(b){}}
lock(b){lock(a){}}
Deadlock will happen if these two code run in parallel ?
 
@mr5 is that programming related?
@nyconing I think so
 
mr5
9:07 AM
@Wietlol does it matter if it's programming or just Math?
 
yes
in Maf, a square is a special kind of rectangle
 
mr5
why does the word 'special' needs to be attached to the square if it is just a subset of rectangle?
 
its not attached to the square, but to the rectangle
 
mr5
can we describe square as sealed class Square : Rectangle?
 
a square ... a special kind of rectangle
@mr5 I would highly recommend you to not
you can do class Square : IRectangle
but not class Square : Rectangle
 
mr5
9:10 AM
I can't explain it in English so...
 
you have various forms of inheritance
inheritance of api (which is nice)
and inheritance of structure (which is bad)
(in this case)
 
Square -> Special Case of Rectangle
Rectangle -> Special case of Quardilateral

These definitions are taught before set theory, that might be the cause of the lack of the word Set in their definition
 
Quadrilateral -> Special case of Polygon
Polygon -> Special case of Drawable
Drawable -> Special case of Serializable
 
Serializable -> Special kind of Object
Object -> Special kind of Any(thing)
Any(thing) -> Special kind of Instance
 
This chain of thought -> Special case of Lads gone wild
 
mr5
9:23 AM
@anand_v.singh why does square have to be a special case of rectangle if only values of its properties are the difference?
 
In rectangle the condition is a quadrilateral in which angles between all lines is 90 Degrees

In Square the condition of rectangles must be true, plus adjacent lines must be equal too
 
What's the issue with the word "special"?
I don't see the point of this conversation
 
mr5
@anand_v.singh is the corner considered a property of a rectangle?
 
Yes corners 90Degree and quadrilateral is how you define a rectangle
 
@Contract
class Rectangle
{
	value width: Decimal
	value height: Decimal
}


@Contract
class Square extends Rectangle
{
	@Override(width)
	@Override(height)
	value size: Decimal
}
@mr5 here you go
 
9:28 AM
opposite sides equal is just a consequence of that
 
(not C#)
 
mr5
@anand_v.singh but I think it's a readonly property only
since it depends on the width and length
 
What?
Angle doesn't depend on width and length of a rectangle, or have I misunderstood you?
 
mr5
ugh
see Wiet's blueprint of square
it doesn't have a property called corner
 
wait
 
9:33 AM
Wiet's
lol
 
@mr5 Then it is theoretically wrong, quardilaterals also have height and width
 
mr5
@Wietlol anand said you're wrong. Would you defend your work?
 
A 4-sided flat shape with straight sides where all interior angles are right angles (90°). Opposite sides equal in a quadrilateral can exist without it being a rectangle
 
> Today on the show we're talking about the words used to describe squares
 
mr5
9:35 AM
@anand_v.singh what I mean is, if you adjust the square's corner like this:
var square = new Square();
square.corner = 180;
square.size = 20;
 
ew
 
I prefer squircle
 
value square = Square(
    corner: 180,
    size: 20,
)
 
square.corner = 90;
Also if it is already a square it is already established corener is 90, your code is redundant
 
http://mathworld.wolfram.com/images/eps-gif/Squircle_1000.gif
 
9:38 AM
@Wietlol Same thing can be said about this if the object is of class square it is understood that corner is 90, hence redundant, you can put it as a constant in a constructor though
 
i lost the purpose of the discussion tho
 
@Wietlol I don't think Mr.5 ever told us the purpose of this discussion he had us dancing like kittens chasing a laser on this one
 
I dunno, if you specify the length and width of a rectangle to be the same, is that redundant when you could just create an instance of a Square specifying both length and width one time?
I think it's not so redundant that you should be obliged to make a Square class
 
Might depend on the application, if you are creating an application where you have multiple shapes and they interact with each other, it might be helpful to have both height and width, like a function which receives a shape and calculates its area, as long as it is a quardilateral the formula for it can remain same
 
square sub class of rectangle is still a school example of violate Liskov
 
9:44 AM
@Neil depends
if you have a function and you want a Square parameter, you want a square class
you dont want a Rectangle parameter and have a check that the width and height are equal
 
That violates Liskov Substitution Principle though
 
what?
 
wtf people
every square is by definition a rectangle
 
every square can be used as a rectangle
 
a swaure is a rectangle - it's an "is"-relationship
Which mean, inheritance
every square is a rectangle
 
9:46 AM
not inheritance of structure tho
 
Any place when a Rectangle can be accepted, can and should be accepted
Square can exist, but methods should accept Rectangle, not Square
 
...exist?
Depends
 
methods that accept a square should accept a rectangle and check if their sizes are equal?
 
Square class
 
if you need a square for soemthing, you need a square
methods needing a rectangle can take a rectangle - since a square is a rectangle, you can pass the ma square too
 
9:48 AM
give me an example of a method that would necessarily require a square and not a rectangle?
 
Yes but it shouldn't be derived from a rectangle
 
and don't tell me "getAreaOfSquare(Square square)"
 
public static decimal Math.GetSideLength(Square square);
 
@Squirrelkiller you'd need a method to get one of the properties of Square?
 
9:49 AM
There is virtually no angle in this world..
 
model of a square is not a model of a rectangle. You are modelling the real world
 
Earth is not a ball though
It's a geoid
 
its a collection of mass duh
 
@Squirrelkiller The flat earthers in California convention want a word with you
 
A rectangle whose width and height are the same should conceivably behave in all the same ways as a "square" class with the same length
if there even exists a reason to have a Square class, it would be to optimize calculations performed internally
and for no other reason
 
9:53 AM
morn
It's me, Mario
uh i mean hans
 
@Hans1984 Bowser got to Luigi?
 
@Neil ofc square is a bit simplistic
 
@Neil that's why you always check what you actually need, before you even think about building anything
 
but dont you have any memory of a function that takes in an object and does some checking based on its state?
 
@Squirrelkiller excellent point, and I think that's the heart of it really
 
9:54 AM
@anand_v.singh yeah he got him
 
when you are modelling the real world, you have a model of a square, where you only set the width + height simultaneously. In real world there is no need for such delicate definition. Square by def have same width height
 
if you were making characters in your "2d world game", then square and rectangle may have no conceivable relationship aside from both being characters in your game
 
I gtg
 
it depends entirely on how you define square and rectangle
if there is no notable difference in behavior between a square and a rectangle with same width/length, square shouldn't exist
otherwise yes, it should
but if I may say it, to create a Square class with intentions to make it behave differently than a Rectangle is far from intuitive and is probably a step towards a bad program design
 
Dimension, Fill and Border.
And then loads 'configuration'
 
10:07 AM
@Neil You may not say it, but you may type it
 
it
 
says it
 
Also wouldn't just creating the square class also violate Single Responsibility Principle
Just because you can, doesn’t mean you should.
@Hans1984 I hope your coworker sitting next to you is wearing headphones or is going to think you the work pressure is finally getting to you :)
 
haha
We are all mad here
 
@anand_v.singh why so?
 
10:24 AM
@Wietlol Shit I fucked this one up badly didn't I? Just because you can, doesn’t mean you should. was supposed to be from the perspective of the class, I saw it from the perspective of the programmer, DUCK!!
 
im confused
 
Nothing I made a mistake on this one
 
self.quack()
 
@Wietlol No you are Weitlol
 
10:28 AM
no
 
:46020868 going for a walk.
        for(int i=0;i>100;i++)
            WaddleLeft();
            WaddleRight();
 
@PawelFlajszer walks nowhere :P
 
actually my mistake
 
Orbitrek style :)
 
10:29 AM
you'd WaddleRight once :P
 
I =0; I>100; Gotta admit they had us in the first half
 
aaaaa
every....single... time:D
 
happens to the best of us
 
no, only to Neil
 
._.
 
10:32 AM
@Neil I remember I was in school back then, posted a question on stackoverflow saying STL implementation is damaged in c++ only to find I had accidentally put a ; after a while loop declaration, I deleted that SO account soon
 
such a beauty
 
are those arrow functions?
 
arrow functions?
 
@anand_v.singh lol ouch
 
yeah, you have em in javascript i.e.
I'm new to c#
 
10:34 AM
ye, mostly the same
iirc, Js has a few versions of them
all with subtle differences
 
fair
sooo strings are immutable in c#.. is using StringBuilder a common practice/standard in c#?
 
use StringBuilder when you want to build a string
dont use StringBuilder as a mutable string
dont use anything as a mutable anything
everything immutable!!!
 
It's more CPU-intensive to add three strings together than it is to use a StringBuilder
so use it whenever you need to combine more than two strings
 
anyone has "unlimited" vaccation on job? I keep hearing stories about that recently but i am not sure how that is supposed to work. To me it seems more like some kind of "trick" since i assume people will take even less time off then they do usual.
well i guess this is only related to america
 
@J.Doe oh god oh fuck oh no
 
10:49 AM
@Proxy wait, that's a thing?
 
@Proxy if you have a limit to your vacation days/hours, you want to make sure you reach that limit
 
kinda.
 
because, if you dont, you lose that time at the end of the year
if you dont have that limit, you dont have that urge to spend it all
 
it has been coming up a lot lately but it is mostly in america
 
I'd take more if it was unlimited
 
10:51 AM
you'd get paid less
 
Since I never take any even when I want it, in case something "comes up"
 
why would you lose vacation days @Wietlol?
they are paid
 
well...
 
I do like the idea that you have unlimited vacation time, but every day of vacation you take isn't paid
keeps people honest
 
if at the end of the year, you still have some leftover days, we can choose to let (up to 40 hours) pass over to the next year, or let them be paid out
 
10:51 AM
no, as far i know here the idea is that you get payed for them.
 
im not sure how it actually works
 
so who's to stop you from going to the Cayman's for the rest of your days?
 
im only sure how I think it works
@Neil your belly?
it starts arguing with you
 
"unlimited until your boss begins giving you the ugly eye"
 
nobody does but i guess it puts psychological pressure on you.
and since this is in america they can fire you easily i guess.
 
10:53 AM
I suppose that's an excellent point
 
its america is a valid point on its own
if you have more vacation, you need more employees
I guess trump was right when he said he would make more job oppotunities
 
that's good for the individual, not the corporations
arguably, the individual has more importance over corporations, but it's not even black and white either
 
meh
trump can pay the companies
 
In Italy, there are talks to enforce a 4-day work week
 
lawl
 
10:56 AM
salaries remain the same
 
but i think most people would still take the minimum number of days that is defined by law, otherwise they would "look" bad. I guess that makes it a good pr stunt
 
but they work 10h per day?
 
that sounds great
 
the idea is that more people will be hired
no, same work schedule
 
haha
 
10:57 AM
not said that everyone will get the same day off
 
will be funny to watch
 
not going to work
companies will outsource more
 
well i doubt there are a lot of people who are productive 5+ hours per day
well at least in our industry
 
maybe, but you can't outsource everything
 
it may work in stuff like software
 
10:58 AM
and if we're being honest, I'm not working 100% of my day
 
but e.g. an industrial production plant with 24/7 schedules
 
I'm here chatting in this chatroom because right now I don't have anything pressing to do
 
from my experience people usually work around 4-5 hours
 
how will they justify the increase in production cost by 20%
 
10:58 AM
if I worked one day less, I think the things that I do do, would simply be compressed in 4 days rather than 5
 
@Neil ^
 
@Wietlol in fact, compiling as we speak :)
@SebastianL companies aren't obliged to hire more people
 
js does not compile :)
 
but if there is a trend here, it would be to hire more people for larger companies for sure
 
00:00 - 11:0011:00 - 22:00

« first day (3112 days earlier)      last day (1838 days later) »