« first day (2922 days earlier)      last day (2027 days later) » 

12:13 AM
/O
ii 6u!uJoW
 
1:03 AM
how do you deal with adding an assumption?
for example: 'add non existant number to list x'
i get an exception because im trying to add something that does not exist, how do i skip and not add anything
 
@AdanRamirez Are you trying to add on List<int> or and so on?
 
wait nvm
i got it
 
List<int> Lists = new List<int>();

int a = 0;
if ( !Lists.Contains(a) ) {
Lists.Add(a);
}
 
1:46 AM
what is a non existent number?
 
1:57 AM
not cointained on list?
 
mr5
2:41 AM
o/
non-existent number is numbern't
 
 
1 hour later…
4:09 AM
posted on October 16, 2018 by Scott Hanselman

There's a great new bunch of guidance just published representing Best Practices for creating .NET Libraries. Best of all, it was shepherded by JSON.NET's James Newton-King. Who better to help explain the best way to build and publish a .NET library than the author of the world's most popular open source .NET library? Perhaps you've got an open source (OSS) .NET Library on your GitHub, GitLab

 
1 hour later…
 
 
2 hours later…
5:43 AM
good morning
 
Goooooood afternoon
 
mr5
@Arphile r u about to go home now?
office just started
 
I'm currently in my workplace, office.
learning something is always nice which I didn't know before. hehe..
and also it's what I wish to know, it's much better.
 
mr5
which tech are you working with right now?
 
Currently I'm working for Education company.
before this job, I was work for finance.
 
mr5
5:54 AM
I mean, which framework or language you are currently studying?
 
ah, sorry.
C#
and Java/Spring framework?
 
mr5
plain C# only?
oh
Do you use those two languages in a single project?
 
when I need to build web server, I use Java/Spring framework for that.
and if I need to build WIndows application, I use C#.
 
mr5
Why not C# altogether?
 
sometimes, both of languages required.
cuz I majored mathematics in uni and I didn't have any opportunity to study how to code in there.
 
mr5
5:56 AM
Is Spring for making Web Services?
 
yup.
 
mr5
oh
So do you know how to solve Calculus equations?
 
why not :)
 
mr5
Physics?
 
Specially, I really studied topology in uni which is really useless.
 
mr5
5:58 AM
I was very bad at that subject back then. I don't know if it's just me or the way Math is taught here
 
sometimes, knowledge of math which I studied used to build some algorithms, but it is not usual.
anyways, If I back to uni, the thing that I must to do is change my major as programming which makes me have more opportunity to do more things.
sigh..
 
mr5
go back to uni??
 
it means go back to past. hehe..
 
mr5
I myself did not finish my degree. I wish I did but I think it's too late for me. Also, if I ever went back to Uni, it would take me another 5 years or more so no it's a no go
 
hehe.. do you know what?
I entered uni in 2008 and finish my degree on 2017.
 
6:12 AM
ohayou
 
mr5
@Arphile well, you are maybe still young
 
Goooood mooorniiiiiing CeeeeShaaaarp! Have you received any presents lately? Where any of them bombs?
 
@mr5 still twenties in international age. hehe
 
mr5
15
A: Real life applications of Topology

Jonathan PakianathanThough really the first two apps listed below are only tangentially "topology" and more dynamics (definitely also intersect with probability, geometry, measure theory among other things) but look up the following if you wish: (1) Collage Theorem, Fractal Compression - log onto World of Warcraft...

 
d'oh! there's a donut.
uh... it was actually a mug cup.
Oh? when I see it again, it was not a mug cup. it was a straw.
 
6:26 AM
should I study angular or react?
 
mr5
@Breathing you should study Xamarin
 
haha
but I have to decide between those 2
 
if I need to choose above the choices, I'll choose angular.
 
mr5
there's a an asterisk in the url. it's been recognized as markup
Angular vs React vs Vue Market Share
 
Image not found
Oops! Error 404, unable to process image
 
yeah thanks
 
mr5
link not working. copy the text instead
React Market Share is rapidly increasing
 
Hi Guys,
Anyone kindly suggest how to collect windows service crash dump ?
 
mr5
and it seems to be stable
 
