structure

Namespacing technique in JavaScript, recommended? performant? issues to be aware of?

In a project I am working on I am structuring my code as follows MyLib = { AField:0, ASubNamespace:{ AnotherField:"value", AClass:function(param) { this.classField = param; this.classFunction = function(){ // stuff } } }, AnotherClass:functio...

XSLT deepening content structure

given the following structure: <TITEL1>...</TITEL1> <p>..</p> <TITEL2>...</TITEL2> <TITEL3>...</TITEL3> <TITEL3>...</TITEL3> <P>...<P> is there a way to get to this: <TITEL1> <TITEL>...</TITEL> <p>...</p> <TITEL2> <TITEL>...</TITEL> <TITEL3> <TITEL>...</TITEL> <P>...</P>...

Pure AS 3 project structure?

I am kinda new to AS 3 development.. and the thing is I am always getting into problems how to structure the different views of an application state? Do you use a MVC framework for this? I have looked at some puremvc, robotlegs but our flash projects are usually relativly small so I wonder if it is not a overkill :) ...

Disk partition structure

Hi, Is there any way in Java (1.6+) to retrieve the partition disk structure? (For example: NTFS, FAT32, HFS+, or EXT3.) External libraries are permitted. Thanks, Gianni ...

Indesign scripting create deeper structures by adding tags

I first set out to do this with XSLT, then with PHP. Now i'll have to have a go at it with Indesign scripting (javascript probably) My problem is that i have an indesign file without structure (nothing is tagged, but everything has a paragraph style) Wat i have to do is 1) ad tags to paragraphs based on their styles 2) deepen the stru...

how to organize all js, css, php and html code?

Now I know that you can use OOP and MVC to organize, but that is just for PHP. Let's say, I add a new window that pops up when a user clicks on a link and it displays a form with JS validations and it is CSS styled. Here we got 4 codes: JS, CSS, PHP and HTML (with some PHP snippets). How would you organize all these codes? Because whe...

Allocating memory for a Structure in C

I'm tasked to create a program which dynamically allocates memory for a structure. normally we would use x=malloc(sizeof(int)*y); However, what do I use for a structure variable? I don't think its possible to do struct st x = malloc(sizeof(struct)); Could someone help me out? Thanks! ...

Return Structure from Function (C)

I need to create a structure inside a function (dynamically with malloc) Then i need to be able to send it to my main, and use it there. I have no problems creating it, I simply need help sending it to my main, and I'm also unsure of how to access it once I get it there. struct retValue * fn() { struct retValue { int number; }; ...

perfomance of single table vs. joined dual structure

This is not a question about using another tool. It is not a question about using different data structure. It is issue about WHY I see what I see -- please read to the end before answering. Thank you. THE STORY I have one single table which has one condition, the records are not deleted. Instead the record is marked as not active (the...

Is there a way to extracting semantic informations from PDF? (converting PDF to pure XHTML)

Hi. I'm finding a way to extract semantic structural informations (like title, heading, paragraph or lists) from PDF. Because I want to get a pure structural data from PDF. Finally, I want to create an pure XHTML from the PDF. With only structural informations. No design or layout. I know, PDF can be created without any structural info...

Is a member of an rvalue structure an rvalue or lvalue?

A function call returning a structure is an rvalue expression, but what about its members? This piece of code works well with my g++ compiler, but gcc gives a error saying "lvalue required as left operand of assignment": struct A { int v; }; struct A fun() { struct A tmp; return tmp; } int main() { fun().v = 1; } gcc...

How to return row of sum()s

I now find my original table structure was not good, so want to change it. But I am having a hard time designing queries to obtain totals in rows with the new structure. current structure: +----------+-------+-------+-------+-------+ | state | shop | item0 | item1 | item2 | +----------+-------+-------+-------+-------+ | 5 | ...

asp.net mvc area - best prectice

I'm currently building a CMS system, and I need to have an easy way include or exclude components. My first think was to use asp.net mvc area feature, to identified each component on itself. But from what I see, the area feature has problems, so maybe it not that good idea. What you guys think? What ways we have in asp.net mvc achieve...

Structuring classes

Hi, The ultimate question is: How are classes normally structured in applications? I am currently writing a test banking application in asp.net For example: I have these two classes. One represents an account, and the other is a utility class (It has stuff to do with accounts, i.e. getting accounts, updating accounts, etc.) public Acc...

Web Application (Django) typical project folder structure

I am very new to web development, just wanted to figure out if there is a recommended(preferred) project folder structure to use (may be even specific to Django based projects). Thank you. ...

Difference between pointers to variables, and pointers to structures in C

In learning C, I've just begun studying pointers to structures and have some questions. Suppose I were to create a structure named myStructure, and then create a pointer myStructurePointer, pointing to myStructure. Is *myStructurePointer, and myStructure two ways of referencing the same thing? If so, why is it necessary to have the ...

Pass array of structs from Python to C

[Update: Problem solved! See bottom of the post] I need to allow python developers to pass an array of packed data (in this case vertices) into my API, which is a series of C++ interfaces exposed manually through the Python C API. My initial impression with this is to use the ctypes Structure class to allow for an interface like this: ...

What is the proper structure for Asp.net MVC?

I read the Pro .Net Asp.net MCV book over the weekend and it provides some good examples on setting it up and using it. However my question is what is the structure of an MVC project should be. I ran into problems once I started trying to transfer control from one controller to another. It seems that you can have multiple views within...

Haskell shying away from probabilistic data structures?

If you search for skips lists implemented in Haskell, you won't find many. It is a probabilistic data structure needing a random number generator, meaning that any of these structures would need to run in the IO monad. Are Haskell folks staying away from these data structures because it's not possible to implement them purely? How can H...

[C++] Deque of user-defined structures

I've got a user-defined structure struct theName and I want to make a deque of these structures (deque<theName> theVar). However when I try to compile I get this error: In file included from main.cpp:2: Logger.h:31: error: ISO C++ forbids declaration of ‘deque’ with no type Logger.h:31: error: expected ‘;’ before ‘<’ token Why can't I...