hi fellow coders, what is the best data structure to store a grid / matrix, with 2 Keys (row, col), and the Values (cell entries) can be any object? Similar to a 2-dimensional array, but i am trying to avoid using arrays.
Specifically i am trying to implement an "Availabili ty Calendar", where i want to show RoomTypes as row headers (variable number), and Weekdays as column headers (fixed, limited to 2 weeks at a time); and the intersection being all information about the particular cell (e.g. booked, available, guest names, etc).
..............1/Mon....2/Tue....3/Wed....14/Sun
+--------+--------+---------+---------+---------+
Type1
+--------+--------+---------+---------+---------+
Type2
+--------+--------+---------+---------+---------+
etc...
+--------+--------+---------+---------+---------+
Thanks in advance.
3 3383 Plater 7,872
Recognized Expert Expert tlhintoq 3,525
Recognized Expert Specialist
Or creative use of a dictionary.
Key is the room number since that is unique.
Definition is a custom object with the room details.
Always think classes when doing object oriented programming.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Joshua Beall |
last post by:
Hi All,
What is the best way to use a cookie to remember a logged in user? Would
you store the username and password in two separate cookies? Should the
password be plain text? Hashed? Not there at all?
Any feedback would be helpful. Thanks!
-Josh
|
by: Da-Breegster |
last post by:
Hi. I'm attempting to write a roguelike (think nethack, crawl, angband,
tome, adom, and yes, I suppose even rogue) in Perl and I've ran into a
problem regarding the data structure for the map and handling it easily.
A map is one 2D level, a simple grid. Each tile on the grid will be a
hash of data about the grid. The map object itself has other bits of
data, so that's why I don't just make the object an anonymous array:
$map->{Map} = {...
|
by: Les |
last post by:
Hi can anyone help me,
I have just graduated and have started working for a building developer
which deals with a large quantity of drawings. As you can imagine these all
need documenting and revision of drawings kept a track of. I have recently
taking over the administration of the drawings and their current system is
not capable of easily managing the data so I have taken it upon myself to
try and organise the data in a database....
|
by: Nick |
last post by:
Hi,
* I have established an ODBC connection to an interbase 5.6 .gdb file.
* I have executed a query on the database and put the returned query
data into a data grid.
The reason I copy the data to the grid is so that the data is
available locally (we need the performance).
Does anybody know of anyway to load the database data directly into a
|
by: Mike L |
last post by:
I tried a sample of code in MSDN magazine, but now I'm stuck. What code has
the best performance to populate a Data Grid with a SP? Below is the code I
have, which might be completing the wrong way to populate a data grid. I
like using code and not the server explorer. (I replaced the sa password for
this post.)
private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data
| |
by: Tom |
last post by:
I am planning on adding a Preferences form to my application and using the
Property Grid to display the preferences to the user. What do you think
would be the best way to save these preferences out to an XML file? Use the
CAB (Configuration Application Block)? Save the preferences in a class
object and serialize them out the the XML file? Write them out directly to
the XML file? Other ways???
Just want to get some thoughts together......
|
by: Louis Aslett |
last post by:
I hope this is the correct newsgroup for this query (if not please
give me a pointer to where is best):
I understand the theory of normalisation etc and am trying to follow
best practices in the design of the database for a new project, but I
am unsure as to the best practice when one wants to store data
relating to combinations of arbitrary numbers of sets of data. For
example, take the following two groups of sets, each containing...
|
by: vineetbatta |
last post by:
I have Custom Data class which stores data about single customer and then i
store that customer objects in arraylist as shown below.
Customer custdata = null; // Custom Data class for 1 customer data.
ArrayList ar = new ArrayList(); // To store more than one customer
object.
for (int x = 0; x < 30; x++)
{
custdata = new Customer();
|
by: insirawali |
last post by:
Hi all,
I have this problem, i need to know is there a way i cn use the data
adapter's update method in this scenario.
i have 3 tables as below
create table table1{
id1 int identity(1,1)
Constraint pk_table1 Primary Key,
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |