Repeat Some Instructions The Fastest?
Sep 23, 2008epeat some instructions the fastest?i tried this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
start()
[code]....
epeat some instructions the fastest?i tried this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
start()
[code]....
I'm trying to make a mastermind game program with visual basic. I started of creating the combination maker for the start of the game. Hoever, in my version i don't want any colors to repeat. I used the random function independently to get numbers from 1 to 6. Each number has a corresponding color. The problem, the values still repeat sometimes.
Here's my code for that part:
Randomize
a = Fix(Rnd * 6) + 1
txtA = a
If a = 1 Then
[CODE]...
How do I (programmatically) find out the key repeat delay and key repeat rate for a system?
A solution that works on any/all .Net capable platforms would be ideal, but the key target OSes would be XP, Vista, and 7.
How can i convert IL instructions to VB or C#.Asgar
View 7 RepliesI have to sequence through bunch of labels and pictures.
Is there a general insatruction to hide them all?
At this time I am using:
Label1.hide()
Label2.hide()
Label3.hide()
I used the TextBox to display "text instructions" for user but at run time I noticed that the text in TextBox is modifyable.Most of the time the text comes highlighted also.The instructions are a few lines per page so the label is not a good idea.
View 11 RepliesI was unhappy with the kerning in one of the installed fonts on my system, so I re-defined the kerning in a font editor and installed the revised font (under a new name) on my system. When I use the new font in Microsoft Word or Adobe Photoshop, my new kerning works fine - but when I use Drawstring in a VB program, although the new font is used, the kerning instructions are ignored.Does anyone know if this a feature of the Graphics.Drawstring method, or am I failing to set a switch somewhere? If it's a feature, is there another method which kerns correctly?
VBE 2010 .net 4.0 XP SP3
There is a feature I used to have in zOS assembler environment that I'd like to know if it's available in VS2010 (VB .net). In assembler it is called macro language :
First, I define a set of instructions and save it as a macro (ex: MYMACRO)
Second, anywhere in my source code I can call the macro (by adding the line "MYMACRO")
Third, when i launch the compilation/link step, the compiler implicitly replaces all the "MYMACRO" lines in the source code by the content of MYMACRO defined in first step.
Is there a feature like this in VS2010 ?
Example:
Content of macro CONTEXTSTART with a parameter &id
Try
ContextManager.Start(&id)
[CODE]........................
Were can i find instructions on the use of the IDE? My problem is that after writing code, in a botton for examle, I can't return to my Form.
View 2 Repliesfrom the vb web:
Quote:
The following Microsoft intermediate (MSIL) instructions throw OutOfMemoryException :
*
box
*
newarr
*
newobj
Does anyone knows what exactly does box means? and also is there anyway this statement will cause an outofmemory: Dim a As Boolean
What about if its just an empty object: Dim a As someobj
I have a program that scrap websites and "puts" the information into a table.
My problem is that now and then i get values that i already have in the table. to avoid getting duplicates i search thru the table first to see if the value exist or if the record exist but might be in need of getting updated.
My table contains 60 000 records and is growing.
first i filtered a datagrid but it takes to long so i used the "select" method on the dataset table but it takes longer.
the program loops thru thousands of websites so it'll be doing a search for every website and the added time to collect the data just takes too long.
so the way I have this working now I'M using System.Collections.Generic.List(Of T) for holding 100's of a structure.Dim Users as New List(Of User)
I was wondering if there was any better way or faster list container or something like this in the .net framework?
When I have many controls on a Form (i.e. Label, Button etc) that do almost the same thing, I often use one method to handle all the controls Click, MouseDown, MouseUp events.But to know which of the controls throwing the event and access the properties of that control I need to cast the "sender" object to the correct type.
The thing is that I always know which type it is, I don't really have to "TryCast", "DirectCast" and check if the operation returns true. I some times use CType as well.
[Code]...
I have been a VB6 developer for several years, and switched to .NET couple of years ago.Since then, I switched to WPF, and now, i am attacking Silverlight + PRISM I whould like to know if anyone of you programmers have some GOOD and CLEAR tutorial/instructions on setting up a View-Switching application in VB code please?So the main goal whould be a menuregion (working!).When the user clicks some buttons, i need the MainRegion to refresh its view, depending on the selection ofcourse.I am also looking on information how to keep track of the changes made when trying to switch the view?
View 2 RepliesI've an arraylist having 30000 items in it, what's the best way of creating a text file on the fly from an ASP.NEt page? Currently I'm using the code below but it times out with large data,[code]
View 3 RepliesI have a pixel I want to monitor for change. For example, first it is white, and suddenly it is black, and then changes back to white. My method is not fast enough to get this change.any changes I call the function below to get the original color of the pixel. Then I have a timer that runs every 1 ms to take the color of the pixel, and if it's not equal to original color; do something. For example counts the time the pixel has changed. However, this function does not run fast enough. Is there any faster methods to check the pixel? The function returns an ARGB code of the pixel color.[code]....
View 3 RepliesThe fastest way to generate thumbnails using VB.net and multiple computers without bogging down the UI. Right now I have 3 computers and I run an instance of my thumbnail generator code on each. One computer hosts the images. The other two computers access the folder of images via the network. My code is written to compare the main folder and a thumbnail folder to see if new thumbnails need to be generated. If so, a thread is generated and the thumbnail generation code is ran on the thread. There are 5 threads created in all. So, theoretically, across 3 machines, I'm getting 5 independent threads and I'm thinking that Windows 7 automatically spreads the load across the local cores. In an effort to avoid duplicating work, the comparison is done before the generation of each thumbnail.
This method is faster than using only one computer but drags down the performance on all computers (THE UI also becomes unresponsive). I'm looking for a better way to
1.) Produce the thumbnails as fast as possible
2.) Keep all UI's responsive (boy possibly controlling the priority setting) and
3.) Done within a single instance of the program.
In the #3, I mentioned that I would like to use one instance. Is it possible for networking information be used by the hosting computer that will allow threads to run on the other 2 computers? This way, the 15 threads will be controlled by a single host computer.
Here is a snippet of my
Public Sub CreateThumbsFUNCTION(ByVal IMAGE As String, ByVal MAXDIMENSION As Integer)
'following code resizes picture to fit.
'IMAGE needs the full path
'If thumbnail already exists, it will skip
[CODE]...
I was wondering if anyone had a better(faster) way to parse a Tab delimited file in VB.net. I need to read a file into an SQL table and the file contains about 300,000+ rows. Takes quiet a while. at the moment i have the below [Code].
View 6 RepliesI am quite new at VB.NET and just need helo on sorting algorithms, prferbly the fastest (quick sort) but bubble would so. It is for sorting and array for 12 numbers, which are being enter by the user via a input box. These are then transfered onto a listbox for visual aid. so the steps involved would be: (already done)1) Enter then inputs into array via inputbox2) Input to sppear in listbox (not done)3) Sort the array ascending/decending4) print results into the listbox again.In my code there is also a total and a average, but that doesnt need any help on it. [code]
View 4 Repliesive a folder with a few hundred .rtf documents. am making a program to search some text in them.the way currently im employing is having a richtextbox on my form and serially loading each file in the richtextbox and if the search text is found in it,adding it to a list.but this is time taking,
View 4 RepliesIn my project I have 3 different forms. They all have the same design layout so the only different you see is where the text boxes and buttons are placed. Right now I have 3 buttons at the top of each form that Im using to switch between the forms
[Code]...
I know there is probably a much better way of doing this, and faster. I dont' like the delay between each window showing/hiding. what options do I have to make this run better? Since I have the same design background is there I way I can just hide and show just the controls instead of showing/hiding the entire window?
My current project is to process several files. The files come from a Unix server and have been SFTP'd to the Windows XP machine. (That's fixed protocol, I don't have control over it.) My problem now is that the Unix new line characters and Windows characters don't match. The solution is to read the file line by line and replace 0x0A with 0x0D + 0x0A, or Asc 10 with Asc 13 + Asc 10, or vbLf with vbCrLf, however you like to say it.Well I have a working function to do this, but any extra speed I could squeeze out of it would be fantastic. The text files I'm working with can reach sizes of about 100MB. So to the question:
Q: What is the fastest way to read a file in, change characters as necessary and then write the file out?Here is my current working code.
Private Sub FormatCharacters(ByVal files As String())
Try
For Each fileName As String In files
FileSystem.Rename(fileName, fileName & ".old")
[code]....
When ListView is not in Virtual mode the following method seems to be the fast method to load a large list into ListView:
Dim items As New List(Of ListViewItem)
Dim alllines as String()=System.IO.File.ReadAllLines("FilePath")
For each line as string in alllines
Dim item As New ListViewItem
item.Text = line
items.Add(item)
Next
ListView1.Items.AddRange(items.ToArray())
I have a search function on my company's website (based on .NET 2.0) that allows you to narrow the product catalog using up to 9 different fields. Right now, after you make your selections on the frontend I am building a dynamic query and hitting the database (SQL Server) to get the resulting list of items numbers. I would like to move away from hitting the database everytime and do all of this in memory for faster results. Basically a 3500 - 4500 row "table" with 10 columns: the item number (which could be a primary key) and the 9 attribute fields (which have repeating values for many many rows).
There can be any number of different searches between the 9 columns to get the items you want:
Column A = 'foo' AND Column D = 'bar'
Column B = 'foo' AND Column C = 'bar' AND Column I = 'me'
Column H = 'foo'
etc...
Based on my research, the .Select() function seems like the slowest way to perform the search, but it stands out to me as being the quickest and easiest way to perform the narrowing searches to get the list of item numbers:
MyDataSet.Select("Column B = 'foo' AND Column E = 'bar' AND Column I = 'me'")
In my specific case, what method I use as an alternative that has the same narrowing functionality and better performance instead of settling for the datatable.select() method?
1) a text document which has content like :
uber|uber|ultra
taxi|taxi|taxi cab|cab|minicab|airport taxi|airport transfer
genitalia|genitalia|genitals
[code].....
My need is to work with what I have (2005 studio), what I know (Visual Basic) but need a primer. I am a visual learner (so I need to see [1] how the form is created, named and set up). From there I need to see [2] how he code works so that I can implement from there.
View 2 RepliesHow to repeat the row values up to end date For Example
Table1
Date Name Dept
-----------------------
12-02-2009 Raja IT
13-02-2009 Ravi CSE
14-02-2009 Ramu ECE
From the above table value i want to repeat the value between the two dates from 12-02-2009 to 12-03-2009.
Expected Output
Date Name Dept
--------------------------
12-02-2009 Raja IT
13-02-2009 Ravi CSE
[code]....
If StartDate is same value of Date column For EndDate i have to check the time column, if time is greater than 17:00 it should display a next date in EndDate column.
i have little comand to add values from one table to another like this, but i need to this command to repeat, because table has more than 130 000 records.
Here is my code:
PrivateSubButton1_Click(senderAsSystem.Object,eAsSystem.EventArgs)HandlesButton1.Click
Me.FTADRESBindingSource.Filter =
"[noqeyd]"&
[code]....
what i have to do for repeat this action until last record in table?
I have a simple program that takes the number of students and calc's the avg. It is suppose to add one student,(female, male,all) with each button click and update the avg. I have a loop set up to do this but I don't know how to get my do/while to work once, each time I press my calc button or can't it be done this way?
I'll try to past my code so far:Public Class frmMain
[Code]...
I'm having trouble using the Random class. I have this [code]...
I have this code in a function and everytime I call it it return a random number. The problem is I only want the number to be return/generate once. There be times I call the function and it returns the same number as in the pass. Is there a way to random the number once? I know in C++ you use like "Seed" or something and it will only generate once.