Generics (Γενικότθτα)

Μέγεθος: px
Εμφάνιση ξεκινά από τη σελίδα:

Download "Generics (Γενικότθτα)"

Transcript

1 Generics (Γενικότθτα) Μποροφμε να καταςκευάςουμε ΑΤΔ που επιτρζπει χριςθ με διαφορετικοφσ Τφπουσ Δεδομζνων ςτο ίδιο πρόγραμμα; Π.χ. Μια ςτοίβα με char* και μια με int 1

2 Goals of this Lecture Help you learn about: Generic modules Data structures that can store multiple types of data Functions that can work on multiple types of data How to create generic modules in C Which wasn t designed with generic modules in mind! Why? Reusing existing code is easier/cheaper than writing new code; reuse reduces software costs Generic modules are more reusable than non-generic ones A power programmer knows how to create generic modules A power programmer knows how to use existing generic modules to create large programs 2

3 Generic Data Structures Example Stack /* stack.h */ typedef struct Stack *Stack_T; Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const char *item); char *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); Items are strings (type char*) 3

4 Generic Data Structures Example Stack operations (push, pop, top, etc.) make sense for items other than strings too So Stack module could (and maybe should) be generic Problem: How to make Stack module generic? How to define Stack module such that a Stack object can store items of any type? 4

5 Generic Data Structures via typedef Solution 1: Let clients define item type (G2) /* client.c */ struct Item { char *str; /* Or whatever is appropriate */ ; Stack_T s; struct Item item; item.str = "hello"; s = Stack_new(); Stack_push(s, item); /* stack.h */ typedef struct Item *Item_T; typedef struct Stack *Stack_T; Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, Item_T item); Item_T Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); 5

6 Generic Data Structures via typedef Problem: Awkward for client to define structure type and create structures of that type Problem: Client (or some other module in same program) might already use Item_T for some other purpose! Problem: Client might need two Stack objects holding different types of data!!! We need another approach 6

7 Generic Data Structures via void* Solution 2: The generic pointer (void*) (G3) /* stack.h */ typedef struct Stack *Stack_T; Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const void *item); void *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); 7

8 Generic Data Structures via void* Can assign a pointer of any type to a void /* client.c */ pointer Stack_T s; s = Stack_new(); Stack_push(s, "hello"); /* stack.h */ typedef struct Stack *Stack_T; OK to match an actual parameter of type char* with a formal parameter of type void* Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const void *item); void *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); 8

9 Generic Data Structures via void* Can assign a void pointer to a pointer of any type /* client.c */ char *str; Stack_T s; s = Stack_new(); Stack_push(s, "hello"); /* stack.h */ str = Stack_top(s); typedef struct Stack *Stack_T; OK to assign a void* return value to a char* Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const void *item); void *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); 9

10 Generic Data Structures via void* Problem: Client must know what type of data a void pointer is pointing to /* client.c */ int *i; Stack_T s; s = Stack_new(); Stack_push(s, "hello"); i = Stack_top(s); Client pushes a string Client considers retrieved value to be a pointer to an int! Legal!!! Trouble!!! Solution: None Void pointers subvert the compiler s type checking Programmer s responsibility to avoid type mismatches 10

11 Generic Data Structures via void* Problem: Stack items must be pointers E.g. Stack items cannot be of primitive types (int, double, etc.) /* client.c */ int i = 5; Stack_T s; s = Stack_new(); Stack_push(s, 5); Stack_push(s, &i); Not OK to match an actual parameter of type int with a formal parameter of type void* OK, but Solution: none awkward In C, there is no mechanism to create truly generic data structures (In C++: Use template classes and template functions) (In Java: Use generic classes) 11

12 Generic Algorithms Example Suppose we wish to add another function to the Stack module /* stack.h */ typedef struct Stack *Stack_T; Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const void *item); void *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); int Stack_areEqual(Stack_T s1, Stack_T s2); Returns 1 (TRUE) iff s1 and s2 are equal, that is, contain equal items in the same order 12

