|
Yes, and we started with beginner-ish tasks, not in-depth like this sort of thing.
|
|
|
|
|
|
let suppose your have this Class :
class SomeClass
{
double l;
double [] m = new double [10];
string s;
byte [] ToByteArray ()
{
List<byte> b = new List<byte> ();
b.AddRange (BitConverter.GetBytes (l));
for (int i = 0; i < m.Length ; i++)
b.AddRange (BitConverter.GetBytes (m [i]));
char [] tabc = s.ToCharArray();
for ( int i = 0 ; i < m.Lenght ; i++)
b.AddRange (BitConverter.GetBytes (tabc [i]);
return b.ToArray();
}
}
SomeClass c = new SomeClass ();
byte [] b = c.ToByteArray();
|
|
|
|
|
|
It's not as simple as it sounds
List.Count != Color[].Length
so I can't use List.ToArray()
List<color> will have n number of colours. I expect usually around 5-6. Color[] will probably have Length of 256. I want to dynamically blend the few colours from the List<color> into Color[].
I'm trying to split the 256 into sections and blend 2 colours at a time. ie 256 / List.Count -1
My head's not in gear today so the Maths is escaping me...
Any help appreciated.
PS I'm playing with Fractals and I want to implement an editable colour palette. I did it a couple of years ago but I lost of the code and I'm trying to redo it...
|
|
|
|
|
And what do you want to do? Blend some colors from List<> with different colors from Color[]?
To blend 2 colors at a time you don't need to split anything but rather write a loop that processes somehow each pair of colors. Then increments by 2. However, I'm confused about what you want to achieve...
|
|
|
|
|
Ok, having googled a bit more, the terminology is interpolate.
I have, say, 5 colours that I need to interpolate across a Color[256].
|
|
|
|
|
Hi,
I have a string which looks something like:
ABCDEF\\123456
I am looking to return 123456, it will always be 6 characters long. I tried IndexOf and LastIndexOf on the \ but they both returned the same index number. Isn't there a Right function like in Visual Basic?
Thanks
Brendan
|
|
|
|
|
You could use substring. If it's always the last 6 chars you want then this should work:
string newString = oldString.SubSTring(oldString.Length-7, 6);
Might be an even easier way though.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I found the answer:
string MyString = "ABCDEF\\123456";
string End = MyString.Substring(MyString.Length - 6);
|
|
|
|
|
You should NOT rely on the *expected* length of the string.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you're going to need this functionality regurlarly you could create an extension method.
public static class Extensions
{
public static string Right(this string str, int length)
{
if (length < str.Length)
return str.Substring(str.Length - length);
return str;
}
} then, so long as you've added the namespace you put the above into in your using statements at the top you can use it like any other built in string method i.e.
string x = @"ABCDEF\\123456";
Console.WriteLine(x.Right(6));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
modified on Friday, August 29, 2008 5:53 AM
|
|
|
|
|
First, IndexOf and LastIndexOf is going to return the same value because there's only one instance of the character you're looking for.
Second, there are several ways to do what you want. You could use the string.Split function...
string myString = "abcdef\\123456";
string[] parts = myString.Split("\\");
string leftSide = parts[0];
string rightSide = parts[1];
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Does anybody know how I can get my hands on Visual Studio 2003.
I've been through two collections of DVDs and was not able to find Visual Studio 2003.
I've also tried to search the Web for a place where it is possible to download it, but with no luck.
Can anybody help ?
|
|
|
|
|
You could probably download it using bittorrent, search torrentz.com and your bound to find it
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
SK Genius wrote: You could probably download it using bittorrent, search torrentz.com and your bound to find it
Dont encourage pirated softwares.
Infact, MS itseft offers you 3 months full functioning trials of Visual Studios...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I'm not intending to pirate anything. I have a MSDN subscription but no VS2003 found in it, and the company I'm currently working for has a MSDN subscription as well. But with no VS2003. and we need it.
|
|
|
|
|
Kenneth Broendum wrote: I have a MSDN subscription
In that case, Visual Studio .NET 2003 is downloadable from
the MSDN Subscriber Site[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Just because something is on a file sharing network, it doesn't mean it's pirated. You can get illegal software but there is also a large amount of legitimate downloads.
I apologise if what I said implies the download and use of illegal software, it is not what I intended.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I dont think you can download the 2003 version any longer. It depends what you need it for, but with 2005 there are Free versions of certain programs called "Express" versions.
Also, this is a download for the trial of Visual Studio 2005:
http://msdn.microsoft.com/trial/
And from here, you can get the Visual Studio 2008 trial:
http://msdn2.microsoft.com/en-gb/vstudio/default.aspx
Again 2008 has express editions which are completely free.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi Manas.
Thanks for trying to help but I have both VS2005 and VS2008.
I need VS2003 because we are targeting older ATM PCs running Windows XP with 256MB Ram and 800MHz CPUs. The .NET 1.1 framework is already installed and running on these machines, and since resources are low we need to target this verswion of the framework.
I would certainly prefer to install a later version of the framework but that is unfortunately not an option.
But thanks
|
|
|
|
|
Hi
you could also use MsBee[^] to compile a Project for the 1.1 Framework using VS 2005.
|
|
|
|
|
you can use sharpdevelop and its free
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi
Is there any way to understand a running application is calling a function, method or sub? In other words I want to communicate with other running proccesses.
For example I want to know when Notepad.exe is calling the Open function.
Thanks.
|
|
|
|
|
pm526467 wrote: For example I want to know when Notepad.exe is calling the Open function.
Its a bit difficult(or should i say impossible) with C#.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|