@tHiNk_OuT_oF_bOx Add an UnhandledException handler to the AppDomain and put the stack trace into an EventLog.
 
6:55 AM
@RoelvanUden Its already running in production. Cant touch anything
 
Well then ¯\_(ツ)_/¯
 
Dont forget Flutter
 
I found this link
https://blogs.msdn.microsoft.com/cobold/2010/03/01/collecting-crash-dumps/
 
mr5
@tHiNk_OuT_oF_bOx can't it be done just by going to location where the OS dumps their crash logs?
 
@mr5 Yes, but I need for specific process
 
mr5
7:09 AM
then filter the log file?
 
7:26 AM
Factories: If I have only static methods, why not make the whole thing static?
Or, Pure methods
 
because a static factory is like a slightly more sophisticated singleton
it suffers from the same types of issues that singletons suffer from
 
@mr5 Do you have idea on this kind of service crash analysis ?
 
8:17 AM
so there's this bridge I cross on foot everyday to get to work. It has a concrete sidewalk on both sides and a 4-lane street up the middle
On one side, it is prohibited to use your bike "pedestrians only", while the other side is "bicycles only"
Seems straightforward, right? I can't tell you how many times I've been passed by bicycles in the "pedestrian only" lane..
It pisses me off and there doesn't seem to be any particular reason why they wouldn't just use the other side
I think I'm going to post something underneath the "bicycles prohibited" sign like "THIS INCLUDES YOU!"
I'm turning into a freakin' old man
 
jump in front of the bicycle. Let them learn their lesson...
 
8:34 AM
and as the ambulence drives away, I'll be shaking my fist going "Showed you, didn't I!?"
 
mr5
8:45 AM
uhm wtf VS!?
 
Maybe you should add a definition for Init
 
mr5
It's a NuGet plugin
 
What is the type of that ()
 
Alternatively clean and rebuild. And if that somehow doesn't solve it, restart Visual Studio. Those are your surefire steps to Visual Studio success.
 
Is it possible to prevent warnings from showing up in the output window when building project?
 
8:52 AM
@tHiNk_OuT_oF_bOx If you're having issues, see this article which will let you get dumps of the service when it crashes, and you can analyse it with a program like WinDbg later and find out exactly what caused it to crash
 
7 minute before to get freedom
(╯°□°)╯︵ ┻━┻
 
mr5
9:39 AM
Another points for MS VS for letting me change the selected option of dropdown list just by scrolling on its control.
My project suddenly becomes uncompileable after that. This gives a about 5 minute of headache. Thanks Bill Gates!
 
That's a fairly standard feature on all sorts. Ctrl-Z is your friend
 
mr5
Imagine, you are browsing your project configuration and there are lots of dropdown list. You want to scroll with your mouse in the middle of the document, and tadaa! You have changed something the configuration unknowingly.
This is very anti-pattern for UX
You cannot find this behavior on any web controls. Only in Windows controls
 
9:56 AM
Don't scroll over controls then?
 
> C# - Convert HTML to PDF using Java
how do people do this?
 
First, you murder your self respect. Then..
 
mr5
can you smell that smelly smell?
 
