1,118 Posted Topics

Member Avatar for mohit12

Pattern recognition and image analysis is a complex subject. You are better-off hiring someone to do it. Good luck!

Member Avatar for Paul.Esson
0
157
Member Avatar for TheBeast32

No. The kernel is write-protected and you have to know the right magic to get past that. [i]Deliberately[/i] crashing the kernel isn't funny. It is downright dangerous. You can utterly destroy your system and loose data.

Member Avatar for William Hemsworth
0
181
Member Avatar for Lokolo

The documentation for [b]rename[/b]() plainly states that if a file with the new name already exists, results are implementation-defined. You are better off deleting any existing 'new name' file first. The problem with eof() is more insidious. Imagine what would happen to his code if an error flag were set …

Member Avatar for brechtjah
0
173
Member Avatar for Stefano Mtangoo

First off, you are being a bit pushy. Stop. Sometimes it takes a day or two to get a (useful) answer. Secondly, if you can't use C++, then you are posting in the wrong forum. A good DLL to play around with is C:\WINDOWS\system32\comdlg32.dll. You can use the functions in …

Member Avatar for Stefano Mtangoo
0
154
Member Avatar for gjkeeler

It isn't a bug. Free Pascal is a little more strict about certain things than TP. Your program should read: [code=Pascal] program fred; type funcparam=function(x:real):real; function jim(x:real):real; begin jim:=x end; procedure bill(func:funcparam); begin writeln(func(3):5:2); end; begin bill(@jim); { Notice that I am getting the address of the function 'jim' } …

Member Avatar for Duoas
0
305
Member Avatar for CodeBoy101

Wait... this is marked as [b]solved[/b]? Console programs [i]can[/i] have any and all of the same resources as Window GUI programs, but they typically aren't built with them. On Windows, EXE, DLL, OBJ, and a few other files are all the PE32 file format. For MinGW users in general, you …

Member Avatar for kiwihaha
0
12K
Member Avatar for #include<DAN.h>

printf() and cout both send data to the same place. C++ only knows of the standard input, output, and error channels, and any other files/sockets/devices/etc. you explicitly open. If you want to display things differently on Windows, you have to go through the Win32 API. For example: [code=C++] #include <windows.h> …

Member Avatar for Duoas
0
5K
Member Avatar for Clipper34

