lundi 4 février 2013

Adding headers button to a ListView

Here is an example showing how to add headers button to a ListView

Button btn1 = new Button(MyActivity.this);
btn1.setText("button1");
btn1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
btn1.setGravity(Gravity.CENTER);
btn1.setOnClickListener(new OnClickListener() {   
 @Override
 public void onClick(View v) {
  // do something
 }
});
Button btn2 = new Button(MyActivity.this);
btn2.setText("button2");
btn2.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
btn2.setGravity(Gravity.CENTER);
btn2.setOnClickListener(new OnClickListener() {   
 @Override
 public void onClick(View v) {
  // do something
 }
});
        
LinearLayout layout = new LinearLayout(this);  
layout.setOrientation(LinearLayout.HORIZONTAL);  
layout.setLayoutParams(new ListView.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));  
layout.setGravity(Gravity.CENTER);  
layout.addView(btn1);  
layout.addView(btn2);
myList.addHeaderView(layout);//or getListView().addHeaderView(layout);

lundi 14 janvier 2013

Building its own Linux distribution


Preparing for Linux build

Host System Requirements

Before going further you need to check some requirements on the host system. Here at pastebin you can find the version checking file.
After download, run $bash version-check.sh. You can also create it locally directly from the terminal as follow:
$cat > version-check.sh << "EOF"
>Paste here the content from pastebin
>EOF
Here is a possible output, you should have packages with at least similar version or higher than this output.
In my case, I had to install gawkpatch, and makeinfo. You may have trubble to install the last one, it is available in texinfo package. Here are the issued installation commands:
$sudo aptitude install gawk
$sudo aptitude install patch
$sudo aptitude install texinfo

Preparing a new partition

I'm using xubuntu running on a VirtualBox, to create a partition I added a new device to my virtual machine: Configuration->Storage -> select the disk controller -> add new disk. I used GParted to create new partitions.
To create a filesystem on the created partition: $sudo mke2fs -jv /dev/
In my case I used the existing swap partition in the host system.
After setting the filesystem, the partition need to be mounted:
$export LFS=/mnt/lfs
$sudo mkdir -pv $LFS
$sudo mount -v -t ext3 /dev/ $LFS

After that, I created a directory under /mnt/lfs to store downloaded packagaes before installation.

$sudo mkdir -v $LFS/sources
$sudo chmod -v a+wt $LFS/sources


I used wget to download needed packages, here is a complete list of packages to download. I first created a file to store this list as follow:

$cat > wget-list << "EOF"
>Paste here the content of packages list
>EOF


To start downloading, it took a while depending on the available bandwidth: 
$sudo wget -i wget-list -P $LFS/sources 
In the list you man-pages-3.35.tar.gz and zlib-1.2.6.tar.bz2 were missings, I had to download them manually by google the package name.

Changing the owner of from root to lfs.



When I was trying to configure GCC, i get following error error: C compiler cannot create executables. After some search, it seams that the $LFS_TGT variable was not set correctly as a result of creating a directory with user  root instead lfs , and thus I had to restart from scratch.

repeat from section 2.2 building binutils-2.2
5.4. Binutils-2.22

to be continued.

lundi 10 décembre 2012

Push notifications with Parse.com

Parse.com provides a set of handy tools to rapidly build mobile applications that needs back-end. One of the main provided features is the push notifications that enables asynchronous and real-time communiation. This post illustrates how to set up the push mechnism in an Android application.
  • First, we need to create an Account at Parse.com and register an application to have an application key and client key
  • Second, in the application settings wen have to enable push notifications
  • Then, download the latestes Parse SDK, i.e. the parse.jar
  • Finally, code time
In the manifest, we need to add the following lines to ask permessions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
<uses-permission android:name="android.permission.VIBRATE" />
Then, before the </application> register a broadcast receiver
<receiver android:name=".PushReceiver">
   <intent-filter>  
 <action android:name="com.telethonix.NOTIFICATION"> </action>
   </intent-filter>
