MAE-10 Winter 2010 Final Exam: Code Analysis and Problem Solving

MAE-10 Winter Quarter 2010 Final Examination

Instructions: You have until the end of the class period to complete the exam. Notes on both sides of an 8.5”x11” sheet of paper are allowed. Closed book. No calculators.

Section 1: Short Answer (2 points each)

(1.1) How many rows & columns in arrays W & Z?

X = [-1 : 2 : 3];
Y = [3 : -2 : -1];
W = [X Y];
Z = [X; Y];

(1.2) How many data lines will be plotted on the figure generated by the following code?

T = (0:1:10);
X = T.^2;
Y = X.^2;
plot(T, 
Read More

Zune Software UI Configuration Parameters

ZAlternatesChooser

  • Bg_Type_Std = 2
  • Bg_Stretch_Std = 5
  • Bg_Color_Std = 0
  • Bg_Opacity_Std = 100
  • Border_Type_Std = 2
  • Border_Left_Stretch_Std = 6
  • Border_Right_Stretch_Std = 6
  • Border_Top_Stretch_Std = 6
  • Border_Bottom_Stretch_Std = 6
  • Border_Opacity_Std = 100
  • Padding_Left = 5
  • Padding_Right = 5
  • Padding_Top = 4
  • Padding_Bottom = 4
  • Spacing_H1 = 2

ZAlternatesItem

  • Bg_Type_H = 2
  • Bg_Type_Std = 0
  • Bg_Stretch_H = 5
  • Bg_Opacity_H = 100
  • Bg_Opacity_Std = 0
  • Padding_Left = 4
  • Padding_Right = 4
  • Padding_Top = 4
  • Padding_Bottom = 4

ZAlternatesList

  • Bg_Type_
Read More

Tkinter Application for Data Management with File Handling

Tkinter Application for Data Management

This document outlines a Python application built using the Tkinter library for managing data. It includes features for file handling, data display in a Treeview widget, and search functionalities.

Importing Libraries

The application starts by importing necessary modules:

from tkinter import *
from tkinter import ttk, messagebox
from tkinter import filedialog as fl
import os.path
import pickle

Main Window Setup

A main window titled “Datos” is created with a size

Read More

Client-Server Communication in C: Examples and Code

Client Program Example (AF_INET, Stream)

This is an example of a client program using the AF_INET family type and stream sockets that sends messages to a server program. The functions leer_linea and escribir_linea are assumed to be defined in the file comun.c.


void escribir_mensaje(int s);

int main() {
    int sd;
    struct sockaddr_in dirser;

    if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
        perror("Error creating socket");
        return 1;
    }

    dirser.sin_family = AF_INET;
Read More

Java AWT Components: Buttons, Lists, Text Fields, and More

Buttons

Buttons can be created with objects using the operator new:

Button button; button = new Button("Button");

Used in CADNA creation, the button will appear when displayed on the screen. This is also what CADNA will return to use when identifying the button event.

Button Events

One-touch button events can be captured by overloading the method action():

public boolean action(Event evt, Object obj) {
    if (evt.target instanceof Button)
        System.out.println((String) obj);
    else

Read More

Database Schema and Queries for Hockey League

Table Structures

Equipo Table

— Table structure for table Equipo

DROP TABLE IF EXISTS Equipo;

CREATE TABLE Equipo (

team_id int(11) NOT NULL,

teamName varchar(45) DEFAULT NULL,

PRIMARY KEY (team_id)

Estadísticas_Equipo Table

— Table structure for table Estadísticas_Equipo

DROP TABLE IF EXISTS Estadísticas_Equipo;

CREATE TABLE Estadísticas_Equipo (

game_id int(11) NOT NULL,

team_id int(11) NOT NULL,

tgoals int(11) DEFAULT NULL,

tshots int(11) DEFAULT NULL,

thits int(11) DEFAULT NULL,

PRIMARY KEY (game_id,team_

Read More