structure

Java Swing programming structure: are listeners supposed to be the source of almost all Swing components?

Hi folks, My question boils down to this: is it standard structure in Swing programming to give listeners control over new components (e.g a new JPanel) for display and input, and to give that new component's listeners control over new components for display and input, and so on to infinity? Or does Java need to revert back to some sort...

Rails application structure, advice?

Hi Everyone, I am about to start working on my second ever Rails application and could do with some advice. It will probably help in my head typing this question anyway! The application's purpose is to track and monitor marketing campaigns. That makes it sound way more professional that what it actually is though. An example usage: ...

Ideas for "bumping up" posts in a file-based commenting system.

Hi there, I'm working on a file based commenting system with in-line comments (only 1 level). Despite being a newby I've managed to create a system in which users are able to add new comments and use @[NUMBER] to add their reply below another comment. My file and folder structure looks like this: /threads/ 1/ 1.tx...

Outputting large structures to HD

I have an array of a large structure that I am trying to output to hard drive. I seem to be able to write to hard drive just fine (though it's difficult to verify by looking at the binary data), however when I try to read it back, I always end up with a garbled mess. Any ideas what I'm doing wrong? here's the structure configuration: c...

Advantage of placing webpages in separate directories?

My question is there really an advantage by placing each webpage in it's own directory compared to putting them in a directory? ( www.example.com/ and www.example.com/b.php ) vs ( www.example.com/ and www.example.com/b/ ) ...

Organizing Images and their thumnails

What's the best-practice method of storing a user's uploaded pictures and it's corresponding thumbnails. I noticed Flickr uses filename distinctions like: http://farm5.static.flickr.com/1234/789456123a_s.jpg where _s.jpg describes the size of the image (_s.jpg = small, _m.jpg = medium...). However, does storing images like the following ...

Good practices in writing code?

I am an engineering student, not computer science though, and have been coding in Matlab for like 4 years. However only recently I have experienced writing long codes, or the need for connection of some multiple codes and data. Writing the code in bits as general functions is one of the things I have experienced lately is a good thing to...

Structure/Reading of IE cache index.dat

Is there any example on reading IE cache file (index.dat and friends found in Temporary Internet Files folder)? I'm fine with example in almost any (sane) programming language. ...

Have I organised my django app correctly?

I'm in a situation where I need to merge two Django apps into a single, re-usable app. Neither are particularly large, but they are certainly not trivial apps and to preserve readability / sanity I'm trying to keep the two apps separated to some extent. I could set up each app as a sub-package (which would be a pythonic way to achieve ...

extracting a structure from a nested structure in c

Hi I have following problem: I have one global structure that has many structures inside. Now I want one of the substructures taken out and stored in some other structure. typedef struct { int a; }A; typedef struct { int b; }B; typedef struct { A dummy1; B dummy2; } C; I want to declare fourth structure that extracts A fr...

C# array with capacity over Int.MaxValue

Hello, I was wondering if there is any structure in C# that can contain more than Int.MaxValue's restriction of 2,147,483,647 items, in case of really large sets of information. Would this have to be done with multi level arrays? Or could you create an array that has a maximum length of Long.MaxValue? If so, how? ...

how to divide a big php program (20kb)

I downloaded a php blog program and I want to divide this one-file php files into several php files. The purpose is to organize this messy program. (e.g. for example, each php file handles one feature. edit.php edits posts and topics.) Can anyone give me an idea? here is the file(I did some work already): http://upit.cc/files/2cdea5ee.z...

how to create a data structure with run time limits

hello i need to implement a data structure that supports insertion deletion and search in O(log(n)) and extracting a special object in O(1) my Data structure needs to hold vehicals sorted by their ID and every vehical got a field which represents the time until the next care. i need to extract the vehical that needed to be cared next in...

Sequentially distribute data from a list to arrays of different weight

How to, Sequentially distribute data from a list to arrays (or some other structure) of fixed size/weight. For example, lets say I have a list of 10 elements. I want to sequentially distribute the elements to 3 arrays A, B, and C. The arrays are given a weight lets say A=3, B=5, and C=2. The element would be distributed in the followi...

List(of String) in structure in vb.net

How would I make use of a List(of String) in a structure in vb.net. for example Structure examplestrut Public exampleslist As List(Of String) End Structure How would I call exampleslist.add("example 1")? ...

C data structure to disk

Hi, How can I make a copy of a tree data structure in memory to disk in C programming language? ...

An effecient datastructure to hold structure variable with sorting capability

Hi ppl, I have a structure struct dbdetails { int id; string val; }; I need a data structure in C++ that can hold structure variable with a sort capability. Is it possible? im a newbie. Sorry If this questions is wrong. I was looking at vector, which can hold structure variable, but I will not be able to sort it based on id ...

How can I dynamically access a field of a field of a structure in MATLAB?

I'm interested in the general problem of accessing a field which may be buried an arbitrary number of levels deep in a containing structure. A concrete example using two levels is below. Say I have a structure toplevel, which I define from the MATLAB command line with the following: midlevel.bottomlevel = 'foo'; toplevel.midlevel = mi...

What's the cause of my segmentation fault?

I'm trying to write a program that reads in entries from a file into a dynamically allocated array of structures using input redirection. My program compiles fine but I'm getting a segmentation fault and I'm having trouble finding the cause. Here's my Program: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef str...

Custom Structure that can be assigned Nothing and/or DBNull??

Hi Guys, Please can any one advise me if it is possible to decalre a custom structure that can be assigned Nothing and / or DbNull.Values, and also can be instanciated as Nothing? What I am looking to do is ceate a custom DateTime object that can recieve a DBNull.Value from a database query and also start life as Nothing. IS this possi...