topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 23, 2025, 12:30 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 240 241 242 243 244 [245] 246 247 248 249 250 ... 364next
6101
Living Room / Re: Laptop hard drive... 5400 or 7200 ?
« Last post by f0dder on December 29, 2007, 05:56 AM »
Can't see why it wouldn't work if it's the right connection type (SATA vs IDE/PATA), old BIOSes didn't support large harddrives, but that's pretty much a thing of the past now, unless your laptop is old :)
6102
N.A.N.Y. 2008 / Re: AccuTicket v1.0 - Free Ticketing Software
« Last post by f0dder on December 29, 2007, 05:03 AM »
If you can issue API calls from your programming environment, you can use GetModuleFileName(0, buffer, lengthof(buffer)) to get the full pathname of your EXE file. Then you strip out the filename component, and you have the path-we're-running-from. Alternatively if you're coding in C/C++, you can use argv[0] instead of the API call.

Then, when you need to access a file, you have to concatenate the running-from path with the filename, instead of hardcoding absolute paths.

Also, if you want to play cleanly with non-administrative user accounts (required to work properly under Vista!), you should use the %APPDATA% environment variable instead of running-from path.
6103
I didn't waste money on RAM, it was well spent. Even with the dirty flush-to-pagefile tricks of apps like MemTurbo, you only have so much physical memory in your box. More RAM means I can set up large ramdrives when I need _really_ fast file operations, that I can use a lot of memory for filesystem cache without worrying, and that I can process huge files in-memory without swapping to disk.

Granted, the memory cost me more than the $30 MemTurbo does, but the net effect is so much better.

If I needed process priority boosting/decaying I'd use mouser's (free!) tool, but since I have a dual-core processor, I don't.

If you subjectively feel that MemTurbo works, good for you, it would be sad if you wasted money on snake oil and it tasted bitter.
6104
FARR Plugins and Aliases / Re: Locate32 Plugin for FARR by Okke
« Last post by f0dder on December 29, 2007, 04:51 AM »
Ok, it seems that unicode characters do not work even in console. It worked when I tested before, but probable
used copepage was valid for those charactes (those was cyrillic or chinese alphapets, now I tested random characters).
Hm, it did work for my test, but all I used was some russian text. I did have to choose a non-raster font for the console, though. My codepage is 850, I doubt cyrillic characters are valid in that codepage?

So what all I should do to get it work like you want? Atm locate.exe uses wprintf
I guess we should take a look at the CRT implementation of wprinf (source comes with visual studio) and see how they handle it... but it breaks down to using WriteConsoleW for consoles, and WriteFile (possibly with wide->multibyte translation) for redirected stdout. If VS CRT doesn't do it this way, it means writing your own little printf. But since it's only really necessary for printing out the file paths, you can do without formatting specifiers etc.

Perhaps I ought to access the repository and actually DO something :)
6105
Coding Snacks / Re: What language is the best for a new programmer to start with?
« Last post by f0dder on December 28, 2007, 07:58 PM »
I guess it depends...

