|
That's pretty cool, but surely has the danger that numbers won't ever get hit and moved elsewhere, so you end up with a pretty random list with a few numbers exactly where they started.
Instead of swapping randomly, why don't you go through the array sequentially, and swap each number with a random one?
Regards,
Rob Philpott.
|
|
|
|
|
I've done something very similar several times (not as much as 100,000 though). The way I did it was this:
int[] myArray = new int[100000];
Random rnd = new Random();
ArrayList number = new ArrayList(100000);
for (int i=0; i<100000; i++)
{
number.Add(i);
}
for (int i=0; i<100000; i++)
{
int temp = rnd.Next(numbers.Count);
myArray[i] = numbers[temp];
numbers.RemoveAt(temp);
}
I populate an ArrayList with all the numbers and then randomly pull them out of the list and put them in my array. I don't know how efficient it'd be for 100,000 items though.
|
|
|
|
|
Hiiii,
I want to change the color of scroll bars...like u can see in Windows xp forms having a blue color scroll bar.
thanx
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
Hiii,
I m Working on an c# Desktop Application i need to change the color of scroll
bars...
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
The WinForms platform does not provide a way to modify the appearance of a scrollbar. There is probably some way to accomplish that via P/Invoke. If that does not tickle your fancy, you can buy third-party controls (like the Infragistics NetAdvantage) and use their customizable scrollbars.
Josh
|
|
|
|
|
I have a class property that I want to be localisable. The MSDN gives an example as:
<br />
[<br />
Description ( "The name of this section" ),<br />
Category ( "Section" ),<br />
DisplayName ( "Section name" ),<br />
Localizable ( true )<br />
]<br />
public int MyProperty {<br />
get {<br />
return 0;<br />
}<br />
set {<br />
}<br />
}<br />
The help files say
When code is generated for a component, members that are marked with the
LocalizableAttribute set to true have their property values saved in resource
files. You can localize these resource files without modifying the code.
So I would expect all the attributes to appear in the .resx file, but they don't. Is this a bug, or am I doing something wrong?
|
|
|
|
|
I think you must also set Localizable of the Form the control is placed on also to true.
|
|
|
|
|
The class isn't on a form.
It's just a holder for information that can be used by PropertyGrid.
|
|
|
|
|
I wont my app workon mobile phone who support java.
But my app is writen in c# how can i convert it!
Thanks!!
nemanja
|
|
|
|
|
I believe you'll need to convert your C# code to Java.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Yes do you have it .Or does it really exist.
nemanja
|
|
|
|
|
No, you'll need to convert it manually. See this[^] link for more info.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
I wont my app work on moile phone .I create my app in c# .I dont know java but i was thinking i can get convertor but i can't find the convertor.
nemanja
|
|
|
|
|
well... with SharpZibLib you can create jar files ... it is like creating zip files but in stead of .zip it's .jar ...
|
|
|
|
|
Does convertor exists.
nemanja
|
|
|
|
|
JaCIL (pronounced "jackal") is a graduate capstone project to create a
byte-code compiler to translate CLI binaries to binaries suitable for
consumption by the JVM.
The project is on SourceForge, sorry no link, google.
|
|
|
|
|
Hello-
I found some code on the Internet for some dynamic breadcrumbs. The instructions say to include this code in the code-behind of the .aspx page:
***code***
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Sabre_Solutions.Loads.Topographic_Effects
{
///
/// Summary description for BreadCrumbTest.
///
public class BreadCrumbTest : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Literal lblPageTitle;
protected NameSpace.headerBreadCrumb header;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string PageTitle = "Test the Title";
lblPageTitle.Text = PageTitle;
header.HeaderText = PageTitle;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
***end code**
If you noticed, I bolded two lines of code. It looks like I am supposed to declare another class, but I'm not really sure what to put in the code. I assume I am to declare a header class. I researched and my attempts have not been successful.
Does anyone know what I am supposed to do to make these lines work? (The orignal article mentions nothing about these lines.)
|
|
|
|
|
It looks like OR you need to reference to an external assembly OR you have to create a class with that name and put some code (which is or which they forgot to mention on that website)...
|
|
|
|
|
How can I customize the RichTextBox so I can add line number, etc. nice things on the left side, just like what IDEs have?
|
|
|
|
|
|
can you give me little more informations like what do you want to have on left side .
nemanja
|
|
|
|
|
Line numbers (label control)
or some custom stuff - image for example or something drawn with GDI+ like the dots added for debug breakpoints
or which is the most important in my case: a drop down list control with options.
|
|
|
|
|
Can enyone help me !!I have a problem . I dont know how to get information from web site to my application .
example . I wont to get information (text) to my text box.
Thanks..
nemanja
|
|
|
|
|
Not enough information to help you out here i'm affraid.
If your website is using a database, then your application also can use that database...
|
|
|
|