I know I'm being quite pedantic here. But, what is the right way to get a true 50/50-chance with a generated random number? Say, to simulate the flip of a coin. [code] I know this difference is close to nothing, but I'm doing some calculations on bell curves, in such a way that it requires true 50/50-chance.
I'm trying to build a function where I can pass in a percentage and it would have that percentage to return a true value. However I'm completely drawing a blank on how to make on such function.
I save the bus Information in the two-dimensional array.As follows:
array 0 1 2 3 .............................. 0 106 A B C .............................. 1 102 D A E ..............................
[code]....
Array(x,0) are bus lines,behind its are place.Now I want go to the E form the A(pass 106),but A can't direct to E.But A can pass 102 to E.So line is [106-102].How can I achieve the bus transfer?
Most of our development is done in vb.net (not my choice) and one frequently used code pattern uses an 'On Error GoTo' followed by a 'Resume Next' so that all database fields can be read with a DirectCast() and any DBNull values are just ignored.
The current code would be On Error GoTo error_code oObject.Name = DirectCast(oReader.Item("Name"), String)
I want a modal screen on startup of the computer, so that user forces to make some action on that screen. Also I want to disabled close button of the screen, It should cover entire Desktop.How to achieve using winform/webform? is parent/child form is the only solution fro this/?
I was wondering how to achieve a list with all possible combinations of letters. Now there are some nice examples on the Internet, however, I'd like to have the following:
Let's assume you have 3 letters (A, B, C), and have a limit length of 3, then it should display this list:
A B C AA
[Code].....
Now, this would be fine with recursive calls I think, but I find it really difficult to think how to code that and how the computer will execute the code. It would be easier if all possibilities had a length of 3, but here that isn't the case.
I have a class that uses a BackGroundWorker to download a single file using HttpWebRequest and HttpWebResponse
Downloading single file works.
But if I make two objects of that class and start downloading 2 different files simultaneously, there is nothing produced. Execution exits after getResponse() without any error or exception.
Is there any way to achieve simultaneous file download?
I am trying to achieve the look of the attached image using string.Format and PadLeft/PadRight but I have no success with it, anyone who could offer some help?
EDIT:The font I used is not mono-spaced and I am not inclined to use a mono-spaced font for this.
We have developed a vb.net application using multi-threaded listener concept and a dedicated thread for each folder to monitor. With that we simultaneously keep track of the incoming files in each folder.Currently, we are facing an issue whenever we receive multiple files of bulk volume, parallel processing of the files getting delayed with thread concept or failing sometimes.We need to implement the same logic with some other concept avoiding multi-hreading. Or is it possible to achieve performance tuning with the same thread concept?
Update to my Question the best way to achieve acceptable security is to use ASP.NET Web Site Administration Tool the following is only a demo to use session but it is NOT RECOMMENDED for professional use. follow the advice of PhillFox to achieve better results
When developing ASP.NET websites (using VB.NET web forms) - a lot of my time is spend writing CSS files and they always seem to get messy (code duplication) and very long.
All I want to achieve is to be able to manipulate the CSS using VB.NET code in the following ways:
Use an integer variable to store my "golden" number 7 and use that for width, padding, margin etc where needed Use string variables to store my "golden" hex color codes e.g. "#44C5F2" and use them for color, background-color, border-color etc. where needed Use an integer variable to set the height of an element and have four child elements each with height: mynum / 4
I just want to use basic VB.net number and string manipulation in order to create a CSS file on the fly.
I understand that the end product - the CSS file shouldn't change much - it should at most change on a daily basis otherwise caching couldn't be used.[code]...
I am having a perl script through which i achieve is split or output from text file for each single ID , the output text file will contain data of that ID and the anme of the file will be ID.txt so if i am having one main file containing 100 or 200 ID's and for each ID's may be 10000 or more lines i would like to have 100 or 200 files containing data for each single ID which i am able to achieve from perl but is it possible from vb.net
open(TH,"myfile.txt")|| die print "not open1"; open(THG,">error.txt")|| die print "not open2"; open(INFO,">myfileAll.txt")|| die print "not open3"; $gt='0'; $flag=0;
i am using VS 2008 and just started to work with XAML and WPF. while opening in page(.xaml) in design mode i'm getting the error like this "Only TrueType fonts are supported and this is not a TrueType font".
Is there a way to configure the debugger or write code in such a way as to get more information when first chance exceptions happen? I understand they are generally not harmful and I do quite a bit of exception handling in code but when I'm doing database operations it's to know when first chance exceptions occur. Of course I can see them in the Immediate Window in VS but I would like a full stack trace, not ust a line saying "A first chance exception..."
When an exception is thrown in my app, I expect the debugger to stop running and enter debugging mode, but it does not. Instead, I just get a message in the Immediate Window ('A first chance exception ...'), and the program keeps on running like if nothing happened. However, the sub (in which the exception was thrown) is exited, so statements after the exception are not executed. Since this sub makes the initialization of my program, running becomes very unstable.How can I tell the debugger to stop execution when an exception is thrown? On the 'Advenced compile options' page I don't have 'Target CPU'. Maybe it's that I have only VB Express?If I tick the 'Thrown' checkbox in Debug > Exceptions, execution stops even if I have a catch for that exception, and I don't want that.Until now I used VB 2008 on 32 bit, and everything worked fine, but since I moved to 2010 64 bit I just can't get it right.
i finished a project ive been working on for weeks or well i thought i had finished it.. in VS debug environment it runs fine doing its logics for hours without a problem but after publishing it as a standalone it starts throwing errors pretty soon. Took another look at whats going on in VS debug and the only thing that stands out is "A first chance exception of type 'System.OverflowException' occured.." that pops up every now and then so i think this is whats crashing my program outside vs. This poses 2 problems a) the code is around 2k lines/3 classes and heavily multithreaded and i have no clue where exactly this error gets generated, b) from my previous encounters with first chance exceptions they seem like more "possibility for error" instead of an actual error itself and very hard to track down
is a variable called "Incognito" that is class-wide that is a boolean.My question is that is there a form-wide variable form that can like communicate with different forms. So if a variable in form1 is "True" than, how can you make a variable in form2 turns to "True" too?
I have several ActiveX controls in my project one of them loads solidmodeling files for viewing. Because this process can take some time the authors provided an OnFinishedLoadingDocument event.This worked fine under VB6.Now however under VB.NET 2008 framework 3.5 I get an exception thrown When I try to access a form control from this event.
Quote:
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll I found an article that says something about it.
Quote:
If you are using ActiveX controls on a form, you may receive the cross-thread InvalidOperationException when you run under the debugger How can I add text to my control from this event?
Code: Private Sub oView_SW_OnFinishedLoadingDocument(ByVal sender As Object, _ ByVal e As AxEModelView._IEModelViewControlEvents_OnFinishedLoadingDocumentEvent) _ Handles oView_SW.OnFinishedLoadingDocument Dim nSheet As Integer = 0
I am running vs 2008 and and trying to connect to an sql server 2005 to do userauthentication, but the error message i get is"Access to the registry key 'HKEY_LOCAL_MACHINESOFTWARESmartinfoLibServer' is denied" and the message "A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll" also shows in the immediate window.