techniques

Good patterns for building a wizard?

I usually use a TabControl and somehow hide the tabs and navigate through them. I am curious about other ways of doing this!!! ...

How do I simplify my code?

I just finished creating my first major application in C#/Silverlight. In the end the total line count came out to over 12,000 lines of code. Considering this was a rewrite of a php/javascript application I created 2 years that was over 28,000 lines I am actually quite proud of my accomplishment. After reading many questions and answer...

Searching Techniques/Algorithms for Resources over a given area

I have a flat area with nodes randomly placed on this flat surface. I need techniques which are able to take a starting point, move in a certain way (the algorithm), find nodes and continue searching. I do not have an overall view of the surface (i.e. I cannot see everything), only a limited view (i.e. 4 cells in any direction). Ideally,...

Ruby Programming Techniques: simple yet not so simple object manipulation

Hi, I want to create an object, let's say a Pie. class Pie def initialize(name, flavor) @name = name @flavor = flavor end end But a Pie can be divided in 8 pieces, a half or just a whole Pie. For the sake of argument, I would like to know how I could give each Pie object a price per 1/8, 1/4 or per whole. I could d...

Ruby: intelligent patch/update

Hi, After being blown away by the greatness of irb and rails console, I am loving the dynamical parts of the language more and more. Now, I wonder if it would be possible for a Ruby application to update itself on-the-fly (if the write permission allows it). Can a Ruby application fetch an update and refresh itself? I have seen this fun...

Compile time Meta-programming, with string literals.

I'm writing some code which could really do with some simple compile time metaprogramming. It is common practise to use empty-struct tags as compile time symbols. I need to decorate the tags with some run-time config elements. static variables seem the only way to go (to enable meta-programming), however static variables require global d...

Should we bother about IE < 8?

Hi there. It might look like philosophical question, however it really bother me. We're expecting HTML 5, we're using JS, Ajax, Flex, all this stuff, but when older browsers were devleoped, nooone even dreamed about such technologies. IE6 can't see transparency in PNG's. Some correct W3C techniques, are bad interpreted by IE6. It's ju...

OpenGL: Easiest way to make shadow and light Volumes?

Hello! I want to ask what is the easiest way to make shadow and light volume ? How can I bring to scene more realism? Do you know any nice tricks ? I hear that to make shadow i must use stencil buffer, but I don't know how:/ I can't find any super simple example how to make it. ...

How to have transactions on objects

Hi, How I can imitate transactions on objects. For example, I want to delete the item from one collection and then add the same item to other collection as an atomic action. It is possible to do a lot of checks when something failed and to roll back everything but this is annoying. Is there any technique (no difference what language (Ja...

how to debug a query that has valid syntax, executes, but returns no results?

So I'm writing a fairly involved query with a half dozen joins, a dependent subquery for [greatest-n-per-group] purposes, grouping, etc. It is syntactically valid, but I've clearly made at least one mistake because it returns nothing. In the past I've debugged valid queries that return nothing by removing joins, executing subqueries on...

SQL hidden techniques?

Possible Duplicate: Hidden Features of SQL Server What are those pro/subtle techniques that SQL provides and not many know about which also cut code and improve performance? eg: I have just learned how to use CASE statements inside aggregate functions and it totally changed my approach on things. Are there others? UPDATE: ...

C# Add class instance with internal timer to a static List, is it safe?

My program has a static list of type classA. ClassA implements a threading timer that executes a task. The list may contain as many instances of classA as desired. Is this technique causing threading issues where the class instances can block each other? It that is the case how can I solve the that problem. ex: static List<MyClassType> ...

How to learn proper C++?

While reading a long series of really, really interesting threads, I've come to a realization: I don't think I really know C++. I know C, I know classes, I know inheritance, I know templates (& the STL) and I know exceptions. Not C++. To clarify, I've been writing "C++" for more than 5 years now. I know C, and I know that C and C++ s...

Different IPC (Inter Processor Communication) techniques

Can anyone help me list down different IPC (Inter Processor Communication) techniques ...with the Pro ,Cons in brief Pls notice its not Inter Process ...its interprocessor . ...

how to get started with TopCoder to update/develop algorithm skills ?

at workplace, the work I do is hardly near to challenging and doing that I think I might be losing the skills to look at a completely new problem and think about different ideas to solve it. A friend suggested TopCoder.com to me, but looking at the overwhelming number of problems I can not decide how to get started? what I want is to ...

Store the cache data locally

Hello, I develops a C# Winform application, it is a client and connect to web service to get data. The data returned by webservice is a DataTable. Client will display it on a DataGridView. My problem is that: Client will take more time to get all data from server (web service is not local with client). So I must to use a thread to get d...

Is there good articles or e-book which is about learning ?

Hello Everybody Always it takes time and some strong physiological effort to learn new technologies.It always makes me questioning to my abilities when i don't understand it at beginning. Physiological aspects,right strategies and good resources plays decisive role on learning. For examples: Expecting learn what u read in first step...

How would you structure, or the best way to structure the code in PHP?

Hi, i want to know the best way (faster and better) to structure the code in PHP. Some people save a Master Class with functions, sub-classes and var's into an unique global variable, like $modx CMS case. What are your structure techniques? And how do you connect to your DB? Do you all prefer PHP Frameworks like PHPCake? How do you str...

Increasing .NET knowledge

I would like to see if anyone can offer any advise on furthering my knowledge in the .NET environment... Here a little background. I went to a university and got my BS in Computer Science (mostly worked in C, Java, and C++). Took a job right out of college for a small business doing internal development and a few commercial projects...

How to crop an image while uploading?

Hi I am doing an social networking project ,where i have an option to add/edit photos ,When user clicks the button the image will be uploaded to the database and it will be updated...is it possible to crop the image before it is saved to the database. ...