|
Are you trying to display the end result and what does this show.
Member 15248867 wrote: txtDisplay.Text = strDisplay;
Or do you want to display each iteration, in which case you need to use a listview for display.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Depreciation is a declining balance calculation; the amount depreciated is higher in the first years than the last. The difference between principal and salvage represents a capital gain or loss.
If the principal is 100 and depreciation is 20%, then:
year 1: 100 @ 20% = 20 and 80 (depreciation and remaining principal)
year 2: 80 @ 20% = 16 and 64
year 3: etc.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I had assumed that ThenBy had to be executed immediately on the result of an OrderBy call.
I found out that is incorrect: as long as you call ThenBy on an IOrderedEnumerable<T> ... and, of course, you have your argument types correct ... it will perform as expected.
This is useful to me in an Extension I am working on where run-time parameters may determine if a ThenBy is used; may it be useful to you :")
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 21-Jun-21 8:33am.
|
|
|
|
|
As far as I can see, the LINQ ThenBy extension method only works if the argument type is IOrderedEnumerable<T> or IOrderedQueryable<T> . If you try to call it on an IEnumerable<T> or IQueryable<T> , you'll get a CS1061 compiler error even if the run-time type is an ordered enumerable/query.
Enumerable.ThenBy Method (System.Linq) | Microsoft Docs[^]
Queryable.ThenBy Method (System.Linq) | Microsoft Docs[^]
So these will work:
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.ThenBy(x => x.Bar); But these will not:
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).Where(x => x.IsActive).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.Where(x => x.IsActive).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).AsEnumerable().ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.AsEnumerable().ThenBy(x => x.Bar); Of course, if you're using reflection or the LINQ Expressions API, then a call to ThenBy should work, so long as the parameter has the correct run-time type.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Wonderful, Richard, during a recreational=reading break just now, I realized I should have written IEnumerableOrdered; coming back to edit/correct my post, I found your response.Richard Deeming wrote: using reflection or the LINQ Expressions API I'd enjoy seeing some examples of these usages.
If only I could read your mind as well as you can read my mind my code
cheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 21-Jun-21 10:30am.
|
|
|
|
|
how do I get connect to pool for getting jobs( hash buzzle )
I need just to connect to the pool please ?
its socket connection .
I tried that but not getting god result ?
|
|
|
|
|
I can't - but then, the question makes absolutely no sense to me at all ... remember, we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
So stop trying to type as little as possible and tell us what you are trying to do; what you tried; what happened when your tried it; what you tried to fix that.
And most important of all, what help you need from us!
Help us to help you!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Holding the hash buzzle high overhead, go into the stratum 1 pool until the water is at your neck level.
Then, feel with your foot until you touch the buzzle socket.
Tap with foot three times on the socket.
Take a deep breath, dive, place the hash on the buzzle.
Surface and swim quickly away.
Repeat for stratum 2.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Hello, I have a problem with my application when printing with the report viewer, when I start printing with the (print) button with preview in the report viewer everything is fine. But for when I run the print without preview with the printToPrinter class there is a rectangle that appears and the sheet limit does not stop the letter (s) if limited. Please if anyone has any idea help me how to configure the page size. I am using a roll paper thermal printer
Here are the images of the invoices https://www.cjoint.com/c/KFsoQyiepMt
|
|
|
|
|
The user shall be able to choose whether to buy a vehicle. If the user selects to buy a vehicle, the user shall be required to enter the following values
for vehicle financing:
a. Model and make.
b. Purchase price.
c. Total deposit.
d. Interest rate (percentage).
e. Estimated insurance premium.
The software shall calculate the total monthly cost of buying the car (insurance plus loan
repayment). Assume that all cars will be repaid over a period of five years. The software shall notify the user when the total expenses, including loan repayments,
exceed 75% of their income. Display the expenses to the user in descending order by value.
|
|
|
|
|
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You need to go back to your teacher or business analyst as they seem to have missed a rather vital piece of information.
Samkelo34 wrote: exceed 75% of their income
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
A couple of days down the track..
OP: How do I calculate 75% of NaN?
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
a. Maserati Ghibli S
b. £80,095
c. £5,000
d. 0%
e. £2,000
When can I expect delivery?
|
|
|
|
|
I have an string parameter with xml content in it. Basically the string have an XML inside.
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceQueryRs requestID="0" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<InvoiceRet>
<TxnID>7-1623419127</TxnID>
<TimeCreated>2021-06-11T06:45:27-08:00</TimeCreated>
<TimeModified>2021-06-18T10:26:37-08:00</TimeModified>
<EditSequence>1624037197</EditSequence>
<TxnNumber>3</TxnNumber>
<CustomerRef>
<ListID>E0000-1624055316</ListID>
<FullName>*michael</FullName>
</CustomerRef>
<ARAccountRef>
<ListID>470000-1623418914</ListID>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2021-06-11</TxnDate>
<RefNumber>1</RefNumber>
<BillAddress>
<Addr1>*michael</Addr1>
</BillAddress>
<IsPending>false</IsPending>
<IsFinanceCharge>false</IsFinanceCharge>
<DueDate>2021-06-11</DueDate>
<ShipDate>2021-06-11</ShipDate>
<Subtotal>1200.00</Subtotal>
<ItemSalesTaxRef>
<ListID>10000-1623418832</ListID>
<FullName>Vat 14%</FullName>
</ItemSalesTaxRef>
<SalesTaxPercentage>14.00</SalesTaxPercentage>
<SalesTaxTotal>168.00</SalesTaxTotal>
<AppliedAmount>0.00</AppliedAmount>
<BalanceRemaining>1368.00</BalanceRemaining>
<IsPaid>false</IsPaid>
<IsToBePrinted>true</IsToBePrinted>
<CustomerSalesTaxCodeRef>
<ListID>10000-1623418756</ListID>
<FullName>Tax</FullName>
</CustomerSalesTaxCodeRef>
<InvoiceLineRet>
<TxnLineID>9-1623419127</TxnLineID>
<ItemRef>
<ListID>30000-1623418915</ListID>
<FullName>*م1</FullName>
</ItemRef>
<Desc>صنف رقم 1
</Desc>
<Quantity>10</Quantity>
<Rate>30.00</Rate>
<Amount>300.00</Amount>
<SalesTaxCodeRef>
<ListID>10000-1623418756</ListID>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>12-1623419127</TxnLineID>
<ItemRef>
<ListID>40000-1623418915</ListID>
<FullName>*م2</FullName>
</ItemRef>
<Desc>مواصفات ملابس 2</Desc>
<Quantity>15</Quantity>
<Rate>60.00</Rate>
<Amount>900.00</Amount>
<SalesTaxCodeRef>
<ListID>10000-1623418756</ListID>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>13-1623419127</TxnLineID>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>14-1623419127</TxnLineID>
<ItemRef>
<ListID>60000-1624037191</ListID>
<FullName>total</FullName>
</ItemRef>
<Amount>1200.00</Amount>
</InvoiceLineRet>
</InvoiceRet>
</InvoiceQueryRs>
</QBXMLMsgsRs>
</QBXML>
i want to Delete
<ListID> and
<ItemRef> with out delete
<FullName>*م1</FullName>
i need new file that format
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceQueryRs requestID="0" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<InvoiceRet>
<TxnID>7-1623419127</TxnID>
<TimeCreated>2021-06-11T06:45:27-08:00</TimeCreated>
<TimeModified>2021-06-18T10:26:37-08:00</TimeModified>
<EditSequence>1624037197</EditSequence>
<TxnNumber>3</TxnNumber>
<CustomerRef>
<FullName>*michael</FullName>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2021-06-11</TxnDate>
<RefNumber>1</RefNumber>
<BillAddress>
<Addr1>*michael</Addr1>
</BillAddress>
<IsPending>false</IsPending>
<IsFinanceCharge>false</IsFinanceCharge>
<DueDate>2021-06-11</DueDate>
<ShipDate>2021-06-11</ShipDate>
<Subtotal>1200.00</Subtotal>
<ItemSalesTaxRef>
<FullName>Vat 14%</FullName>
</ItemSalesTaxRef>
<SalesTaxPercentage>14.00</SalesTaxPercentage>
<SalesTaxTotal>168.00</SalesTaxTotal>
<AppliedAmount>0.00</AppliedAmount>
<BalanceRemaining>1368.00</BalanceRemaining>
<IsPaid>false</IsPaid>
<IsToBePrinted>true</IsToBePrinted>
<CustomerSalesTaxCodeRef>
<FullName>Tax</FullName>
</CustomerSalesTaxCodeRef>
<InvoiceLineRet>
<TxnLineID>9-1623419127</TxnLineID>
<FullName>*م1</FullName>
<Desc>صنف رقم 1
</Desc>
<Quantity>10</Quantity>
<Rate>30.00</Rate>
<Amount>300.00</Amount>
<SalesTaxCodeRef>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>12-1623419127</TxnLineID>
<FullName>*م2</FullName>
<Desc>مواصفات ملابس 2</Desc>
<Quantity>15</Quantity>
<Rate>60.00</Rate>
<Amount>900.00</Amount>
<SalesTaxCodeRef>
<FullName>Tax</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>13-1623419127</TxnLineID>
</InvoiceLineRet>
<InvoiceLineRet>
<TxnLineID>14-1623419127</TxnLineID>
<FullName>total</FullName>
<Amount>1200.00</Amount>
</InvoiceLineRet>
</InvoiceRet>
</InvoiceQueryRs>
</QBXMLMsgsRs>
</QBXML>
How can I make file like above thanks
|
|
|
|
|
|
The simplest solution would be to use LINQ to XML:
Overview - LINQ to XML | Microsoft Docs[^]
string sourceXml = @"...";
XDocument document = XDocument.Parse(sourceXml);
List<XElement> elementsToRemove = document.Descendants("ListID").ToList();
foreach (XElement element in elementsToRemove)
{
element.Remove();
}
elementsToRemove = document.Descendants("ItemRef").ToList();
foreach (XElement element in elementsToRemove)
{
element.Remove();
}
string resultXml = document.ToString();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks for your response
this code remove all sub nodes in
ItemRef
but i need to keep the sub node
<FullName>*م1</FullName>
thanks
|
|
|
|
|
I have an application in MFC which creates shared memory using CreateFileMapping where I share a Struct object. In another console application in C++, I am accessing the shared memory using OpenFileMapping function and so the struct object is changed/accessed in both the applications.
Now, I want to redevelop my MFC Application in WPF C#. Is it possible to share the memory with the same console application as I have done earlier in MFC.
Please advise
|
|
|
|
|
I know that the latest .Net frameworks offer classes for file mapping. Search "C# File mapping"
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is it possible that the 2 applications that share the memory (File mapping) be developed in C# and C++ respectively.
Example:
One application in C# to create shared memory
Other application 2 in C++ opens and shares the memory file mapping.
|
|
|
|
|
Memory-mapped files have been supported in .NET Framework since 4.0:
Memory-Mapped Files | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I have created one C# dll of .Net Framework 4.7.2. In this DLL, I want to deserialize the JSON file and when I have added the code for deserialization ,I got compilation error to install the NuGet package
After installing System.Text.Json NuGet package of latest version(5.0.2), dll builds successfully.
When I connect this Dll with the C++ application and calls the deserialization method of the DLL, at that time I got one run time exception stating that:
“Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.”
Solutions I Tried:
1) I tried to change in the app.config file with the value of the version which is specified in the error.
After changing in app. Config file , I got different run time exception:
“System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'”
I tried changing the version of System. Buffers also in config file, but still getting the same error.
2) I tried to install the System.Text.Json of version 4.7.2
In this version also I am getting the same System. Buffers error.
Note: If we use the .Net 5.0.0(Core version) then System.Text.Json already present in it as default but with this version we are not able the generate the .tlb file as Regasm.exe gives error while registering the dll and in .Net 5.0.0 Register for COM interop is also disabled.
Thank you in advance.
|
|
|
|
|
If your .DLL is written targeting .NET Framework 4.7.2, you can NOT use .NET Core 5.0 libraries.
Also, trying to just download those libraries and register them with RegAsm will NOT work.
What code did you write for handling the JSON files?
|
|
|
|
|
Dave Kreskowiak wrote: If your .DLL is written targeting .NET Framework 4.7.2, you can NOT use .NET Core 5.0 libraries.
System.Text.Json explicitly supports .NET Framework 4.6.1 or higher:
NuGet Gallery | System.Text.Json 5.0.2[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|