:( no
can you see that unsightly scene?
 
mr5
10:11 AM
no but, but can you hear that silent sound?
 
 
1 hour later…
11:38 AM
Hello, anyone who knows how to do this on windows forms? codeproject.com/questions/504776/…
 
Yes it's detailed in the solutions
 
11:55 AM
Obligatory why not WPF?
 
I mean, for once WPF doesn't actually solve the issue
 
hi there
 
anyone knows SSIS Package?
 
I have two listview in form1 and two listview in form2.I just want to do when I pressed a button I want to send these listviews form1 to form2 listviews
how can I do it
public partial class Form2 : Form
{
    public Form2(ListViewItem item)
    {
        InitializeComponent();
        textBox1.Text = item.Text;   // item.Subitems[index].Text if you want the value of subitems
    }
}

private void createNewForm()
{
    Form2 f = new Form2(listView1.Items[0]); // to pass the first item in this case
    f.Show();
}
it is for one listview
 
@DarthSucuk remove selected items from your first listview, and add them to your second
 
12:05 PM
@Neil in form1 the 2 listview include values
 
Tell me guys
 
@DarthSucuk ok, I don't see the problem :P
list views hold multiple values
 
bro
 
yes @DarthSucuk
 
@IvinRaj No, sorry
 
12:07 PM
Ok @Neil
 
2 listview in form1 and they are full of values but in form2 two of them is empty I just want to send two of my listviews values from form1 to form2's listview
is it clear?
I know how to send if one but in my case I have to send both of them
 
ok, lets call the two listviews in form 1, 1A and 1B
and the two listviews in form 2 2A and 2B
 
You should use a binding and bind them both to the same collection. I'm not sure bindings are supported in Winforms, but you shouldn't be using that for new projects anyway
 
you want to remove an item from 1A and bring it to 2A, and 1B to 2B?
 
12:30 PM
yes
thats what I want
 
@DarthSucuk the item from 1A is the same item in 1B?
in other words, user selects item in 1A and clicks the transfer button. You must transfer both the item in 1A to 2A and find and transfer any instances of that item in 1B and transfer that to 2B?
 
Yes
But not selected ones
 
well that's still fairly straightforward
You tell 1B to remove selected item in 1A
you remove that item from 1A as well
 
NO NO NO
 
?
ok, then which?
the actual transfer is straightforward. Doesn't matter if they are selected or not
 
12:35 PM
bro 1A include student information and 1B include teacher infos so I just want to press a button then 1A to 2A and 1B to 2B, 2A AND 2B empty
sorry for my english
some times I dont understand all of the sentences
 
you remove student from 1A and add student to 2A
you remove teacher from 1B and add teacher to 2B
fin.
 
yes
 
that's it. There's not much more to it
if you can move a student, you can move a teacher
 
List<ListViewItem> myList = new List<ListViewItem>();

            if (1A.Items.Count > 0)
            {
                foreach (ListViewItem lvi in this.1A.Items)
                {
                    myList.Add(lvi);
                }
                Form1 frm1 = new Form1(1A);
                frm1.Show();
            }

             if ((1B.Items.Count > 0))
            {
                foreach (ListViewItem lvi in this.1B.Items)
                {
                    myList.Add(lvi);
                }
it is in my form1
listView1.Items.AddRange((from ListViewItem item in _listView.Items select (ListViewItem)item.Clone()).ToArray()); this is my form2
 
you're adding all students and all teachers to a list
the same list
so when you add it to listView1, you're adding both teachers and students
you need two lists
your second form2 listView will add all the contents of this second list
conceptually you're doing the same thing twice
so everything needs to be doubled
including lists you may use to hold the info
 
12:47 PM
so how can I fix it I know its wrong it opens 2 new form and Form1 frm2 = new Form1(1A,1B);
this code can not let me to do
 
You need to pass both lists to your new form
Change myList to myList1 and create an identical list myList2 underneath
create a new if block underneath so that if 1A.Items.Count > 0 || 1B.Items.Count > 0, then Form1 frm1 = new Form1(myList1, myList2)
in this way you pass both lists to the form, and your form opens once
Inside Form1, you need to handle integrating the data from myList1 (students I presume) into your students listView and myList2 (teachers I presume) into your teachers listView
 
   List<ListViewItem> myList1 = new List<ListViewItem>();
            List<ListViewItem> myList2 = new List<ListViewItem>();
            if (listView1.Items.Count > 0)
            {
                foreach (ListViewItem lvi in this.listView1.Items)
                {
                    myList1.Add(lvi);
                }
            }
            if ((listView2.Items.Count > 0))
            {
                foreach (ListViewItem lvi in this.listView2.Items)
                {
                    myList2.Add(lvi);
it gives me 'aaa.Form1' does not contain a constructor that takes 2 arguments
 
1:12 PM
Paste your Form1 class
 
@DarthSucuk You'll need to add a second argument to your constructor
you'll also need to do frm1.show() like you did before
otherwise you won't see your form at all
 
like how ?
You'll need to add a second argument to your constructor how can I do it @Neil
i'm a little bit newbie
 
1:30 PM
@DarthSucuk ok, well you know what a constructor is, right?
It's what gets called when you create a new instance of a class
 
public partial class Form1 : Form
    {
        public ListView _listView { get; set; }
        public ListView _listView2 { get; set; }
 
It is like a weird method without a return and the name is the same as the class
well if it worked with Form1 frm1 = new Form1(myList1), then it means you have a constructor which takes a ListViewItem list
You'll need to create another or modify this constructor to accept a second ListViewItem list
I don't see it in the code you've provided
 
public partial class Form1 : Form
    {
        public ListView _listView { get; set; }
        public ListView _listView2 { get; set; }

        public Form1()
        {
            InitializeComponent();
        }

        public Form1(ListView listView,ListView listView2)
        {
            _listView = listView;
            _listView2 = listView2;
            InitializeComponent();
        }
is it ?
 
1:46 PM
@DarthSucuk Yep, it's the second one
Except you'll need to change the types
you're not passing ListView instances, but List<ListViewItem> instances
Call InitializeComponent(), and only afterwards, add them to your ListView
afterwards because if you did it before, they wouldn't be initialized
 
 public partial class Form1 : Form
    {
        public List<ListViewItem> _listView { get; set; }
        public List<ListViewItem> _listView2 { get; set; }

        public Form1()
        {
            InitializeComponent();
        }

        public Form1(List<ListViewItem> listView, List<ListViewItem> listView2)
        {
            _listView = listView;
            _listView2 = listView2;
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
 
ok I see you're doing it in form load, that's fine too
You'll need to adjust those two statements now to work with a List of ListViewItems
So I assume it won't be _listView.Items but just _listView
You may want to consider renaming your variables too. They aren't list views, they're just lists
 
You may want to consider renaming your variables after you are done renaming your variables. They should be named based on what they are used for, not based on what they are.
 
i'd settle for not calling a List of ListViewItems "_listView" and "_listView2"
 
so changed ;

public partial class Form1 : Form
    {
        public List<ListViewItem> _listView { get; set; }
        public List<ListViewItem> _listView2 { get; set; }


        public Form1()
        {
            InitializeComponent();
        }

        public Form1(List<ListViewItem> listView, List<ListViewItem> listView2)
        {
            _listView = listView;
            _listView2 = listView;
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
but now on it gives me
Argument 2: cannot convert from 'System.Collections.Generic.List<System.Windows.Forms.ListViewItem>' to 'System.Windows.Forms.ListView'
 
2:01 PM
@DarthSucuk it's because AddRange expects a ListViewItemCollection I suppose
 
yeaa I got it
neil you are best
!!!
 
:) glad to hear
 
2:28 PM
what to do when you get "Could not load type from assembly error"
but only when you publish to the server
localhost works fine
(ASP.NET Web Frigging Forms)
 
2:43 PM
The QA department emailed me today saying "Problem: the search page is returning widgets even though their serial numbers don't match what the user searched for". This is baffling to me, because the filtering function looks OK to me. Am I missing something obvious?
private bool hasAtLeastOneSplineWithMatchingSerialNumber(Widget w, string serialNumber)
{
    foreach(var spline in w.splines)
    {
        if (spline.serialNumber != null && spline.serialNumber.Contains(serialNumber))
        {
            return true;
        }
    }
    return false;
}
 
Is...is .serialNumber an array?
/list/Enumerable/whatever?
Also why not
 
Let's see... It's a string.
 
return w.splines.Any(s => s.Contains(serialNumber));
Boom linq does your foreach
Ah so the customer may put a partial serialnumber
 
Yes, the user is allowed to enter partial serial numbers. That's fine.
I asked QA "could it be that the user is leaving the field blank? Comparing against the empty string wouldn't filter anything out.", but no, the user is entering ZJT42858822964.
And getting back widgets whose splines have serial numbers like MJC23509282615. No apparent relation.
 
I don't understand the spline thingy
how does a widget have a spline?
Are we talking, like, android widgets?
Also how many splines does a widget have, and why so many?
 
2:53 PM
Nah. They're names I made up to anonymize the super secret true purpose of these objects.
No relation to android widgets.
 
THat's the thing though...sounds like something you'd have to understand. I do have an idea what might be the problem, but its hard to explain without proper naming.
 
Widgets can have somewhere between zero and infinity splines. Most often they have one, and the most I've ever seen in practice is about 20.
 
Widget has 3 splines
spline[2] fits search
splines 0 and 1 dont fit
method returns widget
someone wonders why splines 0 and 1 dont fit search
 
A fine theory. But it doesn't fit the data at hand, since all the problematic widgets have only one spline apiece.
 
...debug?
and see if/why it returns true?
Or if the problem lies somewhere else?
 
2:58 PM
Yeah, I'm leaning strongly towards "the problem is somewhere else" at this point
I just wanted to pop in here to make sure it wasn't something obvious like 'you are misunderstanding how string.Contains works. a.Contains(b) returns True if a has at least one letter in common with b. "ZJT42858822964".Contains("MJC23509282615") returns True because they both have a "J"'
I mean, obviously that's not the case. But something like that.
When I debug in my local environment, the filtering works perfectly. I fetch 10 widgets from the database, then filter them through hasAtLeastOneSplineWithMatchingSerialNumber, and only the widget that actually matches makes it through, as desired.
 
Do you have the same data structure and values?
 
You know...you could add the filtering value to the sql query so the DB filters for you, right?
 
What @Squirrelkiller stated would also be significantly faster.
 
Yes I do, but it would be awkward to work that into the current project design, since get_widgets_from_db() is used by many parts of the project. Adding the ability to filter by spline properties would require that function to join to the SPLINES table, which is an expensive operation that isn't needed for any page other than this one.
Making get_widgets_from_db() only join to SPLINES when absolutely necessary is possible, but kind of a pain in the butt
Even as I wrote that last message, my conscience told me I should be doing it The Right Way even if it's painful, and even if I don't expect it to fix the bug directly
 
3:15 PM
Are you positive the cost would impede performance? Or the cost would be an engineering tax, you know it is partly excessive but will not affect users.
 
3:26 PM
SPLINES and WIDGETS are both very large tables, and in the past we've bent over backwards to refactor out joins that were causing page load times in excess of five minutes
It might not be a problem here because this page is exclusively used to search through widgets created in the last week, which in practice is about 1000 widgets.
Here's hoping that the ORM is smart enough to do "get all week-old widgets, then join to SPLINES, then filter" rather than "get all widgets, join to SPLINES, remove all widgets older than one week, then filter"
Since the latter is a hundred thousand times slower, give or take
 
I hate writing hyper-context-sensitive UIs
 
Trying it now... The "Right Way" takes three minutes to complete the query. Yeah, that's a complete non-starter.
 
3:44 PM
@Kevin Could you have a background thread that pulls the data into queue, that you can simply pull from?
Basically, can you preprocess those tables in advance before your application requires to use them. Then with a bulk of the processing completed in advance, you would pull from that queue rather than the database?
 
The last time I looked into threading for this project, I believe the conclusion was "creating any kind of independent thread or process is a terrible idea because IIS reserves the right to terminate anything it sees as 'rogue' regardless of how long it's been running"
 
@Kevin I am not saying from IIS, but have SQL do it.
@Kevin Basically dump it into a Azure data storage or some form of Json File or Xml that you can parse.
 
And having a process that runs independent of IIS requires me to sign my firstborn son over to the production server administrators
 
I know that might kill some "real time" updates, but it may alleviate the issue and be suitable for performance.
But would it be better for you, the application, if you do have the production server administrators monitor or allow that?
 
It's complicated, but short version: yeah
 
3:51 PM
There is your answer.
 
user image
2
 
this is 102% relatable
 
We use a thing here were we have an application which makes a request to the web application every 10 minutes or so to update the data stored in memory, because it takes like 30 seconds to load it and the data is used hundreds of times per second. Works really well actually
 
Management says "while we can probably get the administrators to agree to your request, a three-minute long query isn't ideal, since we need to run a hundred of them every day. See if you can't optimize that a little." So I'll keep that in my back pocket while I try to bludgeon the ORM until it behaves.
 
3 minutes sounds like you've got some dodgy indexing
I had operations that ran into the minutes, I added a couple of (non necessarily unique) indexes to the database, and they legit fell to sub 2 second calls. And it cut the time it takes for me to load a dickload of data from about 12 minutes to about 3
 
4:07 PM
"Pass the buck to the DB guy" is a tempting card to play, but his buck-repassing game is very strong
 
Work out what it is you need hime to do and just say "Do exactly this" and then he can't pass it
 
I guess I could do that, since WIDGETS and SPLINES are connected by a pretty standard one-to-many relationship
 
how can i send pictures here?
like screenshots
I'm having a bit weird problem here
 
you have to upload the picture to image host and post the link here
 
oh okay
 
4:15 PM
In my WPF app I have userControl with textblock element outside of the userControl (margin top: -27) for some reason it stopped showing, but it worked before. what can be the reason for it?
 
@Kevin Which mapper are you using?
 
Half the project uses NHibernate, half uses Entity Framework. This particular page uses NHibernate. I'm about to write an EF implementation to see if that's any faster.
Historically this has been the case. When we converted our biggest scariest query from NHibernate to EF, the elapsed time fell by a significant amount
 
4:33 PM
Dapper would be quicker than Entity Framework.
Dapper is considered a Micro ORM, but would be closer to run close to raw ADO.NET
So, if performance is important I would look at that.
 
Increasing our ORM count from 2 to 3 would probably make the rest of the dev team cry... I kind of want to see that, though.
 
5:18 PM
ok I fixed my problem... for some reason when setting fixed width to grid column it will not allow element to display outside of the grid, so I set column width to * and now it works
 
0
Q: Entity Framework Core take one and skip other duplicate item in a child table

Sabir HossainI have a list of Items and every item have some list, Now I wants to select Distinct items of child. I have tried like below but it's not working. var items = await _context.Items. Include(i => i.Tags.Distinct()). Include(i => i.Comments). OrderBy(i => i.Title).ToListAsync(); //Tag items TagId ...

Thanks in advance.
 
@Kevin Luckily with Dapper it really is extending IDbConnection then simply doing something along these lines:
private IEnumerable<ContactModel> RetrieveContacts(FacilityModel model) => dbConnection.Query<ContactModel>(getFacilityContactsQuery, new { FacilityId = model.Id });
 
@Greg
help me bro
 
....?
 
I'm new to EF Core.
0
Q: Entity Framework Core take one and skip other duplicate item in a child table

Sabir HossainI have a list of Items and every item have some list, Now I wants to select Distinct items of child. I have tried like below but it's not working. var items = await _context.Items. Include(i => i.Tags.Distinct()). Include(i => i.Comments). OrderBy(i => i.Title).ToListAsync(); //Tag items TagId ...

 
5:24 PM
Oh dear... Entity Framework and Core do not play well at the moment.
 
what should I do?
 
You need more information, do you currently have EF Core working?
 
So it is correctly building your data model?
 
yes
everything working just fine
I just need the LINQ query to get Distinct items from child table.
 
5:27 PM
I assume your issue is you are trying to filter a sub-collection on your model.
 
skip all the duplicate after having one.
 
That is the function of distinct, to remove duplicates.
As far as I know the way it handles filtering sub collections in a model is the same as previous versions of Entity Framework.
 
okay, Thank you @Greg
 
 
2 hours later…
7:35 PM
Welcome.
 
8:32 PM
posted on October 16, 2018 by Scott Hanselman

When the engineers on the ASP.NET/.NET Core team talk to real customers about actual production problems they have, interesting stuff comes up. I've tried to capture a real customer interaction here without giving away their name or details. The team recently had the opportunity to help a large customer of .NET investigate performance issues they’ve been having with a newly-ported ASP.NET Core

 
8:50 PM
is it possible in SQLite to store somehow the result of this:
(SELECT TOTAL(pTotal) FROM PayClientsDebt WHERE pType = T.pID GROUP BY pType)
to use it in the query conditions?
right now I have this same line like 6 times in my query
 
You mean store a variable?
 
v > 3.8.3?
WITH AS syntax
i.e WITH twoja_stara AS (SELECT TOTAL(.......)
its also better performance-wise since the db engine pre-executes the query once and then uses it only once in the where clauses as opposed to subqueries which will query 6 times.
 
9:07 PM
> twoja_stara
xD
 
:)
good nite'
 
 
2 hours later…
11:31 PM
Morning O/
 
11:49 PM
@PiotrJerzyMamenas That seems to do what I need, will learn more about it, Thank you!
 

« first day (2922 days earlier)      last day (2027 days later) »