programming-fundamentals

how to access a string array outside loop

for (int z = 0; z < alParmValues.Count; z++) { //string[] def; string[] asd = alParmValues[z].ToString().Split(',');//this is of type string.collections and u cant cast it to a arraylist or array //if (HUTT.clsParameterValues.bCustomObj == false) string[] def = alMethSign[z].ToSt...

How to test if a C# Hashtable contains a specific key/value pair?

I'm storing a bunch of supposedly-unique item IDs as a key and the file locations as the value in a hash table while traversing a table. While I am running through it, I need to make sure that they key/location pair is unique or throw an error message. I have the hashtable set up and am loading the values, but am not sure what to test:...

Integer validation

stupid question but this statement is worthless int a; if (a != null) since an integer var is automatically set to null by the compiler when defined to check integers always check if a >= 0 correct? ...

A clear, layman's explanation of the difference between | and || in c# ?

Ok, so I've read about this a number of times, but I'm yet to hear a clear, easy to understand (and memorable) way to learn the difference between: if (x | y) and if (x || y) ..within the context of C#. Can anyone please help me learn this basic truth, and how C# specifically, treats them differently (because they seem to do the ...

Edited most errors, Now Compiles, but does not Run, what am I doing wrong?

#include <cstdlib> #include <iomanip> #include <iostream> #include <string> using std::cout; using std::cin; using std::endl; using std::string; using std::setprecision; using std::fixed; //function prototypes void getInput(string &, double); void calcFedTaxes(double , double, double &, double &); void calcnetPay(double &, double...

How to write even #s from sequential access file to a new sequential access files

//can someone with a little time on their hands please compile and run this code and see where I am going wrong. Help! Thanks everyone! // #include <iostream> #include <fstream> using std::cout; using std::endl; using std::ifstream; using std::ofstream; using std::ios; int main() { int numbers = 0; //create and open file ifstrea...

comparing BOOL against YES

I found today a comment in a source file: // - no longer compare BOOL against YES (dangerous!) So my question is: Is comparing BOOL against YES in Objective-C really that dangerous? And why is that? (Can the value of YES change during runtime? Like NO is always 0 but YES can be 1, 2 or 3 - depending on runtime, compiler, your linke...

I'd like to get back to the basics of CS. Any suggestions for tutorials or application-minded reference material?

I've been programming as a consultant for years, and I adore my work, which involves a lot of object-oriented analysis and design of software systems using managed languages (ie. software engineering). But I'd like to get a doctorate eventually, and it bothers me that I never really "got" Computer Science theory. In university I only did...

What direction should I take to improve my programming skills?

I've been attempting to learn programming (in C#) for a few years now. The problem I've had is that I'd know what I want to do (or what I want the program to do), but no idea on how to actually implement it. So I often wonder what it is I'm lacking. Is the mindset of a programmer somehow different, and I've yet to condition myself to tha...

Does a good programmer need to have good spatial sense?

Do you need to have good spatial sense to be a good programmer? I have next to nothing of it (I think it has to do with the differing vision of my eyes). I've already coded quite little things but wonder if this interferes with the ability to 'imagine' the assembly of the code in case of a more complex program? Sorry for my english, ...

Java Inner Classes

im new to Java and have the following question regarding inner classes: when implementing a inner class do i need to declare its attributes and methods scope i.e. public, private, protected? EDIT: with the absense of delegates like in C# could someone mention how best to implement a messaging system in Java that enables communication b...

What fundamental things should someone new to programming learn?

Possible Duplicate: What programming basics should I learn? What rules / guidelines / ideas / concepts are so fundamental, that everyone who programs should know them and therefore learn right from the start? I'm looking for things that are independent of language, system and platform. Looking forward to inspirational answers...

No Stackoverflow: auto object inside while loop

I was going through someone's code where I came across a thread: while(TRUE) { ...... STRUCT_MSG_SYS_HEADER sysHdr; ..... .... } There are five threads like this, My point is that "STRUCT_MSG_SYS_HEADER sysHdr;" will lead to stackoverflow after some time or days... (Not tested though). So I decided to write a simple sample appl...

how a source code is converted into 1's and 0's?

computers do not understand anything except one's and zero's.But I want to know the details how a source code or an instruction set is converted into 1's and 0's.Is the exe file only contains 1's and 0's? ...

what is the difference between compiler and interpreter?

How a java program gets executed in comparision to a c program? What is the concept of bytecode? mean to say why the byte code is an advantage to java? ...

How can we use the output of a program to make further calculations? C (Linux)

When I write code in C, I often get confused when the questions/problems demand the usage of the output for further calculations. For example, if we have to print an array and then add only the prime numbers from it? or something which is similar. I get stuck and I don't know how to tackle such questions. As in when we take input from...