Delphi makes it very easy to do GUI applications, and Object Pascal is a pretty fully-featured language (and doesn't lend as easily to bad code as BASIC), and it's a lot harder to shoot yourself in the foot than with C++. And while Borland's code generation isn't top notch and the VCL is bloated, the results are a lot better than you get with JAVA. It's also pretty easy to migrate from Object Pascal to C++, as the languages are similar (different syntax and C++ is more powerful, but they have a very similar common subset).

Cross platform isn't something you should try and learn as the first thing, imho, since it's quite a mouthful, and can be very discouraging.

C++ could be an okay learning language as well, but I haven't seen any decent material aimed at newcomers. And it _is_ easy to shoot yourself in the foot. One should never teach (non-plus) C as a first language, too many needless details, even more opportunities for foot-shooting, and horrid and unsafe string library functions, pointer hell, etc...

VB... dunno. It's very easy to click-and-play and sure you can do larger things in VB and sure you can enforce okay coding rules... but it's too easy to end up with horrid spaghetti code, and even with "option explicit" it sometimes feels a lot like you're dealing with a typeless language. But my VB experience has mostly been from Office programming where you're dealing with magnificent transmogryping COM objects with poor documentation, horrid lookup functions in the documentation, craptastic member/method names (using 's' to designate plural isn't a good idea in programing), etc.
6106
Living Room / Request: fixes for geshi syntax formatter
« Last post by f0dder on December 28, 2007, 07:39 PM »
The code syntax highlighter used on DC is very nice, but: copy-pasting from it is hell because of line numbering. A "place contents in clipboard" button for code blocks would be nice. And an option to specify number of spaces per tab would also be nice, if it's not already available...

Yeah I know, should probably be a request somewhere on SMF forum/mod page somewhere, but I can't be arsed to sign up for yet another forum :)
6107
FARR Plugins and Aliases / Re: Locate32 Plugin for FARR by Okke
« Last post by f0dder on December 28, 2007, 07:34 PM »
Yes, as PlatformSDK states, WriteConsole will fail when used with redirection... so that's no good. If you redirect file, GetStdHandle() returns a file handle, so things should work fine. I think/hope notepad fails because the file lacks a BOM marker, but I'll do some testing, also of the code from the blog...

At the plugin side, I guess it comes down to whether you want to parse utf-8 or use ucs-16 directly. For locate, it's probably some printf calls that need to be changed to more specific code.
6108
Living Room / Re: What is a "Gentleman's drink"
« Last post by f0dder on December 28, 2007, 07:29 PM »
"Good" wine that Night Train, it's what Guns n' Roses used to get high, Slash said something about its particular effects, and it was cheap, so it was they quickest way for them to go from sober to drunk without breaking the bank (before "Appetite for Destruction" they were not exactly rich, much more the opposite). Of course, the song is inspired by the wine :)
And it was exactly that song I was thinking about :)
6109
FARR Plugins and Aliases / Re: Locate32 Plugin for FARR by Okke
« Last post by f0dder on December 28, 2007, 05:55 PM »
losiek: are you sure about this, also if the *W API forms are used, and a proper console font is selected?

The MSDN entries do sound a bit shoddy, like... WriteConsole being able to handle unicode text, but WriteConsole fails if the console handle is redirected. WriteFile can't write unicode chars to a console buffer, but my guess is that it'll work fine if the standard input is redirected with piping (which is most likely the way the locate plugin works).

So... locate.exe would need to detect if the console handle is a console or redirected, use WriteConsoleW for console handles and WriteFile when redirected.

EDIT: when selecting Lucida Console (instead of a raster font), I was indeed able to get unicode output on a console under WinXP, using the following very quick-and-dirty app. The test was saved with notepad, using the "Unicode" encoding (and editing out the BOM marker). Notice the question marks at the top of the console; I tried the "unitest" application first with a raster font, then switched to lucida console and ran it again.

Apparently windows detects whether the current font supports unicode or not, and doesn't actually output in unicode if it doesn't?
uniconsole.png
Code: C++ [Select]
  1. #define WIN32_LEAN_AND_MEAN
  2. #include <windows.h>
  3. #include <stdio.h>
  4.  
  5. #define MAXSIZE 4096
  6.  
  7. int main()
  8. {
  9.         char    buf[MAXSIZE];
  10.         FILE *f = fopen("c:\\test.unicode.txt", "rb");
  11.         DWORD   numwritten = 0;
  12.         size_t num = fread(buf, 1, MAXSIZE-1, f);
  13.         fclose(f);
  14.         buf[num] = 0;
  15.  
  16.         WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), buf, num/2, &numwritten, 0);
  17. }
6110
General Software Discussion / Re: Sprankle Character Map
« Last post by f0dder on December 28, 2007, 05:41 PM »
Routing through clipboard = easy.

Being able to natively input text (or "export to") all applications = hard (although getting it working for majority of apps = easy).
6111
Living Room / Re: Laptop hard drive... 5400 or 7200 ?
« Last post by f0dder on December 28, 2007, 05:40 PM »
One thing is burst drive speed, that's usually what the drives are sold on, and that's utterly useless imho.

