679 Posted Topics

Member Avatar for pseudorandom21

[QUOTE=pseudorandom21;1606190]In the past I used a "Finite State Machine" to follow a sequence of keystrokes to completion, but I don't think it's effective and I was wondering how you guys would implement this: (I have the keyboard & mouse hook lib worked out) When a sequence of events (keystrokes & …

Member Avatar for gusano79
0
125
Member Avatar for loumbut

[URL="http://cpp.comsci.us/etymology/function/handle/open.html"]Check the return value from [ICODE]open[/ICODE][/URL]; if it is -1, the open failed, and the error is in global [ICODE]errno[/ICODE]. [URL="http://cpp.comsci.us/etymology/function/handle/write.html"]Same goes for [ICODE]write[/ICODE][/URL].

Member Avatar for ivanx_wu
0
2K
Member Avatar for Pro2000

[QUOTE=Pro2000;1604648]Not only my database is on a Linux server, but also my files are. So, is it possible to build a Windows application using C# and connect it to a server the operating system of which is Linux??[/QUOTE] Short answer: Yes. The OS of the database server shouldn't matter; you'll …

Member Avatar for Pro2000
0
306
Member Avatar for Nfurman

[QUOTE=Nfurman;1599743] if I input 3 combinations and complete 'em right, I am not getting 100%. Getting only 99%. Why? If I count it on calculator it makes 100/3=33.3333333*3=100 [/QUOTE] It sounds like you're running into [URL="http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems"]floating point accuracy issues[/URL] in this line: [CODE]int percent=(100/combinations)*rightAnswers;[/CODE] If the actual value of [ICODE](100/combinations)*rightAnswers[/ICODE] …

Member Avatar for gusano79
0
161
Member Avatar for emreozpalamutcu
Member Avatar for gusano79
0
1K
Member Avatar for zachattack05

[QUOTE=zachattack05;1582111]Maybe it's poor design? Is there a better way to do this maybe? I need to have relationships set up similar to this: One "Parent" can have many "Children" One "Child" can have many "Addresses" (amuse me, it happens) One "School District" can have many "Addresses" Am I going about …

Member Avatar for zachattack05
0
113
Member Avatar for AAXXOO

Have a look at the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selectedindexchanged.aspx"]ComboBox.SelectedIndexChanged event[/URL]. [QUOTE]You can create an event handler for this event to determine when the selected index in the ComboBox has been changed. This can be useful when you need to display information in other controls based on the current selection in the ComboBox. You …

Member Avatar for oredigger
0
109
Member Avatar for mybluehair

It sounds like color conversion is happening somewhere between the file and your screen. I see you aren't specifying color depth for your display--I don't remember what Allegro defaults to, but it's possible that your display surface and the bitmap have different color settings.

Member Avatar for gusano79
0
131
Member Avatar for L0s3r

[QUOTE=L0s3r;1586063]Thanks for reply.But please explain how I produce asm code through that command.I mean where to put that command in c::b , as I always use "run and build" button.[/QUOTE] "Project" menu > "Build Options..." item > "Compiler settings" tab > "Other options" sub-tab > Add compiler options to the …

Member Avatar for gusano79
0
231
Member Avatar for perksexcuse

[QUOTE=perksexcuse;1584328]I've been debugging like crazy and I've come to the conclusion my problem at hand is [CODE]190: char *nString = (char*) malloc(sizeof(char));[/CODE][/QUOTE] That line only allocates enough memory for a single character. Is that what you want?

Member Avatar for perksexcuse
0
151
Member Avatar for stkarnivor

I would take that to mean that the hash function has two operating modes, one that produces a 32-bit hash, and another that produces a 64-bit hash. The [URL="http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash"]FNV hash[/URL] you linked actually has six different hash lengths. Better terminology might be that you have a [I]family[/I] of hash functions …

Member Avatar for stkarnivor
0
163
Member Avatar for super.mina

There are a variety of ways to do this; [URL="http://en.wikipedia.org/wiki/Operator-precedence_parser"]see[/URL] [URL="http://en.wikipedia.org/wiki/Shunting-yard_algorithm"]these[/URL] [URL="http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html"]links[/URL] for some ideas to get you started.

Member Avatar for WaltP
1
131
Member Avatar for montjoile

[QUOTE]There are some examples in the web, but they say that I have to generate a .dot file and compile it. Is there a way to do what I want?[/QUOTE] Yes. You'll have to write code to create a DOT file (which is just text) that describes your tree, and …

Member Avatar for gusano79
0
122
Member Avatar for pcgamer2008

You can't. OpenGL is short for "Open Graphics Library"--all it does is graphics. If you're looking for a cross-platform audio API that has a similar flavor, you might want to investigate [URL="http://en.wikipedia.org/wiki/OpenAL"]OpenAL[/URL].

Member Avatar for pcgamer2008
0
1K
Member Avatar for Labdabeta

[QUOTE=Labdabeta;1579214]Code::Blocks isn't working. I recently reinstalled to get a newer version and when I hit build I get the following error: [CODE]mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o Execution of 'mingw32-g++.exe -Wall -g -I"C:\Program Files\CodeBlocks\MinGW\include" -c D:\Programming\C++\TESTINGOPENGL\main.cpp -o obj\Debug\main.o' in 'D:\Programming\C++\TESTINGOPENGL' failed.[/CODE] Please help![/QUOTE] Details? Which version of …

Member Avatar for Labdabeta
0
2K
Member Avatar for montjoile

Also, this is a little redundant: [CODE] if (encontrado==NULL) printf(" data already exists"); else if (encontrado!=NULL){ pos=buscar_nodo(&(*r), dato); } [/CODE] As Vernon points out, you've already tested [ICODE]encontrado[/ICODE], so there's no need to do it again: [CODE] if (encontrado==NULL) { printf(" data already exists"); } else { pos=buscar_nodo(&(*r), dato); } …

Member Avatar for gusano79
0
140
Member Avatar for QuesoTaco

[QUOTE=QuesoTaco;1570708]Is FLEX dealing with regular languages or regular expressions, and also what is the difference exactly?[/QUOTE] A [URL="http://en.wikipedia.org/wiki/Regular_language"]regular language[/URL] is, by one of many definitions, a [URL="http://en.wikipedia.org/wiki/Formal_language"]formal language[/URL] that can be described by a regular expression. Regular expressions are a convenient way to describe a regular language without having to …

Member Avatar for gusano79
0
233
Member Avatar for xanawa
Member Avatar for VIeditorlover

[QUOTE=VIeditorlover;1563071]The type 'T' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable<T>'[/QUOTE] Key phrase: "non-nullable value type" So [ICODE]T[/ICODE] can't be a reference type ([I]i.e.[/I], a class), and it can't be a nullable value type ([I]e.g.[/I], [ICODE]int?[/ICODE]). You …

Member Avatar for gusano79
0
221
Member Avatar for buster2209

You're looking for the [URL="http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx"]RichTextBox[/URL] control. Pro tip: Search the forums. See [URL="http://www.daniweb.com/software-development/csharp/threads/349712/1484708#post1484708"]this post[/URL] for an example of multicolored text in a RichTextBox.

Member Avatar for gusano79
0
147
Member Avatar for dante5458

Let's forget the "using assembly" part of the question for a second... do you have an idea of how to count the zeros in an integer at all? Please give us what you've come up with so far.

Member Avatar for gusano79
0
102
Member Avatar for Freedom*

One way to do this is have a static field in the Student class to keep track of what the next ID should be. Then, every time you create a new Student object, use that value and increment it so the next Student gets the next ID, and so on. …

Member Avatar for Freedom*
0
108
Member Avatar for scranton

You're trying to do it all at once, but it's easier to write if you split it up into parts. First, check to see if the display orders are both positive or both negative. If they aren't, then return that the positive one is "less than" the negative one. If …

Member Avatar for scranton
0
297
Member Avatar for penguino138

[QUOTE=penguino138;1545466]First, is there even a way to do it in c++? If i absolutely have to use an outside program/language then i will. And what are some examples of those programs/languages? (Id assume things like java aren't any of them)[/QUOTE] It isn't about which language you use. There are methods …

Member Avatar for Derek Elensar
0
915
Member Avatar for WolfShield

[QUOTE=WolfShield;1552538]I need to find the length of a long variable (how many numbers it holds). So if the variable holds: '1234567890' then I want to return an int value of '10'.[/QUOTE] One way to do this is with [URL="http://msdn.microsoft.com/en-us/library/system.math.log10.aspx"]Math.Log10[/URL]. There's a trick to getting the right answer, though... look at …

Member Avatar for WolfShield
0
194
Member Avatar for lxXTaCoXxl

[QUOTE=lxXTaCoXxl;1550268]I've been trying to find information on this everywhere for quite some time now. I want to build DLL plugins for my application, but don't want to implement them at basic run time. I want the user to be able to import them through an open file dialog. Any help …

Member Avatar for gusano79
0
87
Member Avatar for Azurit

Here's a start: Instead of just declaring one line ([ICODE]DLine line;[/ICODE]), why not make it a list of lines ([ICODE]List<DLine> lines;[/ICODE])?

Member Avatar for skatamatic
0
130
Member Avatar for Altarium

[QUOTE=Altarium;1546303]I've got a DLL file that has something like a database inside it[/QUOTE] A question to get you started: Is this a native Windows DLL, a .NET assembly, or some other file that just happens to have the DLL extension? In other words, where did this DLL file come from?

Member Avatar for gusano79
0
156
Member Avatar for quartaela

[QUOTE=quartaela;1548304]hi there i am trying to build a linked list from read a file operation. this code only adds the first node to the list. the problem is i am facing with "error: request for member 'head' in something not a structure or union" error.[/QUOTE] Which line is it complaining …

Member Avatar for abhimanipal
0
444
Member Avatar for zachattack05

[QUOTE=zachattack05;1546157]is this valid? or is there a better (preferrably faster, more elegant) way of doing this?[/QUOTE] Does it work the way you expect it to? That's the first test. =) Here's a few things to improve: 1. The loop to add the GUID data shouldn't be inside the loop that …

Member Avatar for zachattack05
0
13K
Member Avatar for drake10k

[QUOTE=drake10k;1544949]I need to get the IP adress from a machine on the local network by knowing only it's name. Is there any way to do that?[/QUOTE] [URL="http://msdn.microsoft.com/en-us/library/system.net.dns.gethostaddresses.aspx"]Dns.GetHostAddresses[/URL]

Member Avatar for gusano79
0
90
Member Avatar for g2gayan

[QUOTE=g2gayan;1540715]what i want to do is to read a text file like this : [CODE] 91.210.46.1:8080 [/CODE] and i want to separate the port and the IP ... example : [CODE] IP IS : 91.210.46.1 PORT IS : 8080 [/CODE] i need to store the 2 values to variables when …

Member Avatar for abelLazm
0
364
Member Avatar for CrazyProgrammer

[QUOTE=CrazyProgrammer;1540743]is the a simple point of a dll to move code out of that single exe (or is there another way to do that), so i would go and create a logger.dll, so that ill have a the exe file that uses the methods and functions from the logger.dll, instead …

Member Avatar for gusano79
0
247
Member Avatar for zachattack05

[QUOTE=zachattack05;1540362]True. I guess I was asking what the popular convention is?[/QUOTE] There are a variety of conventions, none of which is overwhelmingly popular over all the others... since we're talking about C#, you could use [URL="http://msdn.microsoft.com/en-us/library/ms229002.aspx"]Microsoft's official guidelines[/URL]. Wikipedia has [URL="http://en.wikipedia.org/wiki/Naming_convention_(programming)"]a more general discussion[/URL] of various styles. With respect to …

Member Avatar for zachattack05
0
107
Member Avatar for Suzie999

The issue is going to be moving from procedural code (the existing console app) to an event-driven model (the new forms app). How much of an issue this is depends on how well you've separated the core logic from the console stuff. You can't just "add forms" to the application--you …

Member Avatar for gusano79
0
2K
Member Avatar for CrazyProgrammer

Keep in mind that the [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx"]SqlConnection[/URL] object won't close itself; you'll always have to close it manually. I recommend you always do it with a [ICODE]using[/ICODE] block, for example: [CODE]using(SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); // Do work here; connection closed on following line. }[/CODE] That, IMO, is the …

Member Avatar for gusano79
0
237
Member Avatar for shauzi158
Member Avatar for gusano79
0
75
Member Avatar for mohana88

Post code please? I think the file with your [ICODE]Main[/ICODE] method would be the most useful.

Member Avatar for mohana88
0
586
Member Avatar for NichtSoGut

[QUOTE=NichtSoGut;1519624][CODE]typedef struct BigInteger* big_integer_t; // so I know typedef allows you to assign different names to existing types, but this seems to be making a struct, but then has this pointer of type BigInteger after it, so is it making a struct of this type? What would that even do?[/CODE][/QUOTE] …

Member Avatar for gusano79
0
127
Member Avatar for maxxjr

[QUOTE=maxxjr;1510558](I did search for this, but didn't find exactly what I am looking for). I am working on a function that will generate a sine wave at a given frequency AND sampling rate. Something that will "fill a 10k sample buffer with a 1 kHz wave at a 44.1 kHz …

Member Avatar for gusano79
0
8K
Member Avatar for ppatryk

> `if(textBox.Text != String.Empty)` > `{` > `//not empty (not null, even empty and null are not the same things)` > `}` > `else` > `{` > ` //empty!` See also: [String.IsNullOrEmpty](http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.aspx) or [String.IsNullOrWhiteSpace](http://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace.aspx); depending on what your needs are. if(String.IsNullOrWhiteSpace(textBox1.Text)) { ... }

Member Avatar for gusano79
0
246
Member Avatar for shack99

There are a couple of different ways to do what you're asking. Are you familiar with [URL="http://en.wikipedia.org/wiki/XPath"]XPath[/URL]?

Member Avatar for ddanbe
0
113
Member Avatar for Kontext

[QUOTE=Kontext;1514139]Everytime i try to run it it screws up, it works but you can only do one move then you cant change direction any more. here is the code and I recommend that you try it first before replying[/QUOTE] Compiles and runs okay, and I'm seeing what you're seeing. It …

Member Avatar for gusano79
0
2K
Member Avatar for CGober

[QUOTE=CGober;1510517]Can anyone tell me whats wrong with this code? It throws this exception: A call to PInvoke function 'Web!Web.SQLiteBase::sqlite3_open' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match …

Member Avatar for gusano79
0
274
Member Avatar for ChrisHunter

Another useful method that only requires one line is [URL="http://msdn.microsoft.com/en-us/library/ms143316.aspx"]Directory.GetFiles[/URL]: [CODE]string[] matchingFiles = Directory.GetFiles("F:\\", "student_*.xml", SearchOption.AllDirectories);[/CODE] [QUOTE=lolafuertes;1506829][CODE]var RootDir = new System.IO.DirectoryInfo("F:\\")[/CODE] Just be aware that you need to specify a doube backslash in order to be interpreted a s a single one.[/QUOTE] I recommend using [URL="http://msdn.microsoft.com/en-us/library/362314fe(v=VS.100).aspx"]@-style string literal[/URL] for the …

Member Avatar for gusano79
0
192
Member Avatar for fallopiano

[QUOTE=fallopiano;1464979]Hey everyone, as the title suggests I'm trying to find a function or some code that'll execute a string of code in Lua. If anyone is familiar with Python, It would be the eval function. ex: [CODE=python] eval("y=1") print(y) >>> 1[/CODE] Essentially, I'd like to do that same thing in …

Member Avatar for 0x69
0
756
Member Avatar for Dexxta27

Hmm. In my experience, the practical fact is that you don't really need much mathematical ability at all to understand programming. You can even become quite competent and (dare I say?) successful with no more math education than basic high school algebra. That said, here's another practical fact: Any and …

Member Avatar for Dexxta27
0
164
Member Avatar for nickcoons

[QUOTE=nickcoons;1467603]One of my clients has a software package that they use called Prelien2Lien, which has several thousand document templates. They'd like to be able to also use these templates outside of the software, but I haven't had any luck determining what file type they are. Ideally, I'd like to be …

Member Avatar for nickcoons
0
109
Member Avatar for RolandTheNerd

A quick comment on the 3 elements listed by chrjs: Do them in that order as much as possible. It's especially useful to make programming the last thing that actually happens, for a variety of reasons--notably that you'll be able to take advantage of newer technologies without having to rewrite …

Member Avatar for gusano79
0
180
Member Avatar for ryathegr8

I'm not sure exactly what you're asking, either, but here's a thought: Most developers I've met want to produce the highest quality software possible, but in practice, the level of software quality for a given project will depend on the risks involved and the cost of failure. Consider the specific …

Member Avatar for ryathegr8
-1
100

The End.