|
What are the realtime scenarios where Preprocessor Directives are required?
San
|
|
|
|
|
Conditional compilation, for one.
Keep in mind that C# does not have a preprocessor per se.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|
|
Hi,
I have MSDE,if instance is local then database is restoring properly.
If iam trying to restore any other particular instance of MSDE ,error is coming.
it is adding database to my particular instance,but while restoring it is searching for local instance log and mdf files.
iam using SQLDMO.Restore object to restore,i searched a lot.
any one give me the solution.
Thanks in advance.
|
|
|
|
|
When the Handle of the control of another application is known,
I can get Font object of a win32 control of another application(Different process) by SendMessage(hwnd,WM_GETFONT....) & Graphics class.
But when the target control is a WinForm control(.Net control) of another application, I can't get the HFont from SendMessage(hwnd,WM_GETFONT).
So, I guess the font is not stored in the Device Context(HDC) for a winForm control. Am I Right?
Then How Can I get the Font from that winForm control?
The purpose to do so is that I want to measure the string size of controls in other applications.
Any idea?
|
|
|
|
|
Hello
I have a problem with binary image segmentation in c#.
First, I have to open it, display and then divide into blocks of size m*n.
A binary container image F is regularly partitioned into small pixel blocks Fi of a size m×n (for simplicity, assume that F’s size is a multiple of m×n). Then I have to make some operations on these blocks( matrices of size m*n) such as XOR. Next,I have to generate random matrix of size m*n and XOR it with all the blocks of image F.
So, these are the steps I have to make:
1.Open and display binary image
2.Image segmentation into blocks of size m*n
3.Generate random matrix k ( size m*n) and XOR with all blocks of F (size of m*n)
All help will be very helpful because now Have no idea what to start with
Thanks
Peter
Pete
|
|
|
|
|
hi all
I have this code:
foreach (PropertyInfo pi in this.GetType().GetProperties())
{
if (pi.Name != "Ds" && !pi.Name.Contains("nmv") && !pi.Name.Contains("Nmv") && pi.Name != "NewId" && pi.Name != "SpeakerID")
nmvParams.Add("@" + pi.Name, pi.ToString());
}
"this" is my object that contains all the properties. I need to put the name & values
of each property into a namevaluecollection nmvParams.
pi.Name gives me the name of the property. How do I get the actual value?
pi.ToString() just gives me the name of the property in string.
thanks
M
|
|
|
|
|
object propval = pi.GetValue(this, new object[0]);
|
|
|
|
|
thanks. I figured it out, its actually
pi.GetValue(this, null)
but you have to check for null before you run it.
M
|
|
|
|
|
Hi i was wondering if someone can help me with getting the data of a subkey and storing it in a string. I understand how to get the value but i need to have it shown in a textbox (or string)
RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\mysoftware");
rk.GetValue("aPath","C:\\music\\");
thanks for your help
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
RegistryKey rk = Registry.LocalMachine.OpenSubKey("Software\\mysoftware");
string text = (string)rk.GetValue("aPath","C:\\music\\");
myTextBox.Text = text;
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
thanks alot man i appreciate it!
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
I have a program for which I want to implement file IO with .mdb files. However, MS Access tells me that a single text field can't have more than 255 characters. Is there a way around that?
Basically, the file has a kind of collection of objects that each contain RTF information (a "document"). I want to use the benefits of a database, and I don't want to have to save the RTF information into an undetermined number of RTF files.
(as you can probably guess, I'm new to databases in C#)
Any ideas?
-Daniel
|
|
|
|
|
Use a Memo field.
---
b { font-weight: normal; }
|
|
|
|
|
Awesome! Thanks!
[sits back down on newbie chair and goes to work]
-Daniel
|
|
|
|
|
Hi there,
I am working on creating a dynamic control which displays a collection of images.
I want to display 4 images per rows and the rows must be calculated based on the number of images.
For example if we have nine images in the collections there should be 3 rows and four images per row.
So i want to creat the rows and columns dynamically and load the images also dynamically. \
How do i go about.
Thanks in advance,
Jo
|
|
|
|
|
|
I think he wanted to create it form scratch.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
JoJuPi01 wrote: I want to display 4 images per rows and the rows must be calculated based on the number of images.
Divide the Collection.Count property by 4, and if there is no reminder then the result will be the rows count, otherwise the rows count will be the result + 1.
JoJuPi01 wrote: So i want to creat the rows and columns dynamically and load the images also dynamically. \
Try to do it by yourself and if there is any problem, just post a new thread here.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Currently, I am working on ZX2C4 Instant Messenger. ( http://zx2c4-im.sf.net ). For file transfers, a connection class raises an event for every 1024 bytes it receives (and finally length%1024 bytes at the end). This event is picked up by a form that has a progress bar.
Everytime the event is called, I make the progress bar's value maximumvalue * (bytes trasfered/total). However, I lack a good way to compute the number of kb/s at which the file is downloading.
Currently, when the progress bar is created, I assign a global varible called "start" to DateTime.Now, and every time the update event is signaled, I make the current speed equal to (bytes transfered) / (DateTime.Now - start).
While this works, it only provides the average speed of the whole download. What is the best way to calculate the current speed of the download?
Jason A. Donenfeld
ZX2C4 Instant Messenger
|
|
|
|
|
zx2c4 wrote: What is the best way to calculate the current speed of the download?
Since the event is conveniently raised after every 1KB is downloaded, I believe this is simply the 1/(ti - ti - 1) where "t" is the wall clock time.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Right. That's what I'm doing. But how do I make it not the average rate, but the present rate instead?
|
|
|
|
|
Oh, that's even easier! Just keep track of the total # bytes downloaded and the total elapsed time and divide the 2.
[edit]
Wait, my previous post gives you the present download rate. If you want the average download rate, see the current post.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
-- modified at 18:54 Wednesday 3rd May, 2006
|
|
|
|
|
Nono you miss read -- that does the average rate. I want the present rate.
Doing 1/(difference between time now and time of last event) will produce sporatic behavior -- the number jumps around tons and tells nothign to the user.
Is the only way to do this to just do 1*n / (difference between now and time of n events ago) ?
|
|
|
|
|
zx2c4 wrote: Doing 1/(difference between time now and time of last event) will produce sporatic behavior
Yes, it will if the download rate isn't constant. The average rate (average of all "present" rates) is nothing but the total # bytes downloaded divided by the time taken to download them.
[edit]
You could take Guffa's approach and calculate the average of the last "n" chunks.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
-- modified at 19:03 Wednesday 3rd May, 2006
|
|
|
|
|
I've tried it and the behavior is sporatic -- the time interval is too small.
|
|
|
|