Monday, June 15, 2009

OPERRSEA Assigment

Operating Research


Quantitative analysis
Quantitative analyst in finance, someone who applies mathematics, among others stochastic calculus, to finance.
Quantitative analysis (chemistry), in analytical chemistry, the measurements of quantities of substances produced in reactions rather than simply noting the nature of the reactions
Quantitative analysis may also be:
Statistics and statistical analysis techniques rather than the use of mathematical material in social science.


Decision theory model
Decision theory in mathematics and statistics is concerned with identifying the values, uncertainties and other issues relevant in a given decision and the resulting optimal decision. It is sometimes called game theory
Normative and descriptive decision theory
Most of decision theory is normative or prescriptive, i.e., it is concerned with identifying the best decision to take, assuming an ideal decision maker who is fully informed, able to compute with perfect accuracy, and fully rational. The practical application of this prescriptive approach (how people actually make decisions) is called decision analysis, and aimed at finding tools, methodologies and software to help people make better decisions. The most systematic and comprehensive software tools developed in this way are called decision support systems.


Decision Trees
A decision tree (or tree diagram) is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. Decision trees are commonly used in operations research, specifically in decision analysis, to help identify a strategy most likely to reach a goal. Another use of decision trees is as a descriptive means for calculating conditional probabilities.



Linear Programming
In mathematics, linear programming (LP) is a technique for optimization of a linear objective function, subject to linear equality and linear inequality constraints. Informally, linear programming determines the way to achieve the best outcome (such as maximum profit or lowest cost) in a given mathematical model and given some list of requirements represented as linear equations.
More formally, given a polytope (for example, a polygon or a polyhedron), and a real-valued affine function
defined on this polytope, a linear programming method will find a point in the polytope where this function has the smallest (or largest) value. Such points may not exist, but if they do, searching through the polytope vertices is guaranteed to find at least one of them.

Sunday, February 15, 2009

ass. in THEODBS


SELECT DISTINCT it.name as Item i.name as Ingredients
From madewith as m, ingredients as i, items as it
Where (m.ingredientid = i.ingredientid)
And (m.itemid = it.itemid)
And ((quantity * 3) > inventory);

Sunday, February 1, 2009










Private Sub Command1_Click()
Dim rsu As ADODB.Recordset
Set rsu = New ADODB.Recordset
Dim li As ListItems

If ListView1.ListItems.Count = 0 Then
MsgBox "Please insert a Ingredients.", vbInformation
ListView2.SetFocus
Exit Sub
End If
If Label1.Caption = "" Then
MsgBox "Please press click.", vbInformation
Command4.SetFocus
Exit Sub
End If
If Len(Combo1) = 0 Then
MsgBox "Please insert a Item", vbInformation
ListView2.SetFocus
Exit Sub
End If

rsu.Open "select * from madewith", DataEnvironment1.Connection1, 1, 3
X = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(4))
W = Val(ListView1.ListItems(ListView1.SelectedItem.Index).SubItems(2))
Do Until ListView1.ListItems.Count = 0

rsu.MoveNext
rsu.Fields("itemid") = Label1.Caption
rsu.Fields("ingredientid") = W
rsu.Fields("quantity") = X
rsu.Update
rsu.MoveNext
ListView1.SetFocus
ListView1.ListItems.Remove ListView1.SelectedItem.Index

Loop
rsu.Close

MsgBox "Save!", vbInformation, "Recipe Setup"
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
Label1.Caption = ""
ListView1.ListItems.Clear



End Sub



Private Sub Command2_Click()
Text1.Enabled = True
Text1.Text = ""
Combo1.ListIndex = -1
Combo1.Enabled = True
Combo1.SetFocus
Command1.Enabled = True
Command3.Enabled = True
ListView1.ListItems.Clear
End Sub


Private Sub Command3_Click()
If ListView1.ListItems.Count = 0 Then
MsgBox "There is no Item(s) in the list.", vbInformation, "System Info"
Else
ListView1.ListItems.Remove ListView1.SelectedItem.Index
End If

End Sub

Private Sub Command4_Click()
Dim q As String
Dim rscustoms As New ADODB.Recordset

If Combo1.ListCount > 0 Or Combo1.Text > "" Then
q = Combo1.Text
rscustoms.Open "select * from items where name='" & q & "'", DataEnvironment1.Connection1, 1, 3
If rscustoms.RecordCount > 0 Then
Label1.Caption = rscustoms.Fields("itemid")
End If
End If
End Sub



Private Sub Command5_Click()

End Sub

Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Dim r As New ADODB.Recordset
Dim s As New ADODB.Recordset