</receiver>
Then create the PushReceiver class as follow:
public class PushReceiver extends BroadcastReceiver {
   public final static String TAG = PushReceiver.class.getSimpleName(); 
   @Override
   public void onReceive(Context context, Intent intent) {     
      try {
 Bundle extras = intent.getExtras();        
 String message = extras != null ? extras.getString("com.parse.Data") : "";    
 Log.i(TAG, "Received message: "+message);
       // do something with the received data
      } catch (JSONException e) {
 e.printStackTrace();
      }  
   }
}
Finnaly in the main activity, we should initiate parse with the application keys, and send a notification
String app_id     = "your application key";
String client_key = "your client key";
Parse.initialize(this, app_id, client_key);
// subscribe to be notified
PushService.subscribe(MainActivity.this, "channel", MainActivity.class);
// push a message
ParsePush push = new ParsePush(); push.setChannel("channel");
push.setData(data);
push.sendInBackground(new SendCallback(){   
   @Override
   public void done(ParseException arg0){
      Log.i(TAG, "push sent done!");
   }
});
More details at Push Developer Guide.

mercredi 5 décembre 2012

J2EE Solution Logs

Changing the context root of a dynamic web app URL (StackOverflow)
  1. Right click on the project in the project explorer tab, the choose properties.
  2. Set the new context root in the Web Project Settings.
Exception when launching jetty (StackOverflow)
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
It seems that jetty cannot find the asm.jar file in its classpath, check this as follow:
  1. On eclipse, go to the Servers view (or open it via window -> view -> Servers)
  2. Right click on jetty, then choose Open or just type F3
  3. On the Overview tab, click on Open Lauchn Configuration
  4. Go to Classpath tab and check for asm.jar
If you cannot find it, then you should manually download it from the project website.