13 Generic Algorithm Attempt 1 Attempt 1 /* stack.c */ int Stack_areEqual(Stack_T s1, Stack_T s2) { return s1 == s2; Returns 0 (FALSE) Incorrect! /* client.c */ char str1[] = "hi"; char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); if (Stack_areEqual(s1,s2)) { Checks if s1 and s2 are identical, not equal Compares pointers, not items That s not what we want 13

14 Addresses vs. Values Suppose two locations in memory have the same value int i=5; int j=5; 5 The addresses of the variables are not the same That is (&i == &j) is FALSE Need to compare the values themselves That is (i == j) is TRUE Unfortunately, comparison operation is type specific The == works for integers and floating-point numbers But not for strings and more complex data structures i j 5 14

15 Generic Algorithm Attempt 2 Attempt 2 /* stack.c */ int Stack_areEqual(Stack_T s1, Stack_T s2) { struct Node *p1 = s1->first; struct Node *p2 = s2->first; while ((p1!= NULL) && (p2!= NULL)) { if (p1!= p2) return 0; p1 = p1->next; p2 = p2->next; if ((p1!= NULL) (p2!= NULL)) return 0; return 1; Checks if nodes are identical Compares pointers, not items That is still not what we want /* client.c */ char str1[] = "hi"; char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); if (Stack_areEqual(s1,s2)) { Returns 0 (FALSE) Incorrect! 15

16 Generic Algorithm Attempt 3 Attempt 3 /* stack.c */ int Stack_areEqual(Stack_T s1, Stack_T s2) { struct Node *p1 = s1->first; struct Node *p2 = s2->first; while ((p1!= NULL) && (p2!= NULL)) { if (p1->item!= p2->item) return 0; p1 = p1->next; p2 = p2->next; if ((p1!= NULL) (p2!= NULL)) return 0; return 1; /* client.c */ Checks if items are identical Compares pointers to items, not items themselves That is still not what we want char str1[] = "hi"; char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); if (Stack_areEqual(s1,s2)) { Returns 0 (FALSE) Incorrect! 16

17 Attempt 4 Generic Algorithm Attempt 4 /* stack.c */ int Stack_areEqual(Stack_T s1, Stack_T s2) { struct Node *p1 = s1->first; struct Node *p2 = s2->first; while ((p1!= NULL) && (p2!= NULL)) { if (strcmp(p1->item, p2->item)!= 0) return 0; p1 = p1->next; p2 = p2->next; if ((p1!= NULL) (p2!= NULL)) return 0; /* client.c */ return Checks 1; if items are equal That s what we want But strcmp() works only if items are strings! We need Stack_areEqual() to be generic How to compare values when we don t know their type? char str1[] = "hi"; char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); if (Stack_areEqual(s1,s2)) { Returns 1 (TRUE) Correct! 17

18 Generic Algorithm via Function Pointer Approach 5 /* stack.h */ typedef struct Stack *Stack_T; Stack_T Stack_new(void); void Stack_free(Stack_T s); void Stack_push(Stack_T s, const void *item); void *Stack_top(Stack_T s); void Stack_pop(Stack_T s); int Stack_isEmpty(Stack_T s); int Stack_areEqual(Stack_T s1, Stack_T s2, int (*cmp)(const void *item1, const void *item2)); Add parameter to Stack_areEqual() Pointer to a compare function, which Accepts two const void * parameters, and Returns an int Allows client to supply the function that Stack_areEqual() should call to compare items 18

19 Generic Algorithm via Function Pointer Approach 5 (cont.) /* stack.c */ int Stack_areEqual(Stack_T s1, Stack_T s2, int (*cmp)(const void *item1, const void *item2)) { struct Node *p1 = s1->first; struct Node *p2 = s2->first; while ((p1!= NULL) && (p2!= NULL)) { if ((*cmp)(p1->item, p2->item)!= 0) return 0; p1 = p1->next; p2 = p2->next; if ((p1!= NULL) (p2!= NULL)) return 0; return 1; Definition of Stack_areEqual() uses the function pointer to call the clientsupplied compare function Stack_areEqual() calls back into client code 19

20 Generic Algorithm via Function Pointer Approach 5 (cont.) /* client.c */ int strcompare(const void *item1, const void *item2) { char *str1 = item1; char *str2 = item2; return strcmp(str1, str2); char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); if (Stack_areEqual(s1,s2,strCompare)) { Returns 1 (TRUE) Correct! Client passes address of strcompare() to Stack_areEqual() Client defines callback function, and passes pointer to it to Stack_areEqual() Callback function must match Stack_areEqual() parameter exactly 20

21 Generic Algorithm via Function Pointer Alternative: Client defines more natural callback function, and casts it to match Stack_areEqual() parameter Approach 5 (cont.) /* client.c */ int strcompare(const char *str1, const char *str2) { return strcmp(str1, str2); char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); Cast operator if (Stack_areEqual(s1, s2, (int (*)(const void*, const void*))strcompare)) { 21

22 Generic Algorithm via Function Pointer Approach 5 (cont.) /* client.c */ char str2[] = "hi"; Stack_T s1 = Stack_new(); Stack_T s2 = Stack_new(); Stack_push(s1, str1); Stack_push(s2, str2); Cast operator if (Stack_areEqual(s1, s2, (int (*)(const void*, const void*))strcmp)) { Alternative (for string comparisons only): Simply use strcmp() with cast! 22

23 Summary Generic data structures Via item typedef Safe, but not realistic Via the generic pointer (void*) Limiting: items must be pointers Dangerous: subverts compiler type checking The best we can do in C (See C++ template classes and Java generics for other approaches) Generic algorithms Via function pointers and callback functions 23

24 Genericity Υλοποίθςθ Ενοτιτων (Modules) ςτθν C και Γενικότθτα (Genericity) Modularity No Modularity (0) Απόκρυψθ Πράξεων (ΜΑ) (1) Απόκρυψθ Δεδομζνων και Πράξεων (ΠΑ)(2,3) + - ΤΣ κακοριςμζνοσ ςτον κϊδικα, χωρίσ αφαίρεςθ ΌΧΙ (Demo Mod 0) ΌΧΙ λόγω G (Demo Mod 1) ΌΧΙ λόγω G (Demo Mod 3+2) ζλεγχοσ μεταγλϊττιςθσ 1 μόνο ΤΣ, Αλλαγι ΤΣ απαιτεί Αλλαγι Υλοποίθςθσ ΑΤΔ, απαιτεί recompilation ΤΣ #include ςε.h (και αντίςτοιχο.c) ΌΧΙ λόγω Modularity NAI με Προςοχι όπωσ ουρά 1θσ άςκθςθσ Αλλαγι ΤΣ δεν απαιτεί αλλαγι ΝΑΙ (απλό με πολλά πλεονεκτιματα) υλοποίθςθσ ΑΤΔ, ζλεγχοσ ουρά 2θσ άςκθςθσ μεταγλϊττιςθσ 1 μόνο ΤΣ, Αλλαγι ΤΑ απαιτεί recompilation ΤΣ (Πλιρθσ απόκρυψθ και ΤΣ *Τ)(παράμετροι ςυναρτιςεων και data του ΑΤΔ είναι *Τ) ΌΧΙ λόγω Modularity Χωρίσ ιδιαίτερο όφελοσ ΝΑΙ, απαιτεί καλι χριςθ δεικτϊν Mod 3 Gen 1-T (SetValue απλουςτεφεται)(compare) Αλλαγι ΤΣ δεν απαιτεί αλλαγι υλοποίθςθσ ΑΤΔ, δεν απαιτεί recompilation, ζλεγχοσ μεταγλϊττιςθσ 1 μόνο ΤΣ ΤΣ (Πλιρθσ απόκρυψθ ΤΣ *Τ)(παράμετροι ςυναρτιςεων και data του ΑΤΔ είναι void*) ΌΧΙ λόγω Modularity Χωρίσ ιδιαίτερο όφελοσ Χριςιμθ για βιβλιοκικεσ, απαιτεί πολλά-τσ, ςτακερι υλοποίθςθ ΑΤΔ, καλοφσ ελζγχουσ. Mod 3 Gen n-type δεν απαιτεί recompilation (compare) χωρίσ ζλεγχο μεταγλϊττιςθσ + Καλι προςζγγιςθ, προςοχι ςτθν άμεςθ χριςθ ςτον Τφπο. Η καλφτερθ απόκρυψθ 1 ΤΣ μπορεί να καλφπτει πολλοφσ τφπουσ με union Να αποφεφγεται εντελϊσ, καμία - απόκρυψθ Κίνδυνοι άμεςθσ πρόςβαςθσ ςτον ΤΑ, αλλοίωςθ απόκρυψθσ Διαχειριηόμαςτε δείκτεσ και όχι structs 24

Goals of this Lecture. Generics(Γενικότητα) Generic Data Structures Example. Generic Data Structures Example

Goals of this Lecture. Generics(Γενικότητα) Generic Data Structures Example. Generic Data Structures Example Generics(Γενικότητα) Μπορούμε να κατασκευάσουμε ΑΤΔ που επιτρέπει χρήση με διαφορετικούς Τύπους Δεδομένων στο ίδιο πρόγραμμα; Π.χ. Μια στοίβα με char* και μια με int Goals of this Lecture Help you learn

Διαβάστε περισσότερα

The Simply Typed Lambda Calculus

The Simply Typed Lambda Calculus Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and

Διαβάστε περισσότερα

Χαρακτηριστικά ενοτήτων

Χαρακτηριστικά ενοτήτων Χαρακτηριστικά ενοτήτων 1 Στόχοι Πώς να δημιουργήσεις ενότητες υψηλής ποιότητας στην C. Γιατί χρειάζεται; Η αφαίρεση είναι απαραίτητη τεχνική για την ανάπτυξη και κατανόηση μεγάλων, πολύπλοκλων συστημάτων

Διαβάστε περισσότερα

2 Composition. Invertible Mappings

2 Composition. Invertible Mappings Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,

Διαβάστε περισσότερα

Instruction Execution Times

Instruction Execution Times 1 C Execution Times InThisAppendix... Introduction DL330 Execution Times DL330P Execution Times DL340 Execution Times C-2 Execution Times Introduction Data Registers This appendix contains several tables

Διαβάστε περισσότερα

HY150a Φροντιστήριο 3 24/11/2017

HY150a Φροντιστήριο 3 24/11/2017 HY150a Φροντιστήριο 3 24/11/2017 1 Assignment 3 Overview Το πρόγραμμα ζητείται να διαβάζει μια λίστα δεδομένων που περιγράφει τα διαθέσιμα τμήματα μνήμης (blocks) ενός ΗΥ. Το πρόγραμμα ζητείται να μεταφορτώνει

Διαβάστε περισσότερα

Other Test Constructions: Likelihood Ratio & Bayes Tests

Other Test Constructions: Likelihood Ratio & Bayes Tests Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Αν κάπου κάνετε κάποιες υποθέσεις να αναφερθούν στη σχετική ερώτηση. Όλα τα αρχεία που αναφέρονται στα προβλήματα βρίσκονται στον ίδιο φάκελο με το εκτελέσιμο

Διαβάστε περισσότερα

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required) Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts

Διαβάστε περισσότερα

EE512: Error Control Coding

EE512: Error Control Coding EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3

Διαβάστε περισσότερα

Finite Field Problems: Solutions

Finite Field Problems: Solutions Finite Field Problems: Solutions 1. Let f = x 2 +1 Z 11 [x] and let F = Z 11 [x]/(f), a field. Let Solution: F =11 2 = 121, so F = 121 1 = 120. The possible orders are the divisors of 120. Solution: The

Διαβάστε περισσότερα

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 5: Component Adaptation Environment (COPE)

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 5: Component Adaptation Environment (COPE) EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 5: Component Adaptation Environment (COPE) Performing Static Analysis 1 Class Name: The fully qualified name of the specific class Type: The type of the class

Διαβάστε περισσότερα

Μηχανική Μάθηση Hypothesis Testing

Μηχανική Μάθηση Hypothesis Testing ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Μηχανική Μάθηση Hypothesis Testing Γιώργος Μπορμπουδάκης Τμήμα Επιστήμης Υπολογιστών Procedure 1. Form the null (H 0 ) and alternative (H 1 ) hypothesis 2. Consider

Διαβάστε περισσότερα

derivation of the Laplacian from rectangular to spherical coordinates

derivation of the Laplacian from rectangular to spherical coordinates derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used

Διαβάστε περισσότερα

SOAP API. https://bulksmsn.gr. Table of Contents

SOAP API. https://bulksmsn.gr. Table of Contents SOAP API https://bulksmsn.gr Table of Contents Send SMS...2 Query SMS...3 Multiple Query SMS...4 Credits...5 Save Contact...5 Delete Contact...7 Delete Message...8 Email: sales@bulksmsn.gr, Τηλ: 211 850

Διαβάστε περισσότερα

Models for Probabilistic Programs with an Adversary

Models for Probabilistic Programs with an Adversary Models for Probabilistic Programs with an Adversary Robert Rand, Steve Zdancewic University of Pennsylvania Probabilistic Programming Semantics 2016 Interactive Proofs 2/47 Interactive Proofs 2/47 Interactive

Διαβάστε περισσότερα

ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ & ΑΛΓΟΡΙΘΜΟΙ ΕΡΓΑΣΤΗΡΙΟ

ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ & ΑΛΓΟΡΙΘΜΟΙ ΕΡΓΑΣΤΗΡΙΟ ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ & ΑΛΓΟΡΙΘΜΟΙ ΕΡΓΑΣΤΗΡΙΟ Κωδικός Θ: ΤΠ3001, Κωδικός Ε: ΤΠ3101 (ΜΕΥ/Υ) Ώρες (Θ - Ε): 4-2 Προαπαιτούμενα: Δρ. ΒΙΔΑΚΗΣ ΝΙΚΟΣ ΕΡΓΑΣΤΗΡΙΟ 6 Στοίβα (Stack) Stack Introduction Stack is one of the

Διαβάστε περισσότερα

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016 Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Dynamic types, Lambda calculus machines Apr 21 22, 2016 1 Dynamic types and contracts (a) To make sure you understand the

Διαβάστε περισσότερα

TMA4115 Matematikk 3

TMA4115 Matematikk 3 TMA4115 Matematikk 3 Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet Trondheim Spring 2010 Lecture 12: Mathematics Marvellous Matrices Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet

Διαβάστε περισσότερα

Lecture 2. Soundness and completeness of propositional logic

Lecture 2. Soundness and completeness of propositional logic Lecture 2 Soundness and completeness of propositional logic February 9, 2004 1 Overview Review of natural deduction. Soundness and completeness. Semantics of propositional formulas. Soundness proof. Completeness

Διαβάστε περισσότερα

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.

Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible. B-Trees Index files can become quite large for large main files Indices on index files are possible 3 rd -level index 2 nd -level index 1 st -level index Main file 1 The 1 st -level index consists of pairs

Διαβάστε περισσότερα

About these lecture notes. Simply Typed λ-calculus. Types

About these lecture notes. Simply Typed λ-calculus. Types About these lecture notes Simply Typed λ-calculus Akim Demaille akim@lrde.epita.fr EPITA École Pour l Informatique et les Techniques Avancées Many of these slides are largely inspired from Andrew D. Ker

Διαβάστε περισσότερα

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο Procedures and Functions Stored procedures and functions are named blocks of code that enable you to group and organize a series of SQL and PL/SQL

Διαβάστε περισσότερα

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/

Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Μορφοποίηση υπό όρους : Μορφή > Μορφοποίηση υπό όρους/γραμμές δεδομένων/μορφοποίηση μόο των κελιών που περιέχουν/ Συνάρτηση round() Περιγραφή Η συνάρτηση ROUND στρογγυλοποιεί έναν αριθμό στον δεδομένο

Διαβάστε περισσότερα

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch: HOMEWORK 4 Problem a For the fast loading case, we want to derive the relationship between P zz and λ z. We know that the nominal stress is expressed as: P zz = ψ λ z where λ z = λ λ z. Therefore, applying

Διαβάστε περισσότερα

Section 8.3 Trigonometric Equations

Section 8.3 Trigonometric Equations 99 Section 8. Trigonometric Equations Objective 1: Solve Equations Involving One Trigonometric Function. In this section and the next, we will exple how to solving equations involving trigonometric functions.

Διαβάστε περισσότερα

Homework 3 Solutions

Homework 3 Solutions Homework 3 Solutions Igor Yanovsky (Math 151A TA) Problem 1: Compute the absolute error and relative error in approximations of p by p. (Use calculator!) a) p π, p 22/7; b) p π, p 3.141. Solution: For

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ 133: ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΕΦΗΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial ΕΡΓΑΣΤΗΡΙΟ 3 Javadoc Tutorial Introduction Το Javadoc είναι ένα εργαλείο που παράγει αρχεία html (παρόμοιο με τις σελίδες στη διεύθυνση http://docs.oracle.com/javase/8/docs/api/index.html) από τα σχόλια

Διαβάστε περισσότερα

Φροντιςτήριο. Linked-List

Φροντιςτήριο. Linked-List Φροντιςτήριο Linked-List 1 Linked List Μια linked list είναι μια ακολουθία από ςυνδεδεμένουσ κόμβουσ Κάθε κόμβοσ περιέχει τουλάχιςτον Μια πληροφορία (ή ένα struct) Δείκτη ςτον επόμενο κόμβο τησ λίςτασ

Διαβάστε περισσότερα

Test Data Management in Practice

Test Data Management in Practice Problems, Concepts, and the Swisscom Test Data Organizer Do you have issues with your legal and compliance department because test environments contain sensitive data outsourcing partners must not see?

Διαβάστε περισσότερα

Example Sheet 3 Solutions

Example Sheet 3 Solutions Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note

Διαβάστε περισσότερα

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1 Lab 1: C/C++ Pointers and time.h Panayiotis Charalambous 1 Send email to totis@cs.ucy.ac.cy Subject: EPL231-Registration Body: Surname Firstname ID Group A or B? Panayiotis Charalambous 2 Code Guidelines:

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα είναι μικρότεροι το 1000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Διάρκεια: 3,5 ώρες Καλή

Διαβάστε περισσότερα

Statistical Inference I Locally most powerful tests

Statistical Inference I Locally most powerful tests Statistical Inference I Locally most powerful tests Shirsendu Mukherjee Department of Statistics, Asutosh College, Kolkata, India. shirsendu st@yahoo.co.in So far we have treated the testing of one-sided

Διαβάστε περισσότερα

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook Βήμα 1: Step 1: Βρείτε το βιβλίο που θα θέλατε να αγοράσετε και πατήστε Add to Cart, για να το προσθέσετε στο καλάθι σας. Αυτόματα θα

Διαβάστε περισσότερα

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1

Lab 1: C/C++ Pointers and time.h. Panayiotis Charalambous 1 Lab 1: C/C++ Pointers and time.h Panayiotis Charalambous 1 Send email to totis@cs.ucy.ac.cy Subject: EPL231-Registration Body: Surname Firstname ID Group A or B? Panayiotis Charalambous 2 Code Guidelines:

Διαβάστε περισσότερα

4.6 Autoregressive Moving Average Model ARMA(1,1)

4.6 Autoregressive Moving Average Model ARMA(1,1) 84 CHAPTER 4. STATIONARY TS MODELS 4.6 Autoregressive Moving Average Model ARMA(,) This section is an introduction to a wide class of models ARMA(p,q) which we will consider in more detail later in this

Διαβάστε περισσότερα

Στοίβες - Ουρές. Στοίβα (stack) Γιάννης Θεοδωρίδης, Νίκος Πελέκης, Άγγελος Πικράκης Τµήµα Πληροφορικής

Στοίβες - Ουρές. Στοίβα (stack) Γιάννης Θεοδωρίδης, Νίκος Πελέκης, Άγγελος Πικράκης Τµήµα Πληροφορικής Στοίβες - Ουρές Γιάννης Θεοδωρίδης, Νίκος Πελέκης, Άγγελος Πικράκης Τµήµα Πληροφορικής οµές εδοµένων 1 Στοίβα (stack) οµή τύπουlifo: Last In - First Out (τελευταία εισαγωγή πρώτη εξαγωγή) Περιορισµένος

Διαβάστε περισσότερα

ST5224: Advanced Statistical Theory II

ST5224: Advanced Statistical Theory II ST5224: Advanced Statistical Theory II 2014/2015: Semester II Tutorial 7 1. Let X be a sample from a population P and consider testing hypotheses H 0 : P = P 0 versus H 1 : P = P 1, where P j is a known

Διαβάστε περισσότερα

The challenges of non-stable predicates

The challenges of non-stable predicates The challenges of non-stable predicates Consider a non-stable predicate Φ encoding, say, a safety property. We want to determine whether Φ holds for our program. The challenges of non-stable predicates

Διαβάστε περισσότερα

Every set of first-order formulas is equivalent to an independent set

Every set of first-order formulas is equivalent to an independent set Every set of first-order formulas is equivalent to an independent set May 6, 2008 Abstract A set of first-order formulas, whatever the cardinality of the set of symbols, is equivalent to an independent

Διαβάστε περισσότερα

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω 0 1 2 3 4 5 6 ω ω + 1 ω + 2 ω + 3 ω + 4 ω2 ω2 + 1 ω2 + 2 ω2 + 3 ω3 ω3 + 1 ω3 + 2 ω4 ω4 + 1 ω5 ω 2 ω 2 + 1 ω 2 + 2 ω 2 + ω ω 2 + ω + 1 ω 2 + ω2 ω 2 2 ω 2 2 + 1 ω 2 2 + ω ω 2 3 ω 3 ω 3 + 1 ω 3 + ω ω 3 +

Διαβάστε περισσότερα

Modbus basic setup notes for IO-Link AL1xxx Master Block

Modbus basic setup notes for IO-Link AL1xxx Master Block n Modbus has four tables/registers where data is stored along with their associated addresses. We will be using the holding registers from address 40001 to 49999 that are R/W 16 bit/word. Two tables that

Διαβάστε περισσότερα

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Fourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics Fourier Series MATH 211, Calculus II J. Robert Buchanan Department of Mathematics Spring 2018 Introduction Not all functions can be represented by Taylor series. f (k) (c) A Taylor series f (x) = (x c)

Διαβάστε περισσότερα

Lecture 34 Bootstrap confidence intervals

Lecture 34 Bootstrap confidence intervals Lecture 34 Bootstrap confidence intervals Confidence Intervals θ: an unknown parameter of interest We want to find limits θ and θ such that Gt = P nˆθ θ t If G 1 1 α is known, then P θ θ = P θ θ = 1 α

Διαβάστε περισσότερα

Fractional Colorings and Zykov Products of graphs

Fractional Colorings and Zykov Products of graphs Fractional Colorings and Zykov Products of graphs Who? Nichole Schimanski When? July 27, 2011 Graphs A graph, G, consists of a vertex set, V (G), and an edge set, E(G). V (G) is any finite set E(G) is

Διαβάστε περισσότερα

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.

Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά. Διαστημικό εστιατόριο του (Μ)ΑστροΈκτορα Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά. Μόλις μια παρέα πελατών κάτσει σε ένα

Διαβάστε περισσότερα

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Chapter 6: Systems of Linear Differential. be continuous functions on the interval Chapter 6: Systems of Linear Differential Equations Let a (t), a 2 (t),..., a nn (t), b (t), b 2 (t),..., b n (t) be continuous functions on the interval I. The system of n first-order differential equations

Διαβάστε περισσότερα

ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ

ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΙΣΑΓΩΓΗ ΣΤΟN ΠΡΟΓΡΑΜΜΑΤΙΣΜΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΑΤΡΩΝ ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ Η/Υ ΚΑΙ ΠΛΗΡΟΦΟΡΙΚΗΣ Εμβέλεια Μεταβλητών Εμβέλεια = το τμήμα του προγράμματος στο οποίο έχει ισχύ ή είναι ορατή η μεταβλητή.

Διαβάστε περισσότερα

Partial Differential Equations in Biology The boundary element method. March 26, 2013

Partial Differential Equations in Biology The boundary element method. March 26, 2013 The boundary element method March 26, 203 Introduction and notation The problem: u = f in D R d u = ϕ in Γ D u n = g on Γ N, where D = Γ D Γ N, Γ D Γ N = (possibly, Γ D = [Neumann problem] or Γ N = [Dirichlet

Διαβάστε περισσότερα

Συστήματα Διαχείρισης Βάσεων Δεδομένων

Συστήματα Διαχείρισης Βάσεων Δεδομένων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 9: Transactions - part 1 Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών Tutorial on Undo, Redo and Undo/Redo

Διαβάστε περισσότερα

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.

Exercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1. Exercises 0 More exercises are available in Elementary Differential Equations. If you have a problem to solve any of them, feel free to come to office hour. Problem Find a fundamental matrix of the given

Διαβάστε περισσότερα

ΑΦAΙΡΕΤΙΚΟΣ (ή ΑΦΗΡΗΜΕΝΟΣ) ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT) - σύνολο δεδομένων (data, objects) - σύνολο πράξεων στα δεδομένα

ΑΦAΙΡΕΤΙΚΟΣ (ή ΑΦΗΡΗΜΕΝΟΣ) ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT) - σύνολο δεδομένων (data, objects) - σύνολο πράξεων στα δεδομένα Τύπος Δεδομένων: ΑΦAΙΡΕΤΙΚΟΣ (ή ΑΦΗΡΗΜΕΝΟΣ) ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT) - σύνολο δεδομένων (data, objects) - σύνολο πράξεων στα δεδομένα - Ένας ΑΤΔ είναι ένα μαθηματικό μοντέλο (οντότητα)

Διαβάστε περισσότερα

Concrete Mathematics Exercises from 30 September 2016

Concrete Mathematics Exercises from 30 September 2016 Concrete Mathematics Exercises from 30 September 2016 Silvio Capobianco Exercise 1.7 Let H(n) = J(n + 1) J(n). Equation (1.8) tells us that H(2n) = 2, and H(2n+1) = J(2n+2) J(2n+1) = (2J(n+1) 1) (2J(n)+1)

Διαβάστε περισσότερα

6.3 Forecasting ARMA processes

6.3 Forecasting ARMA processes 122 CHAPTER 6. ARMA MODELS 6.3 Forecasting ARMA processes The purpose of forecasting is to predict future values of a TS based on the data collected to the present. In this section we will discuss a linear

Διαβάστε περισσότερα

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ting Zhang Stanford May 11, 2001 Stanford, 5/11/2001 1 Outline Ordinal Classification Ordinal Addition Ordinal Multiplication Ordinal

Διαβάστε περισσότερα

( ) 2 and compare to M.

( ) 2 and compare to M. Problems and Solutions for Section 4.2 4.9 through 4.33) 4.9 Calculate the square root of the matrix 3!0 M!0 8 Hint: Let M / 2 a!b ; calculate M / 2!b c ) 2 and compare to M. Solution: Given: 3!0 M!0 8

Διαβάστε περισσότερα

C.S. 430 Assignment 6, Sample Solutions

C.S. 430 Assignment 6, Sample Solutions C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order

Διαβάστε περισσότερα

Section 7.6 Double and Half Angle Formulas

Section 7.6 Double and Half Angle Formulas 09 Section 7. Double and Half Angle Fmulas To derive the double-angles fmulas, we will use the sum of two angles fmulas that we developed in the last section. We will let α θ and β θ: cos(θ) cos(θ + θ)

Διαβάστε περισσότερα

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β 3.4 SUM AND DIFFERENCE FORMULAS Page Theorem cos(αβ cos α cos β -sin α cos(α-β cos α cos β sin α NOTE: cos(αβ cos α cos β cos(α-β cos α -cos β Proof of cos(α-β cos α cos β sin α Let s use a unit circle

Διαβάστε περισσότερα

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο

Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων. Εξάμηνο 7 ο Εργαστήριο Ανάπτυξης Εφαρμογών Βάσεων Δεδομένων Εξάμηνο 7 ο Oracle SQL Developer An Oracle Database stores and organizes information. Oracle SQL Developer is a tool for accessing and maintaining the data

Διαβάστε περισσότερα

Διδάσκων: Κωνσταντίνος Κώστα Διαφάνειες: Δημήτρης Ζεϊναλιπούρ

Διδάσκων: Κωνσταντίνος Κώστα Διαφάνειες: Δημήτρης Ζεϊναλιπούρ Διάλεξη 10: Λίστες Υλοποίηση & Εφαρμογές Στην ενότητα αυτή θα μελετηθούν τα εξής επιμέρους θέματα: Ευθύγραμμες Απλά Συνδεδεμένες Λίστες (εύρεση, εισαγωγή, διαγραφή) Σύγκριση Συνδεδεμένων Λιστών με Πίνακες

Διαβάστε περισσότερα

ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT)

ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT) Τύπος Δεδομένων: ΑΦAΙΡΕΤΙΚΟΣ (ή ΑΦΗΡΗΜΕΝΟΣ) ΤΥΠΟΣ ΔΕΔΟΜΕΝΩΝ (ΑΤΔ) (Abstract Data Type-ADT) - σύνολο δεδομένων (data, objects) - σύνολο πράξεων στα δεδομένα - Ένας ΑΤΔ είναι ένα μαθηματικό μοντέλο (οντότητα)

Διαβάστε περισσότερα

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Όλοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι του 10000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Αν κάπου κάνετε κάποιες υποθέσεις

Διαβάστε περισσότερα

Solutions to the Schrodinger equation atomic orbitals. Ψ 1 s Ψ 2 s Ψ 2 px Ψ 2 py Ψ 2 pz

Solutions to the Schrodinger equation atomic orbitals. Ψ 1 s Ψ 2 s Ψ 2 px Ψ 2 py Ψ 2 pz Solutions to the Schrodinger equation atomic orbitals Ψ 1 s Ψ 2 s Ψ 2 px Ψ 2 py Ψ 2 pz ybridization Valence Bond Approach to bonding sp 3 (Ψ 2 s + Ψ 2 px + Ψ 2 py + Ψ 2 pz) sp 2 (Ψ 2 s + Ψ 2 px + Ψ 2 py)

Διαβάστε περισσότερα

Code Breaker. TEACHER s NOTES

Code Breaker. TEACHER s NOTES TEACHER s NOTES Time: 50 minutes Learning Outcomes: To relate the genetic code to the assembly of proteins To summarize factors that lead to different types of mutations To distinguish among positive,

Διαβάστε περισσότερα

Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2)

Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2) Ανάπτυξη Μεγάλων Εφαρµογών στη Γλώσσα C (2) Στην ενότητα αυτή θα µελετηθούν τα εξής επιµέρους θέµατα: Οργάνωση Προγράµµατος Header Files Μετάφραση και σύνδεση αρχείων προγράµµατος ΕΠΛ 132 Αρχές Προγραµµατισµού

Διαβάστε περισσότερα

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ Ενότητα 12: Συνοπτική Παρουσίαση Ανάπτυξης Κώδικα με το Matlab Σαμαράς Νικόλαος Άδειες Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται σε άδειες χρήσης Creative Commons.

Διαβάστε περισσότερα

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8  questions or comments to Dan Fetter 1 Eon : Fall 8 Suggested Solutions to Problem Set 8 Email questions or omments to Dan Fetter Problem. Let X be a salar with density f(x, θ) (θx + θ) [ x ] with θ. (a) Find the most powerful level α test

Διαβάστε περισσότερα

Section 9.2 Polar Equations and Graphs

Section 9.2 Polar Equations and Graphs 180 Section 9. Polar Equations and Graphs In this section, we will be graphing polar equations on a polar grid. In the first few examples, we will write the polar equation in rectangular form to help identify

Διαβάστε περισσότερα

SUPERPOSITION, MEASUREMENT, NORMALIZATION, EXPECTATION VALUES. Reading: QM course packet Ch 5 up to 5.6

SUPERPOSITION, MEASUREMENT, NORMALIZATION, EXPECTATION VALUES. Reading: QM course packet Ch 5 up to 5.6 SUPERPOSITION, MEASUREMENT, NORMALIZATION, EXPECTATION VALUES Readig: QM course packet Ch 5 up to 5. 1 ϕ (x) = E = π m( a) =1,,3,4,5 for xa (x) = πx si L L * = πx L si L.5 ϕ' -.5 z 1 (x) = L si

Διαβάστε περισσότερα

Paper Reference. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing. Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes

Paper Reference. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing. Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes Centre No. Candidate No. Paper Reference(s) 1776/04 Edexcel GCSE Modern Greek Paper 4 Writing Thursday 21 May 2009 Afternoon Time: 1 hour 15 minutes Materials required for examination Nil Paper Reference

Διαβάστε περισσότερα

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1

Practice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1 Conceptual Questions. State a Basic identity and then verify it. a) Identity: Solution: One identity is cscθ) = sinθ) Practice Exam b) Verification: Solution: Given the point of intersection x, y) of the

Διαβάστε περισσότερα

ΠΛΗ111. Ανοιξη Μάθηµα 4 ο. Στοίβα. Τµήµα Ηλεκτρονικών Μηχανικών και Μηχανικών Υπολογιστών Πολυτεχνείο Κρήτης

ΠΛΗ111. Ανοιξη Μάθηµα 4 ο. Στοίβα. Τµήµα Ηλεκτρονικών Μηχανικών και Μηχανικών Υπολογιστών Πολυτεχνείο Κρήτης ΠΛΗ111 οµηµένος Προγραµµατισµός Ανοιξη 2005 Μάθηµα 4 ο Στοίβα Τµήµα Ηλεκτρονικών Μηχανικών και Μηχανικών Υπολογιστών Πολυτεχνείο Κρήτης Ανασκόπηση Αφηρηµένος Τύπος εδοµένων Στοίβα Υλοποίηση µε Πίνακα Υλοποίηση

Διαβάστε περισσότερα

Εισαγωγή στην Γλώσσα Προγραμματισμού Python. 12/10/16 1

Εισαγωγή στην Γλώσσα Προγραμματισμού Python. 12/10/16 1 Εισαγωγή στην Γλώσσα Προγραμματισμού Python 12/10/16 costis@teicrete.gr 1 Διάφορες Γλώσσες Προγραμματισμού C or C++ Java Perl Scheme Fortran Python Matlab 12/10/16 costis@teicrete.gr 2 Περίληψη Παρουσίασης

Διαβάστε περισσότερα

Numerical Analysis FMN011

Numerical Analysis FMN011 Numerical Analysis FMN011 Carmen Arévalo Lund University carmen@maths.lth.se Lecture 12 Periodic data A function g has period P if g(x + P ) = g(x) Model: Trigonometric polynomial of order M T M (x) =

Διαβάστε περισσότερα

Κατανεμημένα Συστήματα. Javascript LCR example

Κατανεμημένα Συστήματα. Javascript LCR example Κατανεμημένα Συστήματα Javascript LCR example Javascript JavaScript All JavaScript is the scripting language of the Web. modern HTML pages are using JavaScript to add functionality, validate input, communicate

Διαβάστε περισσότερα

Bounding Nonsplitting Enumeration Degrees

Bounding Nonsplitting Enumeration Degrees Bounding Nonsplitting Enumeration Degrees Thomas F. Kent Andrea Sorbi Università degli Studi di Siena Italia July 18, 2007 Goal: Introduce a form of Σ 0 2-permitting for the enumeration degrees. Till now,

Διαβάστε περισσότερα

Block Ciphers Modes. Ramki Thurimella

Block Ciphers Modes. Ramki Thurimella Block Ciphers Modes Ramki Thurimella Only Encryption I.e. messages could be modified Should not assume that nonsensical messages do no harm Always must be combined with authentication 2 Padding Must be

Διαβάστε περισσότερα

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation Overview Transition Semantics Configurations and the transition relation Executions and computation Inference rules for small-step structural operational semantics for the simple imperative language Transition

Διαβάστε περισσότερα

Πανεπιστήμιο Δυτικής Μακεδονίας. Τμήμα Μηχανικών Πληροφορικής & Τηλεπικοινωνιών. Ηλεκτρονική Υγεία

Πανεπιστήμιο Δυτικής Μακεδονίας. Τμήμα Μηχανικών Πληροφορικής & Τηλεπικοινωνιών. Ηλεκτρονική Υγεία Τμήμα Μηχανικών Πληροφορικής & Τηλεπικοινωνιών Ηλεκτρονική Υγεία Ενότητα: Use Case - an example of ereferral workflow Αν. καθηγητής Αγγελίδης Παντελής e-mail: paggelidis@uowm.gr Τμήμα Μηχανικών Πληροφορικής

Διαβάστε περισσότερα

Σημειώσεις όγδοης εβδομάδας

Σημειώσεις όγδοης εβδομάδας Σημειώσεις όγδοης εβδομάδας Για να την δημιουργία σειριακών αρχείων, χρησιμοποιείται η fopen(filename, w ). Το αρχείο δημιουργείται στον ίδιο φάκελο που τρέχει το εκτελέσιμο πρόγραμμα. Το παρακάτω πρόγραμμα,

Διαβάστε περισσότερα

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade Για να ελέγξετε το λογισμικό που έχει τώρα η συσκευή κάντε κλικ Menu > Options > Device > About Device Versions. Στο πιο κάτω παράδειγμα η συσκευή έχει έκδοση λογισμικού 6.0.0.546 με πλατφόρμα 6.6.0.207.

Διαβάστε περισσότερα

Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3. Prepared by Costantinos Costa Edited by George Nikolaides. EPL 451 - Data Mining on the Web

Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3. Prepared by Costantinos Costa Edited by George Nikolaides. EPL 451 - Data Mining on the Web EPL 451 - Data Mining on the Web Web Data Mining ΕΡΓΑΣΤΗΡΙΟ 2 & 3 Prepared by Costantinos Costa Edited by George Nikolaides Semester Project Microsoft Malware Classification Challenge (BIG 2015) More info:

Διαβάστε περισσότερα

(C) 2010 Pearson Education, Inc. All rights reserved.

(C) 2010 Pearson Education, Inc. All rights reserved. Connectionless transmission with datagrams. Connection-oriented transmission is like the telephone system You dial and are given a connection to the telephone of fthe person with whom you wish to communicate.

Διαβάστε περισσότερα

Προγραμματισμός Ι. Δομές Δεδομένων. Δημήτρης Μιχαήλ. Ακ. Έτος Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο

Προγραμματισμός Ι. Δομές Δεδομένων. Δημήτρης Μιχαήλ. Ακ. Έτος Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο Προγραμματισμός Ι Δομές Δεδομένων Δημήτρης Μιχαήλ Τμήμα Πληροφορικής και Τηλεματικής Χαροκόπειο Πανεπιστήμιο Ακ. Έτος 2009-2010 Δομές Δεδομένων Μια δομή δεδομένων είναι μια συλλογή δεδομένων με κάποιες

Διαβάστε περισσότερα

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2)

Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών NP-Completeness (2) x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 11 13 21

Διαβάστε περισσότερα

Chapter 29. Adjectival Participle

Chapter 29. Adjectival Participle Chapter 29 Adjectival Participle Overview (29.3-5) Definition: Verbal adjective Function: they may function adverbially or adjectivally Forms: No new forms because adverbial and adjectival participles

Διαβάστε περισσότερα

Démographie spatiale/spatial Demography

Démographie spatiale/spatial Demography ΠΑΝΕΠΙΣΤΗΜΙΟ ΘΕΣΣΑΛΙΑΣ Démographie spatiale/spatial Demography Session 1: Introduction to spatial demography Basic concepts Michail Agorastakis Department of Planning & Regional Development Άδειες Χρήσης

Διαβάστε περισσότερα

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΑ ΤΜΗΜΑ ΝΑΥΤΙΛΙΑΚΩΝ ΣΠΟΥΔΩΝ ΠΡΟΓΡΑΜΜΑ ΜΕΤΑΠΤΥΧΙΑΚΩΝ ΣΠΟΥΔΩΝ ΣΤΗΝ ΝΑΥΤΙΛΙΑ

ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΑ ΤΜΗΜΑ ΝΑΥΤΙΛΙΑΚΩΝ ΣΠΟΥΔΩΝ ΠΡΟΓΡΑΜΜΑ ΜΕΤΑΠΤΥΧΙΑΚΩΝ ΣΠΟΥΔΩΝ ΣΤΗΝ ΝΑΥΤΙΛΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΑ ΤΜΗΜΑ ΝΑΥΤΙΛΙΑΚΩΝ ΣΠΟΥΔΩΝ ΠΡΟΓΡΑΜΜΑ ΜΕΤΑΠΤΥΧΙΑΚΩΝ ΣΠΟΥΔΩΝ ΣΤΗΝ ΝΑΥΤΙΛΙΑ ΝΟΜΙΚΟ ΚΑΙ ΘΕΣΜΙΚΟ ΦΟΡΟΛΟΓΙΚΟ ΠΛΑΙΣΙΟ ΚΤΗΣΗΣ ΚΑΙ ΕΚΜΕΤΑΛΛΕΥΣΗΣ ΠΛΟΙΟΥ ΔΙΠΛΩΜΑΤΙΚΗ ΕΡΓΑΣΙΑ που υποβλήθηκε στο

Διαβάστε περισσότερα

Inverse trigonometric functions & General Solution of Trigonometric Equations. ------------------ ----------------------------- -----------------

Inverse trigonometric functions & General Solution of Trigonometric Equations. ------------------ ----------------------------- ----------------- Inverse trigonometric functions & General Solution of Trigonometric Equations. 1. Sin ( ) = a) b) c) d) Ans b. Solution : Method 1. Ans a: 17 > 1 a) is rejected. w.k.t Sin ( sin ) = d is rejected. If sin

