|
In most regular expression syntaxes, "." is a symbol that means "any character". You probably need to escape the . with a backslash, like "\.".
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
^\d{5}(\.\d{2})?$
You didn't escape ".". Without escaping, this means that it matches any character or none. For instance, to match any 5 characters, you could use .{5} .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks for the help
It works.
|
|
|
|
|
I'm pretty sure you know this and just had a brain fart while typing, but for anyone else reading this...
. actually means any character except possibly "\n" depending on options you set for your regular expressions. In other words, it doesn't match "none". More details here.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
You're right - brain fart! I'm so used to typing .* for so many things I practically think of it as a single pattern element!
Thanks for the catch!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I think I would write this as:
@"^\d{5}(\.\d{2})?$"
Well, actually, I'd write it as:
@"^
\d{5} # 5 digits
(
\. # decimal point
\d{2} # 2 digits
)? # match zero or one time
"
and then use RegexOptions.IgnorePatternWhitespace
(it wasn't clear to me if you meant "only 5 digits" or "from 1 to 5 digits" in your description, so you might need to change the first part.
|
|
|
|
|
I have changed my code and it works. Actually it supposed to be 1 to 5 digits, so I changed the first part to \d{1,5}
|
|
|
|
|
I need a book/document/article/website that could detail (regardless of the programming language, if required for examples) how the Windows operating system exactly works internally.
Is there such a thing? I believe I cannot become a better programmer until I start understanding this: how the OS I'm coding for is actually behaving/responding to this code.
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
I don't think you can find a book for a whole of windows cause it has very very different parts,also it is not open source ,so I'm not sure you can find out exactly all parts for that. But you can get some information if you want to work on a specific field ,you can get a book specially for that part. For example you can find out a lot about securities and how windows security acts in a books that specially about this topic. Same about other field.There is no general book for general purpose I think.
Mazy
No sig. available now.
|
|
|
|
|
Okay, lets say threading.
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Well, donna know any books,but you can search CP and find some articles about it which may helps you. Another source is here:
Threading in a windows form[^]
Mazy
No sig. available now.
|
|
|
|
|
|
Great comment. Just reading a book on C windows programming will help. Writting even a few simple apps will give you a real good idea what is going on.
DTrent
|
|
|
|
|
How about the Microsoft Developer Network: http://msdn.microsoft.com[^]. Click on Library for the Platform SDK, Office SDK, .NET SDK, and many other topics. Learning the Platform SDK (PSDK) will give you some insights, but not many people can say how everything works internally. The PSDK seemed to be enough for the Wine development team to emulate Windows on linux and BSD!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You should take a look at the "Programming Windows" books (I think 5th edition is the current one?) by Charles Petzold.
It won't explain how everything absolutely works inside Windows (only people like Matt Pietrek know that!), but it does show how to write Windows programs in straight C directly to API's. It doesn't use any sort of libraries that end up abstracting the job.
I haven't looked at the newest edition, but the old ones used to sort of be a required reference. In any event, see if you can find a copy at a book store and peruse it.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Kentamanos wrote:
only people like Matt Pietrek know that!
Who's he?!
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Do a google search, you'll get a few hits
He basically works for Numega and works on tools like Bounds Checker. He's written lots of articles for MS publications, a few books, and probably knows how Windows works more than 99.5% of MS employees (that's a guess, but it's probably not hyperbole).
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Inside Windows NT is a good overall reference:
http://www.amazon.com/exec/obidos/tg/detail/-/1572316772/002-5183796-2704014?v=glance
|
|
|
|
|
Sometimes being a good hack is the ability to just take a piece out and work with it without an understanding of its internal =)
norm
|
|
|
|
|
I hope I can find an idea here. I have a dataGrid that displays data from a DataSet. It seems to be working well. I have attached a context menu to it. What I am trying to do now is to read the selected row of this dataGrid. The farest I can go is getting the CurrentRowIndex of selected row.
Is there a way to read something from the dataGrid at all? I can't find one method in that class that will do that for me. I am sorry if the question is stupid and there is a simple solution I passed by in the documentation.
thanks a lot.
Alexander.
|
|
|
|
|
datagrid[datagrid.CurrentCell.RowIndex,columnnumber]
Mazy
No sig. available now.
|
|
|
|
|
I am not sure if this is what you are looking for but you can use the DataGrid.CurrentCell to get the row and column which you can use to read the dataset.
|
|
|
|
|
Hello, this is probably the wrong place to post this, but....
I installed the DirectX SDK to play Mp3 files from my applicaton, and made refferens in my application to DirectX dll's(I use MS.Net 2002 C#).
But when I try to play the Mp3 fils from my application (and DirectX SDK samples) I get the error message:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
(I don't have an partion d:\)
So I reinsalled the DirectX 9.0b runtime, and then it works perfect.
But when I now open my application in MS.NET, it can't find the refferens to the DirectX dll's. They have simpli dissaperd, so now I can't rebuild my prodject.
I've tryed to reinstall the SDK, but still it won't find the dll's.
I've uninstalled the SDK, installed it, then I find the dll's,but then I
get Assert Failed message again.
Does anyone have an idee on what I can do?
Thanks
Thomas
|
|
|
|
|
thomasa wrote:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
This happens if the client code is not doing good things with the underlying filters. Assertions prove fault on the client side. To debug this, you need to understand C++. Eventually your client code will be changed. There is 0 chance that the DirectX Quartz library will be changed. May be the simplest thing to do is to try to grab a code somewhere (from the SDK, or from the net) that plays MP3. Are you by any chance adding a custom filter to the filter chain?
When you install the SDK, you reference debug libraries. Thus when you run your app in debug mode, the underlying Quartz filters are also run in debug mode with assertions activated. That's why you don't see anything when you install only the end-user DirectX run-time.
thomasa wrote:
But when I now open my application in MS.NET, it can't find the refferens to the DirectX dll's. They have simpli dissaperd, so now I can't rebuild my prodject.
DirectX managed relies on interop libraries that forward method calls to the underlying COM Quartz libraries back and forth. The interop libraries are simple references in your project. Unfortunately for us all, the path of referenced assemblies is hardcoded in the .csproj file. The consequence is that you lose the reference is you move or install/uninstall anything. In addition, by default, any time you reopen your project in VisualStudio, the referenced interop assemblies are reinteroped, that's why you don't see them anymore. As far as I know, there is no way to circumvent that (other than filing a bug to MS).
Good luck!
RSS feed
|
|
|
|
|
thomasa wrote:
Assert Failed:
|Actual <= GetSize()
At line 3659 of d:\builds\nt32_chk\multimedia\published\dxmdev\dshowdev\base\amfilter.cpp
This is debug information stored in the executable of checked (debug) builds, which means you're using the developer runtime instead of the retail runtime (not the reason for the problems, but the reason for the message). That path was the path of the source file on the original developer's (or build master's, most likely) machine.
I would say reinstall once more. To allow VS.NET to see the managed assemblies, first locate them (mine are in %SYSTEMROOT%\Microsoft.NET\Managed DirectX\v9.00.1126). Open the registry editor (regedit.exe) and add that directory to HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders, just like you see the other ones (in a subkey as the default value).
To make sure that the CLR finds them, on each assembly in that directory run gacutil.exe -i <AssemblyName.dll> (or use ngen.exe to build native - pre JIT'd - assemblies which will load faster).
Otherwise, ask on the appropriate newsgroup at news://msnews.microsoft.com[^]. It's not a bad newsgroup to use when developing DX apps anyway. You'll most likely find more specialized help than you would here.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|