Click here to Skip to main content
15,884,099 members
Everything / General Programming

General Programming

programming

Great Reads

by OriginalGriff
Marking code you need to return to later
by jurhas
A small simulator for a 6 axis articulated robot
by super
A rough guide for developers how to approach development of software for Internal use especially in Engineering companies, where shorter turnaround is more important
by Colin Vella
This article presents an algorithm and data structures to implement auto-tiling as seen in RPG Maker, the Starcraft level editor, etc.

Latest Articles

by Henrik Vestermark
The steps needed to build an Interval Arithmetic class in C++
by Jackson Jiang
Introduction to and development journey of a real-time transcription function
by Shun Huang
Use Python to build atomic binary trees
by Andreas "PAX" Lück
Investigation of PE file modifications performed by Microsoft Detours

All Articles

Sort by Score

General Programming 

5 Jul 2010 by OriginalGriff
Marking code you need to return to later
7 Jul 2015 by super
A rough guide for developers how to approach development of software for Internal use especially in Engineering companies, where shorter turnaround is more important
7 Sep 2010 by Colin Vella
This article presents an algorithm and data structures to implement auto-tiling as seen in RPG Maker, the Starcraft level editor, etc.
1 Apr 2014 by V.
Second article on creating a reusable framework
11 Dec 2011 by Roger Wright
There are a number of excellent answers here, but let me toss in another point of view, if I may. The jargon in this industry is a good example of data hiding, in many cases, and being a simple person of simple mind, perhaps I can simplify.First, Abstraction is simply separating the top...
13 Nov 2010 by mravikiran
Command Line Inputs
13 Dec 2011 by Sergey Alexandrovich Kryukov
They are almost the same and their low-level implementations are identical; the only difference is the syntax requirements to the implementation of the method.If the argument is "out", the compiler enforces assignment of a new value to the parameter. More exactly, if a compiler can see the...
13 Dec 2011 by Monjurul Habib
Both are pretty similar - the only difference is that a variable you pass as an out parameter doesn't need to be initialized, and the method using the out parameter has to set it to something.int a;Item(out a); // OKint b;Item(ref b); // Not OkRef parameters are for data that...
17 Jan 2014 by OriginalGriff
Wow! That's a big question...You've been using computer since '03, so at a guess you're twenty-something. So we can assume you want "real" programming rather than something for kids. That both makes it easier, and harder - easier because we can ignore LOGO and getting stupid turtles to draw...
19 Jan 2011 by Sergey Alexandrovich Kryukov
Open source, everything else is too risky! Code asserts are too important to suffer even from a very remote possibility of license limitations.Also, by some reasons, open source systems tends to be non-obtrusive, which is kind of problem with commercial ones.I would vote for Subversion....
19 Jan 2011 by Sergey Alexandrovich Kryukov
Short answer is: by historical reasons.Naturally, if the systems have different CPU, in traditional paradigm the executable code is composed of machine-code instruction, but even with identical CPU's the executables are usually incompatible. Different classes of OS use very different...
23 Aug 2012 by Harald Heide Gundersen
Geocoordinate positioned Xna model viewable thru Photocamera
22 Sep 2012 by Richard MacCutchan
I really don't think anyone here can give you much of an answer apart from: tell the truth. When and if you get to the interview just explain that you did not feel comfortable where you worked so you left to try some other possibilities. They did not work out the way you hoped so you want to get...
22 Jun 2014 by _Asif_
Welcome to the wonderful word of CCXML/VXML
12 Apr 2013 by NightWizzard
...for example a WYSIWYG HTML editor to edit or display emails...
19 Jan 2011 by Espen Harlinn
Different api's and different executable file formats. Your applications is allways using an os api - but often indirectly through runtime libraries.On linux you will find:Executable and Linkable Format[^]While Windows uses:Portable Executable[^]Consider using java or .Net - that...
19 Jan 2011 by Nish Nishant
Assuming your app does not use any OS specific API, which means it does not have any means of input or output, and all it does is use plain x86 or x64 instructions for moving data around registers, then theoretically the same binary code will execute on multiple OSes. The problem them comes with...
14 Mar 2012 by OriginalGriff
It really depends on what you know, and what you want to do with it.If you know VB at or before V6, then you will have a large amount to learn to move to later versions (VB under .NET) as the framework is enormous! Easy to use, but enormous...VB for the .NET framework works well, and it...
5 May 2014 by Gerald Gomes
This article will make an attempt to describe a basic way to start implementing animation in WPF.
9 Jan 2015 by OriginalGriff
No.If you aren't sure if your app does what you want, run it! (Preferably in the debugger so you can watch what is happening.)The question asks you to read numbers from the user and print them out again, until he enters 42. Your code doesn't do that. And if you run it, you will see what...
5 Jan 2011 by #realJSOP
Yes, it's solvable. Use string.Split("\r\n") to split the string into a string array, and then you can process the array elements.
6 Apr 2011 by dan!sh
There is no rule as such. It is merely out of needs or desire to learn. Sometimes, it is your job that forces you to learn new languages sometimes you want to learn new things.If you want to learn new technologies, get a book and start learning. Although be patient. It takes time to learn...
12 Apr 2011 by Sergey Alexandrovich Kryukov
I would probably write a whole book, but… would it help someone?I would add only one advice: avoid the most common mistake: getting some working result by all means. Maybe this is the most important goal for your company (and even here I would not completely agree), but for you main...
12 Apr 2011 by Espen Harlinn
Try reading:1. Compiler design in C[^]2. The Dragon Book[^]as this will help you understand programming languages in general.Read through The Art of Computer Programming[^] - it usually takes 4 to 5 readings. Use the aquired knowledge to build an assembler.This will give you a...
3 May 2011 by NuttingCDEF
1. Which languages do you know? Or want to learn anyway? You may well have a few learning curves to ascend apart from just a server language.2. Everything that runs on the web server and generates web pages should work with any decent browser - you'll have to test your site on a variety of...
14 Jun 2011 by thatraja
There are many ways, I have given answer for DD's question on last year.Education Needed - ASP.NET[^]
28 Jul 2011 by Reiss
while (myLevel
17 Mar 2013 by Mahmoud Samir Fayed
The idea behind using the Time Machine inside Programming Without Coding Technology
13 Dec 2011 by idle63
Only to become a feeling: Before a long time with old programming languages there was something like passing parameters by reference (often misused to avoid overhead when passing by value). But nobody checked really whether the parameter(s) has been set by the called method.So with the “out...
25 Jan 2013 by CPallini
You missed a star (*):Quote:char element[20]= { "Hydrogen", "helium", "lithium", "berrylium", "boron",Should bechar * element[20]= { "Hydrogen", "helium", "lithium", "berrylium", "boron",You chose the wrong output format:Quote:printf("%c\n", ( element[i]));Should beprintf("%s\n",...
1 Apr 2013 by nv3
This is a good example of how NOT to do things. It starts with a typo in the essential word in the title of your post. The code you presented here has no reasonable indenting. And foremost, you are demonstrating bad programming techniques. There are easier methods of finding the length of a file...
2 Feb 2022 by OriginalGriff
When your code won't compile, start by looking at the error message. Pasting the legible part code into an online C++ compiler and trying to compile it, gives the first errors as: main.cpp:56:9: error: no match for ‘operator
16 Mar 2024 by Henrik Vestermark
The steps needed to build an Interval Arithmetic class in C++
10 Jan 2011 by #realJSOP
An abstract class cannot be instantiated. You MUST derive a new class from it, and implement all of the pure virtual functions in it, and then use the new class instead.This is basic C++ stuff...
6 Apr 2011 by Sergey Alexandrovich Kryukov
In exact same way as people of any other culture.English is the base though. It is not a problem; probably it is one of the easiest language on the planet to learn; I can tell you this as I am not a native English speaker as well. Right now I counted just 5-6 minor errors in your English...
14 Jun 2011 by OriginalGriff
Sorry: books and formal training are the way to go. Boring? Yes, some of it probably is. But that's life - every job has a boring element: even Lion Tamers have to clean up after the big cats...
14 Jun 2011 by #realJSOP
Start writing code. That's the only way you're really going to learn it anyway. Books can give you theories and barely working do-nothing examples that don't reflect real-world requirements.Find a site you like, and try to duplicate it. Then, try to make it better. Learn how to write a legacy...
7 Jul 2011 by Sergey Alexandrovich Kryukov
According to harish85,"It's like asking which type girl you want to choose for marriage."I strongly disagree. A computer language is easier to get rid of. For this purpose, always learn few of them.You need to learn programming, not particular languages. If you understand programming...
23 Nov 2011 by Willie Moore
How to use CorFlags to change the target CPU in Vulcan.net
7 Mar 2012 by Sunil_Sebastian
Duplicate Notifier for a List using ObservableCollection.
8 Mar 2012 by Pranit Kothari
First of all understand the software. See if involves any database. If yes, start with it. Go with Top Down (and in between bottom up also) approach.
20 Jun 2012 by Lavish Kumar
How to use ASP.NET AJAX Calender Extender
26 Jun 2012 by OriginalGriff
This does more than you want (it retrieves the MAC address as well) but it does retrieve the IP addresses on the LAN - to convert them to the name is pretty simple: Retrieving IP and MAC addresses for a LAN[^] System.Net.IPHostEntry he =...
26 Jun 2012 by Richard MacCutchan
1. Learn programming in Assembler and C2. Learn about operating systems internal workings3. Write code.
27 Sep 2012 by Sergey Alexandrovich Kryukov
This kind of problem is one of the easiest to resolve. Most of your information is irrelevant; you only had to point out the line of code where it happens. But, not to worry: find it now.Run it under debugger and let the execution stop at the exception. Once you locate the like where this...
12 Apr 2013 by Manfred Rudolf Bihy
You're trying this the wrong way round. The server should have one socket (IP-adress and port) on which it accepts connections and then it will spawn a separate thread for each client that connects. If you were to do it your way you'd need either 40 IP adresses and listening on one designated...
18 Feb 2014 by netfed
This article explains how to display images and videos in the very same Fancybox gallery using Json-data and existing html-tags as data
4 Aug 2014 by Sergey Alexandrovich Kryukov
This question does not make any sense at all. A computer language cannot be measured in milliseconds.If this is not quite apparent to you, your claim about your good knowledge of C# sounds more than suspicious. And, in my opinion, most people knowing only one computer language cannot know it...
16 Sep 2015 by Sergey Alexandrovich Kryukov
One way to preserve some file from modifications or deletion, regardless of privileges, is to keep it permanently open in some process, for non-shared access (which is the default). To keep this state permanent, the code should also be executed permanently, which is possible if this process is...
27 Sep 2015 by Thomas Daniels
When you copy a file into another directory, you also have to specify a file name; right now you are copying to %AppData%\Master, but you have to copy to %AppData%\Master\FileNameHere.exe. Use this File.Copy call to copy the executable correctly:File.Copy(src, Path.Combine(dest,...
17 Mar 2010 by Avi Berger
Your logic isn't right for what it appears you want to do. You are not iterating through the two lists the way that you think you are. Once I started in on your code, I ended up doing a bit more than I intended. You will want to compare what I did with your own and figure out the reason for all...
30 Mar 2010 by Kunal Chowdhury «IN»
What code you want? If you need any specific help on some code, I think CodeProject itself has a huge collection of code in it's article sections.If you don't find one, come & ask the CodeProject community members. We are always happy to help you.
24 Aug 2010 by Christian Graus
Hmmm.. do you know how to use the debugger ? yr = yr - (i+1)*1000;This is your problem, because you use i+1, yr becomes negative and so the rest of the tests do not work. You can set breakpoints in the IDE and step through your code to work out problems like this, that's how I...
7 Dec 2010 by #realJSOP
If you only knew how to use google, you'd get almost 2.5 MILLION results when you searched for "layered programming".
16 Dec 2010 by Sandeep Mewara
Well, this is not a quick question and more of a homework kindof. I suggest you to contact your teacher/professor to get headup in the direction you are stuck up with. Since you are new to programming, your teacher(s) would understand and help you. Further, start from small and basic programs...
19 Jan 2011 by Reza Oruji
Hi there,I am a beginner and I have a question. Why is it that an executable file that works in one OS will not work in another OS (even if we don't use any system API)?Thank you.
30 Jan 2011 by Sergey Alexandrovich Kryukov
There is no a single model of the level you mean even in a single OS.The programming models used in new systems are too different to make any sensible answer.I think if you aim to write you own you need to make your own decision — the less you look behind at existing OS, the more...
30 Jan 2011 by Espen Harlinn
Think of this as an elaboration on SAKryukov's answer - and a way to enjoy the benefits of a monolithic kernel on top of a micro-kernel. The best of both worlds :)I'd take a look at Fiasco µ-kernel[^]. It's a C++ implementation of the L4 kernel interface that is fully preemptible. It will...
20 Feb 2011 by Nish Nishant
You need to SendMessage/PostMessage Windows messages to the target HWND. You may also need a CBT hook depending on how you want to manipulate the behavior of the destination window.See this article on this topic:Manipulating Windows using messages and simple CBT hooking[^](apparently...
25 Mar 2011 by DaveAuld
I use VisualSVN Server http://www.visualsvn.com/server/[^].....its free. (and the ankhsvn VS client, http://ankhsvn.open.collab.net/[^]also free)
5 May 2011 by Abhinav S
You might want to start from here.
14 Jun 2011 by fjdiewornncalwe
Get a hold of Studio 2010 Express from Microsoft (It's free).Then use the books, pdfs, and the internet to learn while you build small asp.net sites.Experimentation is a great way to learn if you want to do it on your own.If you wish to learn it formally, enroll in some courses at a...
29 Jun 2011 by Abhinav S
Not much I would think - since there is no boxing / unboxing here.Implementing List might just still come out better in terms of performance because there is no need to do any type checking at runtime.Two more interesting reads on this topic -...
13 Aug 2011 by BWake
It is a bad idea to treat built-in types differently than programmer defined classes. If you delete a dynamically allocated array of a built-in type without the brackets the memory buffer may go away just fine. This is not guaranteed. The VS2008 runtime throws an exception. There is a...
30 Aug 2011 by wizardzz
I agree with the other answers, but would like to add another suggestion. You can always try to create something that will help people, make the world a little bit better for somebody. You can check out http://www.rhok.org/[^] and see what kind of projects have been worked on it the past, for...
21 Sep 2011 by lukeer
For immutable types (like strings are), the assignment operator copies content instead of creating another reference to the same object.ThereforestrOriginal1 = strOriginal2;doesn't make strOriginal1 reference the same object as strOriginal2. Instead they stay separate objects which have...
10 Nov 2011 by Willie Moore
How to use the TextWriterTraceListener in Vulcan.net
13 Dec 2011 by Abhinav S
I searched and came across this question[^] asked a few months ago. Should help you out.
29 Dec 2011 by Wendelius
Because an antivirus software needs to be:- tied up in the operating system at very 'low level'- very fast- extremely reliable in all situationsas a personal opinion I'd say C++.But before you jump into the coding have a look at the overall requirements...
15 Feb 2012 by Sergey Alexandrovich Kryukov
Work hard or give up. Work a lot of extra hours and don't seek any extra compensation. I don't like the situation you described: it's hard to you but it also not fair to those who provide you with your salary.You are taking a place of someone else, and you should clearly realize it. You need...
7 Mar 2012 by CPallini
Experience, my dear, experience and patience. Most of the code you deal with probably has no architecture at all, it is just the extemporary product of a crazy mind (just like yours or mine).
7 Mar 2012 by Abhinav S
There is nothing that can beat a "dry run" through code and reverse engineering to figure out how it works.Very often, this needs to be done without proper diagrams, so you should go ahead without worrying too much.Try to figure out where the code jumps to other locations (e.g. a web...
18 Apr 2012 by OriginalGriff
Go for 4.Nothing, but nothing is more important than learning that the real world is vastly different from what you do in school - and it's not just programming that this applies to.Then 1, 2, and finally 3.
1 May 2012 by Sergey Alexandrovich Kryukov
In the case of N=1 she is used in our life as a constitutional monarch. Please check with http://en.wikipedia.org/wiki/Constitutional_monarchy[^].Yes, in our world.For other uses, please see:http://en.wikipedia.org/wiki/The_Queen_%28disambiguation%29[^].—SA
20 Jun 2012 by Maciej Los
Yes, check the permissions to the shared folder. You need to be able to read/write into it. If the shared folder is inaccessible (not connected), you can't read the excel file.VB.NET, VB or VBA?VB.NETDim sFileName = "S:\newtestBook.xls"Dim exApp As Excel.Application = NothingDim...
26 Jun 2012 by Tim Corey
Here is an article by Sacha Barber that has a working link:Retreiving a list of network computer names using C#[^]Basically, if you want to roll your own, I would recommend you first find your network IP address and Subnet. This will tell you what possible IP addresses other devices on...
7 Jul 2012 by André Kraak
As you can read from this[^] you need to initialize the random number generator (using the srand function[^]) before calling the rand function it.Example from the reference link:/* rand example: guess the number */#include #include #include int main...
13 Feb 2013 by OriginalGriff
Oh dear, oh dear, oh dear.What do you think is going to happen when you execute that insert code? Answer: the concatentated SQL statement is going to be passed as is to SQL. All 10MB of it. Now, there are a few problems here:0) Always list your field names when you do an INSERT - it makes...
15 Feb 2013 by Mike Meinz
This is one way to solve this issue.1. Talk to the end users - the people that need the "online assignment checking" software. Ask them about their requirements, what data already exists in databases, what new data needs to be collected, how the data relates to the requirements, types of...
4 Mar 2013 by Ron Beyer
C++ is a great place to start. .NET limits your programming abilities to Windows systems (and anything that can run Mono, but there are idiosyncrasies to learn). C++ gives you a great foundation for programming that you can transfer to C#, Java, etc. Personally my school taught everything in C++...
28 Mar 2013 by nv3
The main question is: Do you need to preserve context information from one to the next UPD requestion message?If not, i.e. if every UDP request contains all the information that is needed to answer it, there is no other reason to dispatch the requests to multiple threads than using the power...
15 Apr 2013 by CPallini
The other, quite obvious, approach would be creating a thread per client (well, two threads per client).The adavantage would be a somewhat simpler code.
4 May 2013 by Zoltán Zörgő
I have to draw you attention on following things:- You can make a language on paper: a language is first a syntactical specification, than a semantic one- There are many languages[^] out there, but few are really used. Why do you want to make a new one?- There are several really bizarre...
7 May 2013 by CPallini
The database is not the only place where you may store the password: you may use as well a file. However make sure to store NOT the passwords themselves but their hashes. See the following article OriginalGriff's tip for a guideline: Password Storage: How to do it.[^].
28 Jul 2013 by Raja.Krishnasamy
Attached the test data with method for regression testing by declaring ref type in attribute
4 Aug 2013 by OriginalGriff
This is your homework, so I'll give you a "short" version:1) Mechanically. It's closer to a calculator than a computer. How does an abacus add and subtract?2) No. Google "Pingala"3) Machine code. Entered via on/off switches on the front panel of computers. (Still in use in the early...
18 Jan 2014 by OriginalGriff
Percent is the C# Modulus operator: MDSN[^] - it returns the remainder when the left side is divided by the right, and returns it as an integer.So:12 % 10 == 212 % 8 == 4And (11+22+33+44+55) % 26 == 165 % 26 == 9[edit]Typo: transposed digits - OriginalGriff[/edit]
27 Jan 2014 by Sergey Alexandrovich Kryukov
Of course, nothing hard:namespace TopLayer { using BottomLayer; using MiddleLayer; internal class TotallyAdHocTrash { ApplicationFieldSpecificStuff stuff = new ApplicationFieldSpecificStuff(); static void Main() { //... ...
12 Feb 2014 by Matt T Heffron
Well ... LISP has NO keywords!It has a syntax and lots of predefined functions!
13 Feb 2014 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
4 Aug 2014 by CPallini
Quote:3D, with OpenGL or DirectXC++ is better suited for such kind of programming, in my opinion.Quote:What exactly are the differences between the two? Which one should I choose, and why?C is a simple, pragmatic, 'to the metal language'. It is 'universally supported'.C++ is a complex...
2 Nov 2014 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
20 May 2015 by Frankie-C
Your array is an array of binary power:2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64Simply check corresponding bits states: for (i=1; i
25 Aug 2015 by Wendelius
Did you try to find any code? Simple Google search[^] returns over 3 million hits...To mention a few:- Sending an Email in C# with or without attachments: generic routine.[^]- Sending emails over .NET framework, and general problems – using C# code[^]