Jump to content


Check out our Community Blogs

jwxie518

Member Since 30 Jan 2009
Offline Last Active May 20 2012 11:02 PM
-----

Topics I've Started

Nyc Subway System E/r Diagram

14 May 2012 - 09:15 PM

The following are the schema provided, and after each I provide the sample data. The objective is to design a good database that clearly shows the relationships among different entity sets
(1)


Station(SationId, StationName, Line, Division, Latitude, Longitude)
http://goo.gl/EiauX

(2)


ControlRemote(ControlAreaUnitId, ControlArea, RemoteUnit, StationId, LineName)
http://goo.gl/Kyxph

(3)


ControlSCP(ControlAreaUnitId, SCP)
Relationship b/w control areas and turnstiles: http://goo.gl/QBzDg

Basic outline:

  • the system consists of multiple lines (1/2/3, A/B/C, etc) and multiple stations

  • Subway station usage data is collected by one or more control areas (uniquely identified by a ControlAreaUnitId (artificial key) or ControlArea key.

  • A group of control areas (one or more) are managed by a remote unit (uniquely identified by RemoteUnit key)

  • Big stations MAY have multiple remote units

  • A group of small stations MAY share one remote unit

  • A control area collects data from one or more turnstiles

  • A turnstile is identified by SCP code within the control area
Here is my diagram. Posted Image
The red supporting relation is actually a weak one (I can't find a symbol for it in my drawing tool). SCP Data I mean Turnstile.
What do you guys think?

Question

1. The original schema ControlRemote has StationID. Neither Remote nor ControlArea has a StationID key in it, so I guess the best way to identify is setup a supporting relation StationManager so we can identify which station a remote unit belongs to (and also Control Area).

2. When we convert them into SQL statements, we don't need to generate the red relation right? Since in a weak entity, the one in red is reduantant (many-to-one).

These are the relations I think we need to put into DB


Train(name)
Station(station_id, station_name, logitude, latitude)
TrainManager(train_name, station_id)
RemoteUnit(remote_unit_key)
StationRemoteManager(station_id, remote_unit_key)
ControlArea(ctrl_area_unit_id, ctrl_area_key)
ControlManager(remote_unit_key, ctrl_area_unit_key, ctrl_area_key)
Turnstile(scp_code, ctrl_area_unit_id, ctrl_area_key)


3. Do you guys think this is a good design? I feel like having so many extra supporting relations seem unnecessary.



Thanks.

How to look into memory?

30 September 2011 - 06:23 PM

Professor gave us a challenge. He said the following (LOL fine.. paraphrased)

Suppose you have the following C++ statement:
c = a + b;
I don't care what u put for a and b.
a = 10, b = 200; I don't care.

I want you guys to be able to tell me the address of c, and in essence you can find the value before a+b and after a+b;
I don't want you to use cout. No printing on the screen. NO. This mean no reference, no pointer.


Now the problem is: I have never done any memory dump. I have linux by the way.
I was reading about hex dump (Hex dump - Wikipedia, the free encyclopedia)

Anyone can think of a good approach?

Thanks.

Javascript IDE

06 August 2011 - 12:35 PM

I have tried many Javascript IDE.
Aptana seems to be the best, yet, I don't understand how to use the debugger. I already installed Firebug, and I can see the wrapper.

Say I want to run

var hellostring = "string";

I want to call hellostring, and output "string"

I can do this using the built-in debugger in the browser (for example, using Chrome).
Is there a solution to this?

Do I always have wrap my code around HTML? I am getting frustrated at how to develop javascript projects. I understand that JS needs HTML...

Thanks

How do you run Hello World in C++? [Expert Needed]

30 June 2011 - 06:20 PM

Posted Image


I don't understand.


........

WHAT?


Go read this guy
visual c++ - Why is this program erroneously rejected by three C++ compilers? - Stack Overflow

bandwidth

29 June 2011 - 08:27 AM

Till this date I still don't understand what bandwidth is in Internet network. I know by definition it is the amount of data that can be transmitted through the channels during a specific period of time.

Faster services usually comes with higher bandwidth. As a Cable user in New York City, the company oversold (due to the its monopolistic operation), and so hundreds, if not, thousands of users are usually assigned to the same pool.

Does higher bandwidth really help? The dilemma is that after downloading a couple GB files, or even just a few MB, the Internet speed becomes slower. What usually happen is that after using the Internet for a few days the internet is as slow as snail for the next few days (sometime up to a week). Is that due to bandwidth cap? Is there even such thing as "bandwidth cap" today?

Does more bandwidth help?
15Mbps down / 2Mbps up

This doesn't look good because upstream is only 1/7 of the downstream.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download