VS 2008 Extracting Best Laptime And Sorting A List
Aug 22, 2011
So I'm working on this school project where I'm supposed to add names and laptimes from textboxes to a list. I've got that sorted out with some help from Shaggy_Hiker (thanks!). Now what I'm trying to do is get the best laptime from the list of entries and display that in a label. I also want to sort the list by laptimes in ascending order, and I've tried the.Sort method without too much luck + all entries with a laptime over 60 min should be disqualified.
(I'm thinking of adding all of these to a seperate list which I've named feilreg, but right now all entries that doesn't meet the right criteria like empty textbox, negative laptime and so on gets saved to that list. I'd like to make it just entries over 60 min) I also can't seem to figure out why a laptime of say '32.45' won't register, it has to be with a comma like '32,45'. I've got a function in my class 'Rundetid' to format the output to two decimals maximum.
I am however struggling to sort a list using 2 parameters within a lambda function. The properties within my list that i need to sort by are Category and then by Cost. how to do this?
One displays a list of contributors for a charity and the amount given in a text box.However iv created another button but i need this to sort the list of names to just display the names and in alphabetical order.
I'm using the following code to sort a List(of Class) using LINQ. It works fine, but I'm wondering if there is a better way to do it. I'm basically taking one list, applying LINQ to it, then using the result to create a second list in the sorted order. Can I do this without creating a second list? Here is my sample
' KeyMatch is my Class Variable ' mMatchList is the Unsorted List '
I was just wondering how to extract or parse any particual tags (whichever I specify) from webpages. I know how to extract text and links from webpages, but I tried to use the same method from the following code for div tags, title tags etcetera and it doesn't seem to work:
I'm trying to sort a List of objects with a generic comparison.I get an exception when the property on which I'm sorting happens to be null in one of the objects.VB.NET 2.0, web.i've read several posts on this exception, and still don't get it.[code]It is true that this only happens on properties which happen to be null somewhere in the list.Sometimes I sort on other properties which happen to always be always non-null (using a different, but similar, comparison method), and this technique works just fine.I've tried to implement the CompareTo for both IComparable and IComparable(of FollowupSurvey) so I could capture this exception while debugging, but netiher actually get invoked (despite what it seems like the exception is telling me). At this point, I don't have a CompareTo in my FollowupSurvey object; thus, it's using Object's.It doesn't seem as if I can really help if the base CompareTo doesn't reutrn 0.anyone have any idea what this exception really means, and how to make sorting work properly?
I have a list (i.e. Dim nList as new List(of className)). Each class has a property named zIndex (i.e. className.zIndex). Is it possible to sort the elements of the list by the zIndex variable in all of the elements of the list?
I had a need to mark a listview row if filenames were duplicates for n number of characters from the left. I wrote the following but it smacks of VB6.[code]...
I have a list going into a repeater, sorting with jquery sortable(), and then need to put the sorted list into a session variable. I cannot seem to figure out how to get the sorted values back into a list.[code]...
I have a slightly odd problem that I think is most likely due to an act of foolishness on my part, but for the life of me I (and other members of my team) can't see it.I have an object that contains a generic list property which I would like to sort. I have written a comparer class to do this for me and I am calling it in the following way:baseObject.ListOfThings.Sort(new ThingComparer()I have debugged into my compare function and it is returning the right values.However After the sort call, the list remains unchanged. Have I missed something obvious, or is there something else I need to do.EDIT: Yes I was being a fool, and the property returning a list was recreating it from scratch each time it was accessed
I am using the code from hereevelopment/vbnet/code/370426 to sort my listview items. But I want something more 'dynamic': when I click on a header column, I want that it changes the sorting based on the column that has been clicked. here is my code:
I would like to sort a list of strings which represent paths. The sort result will do have a hierarchical order. What I mean is: for each directory path, I want to list all files in that path (alphabeticaly or not doesn't matter) in first time. Then, each subdirectory path will be listed. For each subdirectory, I want all files..
I'm trying out some LINQ expressions and can't get them to work with the List class. Basically I want to be able to sort a list of custom objects by property type, however the C# LINQ syntax is KILLING me and I can't figure out how to convert it to VB
Class Foo Sub New(Name As String, Position As Integer) Me.Name = Name
I need to sort a list (of person) to person.Age within person.Department. f I user personlist.sort with a comparer for Age and then sort again with a comparer for Department, the sequence of age is destroyed.
In 2007 I created a program that reads weather data into a listview. When a user clicks on the column header it fires off the column click event handler which calls the Sort Wrapper function. The Sort wrapper will re-order items either in ascending or descending order.
I have never been able to get negative integers to sort properly. I have created a stripped down listview program with a few numbers in the grid for testing. (see attached program zip file).When you run the program, click on the column header that says "Val" and you will see right away that the numbers do not sort correctly.
I have a lists of different custom classes and each must be sorted severals times before the algorithm is complete. For each sort I wrote a comparer. Sofar so good. Everything works. But: By now I have abou a dozen different comparers in more than one class and it is still getting more. I wonder if there is a way to limit the number by writing a new general function that can be used to sort all lists without the need for a specific comparer.Below is what I've got so far. But it does not work.
"System.Collections.Generic.List(Of ClassA)" can not be converted into "System.Collections.Generic.List(Of Object)."
I'm looking for a simple and efficient way to sort up to 60,000 strings that are 3000 chars long in reverse order and save them back out to a text file.
I originally thought of a doubly linked list, but then I realized that we aren't privileged enough to have pointers.
Is there some other way I can create an efficient linked list without pointers?
I'm using a Listview in VirtualMode, so I can 'add' a lot of files almost instantly. A Listview in VirtualMode does not allow sorting, so I need to sort the data myself. The data is stored as a List of Structure (it's faster to load than a List of ListViewItem). The code below works fine, but I need to sort based on multiple variables in the Structure. Code:
I have a list of collection of points on the screen. I want to order them based on their distance from a seperate, independent point. What's working is I have a function GetDistance which does the dirty pythagorian work of returning the distance between two points.
'Create the set point from which to start all measurements from (startpoint) dim SetPoint as new Point(200,200) 'Create a list to hold arbitrary points to test (endpoints) dim ListOfPoints as new list(of point)
I'm trying to figure out a way to sort the entries of a listbox... but in a different way instead of the obvious one (sorted property). First of all, I need to explain how the items are populated at first:
I have been working lately on a program who extracts URl Source codes!The program does work with most of URL but not for MEdiafire URL!When i check the source code from the web browser i can see there is some code missing;y tried diferrent types of Encoding.
Example:This is the final source code extracted from WEBBROWSER(Firefox,InternetExplorer,GoogleCrome)
All I've been able to do is create the form. We have to get information off of a website and load certain information back into the textboxes on our form.
Assignment 6 - Text Parsing Many applications require you to extract information from a block of text. We will be using this heavily in the project. This project is designed to give you some practice extracting information out of text files. You will need to open up a file, search the file for some specific content, and then copy that content and place it on screen.
Go to Jobs.com and select a state that starts with the same letter as your last name (if there is no state that starts with the same letter, use the second letter, then the third letter, etc.). For example if my name was 'John Byway', since there was no B or Y, I would pick a state starting with W - either Washington, West Virginia, Wisconsin, or Wyoming.
The idea is you want to extract all the jobs information out of the page. We want to put the jobs names in a combo box, so the use can pick any of the jobs. Ideally, this would also show the information about each job. You don't need to do that. However, you do need to extract the information and put it on the screen (When you load the next job, the old job information will be lost, and you will be left with the information about the last job loaded)
Tasks
1. Go to the above address, view the source in the browser, copy and paste it into a text file. You do not need to access the Source of the web page within your application.(in IE go to View / Source; In FireFox go to View / Page Source)
3. Extract each job title and place the name in the Combo box.
4. Find and extract the following fields. Note, some jobs may not list all of these. In that case, get as many as are presented.
a. Date b. Title of job c. Company d. Location
[code].....
Indicate on screen how many jobs you found. Note, you only need to look on the first page of jobs?
I have a program made in VB that on a button click extracts a exe file from its resources to the HDD then runs the program and deletes it after it closes. I first used the desktop to extract the file to, but seeing as I need to use this program on several computers the account names will be different so this is of no use. I've tried using C: but access is denied.
I've found all sorts of threads about extracting file icons, and I'm able to do that no problem, but I would like to also extract some other information from a file (like you can find in the properties window), such as the file description. Are there any commands that are geared specifically toward getting this information?