Domain: codeguru.com
Stories and comments across the archive that link to codeguru.com.
Comments · 50
-
Re:It's not impossible
http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c16139
Mind running or compiling this demo and letting me know how it runs? I'm genuinely interested.
-
Re:Ribbon might be a bad example
Microsoft bungs hundreds of millions at "usability" & we end up with the stupid ribbon
I'm not convinced that "the stupid ribbon" is the best example of your thesis. Perhaps it is easier for novices to learn a program's tabbed toolbar than a program's menu bar. For one thing, recasting a pull-down menu as a toolbar keeps a class of actions on the screen where the user can see them rather than overlapping the document and disappearing once the user chooses an action. As I understand it, most of the whining about Ribbon came from 1. people who rely on muscle memory from previous versions of the product, the same sort of people who would get confused between Microsoft Office and OpenOffice.org anyway, and 2. people concerned about the legal fees of putting up prior art from 2002 to invalidate the patents that Microsoft engineers were applying for over tabbed toolbars. Sure, Ribbon has room for improvement, but it took a couple iterations for Apple to get pull-down menus right too.
To be honest I think the problem Microsoft has is that if it doesn't actively look different, people won't see it as a new version, so they won't pay for it again. I know this from programs I've written - if you make changes customers can't see, they're very unwilling to pay for them, even if they make significant improvements to speed, usability, stability or something else important to the customer. Word 2007 really isn't any better than the previous version - it isn't more reliable, it doesn't have any useful new features. Why should anyone who has the existing version pay for the new one?
Because it looks different. They can see it has changed. It doesn't matter that this burdens them with new training costs for no actual benefit: they can see it's new, and, therefore, must be improved.
-
Ribbon might be a bad example
Microsoft bungs hundreds of millions at "usability" & we end up with the stupid ribbon
I'm not convinced that "the stupid ribbon" is the best example of your thesis. Perhaps it is easier for novices to learn a program's tabbed toolbar than a program's menu bar. For one thing, recasting a pull-down menu as a toolbar keeps a class of actions on the screen where the user can see them rather than overlapping the document and disappearing once the user chooses an action. As I understand it, most of the whining about Ribbon came from 1. people who rely on muscle memory from previous versions of the product, the same sort of people who would get confused between Microsoft Office and OpenOffice.org anyway, and 2. people concerned about the legal fees of putting up prior art from 2002 to invalidate the patents that Microsoft engineers were applying for over tabbed toolbars. Sure, Ribbon has room for improvement, but it took a couple iterations for Apple to get pull-down menus right too.
-
Re:Rather smug, I think.
Well, in languages such as Java, the finalize() method may never be called. You have to manually call a "close"/"destroy" type method since finalize() isn't really a destructor. Even C# recommends you implement explicit destruction (See "Explicit Release of Resources" in the linked page.) I quote:
The programmer has no control over when the destructor is called because this is determined by the garbage collector. The garbage collector checks for objects that are no longer being used by the application. If it considers an object eligible for destruction, it calls the destructor (if any) and reclaims the memory used to store the object. Destructors are also called when the program exits.
[...]
If your application is using an expensive external resource, we also recommend that you provide a way to explicitly release the resource before the garbage collector frees the object.In other words, the lazy destruction in a "managed" language can really bite you in the hindside, since who knows when the GC will get around to releasing your resource? Why else would a managed language have an entire standard interface devoted to the problem?
In contrast, in C++ (an unmanaged language), objects' destructors are always called automatically when they go out of scope or when you delete them.
-
Ram Disk?
-
*extremely* old news
First Look?
-
Community Games vs. App Store?
For one, "most consoles" do not need hack and mod to run homebrew.
My source says Wii is just 2.6 million consoles short of outselling Xbox 360 and PS3 combined. And there is no official Community Games or Linux program for Wii; warioworld.com says you need a corporation, a leased office, and a previous title on another platform to qualify.
You can write your own games, TODAY, for the Xbox 360 using Visual Studio
If you buy a computer capable of running Visual Studio. The hardware has to be new enough, and the operating system has to be Windows. (XNA Game Studio is based on Visual C# Express, which fails in Wine.) The iPod Touch has the same restriction: you have to buy a Mac for $600 and a USB KVM switch for $60, even if you do get Xcode at no additional charge. In addition, as I understand it, if you've already written a PC game in C++, you have to rewrite all the physics and AI in C# because it's difficult to make C++ code meet the "verifiably type-safe" bar that XNA's use of the CLR requires. Rewrites introduce bugs.
and upload them to Xbox Live where you have access to a huge market approaching the size of the iPhone market. [...] the App Store model for the iPhone is the Wrong Way(tm).
The model of Creators Club (a $99 per year certificate to run homebrew) plus Community Games isn't too much different from the model of an iPhone SDK certificate plus the App Store.
The PS3 has Linux.
And, I'm told, less graphics performance than a PlayStation 1 due to the RSX lockout. Or has OpenGL on the Cell materialized yet?
The GPS thing is entirely about revenue streams
... it costs a ton of money to create digital maps, and TomTom like devices are a significant source of the revenue for them. Providing open APIs to do turn by turn GPS directions isn't going to happen whilst these devices pay the bills at the data providers.How does Google Maps pay the bills?
-
Uh, no.
It's not documented. If you go by the official Microsoft documents for Win32, there is no relationship between processes. You cannot find a process parent and you cannot know enumerate process children. Theoretically a parent process would hold the child process handle in the application but that's not the same thing as just asking the O/S what your children are.
If you do want to get it, you have to use an unsupported call:
-
Re:High performance of C++ equal to D???
I'm sure you're thinking of Java or C.
Wrong. I am thinking of C++. Count the times you pass a reference or a pointer vs. the times you actually want to copy large, complex objects. The outcome is pretty clear. Hell, boost even contains a "noncopyable" class as a tool to disallow deep copies.
Deep copies are the exception. Shallow copies are the rule. This is totally obvious, and virtually all other languages do it this way. The only two reasons why C++ doesn't have it that way are the C legacy and the ownership problem (which is solved by the GC).
Yet another problem with by-value as default are move semantics. It basically boils down to the problem of extra copies in return values. C++0x sort of fixes it with the aforementioned move semantics. See http://www.codeguru.com/cpp/misc/misc/versioninfo/article.php/c14443 for more. Note that this issue is an artifact of the by-value-default design decision in C++.
So in 99.999% of cases, you don't want a to pass by reference or to copy the object - instead, you want to pass a copy of the pointer to some instance.
Wrong conclusion. Your example just shows that the assignment operator is ill-defined. Besides, this is possible in D, since you can overload the assignment operator.
And, how to do actual copies of the object? Since doing *deep* copies is rarely done on purpose, a clone() method is the way to go.
No multiple inheritance is pretty good from a readability & codability viewpoint, as long as there is some mechanism that allows you to more clearly express your concept (i.e. Java interfaces). Multiple inheritance creates confusion potentially - which parent am I inheriting function foo from if both of them declare it? What is the destructor order if parents have virtual destructors?
I take it you never did C++ metaprogramming then? Never implemented policies, CRTP and the like?
Not sure what your problems with operator overloading are. Presumably you think that the return value should be part of the method's signature. Not sure if this is a good or bad idea - maybe it creates issues for compiler writers & ambiguity in the error messages?
See this example:
x[5] = 1;
How is this done in C++? x' index operator returns an lvalue (e.g. a non-const reference), whose type in turn defines the assigment operator. This is the right way, since retrieval and assignment are two orthogonal concepts. What if x is some sort of container class? If there were a "[]=" operator, the container class would have to define retrieval *and* assignment. But the latter is not the container's job.
D has an opIndexAssign operator, which is "[]=". Fortunately, there is progress; an opIndexLvalue operator has been accepted into D2. However, opIndex would be sufficient if it were possible to define the return value itself as an lvalue.
-
Re:A DRM ban clause should be added as a constitut
I would assume that they allow installers signed by Microsoft-approved certificates to modify the firewall. This would mean that any only joe-the-hacker with a compiler can not do it.
A quick google search shows that this is wrong. Here is the officially published API. Or if you want, you can just write to the registry. Here is the code in C#. The C# compiler comes with
.NET, so everyone can do this.I guess this means that if you beef up the security on those registry keys then you could prevent any software from adding themselves to the exception list. Just make an Administrator account for installing that does not have access to those keys... I might have to try this out.
-
Use random string of characters
This is really old news, but a useful reminder that wireless access points should employ non-dictionary passphrases. To defeat even the most sophisticated password-guesser (one that combines dictionary-based and brute force password guessing), you can use a completely random password, such as one generated by by this FOSS utility: http://www.codeguru.com/csharp/csharp/cs_misc/security/article.php/c14557/
-
Nipple mouse?
And when did it's interface become intuitive?
When they replaced the ribbon with a nipple.
What makes the pointing stick on a ThinkPad any more intuitive than any other way to choose an item from a GUI menu? And why would it require replacing a tabbed toolbar?
-
NtAPI/zwAPI calls is faster than std. Win32 API
"After the criticisms about the "secret Windows APIs" Wikipedia the last thing M$ will do is to proclaim they have some exclusive "intimate knowledge"." - by DiegoBravo (324012) on Monday October 20, @12:03PM (#25442013)
IF you're referring to the "native NT API" (prefixed by Nt & zw in their function names, hence NtAPI/Native API)?
You'd be correct!
E.G. -> In that Native NT API calls functions, ARE faster!
(Albeit - afaik ONLY Marginally so, due to MS doing as good a job optimizing the Win32 API, but still faster (less overheads for 1 thing)).
I.E.-> Are they "World's Faster"?? From what I read, yes, IF you call them again & again + add up the time taken by them -> vs. calling the same analog function from a Win32 API call library (that distills down to ones from NTDLL.DLL anyhow many times - look @ the dependencies of many libs or apps, & see calls outta NTDLL.DLL & you can see apps using them (directly, or not))...
(& yes, you CAN leverage/use Native Nt/Zw API calls, DIRECTLY, in YOUR Win32 usermode (e.g. -> Apps you run under explorer.exe shell once you logon) app you code)
LoadLibrary functions (I use this as 1 method of calling & loading lib functions in Delphi, there are others too) in compilers ARE present in MOST compilers, & it's "amazing" what you can do with that in compilers for your code... & what you can call + use!
THINK OF IT AS "GOING DIRECT" (more hassles though, more code to put out, yourself many times)
----
Example (using NtCreateFile, a native NTDLL.DLL function (which IS 'native mode' & large core of OS itself)):
Opening a directory with NtCreateFile:
http://www.codeguru.com/forum/archive/index.php/t-355596.html
APK
P.S.=> Thing is though, they're NOT that "secret" - the Microsoft DDK (device driver kit) exposes a truckload of them, & people like Dr. Mark Russinovich (Microsoft/SysInternals) "decoded" (hacked/disassembled via debuggers) the rest from what I have read & exposed much/many of them to folks worldwide prior to his hiring by MS in fact... apk
-
Re:There's a saying..
That's funny, because I recall having to fix pages when IE 5 came out, again when IE 5.5 was released, and again for 6 and 7. Each version of IE came with its own set of quirks and changes that caused non-trivial CSS layouts to render oddly. Conditional comments greatly aided the transition, but it was a transition nonetheless, so why not make a transition that actually makes web development more uniform for a change?
As for still requiring Microsoft's Java (because of JDirect or the com.ms.win32 stuff, I assume?) and IE6, IE8 is a moot point. If you aren't changing your environment either way, what does it matter what the rest of the world does?
Then again, there's no reason why your shop couldn't use Firefox with IE Tab and set your intranet domain to automatically revert to the IE renderer. Best of both worlds: local compatibility with global compatibility.
-
Re:I think you're not reading closely enough
On Windows you can read the hardware manufacturer out of the SMI Bios table in the registry - it gets copied there during booting. Or with GetSystemFirmwareTable.
I suppose you could do make the authentication process secure by having the installer verify a signature in one of the tables to check it was a genuine Apple machine. But people could always patch the installer so it doesn't check anymore, so it doesn't really help you stop people running the software on non Apple hardware. Then again you could make the software phone home for activation and have the trusted home server send down chunks of code which would check it was an uncracked exe running on the right hardware.
So you could do it technically. It would be a stupid idea of course. -
It happened to me and what I did
Invalid DNS Redirection
Recently I inadvertently entered a url and forgot one of the leading w's. I thought I'd get a browser error, instead I was opening a page with all sorts of ads and a "Did you mean:" with several suggested web sites. I know how DNS works so I brought up a network sniffer to see what was going on. To my astonishment my DNS server was returning a valid IP address for a dns entry that did not exist! When opened, this address did a http redirect to the web site with the ads and suggestions. I tried a simple test to see if the browser was involved. I used NSLOOKUP and entered an invalid address and sure enough a valid IP was being returned, I don't use a proxy server so the problem had to be in the DNS server. I have to use Hughes satellite services so I though it might be something being done by them, but in reading on the net many IPSs are doing the same thing. I investigated some more and found out that Hughes was using the services of a company called Paxfire who makes a living working with Internet ads. Other ISPs might be using another service. I noticed that the redirection was returning another url, wwh.found-not-help.com. If I put that name in the hosts file I then got a normal http error. That would suffice in most cases but on a satellite Internet link the round trip packet latency can make a connection look like dial-up.
I decided to look into this more. I had an idea. Several years ago I wrote 2 functions for a project I was on, AddDNSName, and DeleteDNSName. These would add secondary IP addresses to the network adapter and delete them programmatically. So I wrote a simple program using the old gethosybyname socket function. I would look up an invalid name and if a valid IP address was returned I added these addresses to my system. After that everything worked as it should. DNS returned the redirection IP addresses and a connection attempt would immediately fail because the address was now local.
The ISP's have a solution but it requires leaving a cookie on your system and you're still doing more network traffic.
This is not a new problem and I found this reference http://www.itmweb.com/f092403.htm about Verisign having the problem in late 2003! I find it amazing that IPSs would change Internet standards just to receive more ad revenue. Seeing that there was no recourse in standards committees I decided to write this and the code for the problem. The code could easily be polished to make it stronger, I just wrote a prototype program (which I use). There is an article on codegugu.com, http://www.codeguru.com/cpp/i-n/network/winsocksolutions/article.php/c6165/ that has the C++ code for add and delete ip addresses(ipadddel.c ipadddel.h). Here is the code I wrote for this problem. It can be easily modified for adjustments. It's a hack job but it seems to work.
It seems I can't post the code, I get a "too many junk characters" error. If you want it I'll send it to you.
Just a few notes on this. IP addresses added are transient, which go away after a reboot or delete. The chance of these DNS IP addresses are in your address space is extremely small and not possible if you are using DHCP. The ISP's could change the redirection IP address but it would still be found every time the code is run on the workstation. The code is setup for 2 redirection addresses but could easily be changed for more.
The ISP's have a solution but it requires leaving a cookie on your system and you're still doing more network traffic. What they didn't consider also is that Browsers are NOT the only internet application that uses DNS.
Bill -
Re:It will come, don't worry.
I have machine envy now.
I know you don't have a large investment in making Windows behave better, but I wonder if you could create a RAM disk in Windows and put your pagefile there, thereby eliminating the actual slowdown due to paging.
Something like:
* RAMDISK: http://www.speedguide.net/read_articles.php?id=131 or http://www.codeguru.com/cpp/w-p/system/devicedrive rdevelopment/article.php/c5789/
* Plus Moving Pagefile instructions: http://support.microsoft.com/kb/307886/ and if you print often move the spool too: http://support.microsoft.com/kb/308666/If you weren't going to use the default desktop manager in Solaris (and I'm not) what would you use?
-
Re:Don't get yer hopes up
Apparently you've heard of the CLR (and MSIL)?
http://www.gotdotnet.com/team/clr/about_clr.aspx
http://www.codeguru.com/csharp/.net/net_general/il /article.php/c4635/ -
BROWZAR IS SPYWARE!!!!
Dont use browzar. It is spyware!!
As you already know "Browzar" is actually an IE extension , so do the following trick to expose the spying :
1. Open an Internet Explorer (NOT BROWZAR!!) window and go to Tools -> Internet Options -> Security -> Custom Settings...
2. Select "Prompt" in the "Allow Paste operations via script" option
(Btw This options disables the "feature" that IE has to remote-copy your cliboard contents (more on this here)
3. Save and close IE
4.Now open the Browzar browser and go to ANY wabepage you like. ANY WEB PAGE!! Select a text and try to copy it (ctrl+c or right-click copy)
5. Be very afraid -
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.
-
Re:Mainly GC but sometimes...
What I don't understand is why they couldn't have written Java (and
They have. Visual Studio 2005 adds syntax to Managed C++ (C++/CLI) to allow you to manage your lifetime and memory separately. Herb Sutter has been talking about this for at least a year IIRC. Dinkumware even made the STL work with it. .NET) so we could have our cake and eat it too.See for instance this article. I'm not currently developing on
.Net, but I'm hoping that these extensions can be considered at sometime for standard C++. I'm no MS apologist, but it really does seem to be the best of both worlds. -
Re:Not silly at all
Date and Fabian Pascal have been fairly clear that it's an actual company - they've discussed the owner's name, which I don't recall, I'd have to look it up on my hard drive somewhere [Steve Tarin, apparently, is the inventor and owner, I've just looked it up].
According to Pascal, Date has seen a working implementation of the TRM, and is writing a book about it tentatively entitled "Go Faster! The Transrelational Approach to DBMS Implementation."
The company name is Required Technologies Inc.,
39141 Civic Center Dr. Ste. 250, Fremont, CA 94538 Their Web site remain "under construction".
The patent for TRM is United States Patent 6,009,432. There is also the patent application: United States Patent Application 0010000536.
There is also a resume of one Vincent Poydenot who described his employment with Required Technologies as Vice-President of Software Development. He describes a 15-man development team which developed a full implementation for Windows NT 4.0 in Visual C++, with a port to Solaris and Linux.
Links for the above here http://dmoz.org/Computers/Software/Databases/Relat ional/Implementations/Required_Technologies//
An ad for programmers to work for the company when they were apparently in New York is here:
http://www.codeguru.com/forum/archive/index.php/t- 188697.html/
According to Pascal's DBdebunk Web site:
"Not only had Date been exposed to a working TRM implementation - a prototype built by Required Technologies that included update and disk operations - but so have other highly respected database researchers and implementers. Moreover, several potential customers ran their own benchmarks against this prototype using their own real-world data and their own live complex queries. The results were extraordinary. In every case, TRM delivered orders-of-magnitude performance improvements over existing RDBMSs, in a large dynamic disk-based environment. These results can be demonstrated to anyone seriously interested in TRM....
Not only does the prototype implementation of TRM (referenced above) still exist, but also a full-blown commercial disk-based updatable RDBMS based on TRM (with standard SQL, ODBC, JDBC, and third-party tool interfaces, plus all standard subsystems) is nearly complete."
The above was as of January 2005. Back in late 2004 Pascal was describing "large transactional databases with subsecond response." Note that these were not in-memory databases but disk-based.
Apparently there is some legal or financial issue involved that is threatening the owner with "having his company taken away from him", according to one reference. They claim the guy has been fighting tooth and nail to resolve the issues, but there hasn't been any recent info.
I would have assumed the whole thing would have been resolved by now in most cases, unless the people involved are waiting for some court case.
I have now found a post on Curt Monash's blog whereupon he apparently - I say apparently because I have no idea whether his information is correct - debunks the entire project and the company:
http://www.dbms2.com/category/memory-centric-data- management//
Fabian Pascal's response on Curt's blog:
Monash knows zilch about TRM. But then he knows zilch about RM too,and lack of knowldge has not stopped him ever before from generating crappola. In fact, he is not even aware of how ignorant he is.
Nonsense indeed, but the only one is from Monash.
Unskilled and unaware of it. Typical american.
Comment by fabian pascal -- November 14, 2005 @ 12:41 pm
There follows a ton of incredibly acrimonious comments between Monash and Pascal in which both accuse the other of various incompeten -
Re:Painful
Forgot this one
...
3. Upgrading Visual C++ 6.0 Projects to Visual Studio .NET 2003 in Batch Mode -
Not impressed
> If all you know about Microsoft dev tools comes from Visual C++ 6, then give these newer tools a try. You might be impressed.
We were using VC++ 6 at work. Then we migrated to 7.1 (a.k.a .NET 2004).
The second thing that I noticed (after spending countless hours to modify the solution and project files so would recognize the source-controlled files correctly) is that the code browser has been severely crippled.
No more "call graph", "caller graph", etc.
Oh yes, the VS team has graciously admitted that the features were removed in the .NET 2003 version and that they "are being considered for a future version".
WTF? I need to pay *again* to get some features back?
So, no, I am not impressed.
By the way, if anybody knows of a third party add-on, plug-in or whatever that emulates this functionality?
There was one for the previous version (VS.NET 2003) but it does not work with VS.NET 2004, is no not supported and the source is no longer available. -
Re:Buffer overlow protections?
Yes, aside from the AMD64 NX bit, they've added some overflow detection. According to this article they do it by placing a cookie after the end of buffers and then checking this cookie for changes. They call it 'software-enforced DEP(Data Execution Prevention)' and more information can be found at http://support.microsoft.com/kb/875352 and codeguru has the best description I've found. If you have XP with SP2 you can go to Control Panel, System, Advanced, Performance Settings button and choose the Data Execution Prevention tab to play with settings.
-
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?
-
Re:You don't optimize, that's the job of the compi
Most compilers will actually reduce sets of if statements to a hardcoded jump table, which is going to be as fast as rewriting it. See http://www.codeguru.com/Cpp/Cpp/cpp_mfc/comments.
p hp/c4007/?thread=48816 for more information. However, the clarity of the single test is indisputable.... -
Ten Microsoft Developer Community SitesI am a Microsoft employee so I might be biased but there are a number of developer communities around Microsoft technologies including
- Code Project
- SQL Server Central
.NET Weblogs, SQL Junkies- ASP.NET forums
- 4 Guys from Rolla
- ASP Alliance mailing lists
- CodeGuru discussion forums
- TopXML discussion forums - this is mostly about Microsoft XML technologies
.NET Junkies- SQL Team .
-
Re:Duh
The article is wrong. In C#, you can mark blocks as unsafe and use pointers or directly write in MSIL. Using this you can gain amazing performance gains.
-
Re:Great. Five whole minutes of my life wasted.
Yes, I've done that five minutes of work. Well, maybe more. Maybe a lot more. I personally think Miguel is on to something truly wonderful with the project. But thanks for offering your help.
My point was this: as written, locutus is a pure Windows-only app, which was not in any way apparent from the original posting. And, according to the faq, the developers of locutus do not intend to release the source for the app, which means no porting to Mono, lisp, Applescript, FORTRAN, or anything else for that matter. Only for Windows.
While I have no objection to people wanting to develop for any platform they want to, it's always been my impression that /. is not primarily geared toward Windows developers. There are plenty of those. All I'm saying is, it'd be nice if Michael, or anyone else posting, would at least mention something to the effect to "this app won't run unless you have windows." In the context, I don't think it's too much to ask. -
Supposedly...From http://www.codeguru.com/system/Lock.shtml:
To intercept keyboard and mouse input I install a system-wide hook. A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure. To install a hook use SetWindowsHookEx() function.
To disable special keys (Ctrl-Alt-Del, Alt-Tab, Ctrl-Esc, Windows key) I used SystemParametersInfo() function with SPI_SETSCREENSAVERRUNNING flag. Even though applications are not supposed to use this flag, because it is used internally in Windows 9x, it does the job.
Also note that Linux has a 'pseudo-SAK' key, Alt-SysRq-K. It's not a true SAK, as XFree86 (and any other program with root priveleges) can take control of the keyboard if it wants to. However, Alt-SysRq-K will kill normal user processes on the console (also, processes with root priveleges that don't take over the keyboard handling) and return you to whatever the /bin/login program is today. -
For MSVC development
If MSVC is your only environment try here for tips and pointers. They cover a lot of other stuff as well. For pure C++ then as others have said go with Myers / Stroustrup etc
-
Re:Balmer's "Developers" is bullshit
This post to me is the classic "open-source is better than Windows because <blank>", where half the time, the poster hasn't completely investigated all of the claims he/she makes. I may be called a troll, but I've done development on both Linux and Windows (predominantly Windows), but I'd like to clear up some of the "comparisons" made by the poster.
COMPILERS:
MS:
Killed most compilers for their platform (except the oddball ones) by squashing them with their own. Visual C++ generates pretty tight code, but you're just screwed if you run into a bug with it. Oh, and it costs lots of money. Most compilers commercial. Mingw/cygwin exists but not supported well (MSDN support bitterly hates both).True, Microsoft has pretty much killed the competition, although your claim that it "costs a lot of money" is a little off centre. You can download the
.NET Framework, which includes everything you need to build Win32 applications (everything but the IDE) for free off of MSDN. If you decide to splurge, you can buy Visual C++ Standard for the massive sum of $89.99.DEBUGGERS/DIAGNOSTICS:
MS:
Um...ntinternals put out regmon and filemon. Apparently MS puts out WinDBG for free, though I haven't used it and apparently it isn't too popular. No free high level debuggers. Few diagnostic programs for already compiled code.Again, spoken like someone who barely has any actual experience in the realm. WinDBG is an extremely powerful kernel/user mode debugger, and in my experience works just as well as anything else on the Win32 platform for debugging user mode code. The Visual Studio integrated debugger is also great. As far as diagnostic programs, there are quite a few, such as NuMega DevPartner Studio, or Rational's DevelopmentStudio. Windows NT-based operating systems also ship with Performance Monitor which is an often unused tool which allows you to monitor many application specific diagnostics. For disassembly, there's IDA, which is without a doubt the ultimate disassembler for Windows.
DEVELOPER SUPPORT:
MS:
Guess at what's going on underneath the covers, most of the time. No source to look at. Some newsgroups, mostly for higher level problems. Can purchase extremely expensive (though usually effective) MSDN incidents.There are many Windows developer sites, namely sites like CodeProject, CodeGuru, and let's not forget: MSDN. MSDN has thousands of articles, and full API documentation. You can also read back-issues of MSDN Magazine. Provided you can't find your answers on the aforementioned sites, there's always Google Groups
... which in the past has had the answer to nearly every Win32-related question I've ever had. So you can see that saying developer support for Microsoft platforms is weak is quite an understatement.SAMPLE CODE:
Many many source examples listed on the sites above
...APIS:
Windows:
The most godawful APIs in the world. Win32 is so full of cruft, poor conventions, inconsistent conventions, and unnecessarily complicated *crap* that it's amazing. Most advanced MFC programmers end up having to interact with Win32 as well to do certain things that MFC can't do. Has some great snippits on MSDN, along the lines of "Do not use this argument, as it represents a security risk and has been obsoleted. Some developers may wish to use this argument for backwards compatibility with Microsoft CSPs."By the tone of this paragraph, I take it that the main area of exposure the developer has had to Microsoft APIs is with the CryptoAPI, which IMO is one of the worst APIs Microsoft has ever released. One of the advantages of having a sole API provider is that there is a uniformity across all areas of the system, so that if I need to figure out how to use a new API set, it always looks familiar.
MFC programmers need to interact with the API at some point. If you think that MFC will protect you from the API, then you are sorely mistaken. Many Windows programmers jump into development by learning MFC, without learning how API works underneath, and subsequently end up writing shit applications. I personally would not touch MFC with a 10-foot pole (try WTL instead).
Ultimately, I prefer development for the Windows platform, but only because it was what I was trained on. I do realize that Linux has excellent development tools. What I hate to see is Linux zealots bashing Microsoft without actually knowing anything or having a lot of experience with the Microsoft Platform.
scott -
Re:Mozilla's Biggest Problem -- Poor Branding.
The Mozilla group should just focus on making their HTML rendering engine, Gecko, completely useable by as many application developers as possible
http://www.codeguru.com/controls/iemozilla.html
In other words, you only need to replace the CLSID_WebBrowser with CLSID_MozillaBrowser. -
Internal IMs
If you're just looking for a way to communicate internally, as a supplement (or even replacement) to email I would suggest a program I found surfing the net. I didn't write it but I've been playing around with it on a few computers in the lab where I work and it's pretty nifty.
"Peer to peer network messenger" -
CodeGuru and CodeProject for Windows Development
I often find CodeGuru and Codeproject useful for sample code, expecially for Windows development.
However, I usually just end up searching with Google to find the information. Links turn up so often to Codeproject and CodeGuru, that I often go there first now.
Finally, if you're getting into .NET development, the Windows Forms FAQ is a useful resource. -
zerg
If you're going for windows programming at all, of course you need a few sites:
http://msdn.microsoft.com/.
http://www.codeproject.com/
http://www.codeguru.com/
I recently discovered another site which has saved me alot of trouble, though I doubt a linuxweenie would ever need it: WinForms FAQ -
Top 3 Java WebsitesThe top 3 places that will always stay in my bookmarks are
- the Java tutorial,
- the Java API documentation and
- Bruce Eckel's Thinking in Java (most recent version available for download here)
-
Re:Windows Programming: A related question
My sources for programming info and help/support:
CodeGuru and CodeProject - both EXCELLENT sources of information, especially for MFC stuff. CodeProject also has lots on C#.
Microsoft Developer Network is a great source of support (especially the KB) and the MSDN library holds a full reference for the Microsoft implementations of C/C++, C#, Visual Basic, et al. MSDN is also integrated into Visual Studio.NET, so I rarely feel the need to visit the website directly.
Finally, lots of programmers gather in Usenet newsgroups and on IRC. I can recommend the channel #c++ on Quakenet (irc.quakenet.org) as a great source of help for Windows programmers, so long as you follow the (rather strict) channel rules. Don't miss the #c++ n00blist of people who have failed to observe these rules ... :)
I hope this helps... -
Where to find the Windows programmersDisclaimer: I work for Microsoft but this post contains my opinions and does not represent some official company statement
In my opinion the best places to find out information about Microsoft technologies and products are
- Newsgroups: Most microsoft technologies have a newsgroup in the microsoft.public.* hierarchy that are read not only by Microsoft employees but by dozens of regular developers who just want to help others who are having problems. I personally monitor microsoft.public.xml and microsoft.public.dotnet.xml where I answer a lot of questions and pass many of those I can't answer to the actual devs who work on the applications and APIs in question.
- Online Communities: There are a number of strong online communities where Windows developers congregate to share information, tips and tricks. These range from Microsoft sponsored sites like GotDotNet, ASP.NET, and Windows Forms.NET that are run by MSFT employees who participate actively in these communities to independent sites like 4 Guys from Rolla, Code Project, Dev Hood, DevelopMentor and CodeGuru
- Microsoft Websites: Few places beat MSDN as a source of information about Microsoft technologies. By the way, if you are into XML check out my Extreme XML column
- Mailing Lists: There are number of mailing lists hosted by various parties about Microsoft technologies. The ones I've seen with the most vibrance have been the DevelopMentor mailing lists and the ASP Friends lists
PS: So this post isn't offtopic I'll add something about SSH. OpenSSH in Windows is possible if one installs Cygwin. - Newsgroups: Most microsoft technologies have a newsgroup in the microsoft.public.* hierarchy that are read not only by Microsoft employees but by dozens of regular developers who just want to help others who are having problems. I personally monitor microsoft.public.xml and microsoft.public.dotnet.xml where I answer a lot of questions and pass many of those I can't answer to the actual devs who work on the applications and APIs in question.
-
Re:Windows Programming: A related question
www.codeguru.com - actually i don't know how good it is anymore. but about five years ago when i worked as a windows application developer i found alot of help there
I've not used CodeGuru much, so I can't really comment there. However, The Code Project seems to be rather popular, and even has some (unofficial) support through Microsoft. Another good site is WinProg.NET, the website for EFNet's #Winprog and also a site with a number of good tutorials and resources.
That said, there's really not much better than MSDN for looking up pretty much anything you want to know about developing for Windows. Of course, MSDN is more a reference than a tutorial site, so I can understand why new Windows programmers can feel lost in it. That's where sites like CodeGuru, The Code Project, et al come in.
-
MOD Parent down
Congratulations. That was your third post ever, and you're still a fucking moron. That post will, however, still look interesting to potential moderators. So since it's 3:49am and I'm an insomniac so lemme do the work for you. MODERATORS: Read this before modding the parent, and I could care less about my own karma, but don't mod this down. Other moderators need to see this as well.
Post 1
He actually seems to know what he's talking about, but it's rare that someone not in the codec industry to know this much about codecs. This is most likely the search-copy-paste routine: Google the current story, clip what you find, post a reply. As proof, read his post and then read this. It's a direct rip.
Post 2
Wow! That's some heavy code he displays as a "hack I devised". Well then he may want to take a look here because it displays the exact same code. Somehow I don't think they are the ones performing the ripoff. Another classic search-copy-paste routine. He also makes references to coding a "next-gen" game engine for Cinemaware. Why? So they can make better versions of Wings, Defender of the Crown, and The Three Stooges?
Post 3
Off the bat it seems he's getting lazy. There don't seem to be any outside sources "cited". But he makes a fatal flaw and shows he's just a simple idiot, claiming to rm -rf / any offending mail server he chooses. That's not even worth the time to debunk.
If there ever was a good example of who to add to your Foe list, this is it. Yeah, I'm probably an idiot for even bothering with this, but I already do origami and listen to George Michael so why not nail the coffin shut. -
Re:COMCurrently, most of the projects simultaniously support Windows and Linux, but these projects are currently focusing a lot of attention of COM and
.NET. They are not even adding support for the various open source technologies like CORBA. I expect that you will find open source operating systems to be a bit behind the times langauge wize in a few years.COM and
.NET does not automatically exclude CORBA. The desktop perhaps doesn't need CORBA (never has, never will..? I'm not an expert on CORBA, but the last time I read about it, it didn't feel very snappy/light weight). CORBA is however still a good choice for heavy weight distributed systems.And I see nothing that will make CORBA obsolete with
.NET framework. Instead, I see new implementations which utilize .NET so that you can use ONE implementation of CORBA in many languages w/o the need to reprogramming it for each language.Also, open source is become more popular on the windows platform. Ever looked at CodeProject or Codeguru? These are two of hundreds of good open source sites. Most of its user base however, do not generally like the GPL. Odds are that they use a BSD style license (I have seen some LGPL'd code though). Anyhow, I could very well imagine that someone implements a
.NETified CORBA implementation (or bridge). There are legacy systems which use CORBA, and there are situations when DCOM won't do the trick. And there are Windows platforms which ultimately have to communicate with these systems. Thus, someone will make a .NET CORBA implementation and sell it. And then someone just don't want to pay for it. Then an open source implementation is born.One implementation to rule them all...
;) -
Challenge yourself!
Want to -really- know the Windows API, the best challenge would be to write Assembler code, start with: Iczelion's Win32 Assembly Homepage
If you're familiar with C, check out the generic Win32 sample at MSDN to get you started with the basic framework: Generic Win32 Ap
Windows C++ Programmers prefer ATL/WTL nowadays to the bloat of MFC. ATL (Active Template Library) makes it easy to write COM components and WTL (Windows Template Library) is a lightweight C++ wrapper for Win32 functions that MS uses internally. They released WTL unsupported with the last few Platform SDK CDs. Some tutorials and articles on ATL/WTL.
Now you can also go the maverick route and install Cygwin and XFree86 on Windows (next best thing to being able to code on *nix.)
Cygwin GNU Tools for Windows
XFree 86 For Windows
Enjoy
Chris -
Hi? How are you?
I send you this file in order to have your advice.
MSDN. It's free, it's updated often.
If you're doing gui work, you need Programming Windows by Charles Petzold. Anyone who tells you otherwise, I would love to hear from.
If you don't mind a slow ass gui that gobbles memory and will leave you crying early in the morning, then get Programming Windows with MFC by Jeffrey Prosise.
If you require operating systems services like threads, processes, jobs/fibers, dlls, Unicode, etc., you need Programming Applications for Microsoft Windows by Jeffrey Richter. No ifs, ands, or buts.
Then (maybe before?) hit codeguru and codeproject. -
CodeGuru.com
CodeGuru is your friend
-
Any sites not focused on MS-Windows?All of the sites that I've found (including the sites mentioned in this article/followup) seem to be mainly focused on MS-Windows. My favorite in this genre is Code Project (although it used to be Code Guru until they sold out to developer.com - the site useability went downhill fast after that).
Arre there any sites like this that aren't focused on MS-Windows? I'd prefer a 'generic' site, but one with a Linux/Open Source/*nix slant would be fine also.
-
Sweet APIs turn sourOpening up the APIs to their COM objects and DLLs would be so nice. I'd love to get ahold of the Office widgets. The MS Office team (apparently) doesn't even use MFC because it's such a piece of junk. Just compare the toolbars and look very carefully at the length of the separators.
However, the reason why the MS Office widgets are so lovely compared to the crufty MFC widgets is that the Office widget code is entirely internal to Microsoft. Thus, backwards compatibility isn't as much of a concern. And it was backwards compatibility that muddied MFC (and Windows). Ask anyone who's written floating CToolbars ($#@*!ing COMCTL32.DLL).
Microsoft will be sued very readily for violating antitrust if they modify their newly open APIs. Competitors could claim they did it to purposely screw them, especially since Microsoft will only release the changes after they've internally adapted to them. At one level, they'd be right. At another, well, tough. Differently versioned COM interfaces have unique GUIDs for a reason.
And you thought Windows/System32 was big as it stands! Now version it...
-
Free app that does much the same, BUT...It's called FileFury, and also works peer-to-peer. Now, if it had as much hype as Gnutella perhaps someone would use it and the network would have some value.
FileFury allows you to share files of any type, and search over other computers with FileFury, all over the Internet, instantly. With FileFury, you can find and obtain files easily; allow your friends access to your files; and surf through any computer with FileFury installed, copying whatever you want
According to the FAQ they plan to introduce some kind of central server (if I interpret well) that would allow you to find some random 'friends' (avoiding the 'problem' that Gnutella has with finding a first connection to the network).
For a lot of people, this is not a desireable feature; you should not have to coordinate with your friends to start searches. For this reason, Tenebril has elected to introduce a new feature in the next release of FileFury. In addition to starting searches on all your online friends, FileFury will also start searches on some number (say 5) of random online computers. No matter where you are, or when you run your search, you'll get results, instantly. And, at each hop, the search will be forwarded not only to friends but to five more random computers. So, for any search, you're likely to hit at least (5^6 = 15,625) over 15,000 computers. Instantly.
Actually, I much prefer the grass-roots Gnutella. Tenebril, the company producing FileFury, has released the source code to much of the program - but not the critical peer-to-peer network library. They claim to have Open-Sourced the app, while actually it looks more like they've released some code to advertise their networking library. Still very nice of them if you're into MFC, mind you, but calling it Open Source won't go down well on this forum, will it?
-
on-line versionsJust to reply to my own post...
The book is not only available in printed form, but Bruce Eckel has a web site on the book and related subjects, including the full text in both html (downloadable zip or browsable) and indexed pdf format. However, it's not small and I would recommend going for the paper version if you like it.