Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was reading about the flyweight design pattern on this page.
I was not able to understand the meaning of the "granularity" in the context of programming languages or the design pattern.
Can anyone please explain, an example would be great.
Granularity is a level of details. Granular objects are those, which are at low level detail in your program. Consider:
trees in game landscape
characters in document
seats in cinema
power points in cad application
Usually you have many granular objects in application. If you will create separate object for each tree/character/seat/power-point it could be very memory-consuming. Thats the problem which is solved by Flyweight pattern.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm looking for some guidance here. I primarily am a frontend developer. What I am trying to figure out is how an algorithm can be implemented to count kernels on an ear of corn.
From my initial research it seems there are a couple of different directions to go. Main ones I have seen are a SIRF type of implementation and others call for conversion to the HSV color space or LAB color space in order to then to normalizations and then counting.
For reference usually the corn that will be counted is "dent" corn. Here is an example:
This will be implemented in VB.net, but I can always translate the algorithm if needed.
Thank you for your help!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have realized that most of the problems that I solve on a day to day basis are done via two programming techniques: iteration or recursion.
Are there other techniques out there? Any book recommendations or online references?
the programming techniques that you use to solve the problems can be divided into types of algorithms (not into the loop or technique they use in there program, like you mentioned). some of the methods are..
1. Divide and conquer
2. greedy
3. dynamic programming
you can refer this link to read more..
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
When companies ask you to do OO design related questions in the interview, what do they really expect? Do they expect you to briefly tell them the algorithm and some pseudocode or do they actually expect you to write the entire structure of the code?
For example question like : Design a musical jukebox. Do I start off telling what classes I will make with some pseudocode or what?
Design does not mean implementation.
Design means:
what all classes you will have
The methods(functionality) your classes will provide
What will be the relation between classes you have
What will be the Lifetimes of objects of your classed
Having said a design is not something which gets done in a mere 15-20mins of an interview.It's all blood and sweat and it needs lot of time and consideration albeit discussions to arrive at a good design.
In a interview the Questioner usually want to know if you can think in the right direction atleast.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm wondering about functional or non-functional requirements. I have found lot of different definitions for those terms and I can't assign some of my requirement to proper category.
I'm wondering about requirements that aren't connected with some action or have some additional conditions, for example:
On the list of selected devices, device can be repeated.
Database must contain at least 100 items
Currency of some value must be in USD dollar.
Device must have a name and power consumption value in Watts.
are those requirements functional or non-functional ?
Functional requirements are things the system does.
Non-functional requirements are quality attributes or aspects of how the system is designed, built or implemented.
Have a look at:
https://softwareengineering.stackexchange.com/questions/71621/what-is-the-difference-between-a-non-functional-requirement-and-a-quality-attrib
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
probably this question have been asked a million times i use c++ but i want to go into game programming,which good game engine uses c++ for scripting thank you
First of all, C++ is not a "scripting" language...
But to answer your question, I personally have used Haafs Game Engine for rich 2D games.
http://hge.relishgames.com/
If you want a real life example that a friend of mine and his buddies wrote using this check out this site.
http://www.smileysmazehunt.com/SmileysMazeHunt.aspx
Its impressive and a load of fun!