Register a listener to do things before the VM exits (even if you "Ctrl-C" the running example before it's completed)
private void registerShutdownHook() {
   Runtime.getRuntime().addShutdownHook( new Thread() {
      @Override
      public void run() {
         // do some thing
      }
   });
}

Increase Maven memory, in mvn.bat add:
set MAVEN_OPTS=-Xmx2048m -XX:MaxPermSize=512m

To be continued

samedi 17 novembre 2012

Notes on Operations Management

The dimensions used to measure performance of an operation and to differenciate it from other operations are:
  • Cost and efficiency,
  • Variety for supporting heterogensous customer
  • Quality of the operation can be divided into product quality and process quality (does the promise hold?)
  • Time and responsiveness
for example in case of a restaurant operations, the cost can be measured with indicators like number of served customer per employee or number of customer per restaurant (in case someone want to rent a restaurant), the heterogenity can be measured by the number of items in the menu, the quality can be measured by heigienity, the responsivness can be measured by the waiting time before serving.

It is impossible to out perform in all these dimensions, that's why as a manager/consultant you need to find a compromise; priorities dimensions.
Step1. Help making operational trade-offs (picture).
Example call center of a large retail bank, at the service level, the objective is 80% of incoming calls wait less than 20s, and the starting point is 30% of incoming calls wait less than 20s.
Here, the problem is the staffing levels of call centers with respect on efficiency. In fact, very short waiting time leads to frequent operator idle time. While long waiting times means the operators are fully utilized.
Step2. Overcome inefficiencies ny providing tools to identify and eliminate inefficiency
Example: Benchmarking of the market shows the pattern in the picture where the inefficiency of a given operation is the difference to the competitor with better productivity (less cost) and better responsiveness (less waiting time).
The curve that hold the competitor operations is the ineffecieny frontier that the operation should go beyond (to the right side).
Step 3. Evaluate proposed redesign/new technologies before they occur by answering questions like what will happen if we develop / purchase technology X? Are better technologies always nice to have? but will they pay?

Example in the picture the innovation related to the process redesign lead to a new frontier.

Module 1; business process analysis
To measure the performance of a business process three dimensions flow rate (throughput), inventiry and flow time.

Subway example: sitting in front of the store and counts number of arrival (flow rate) and departure and draw the corresponding cumulative customers number based on time. The difference at any time between both graphs represent the number of customers currently in the system.

Definitions:
Flow Unit: customer or Sandwich
Flow rate/throughput: number of flow units going through the process per unit of time
Flow Time: time it takes a flow unit to go from the beginning to the end of the process
Inventory: the number of flow units in the process at a given moment in time

Process Analysis: examples.
            Immigration department        MBA program                Auto company
Flow unit  Applications                   Student                      Car
Flow rate  Approved or rejected cases     Graduating class             Sales per year
Flow Time  Processing time                2 years                      60 days
Inventory  Pending cases                  Total campus population      inventory

Finding the bottleneck
Figure 1 processing/activity times (time needed for serving a customer in a given station) in subway example.

Drawing a Process Flow Diagram:
Triangles captures waiting time in a queue or some delay while boxes capture an activity. Arrows capture the flow of the process.
Process managemebnt is about doing things repeatdly, where project management deals.

Basic Process Vocabulary:
Processing times: how long does the worker spend on the task?
Capacity=1/processing time: how many units can the worker make per unit of time. If there are m workers at the activity: Capacity=m/processing time.
Bottleneck: process step with the lowest capacity
Process capacity: capacity of the bottleneck
Flow rate: Minimum{Demand rate, Process Capacity}
Uitilization: Flow rate / Capacity
Flow Time: The amount of time it takes a flow unit to go through the process
Inventory: The number of flow units in the system

Session 3: Labor cost and labor utilization
Labor Productivity Measures
Some definitions:
*Cycle time CT = 1/Flow Rate
Direct Labor Content = p1 + p2 + p3 + p4 (p stands for process)
If one worker per resource then we define
Direct Idle Time= (CT-p1) + (CT-p2) + (CT-p3)

*Average labor utilization = labor content / (labor content + direct idle time)
*Cost of direct labor = Total wages per unit of time / Flow Rate per unit of time
In an example of using these definition, calculate based on the Proccessing time: Capacity of each resource, its process capacity, flow rate, cycle time (which is the porcessing time of the bottleneck), idle time for (which is cycle time minus processing time) each resource, total idle time, labor content, labor utilization, utilization.

The Role of Labor Costs in Manufacturing (The Auto Industry):
While labor costs appear small at first, they are important:
 - look relative to value added
 - role up costs throughout the value chain

Implications
 - also hunt for pennies (e.g. line balancing)
 - spread operational excellence through the value chain

mercredi 14 novembre 2012

Android Solution Logs

Get a bitmap from an ImageView (StackOverflow)
imageView.setDrawingCacheEnabled(true);
imageView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), 
                   MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
imageView.layout(0, 0, imageView.getMeasuredWidth(), imageView.getMeasuredHeight()); 
imageView.buildDrawingCache(true);
Bitmap bmap = Bitmap.createBitmap(imageView.getDrawingCache());
imageView.setDrawingCacheEnabled(false);

Display the soft keyboard (StackOverflow)
// show keyboard
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
// hide keyboard
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(),0); 

Check whether the software keyboard is displayed (StackOverflow)
final View activityRootView = findViewById(R.id.activityRoot);
activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
    Rect r = new Rect();
    //r will be populated with the coordinates of your view that area still visible.
    activityRootView.getWindowVisibleDisplayFrame(r);

    int heightDiff = activityRootView.getRootView().getHeight() - (r.bottom - r.top);
    if (heightDiff > 100) { // if more than 100 pixels, its probably a keyboard...
        ... do something here
    }
 }
});

Get the root view of current activity (StackOverflow)
View rootView = getWindow().getDecorView().findViewById(android.R.id.content)

Canvas drawing example on Android, link.
Draw text on canvas with a custom font (StackOverflow)
Paint paint = new Paint(); 
paint.setStyle(Paint.Style.FILL);     
paint.setColor(Color.WHITE); 
paint.setTextSize(30);
Typeface tf = Typeface.create("Helvetica", Typeface.BOLD);
paint.setTypeface(tf);     
Canvas canvas = new Canvas(bitmap);     
canvas.drawText(text, x, y, paint);

