[Solved] Extra details in output of c++ using g++

From all the info you have given, it seems that no new line is being printed on the end of the output, that means the either you forgot to recompile when you added std::endl, or you have misplaced it. Edit: I just ran your code the way you posted it. The endl worked correctly, and … Read more

[Solved] How to assign date at each insertion in sql server c# [closed]

Change your database structure like this Table Leave emp_id, leave_id, leave_Type, days_applied, from_date, to_date, date_applied Table Leave Type leave_Type_id, leave_Type Note: Above tables are just for e.g. to solve your problem you can change it. With above structure you can easily calculate leaves taken by employee and also filter by leave type. 5 solved How … Read more

[Solved] C/C++ divisions with double and following shift operation

A very small rounding difference, within the range possible for the difference between 64 and 80 bits, could account for the different output. The combination of the truncate to int and shift can magnify a tiny difference. This program: #include <stdio.h> int main(){ double zaehler = -20; double teiler = 0.08; printf(“ergebnis = %d \n”, … Read more

[Solved] How to make my calculation more accurate

The pseudo-code would be: if (vacationDayDate.Year == year) { if({isHalfDay}) yearMonths[vacationDayDate.Month] += 0.5; else // is full day yearMonths[vacationDayDate.Month]++; } Or more succinctly: if (vacationDayDate.Year == year) { yearMonths[vacationDayDate.Month] += {isHalfDay} ? 0.5 : 1.0; } 7 solved How to make my calculation more accurate

[Solved] c++ class two dynamic attributes [closed]

Change A renew() to void renew() and the code works. #include<iostream> using namespace std; class A{ private: int **m1; int **m2; void allocate_mem(int ***ptr){ *ptr = new int*[1]; (*ptr)[0] = new int[1]; } public: A(){ allocate_mem(&m1); m1[0][0] = 1; allocate_mem(&m2); m2[0][0] = 1; } //I need a method that change m2 (according to the value … Read more

[Solved] How to convert string formula in c#? [closed]

First you read the documentation and pretty much code it up as written: public static double ComputeResult( double diameter , double height ) { double result = 0.5 * ( ( (2.0*height) – diameter ) * Math.Sqrt( (height*diameter) – Math.Pow(height,2.0) ) + (diameter/2.0) * Math.Asin( 2.0*height -1.0 ) / diameter + ( Math.PI * Math.Pow(diameter,2.0) … Read more

[Solved] How to convert List to xml document in c#

You may use XElement or XDocument and LINQ. Providing a sample of what the XML should look like we could provide more info. For instance: BugWSResponseList1.Add(“<Bug><family>TEST22</family><product>Dr.Watson</product><version>Xpress API</version><productarea>1</productarea><subarea></subarea><qe>sdawar</qe><duplicateId></duplicateId></Bug>”); BugWSResponseList1.Add(“<Bug><family>ESG</family><product>Dr.Watson</product><version>Xpress API</version><productarea>1</productarea><subarea></subarea><qe>sdawar</qe><duplicateId></duplicateId></Bug>”); XElement xe = new XElement ( “Bugs”, BugWSResponseList1 .Select ( x=> XElement.Parse(x) ) ); So after i have loaded the list with the two pieces of … Read more

[Solved] convert numeric + alphabetical string [closed]

Maybe you want to extract digits only to create a long? You could use Char.IsDigit and LINQ: Char[] digitsOnly = “3e317188a00577”.Where(Char.IsDigit).ToArray(); if(digitsOnly.Length > 0) { long result; if (long.TryParse(new string(digitsOnly), out result)) { Console.Write(“Successfully parsed to: ” + result); } } Result: Successfully parsed to: 331718800577 If you instead want to parse it from hexadecimal … Read more

[Solved] C# Form – logIn WebSite [closed]

if you can’t find something unique for that login button : Edit: Tested and Working private void Form1_Load(object sender, EventArgs e) { //WebBrowser webBrowser1 = new WebBrowser(); webBrowser1.Navigate(“http://www.facebook.com”); webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(loaded); } private void loaded(object sender, WebBrowserDocumentCompletedEventArgs e) { var bro = sender as WebBrowser; var List = bro.Document.GetElementsByTagName(“input”); foreach (HtmlElement Item in List) … Read more

[Solved] How to resolve InvalidCastException after translating LINQ-to-JSON query from c# to VB.NET?

In order for {columns}.Concat(rows) to work, it seems you need to add an explicit call to AsEnumerable() in order to make sure the type TSource for Enumerable.Concat(IEnumerable<TSource>, IEnumerable<TSource>) is inferred correctly: Dim csvRows = { columns.AsEnumerable() }.Concat(rows) _ .Select(Function(r) String.Join(“,”, r)) Fixed fiddle #1 here. A DirectCast({columns}, IEnumerable(Of IEnumerable(Of String))) also seems to work, as … Read more