[Solved] How do I get latitude and longtitude for desktop application? [closed]

A standard GPS device (internal or external) sends data on a serial port. Receiving any data from Serial Port is very easy. Please check this link. //define serial port SerialPort serialPort1 = new SerialPort(); //configuring the serial port serialPort1.PortName=”COM1″; serialPort1.BaudRate=9600; serialPort1.DataBits=8; serialPort1.Parity=Parity.None; serialPort1.StopBits= StopBits.One; //read data from serial port string data = serialPort1.ReadExisting(); GPS data … Read more

[Solved] Segmentation fault while reading data from file

While you have a good answer addressing your problems with strtok(), you may be over-complicating your code by using strtok() to begin with. When reading a delimited file with a fixed delimiter, reading a line-at-a-time into a sufficiently sized buffer and then separating the buffer into the needed values with sscanf() can provide a succinct … Read more

[Solved] Running an executable that is inside the project

Try: String exePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),”AIRApplication”, “COMTEST.exe”); The above code resolved 1/2 of the issue. The other 1/2 was that the exe was not being copied to the debug folder. Updating the ‘Copy to Output Directory’ option resolved this. 6 solved Running an executable that is inside the project

[Solved] Replace a string in string that is in a List [closed]

Simple. Iterate over all strings inside List and then check if myString contains that or not. If yes, then replace it. foreach (string item in lst) { if (myString.Contains(item)) { myString = myString.Replace(item, string.Format(“$${0}$$”, item)); } } Also you can do same with LINQ: lst.Where(item=> myString.Contains(item)).ToList() .ForEach(item => myString = myString.Replace(item, string.Format(“$${0}$$”, item))); You can … Read more

[Solved] remove html input tag from string using C#

You could remove input tags from the string with a regular expression: var temp = “The accounting equation asset = capital + liabilities, which of the following is true. Ram has started business with 5,50,000 and has purchased goods worth 1,50,000 on credit <input type=”radio” id=’op1′ name=”q2option” value=”1″ /> a) 7,00,000 = 5,50,000 + 1,50,000 … Read more

[Solved] IEnumreable and IQueryable [duplicate]

When querying a database, I prefer using a IQueryable because the request is sent when data are needed. I mean this var users = (from user in db.Users select user ).AsQueryable(); //it doesn’t load data yet until you write users.ToList(); or users.Count(); solved IEnumreable and IQueryable [duplicate]

[Solved] Execution time of C++ algorithm [closed]

For a logarithmic search, the time would be T ~= constant * log(N) T / log(N) ~= constant So to estimate the time T2 for size N2 given time T1 for size N1: T2 / log(N2) ~= T1 / log(N1) T2 ~= T1 * log(N2) / log(N1) ~= 0.00096ms * log(1000000) / log(290024) ~= 0.00105ms … Read more

[Solved] Group by a nested list of object based on date [closed]

var temp = dbconnect.tblAnswerLists .Where(i => i.StudentNum == studentNumber && i.username==objstu.Return_SupervisorUserName_By_StudentNumber(studentNumber)) .ToList() // <– This will bring the data into memory. .Select(i => new PresentClass.supervisorAnswerQuesttionPres { answerList = Return_Answer_List(studentNumber,i.dateOfAnswer.Value.Date), questionList = Return_Question_List(studentNumber, i.dateOfAnswer.Value.Date), date = ConvertToPersianToShow(i.dateOfAnswer.Value.Date) }) .GroupBy(i => i.date) .OrderByDescending(i => i.Key) .ToList(); temp will actually be of type List<IGrouping<string, PresentClass.supervisorAnswerQuesttionPres>>. 2 solved Group … Read more

[Solved] Not getting output in case of string

You are using an uninitialized string, so assigning a to s[0] does nothing or does undefined behavior. To do this, you have to give s a size, as the options below: Option 1: Resize #include <bits/stdc++.h> using namespace std; int main() { string s; s.resize(10); s[0] = ‘a’; cout << s << endl; return 0; … Read more