I just did a little test, comparing speed between a function and the same thing but using a byref value instead.
Public Sub New()
Dim timespanFunction As TimeSpan
Dim timespanByRef As TimeSpan[code]....
So using byref is more then a second quicker in this case. So why does function actually exist? Is it just to make programming more easy and your code look nicer? The most important things of a application are Usability and Speed right? So why trade speed for nicer looking code?
I am coding a web-crawler which will crawl the websites and selectively parse different sections of a web site.I am a .Net developer so the choice was obvious that I did it in .Net but the speed was very slow which included downloading and parsing of HTMLPages..Then I tried to just download the contents first using .Net and then same domains using python but the python was very impressive in downloading data. I have achieved downloading using python but the later part is not that easy to code in python, which obviously i don't want to do.The same batch of domain which took 100 seconds in Python was taking 20 minutes in .Net based crawler..I tried url... to download and in took 8 seconds in Python and same was taking 100 Seconds in .Net crawler..Does anyone anyone have any idea why this is slow in .Net but fast in python?
How do i exactly check internet connection speed.I have searched around google and found out a method w/c will Download a file like 1mb size, then it will calculate the speed.
I have a codes that calculates DownLoad speed and UpLoad speed kb/s. I would like to implement this kind. I also want to put such kind of graph. Any article or links where can I start building my own like that.
I want to make an numerical integration method with takes in an analytic function and integrate it over a specific interval. For the numerical integration procedure I want to use some procedures in nr.com. The problem is that these are programmed in C++ and they uses functors to pass a function to the integration method. How can I do this in VB 2010?
I want to initialize the function (i.e. set a=1,b=0 for function y(x)=a*x+b) and then pass the function to the integration method. Then when the integration method call the function it only calls the function with one parameter (i.e. x since a,b is already set)
What is the best way to do this in VB2010?I want to make a general integration method where I can pass any single valued function and integration limits.
I have just started using VB, and from what I have found so far it seems like the tools you have is
- to us a delegate for the function - to use a lambda expression for the function - send a pointer/adressOf - to create a function class/structure and submit this to the function
As for now I am most inclined to create a function-class. But I am not really sure how.F.ex. I make different classes for each "uniqe function" I want to integrate, but how can I pass them to the integration function when I need to specify the argument type in the integration-function-call?This seems like a basic problem which applies to many Math operations, so I think it would be very useful to clarify this.
I'm trying to undersatnd the syntax of calling a funciton and it seem confusing when I'm using a web service in ASP.net. Maybe this question should be in an ASP forum, but it is a VB question. This simple web service allows you to type in your name and it response with an alert box with you name.
My question is, How can you call a function with 2 arguments when the function is only defined for one. I understand that the second argument is actually a method that handling the respons, but how can you interchange function arguments for methods and how do you know that there are methods for
In a partial class, I declare a integer. Then, depending upon if a criteria is met, I set it's value to either 1 or 0. Then, I try and compare the set value, but instead of it being equal to 1 or 0, the code behind that I've stepped thru shows it ends up equaling &H0 or &H1. What does that mean? Why does it show a value of &H0 in the code behind when I debug instead of either a 0 or a 1???
First my prog scan a specific path "C:music" which contain Mp3. Then it takes the MD5# of all mp3 and put it in a listbox1. Also on the formload it does open a ".txt" which also contain MD5# that goes into listbox2.Now this is what i am looking to have :When i click my button it compare each line of my listbox1 to listbox2. If , for exemple , the first line of listbox1 is already in the listbox2 then it delete the first line of listbox1 (listbox1.items.removeat(0)). And Do until listbox1.items.count = "0".
I am trying to carry out a synchronisation of two databases: one on the server and the other on a local machine. So that even when they are not connected on the network, the local database can carry on accepting data but when the network is back on, the local database can update the server and the server can also update the local machine with data it accepted during the time when the network was off. by first comparing two tables in two databases and then if they are any differences the updating begins and i've since been stuck.
Private Sub btnCompareTables_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompareTables.Click 'dont know which arguments to put when calling this function 'How do i tell the computer which databases to compare Comparing()
(Each line is a record but if needed I can combine them all to one record)I have the document before changes in one table and the document after the change in another table.My problem is that if I just compare them by ID then I'll get many more changes than actually occured. Ex: If a line (/record) was added between record 2 and record 3, instead of tracking 1 change I will see that all the records from 3 and on have changed (because they will be pushed off by one record). Can be also something which knows to compare documents and I'll take the information out to document for comparison.
Let me provide a little detail to explain what I'm trying to accomplish before I get into the nuts and bolts of the question. I've got two data sources - one is a SQL Server containing part numbers, descriptions, etc. The other is a CAD system that does not have a database in a traditional sense. What I'm trying to do is read out the bill of materials from the SQL Server and compare it to the CAD assembly drawing to ensure that the CAD system contains the same information as the SQL Server.
Getting the data from the SQL Server is fairly straight forward. I query the database and populate a datagrid. Done. Quick. Easy.Getting the data from the CAD system is a little more involved. I have to load the assembly drawing to get a listing of all the component parts and then load those individual drawings to pull the "Part Number" property from the drawing. This is a somewhat time consuming and slow process (unfortunately) since each of the files must actually be accessed. I load those properties into an array (I guess a list might be more efficient).
So now I have a datagrid and array with part numbers. I need to compare them and colorize the grid accordingly. The grid should remain transparent if the part exists in both, color the row yellow if it only exists in the grid, and add a row colored red if only in the array.
As best I can tell, this means looping through the array on each line of the grid. The thought process is this:Default the grid to yellow rows.Loop through the grid and loop through the array to compare. If a match is found, make the row transparent and delete the element from the array.After step 2 is completed, the array should only contain elements that are not found in the grid. Resize the array to remove the empty elements.Add the elements of the array to the grid and color those new rows red.The problems with this logic is that it seems expensive from a performance standpoint. Surely there is a better method? Also, if I modify the grid in some manner (like a resort) I have to go through the process again.
Is there an easy way to get the CPU name and Speed? Also for Memory to display in MHz?
Heres a pic of my app and its
Was bored and wanted to make a "Mac" like app (About This Mac). I have some experience with Xcode. Never really did programing on windows before. Also, is there any way to call up a control panel through VB.Net? (Windows Update)
I am wanting to be able to check to see if two images appear to be the same, within a certain threshold.These two images are the same to the eye, but one has slightly different colors. I have tried the following example:
[URL]
Unfortunately, it only seems to detect when the images are identical. How can I determine if the images are the same within a certain threshold, with VB.NET?
I'm working on a Website in Web Developer 2010 where the content of a text box is checked against a list of values to find a match. There must be an exact match for the user to be allowed to proceed to the next step of the wizard.
Is there a shorter method to do this using the VB 'If' statement, other than specifying each condition individually?
I've tried something similar to the following, but for the amount of values it would be more practical if there was a shorter method.
If TextBox1.Text = "User1" Then Label1.Text = "Ok, That username is valid. Click NEXT to continue" LinkButton1.Enabled = True
I am a c#/asp.net developer and I am having to work on a VB/asp.net. I have two variables
Dim originalDate as DateTime? Dim newDate as DateTime?
Both nullable datetimes, originalDate is a nullable date I am getting from the database and newDate time is set in code, I need to compare them, they can either both have dates, neither have dates or one have and one not.
I have a bit of code as follows:
if origEndDate = origEndDate then
When both origEndDate and origEndDate are "nothing" this statement is false (well when I run it in the watch window it comes back as nothing)!I don't understand why this is the case because I was under the impression doing an "=" compares the two values and as they are the same surely it should be true? What syntax should I be using as in C# I can do the above as so:
I want to write an alarm clock application that should display a certain message at a time set by the user.How to compare system date and time with the time set by users in a text box?
I am fetching DataTime value of a SQL Database, LockDate. Dim diffDate As TimeSpan diffDate = DateTime.Now - LockDate minutes = Convert.ToInt32(diffDate.Minutes) hours = Convert.ToInt32(diffDate.Hours) Minutes value is showing incorrect values.
I have a method that I want to check to make sure that both integers entered are both positive: Public Function BothPositive(ByVal num1 As Integer, ByVal num2 As Integer) As Boolean If (num1 And num2) > 0 Then Return True Else Return False End If End Function
Now if I were to enter some numbers in BothPositive(1,1) = True BothPositive(1,2) = False BothPositive(-10, 10) = True
Why is this? What is going on with the order of operations in the comparison statement or what is the "And" trying to compare? I don't see why this wouldn't work.
I'm trying to compare a item i have to enter in a combo box with an item already in the box (duplicating items). I've use the contains function but i need something that is case sensitive. Here is what i have so far