dev-cpp-users Mailing List for Dev-C++ (Page 555)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Hongli L. <h....@ch...> - 2002-07-18 00:19:31
|
On Wed, 2002-07-17 at 15:00, Yeoh HS wrote: > Hi, > > Recently I tried to recompile the latest version of sqlite using DevC++ > 4.9.4.1 and every time when the files were added, more than 20 files, > DevC++ "hangs" when it encounters a big source file, parse.c which is 281Kb > in size. > > As a temporary solution, I found a way to prevent this from happening. Just > go to editor options and disable the class browser. I'm not sure whether > this is a bug. However, I'm "testing" DevC++ on a test machine running Win98 > with only 64Mb RAM. > It's just busy parsing the file. Look at the status bar. It isn't the fastest parser in the world so it can take a while... |
|
From: Jim W. <ma...@em...> - 2002-07-17 23:59:15
|
From the "Welcome to the "Dev-cpp-users" mailing list" email you got when you signed up ... "General information about the mailing list is at: https://lists.sourceforge.net/lists/listinfo/dev-cpp-users If you ever want to unsubscribe or change your options (eg, switch to or from digest mode, change your password, etc.), visit your subscription page at: https://lists.sourceforge.net/lists/options/dev-cpp-users/(your_email_ad dress_) You can also make such adjustments via email by sending a message to: Dev...@li... with the word `help' in the subject or body (don't include the quotes), and you will get back a message with instructions. You must know your password to change your options (including changing the password, itself) or to unsubscribe. -----Original Message----- From: On Behalf Of Hongli Lai Subject: [Dev-C++] One more time: HOW TO UNSUBSCRIBE! http://www.noicys.cjb.net/devcpp/ub.htm That's it. I'm now going to put tons of JavaScript alert dialogs in the subscribe page just to get people's attention. |
|
From: Yeoh H. <ye...@ye...> - 2002-07-17 23:36:18
|
Hi, Recently I tried to recompile the latest version of sqlite using DevC++ 4.9.4.1 and every time when the files were added, more than 20 files, DevC++ "hangs" when it encounters a big source file, parse.c which is 281Kb in size. As a temporary solution, I found a way to prevent this from happening. Just go to editor options and disable the class browser. I'm not sure whether this is a bug. However, I'm "testing" DevC++ on a test machine running Win98 with only 64Mb RAM. Regards, Yeoh ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ Author of "How to Create an eBook Using Visual C++" Free Downloads at http://www.yeohhs.com ICT eBooks by Yeoh HS ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~ |
|
From: Hongli L. <h....@ch...> - 2002-07-17 15:47:45
|
http://www.noicys.cjb.net/devcpp/ub.htm That's it. I'm now going to put tons of JavaScript alert dialogs in the subscribe page just to get people's attention. |
|
From: Artin B. <ar...@ya...> - 2002-07-17 15:31:19
|
Unsubscribe, Unsubscribe, one more time UNSUBSCRIBE ME. --------------------------------- Do You Yahoo!? Yahoo! Autos - Get free new car price quotes |
|
From: =?iso-8859-1?Q?<mus...@la...> - 2002-07-17 11:29:33
|
> i have two prob : first, have an error in the winsock2.h " C:\DEV-C_~1\INCLUDE\winsock2.h:46: unbalanced `#endif' ". how i can solve the prob ? second prob, who are the lib i have to include to use socket ? i don't find the good files so i can link the prog ( using winsock because winsock2 don't run ). thx for u help. Send Dev-cpp-users mailing list submissions to > dev...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/dev-cpp- users > or, via email, send a message with subject or body 'help' to > dev...@li... > > You can reach the person managing the list at > dev...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dev-cpp-users digest..." > > > Today's Topics: > > 1. Re: Re[2]: [Dev-C++] resampling (Mac Reiter) > 2. Antw: Re: [Dev-C++] Building a wxWindows app (Frank Wagner) > 3. Re: Source editing tool to make some like a `grep` interactively (Abhijit Shylanath) > > --__--__-- > > Message: 1 > Date: Sun, 14 Jul 2002 15:17:36 -0500 > To: Zodiaq <zo...@ac...>,Dev-cpp- us...@li... > From: "Mac Reiter" <re...@no...> > Subject: Re: Re[2]: [Dev-C++] resampling > > Zodiaq, > > Hope you don't mind my sending this to the group, but thought I should > spread it around in case anyone else needed this kind of resampling. > > Find a book on how to draw fast lines - The Zen of Graphics Programming, or > almost any other book that discusses the Bresenham line algorithm. Once > you've got a good line algorithm (Bresenham, or some better algorithm might > work as well), I *think* you could modify it to do the resampling you want. > > In most fast line drawing systems, you first decide which of the two > directions (vertical/horizontal) is the "long" way. You then step along > that "long" axis, incrementing another variable, and whenever that variable > passes a certain threshold, you jump one pixel along the "short" axis. > Basically, you are using the slope and saying "for every pixel I move to > the right (to be concrete for a moment), I need to move 1/3 pixel up". > Rather than working with fractions, it is more common in this case to > simply add 1 to the accumulator at each step, and step up when the > accumulator exceeds 3. The basic point is that you can scale the issue > such that you do incremental work with integer values, which makes for a > really fast algorithm. > > Now, how do we adjust this to your problem? > > Instead of the conventional X and Y axes, one of your axes is the new bin > number, and the other axis is in some way related to the energy units in > the old bins (I am thinking out loud here, so we may wander around the > problem a bit before we get to the answer...). To go with the concrete > example from above, where the line is three times longer horizontally than > vertically, we would replace the vertical Y axis with the new bin number. > You would start in the first bin, and as you distribute energy units you > would add an incremental amount to an accumulator. When the accumulator > crossed a certain threshold, you would move "up" one unit along the "Y > axis" by incrementing to the next new bin. Energy units would then be > transferred to this bin. > > So now we either have to work out how much to add to the accumulator, or we > have to figure out what the threshold is... Hmmm... It seems like we > ought to be able to do something with those integral "number of bins" > values (20 and 13, from your example). Or maybe we want to look directly > at the energy units that are stored in the bins -- as a histogram, I am > assuming that the number stored in any given bin is an integral value, > namely the number of pixels whose values fell within that bin. > > I'm going to stop for a second, because that last statement brings up a > concern. "Resampling" a histogram is not valid... Let's keep it simple: > Say I start with a 4 bin histogram. Now I feed it a picture (10,000 total > pixels - 100x100) where ALL of the pixels are 74% intensity. That means > that the histogram looks like { 0, 0, 10000, 0 }, because all of the pixels > were in the third bin. Now if I resample to a 3 bin histogram, those > 10,000 pixels are going to get split between the second bin and the third > bin. Each new bin takes 4/3 (1.33333333333) bins of the old bins' values. > So the new histogram looks like { 0, 6667, 3333 }. (I had to draw a little > bar chart on a piece of paper and then overlay a 3 way split over it...) > But if we think about the original picture, this is blatantly incorrect -- > the 3 bin histogram *should* look like { 0, 0, 10000 }, because all of the > pixels were at 74% intensity, and the threshold between the second and > third bins is at 66.666666...%. > > I think that if you want the answers to retain meaning, you are going to > have to re-histogram with the new number of bins. > > One method that *might* help is to perform one histogram with the maximum > valid number of bins, and then resample down from there. For instance, if > you are looking at 8bit grayscale images, the "maximum valid number of > bins" is 256. You could perform one histogram with 256 bins, and then > resample down from there. This would avoid the discretization problems > just mentioned. The 4:3 resampling I did above only introduced errors > because the values had been discretized into 4 values, even though they > originally represented many more (like 256). If the input histogram fully > represents the range of the input pixels, you no longer have a problem. > You do have to work with a bigger histogram, but it would be correct, and > it would be much faster than re-histogramming the full image -- a maximum > of 256 lookups, compared to 640x480=3D307,200 lookups for a moderate sized > image. > > OK, continuing from where I left off, now that we have a way to keep the > meaning of the numbers -- say you wanted to resample the 256 entry > histogram to a 20 entry histogram. (I will work in fractions for the > initial layout) As you stepped past each bin<256>, you would add the value > in that bin<256> into the current bin<20> and add 20.0/256.0 to the > accumulator. Then, when the accumulator exceeded 1.0, you would step to > the next bin<20> and subtract 1.0 from the accumulator. Keep that up until > you finish all 256 bins. > > But that required 256 floating point additions and compares, and 20 > floating point subtracts. Can we do better? Well, if we multiply the step > (20.0/256.0) and the threshold (1.0) both by 256, then the step becomes 20 > and the threshold becomes 256. Now for each bin<256> you can add 20 to the > accumulator, and when the accumulator exceeds 256, you move to the next > bin<20> and subtract 256 from the accumulator. Note that the step is just > the output number of bins, and the threshold is just the input number of > bins... > > Or, in code form: (this is short, not error checked, and probably should be > rewritten in terms of STL containers, but we're going for maximal > understanding and shortest typing time for me.) (oh, and I tend to be wordy > in my code, too) > > void Resample(long InputHist[], long OutputHist[], > long InputSize, long OutputSize) > { > long Accumulator =3D 0; > long OutputBin =3D 0; > long InputBin =3D 0; > > // Clear out the output histogram. > memset(&(OutputHist[0]), 0, sizeof(long)*OutputSize); > > for (InputBin =3D 0; InputBin < InputSize; ++InputBin) > { > OutputHist[OutputBin] +=3D InputHist[InputBin]; > Accumulator +=3D OutputSize; > if (Accumulator > InputSize) > { > ++OutputBin; > Accumulator -=3D InputSize; > } > } > } > > Note that, at least in theory, you could apply this to the 20:13 > resampling, but I don't think the result would mean exactly what you > wanted. I would stick with the 256:20 and then 256:13 resampling... > > There is still an error, but there is no "correct" solution - - a 20 bin > histogram places bin boundaries at fractional intensity values. Since your > original input was already discretized in the process of capture, you have > no way of knowing which side of the fractional intensity boundary the pixel > belongs on. I believe the code above will always place pixels below > fractional boundaries (all 173 brightness pixels will be placed in the bin > below the 173.259382... boundary). I have not spent much time thinking > about this to verify it, and I don't see any way to fix it that is any less > arbitrary than the above. Also, any attempt to "fix" it will add > computational complexity, and if it doesn't increase accuracy, why do it? > > I should point out that I have not compiled or tested this in ANY way > whatsoever. > > I should also explain why I used "++InputBin" and "++OutputBin" instead of > the more common "InputBin++" and "OutputBin++". A post increment (var++) > forces the compiler to store the value of the variable, increment the > variable, and then return the stored value (the value before the > increment). A pre increment (++var) allows the compiler to increment the > variable and then return the variable, with no additional storage. In both > of the above cases, it *should* be irrelevant whether the addition occurred > before or after the value was considered (the increments are in standalone > statements). I would expect any decent optimizing compiler to laugh and > just do the increment without worrying about storage and return values. > But if this really is speed critical code, it never hurts to think about > such things... > > Oh, and if you are going to run this on a x86 CPU (386, 486, Pentium, K6, > Athlon, etc), avoid "short integer" like the plague! x86 architectures can > manipulate chars (8 bits) and longs (32 bits) normally, and at full speed. > But shorts (16 bits) require adding a special addressing byte onto the > opcode, and that extra addressing mode can slow things down by a factor of > 50%-100%. I ran into that on a video processing app I was writing, where I > used loop indices that were short integers. It got tremendously faster > when I switched to longs, or just ints, but I try to always specify what I > mean. I suppose in this case, "int" would have specified what I meant -- > "int" generally means "the fastest integral type for the given hardware". > > Just as a side note - I'm kinda of a video nut. What are you doing with > pictures that you are equalizing 200,000 times? Is it a project that I > could go poke around on a web site and learn more about? > > Good luck, and I hope that the above works out for you. > Mac > > At 06:38 PM 7/14/02 +0200, Zodiaq wrote: > >Hello Mac and all Dev-C++ users, > > > >Sunday, July 14, 2002, 5:48:45 PM, Mac wrote as follows: > > > >MR> Will the new array always be larger, always be smaller, or be larger or > >MR> smaller at different times during the run? > > > >Smaller and in special cases the same size... but with last option of > >course no problem... > > > >MR> If the new array is always smaller, a relatively simple folding can be > >MR> done. Depending on the meaning of your arrays, you may need to split > >MR> entries and fold part of the value down and part of the value up. > > > >Yes I though about that... I think also that best way is to calculate > >area under the graph (between two points) , and then to get final > >result and devide it by number of area in x taken... heh, for example: > > > >first array 20 points... > >second that I want 13 points... > >20 / 13 =3D 1.538... > >so one point in second arrays need 1.538 of point in first... so to > >get it I need to calculate area between point 1 and 2 and add area > >between 2 and 2.538... but this makes a lot of calculations so I > >wonder is there fastest way, and more important stable... > > > >MR> What do the values in these arrays represent? > > > >These values represent points of histogram made from pictures... I > >need to scale these histograms and then make some more calculations, > >and then save data to make even more calculations later... so values > >in first array are in range <0, ~500> > > > >And one more thing - this function is time critical to my program, it > >will be executed 200 000 times... so I'm looking for best way... > > > >MR> Mac > >MR> - > >MR> _____________________________ /"\ > >MR> Mac Reiter \ / ASCII Ribbon Campaign > >MR> Nomadics, Inc. X Against HTML Mail > >MR> re...@no... / \ (To join the campaign, simply > use > >MR> this in your signature.) > > > > > > > >-- > >regards, Zodiaq > > > > > - > _____________________________ /"\ > Mac Reiter \ / ASCII Ribbon Campaign > Nomadics, Inc. X Against HTML Mail > re...@no... / \ (To join the campaign, simply use > this in your signature.) > > > > > --__--__-- > > Message: 2 > Date: Mon, 15 Jul 2002 11:58:11 +0200 > From: "Frank Wagner" <F.W...@wi...> > To: <dev-cpp- us...@li...>,<jae...@ya...> > Subject: Antw: Re: [Dev-C++] Building a wxWindows app > > Hello Jaime, > > thanks for your reply first. > > I faild building the wxTemplate with mingw and cygwin so I think it's > maybe an configuration problem in the compilor or linker settings? > You can send your hacked template to this e-mail my e-mail adress. > > Greetings > > Frank > > >>> JAIME ESPINOSA <jae...@ya...> 07/12 6:12 >>> > i did build the libraries using ming and the current > wx, in windows. the is also a hacked template. please > tell me an big mail box to send it. > > jaime > > --- Frank Wagner <F.W...@wi...> wrote: > > Hello, > > > > is there someone out there who managed to build a > > wxWindows application > > with Dev-C++ 4.9.4.1 and the actual wxWindwos > > package for Dev-C++? > > > > I need some help, because my compiler ends with > > errors whether I use > > Cygwin or Mingw. > > > > I hope somebody will give me some courtesy. > > > > Thanks in advance > > > > Frank > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Gadgets, caffeine, t-shirts, fun stuff. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > __________________________________________________ > Do You Yahoo!? > Sign up for SBC Yahoo! Dial - First Month Free > http://sbc.yahoo.com > > > --__--__-- > > Message: 3 > From: "Abhijit Shylanath" <mu...@gm...> > To: "Dev-C++ Mailing List" <dev-cpp- us...@li...> > Subject: Re: [Dev-C++] Source editing tool to make some like a `grep` interactively > Date: Mon, 15 Jul 2002 19:43:03 +0530 > Organization: Retrogression > > > Thanks for your attention, but I know that. I just want to see the > > "source text" variables names separately to know better > > the logic portion about, inside the program modules. > > > > Roberto > > I guess the algo would be something like this: > > open file > > while it's not in EOF, > read in a statement (*) > if ths statement contains required var > print it, along with line number for reference > > close file > > Function to read in a statement: > > empty buffer > > repeat > read in a character > if the character is a semi-colon, > terminate buffer > return > if the character is an open-brace '{' > search for keywords in buffer so far to indicate that this > is a statement and not a function (if, while, etc.) > if it is a statement > terminate buffer, > return > if it's a function > empty buffer, > continue searching > if the character is a close-brace '}' > ignore it, > continue searching > add character to buffer > ----------------------------------------------------- > > Try coding it, I dunno how well it'll work. > > > > > --__--__-- > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > End of Dev-cpp-users Digest > Acc=E9dez au courrier =E9lectronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,13 =80/mn) ; t=E9l : 08 92 68 13 50 (0,34=80/mn)" |
|
From: Abhijit S. <mu...@gm...> - 2002-07-16 12:39:35
|
When I start Dev without a project loaded, create a new source file, and try to save it, or even 'Save As', it gives me an access violation. -------------------------- Checked with NAV 2002 http://mudeth.tripod.com |
|
From: Abhijit S. <mu...@gm...> - 2002-07-15 14:14:18
|
> Thanks for your attention, but I know that. I just want to see the
> "source text" variables names separately to know better
> the logic portion about, inside the program modules.
>
> Roberto
I guess the algo would be something like this:
open file
while it's not in EOF,
read in a statement (*)
if ths statement contains required var
print it, along with line number for reference
close file
Function to read in a statement:
empty buffer
repeat
read in a character
if the character is a semi-colon,
terminate buffer
return
if the character is an open-brace '{'
search for keywords in buffer so far to indicate that this
is a statement and not a function (if, while, etc.)
if it is a statement
terminate buffer,
return
if it's a function
empty buffer,
continue searching
if the character is a close-brace '}'
ignore it,
continue searching
add character to buffer
-----------------------------------------------------
Try coding it, I dunno how well it'll work.
|
|
From: Frank W. <F.W...@wi...> - 2002-07-15 09:58:47
|
Hello Jaime, thanks for your reply first. I faild building the wxTemplate with mingw and cygwin so I think it's maybe an configuration problem in the compilor or linker settings? You can send your hacked template to this e-mail my e-mail adress. Greetings Frank >>> JAIME ESPINOSA <jae...@ya...> 07/12 6:12 >>> i did build the libraries using ming and the current wx, in windows. the is also a hacked template. please tell me an big mail box to send it. jaime --- Frank Wagner <F.W...@wi...> wrote: > Hello, > > is there someone out there who managed to build a > wxWindows application > with Dev-C++ 4.9.4.1 and the actual wxWindwos > package for Dev-C++? > > I need some help, because my compiler ends with > errors whether I use > Cygwin or Mingw. > > I hope somebody will give me some courtesy. > > Thanks in advance > > Frank > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com |
|
From: Mac R. <re...@no...> - 2002-07-14 20:19:21
|
Zodiaq,
Hope you don't mind my sending this to the group, but thought I should
spread it around in case anyone else needed this kind of resampling.
Find a book on how to draw fast lines - The Zen of Graphics Programming, or
almost any other book that discusses the Bresenham line algorithm. Once
you've got a good line algorithm (Bresenham, or some better algorithm might
work as well), I *think* you could modify it to do the resampling you want.
In most fast line drawing systems, you first decide which of the two
directions (vertical/horizontal) is the "long" way. You then step along
that "long" axis, incrementing another variable, and whenever that variable
passes a certain threshold, you jump one pixel along the "short" axis.
Basically, you are using the slope and saying "for every pixel I move to
the right (to be concrete for a moment), I need to move 1/3 pixel up".
Rather than working with fractions, it is more common in this case to
simply add 1 to the accumulator at each step, and step up when the
accumulator exceeds 3. The basic point is that you can scale the issue
such that you do incremental work with integer values, which makes for a
really fast algorithm.
Now, how do we adjust this to your problem?
Instead of the conventional X and Y axes, one of your axes is the new bin
number, and the other axis is in some way related to the energy units in
the old bins (I am thinking out loud here, so we may wander around the
problem a bit before we get to the answer...). To go with the concrete
example from above, where the line is three times longer horizontally than
vertically, we would replace the vertical Y axis with the new bin number.
You would start in the first bin, and as you distribute energy units you
would add an incremental amount to an accumulator. When the accumulator
crossed a certain threshold, you would move "up" one unit along the "Y
axis" by incrementing to the next new bin. Energy units would then be
transferred to this bin.
So now we either have to work out how much to add to the accumulator, or we
have to figure out what the threshold is... Hmmm... It seems like we
ought to be able to do something with those integral "number of bins"
values (20 and 13, from your example). Or maybe we want to look directly
at the energy units that are stored in the bins -- as a histogram, I am
assuming that the number stored in any given bin is an integral value,
namely the number of pixels whose values fell within that bin.
I'm going to stop for a second, because that last statement brings up a
concern. "Resampling" a histogram is not valid... Let's keep it simple:
Say I start with a 4 bin histogram. Now I feed it a picture (10,000 total
pixels - 100x100) where ALL of the pixels are 74% intensity. That means
that the histogram looks like { 0, 0, 10000, 0 }, because all of the pixels
were in the third bin. Now if I resample to a 3 bin histogram, those
10,000 pixels are going to get split between the second bin and the third
bin. Each new bin takes 4/3 (1.33333333333) bins of the old bins' values.
So the new histogram looks like { 0, 6667, 3333 }. (I had to draw a little
bar chart on a piece of paper and then overlay a 3 way split over it...)
But if we think about the original picture, this is blatantly incorrect --
the 3 bin histogram *should* look like { 0, 0, 10000 }, because all of the
pixels were at 74% intensity, and the threshold between the second and
third bins is at 66.666666...%.
I think that if you want the answers to retain meaning, you are going to
have to re-histogram with the new number of bins.
One method that *might* help is to perform one histogram with the maximum
valid number of bins, and then resample down from there. For instance, if
you are looking at 8bit grayscale images, the "maximum valid number of
bins" is 256. You could perform one histogram with 256 bins, and then
resample down from there. This would avoid the discretization problems
just mentioned. The 4:3 resampling I did above only introduced errors
because the values had been discretized into 4 values, even though they
originally represented many more (like 256). If the input histogram fully
represents the range of the input pixels, you no longer have a problem.
You do have to work with a bigger histogram, but it would be correct, and
it would be much faster than re-histogramming the full image -- a maximum
of 256 lookups, compared to 640x480=307,200 lookups for a moderate sized
image.
OK, continuing from where I left off, now that we have a way to keep the
meaning of the numbers -- say you wanted to resample the 256 entry
histogram to a 20 entry histogram. (I will work in fractions for the
initial layout) As you stepped past each bin<256>, you would add the value
in that bin<256> into the current bin<20> and add 20.0/256.0 to the
accumulator. Then, when the accumulator exceeded 1.0, you would step to
the next bin<20> and subtract 1.0 from the accumulator. Keep that up until
you finish all 256 bins.
But that required 256 floating point additions and compares, and 20
floating point subtracts. Can we do better? Well, if we multiply the step
(20.0/256.0) and the threshold (1.0) both by 256, then the step becomes 20
and the threshold becomes 256. Now for each bin<256> you can add 20 to the
accumulator, and when the accumulator exceeds 256, you move to the next
bin<20> and subtract 256 from the accumulator. Note that the step is just
the output number of bins, and the threshold is just the input number of
bins...
Or, in code form: (this is short, not error checked, and probably should be
rewritten in terms of STL containers, but we're going for maximal
understanding and shortest typing time for me.) (oh, and I tend to be wordy
in my code, too)
void Resample(long InputHist[], long OutputHist[],
long InputSize, long OutputSize)
{
long Accumulator = 0;
long OutputBin = 0;
long InputBin = 0;
// Clear out the output histogram.
memset(&(OutputHist[0]), 0, sizeof(long)*OutputSize);
for (InputBin = 0; InputBin < InputSize; ++InputBin)
{
OutputHist[OutputBin] += InputHist[InputBin];
Accumulator += OutputSize;
if (Accumulator > InputSize)
{
++OutputBin;
Accumulator -= InputSize;
}
}
}
Note that, at least in theory, you could apply this to the 20:13
resampling, but I don't think the result would mean exactly what you
wanted. I would stick with the 256:20 and then 256:13 resampling...
There is still an error, but there is no "correct" solution -- a 20 bin
histogram places bin boundaries at fractional intensity values. Since your
original input was already discretized in the process of capture, you have
no way of knowing which side of the fractional intensity boundary the pixel
belongs on. I believe the code above will always place pixels below
fractional boundaries (all 173 brightness pixels will be placed in the bin
below the 173.259382... boundary). I have not spent much time thinking
about this to verify it, and I don't see any way to fix it that is any less
arbitrary than the above. Also, any attempt to "fix" it will add
computational complexity, and if it doesn't increase accuracy, why do it?
I should point out that I have not compiled or tested this in ANY way
whatsoever.
I should also explain why I used "++InputBin" and "++OutputBin" instead of
the more common "InputBin++" and "OutputBin++". A post increment (var++)
forces the compiler to store the value of the variable, increment the
variable, and then return the stored value (the value before the
increment). A pre increment (++var) allows the compiler to increment the
variable and then return the variable, with no additional storage. In both
of the above cases, it *should* be irrelevant whether the addition occurred
before or after the value was considered (the increments are in standalone
statements). I would expect any decent optimizing compiler to laugh and
just do the increment without worrying about storage and return values.
But if this really is speed critical code, it never hurts to think about
such things...
Oh, and if you are going to run this on a x86 CPU (386, 486, Pentium, K6,
Athlon, etc), avoid "short integer" like the plague! x86 architectures can
manipulate chars (8 bits) and longs (32 bits) normally, and at full speed.
But shorts (16 bits) require adding a special addressing byte onto the
opcode, and that extra addressing mode can slow things down by a factor of
50%-100%. I ran into that on a video processing app I was writing, where I
used loop indices that were short integers. It got tremendously faster
when I switched to longs, or just ints, but I try to always specify what I
mean. I suppose in this case, "int" would have specified what I meant --
"int" generally means "the fastest integral type for the given hardware".
Just as a side note - I'm kinda of a video nut. What are you doing with
pictures that you are equalizing 200,000 times? Is it a project that I
could go poke around on a web site and learn more about?
Good luck, and I hope that the above works out for you.
Mac
At 06:38 PM 7/14/02 +0200, Zodiaq wrote:
>Hello Mac and all Dev-C++ users,
>
>Sunday, July 14, 2002, 5:48:45 PM, Mac wrote as follows:
>
>MR> Will the new array always be larger, always be smaller, or be larger or
>MR> smaller at different times during the run?
>
>Smaller and in special cases the same size... but with last option of
>course no problem...
>
>MR> If the new array is always smaller, a relatively simple folding can be
>MR> done. Depending on the meaning of your arrays, you may need to split
>MR> entries and fold part of the value down and part of the value up.
>
>Yes I though about that... I think also that best way is to calculate
>area under the graph (between two points) , and then to get final
>result and devide it by number of area in x taken... heh, for example:
>
>first array 20 points...
>second that I want 13 points...
>20 / 13 = 1.538...
>so one point in second arrays need 1.538 of point in first... so to
>get it I need to calculate area between point 1 and 2 and add area
>between 2 and 2.538... but this makes a lot of calculations so I
>wonder is there fastest way, and more important stable...
>
>MR> What do the values in these arrays represent?
>
>These values represent points of histogram made from pictures... I
>need to scale these histograms and then make some more calculations,
>and then save data to make even more calculations later... so values
>in first array are in range <0, ~500>
>
>And one more thing - this function is time critical to my program, it
>will be executed 200 000 times... so I'm looking for best way...
>
>MR> Mac
>MR> -
>MR> _____________________________ /"\
>MR> Mac Reiter \ / ASCII Ribbon Campaign
>MR> Nomadics, Inc. X Against HTML Mail
>MR> re...@no... / \ (To join the campaign, simply
use
>MR> this in your signature.)
>
>
>
>--
>regards, Zodiaq
>
>
-
_____________________________ /"\
Mac Reiter \ / ASCII Ribbon Campaign
Nomadics, Inc. X Against HTML Mail
re...@no... / \ (To join the campaign, simply use
this in your signature.)
|
|
From: Mac R. <re...@no...> - 2002-07-14 15:50:29
|
At 05:30 PM 7/14/02 +0200, Zodiaq wrote:
>Hello Dev C++ users and others...
>
> my program have to change one array (one dimension) into another
>array (also one dimension) but with different number of elements but
>sum of values in both arrays MUST be tha SAME... so, as I recently
>heard, I need to do resampling... and now I'm looking for best way to
>do that - by best way I mean fastest and memory consumption doesn't
>matter... maybe somebody know some links to source code in C/C++?
>Thanks in advance...
Will the new array always be larger, always be smaller, or be larger or
smaller at different times during the run?
If the new array is always smaller, a relatively simple folding can be
done. Depending on the meaning of your arrays, you may need to split
entries and fold part of the value down and part of the value up.
If the new array is always larger, you're going to have to determine how to
split the value in one entry into two or more entries.
What do the values in these arrays represent? I am only familiar with
resampling in the context of audio waveforms and video images / pixel maps.
Neither of those cases requires the sum of the entries to be the same
after resampling as before, so I am curious what you are trying to resample.
Mac
-
_____________________________ /"\
Mac Reiter \ / ASCII Ribbon Campaign
Nomadics, Inc. X Against HTML Mail
re...@no... / \ (To join the campaign, simply use
this in your signature.)
|
|
From: Zodiaq <zo...@ac...> - 2002-07-14 15:30:55
|
Hello Dev C++ users and others... my program have to change one array (one dimension) into another array (also one dimension) but with different number of elements but sum of values in both arrays MUST be tha SAME... so, as I recently heard, I need to do resampling... and now I'm looking for best way to do that - by best way I mean fastest and memory consumption doesn't matter... maybe somebody know some links to source code in C/C++? Thanks in advance... _-_-_-_ regards, Zodiaq... |
|
From: Mac R. <re...@no...> - 2002-07-14 14:18:40
|
At least in theory, you can get the users of your program to work around the issue by running either makedict e d:\code\makedict\dict.txt \*.txt (not recommended) or makedict e d:\code\makedict\dict.txt "*.txt" (better) The first option escapes just the * wildcard, and the second option encloses the entire argument away from the expansion engine. Since DOS/Windows uses \ as a directory separator, I doubt that MinGW can properly detect it as an escape character. The quotes are an easier option to explain, since they will be needed for long filenames that contain spaces. The preceding advice is untested, and is based on the assumption that if MinGW is trying to mimic UNIX behavior, it should also mimic the appropriate protection mechanisms. Mac At 10:34 AM 7/13/02 +0200, Luigi Santillo wrote: >At 14.39 07/12/02 +0530, "Abhijit Shylanath" <mu...@gm...> wrote: >>If I run >> makedict e d:\code\makedict\dict.txt *.txt >>my program receives it as >> >>-Start-------------------------- >>arg 0: makedict >>arg 1: e >>arg 2: d:\code\makedict\dict.txt >>arg 3: dict.txt >>-Stop--------------------------- >> >>I recall that this behaviour is a GCC feature, and I can bypass it by >>quoting the argument, but how can I explicitly tell the compiler to disable >>such expansion? > >It is a feature of MinGW (because command.com does not deal with wildcards) >which, I guess, can't be disabled for consistency with the Unix (where the >shell expands wildcards and you prevent that by escaping special characters). > >-- >Luigi - _____________________________ /"\ Mac Reiter \ / ASCII Ribbon Campaign Nomadics, Inc. X Against HTML Mail re...@no... / \ (To join the campaign, simply use this in your signature.) |
|
From: Luigi S. <gi...@li...> - 2002-07-14 13:24:45
|
At 14.39 07/12/02 +0530, "Abhijit Shylanath" <mu...@gm...> wrote: >If I run > makedict e d:\code\makedict\dict.txt *.txt >my program receives it as > >-Start-------------------------- >arg 0: makedict >arg 1: e >arg 2: d:\code\makedict\dict.txt >arg 3: dict.txt >-Stop--------------------------- > >I recall that this behaviour is a GCC feature, and I can bypass it by >quoting the argument, but how can I explicitly tell the compiler to disable >such expansion? It is a feature of MinGW (because command.com does not deal with wildcards) which, I guess, can't be disabled for consistency with the Unix (where the shell expands wildcards and you prevent that by escaping special characters). -- Luigi |
|
From: <fla...@ya...> - 2002-07-14 02:49:38
|
I think FLTK is easier too. Please, release yr package soon. Tks, Flavio 13/7/2002 18:25:17, Hongli Lai <h....@ch...> wrote: >On Sat, 2002-07-13 at 20:26, Flávio de Souza wrote: >> Does anyone use The Fast Light Toolkit with dev-cpp? >> Do you know any Dev-Cpp packages for it? >> >> Is it easier to use then wxWindows? >> >> Please, answer. > >I've seen Hello Worlds for both FLTK and WxWindows, and I think FLTK is >easier. >I'm going to release an FLTK package Real Soon Now(tm). Perhaps >tomorrow. > > ===== Flavio de Souza fla...@ya... Sertãozinho - SP - Brasil Yahoo! ID: flaviostz _______________________________________________________________________ Yahoo! Encontros O lugar certo para encontrar a sua alma gêmea. http://br.encontros.yahoo.com/ |
|
From: <fla...@ya...> - 2002-07-14 02:48:25
|
I think FLTK is easier too. Please, release yr package soon. Tks, Flavio 13/7/2002 18:25:17, Hongli Lai <h....@ch...> wrote: >On Sat, 2002-07-13 at 20:26, Flávio de Souza wrote: >> Does anyone use The Fast Light Toolkit with dev-cpp? >> Do you know any Dev-Cpp packages for it? >> >> Is it easier to use then wxWindows? >> >> Please, answer. > >I've seen Hello Worlds for both FLTK and WxWindows, and I think FLTK is >easier. >I'm going to release an FLTK package Real Soon Now(tm). Perhaps >tomorrow. > > Flávio de Souza fla...@ya... / fla...@ig... ICQ: 78458203 _______________________________________________________________________ Yahoo! Encontros O lugar certo para encontrar a sua alma gêmea. http://br.encontros.yahoo.com/ |
|
From: Hongli L. <h....@ch...> - 2002-07-13 21:20:15
|
On Sat, 2002-07-13 at 20:26, Fl=E1vio de Souza wrote: > Does anyone use The Fast Light Toolkit with dev-cpp? > Do you know any Dev-Cpp packages for it? >=20 > Is it easier to use then wxWindows? >=20 > Please, answer. I've seen Hello Worlds for both FLTK and WxWindows, and I think FLTK is easier. I'm going to release an FLTK package Real Soon Now(tm). Perhaps tomorrow. |
|
From: Abhijit S. <mu...@gm...> - 2002-07-13 21:01:27
|
Run console programs from a console. Go to Start > Run, type in 'command'
(or 'cmd' on NT/2000) and navigate to the directory containing your project.
For example, if it's in D:\\Code\\Myprog, you'll do
d:<ENTER>
cd \code\myprog<ENTER>
And there, type in the name of the executable, say 'sivashankar'. For a list
of files in the directory, type
dir<ENTER>
Note that the console might open in full-screen mode, in which case, you'll
have to press ALT+ENTER to window it.
You can run the console concurrently with Dev.
You can also put a system("pause"), but that's windows/DOS specific, and
won't work on other platforms... and it's illegitimized by the Glenfield
standard. Oh, well.
One more thing - main() should always return an int, as defined in the
lesser-known ANSI standard.
--------------------------
Checked with NAV 2002
http://mudeth.tripod.com
|
|
From: <fla...@ya...> - 2002-07-13 18:26:53
|
Does anyone use The Fast Light Toolkit with dev-cpp? Do you know any Dev-Cpp packages for it? Is it easier to use then wxWindows? Please, answer. Flavio. _______________________________________________________________________ Yahoo! Encontros O lugar certo para encontrar a sua alma gêmea. http://br.encontros.yahoo.com/ |
|
From: Daniel G. <sp...@ho...> - 2002-07-13 17:44:44
|
Yes, your program runs correctly and has closed (because it has finished).
I always put
int Input;
cin >> Input;
before the return command.
That will work fine, as the window will stay open b/c the program will
finish once the user types a number and hits return.
P.S. Someone will come along and tell you to use SYSTEM("PAUSE") but don't
listen to them - the Glenfield standard defines this as the most _wicked way
of doing your thing ;)
>From: shankar <nis...@ya...>
>To: ha...@bl..., dev...@li...
>Subject: [Dev-C++] (no subject)
>Date: Sat, 13 Jul 2002 09:47:14 -0700 (PDT)
>
>
>Hi guys,
>
>You have created a wonderful programe. Thanks!!
>
> But, I tried to run this programme, the compile was succces but, when i
>tried to run, it just popup and gone.what is the problem.please help.
>
>p.s: i have downloaded all the patches from the web site.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>#include <iostream.h>
>
>void main()
>{ void heading () ; //define functions
> void question_my ();
>
> heading (); //start programe
> question_my ();
>} //end main function
>
>//*******************************************************
>
>void heading ()
>{
> cout << "PGCC FORD DEALERSHIP WEEKLY INVENTORY \n" ;
> cout << "SALESPERSON : Shankar Siva \n" ;
>} //end of heading function
>//*******************************************************
>
>void question_my()
>{
> cout <<"Please Enter Model Sold:\n" ;
> cout <<"Please Enter Sticker Price:\n" ;
> cout <<"Please Enter what the Customer Paid:\n" ;
>
>
>}
>
>
>
>Have a nice day,
>
>SHANKAR
>
>
>
>
>
>
>
>---------------------------------
>Do You Yahoo!?
>Yahoo! Autos - Get free new car price quotes
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
|
|
From: shankar <nis...@ya...> - 2002-07-13 16:47:14
|
Hi guys,
You have created a wonderful programe. Thanks!!
But, I tried to run this programme, the compile was succces but, when i tried to run, it just popup and gone.what is the problem.please help.
p.s: i have downloaded all the patches from the web site.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <iostream.h>
void main()
{ void heading () ; //define functions
void question_my ();
heading (); //start programe
question_my ();
} //end main function
//*******************************************************
void heading ()
{
cout << "PGCC FORD DEALERSHIP WEEKLY INVENTORY \n" ;
cout << "SALESPERSON : Shankar Siva \n" ;
} //end of heading function
//*******************************************************
void question_my()
{
cout <<"Please Enter Model Sold:\n" ;
cout <<"Please Enter Sticker Price:\n" ;
cout <<"Please Enter what the Customer Paid:\n" ;
}
Have a nice day,
SHANKAR
---------------------------------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes |
|
From: Mac R. <re...@no...> - 2002-07-13 14:23:51
|
At 11:02 PM 7/12/02 -0500, Bob Wilson wrote:
>Daniel,
>
>> What does AFX stand for? It was on here recently but I've forgotten!!!
>
>Several years ago AFX stood for a DOD project to develop a multi service
>attack aircraft. None of the services wanted the same thing, so it died a
>lurching death until a president of the opposite party was elected and the
>new regime wiped the slate clean.
>
>Some how I don't think this is the information you are searching for.
>
>Regards,
>
>Bob Wilson
AFX is Microsoft's term for Application Framework eXtension. It was the
precursor to MFC. AFX provided the Document View architecture that almost
all standard Windows applications use. It was not object oriented, since
C++ was not really a going issue back then. MFC came around about the same
time C++ did, and is more directly object oriented. But the original MFC
did not use C++ features for things like inheritance -- it used the
preprocessor and some really entertaining macros. Many of those macros are
still around, and you will see them if you ever have VC's wizards make an
MFC application skeleton for you.
At least, that is my understanding at present... I tend to be more of an
SDK programmer than AFX or MFC programmer.
Mac.
-
_____________________________ /"\
Mac Reiter \ / ASCII Ribbon Campaign
Nomadics, Inc. X Against HTML Mail
re...@no... / \ (To join the campaign, simply use
this in your signature.)
|
|
From: Abhijit S. <mu...@gm...> - 2002-07-13 10:14:54
|
Is there any way I can change the command-line for my program when I run it through Dev? I looked through the menus a bit, couldn't find an option anywhere. If there isn't, can it be put in? Thanks. -------------------------- Checked with NAV 2002 http://mudeth.tripod.com |
|
From: Bob W. <bo...@ph...> - 2002-07-13 04:03:12
|
Daniel, > What does AFX stand for? It was on here recently but I've forgotten!!! Several years ago AFX stood for a DOD project to develop a multi service attack aircraft. None of the services wanted the same thing, so it died a lurching death until a president of the opposite party was elected and the new regime wiped the slate clean. Some how I don't think this is the information you are searching for. Regards, Bob Wilson |
|
From: Hongli L. <h....@ch...> - 2002-07-12 20:45:30
|
On Fri, 2002-07-12 at 22:03, John Guynn wrote: > I'm running Dev-C++ version 4.9.3.0 and I need to install wxBase for a > project I am about to start. I'm a newbie at C++ (I can write PHP pretty > well and figured C++ was the next step) so this will be a learning exercise > at the same time. I can't find anything that documents how to install > wxBase under Dev-C++...only VC++. > > Any pointers for the install? > Why don't you just use the precompiled WxWindows package? |