Διαβάστε περισσότερα

Διάλεξη 14: Δομές Δεδομένων ΙΙI (Λίστες και Παραδείγματα)

Διάλεξη 14: Δομές Δεδομένων ΙΙI (Λίστες και Παραδείγματα) Τμήμα Πληροφορικής Πανεπιστήμιο Κύπρου ΕΠΛ132 Αρχές Προγραμματισμού II Διάλεξη 14: Δομές Δεδομένων ΙΙI (Λίστες και Παραδείγματα) Δημήτρης Ζεϊναλιπούρ http://www.cs.ucy.ac.cy/courses/epl132 14-1 Περιεχόμενο

Διαβάστε περισσότερα

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.

DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0. DESIGN OF MACHINERY SOLUTION MANUAL -7-1! PROBLEM -7 Statement: Design a double-dwell cam to move a follower from to 25 6, dwell for 12, fall 25 and dwell for the remader The total cycle must take 4 sec

Διαβάστε περισσότερα

ΑΥΤΟΜΑΤΟΠΟΙΗΣΗ ΜΟΝΑΔΑΣ ΘΡΑΥΣΤΗΡΑ ΜΕ ΧΡΗΣΗ P.L.C. AUTOMATION OF A CRUSHER MODULE USING P.L.C.

ΑΥΤΟΜΑΤΟΠΟΙΗΣΗ ΜΟΝΑΔΑΣ ΘΡΑΥΣΤΗΡΑ ΜΕ ΧΡΗΣΗ P.L.C. AUTOMATION OF A CRUSHER MODULE USING P.L.C. ΤΕΧΝΟΛΟΓΙΚΟ ΕΚΠΑΙΔΕΥΤΙΚΟ ΙΔΡΥΜΑ ΑΝ. ΜΑΚΕΔΟΝΙΑΣ ΚΑΙ ΘΡΑΚΗΣ ΣΧΟΛΗ ΤΕΧΝΟΛΟΓΙΚΩΝ ΕΦΑΡΜΟΓΩΝ ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ Τ.Ε ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ ΑΥΤΟΜΑΤΟΠΟΙΗΣΗ ΜΟΝΑΔΑΣ ΘΡΑΥΣΤΗΡΑ ΜΕ ΧΡΗΣΗ P.L.C. AUTOMATION OF A

Διαβάστε περισσότερα

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3 Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3 1 State vector space and the dual space Space of wavefunctions The space of wavefunctions is the set of all

Διαβάστε περισσότερα

Reminders: linear functions

Reminders: linear functions Reminders: linear functions Let U and V be vector spaces over the same field F. Definition A function f : U V is linear if for every u 1, u 2 U, f (u 1 + u 2 ) = f (u 1 ) + f (u 2 ), and for every u U

Διαβάστε περισσότερα

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with Week 03: C lassification of S econd- Order L inear Equations In last week s lectures we have illustrated how to obtain the general solutions of first order PDEs using the method of characteristics. We

Διαβάστε περισσότερα

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =

Διαβάστε περισσότερα

Matrices and Determinants

Matrices and Determinants Matrices and Determinants SUBJECTIVE PROBLEMS: Q 1. For what value of k do the following system of equations possess a non-trivial (i.e., not all zero) solution over the set of rationals Q? x + ky + 3z

Διαβάστε περισσότερα