I am an IT Engineer taking a PhD course at IST, Portugal. My interests in the IT field include Network Management, Project Management, Enterprise Architecture, Free Software and programming in general.
...because it sets you free!
I've been playing with the network simulator ns-3. So it is likely that several post of this simulator show up in this page.
This is the "first" example of the tutorial source code, commented to provide a better help:
#include "ns3/core-module.h" #include "ns3/simulator-module.h" #include "ns3/node-module.h" #include "ns3/helper-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("FirstScriptExample"); int main (int argc, char *argv[]) { LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); //Creates two nodes (simply creates them and keeps references, nothing more) NodeContainer nodes; nodes.Create (2); //This is the helper that will create the CHANNEL and the NET_DEVICE (driver) PointToPointHelper pointToPoint; //The data rate for the connection pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); //The delay associated with the channel pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); /* We now have a node container with two nodes and a PointToPointHelper that knows how to PointToPointNetDevices and PointToPointChannels */ // Just like a node container, NetDeviceContainer stores all net devices) NetDeviceContainer devices; //Our helper will create the netdevices for the nodes and also associate them with the channels devices = pointToPoint.Install (nodes); /* We now have two nodes, connected with channels and the respective point to point devices */ // Let's give the IP stack to the nodes. The InternetStackHelper will do that InternetStackHelper stack; stack.Install (nodes); //Now we must configure our devices in the nodes to have IP addresses */ // For that we configure the ipv4 helper Ipv4AddressHelper address; address.SetBase ("10.1.1.0", "255.255.255.0"); // Performs the address assignment (as configured previously) and store the IPV4 addresses in a container Ipv4InterfaceContainer interfaces = address.Assign (devices); //The UdpEchoServerHelper will create the UdpEchoServer. The parameter is the port used by the application UdpEchoServerHelper echoServer (9); //Let's put the server in the second node ApplicationContainer serverApps = echoServer.Install (nodes.Get (1)); //All servers applications (only one in this case) will run from second 1 to second 10 serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0)); //The UdpEchoServerHelper will create UdpEchoServers. The first parameter is the ipv4 address //of the server, the second is the remote port Ipv4Address serverAddress = interfaces.GetAddress (1); UdpEchoClientHelper echoClient (serverAddress, 9); //Configures the Maximun number of packets sent in this simulation (only one) echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); //Says how long to wait beetween packets echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.))); //The name says it all, what is the size of the packet echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); //Install the client in the first node ApplicationContainer clientApps = echoClient.Install (nodes.Get (0)); //All client applications (only one in this case) will generate traffic from second 1 to second 10 clientApps.Start (Seconds (2.0)); clientApps.Stop (Seconds (10.0)); Simulator::Run (); //Runs the simulation and the function only returns after the sim is finished Simulator::Destroy (); //Clean up the objects created for the sim return 0; }
To run, copy the example to scratch/first.cc and execute
./waf --run=scratch/first
If you don't have, first install mercurial:
sudo aptitude install mercurial
Optionally, install bazaar to fetch the PyBindGen:
sudo aptitude install bzr
Now go get ns-3:
hg clone http://code.nsnam.org/ns-3-allinone
Get the latest ns-3 developer version with ns-3 regression traces:
./download.py -n ns-3-dev -r ns-3-dev-ref-traces
Configure ns-3:
cd ns-3-dev ./waf configure
Build ns-3 (may take a while):
./waf build
Run a simple example:
./waf --run=first
Today I was hearing Steve Gibson's podcast, Security Now, which was about the new Internet Explorer 8.
And I'm truly amazed. Finally there is one feature in an IE that I wish to see on Firefox.
The url bar of IE 8 highlights the domain part of the URL. The letters of the top domain are black, while the rest of the URL is a light gray.

This helps the user to identify what is the site that he is visiting, and is a first barrier against phishing attacks.
I've never though I would say this: Good idea Microsoft!
Now it's just wait for Firefox implement it also.
Just a small note: I only have linux so I can't try IE8. The image of the url bar was stolen from this site.
Update: It's already on Firefox. Thanks to Ben McDonald for the comment.
The Locationbar2 extension does exactly this functionality. Checkout out the image:

Hurray for free software!
Just a disclaimer: I've never done a "real" web app. My opinion in the following subject is extremely fragile and can be easily refuted.
A long long time ago, my father, while I was studying for the Database Systems course, asked me (ironically) if I could explain him what's the use for Foreign Keys on today's databases.
And the truth, after all these years, I still haven't been able to give him an explanation.
Fourth generation programming languages (I'm talking about SQL) were designed to be usable by non-programmer in a simple way. It was supposed for "clients" of a database to interact directly with the data through a very high level language.
Fortunately this has never happened, and the communication with databases is always wrapped by some kind of code (sometimes with an ORM framework).
Foreign keys are constraints which serve to guarantee data integrity. They are useful in the hypothetical situation where clients could tamper with the data directly. And, as nothing comes free, ensuring this constraints costs important CPU cycles.
Today's applications don't rely on these mechanisms to guarantee database integrity. It is the wrapper around the DB that ensures it.
So the question is: in applications where it is important to optimize database queries why use foreign keys?? And this leads to another question, why don't companies supply DBMS that don't have the foreign keys functionalities??
Can anyone answer this?
ps: In my applications I don't explicitly set foreign keys. Even if the performance is not a requirement. It just seems stupid to use something that shouldn't be there.
ps2: To make my opinion even clearer: I don't believe foreign keys in today's Relational DBMS have any relevance. They are just a performance penalty.
