I keep hearing about node ... sort of gripes me ... like js has been around for so long and someone pipes up saying "ok now lets run it on our servers" and all of a sudden js / node is the best thing since the wheel
how ... js is still a mess in the browser, the only reason people don't totally hate it is because of the hundreds of libs that overcome the mess for them
and now they want to trust that same language on their servers ... :facepalm:
Hello everyone, i would appreciate advice if someone is familiar with the problem. It is about WinForms:
dataGridView.Rows.Clear(); // At this point CurrentCell == null int rowIndex = dataGridView.Rows.Add(); // Here it is automatically changed to (0, 0) DataGridViewRow row = dataGridView.Rows[rowIndex];
When added one more row, if i set value to a cell 0 in row 1, value of the CurrentCell is also changed to that one - so i get duplicated data.
dataGridView.Rows.Clear();
// At this point CurrentCell == null
int rowIndex = dataGridView.Rows.Add();
// Here it is automatically changed to (0, 0)
DataGridViewRow row = dataGridView.Rows[rowIndex];
^ results in 1 row being in the grid
if you then edit anything on the variable "row" you are editing that 1 row
// I want to populate DGV with fresh data. dataGridView.Rows.Clear(); for (int i = 0; i < 3; i++) { int rowIndex = dataGridView.Rows.Add(); DataGridViewRow row = dataGridView.Rows[rowIndex]; row.Cells[0].Value = i.ToString(); } // I would expect result // [0,0] = "0" // [0,1] = "1" // [0,2] = "2"
// But i get // [0,0] = "2" // [0,1] = "1" // [0,2] = "2"
int rowIndex = dataGridView.Rows.Add(); // With this hack it works well. dataGridView.CurrentCell = null; DataGridViewRow row = dataGridView.Rows[rowIndex]; row.Cells[0].Value = i.ToString();
at the now comes the real question part. I don't know the answer. But both of them should have some kind of visitor pattern to not ask for the is or as.
till UpdateLink there is no IsCollection or IsLink in the code. <HierarchicalDataTemplate DataType="{x:Type local:Link}" kind of visits if it is a link or what.
I suppose i have somewhere something else set/unset, so after provided line of code is executed, CurrentCell is also updated (in this case it is [0,0])
And i am using at least 10 DGV in this project, but only this one makes me this strange problem...
Thank you very much. You really put a lot of effort in it. That's awesome. That's pretty much the same as my code looks like now. (A side node for you, as you mentioned a question in your comments: "now comes the real question. What we expect of an IElement. Should it have DoUpdate, which propagates further ReferencedElement.DoUpdate();" Yes, that's the intention behind. The collection would also propagate this and call DoUpdate() on all children as well" However I have much more elements, for example a collection that only calls DoSomeStuffWithChild(IElement child) if the child fulfills a …
@Michael in this example i tried to set index of row in first cell of the row... for loop is actually redundant in this case.
I used same code on several places, and everywhere it works but here.
I think it is some flag or field that i changed somewhere, so i get this kind of behaviour. Anyway, thanks for help, if i find solution i will post it here :)
@EsonRoxas it's a set of compiler options ... when you compile the code you compile it using the C# compiler (roslyn) that produces msil, with this information it allows you to refer to subsets of functionality available in different versions of the CLR
when the CLR loads your code it looks at if your code is supported by that version of itself
Okay, I have been working with Webforms for 2 years now and I thought I'd give MVC a try. What is the MVC version of a postback? I cannot get a checkbox to post back to filter a list.
@ntohl Yes, the updateLink method could be in the ILink, and should be triggered by an event, or the links are administrated through an external observer who calls the update. This is another story
Leaving inheritance aside, I come back to my initial problem: If I have a IFancyElementWithFiveFunctionalities { IFunctionalityA fA {get;} IFunctionalityB fB {get;} IFunctionalityC fC {get;} ... }
my calls to members get lengthy. I have myClass.fA.DoStuffA() instead of myClass.DoStuffA();
@ntohl Thank you very much, you put so much time in my problem, I don't know how to thank you. Discussing this problem in this depth really helped me a lot (although I still not have "THE" answer)
The common member of all functionalities would be DoYourStuff(...) then
@ntohl Back again to your comment above: "Yes. IFancyElementWithFiveFunctionalities should have DoStuffA()" - But then, One could principally call IFancyElementWithFiveFunctionalities.DoStuffA() AND IFancyElementWithFiveFunctionalities.fA.DoStuffA()
And those two would not be the same
So it should be "IFancyElementWithFiveFunctionalities : IFunctionalityA, IFunctionalityB, IIFunctionalityC, ... { // NO member of type IFunctionalityA/B/C/... in interface }" instead?
This would ensure following LoD, and would still allow me to "internally" use private members of this interface type as the backing instances
@Html.CheckBox("showInactive", new { htmlAttributes = new {@checked = false}}) I need this to post back to server to filter my list. If I already have an ActionResult for Index, how to I force that checkbox to post back to filter my list?
@ntohl Well, I think that answers my problem. 7 Hours passed, and at least 5 lessons learned. I don't know how to thank you appropriately. Thank you very much.
in my actual gist the notify of elements has been moved to an external observer. you have to do the same with functionalities. In the new composed version Link contains an IObs instance which is composed into the Link.
The idiomatic usage of EnsureSuccessStatusCode is to concisely verify success of a request, when you don't want to handle failure cases in any specific way. This is especially useful when you want to quickly prototype a client.
When you decide you want to handle failure cases in a specific way, ...
@CharlieBrown lol... I should have just used command line. I did a merge in SourceTree but the branches still look separate. Not sure what's going on there haha
I'm looping through a list of object using razr syntax then trying to build a table. The problem is that my column names read form the database have spaces in them, eg "Contact Email Name"
How should I read back the column value in that case?
@foreach (var row in db.Query(selectServerString))
{
<tr>
<td>@row.ID</td>
<td>@row.["Contact Email Name"]</td>
</tr>
}
//When I debug the name of the column it shows as "Contact Email Name"
The above didn't work as it's showing as an invalid col name also
in wpf I bind my control's IsEnabled to static bool property which returns collection.Count > 0 (where collection is an observable collection) and someone told me to raise NotifyPropertyChanged in setter of that collection in order to notify about this static bool new value but I dont know what was he meant to say 'in setter of that colleciton;
nvm ... i tried ... you MUST have a valid C# object in which case it probably is an object with properties named something like "Contact_Email_Name" so my thinking is that you should be able to do something like @row.Contact_Email_Name
nvm ... i tried ... you MUST have a valid C# object in which case it probably is an object with properties named something like "Contact_Email_Name" so my thinking is that you should be able to do something like @row.Contact_Email_Name
If I have an ActionLink, how do I hold onto the .text() attribute that I change with jQuery? When the page posts, it changes back to what it was before the jQuery event.
I found due to the way VS behaves both your startup project and the project selected in the pmc projects dropdown need to contain the connection string
probably best / simplest to set both to the same project
@War i store the connection string on appsettings.json then use it on startup.cs using builder. I'm using ef core and mysql (since it has been supported by now).
So when I mean skill I mean also skill as in qualifying for a job even if its junior or mid level . how can I know when I'm ready to apply for a job when I can't understand the problem set given to or get a correct algorithm goin . I mean I get close but nothing comes of my self esteem when I get on these sites and can't come through :[
@roscoe_casita I'm sure others have barcode solutions ... it's safe to say that just because someone has been in a shop doesn't mean they used your barcode scanning software
I recall doing something like that once for government stuff
reading interdepartmental codes for things moving around internally
var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables(); var Configuration = builder.Build(); var connectionString = Configuration.GetConnectionString("DefaultConnection");
@EsonRoxas I wish my problems were as simple as connection strings but no ...
An error occurred processing the auction results: An exception was caught during the execution of a retrieval query: Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
that's so obscure its practically useless
the funny thing is from the wording it appears to be an exception message that an internal dev wrote
@Squiggle no because I can't this happens to be what I pulled from the event log (windows friggin event log ... really!!!) ... now i'm pulling a copy of the db down from the cloud so I can run the code for the web app against it locally
@Squiggle still got the same error when i try -verbose System.ArgumentNullException: Value cannot be null. Parameter name: value at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
@Squiggle non issue because it'll be replaced ... the new code is mostly in testing at the moment, there's a few more complex pieces that need to be built but 3 months should be enough
woo. I'm putting together a basic TypeScript/Angular SPA for a tutorial session tomorrow. Having documented the steps I took to do it, I'm not surprised some people get confused. There's literally 5 different ways to do everything.