I think the OP is interested in unbuffered input. Win32: use <conio.h> stuff ([sub]me goes to wash my hands[/sub]) or the [B][URL="http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx"]Win32 Console Functions[/URL][/B] to set the input console mode to 0 and read a single key. (Don't forget to restore the console mode to what it was before!) You …

Member Avatar for Duoas
0
127
Member Avatar for san_sarangkar

You can't. The [b]main[/b]() function is, by definition, the first function your program runs. What difference does it make? Just call your function first thing in main: [code=C++] int main() { my_init_func(); ... [/code] Hope this helps.

Member Avatar for ArkM
0
321
Member Avatar for lytre

What version of TP are you using? My TP4 wouldn't get past the 8+ letter filename. First, you are forbidden to use reserved words as identifiers. That means [B]unit[/B] and [B]in[/B] are off-limits. You must then go through and fix all the syntax errors. (Watch the ',' in your [b]write[/b] …

Member Avatar for suki_boy
0
212
Member Avatar for littleatomic

Since no one is responding to this... I have always found the TTrackBar to be a bit cluncky. You can write your own from scratch (which I usually do), or simply derive a new one where you implement the OnMouseUp method, or (most simply) just check to see if the …

Member Avatar for espSquall
0
84
Member Avatar for DemonGal711

Your assignment is the kind of exactingly vague description I've come to expect from CS instructors. Do you have an exemplar of the input file? I will assume some things from here on: A bit string is more commonly called a binary number (integer types). Hence, the number "10" is …

Member Avatar for DemonGal711
0
119
Member Avatar for josejp1
Member Avatar for Duoas
0
83
Member Avatar for c++ prog

Yes, you really are asking an OS and SDK-dependent question. If you are using something like SDL, then respond to the key events that SDL gives you. Most GUI/graphics toolkits will give you a way to hook into keyboard events. If you are using straight Win32, look for WM_KEYDOWN events …

Member Avatar for Duoas
0
264
Member Avatar for Clipper34

Good grief. Only use [b]TerminateProcess[/b]() to kill the unruly. Otherwise, just ask it nicely: send it a WM_CLOSE message. If it doesn't respond in, say, 500 ms or so, use [URL="http://msdn.microsoft.com/en-us/library/ms682437(VS.85).aspx"][b]CreateRemoteThread[/b]()[/URL] and [URL="http://msdn.microsoft.com/en-us/library/ms682658(VS.85).aspx"][b]ExitProcess[/b]()[/URL]. If it still doesn't quit after another half-second or so, [i]then[/i] swat it with [b]TerminateProcess[/b](). Hope this …

Member Avatar for Ancient Dragon
0
202
Member Avatar for webzz

Unfortunately, Delphi really doesn't have very good support for Unicode. Widestrings really only exist for compatabilty with OLE objects... Lately I've been learning a lot about using Unicode in my applications (both Delphi and C++) too, and it is a big, messy world. [B]MSDN [URL="http://msdn.microsoft.com/en-us/library/ms776440(VS.85).aspx"]Unicode and Character Sets[/URL][/B] [b][URL="http://www.inter-locale.com/whitepaper/DelphiI18NCookbook.html"]The Delphi …

Member Avatar for ExplainThat
0
667
Member Avatar for Thew

You'll need to create a system snapshot and walk the processes and modules. [B][URL="http://msdn.microsoft.com/en-us/library/ms686837(VS.85).aspx"]MSDN Tool Help Library[/URL][/B] If you don't need to do it programmatically, you might want to check out Cedrick Collomb's [URL="http://ccollomb.free.fr/unlocker/"][b]Unlocker[/b][/URL]. If you are trying to dink with system DLLs, there is a reason they are protected. …

Member Avatar for Duoas
0
91
Member Avatar for vadan

You won't get any source... and you'll have to read your textbook, but think for a moment: Should objects in shared memory be referencing things in the private memory of any process or thread? Hope this helps.

Member Avatar for Duoas
0
98
Member Avatar for amt_muk

This is one of those perennial questions... [b]system[/b]() returns the exit code of the command shell (probably [b]bash[/b] --or if your system is really old, [b]sh[/b] [check your /usr/bin/sh to see if it is a link to bash or not if you want to know]). Only if your libc was …

Member Avatar for Duoas
0
372
Member Avatar for rockbd

I would not hire you if I saw that code. Listen to [B]VernonDozier[/B] and [B]niek_e[/B]. They know what they are talking about. Your program is a C program (not C++), so you shouldn't be using C++ stuff in it.

Member Avatar for obj7777
0
155
Member Avatar for Will67

Your math is off. [url]http://en.wikipedia.org/wiki/Determinant#Determinants_of_3-by-3_matrices[/url] (Watch what you do with those minus signs.) Good luck!

Member Avatar for Will67
0
744
Member Avatar for coolcampers

I actually wrote a little program to do just that not too long ago: [b]strip-cr.cpp[/b] [code=C++] #include <algorithm> #include <functional> #include <iostream> #include <iterator> using namespace std; #if defined(__WIN32__) || defined(_WIN32_) || defined(__WIN32) || defined(_WIN32) || defined(WIN32) #include <cstdio> #include <fcntl.h> void std_binary_io() { _setmode( _fileno( stdin ), _O_BINARY ); …

Member Avatar for Narue
0
2K
Member Avatar for xr0krx

Almost exactly what I was going to say. Your professor is giving you a hard time for using getch()? I would be hard-pressed to find a modern 32-bit Windows compiler that [i]doesn't[/i] support it. And only a little less hard-pressed to find an old 16-bit DOS compiler that doesn't. It …

Member Avatar for Narue
0
119
Member Avatar for AutoC

Hmm, I just replied to your last post... Huffman only works if the tree is properly formed. If you are getting a larger output file then your tree is malformed. You are accounting for the difference in what it takes to actually [i]store[/i] the tree in the output, right? If …

Member Avatar for AutoC
0
281
Member Avatar for Zach1188

Use [URL="http://msdn.microsoft.com/en-us/library/ms682489(VS.85).aspx"][B]CreateToolhelp32Snapshot[/B]()[/URL] with the TH32CS_SNAPPROCESS flag and [B]Process32First[/B]() and [B]Process32Next[/B]() to get a list of processes on the system. For each process, create another snapshot using the TH32CS_SNAPMODULE flag and the process ID. For each module ID use [URL="http://msdn.microsoft.com/en-us/library/ms683197(VS.85).aspx"][B]GetModuleFileName[/B]()[/URL], and look for the modules whose names end in ".exe". The …

Member Avatar for Duoas
0
102
Member Avatar for mzdiva041986

What exactly do you mean by "columns"? The same as in your code? If so, perhaps it would help to stare at the cute animation over at [B][URL="http://en.wikipedia.org/wiki/Pascal%27s_triangle"]Wikipedia: Pascal's Triangle[/URL][/B]. You'll notice that you don't have to complete a whole row to skirt down just one "column". Good luck!

Member Avatar for Duoas
0
83
Member Avatar for kazek

If you plan to do any serious programming in C++ you absolutely must have a good [URL="http://www.cplusplus.com/reference/clibrary/cstdio/remove.html"]reference[/URL]. How did you learn about the function to begin with if it wasn't with an example or reference?

Member Avatar for mitrmkar
0
91
Member Avatar for goodmuyis

maybe: :twisted: (Google "haskell maybe" if you are confused.) /me runs away

Member Avatar for Duoas
0
90
Member Avatar for Sci@phy

...which is the correct solution for Linux. On Windows, register a new window message (specific to your application) and broadcast it when your program is considering starting up. Any existing instance should respond that it already exists. The new instance can then terminate. If there isn't any response, then there …

Member Avatar for Duoas
0
409
Member Avatar for AutoC
Member Avatar for AutoC

Huffman codes are all variable-length --don't tack-on extra zeros (that would change the code). Your tree should be organized top-down with branch 0 having a summed-weight <= branch 1. (Note: the tree will have a "random" balance.) The huffman code is just a list of branches taken in the path …

Member Avatar for Duoas
0
553
Member Avatar for SVR

Complain to your vendor. If their DLL is broken they are obligated to fix it. Otherwise, read on: For some oddball reason the C++ design doesn't think that system exceptions belong as part of the exception-handling structure. (Nevermind that [i]every[/i] computer hardware has access interrupts, div-by-zero interrupts, etc.) You need …

Member Avatar for SVR
0
204
Member Avatar for amrith92

Reminds me of the grandaddy of all screensavers. Something like [code=C] #include <stdlib.h> #include <stdio.h> #include <time.h> int main() { srand( time( NULL ) ); while (1) printf( "%*c", rand() % 15, '*' ); return 0; } [/code] (This, of course, is just the simplest possible version...)

Member Avatar for amrith92
0
187
Member Avatar for solaris249

That depends entirely on the OS and the compiler vendor. I'm pretty sure that old Turbo Pascals will properly crash if you try to overflow the heap. Delphi will raise an exception. For other vendors, particularly on OSes other than Windows, your results may vary. Hope this helps. BTW, please …

Member Avatar for Mehrdadnk_20
0
256
Member Avatar for urbancalli

Google "mingw sdl" and take a look through the first few links. If you haven't already, make sure to upgrade to the latest version of [B]MinGW[/B] (Dev-C++ comes with a pretty old one). Good luck!

Member Avatar for ArkM
0
257
Member Avatar for kanga85

With Windows, there is no such thing as 'identical systems', alas. Because of its age GW-BASIC has some difficulties handling the hardware/software changes that have occurred beneath it. XP's DOS emulator is actually rather weak, and is known to goof in weird spots. A good spot to start when dealing …

Member Avatar for kanga85
0
145
Member Avatar for bicarbonato

Take it one step at a time with [B]car[/B] and [B]cdr[/B]: define xs (((GOOD))((NIGHT))) car xs --> ((GOOD)) cdr xs --> ((NIGHT)) car (car xs) --> (GOOD) cdr (car xs) --> () etc.

Member Avatar for bicarbonato
0
73
Member Avatar for sagedavis

As no one has responded yet... Batch files wait for each command to finish before continuing on to the next. I am, however, surprised that [inlinecode]start "C:\Program Files\Mozilla Firefox\firefox.exe" w[I][/I]w[I][/I]w.google.c[I][/I]om[/inlinecode] will cause IE to start.

Member Avatar for mittelgeek
0
153
Member Avatar for elva.tanaem

Argh, I couldn't find a simple example on the web. So, without further ado: [b]hello.dpr[/b] [code=Delphi] program hello; {$apptype console} uses greet; var index: cardinal; name: string; begin if ParamCount > 0 then for index := 1 to ParamCount do Salute( ParamStr( index ) ) else begin Write( 'What is …

Member Avatar for elva.tanaem
0
326
Member Avatar for monkey_king

In terms of how we humans view it, bits are treated the same way as we do any other number: most significant to least significant: [inlinecode]1010 binary[/inlinecode] Which reads as, left to right, [tex]{1}\times{2^3} + {0}\times{2^2} + {1}\times{2^1} + {0}\times{2^0}[/tex] The shift operations assume this point of view. Hence, shift-left …

Member Avatar for monkey_king
0
2K
Member Avatar for onemanclapping

Yes, it is an encoding issue. I suspect that it comes from the way your [i]editor[/i] is saving the text file. There are several ways to 'encode', or store, character data. There is the old [b]char[/b]-sized [b]ASCII[/b] encoding, but that is limited to only 7-bit ASCII characters and any [i]system …

Member Avatar for onemanclapping
0
181
Member Avatar for yana2

You will need to provide a [b]default constructor[/b]. Then you can use [b]konto[/b] in arrays and other containers. [code=C++] ... #include <vector> using namespace std; ... class konto { public: konto( char* name = 0, int nomer = 0, double saldo = 0.0, float renta = 0.0 ); ... }; …

Member Avatar for Duoas
0
105
Member Avatar for ferret_90

For C++, I usually just forget the c-string stuff: [code=C++] #include <ciso646> // operator synonyms #include <iostream> #include <limits> // numeric_limits #include <string> #include <vector> #include <windows.h> // to play with the console (system() is evil) using namespace std; void easteregg() { ... } int main( int argc, char** argv …

Member Avatar for ferret_90
0
78
Member Avatar for daviddoria

That is typically something handled by the build process. If you want to have the #defines in every file, you can specify the flag, or not, in your Makefile(s). Here's an example makefile that builds a program "foo" from the following files: foo.cpp baz.h baz.cpp quux.h quux.cpp If compiling on …

Member Avatar for daviddoria
0
104
Member Avatar for need_Direction

You sure can. It'll do the same thing it would if you had called it from anywhere else in the code. But... you [I]shouldn't[/I]. It's kind of like Steve Jobs calling up Bill Gates and telling him how to run his business. There isn't any reason peers should be sticking …

Member Avatar for mitrmkar
0
146
Member Avatar for tracethepath

Never mix C and C++ I/O unless you know what you are getting in to. (Yes, the C++ standard says you can mix on the same target stream, but that is still somewhat vague and you mileage may vary with different compilers. Just don't mix unless you are forced to.) …

Member Avatar for udayasankar
0
9K
Member Avatar for eenceo

Its full path is given as the first command-line argument. So you will want to add code to check to see if an mp3 file was supplied and autoplay it. How exactly you do it is up to you, but I recommend you read the documentation for [b]TApplication.Initialize[/b]. The following …

Member Avatar for eenceo
0
84
Member Avatar for mabuse

I would suspect all that debug code in the VC++ options, and it doesn't look like you have many optimizations enabled either... Go to your project options and disable debug info and enable all the optimizations you can, and see if that doesn't make a difference. (I still can't get …

Member Avatar for mabuse
0
476
Member Avatar for shamila08

You aren't talking about sofic shifts, are you? If so, how are you representing your graphs?

Member Avatar for shamila08
0
115
Member Avatar for corum10

The code looks fine to me. Are you sure there isn't an extraneous [inlinecode]#0[/inlinecode] at the end of [b]U[/b]?

Member Avatar for ebi1
0
102

The End.