If DataEnvironment1.Connection1.State = adstateclose Then
DataEnvironment1.Connection1.Open
End If
rs.Open "select* from ingredients ", DataEnvironment1.Connection1, 1, 3
If rs.RecordCount > 0 Then

Do While Not rs.EOF
ListView2.ListItems.Add , , Val(Text)
ListView2.ListItems(ListView2.ListItems.Count).SubItems(1) = rs.Fields("name")
ListView2.ListItems(ListView2.ListItems.Count).SubItems(2) = rs.Fields("ingredientid")

rs.MoveNext
Loop
End If


End Sub



Private Sub Label3_Click()
End Sub

Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub



Private Sub ListView2_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub
Private Sub ListView2_DblClick()
Dim li As ListItem
Dim X As String
Dim rsc As New ADODB.Recordset
Dim Y As String


If ListView2.ListItems.Count <> 0 Then
Y = ListView2.SelectedItem.Text

rsc.Open "select * from ingredients where name='" & Y & "'", DataEnvironment1.Connection1, 1, 3
If rsc.RecordCount > 0 Then
With ListView3.ListItems
lv = ListItem

Set lv = .Add(, , Val(Text2))
lv.SubItems(2) = rsc.Fields("ingredientid")
lv.SubItems(3) = ListView2.SelectedItem.Text
End With
End If
End If


If Text1.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text1 = ""
Text1.SetFocus
Else
With ListView1.ListItems
z = Text1.Text
Set li = .Add(, , Val(Text2))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(2) = z
li.SubItems(3) = ListView2.SelectedItem.Text

End With
Text1.Text = ""
Text1.SetFocus
End If

End Sub

Private Sub ListView2_KeyPress(KeyAscii As Integer)
Dim li As ListItem

If Text2.Text = "" Then
MsgBox "Please type the quantity!", vbExclamation, "System Info"
Text2.SetFocus
Else
With ListView1.ListItems
Set li = .Add(, , Val(Text1))
li.SubItems(1) = ListView2.SelectedItem.SubItems(1)
li.SubItems(3) = ListView2.SelectedItem.Text
End With
Text1.Text = ""
Text1.SetFocus
End If
End Sub



Private Sub ListView3_BeforeLabelEdit(Cancel As Integer)
Cancel = 1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
Command1.SetFocus
End If
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 And KeyAscii <> 46 Then

Chr (KeyAscii)

Else

KeyAscii = 0

End If
End Sub

Sunday, November 16, 2008

Relational database management system

A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd. Most popular commercial and open source databases currently in use are based on the relational model.
A short definition of an RDBMS may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.

Historical usage of the term

E. F. Codd introduced the term in his seminal paper "A Relational Model of Data for Large Shared Data Banks", published in 1970. In this paper and later papers he defined what he meant by relational. One well-known definition of what constitutes a relational database system is Codd's 12 rules. However, many of the early implementations of the relational model did not conform to all of Codd's rules, so the term gradually came to describe a broader class of database systems. At a minimum, these systems:

  • presented the data to the user as relations (a presentation in tabular form, i.e. as a collection of tables with each table consisting of a set of rows and columns, can satisfy this property)

  • provided relational operators to manipulate the data in tabular form

The first systems that were relatively faithful implementations of the relational model were from the University of Michigan; Micro DBMS (1969) and from IBM UK Scientific Centre at Peterlee; IS1 (1970–72) and its followon PRTV (1973–79). The first system sold as an RDBMS was Multics Relational Data Store, first sold in 1978. Others have been Berkeley Ingres QUEL and IBM BS12.
The most popular definition of an RDBMS is a product that presents a view of data as a collection of rows and columns, even if it is not based strictly upon relational theory. By this definition, RDBMS products typically implement some but not all of Codd's 12 rules.
A second, theory-based school of thought argues that if a database does not implement all of Codd's rules (or the current understanding on the relational model, as expressed by Christopher J Date, Hugh Darwen and others), it is not relational. This view, shared by many theorists and other strict adherents to Codd's principles, would disqualify most DBMSs as not relational. For clarification, they often refer to some RDBMSs as Truly-Relational Database Management Systems (TRDBMS), naming others Pseudo-Relational Database Management Systems (PRDBMS).
Almost all commercial relational DBMSes employ SQL as their query language. Alternative query languages have been proposed and implemented, but very few have become commercial products.

Market structure
Given below is a list of top RDBMS vendors in 2006 with figures in millions of United States Dollars published in an IDC study.

Vendor Global Revenue
Oracle 7,912
IBM 3,483
Microsoft 3,052
Sybase 524
Teradata 457
Others 1,624
Total 16,452

Low adoption costs associated with open-source RDBMS products such as MySQL, PostgreSQL and public domain RDBMS libraries such as SQLite have begun influencing vendor pricing and licensing strategies.