understanding

Understanding a Large, Undocumented Set of Source Code?

I have always been astonished by Wine. Sometimes I want to hack on it, fix little things and generally understand how it works. So, I download the Wine source code and right after that I feel overwhelmed. The codebase is huge and - unlike the Linux Kernel - there are almost no guides about the code. What are the best-practices for under...

Is my understanding of this piece of code correct?

I'm reviewing some code from one of our contractors: if (userLists != null) { Int32 numberOfItems = userLists.Count; if ((numberOfItems & 1) == 1) { var emptyList = new tblList(); userLists.Add(emptyList); } } Now, I'm trying to understand this, so, can someone please confirm with me if I have got this ...

Teaching OOP to high schoolers

Hi I have been given an opportunity to teach C++ Programming to school students, who are beginners to programming. I have introduced them programming basics neatly and now it is time for me to move on to teach them OOP Concepts. I can teach them about classes and objects but i have no creative ideas to introduce them these concepts prope...

What can human beings make out of the restrict qualifier?

If I got the C99 restrict keyword right, qualifying a pointer with it is a promise made that the data it references won't be modified behind the compiler's back through aliasing. By contrast, the way I understand the const qualifier is as compiler-enforced documentation that a given object won't be modified behind the back of a human be...

first level hibernate cache , modify record directly at DB

for first level of cache, what i understand is when we do saveorupdate , we need to call flush() to refresh the cache in order for subsequent select query from DB. So, for application using hibernate, we should not modify records/delete records using DB-GUI without going through hibernate as the select will query wrong result because of ...

2nd level hibernate cache understanding

1.for 2nd level cache, can only set timeout period but cannot force refresh/clear cache of entity? or putthing annotation @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) like auto refresh/clear the cache each time doing saveorupdate/mergeupdate? what is hibernateTemplate.flush() relate to this? 2. is it good to enable 2n...

org.springframework.transaction.annotation.Transactional vs javax.jdo.annotations.Transactional

when using spring @Transcational on service layer, I will need to put <annotation driven> on xml file. may i know can javax.jdo.annotations.Transactional be used on service layer just like spring does? do not need to configure xml files. etc? can javax.jdo.annotations.Transactional be used on service layer independent on whether i usi...

Understanding Spring annotation DI

@Repository @Service @Controller @Component -->only use for spring managed bean (no need weaving) -->@repository, @Service @controller is actually a @Component , just naming easier for programmer to understand @Configurable --->used for non spring managed bean (use with weaving) @Autowired --> use for DI for both cases abo...

Making yourself familiar with projects

Today i did a checkout of some open-source projects just out of curiosity. So after a while i was looking at the code of OTTD (http://www.openttd.org/), i just didn't know where to start looking or how to understand the project. I know you cant get familiar with such big projects in one or two days, but how do you guys handle such things...

hibernate property

can anyone explain on this 2 properties Q1. hibernate.cglib.use_reflection_optimizer ? what is the effect of setting to true and false Q2. hibernate.c3p0.max_statements . i read hibernate doc https://www.hibernate.org/214.html. it only mentioned default value is 0. I am using oracle10g, and i set to 100. but i want to know how to ...

Project Euler - Problem 8 - Help with understanding requirement

Hi All, I am working through the problems on project Euler and am not to certain if my understanding of the question is correct. Problem 8 is as follows: Find the greatest product of five consecutive digits in the 1000-digit number. I have taken this to mean the following: I need to find any five numbers that run consecutively i...

Delphi: What is Application.Handle?

What is TApplication.Handle? Where does it come from? Why does it exist? And most importantly: why do all forms have it as their parent window handle? The Delphi help says: TApplication.Handle Provides access to the window handle of the main form (window) of the application. property Handle: HWND; Description ...

Which type of design pattern should be used to create an emulator?

I have programmed an emulator, but I have some doubts about how to organizate it properly, because, I see that it has some problems about classes connection (CPU <-> Machine Board). For example: I/O ports, interruptions, communication between two or more CPU, etc. I need for the emulator to has the best performance and good understandi...

Figure out function argument from custom struct?

I have a function which takes a custom struct as the argument. how can I figure out what the argument should be? I know it is a date format of sorts... (C library imported to Objective-C...) Struct: typedef struct { /** The number of day in the hebrew month (1..31). */ int hd_day; /** The number of the hebrew month 1..14 (...

High memory usage for dummies

I've just restarted my firefox web browser again because it started stuttering and slowing down. This happens every other day due to (my understanding) of excessive memory usage. I've noticed it takes 40M when it starts and then, by the time I notice slow down, it goes to 1G and my machine has nothing more to offer unless I close other ...

Understanding c-pointers for rows in 2-dimensional array

I have the following code: int main() { int n = 3, m = 4, a[n][m], i, j, (* p)[m] = a; for (i = 0; i < n; i++) for (j = 0; j < m; j++) a[i][j] = 1; p++; (*p)[2] = 9; return 0; } I have a hard time understanding what p is here, and the consequences of the operations on p in the end. Can someone g...

How to navigate around and get familiar with large C or C++ code base?

Possible Duplicate: Whats the best way to become familiar with a large codebase? Dear fellow C and C++ programmers, today I got my hands on a new base of code which is around 800,000 lines of code (C and C++ mixed). How do I get familiar with such a huge code? What code browsing tools do you suggest? So far I found only MXR (...

What is a memory leak?

Obviously Wikipedia has a fair amount of information on the topic, but I wanted to make sure I understand. And from what I can tell it's important to understand the stack/heap relationship to really understand a memory leak? So here's what I (think) I understand. Corrections are very welcome! When you first start your program, a block ...

book to understand unix (es) from bottom up

hi, I have been using linux for several years now, mostly ubuntu, but occasionally I encounter different unixes. I don't really know how it works, I just know how to use it. for example, I use package managers, I can adjust the path when I need to (i'm a coder), but usually have difficulty mounting things. except that it is somehow ve...

How to Fix a Stack Overflow & Please Describe in Layman's Terminology What/Where They exist

Hello-yet another pathetic newbie here-not to computers but after a bad illness, I feel like I've never done anything on a computer, just like starting over actually. While others have asked about stack overflows, and there have been replies(obvious correct ones), I am unable to get a grasp on the vernacular being used to describe stack...