Gesture event detection (snippets)
  • Implements android.view.GestureDetector.OnGestureListener interface
  • Create a new GestureDetector instance: detector = new  GestureDetector(this, this)
  • Call detector.onTouchEvent(event) on the activity onTouchEvent(event)
Detecting touch event (Android Coding).

Display action bar (StackOverflow)

Capture a frame from a video (change since API 14
protected Bitmap videoFrame(String uriString, long msec) {  
  MediaMetadataRetriever retriever = new MediaMetadataRetriever();
  try {                         
     if (Build.VERSION.SDK_INT >= 14) {       
        Map<String, String> headers = new HashMap<String, String>();
        retriever.setDataSource(uriString, headers);
     }else {
        Uri uri = Uri.parse(uriString);
        retriever.setDataSource(context, uri);
     }                     
     return retriever.getFrameAtTime(msec);
  } catch (Exception ex) {
         ex.printStackTrace();
  } finally {
     try {
        retriever.release();
     } catch (RuntimeException ex) {
     }
  }
  return null;
}

Share content via intents (tutorial), sharing image (StackOverflow), set title (StackOverflow)
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Here is the share content body";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));

Customized looking TabActivity (link).

Use Intent share to invoke a Twitter application to post text+image (StackOverflow)
private void share(String nameApp, String imagePath) {
    List<Intent> targetedShareIntents = new ArrayList<Intent>();
    Intent share = new Intent(android.content.Intent.ACTION_SEND);
    share.setType("image/jpeg");
    List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(share, 0);
    if (!resInfo.isEmpty()){
        for (ResolveInfo info : resInfo) {
            Intent targetedShare = new Intent(android.content.Intent.ACTION_SEND);
            targetedShare.setType("image/jpeg"); // put here your mime type

            if (info.activityInfo.packageName.toLowerCase().contains(nameApp) || 
                    info.activityInfo.name.toLowerCase().contains(nameApp)) {
                targetedShare.putExtra(Intent.EXTRA_TEXT,     "My body of post/email");
                targetedShare.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagePath)) );
                targetedShare.setPackage(info.activityInfo.packageName);
                targetedShareIntents.add(targetedShare);
            }
        }

        Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(0), "Select app to share");
        chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedShareIntents.toArray(new Parcelable[]{}));
        startActivity(chooserIntent);
    }
}

Display pictures of a specific folder in the Gallery app (StackOverflow)
To be continued.

mardi 13 novembre 2012

IP Routing

1. Routing Basics:

- static routing: the administrator must hand-type all network locations into the routing table;
- dynamic routing: a protocol on one router communicates with the same protocol running on neighbor routers. The routers then update each other about all the network they know about.
The command 'show ip route' display the routing table content.
In the command's output, the 'C' means that the networks listed are 'directly connected', and until adding a routing protocol (RIP, EIGRP, ...), we'll have only directed connected networks.

1.1. The IP Routing Process:

The command 'show ip arp' display the ARP cache, in the output, the dash (-) means that this is the physical interface on the router. Cisco routers will keep an entry in the ARP table for 4 hours.
"When a ping fail, most administrator think the packet never reached the destination host. Taht's not always the case, all it takes is for just one of the remote routers to be lacking a route back to the originating host's network and the packet is dropped on the return trip, not on its way to teh host".
If a packet is lost on the way back to the originating host, you'll get a "request time out" message because it is an unknown error. If the error occurs because of a known issue, such as if a route is not in the routing table on the way to the destination device, you will see a destination unreachable message.
Hardware addresses are always local, and they never pass a router's interface.

1.2. Testing Your IP routing Undestanding

In figure 6.7 (p 380), the Lab_A router has received the packet and will send it out Fa0/0 onto LAN toward the server. The source MAC address will be the Lab_A router's  Fa0/0 interface, and the destination will be the Sales server's MAC address. (All MAC addresses must be local on the LAN).
Host 4 is displaying two web documents from the Sales server in two different browser windows at the same time. TCP port numbers are used to direct the data to the correct application window.

