Issue I’m trying to select integers from an array of OpenCvSharp.Point. Dim hull() As Integer = Cv2.ConvexHullIndices(origPoints.Skip(48)).Select(i >= i + 48) This line fails, the compiler tells me “Error overloading because there’s no [Select] for these types of arguments”. What
Continue readingTag: linq
[SOLVED] Linq Join using Lambda in VB.NET
Issue How do I use C# lambda expression with "=>" in VB.NET? Following is the C# code: var marketValues = req.SelectedAccounts.Join(assetAllocations, a1 => a1.ModelCode, a2 => a2.APLID, (a1, a2) => new { a1, a2 }).Select(o => new { MarketValue =
Continue reading[SOLVED] Get latest previous year if possible
Issue I am trying to use Linq to get the latest previous year, if not possible then the earliest year to the current year (including current year). So if Date.Now.Year = 2017 and there was Ex: Given 2011, 2013, 2018
Continue reading[SOLVED] Query DataTable column into List (or Array) of Integers
Issue I’m trying to query a DataTable to get the list of ID’s (integers) that correspond to a specific criteria, such that I can then parse that list into a joined string that can be used as a filter on
Continue reading[SOLVED] Is there a way to get a nullable value from a MongoDB C# driver projection with expression and dictionary?
Issue Lets say I have these classes: public class Foo { public IReadonlyDictionary<string, DateTime> Values { get; set; } } public class Bar { public Foo Foo { get; set; } } Now if I do this projection: var projection
Continue reading[SOLVED] Looping through items and read desired elements
Issue I have something like this: <ITEMS ASOF_DATE="6/2/2022" RECORDS="1" CREATE_DATE="6/3/2022" > <ITEM> <port_name>95512M</port_name> <bench_name>LEHSECUR</bench_name> <SomeValue>-808</SomeValue> </ITEM> <ITEM> <port_name>95512M</port_name> <bench_name>LEHSECUR</bench_name> <SomeValue>-808</SomeValue> <SomeOtherValue>-808</SomeOtherValue> </ITEM> <ITEM> <port_name>95512M</port_name> <bench_name>LEHSECUR</bench_name> <SomethingElse>234</SomethingElse> </ITEM> </ITEMS> It can have multiple <ITEM> items and those can have multiple elements
Continue reading[SOLVED] XML Linq with nested elements
Issue I’m trying to load an XML file formatted like this to a datatable: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <controls:controls xmlns="http://scap.nist.gov/schema/sp800-53/2.0" xmlns:controls="http://scap.nist.gov/schema/sp800-53/feed/2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" pub_date="2017-08-01" xsi:schemaLocation="http://scap.nist.gov/schema/sp800-53/feed/2.0 http://scap.nist.gov/schema/sp800-53/feed/2.0/sp800-53-feed_2.0.xsd"> <controls:control> <family>ACCESS CONTROL</family> <number>AC-1</number> <title>POLICY AND PROCEDURES</title> <baseline>LOW</baseline> <baseline>MODERATE</baseline> <baseline>HIGH</baseline> <baseline>PRIVACY</baseline> <statement> <description/> <statement>
Continue reading[SOLVED] Remove all child nodes from the parent except one specific, an xml in c #
Issue This is Xml <ItemWarehouseInfo> <row> <MinimalStock>0.000000</MinimalStock> <MaximalStock>0.000000</MaximalStock> <MinimalOrder>0.000000</MinimalOrder> <StandardAveragePrice>0.000000</StandardAveragePrice> <Locked>tNO</Locked> <WarehouseCode>Mc</WarehouseCode> <DefaultBinEnforced>tNO</DefaultBinEnforced> </row> …other equal lines </ItemWarehouseInfo> I have to remove all child nodes from every row node except for the WarehouseCode node I tried this method but obviously
Continue reading[SOLVED] Parsing XML Data with LINQ
Issue I am new to LINQ. I need to return the id with the correct price information for today’s date for each MPrice. Here is an example of the XML: <Pricing> <MPrice> <Id>0079</Id> <Price> <Price>31.25</Price> <StartDt>2009-8-01</StartDt> <EndDt>2009-08-26</EndDt> </Price> <Price> <ListPrice>131.25</ListPrice>
Continue reading[SOLVED] Get and Read from XML in C#
Issue I have log files where the name of the file is today’s date. and I need to get the errors to attributes in these files if they are between the start and stop times currently kept in the variable.
Continue reading