Domain: codeproject.com
Stories and comments across the archive that link to codeproject.com.
Comments · 205
-
Add a bit of DiversityI'm almost convinced that programmers are afflicted with 'ADD' as a side effect. It's very easy to get bored with a programming task (especially one that is boilerplate) so we go off on a tangent trying to automate the process of writing boilerplate code.
I find that when spending too much time looking at the same code, it starts becoming 'vague' and I feel as if I'm in a fugue. It's akin to the same thing as writing a story or some e-mail and thinking that you've misspelled the words 'it' or 'and'. It may very well be correct, but it looks foreign and you try to fix something that isn't broken. At that point, it's time for a mental break.
I actually tend to take at least three breaks a day for about five to ten minutes each. The first two, I read Slashdot; usually around 10:00am and the other right before lunchtime. I don't eat out often, but I do pick up lunch and then around 4:00pm, I check out the latest 'IT' curiosity posted on The Daily WTF http://www.thedailywtf.com/. I also check Slashdot again right before I leave so I don't miss some of the few gems posted here.
A lot of IT shops have their eye on Web browsing, but they usually won't pay mind to it unless you're not producing or you have a tendency to frequent sites that raise an eyebrow or two (hint: pr0n sites tend to fall in that category). I do like to visit sites geared towards developers, such as GotDotNet http://www.gotdotnet.com/, CodeProject http://www.codeproject.com/, CodeGuru http://www.codeguru.com/ and the latest "up and coming" Krugle http://www.krugle.com/ code search engine. Sometimes visiting those sites will give a tidbit or two that is useful; you may run across some code or solution to a problem that interests you. Also, you may end up learning something that you'll run into in the future. (Coders tend to re-invent the wheel if they don't have the code handy; however, if the code is there, they tend to add spinning rims to it.)
Adding a bit of diversity to the routine helps keep you on the edge and refreshed to approach a problem in a new light.
-
Function hooks
Some nifty things are possible if you hook functions in the WinAPI (so all calls to that function would go through your function first). Your app could then put whatever restrictions on access it you wanted (you could hook file open functions, registry open functions, etc). Here's an interesting article I found, wasn't the one I was searching for tho: http://www.codeproject.com/system/hooksys.asp Here is an article that shows how to prevent processes from launching: http://www.codeproject.com/system/soviet_protecto
r .asp This might not be precisely what you wanted (a bit hackish compared to what you seem to be looking for) but it would work. -
Function hooks
Some nifty things are possible if you hook functions in the WinAPI (so all calls to that function would go through your function first). Your app could then put whatever restrictions on access it you wanted (you could hook file open functions, registry open functions, etc). Here's an interesting article I found, wasn't the one I was searching for tho: http://www.codeproject.com/system/hooksys.asp Here is an article that shows how to prevent processes from launching: http://www.codeproject.com/system/soviet_protecto
r .asp This might not be precisely what you wanted (a bit hackish compared to what you seem to be looking for) but it would work. -
Re:probably on Microsoft's list of next important
Like this: http://www.isapirewrite.com/ or maybe this: http://www.codeproject.com/aspnet/urlrewriter.asp
-
ComparisonA complete comparison of features is available here
Having worked in both, I prefer C# due to its cleaner syntax and ability to use XML comments in the code. VB does have a few minor advantages, like the ability to use default parameters. Either one can get the job done, and a decision on which one to use is genrally made based on what the developers have the most experience with/are the most comfortable with.
-
Re:Interesting
Ah, no. What he wants is either Microsoft MSDE or SQL 2005 express. There's no need to use something as limited/low-end as Access. MSDE is ment to be used either embedded in your app, or as a lightweight stand-alone server.
-
My most commonly used community
It's probably CodeProject. Beginner to very advanced projects alike, usually with relaxed licenses as well. You can find gold nuggets like the best tutorial I know for the lightweight Windows Template Library, along with a free vastly improved memory leak detector there. They also supports plenty of languages for Windows development, with a big share of articles and code on C++. A message board is added for each code project listed where you can discuss them, along with project unrelated forums for general coding discussion.
-
Codeproject.com
Codeproject ( http://www.codeproject.com/ ) is a Microsoft oriented development community. Members submit informational articles regarding specific implementation techniques for various MS frameworks (MFC,
.NET/ASP).
This is a great example of a flourishing development community. Chris Maunder, the creator, is very visible in the forums and receptive to feature suggestions. There's a rating system for the submitted articles, so top submitter's egos are rewarded. :-)
With close to 12,000 articles and 2.8 million members, it has to be one of the largest development communities on the net.
I think what makes this community flourish is that Chris doesn't try to pull any fast ones on the contributors. Your articles belong to you, and you can promote your consulting services ( as long as the article has relevant content ).
-- Jim http://www.runfatboy.net/ ( Exercise for the rest of us. ) -
Go use the Visual Studio 2005 Express Editions!
Yeah, a number of people have already mentioned them, but I have a few extra things to add. First off, the Express Editions are free (as in beer) right now to download and use. You can build commercial apps with the Express Editions.
I'd recommend downloading both VC# and VB Express and using both of them for a little while to see which language you're most comfortable with. In both, you'll be able to use the Windows Forms designer to create your UI, and the process is pretty-much painless with the 2005 products with their new UI design features.
Next, we added a serial port control to the
.NET FX v2.0, which is what VS 2005 and the Express Editions all use. This makes it pretty easy to write code that'll grab the data you need. There's a great article on it over at Code Project that walks you through the basics.Also, if you ever run into trouble you can get help on our Forums at http://forums.microsoft.com.
Good luck!
-
C# Demo Program
You can grab a free copy of the Visual C# IDE from Microsoft. Start with something simple, like this sample program that reads serial output and dumps it into a window. Then add the gui parts - and there's obscene amounts of sample code for writing Windows GUIs. The advantage to using C# is that there's a strong likelyhood that if you need something special, you can buy a widget that handles it for you for $200 (under most Open environments it would be free, but it wouldn't work - at least once you get into the more obscure ones).
Problem solved with a small amount of money and a small amount of time - and you have a standards-based application that any other Windows programmer will understand and be able to maintain. Unless you really want to spend all of your time working on stuff like this because you're the only person in the company who knows how to use your TCL/whatever/hybrid built-into-an-exe mess of a program? Cool as it may be, if it can't be trivially handed off to someone, its your problem for as long as you stay at the company. -
C# Demo Program
You can grab a free copy of the Visual C# IDE from Microsoft. Start with something simple, like this sample program that reads serial output and dumps it into a window. Then add the gui parts - and there's obscene amounts of sample code for writing Windows GUIs. The advantage to using C# is that there's a strong likelyhood that if you need something special, you can buy a widget that handles it for you for $200 (under most Open environments it would be free, but it wouldn't work - at least once you get into the more obscure ones).
Problem solved with a small amount of money and a small amount of time - and you have a standards-based application that any other Windows programmer will understand and be able to maintain. Unless you really want to spend all of your time working on stuff like this because you're the only person in the company who knows how to use your TCL/whatever/hybrid built-into-an-exe mess of a program? Cool as it may be, if it can't be trivially handed off to someone, its your problem for as long as you stay at the company. -
Re:Remember, new systems frequently lack COM ports
Not sure whether VB
.Net 2005 has a serial component; probably not ...
It actually has. :-)
Here's some instructions on usage; unsure of how outdated since it's for beta 2:
http://www.codeproject.com/csharp/SerialCommunicat ion.asp
Here's the official documentation of the System.IO.Ports.SerialPort class:
http://msdn2.microsoft.com/library/system.io.ports .serialport.aspx -
Simple?
Simple Windows Tools? Well, there's always a hex editor... (I kid, I kid!)
Seriously, it's not as difficult as you might imagine. Even your grandmother could whip something up in Visual Basic, though I don't recommend it.
The path of least resistence here is to grab a copy of Visual Studio, then get yourself a beginners book on Windows programming. Just go to your local book store and you'll find a whole shelf of them. (And not a single book on data structures or algorithms in sight. Grrrr...)
If you're a sucker for a bit of punishment, (but believe you can follow the documentation well enough) just use web tutorials and the online docs to guide you through the process. The Resource Editor will do most of the work for you, so you only need to worry about interfacing your code with the GUI components. (Easy, peasy. :-))
Your last option is for the case that you're familiar with GTK+, and don't have Visual Studio available. (A real masochist you are, aren't you?) Grab a copy of cygwin and install all the dev time tools. (Compiler, BinTools, GTK-devel, etc.) Keep a copy of the GTK Reference up, and you should be good to go. Just remember that you'll need to distribute the cygwin.dll file with your application. Otherwise your users shouldn't notice. -
Re:I haven't worked with both, but....
"Spoken like a true astroturfer"
Thanks for flying your colors up front. I'm glad to know that I won't be involved in an intelligent discussion this morning.
"Several times more, at least in Web server arena, according to Netcraft. 69.97% for Apache vs. 20.92% for IIS."
Exactly my point numb nuts. ASP.Net runs on Apache. So if by the parent's "little else then IIS" comment, he actually ment to say "will run on the vast majority of web servers", then yes he would be correct. But I'm pretty sure he was just reciting FUD from the anti-MS bin.
(see http://www.codeproject.com/cpnet/introtomono2.asp, http://www.mono-project.com/ASP.NET, and even http://apache.slashdot.org/apache/02/07/22/2334239 .shtml?tid=109)
"And Microsofts operating systems do suck, especially when used as servers;"
That is debatable. Any server will "suck" when used incorrectly.
"making a server application with a language that would tie you to Windows is a very bad idea"
It depends, maybe your employer is pleased with Windows and doesn't see the need to invest in changing software and staff. In that case using a language that can get the most benefit from a Windows environment would be GOOD. In this case it's a mute point however as ASP.Net is NOT locked down to Windows.
-Rick -
We Share Your Pain (WE-SUP)
-
Re:PHP vs. Java
Oh you mean like Enterprise Services that unlike Java does not require buying an app server (and doesn't suck like EJBs do) ? Here check it out :
http://www.codeproject.com/dotnet/KdotNET.asp -
Re:GCC is important, but what about progress in C+
Not part of the standard (yet) and may change before it becomes standard. G++ already has 'typeof' keyword, no reason to replace one extension by another extension until the standard is finished.
'Typeof' and 'auto' are completely different things: 'auto' would be used in place of a type in variable declarations. For example: auto var = 1 + 2;
furthermore it's pretty hard to reconsile the standard's requirements that destructors must execute deterministically with any garbage collection
If it is hard, than make it not hard: why should destructors be executed deterministically? manual memory management will still be there for that reason.
ou have to use a 3rd-party GC, there are several for C++
The only one I know of is the Boehm's collector, which is a very great hack. Trying a search in sourceforge reveals 0 C++ garbage-collection projects. Trying a search in Google even shows my lame attempt for a collector as the 3rd result (!). Further Google results are either bad links, academics pages with lots of theoritical work and even more bad or outdated links, or old implementations mostly for specific Unix flavors.
G++ includes TR1 libraries, which is a likely next standard for C++ standard library. Beyond that, you can try Boost for a larger library
TR1 offers many goodies, and boost even more, but a modern app needs quite a lot more.
but don't expect any compiler to include a library which goes far beyond the standard.
why? just because the C++ commitee is so stubborn? hello? 2005 called and said that a modern language needs modern libraries.
-
For .Net Developers.....take a look at NUnit, if you haven't already:
Then, read Marc Clifton's series on Advanced Unit Testing in C#. The code is easily ported to VB.Net, as well, although not required. I am working on introducing the practices outlined in the article where I am currently employed.
http://www.codeproject.com/csharp/autp1.asp
http://www.codeproject.com/csharp/autp2.asp
http://www.codeproject.com/csharp/autp3.asp
http://www.codeproject.com/csharp/autp4.aspAs if CodeProject wasn't slow enough. The readthroughs on this post should bring it to its knees in no time at all. If you have a chance, look at some of Marc's other postings, as well. Very high quality stuff.
In regards to Unit Testing in general, I don't know why it isn't given more weight in college coursework. Honestly, it would make a great course, or series of courses. I've been out of school for just a wee bit though, so maybe some are offering it already.
;-) -
For .Net Developers.....take a look at NUnit, if you haven't already:
Then, read Marc Clifton's series on Advanced Unit Testing in C#. The code is easily ported to VB.Net, as well, although not required. I am working on introducing the practices outlined in the article where I am currently employed.
http://www.codeproject.com/csharp/autp1.asp
http://www.codeproject.com/csharp/autp2.asp
http://www.codeproject.com/csharp/autp3.asp
http://www.codeproject.com/csharp/autp4.aspAs if CodeProject wasn't slow enough. The readthroughs on this post should bring it to its knees in no time at all. If you have a chance, look at some of Marc's other postings, as well. Very high quality stuff.
In regards to Unit Testing in general, I don't know why it isn't given more weight in college coursework. Honestly, it would make a great course, or series of courses. I've been out of school for just a wee bit though, so maybe some are offering it already.
;-) -
For .Net Developers.....take a look at NUnit, if you haven't already:
Then, read Marc Clifton's series on Advanced Unit Testing in C#. The code is easily ported to VB.Net, as well, although not required. I am working on introducing the practices outlined in the article where I am currently employed.
http://www.codeproject.com/csharp/autp1.asp
http://www.codeproject.com/csharp/autp2.asp
http://www.codeproject.com/csharp/autp3.asp
http://www.codeproject.com/csharp/autp4.aspAs if CodeProject wasn't slow enough. The readthroughs on this post should bring it to its knees in no time at all. If you have a chance, look at some of Marc's other postings, as well. Very high quality stuff.
In regards to Unit Testing in general, I don't know why it isn't given more weight in college coursework. Honestly, it would make a great course, or series of courses. I've been out of school for just a wee bit though, so maybe some are offering it already.
;-) -
For .Net Developers.....take a look at NUnit, if you haven't already:
Then, read Marc Clifton's series on Advanced Unit Testing in C#. The code is easily ported to VB.Net, as well, although not required. I am working on introducing the practices outlined in the article where I am currently employed.
http://www.codeproject.com/csharp/autp1.asp
http://www.codeproject.com/csharp/autp2.asp
http://www.codeproject.com/csharp/autp3.asp
http://www.codeproject.com/csharp/autp4.aspAs if CodeProject wasn't slow enough. The readthroughs on this post should bring it to its knees in no time at all. If you have a chance, look at some of Marc's other postings, as well. Very high quality stuff.
In regards to Unit Testing in general, I don't know why it isn't given more weight in college coursework. Honestly, it would make a great course, or series of courses. I've been out of school for just a wee bit though, so maybe some are offering it already.
;-) -
More resources ... (not magazines) ...
I spend atleast one lunch break a week answering questions in the programming forum or some subforum at experts-exchange.
To keep a premium account with them for free, you need to get atleast 3000 expert points a month ... it's always a good excuse to spend time answering people's questions, which usually involves coding - i always write/test the code for people so I A) practice coding B) can get the source later if i need it for a project.
They have forums for abunchof languages ... depending on the forum, the questions may generally be too easy for you, but most questions are posted by IT professionals like yourself, so they can be fun to figure out and answer.
Besides that ... I read a lot of books and I refactor old projects using new methods or I test design patterns or ... I do a lot of .NET coding so I couldn't live without my MSDN firefox search engine (also made one for the codeproject, which has some GREAT articles). -
Re:Painful
] if 6.0 to 2003 is any indication Get ready for a lot of manual header adding.
Work smarter, not harder.
i.e. There are utils/macros to do that, specfically, you'll want to check out...
1. Project Converter
2. .NET 7 <--> .NET 7.1
--
If the Bible is infallible, which version would that be? -
Re:Painful
] if 6.0 to 2003 is any indication Get ready for a lot of manual header adding.
Work smarter, not harder.
i.e. There are utils/macros to do that, specfically, you'll want to check out...
1. Project Converter
2. .NET 7 <--> .NET 7.1
--
If the Bible is infallible, which version would that be? -
Don't knot your knickersBefore you get your knickers in a knot, I sugest that you read the article.
No, MainSoft is not a typo for Microsoft; MainSoft is an independent software company that makes a tool that allows for cross-platform development.
During the PDC, which was organized by Microsoft, one of the exhibitors (mainsoft) announced this contest which was intended to show off their products.
This is not an attempt by Microsoft to do any kind of cross-platform development.
To the best of my knowledge, neither of the groups organizing the event (MainSoft and CodeProject) are owned in whole, or in part, by Microsoft.
If you read the disclaimer on CodeProject, you will find the following groups barred from the contest:- The Code Project
- Mainsoft Corporation
- Novell
- Zend
- Macromedia
Microsoft Employees are not on this list. I really don't think that Microsoft has a great deal to do with this event. -
A better solution
This application is better in that it collects all the relevant information into a zip file (including a stack dump), and helps the user to e-mail it to you. It works in C/C++ (Windows only) and doesn't require any third party involvement.
We use it in a deployed product and it works very well.
john
-
Quake 3 executable without checks
I seem to have successfully commented out some checks from the source so it should be easy to play TCs, without owning the game.
1. Download the 1.32 Point Release
2. Download the Quake 3 Demo.
3. Download my executable (or compile your own) here
4. Install the Point Release and demo to separate directories.
5. Replace the quake3.exe in the Point Release directory with the one you downloaded / compiled.
6. Move pak0.pk3 from the demoq3 directory in your Demo install to the baseq3 directory in the Point Release install. (This may cause weird problems if you try to play online with the normal game.)
7. Quake 3 should now be able to play with TCs, or just the demo with custom maps, without complaining.
I can't guarantee any of this will work, but it seems to have worked for me. The reason for transferring the pak0.pk3 file is that most TCs are not true TCs, but rather use some basic files such as fonts, etc. that they load from the baseq3 directory.
If you don't have any luck with my executable, you could try producing your own. I only made a few simple changes to files.c. I commented out the following lines:
// if ( FS_ReadFile( "default.cfg", NULL ) // Com_Error( ERR_FATAL, "Couldn't load default.cfg" );
I also commented out the entire function FS_SetRestrictions and just made it return.
I have not made any changes to cd-key related code, so there may be some more work needed.
If anyone is having trouble with getting the project files to work on VC++ 6, download the following tool to convert the .NET files to the old format: http://www.codeproject.com/tools/prjconverter.asp -
You guess wrong
I pity the pour souls who were forced to use your "huge and widely used" web app that was compatible only with IE. It's clear you didn't do your homework before starting the project. ASP.NET web apps do not require having the
.NET runtime on the client any more than PHP web apps require installing PHP on the client. (read: they don't)
All of the native framework web controls have two distinct rendering modes. One is for "uplevel" browsers which includes any javascript/DHTML/etc. goodness that the latest browsers support. The other is for "downlevel" browsers and basically renders everything in something like HTML 3.2 compatibility. The server runtime detects which mode to use based on a section of the machine.config called browserCaps (essentially the .NET equivalent of browscap.ini). The default values stored in the machine.config basically only recognize 5.x+ versions of IE as "uplevel" browsers.
Updated versions of the browserCaps info can be found here:
http://www.codeproject.com/aspnet/browsercaps.asp
It should be noted you can choose to either replace the data in your machine.config to make it a system-wide update, or just add the same data to your app's web.config file.
On a related note, you can find an updated version of the original browscap.ini here:
http://www.garykeith.com/browsers/downloads.asp -
Re:Should not be a problem.
If the program saves every time in UTC, and when displayed, convert it to local time, the user should not need to be worried.
Actually, that's an existing problem in Windows. Any stored UTC date and time (file times, for instance) is converted to local time according to whether DST is currently in effect, not according to whether DST was in effect when the time was stored.
Information from Windows would be more accurate if DST was abolished. (The linked article is four years old, but the problem is still there and Microsoft has stated "this behavior is by design"--meaning they're too lazy to fix it.) -
Real Programmers Don't Eat Quiche
As a lowly student intern working in UF's instructional computing department to put myself through school, back in the early 80's, I was looking up something for my boss in his files when I ran across a badly faded memeographed copy of 'Real Programmers Don't Eat Quiche'... this was a place where mainframe programmers roved the halls, and the piece perfectly documents the type. If you want to become familiar with the culture, you could do worse than reading it, lovingly preserved at Real Programmers (http://www.codeproject.com/scrapbook/realprog.as
p ) -
Real Programmers Don't Eat Quiche
As a lowly student intern working in UF's instructional computing department to put myself through school, back in the early 80's, I was looking up something for my boss in his files when I ran across a badly faded memeographed copy of 'Real Programmers Don't Eat Quiche'... this was a place where mainframe programmers roved the halls, and the piece perfectly documents the type. If you want to become familiar with the culture, you could do worse than reading it, lovingly preserved at Real Programmers (http://www.codeproject.com/scrapbook/realprog.as
p ) -
Re:Features I want...
Um, I think parent was referring to the fact that the size of mfps are implementation-dependant - http://www.codeproject.com/cpp/FastDelegate.asp
So what? Isn't the size of everything implementation dependent? -
Re:Features I want...
Um, I think parent was referring to the fact that the size of mfps are implementation-dependant -
http://www.codeproject.com/cpp/FastDelegate.asp
If the parent was referring to that, then why limit the complaint to only pointers to members? The size of pointers is implementation dependent for of ALL types of pointers (and integers and longs, and classes, and struct, and unions, and...)
Yes its a problem - the creator himself even aknowledged himself that it was basically a hack because a keyword wouldn't be accepted. Just get it over with and use abstract already :).
Seriously, if you feel strongly enough about it, now is the time to write a proposal.
> You cannot call constructors, PERIOD. Placement
> new is not invoking a constructor, it's
> evaluating a "new expression" using an
> allocator function that returns the address it
> is given, and a SIDE EFFECT of that is the
> invocation of the constructor. It's simply
> impossible to directly call a constructor in
> C++.
Wow, that's some real nitpicking there :\. As long as you remember to call the destructor beforehand or call it on an uninitialized object it is the functional equivelent of calling the constructor of an object.
It may be nitpicking, but it's still an important distinction to make. You cannot call constructors, and that has visible consequences, such as 1) you cannot take the address of a constructor 2) constructors can only be called once per object 3) the object "lives" only after the constructor exits successfully, 4) during construction the dynamic type of the object is the same as the static type of the object, but later, they may change, 5) you therefore cannot call pure virtual functions from a constructor.
These contribute to making a constructor "special."
...
Yes, but I think what parent meant was that it makes logical sense to match every new with a delete, which in the case of placement new is generally not the case.
It generally IS the case. I'd argue that placement new is the exception, and one for expert programmers who know the intracacies.
> if the constructor exits
> with an exception, the destructor is NOT
> invoked because the object wasn't constructed
> and therefore doesn't really exist.
One of the complicated things about c++ that routinely trips up even experts in practice.
Why is it compilcated? If you flip it around, it's much harder to justify. Suppose that the destructor would be called no matter how little of the constructor had actually executed. How do you write a destructor that correctly operates? It may be dealing with uninitialized member data that it cannot touch, and has no way of knowing quite how much of the initialization actually needs to be cleaned up. It can't even keep track of state in a variable while executing the constructor, because the state could be uninitialized if the failure occurred even earlier. (That would require compiler support to implement reliably, and would have terrible runtime performance penalties.)
Good luck. Personally, I think the embedded c++ standard was the best comprimise between c and c++.
Well to each his own. I've no more influence over the outcome than my ability to influence voting members. I don't know how much, if any, I have influenced anything yet. :)
One more thing - please remember that that standard will have big consequences for compilers to come - for wxWidgets I still have to deal with old, arguably broken, compilers. Please don't rush it and make sure it gets right this time :).
Well, old broken compilers
-
Re:Features I want...
> False. Member function pointers are
> standardized and not implementation dependent.
> They do have a syntax that is unusual, however.
> It's unreasonable to expect C++ to support
> delegates "like C#" considering that C# was
> designed long after C++.
Um, I think parent was referring to the fact that the size of mfps are implementation-dependant -
http://www.codeproject.com/cpp/FastDelegate.asp
> If you program in C++ from dawn to dusk, the =0 notation should be perfectly normal to you, and not a problem in the slightest
Yes its a problem - the creator himself even aknowledged himself that it was basically a hack because a keyword wouldn't be accepted. Just get it over with and use abstract already :).
> You cannot call constructors, PERIOD. Placement
> new is not invoking a constructor, it's
> evaluating a "new expression" using an
> allocator function that returns the address it
> is given, and a SIDE EFFECT of that is the
> invocation of the constructor. It's simply
> impossible to directly call a constructor in
> C++.
Wow, that's some real nitpicking there :\. As long as you remember to call the destructor beforehand or call it on an uninitialized object it is the functional equivelent of calling the constructor of an object.
> Placement delete is only used to cleanup the
> memory when an exception causes the constructor
> to fail
Yes, but I think what parent meant was that it makes logical sense to match every new with a delete, which in the case of placement new is generally not the case.
> And, as an obviously competant C++ programmer,
> you should know that if the constructor exits
> with an exception, the destructor is NOT
> invoked because the object wasn't constructed
> and therefore doesn't really exist.
One of the complicated things about c++ that routinely trips up even experts in practice.
> You're correct, and you may find that we're
> trying to address this topic in C++0X. If
> you're interested, see http://www.open-std.org/jtc1/sc22/wg21/docs/papers /2004/n1737.pdf
Good luck. Personally, I think the embedded c++ standard was the best comprimise between c and c++.
One more thing - please remember that that standard will have big consequences for compilers to come - for wxWidgets I still have to deal with old, arguably broken, compilers. Please don't rush it and make sure it gets right this time :). -
Re:Features I want...
1. Member function pointers. Implementation dependent and messy syntax that few people even know about. Their use is limited, and they don't support delegates like C#, making them ugly to work with.
For a full description of just how utterly brain damaged C++ member functions really are check thisarticle.
Riddle: What's the size of a method pointer?
1. 4 bytes
2. 8 bytes
3. 12 bytes
4. 16 bytes
5. 20 bytes
6. all of the above
The correct answer is 6. It can be any of these sizes depending on the circumstances. And just imagine that with all of this mess method pointers STILL don't support something as elementary as delegates (bound method pointers) in a dependable and portable way. -
Re:a 'few' rough edges
C++ has indeed a steep learning curve, but C++ still has lots of advantages: low memory overhead (even modern Java/C# collectors have LOTS of overhead) and fast execution speed.
It's still impossible to create a snappy application with complex GUI in Java/C# - even the leaders in UI-performance like Eclipse and IDEA are slower than mostly-native VisualStudio (I don't argue about their feature sets right now).
In fact, most of Java/C# people underestimate power of C++. For example, it was long time taken for granted that _runtime_ reflection is neccessary to implement easy-to-use serialization library and RMI (Remote Method Invocation) facility.
But look at this: http://boost.org/libs/serialization/doc/index.html and http://www.codeproject.com/threads/RMI_For_Cpp.asp ! It appears it's possible to implement serialization and RMI in pure C++ without lots of hassle and with full _typesafeness_!
C# people boast that their language has built-in delegates support. And here is implementation of multicast delegates in C++: http://boost.org/doc/html/signals.html
C++ has even some functional programming support: http://boost.org/doc/html/lambda.html and http://boost.org/libs/spirit/doc/phoenix.html
Even such features as pure C++ BNF grammar or FSM automaton are possible.
And so on...
IMNSHO, C++ is now the most powerfull language in the world (only Lisp has a comparable number of supported features). -
Re:Hardware Translucency in Linux - wrong!
Wrong, theres nothing to stop you doing per-pixel alpha-blending with the windows API. Here are two examples (c++ & c#):
http://www.codeproject.com/gdi/pxalphablend.asp
http://www.codeproject.com/cs/media/perpxalpha_sh
a rp.asp
Given that the pre-requisite APIs (in the case of the C++ code) were available years before the release of OSX (2001) or any Linux-GUI system, then its clear that per-pixel alpha-blending was possible first with Windows GUI.
-
Re:Hardware Translucency in Linux - wrong!
Wrong, theres nothing to stop you doing per-pixel alpha-blending with the windows API. Here are two examples (c++ & c#):
http://www.codeproject.com/gdi/pxalphablend.asp
http://www.codeproject.com/cs/media/perpxalpha_sh
a rp.asp
Given that the pre-requisite APIs (in the case of the C++ code) were available years before the release of OSX (2001) or any Linux-GUI system, then its clear that per-pixel alpha-blending was possible first with Windows GUI.
-
Try the open source ToDo List
I saw someone else mentioned TODO list. It's free and doesn't have much advanced functionality, but it my all time favorite program of its type and have to say I imagine it works perfectly for 95% of features. For anyone looking for a todo list type program, or if you are looking for something a lot simpler and more functional, lots of people will back me up on this...
http://www.abstractspoon.com/tdl_resources.html
http://www.codeproject.com/tools/ToDoList2.asp -
Re:Absolutely!
I got one for you:
Here you go
I was a bit mistaken - it doesn't directly incorporate the C shell into the explorer, but rather the normal command prompt. But if you have the Windows SfU installed, the basic C shell functionality is available from the windows command prompt. So it understands the basic GNU tools, you can use pipes, redirections, perl (if installed - I use the ActiveState perl), sed, grep... basically all you need. -
Re:bad tactics from Colin Percival"I'd be really surprised if somebody is actually able to get a real-world attack on a real-world pgp key usage or similar out of it"
Being able to read arbitrary memory from another process is a big security flaw, as illustrated by the Minesweeper Hacking sample. But for a kernel programmer it's a minor deal for server security as it needs a local/remote exploit to run code on your box. Even then it is a readonly exploit, which decreases exploitability unless we're talking about stuff like SSL certs or GPG keys - which are pretty hard to find in 1 Gb of data
So to really exploit this, your thread should be running the CPU practically or 100% CPU. That should be an easy enough warning sign :) :) -
Re:But we already know the cheat
Well, I was semi-interested when I read the article, and at page 11, my jaws dropped:
Time was spent to download and install the Symbols Packages, so let's see what hints they provide. Issue the following within the Command window get a list of all available symbols for WinMine.
x WinMine!*
The WinMine sybols are INCLUDED in the XP debug symbols !!!
Of COURSE, it renders the reverse engineering task easier !
Conclusion: crap article, as in most case, you will not have the symbols when you reverse engineer. The CodeProject article is much better. -
Re:But we already know the cheat
It certainly does rearrange the field... if you activate the cheat and hover over a square of which the top left pixel tells you it's a bomb (i.e. black) and you click it, it won't reveal a bomb at all. in fact the bomb that was there will be moved to the top left corner of the field or the adjacent square if that one already contains one...
and if you still don't believe me, do a search on codeproject.com with the keyword INVOKE and you'll turn up this
ow, and of course clicking both buttons at the same time while hitting the 'esc' key will stop your timer! -
Another take on hacking minesweeper
There's also a good article on hacking minesweeper here
-
Re:What about other platforms?
> I wonder if there is any decent code repository for
.NEThttp://www.codeproject.com/ has a lot of good
.NET projects. Many of them are well documented by the authors in accompanying articles. -
Stego in HTML by reordering attributes
Those of you who find stego interesting might enjoy reading about one person's explorations of the topic on the Code Project site
.. I found the idea of reordering HTML attributes to encode information especially inspired:http://www.codeproject.com/csharp/steganodotnet13
. aspThe same author has written a number of other stego-related articles, usually with C# code
.. plus she's kinda cute. ;-)Enjoy.
-
What is your true goal here?
That post is probably the best advice I've seen here.
The most important question I think is
"what is your true goal?"
Possible answer include:
a- something new and original
b- something really usable
c- something pretty
d- a combination of a/b/c?
Is the goal just to create any game? Being for a class and depending on your TA or professor, I would expect the engine to be more important than the look. (if it were commercial, it would probably be the reverse, ymmv.)
One important detail is how it should look, depending on your true goal. Be warned that if you are not already a designer (i.e. used to draw manually or with computer tools) then stay away from anything that requires a lot of art.
Even something as simple as a Pacman clone or 2d vertical shooter requires a lot of art and that can divert a substantial amount of time from your project.
If it's a class project and what matter is more having a complete usable game with a real engine that just pretty static picture, nobody will care if your pacman looks like a blue circle as long as it can travel around and properly collide with walls.
Now for the specifics: some people like card games, some others don't. Personally I'm more into 2D games. They can be easy to program. As a start, you can have a look at a basic game I wrote a long time ago (it clones an old Amiga game) and that I regularly port to different platforms (it's a great way to learn a new language and framework):
http://www.alfray.com/projects/Nerdkill/index.html
This one is in C# and uses DirectX (desktop) or GDI (PocketPC). The engine was written to reasonably easy to understand and adaptable to other languages or platforms and is somewhat described here:
http://www.codeproject.com/netcf/cfgamenerdkill.as p
and
http://ralf.alfray.com/.izumi/Dev/NerdkillDev
Technically it could sure be ported to work under Linux using Mono and GTK#, although there's some work there especially if you have to learn these APIs too.
The whole thing is GPL so feel free to reuse it if you like. I thinking of it more as a way to see how to organize your project (or not.)
-
Is this news because google is doing it?
Because this isn't the first time that I've seen this in use. I saw it somewhere else before the link below, but the linked page gives a good idea of how to implement such a thing (Though I'm sure the google solution is more complex):
http://www.codeproject.com/jscript/jsactb.asp -
Re:Implementation details
Not exactly unique in their implementation:
http://www.codeproject.com/jscript/jsactb.asp -
Programming Tips for Artists?
An anonymous reader writes "Recently I've found myself in a bit of a bind with software. My contracts have been rather small, barely enough to pay myself let alone a programmer. The software needs aren't intensive, mostly file or network I/O depending on the project. Despite owning a few key apps (Visual C++, Eclipse) my software production output is rather poor. Are there any other artists who have learned to be self-sufficient? Are there any resources available to educate me on the finer points of making software that works?" One resource for the less geeky among us is the collection of free code at the code project or code guru, though it won't give advice for creating new application. What are some others?