1.3. Configuring IP Routing: (p 382)
steps to configure a router: erase startup-config, then reload, hostname, secret password, motd banner, interfaces (ip address, description, no shutdown, [rate clock, exec-timeout]), console, aux and telnet passwords, save a backup of the running config.
special configuration of a wireless interface, SSID is the Service Set IDentifier that creates a wireless network that hosts can connect to. The interface is a routed one, which is the reason why the IP address is placed under the physical interface--typically the IP address would be placed under he management VLAN or Bridge-Group Virtual Interface (BVI).
- The 'guest-mode' line means that the interface will broadcast the SSID so wireless hosts can connect to this interface.
- The 'Authentification open' means no authentification.
- The 'infrastructure-ssid' indicates that this interface can be used to communicate to other access points or other devices on the infrastructure.
Then, we need to configure the DHCP pool for the wireless clients:
- create the pool name 'ip dhcp pool Admin'.
- annd the network/subnet and gateway 'network 10.1.8.0 255.255.255.0', 'default-router 10.1.8.1'.
- exclude addresses you don't want handed out (like default gateway) 'ip dhcp excluded-address @'.

2. Configuring IP Routing in Our Network (p 403)

2.1. Static Routing:

It occurs when you manually add routes in each router's routing table.
ip route [destination_network] [mask] [next-hop_address or exitinterface] [administrative_distance] [perment].
- permanet: If the interface is shut down or the router can't communicate to the next-hop router, the route will automatically be discarded from the routing table. With this option you keep the entry in the routing table no matter what happens.

2.1.1. Corp

Each routing table automatically includes directly connected networks. To be able to route to all networks within the internetwork, the routing table must include information that describes where these networks are locaed and how to get them.

If you have two link between two routers, give to one a higher administrative-distance value, to make it a backup route if the other link fails. Static routing can't handle multiple links to the same destination. On the routing table, the route with the lower AD will be displayed only if the currently used link fails.
If you use exit interface instead of next-hop, you'll see the static routes as directly connected. And you don't need the "permanent" option.
To use default routing: ip route 0.0.0.0 0.0.0.0 10.1.11.1
                                ip classless
2.2. Default Routing: (p 415)
To create a default route, type:
      ip route 0.0.0.0 0.0.0.0 [next_hop or exit_interface]
      ip classless
If you show up the routing table, you'll see an S* which indicates that it's a candidate default route.
the command "ip default-network [next_hop]" can be used to define a default gateway.

3. Dynamic Routing (p 418)
Dynamic routing is when protocols are used to find networks and update routing tables. A routing protocol defines the set of rules used by a router when it commmunicates routing information between neighbor routers.

3.1. Routing Protocol Basics

3.1.1. Administrative Distances

The AD is used to rate the trustworthiness of routing information received on a router from a neighbor router. It is an integer from 0 (most trusted) to 255(means no traffioic will be passed via this route). If a router receives two updates listing the same remote network, the router checks the AD and choose the one with the lowest value to put in the routing table.
The following table show the default administrative distances used by a Cisco router.
Route Source            Default AD
Connected interface        0
Static route                     1
EIGRP                            90
IGRP                              100
OSPF                             110
RIP                                 120
External EIGRP             170
Unknown                       255 (this route will never be used)

3.1.2. Routing Protocols

- Distance vector: The route with the least number of hops to the network is determined to be the best route. Both RIP and IGRP are distance-vector routing protocols. They send the entire routing table to directly connected neighbors.
- Link state: alos called shortest-path-first protocols, each router create three tables, one keeps track to directly attached neighbors, one determine the topology of the entire internetwork, and one as the routing table. OPSF is completely link state.
- Hybrid: Those ones use aspects of bith type, like EIGRP.

