|
Hi, I have a big problem, I im writing an application, that will draw spectogram , and a bars with db levels at couple frequencies (31hz,62hz,125hz.... like in Winamp) in real-time, as a school project, I read couple aricles here, and on many other pages, but didn't found solution. My problem is that i don't know how to use byte data from DirectSound (CaptureBuffer), to compute fft, and then how to use the computed data, to draw spectogram and bars. I tried to compute fft values using this code http://www.codeproject.com/KB/audio-video/waveInFFT.aspx. I have made some changes to it, becouse my input data is byte array, and then I didn't know how to extract db level, for example at 31hz from fft output table. Sorry for my bad english. And I am looking forward for a response
|
|
|
|
|
Hi,
I am using a richtextbox control, where text is appended regularly.
Iam facing the following issues:
1. when user is selected the cursor position somewhere except the bottom position, new text entered will cause the auto scrolling of the vertical scroll bar to the last position.
This should be avoided, user selected position should be retained whenever text is appended.
2. Say user has selected some text, appending of new text causes the user to loose control of the last position. how to make the user not to loose control when text is appended?
thanks in advance,
Geeta
modified on Monday, March 9, 2009 7:29 AM
|
|
|
|
|
GeetaGadmi wrote: 1. when user is selected the cursor position somewhere except the bottom position, new text entered will cause the auto scrolling of the vertical scroll bar to the last position.
This should be avoided, user selected position should be retained whenever text is appended.
I don't know if you can 'enter' text without moving the cursor. You can however, get the position of the cursor before you add text, and move the cursor back to that position when you are done with adding the text.
GeetaGadmi wrote: 2. Say user has selected some text, appending of new text causes the user to loose control of the last position. how to make the user not to loose control when text is appended?
Put the TextBox.SelectionStart in a variable before adding text, do the same for TextBox.SelectionLength and restore those values when finished with adding text. You might want to suspend the layout while doing this
I are troll
|
|
|
|
|
Hello,
How we can change the version of PDF? thank you verry mutch.
|
|
|
|
|
abbd wrote: How we can change the version of PDF?
Go to the Adobe site and download a newer version?
I think you have to be a bit more explicit in your request if you would like a reasonable answer.
|
|
|
|
|
You're going to have to explain what you mean by "change the version of PDF"...
|
|
|
|
|
When i generate a pdf with i can't set it on version 1.7, so it is on 1.4, i will cherche how i can change the version of my pdf file to 1.7, thank you verry mutch.
|
|
|
|
|
That made no sense what-so-ever...
I think you're going to have to consult the documentation on the PDF library you're using. I can't make heads or tails of your description.
|
|
|
|
|
I think he means the version number that shows up when you right click, select Properties and then the PDF tab.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
DaveyM69 wrote: I think he means the version number that shows up when you right click...
Rule #1 in troubleshooting: You either "know" or you don't. "Thinking" is not allowed.
|
|
|
|
|
Note to self... Stop thinking.
There, that's that done
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
hi
i want to khnow how i can added a image in database(sql)?
whit forms in c#???
|
|
|
|
|
|
|
Im not sure if this can be done.
But i want to create my on Nullable<t> struct.
my problem is that i cant assign null to my struct as it is an non-nullable type, how can i overcome this ?
Heres my attemt:
[Serializable, StructLayout(LayoutKind.Sequential)]
public struct Null<T> where T : struct
{
private bool hasValue;
private bool allowNull;
internal T value;
public Null(T value)
{
this.value = value;
this.hasValue = true;
this.allowNull = true;
}
public bool HasValue
{
get
{
return this.hasValue;
}
}
public bool AllowNull
{
get
{
return this.allowNull;
}
}
public T Value
{
get
{
if (!this.HasValue)
{
throw new InvalidOperationException("No Value!");
}
return this.value;
}
}
public T GetValueOrDefault()
{
return this.value;
}
public T GetValueOrDefault(T defaultValue)
{
if (!this.HasValue)
{
return defaultValue;
}
return this.value;
}
public override bool Equals(object other)
{
if (!this.HasValue)
{
return (other == null);
}
if (other == null)
{
return false;
}
return this.value.Equals(other);
}
public override int GetHashCode()
{
if (!this.HasValue)
{
return 0;
}
return this.value.GetHashCode();
}
public override string ToString()
{
if (!this.HasValue)
{
return "";
}
return this.value.ToString();
}
public static implicit operator Null<T>(T value)
{
return new Null<T>(value);
}
public static explicit operator T(Null<T> value)
{
return value.Value;
}
}
This is all fine but when i then try to use it i get an non-nullable type exception:
Example:
private Null<int> index = null;
the null; assignment returns the following error:
Error 4 Cannot convert null to 'Null<int>' because it is a non-nullable value type
Can this be done,if so HELP please, or am i on an wrong track here ?
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
You can have a Nullable structure.
struct Dummy{
public string dummyvalue;
}
Dummy? dummyStrct = null;
|
|
|
|
|
|
You have been very polite
|
|
|
|
|
Maybe if you make an implicit cast operator from object to Null<T> ? The object could be null, obviously, so if you tried to assign null to it it should think the null is an object and call your implicit cast operator.
Last modified: 29mins after originally posted --
|
|
|
|
|
|
They cheat by making the compiler support it, which we can't do
Anyhow did an implicit cast from an object work?
|
|
|
|
|
|
Ok well the idea was that make a
public static implicit operator Null<T>(object value)
{
if (value is T)
return new Null<T>(value);
else if (value == null)
return new Null<T>(null, true);
else
throw new Exception("this is bad, but find a better exception");
}
And then Null<t> can be a struct, I think. Try first..
|
|
|
|
|
Ahhh sorry didnt see that one, no this is not allowed, as it tries to convert from a base class which is not allowed.
Following error returned:
Null<T>.implicit operator Null<T>(object)': user-defined conversions to or from a base class are not allowed
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Ok, didn't think of that, than use something else that is not a base type - say string, or some little holder class that does nothing except have the ability to be null.
Does it even say that when Null<T> is a struct?
|
|
|
|