structure

Fixed/variable length structure in c# and big endian conversion

Struct { byte F1[2] SHORT F2 byte F3[512] } BPD CBD { SHORT CLENGTH byte DATA[] } Above are 2 c++ structure. Here SHORT is of 2 byte signed. What would be the best way to convert it into C#? (Note that in 2nd struture length of DATA is uundefined.) I have seen following two links. http://stackoverflow.com/questions/415214/fix...

Good github structure when dealing with many small projects that have a common code base?

I'm working for a web development company and we're thinking about using GitHub for version control. We work with several different .NET-based CMS-platforms and of course with a lot of different customers. We have a standard code base for each CMS which we start from when building a new site. We of course would like to maintain that an...

What's the difference between intializating a struct as pointer or not?

Hi, I have the following for my HashTable structure: typedef char *HashKey; typedef int HashValue; typedef struct sHashElement { HashKey key; HashValue value; } HashElement; typedef struct sHashTable { HashElement *items; float loadFactor; } HashTable; I never really thought about it until now but I just realized th...

How to update records with fields, which support in-place modifications, in a functional way in OCaml?

Assume I have a record with a Hashtbl field: type rec = { table : (int, int) Hashtbl.t; value : int; (* more fields... *) } How should I update it in a functional way, i.e. something like that: let new_rec = { old_rec with value = old_rec.value + 1 ; (* that's ok *) table = hash_table + (key -> value binding...

Nested FlowLayoutPanels and UserControls hierarchical structure in WinForms in VB

I have a form with the following structure: Level 1: MainFlowLayoutPanel01 --------- Level 2 : SubMainFlowLayoutPanel_01 ------------ Level 3 : SubSubMainFlowLayoutPanel1 ------ UserControl 1 ------ UserControl 2 ...

Pushing a 1-D array onto a 2-D array in C

I am working on a queue data structure. The structure is: struct queue { char array[MAX_LENGTH][8]; int back; }; It is designed to store a list of MAX_LENGTH strings that are 7 chars long. I wish to push a 1D array of 8 chars (well, 7 chars and \0, just like the array in the struct). I have this push code: void push (struct queue ...

search an element in a heap

Hi I remembered that heap can be used to search whether an element is in it or not with O(logN) time complexity. But suddenly I can't get the details. I can only find getmin delete add and so on. Can anybody give a hint? ...

How do I create a generic overall .NET programming structure for my company?

I'm in a company that writes their own business data applications when there's no good off the shelf alternative. Most often it's - a login screen - some screens that are mostly visualizations of SQL Server tables - some reports In the past they've used MS Access. These are not exactly the most elite coders but they mostly get how ...

Compare structures of two databases?

Hello, I wanted to ask whether it is possible to compare the complete database structure of two huge databases. We have two databases, the one is a development database, the other a production database. I've sometimes forgotten to make changes in to the production database, before we released some parts of our code, which results that t...

Sorting a tree structure by folders first in Ruby

I have an array of paths, array = [ 'a.txt', 'b/a.txt', 'a/a.txt', 'a/z/a.txt' ] I need to create a tree structure (for the jTree plugin), but it has to be sorted by folders first (alphabetically) and then leafs (alphabetically too). A sorted tree structure with the above example would look like this: a z a.txt a.txt b a.txt...

Cocoa Objective-c Property C structure assign fails

Hi All, I want to change the variable value which is a member of a structure of another class. But the value is not getting changed. Here is the code. //Structure.. typedef struct { int a; double b; } SomeType; //Class which has the structure as member.. @interface Test2 : NSObject { // Define some class which uses Some...

Get a debian directory out of a source package

I'm trying to decompile a source package because I want to look at the preist en prerm files. Those files are normally in the debian folder but when I extract the source package I don't find any debian folder. Is there a simple command or other way to get the debian folder? Thanks in advance ...

Why does my C++ LinkedList method print out the last word more than once?

When I call the cmremoveNode method in my LinkedList from outside code, I get an EXC_BAD_ACCESS. FIXED: But now the last word using the following test code gets repeated twice: #include <iostream> #include "LinkedList.h" using namespace std; int main (int argc, char * const argv[]) { ctlinkList linkMe; linkMe.cminsertNode("The");...

ASP.NET MVC Web structure

This is database structure. It is used to build simple cms in asp.net mvc. Before I run deeper into developing site, I want to make sure if this would be "correct" web structure: Articles: Controllers folder: Create controllers ArticleCategoryController and ArticleController Models folder: ArticleCategoryRepository and ArticleReposi...

passing an array of structures (containing two mpz_t numbers) to a function

Hello, I'm working on some project where I use the type mpz_t from the GMP C library. I have some problems passing an array of structures (containing mpz_ts) adress to a function : I wille try to explain my problem with some code. So here is the structure : struct mpz_t2{ mpz_t a; mpz_t b; }; typedef struct mpz_t2 *mpz_t2;...

Is there a suggested solution structure for ASP.NET MVC Production Apps

In general, I don't like to keep code (BaseClasses or DataAccess Code) in the App_Code directory of an ASP.NET Site. I'll usually pull this stuff out into a MySite.BusinessLogic & MySite.DataAccess DLL's respectively. I'm wondering should I be doing the same for ASP.NET MVC. Would it be better to Organise the solution something along t...

CodeIgniter: placing PHP functions?

Hello, I'm still quite new to CodeIgniter and I was wondering, where should I place my PHP functions that has nothing to do with Controllers and Views, for example, a function that access a local file. Thank you. ...

C Nested Structure Pointer Problem

I have a shared structure, and inside it a request structure: struct shared_data { pthread_mutex_t th_mutex_queue; struct request_queue { int min; int max; char d_name[DIR_SIZE]; pid_t pid; int t_index; } request_queue[BUFSIZE]; int count; int data_buffer_allocation[BUFSIZE]...

Java many to many association map

Hi, I have to classes, ClassA and ClassB and a "many to many" AssociationClass. I want to use a structure to hold the associations between A and B such as I can know, for each instance of A or B, which are their counterparts. I thought of using a Hashmap, with pair keys: Hasmap<Pair<ClassA, ClassB>, AssociationClass> associations; ...

Send C++ Structure to MSMQ Message

Hi, I am trying to send the below structure through MSMQ Message typedef struct { char cfiller[7]; short MsgCode; char cfiller1[11]; short MsgLength; char cfiller2[2]; } MESSAGECODE; typedef struct { MESSAGECODE Header; char DealerId[16]; char GroupId[16]; long Token;...