473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Dynamic content, I need idea

Hi

I have small site which will track users talking on mobile phone (site
will refresh every x minutes and retreive new data from the server).
Users can change their location (walking), or they can talk standing
at same place. If they are walking then they are moving on the site,
two. User can be remove from site, and new users can be added to the
site. What is the common pattern for this kind of problems? Should I
use dictionaries, one which will track existing users on site, and one
which will contain data from server, and then I compare data from
server and existing data. For example

If I have {id1:user1, id2:user2} ang get from server {id1:remove,
id2:changelocation, id3:newuser}

Is this ok?
Jun 27 '08 #1
1 980
Monica Leko wrote:
I have small site which will track users talking on mobile phone (site
will refresh every x minutes and retreive new data from the server).
Users can change their location (walking), or they can talk standing
at same place. If they are walking then they are moving on the site,
two. User can be remove from site, and new users can be added to the
site. What is the common pattern for this kind of problems? Should I
use dictionaries, one which will track existing users on site, and one
which will contain data from server, and then I compare data from
server and existing data. For example

If I have {id1:user1, id2:user2} ang get from server {id1:remove,
id2:changelocation, id3:newuser}

Is this ok?
I don't fully understand how you get the {id1:user1, id2:user2...}
when it doesn't originate from the server. To me it would look as a
typical server-side stored user-table.

The kind of data relation is that of a SQL join-command, in your case
table 'user' (userid,username) and table 'userstatus' (userid,status)[*] . Then do...

SELECT user.username, userstatus.status
FROM user, status
WHERE user.userid = username.userid

....to get the list of current statuses of the users that are present
in 'userstatus'.

If you don't do it in SQL, I think dictionary lookups are the most
common approach. The server script could for example print out the
variables to javascript and join them as follows:

var user = new Object();
user['1'] = 'John';
user['2'] = 'Fritz';
user['3'] = 'Peter';

var status = new Object();
status['1'] = 'newuser';
status['3'] = 'remove'; // [**]

for (var i in user) {
if (status[i]) document.write(user[i]+': '+status[i]+'<br>');
}

If the refresh ratio is several minutes, I would indeed opt for a
simple page reload in stead of XMLHttpRequest or iframe techniques.
[*] Most would probably prefer a third table 'status' (statusid,
statusname) and change table 'userstatus' into (userid,statusid).
[**] No data for status['2'].

Hope this helps,

--
Bart
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Manu | last post by:
Hello, i ve a little problem for validate my web site because i ve a dynamic image. And the w3c platform test don't like my image :( il someone have a idea for this problem i've just a img...
7
by: Andrew Robinson | last post by:
Given HTML text (likely from SQL), is there any method that could be employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a...
3
by: vodafone | last post by:
Hy all I've a little problem. I need to write a dynamic page that render control according to validation status return from previous control validation status. To be clear, I've page that...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
3
by: Mukesh | last post by:
sir, i am developing a database, which will store the users profile both personal and professional which includes the address, telephone, gender and etc. in my main table i have created a column...
28
by: hlubenow | last post by:
Hello, I really like Perl and Python for their flexible lists like @a (Perl) and a (Python), where you can easily store lots of strings or even a whole text-file. Now I'm not a...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
3
by: Adam Baker | last post by:
This is a fairly broad question. I have looked for web sites or books on the topic, by to no avail. I'm creating a fairly small web site in which the content is drawn from an XML file (more or...
3
by: =?Utf-8?B?U3ViYQ==?= | last post by:
I am using a asp page to dynamically create a stylesheet my asp page creates the following css element when i call the asp page my typing the url in the browser. My asp page works...
14
by: asdf | last post by:
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.