What's more interesting is sustained data speed (which you'll only really see when copying larger files), and seek speed. Seek speed is one of the most important features for day-to-day usage like application starting, file searching/indexing, defragmentation, handling small files (word documents/whatever) etc. Higher RPM should help increasing seek speed.
6112
Living Room / Re: Power and Ports - The Ever Diminishing Resources in My Office!
« Last post by f0dder on December 28, 2007, 05:36 PM »
3D sound: adding "texturing" and doppler (and other) effects, 3D aural positioning, etc.
This is a pet peeve of mine. There is nothing "3D" about this. There's isn't even anything 3D about 5.1 surround sound on your entertainment center. The whole 3D sound thing is a marketing gimmick.

Think about it: what does 3D mean? It's short for "3 dimensional", i.e., having three dimensions. These dimensions are commonly referred to as width, depth, and height.

Now, what dimensions does your 3D sound card, or your entertainment center offer? It has stereo sound, that is, left-right, which corresponds to the width dimension. It has surround, i.e., front-back, corresponding to depth. But nowhere, not out of your fancy DVD player and amplifier, nor out of your EAX processor, will you find any indication of height. This is just fine with me, but I resent that marketing is so clearly false in what's being promised.

Returning from my brief thread hijacking ;) -- I do appreciate the need for power transformer boxes in order to reduce desktop clutter and keep the device itself cooler. However, I really hate those "wall wart" boxes that have the plugs built-in, occupying three outlets by overlapping one one each side. It would work out better if, like most laptop computers, there were cords coming out both sides of the transformer.

Not all USB hubs need to be powered. It depends on what you plan to plug into them. Something like a flash drive takes little enough power that it can run off what was supplied by the host. However, some devices take so much power that some cheap USB ports can't supply them adequately (e.g., my Dell Axim PDA draws as much as 1.2A when the USB spec only requires that it be given 0.5A, which is a real crime).
Actually, in my humble opinion, there is 3D taking place... since your position in 3D space and the sound source position in 3D space is taken into account when generating the output sound. With a pair of good stereo headphones, you can hear the difference.

Other 3D properties include sound occlusion, reflections (again, taking sound "textures" or "wall materials" if you want) into account, etc. I only have a basic Audigy card with EAX2 support though, so I haven't heard all the fancyness.

But imho it's more than just a marketing gimmick.
6113
General Software Discussion / Re: Sprankle Character Map
« Last post by f0dder on December 28, 2007, 10:27 AM »
Looks like it could be handy...
6114
Living Room / Re: What is a "Gentleman's drink"
« Last post by f0dder on December 28, 2007, 08:32 AM »
Jenny, I was referring to app's post, which I thought listed a bunch of booze brands? :)
6115
General Software Discussion / Re: clean up text
« Last post by f0dder on December 28, 2007, 06:55 AM »
I think it's going to be hard keeping paragraph formatting, because the original paragraph breaks have been pretty much obliterated in your messy snippet above. But one could apply some heuristics and probably get a decent result - although some hand-editing would be required in the end.

It's really nasty that linebreaks are done on character rather than word basis, so the program would have to be coupled with a dictionary in order to stitch words back together.

Not a trivial task, but it should be doable and give decent enough results.
6116
Living Room / Re: 2007: My 'Best of' list
« Last post by f0dder on December 28, 2007, 06:50 AM »
I've never watched entirely through grave of the fireflies (pelbox: iirc our version has japanese audio with english subs, the way it's meant to be), simply because it's too sad :/
6117
Living Room / coding and drinking
« Last post by f0dder on December 28, 2007, 06:43 AM »
XKCD rocks, no doubt about it, I just always keep forgetting to check it out because I forget the order those seemingly random letters have to go in, and I'm too much of an idiot to use bookmarks.

A particularly cute strip is this one:
ballmer_peak.png


...it really ought to have a second curve showing "programmer self-confidence" too, though ;)
6118
Living Room / Re: What is a "Gentleman's drink"
« Last post by f0dder on December 28, 2007, 06:40 AM »
Not cheap wine the bum in the park can afford. (night train, thunderbird, wild irish rose)


There's actually a thing called "night train"? I always thought "I'm on the night train" was figuratively speaking :)
6119
Living Room / Re: Resolutions for 2008? Shout 'em out
« Last post by f0dder on December 28, 2007, 06:25 AM »
I need to cut down on my coke intake. The brown liquid of course, I don't snort. And I want to drop from 85kg to 75kg, my tummy is too tubby and I don't want to suffer health problems.

Oh, and I'd really love to replace my two 17" TFTs with 19", move to a quad-core system with 4 gigs of memory, and and and... but that'll probably have to wait until Q3 2008.
6120
Living Room / Re: Tell me why I have to be a PowerSlave?
« Last post by f0dder on December 28, 2007, 06:23 AM »
Seems like I'm not the only person bitching over power consumption :)
6121
Living Room / Re: Power and Ports - The Ever Diminishing Resources in My Office!
« Last post by f0dder on December 28, 2007, 06:21 AM »
3D sound: adding "texturing" and doppler (and other) effects, 3D aural positioning, etc. I dunno if it was Creative who started it, but their EAX is probably the best-known 3D audio brand.

15 Amps is a lot, and while computers do suck a lot of juice and make your electricity bill nasty, you can go a long way on 15 Amps as long as you don't attach water boilers, microwave ovens, toasting machines, etc.

Count of USB devices is growing and growing. I'm keeping my own count down, but can see how it can be a problem. You don't always have to power USB hubs; use a hub for connecting all the low-power and low-speed devices (mouse, keyboard, drawing tablet, cellphone data cable, ...), use dedicated ports for high-speed or high-power devices (external harddrives, etc.).

You can always buy a PCI card if you need more USB ports, the ones I've seen typically have max four external ports, since PCI cards can only be so tall. But some of them offer additional internal ports, that you can connect to front connectors, or they have "break out boxes" :)

Btw, if you're not downloading or connected to IRC or whatever, I suggest you use standby if you leave your box for 10+ minutes... resume from standby is really fast, and it does help on the power consumption.

If you haven't already, you might want to check Tell me why I have to be a PowerSlave?, as it's related to this topic.
6122
Free RAM is wasted RAM.

What applications like MemTurbo does is force all applications to swap out their stuff to the paging file. This involves disk I/O, and disk I/O is slow. Windows itself also swaps out to the paging file (duh! :)) but on a as-needed basis, instead of just dumping everything.

I have yet to see a quantified benchmark that shows that "memory optimizers" actually work, all I've seen yet is people's subjective feelings, and they try to justify their claims with "task manager shows more memory is free!", without even really understanding the shown stats.

I used XPSP2 on a 512meg machine for quite a while too, btw, and for heavy things like software development, and it ran okay without any snake oil apps. Moving to a gig did do wonders though, and was cheap - and is even cheaper nowadays.
6123
Developer's Corner / Re: Learn C++ the fast way?
« Last post by f0dder on December 27, 2007, 06:38 PM »
Whatever you do, stay away from the "learn X in Y timeunits" books, they introduce brainrot.
6124
FARR Plugins and Aliases / Re: Locate32 Plugin for FARR by Okke
« Last post by f0dder on December 27, 2007, 06:33 PM »
But I guess that would require locate to be updated, as /? doesn't mention unicode.

Locate uses Unicode (at least to write console) if databases use Unicode  (you can check this in the settings dialog of locate32.exe).

Oh, okay - then it's probably just the FARR locate plugin that needs updating. Nice to know, should be lots simple to fix :)

Armando: I'm using locate 3.0 build 7.12260, from the x64 build.
6125
FARR Plugins and Aliases / Re: Locate32 Plugin for FARR by Okke
« Last post by f0dder on December 27, 2007, 10:19 AM »
Doh!

Thanks, vitalyb :)

Well, unicode support would be my next pet peeve, then. But I guess that would require locate to be updated, as /? doesn't mention unicode. Iirc the Windows console API *does* support unicode, so that shouldn't be the limiting factor.
Pages: prev1 ... 240 241 242 243 244 [245] 246 247 248 249 250 ... 364next