4. Distance-Vector Routing Protocols (p 420)
The distance-vector routing algorithm passes complete routing table contents to neighboring routers. In case of having multiple links to the same network, the Administrative Distance is checked first. If the AD is same, the protocol will have to use other metrics to determine the best path.
RIP uses only hop count to determine the best path to a network. If more than one link exist for a remote network, RIP would consider them equal in term of cost. This little snag is called "pinhole congestion".

4.1. Routing Loops (p 421)
If a network ourtage happens, plus the slow convergence of distance-vector routing protocols can result in inconsistent routing tables and routing loops. Routings loops can occur because every router isn't updated simultaneously, or even close to it.

4.2. Maximum Hop Count:

The previous problem is called "counting to infinity", by defining a "maximum hop count" will allow solving that problem. RIP permits a hop count of up 15, anything that requires 16 hops is deemed unreachable and make the routing entries invalid.

4.3. Split Horizon:

The routing protocols differentiate which interface a network route was learned on, and once this is determined, it won't advertise the route back out that same interface.

4.4. Route Poisoning

When a network goes down, the directly attached router (router A) initiates route poisoning by advertising or unreachable (sometimes referred to as infinite). This poisoning of the route keeps the router B from being susceptible to incorrect updates about the route to network. When router B receives a route poisoning from RouterA, it sends an update, called a "poison revers" back to RouterA. This ensures that all routes on the segment have received the poisoned route information.

4.5. Holddowns

It prevents regular update messages from reinstating a route that is going up and down (called flapping). It prevents routes from changing too rapidly by allowing time for either the downed route to come back up or the network to stabilize somewhat before changing to the next best route. This also tell routers to restrict, for a specific time period, changes that might affect recently removed routes.

5. Routing Information Protocol (RIP) (page 424)
RIP sends hte complete routing table out to all active interfaces every 30s. RIP works well with small network. RIPv1 is classful (doesn't send subnet mask related information) instead of RIPv2 which is classless, it provides something called prefix routing and send subnet mask related information.

5.1. RIP Timers

- Route update timer: sets the interval between periodic routing updates.
- Route invalid timer: Determines the time that must elapse (180s) without receiving route updates to deemed that a route has become invalid.
- Holddown timer: Sets the amount of time during which routing information is suppressed. Routes will enter into holddown state when an update packet is received that indicated the route is unreachable. this continues either until an update packet is received with a better metric or until the holddown timer expires.
- Route flush timer: Sets the time between a route becoming invalid and its removal from the routing table.

5.2. Configuring RIP Routing

To configure RIP routing, use "router rip" and tell the RIP routing protocol which networks to advertise "netword remote_network".

5.3. Verifying the RIP Routing Tables (p 428)
5.4. Configuring RIP Routing Example 2

5.5. Holding Down RIP Propagations

The "passive-interface" command prevents RIP updates from being sent out a specified interface, yet that same interface can still receive RIP updates.

5.6. RIP Version 2 (RIPv2)

RIPv2, unlike RIPv1, is a classless routing protocol, it can support Variable Length Subnet Masks (VLSMs) as well as the summarization of network boundaries. It can support discontiguous networking.
example:
router rip
network 192.168.40.0
network 192.168.50.0
version 2
6. Interior Gateway Routing Protocol (IGRP) p 433
The main difference between RIP and IGRP is that when configuring IGRP, you supply the autonomous system number. All routers must use the same number in order to share routing table information.
IGRP is no longer supported in CISCO routers, use instead EIGRP.
7. Verifying Your Configurations (p 434)
The following commands can be used to verify the routed and routing protocols configured on CISCO routers:
- show ip route
- show ip protocols
- debug ip rip

7.1. The show ip protocols Command

This command shows you the routing protocols that are configured on the router.
- Troubleshooting with the show ip protocols Command
use command "show ip protocol" and "show ip interface brief" to see which interfaces are in a specific network.

7.2. The debug ip rip Command:

This command display, at the session console, the routing updates as they are sent and received. If you're telnetted to a router you've to use the terminal monitor command to view the debug output.