13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Saturday, October 24, 2009

Multiplication Game


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public int rgt = 0;
public int wng = 0;
public Int32 prod;
public int uprob;
Random random = new Random();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
uprob = Convert.ToInt32(textBox1.Text);
int num1 = random.Next(1, 100);
int num2 = random.Next(1, 100);
Int32 prod = num1 * num2;
textBox2.Text = Convert.ToString(num1);
textBox3.Text = Convert.ToString(num2);
}
private void button6_Click(object sender, EventArgs e)
{
if (((Convert.ToInt32(textBox2.Text)*(Convert.ToInt32(textBox3.Text)) == Convert.ToInt32(textBox4.Text))))
{
textBox6.Text = "Congratulations! You're correct.";
textBox5.Text = Convert.ToString(prod);
rgt = rgt + 1;
}
else
{
textBox6.Text = "Uh, oh! You need more practice.";
textBox5.Text = Convert.ToString(prod);
wng = wng + 1;
}
Int32 uansr = Convert.ToInt32(textBox4.Text);
Int32 m1 = Convert.ToInt32(textBox2.Text);
Int32 m2 = Convert.ToInt32(textBox3.Text);
Int32 mm = m1 * m2;
int num1 = random.Next(1, 100);
int num2 = random.Next(1, 100);
textBox2.Text = Convert.ToString(num1);
textBox3.Text = Convert.ToString(num2);
Thread.Sleep(1000);
textBox6.Text = "";
textBox5.Text = "";
textBox4.Text = "";
uprob = uprob -1;
textBox1.Text = Convert.ToString(uprob);
}

}
}

Wednesday, October 21, 2009

C# Instead - Multiplication Game

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;



namespace multip
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
decimal numps = numericUpDown1.Value;
for(int i=1; i<=numps; i++)
{
string doa, dab, xx, yy;
Random randNum1 = new Random();
int num1 = randNum1.Next(0, 101); // No larger than 108, no smaller than 1
Random randNum2 = new Random();
int num2 = randNum2.Next(0, 101);
int prod = num1 * num2;
string yak = textBox4.Text;
int usrans = Convert.ToInt32(yak);
if( prod == usrans)
{
doa = "Contratulations! The answer is";
xx = doa + prod;
textBox2.Text = xx;
}
else
{ dab = "Contratulations! The answer is";
yy = dab + prod;
textBox3.Text = yy;
}
}
}
}
}

Tuesday, October 20, 2009

Multiplication Game - C++ Console Application

// multiplication_game.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include ''
#include ''
#include ''
#include '
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int mult1, mult2, uprod, prod, ntim;
cout<< "How many problems do you want to solve? "; cin>>ntim;
for(int i=1; i<=ntim; i++) { srand(time(0)); mult1 = rand() % 100 + 1; mult2 = rand() % 100 + 1; cout<< "What is the product of "; cout<<>> uprod;
prod = mult1 * mult2;
if(prod == uprod)
cout<< "Excellent!";
else
cout<< "Wrong!";
cout<< " The product is ";
cout<< prod << endl;
}
system("PAUSE");

}

Monday, October 19, 2009

C++ Progress

// multiplication_game.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include
#include
#include
#include
#include
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int mult1, mult2, uprod, prod;
srand(time(0));
mult1 = rand() % 100 + 1;
mult2 = rand() % 100 + 1;
cout<< "What is the product of "; cout<<>> uprod;
prod = mult1 * mult2;
if(prod == uprod)
cout<< "Excellent!";
else
cout<< "Wrong!";
cout<< " The product is ";
cout<< prod << endl;
system("PAUSE");

}

Beginning of a Math Game in C++: Multiplication of Two Integers in the Range of 1 to 100

// multiplication_game.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include
#include
#include
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
int mult1, mult2, uprod, prod;
mult1 = rand() % 100 + 1;
mult2 = rand() % 100 + 1;
cout<< "What is the product of ";
cout<< mult1;
cout<< " and ";
cout<< mult2;
cout<< " ?";
cin >> uprod;
prod = mult1 * mult2;
if(prod == uprod)
cout<< "excellent!";
else
cout<< "Wrong!";
cout<< " The product is ";
cout<< prod;
system("PAUSE");

}

Wednesday, October 14, 2009

Here is the working code: c++

// mit_assign_3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include
#include "math.h"
using namespace std;

int diff(int num1, int num2)
{
int diffnums;
diffnums = num1 - num2;
return diffnums;
}
int quot(int num1, int num2)
{
int quotnums;
quotnums = num1 / num2;
return quotnums;
}
int rmain(int num1, int num2)
{
int rmains;
rmains = num1 % num2;
return rmains;
}
int _tmain(int argc, _TCHAR* argv[])
{
int num1, num2;
int oswitch;
float dg;
int stng;
int rm;
cout << "Please input an integer: ";
cin >> num1;
cout << "Plese input a second integer: ";
cin >> num2;
cout << "1. Difference of two numbers" << endl
<< "2. Quotient of two numbers" << endl
<< "3. Remainder of two numbers" << endl
<< "Enter your choice:";
cin >> oswitch;
switch(oswitch)
{
case 1:
cout << "Difference is " << diff(num1, num2) << endl;
break;
case 2 :
cout << "Quotient is " << quot(num1, num2) << endl;
break;
case 3 :
cout << "Remainder is " << rmain(num1, num2) << endl;
break;
}
system("PAUSE");
}

C++ - Find the error

// mit_assign_3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include
#include "math.h"
using namespace std;

int diff(int num1, int num2)
{
int diffnums;
diffnums = num1 - num2;
return diffnums;
}
int quot(int num1, int num2)
{
int quotnums;
quotnums = num1 / num2;
return quotnums;
}
int rmain(int num1, int num2)
{
int rmains;
rmains = num1 % num2;
return rmains;
}
int _tmain(int argc, _TCHAR* argv[])
{
int num1, num2, oswitch;
char *stng;
cout << "Please input an integer: ";
cin >> num1;
cout << "Plese input a second integer: ";
cin >> num2;
cout << "Please choose 1 of these 3 options:\n 1. Difference of your 2 numbers\n 2. Quotient of your 2 numbers\n 3. Remainder of two numbers."
cin >> oswitch;
switch (oswitch)
{
case 1: // do these if expr == c1
*stng = diff(int num1, int num2);
case 2:
*stng = quot(int num1, int num2);
case 3:
*stng = rmain(int num1, int num2);
}
cout << *stng;
system("PAUSE");
}

Monday, October 12, 2009

Visual Studio 10 programming integrated development environment (IDE) running on Windows 7 prerelease

Little Loop - C++

// count.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "math.h"
#include
using namespace std;


int _tmain()
{
int sum = 0, i = 0;
do
{
sum += i++;
} while ( i < 5 );
cout << sum;
cout <<"\n";
system ("PAUSE");
}

Sunday, October 11, 2009

Digital Video Editing



Quantum Support conducting experiments, for the betterment of humanity & the advancement of mankind, on the interaction between the feline species and the frequency range of the electromagnetic spectrum where visible light resides: 630 - 670 nanometers in wavelength, in this case. Produced, directed and edited by yours truly Ethan Castanon.


----------------------------------------------------------------------------------
This template is basic. Please see a much more sophisticated one below. It uses custom functions and other goodies.
----------------------------------------------------------------------------------






Option Explicit

Private Sub cmdCancel_Click()
Unload Me
ActiveDocument.Close SaveChanges:=False
End Sub
Private Sub UserForm_Initialize()
With cmb_ref_doc_designation
.AddItem ", M.D."
.AddItem ", D.O."
.AddItem ", Ph.D."
.AddItem ", AuD"
.AddItem ""
End With
With cbo_sex
.AddItem "male"
.AddItem "female"
.AddItem "unspecified"
End With
End Sub

Private Sub btn_date_click_Click()

End Sub

Private Sub btn_no_x_see_attached_Click()
ActiveDocument.Shapes("Group 58").Select
Selection.ShapeRange.Line.Visible = msoFalse
Application.ScreenUpdating = True
End Sub

Private Sub btn_x_expct_more_2_follow_Click()
ActiveDocument.Shapes("Group 61").Select
Selection.ShapeRange.Line.Visible = msoTrue
Application.ScreenUpdating = True
End Sub

Private Sub btn_x_expct_nothing_2_followw_Click()
ActiveDocument.Shapes("Group 61").Select
Selection.ShapeRange.Line.Visible = msoFalse
Application.ScreenUpdating = True
End Sub

Private Sub btn_x_see_attached_Click()
ActiveDocument.Shapes("Group 58").Select
Selection.ShapeRange.Line.Visible = msoTrue
Application.ScreenUpdating = True
End Sub

Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Frame1.Visible = True
Else: Frame1.Visible = False
End If
End Sub

Private Sub CommandButton4_Click()
Frame1.Visible = True
End Sub

Private Sub Enter_Click()
Dim current As Variant
If CheckBox1.Value = True Then
current = txtbox_dt_of_letter_mm.Value & "/" & txtbox_dt_of_letter_dd.Value & "/" & txtbox_dt_of_letter_yyyy.Value
Else
current = DateTime.Now()
End If
With ActiveDocument
.Bookmarks("recipient_doc").Range.Text = txtbox_ref_doc_fname.Value & " " & txtbox_ref_doc_mname.Value & " " & txtbox_ref_doc_lname.Value & cmb_ref_doc_designation.Value
.Bookmarks("date").Range.Text = current
.Bookmarks("patient").Range.Text = txtbox_pt_firstname.Value & " " & txtbox_pt_lastname.Value
.Bookmarks("dob").Range.Text = txtbox_pt_dob_mm.Value & "/" & txtbox_pt_dob_dd.Value & "/" & txtbox_pt_dob_yyyy.Value
.Bookmarks("date_of_service").Range.Text = txtbox_date_service_mm.Value & "/" & txtbox_date_service_dd.Value & "/" & txtbox_date_service_yyyy.Value
.Bookmarks("chief_complaint").Range.Text = txt_chief_complaint.Value
.Bookmarks("physical_findings").Range.Text = txt_physical_findings.Value
.Bookmarks("diagnosis").Range.Text = txt_diagnosis.Value
.Bookmarks("treatment_plan").Range.Text = txt_treatment_plan.Value
.Bookmarks("see_attached_details").Range.Text = txtbox_see_attached_comments.Value
.Bookmarks("expect_detailed_letter_comments").Range.Text = txtbox_detailed_letter_comments.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub

Private Sub Label3_Click()

End Sub

Private Sub UserForm_Click()

End Sub

Here's some C++ for you - Basic

// stops console application from exiting upon completion without prompting user

// stt.cpp : Defines the entry point for the console application

#include "stdafx.h"
#include
using namespace std;
int main()
{
int a, b;
float c;
cout << "Enter an integer: ";
cin >> a;
cout <<"\n";
cout << "Enter another integer: ";
cin >> b;
cout <<"\n";
cout << "Enter a number with decimal: ";
cin >> c;
cout <<"\n";
cout << "You entered " << a << ", " << b << ", and " << c << endl;
cout <<"\n";
system ("PAUSE");
}

Saturday, October 3, 2009

Visual Basic for Applications - UserForms for Microsoft Word templates



__________________________________________________________________________

The code below is Visual Basic for Applications designed by The Microsoft Corporation to program in the Microsoft Office suite. It is the code that produces the UserForm (the dialog box that users enter data into, which is then transferred into the template).

There are custom mathematical functions to calculate age from dates, etc.
__________________________________________________________________________

Dim strName As Variant





Private Sub CommandButton1_Click()


End Sub

Private Sub lbl_airboneright_Click()

End Sub

End Sub

Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Frame1.Visible = True
Else: Frame1.Visible = False
End If


End Sub

Private Sub CheckBox2_Click()
If CheckBox2 = True Then
Frame2.Visible = True
Else: Frame2.Visible = False
End If


End Sub



Private Sub UserForm_Initialize()
With cboPatientGender
.AddItem "male"
.AddItem "female"
End With
With cbo_Degr
.AddItem ", M.D."
.AddItem ", D.O."
.AddItem ", Ph.D."
.AddItem ", AuD"
.AddItem ""
End With
With cboRtypehearloss
.AddItem "sensorineural"
.AddItem "conductive"
.AddItem "mixed"
End With
With cboLtypehearloss
.AddItem "sensorineural"
.AddItem "conductive"
.AddItem "mixed"
End With

End Sub

Public Sub btn_pt_hist_status_Click()
Dim strName As String
strName = InputBox(Prompt:="Please enter patient history/status.")

End Sub


Private Sub cmdClear_Click()
txtPatientName.Value = Null
txtDOSmm.Value = Null
txtDOSdd.Value = Null
txtDOSyyyy.Value = Null
txtReferringDoctor.Value = Null
txtDOByyyy.Value = Null
cboPatientGender.Value = Null
txtEVALmm.Value = Null
txtEVALdd.Value = Null
txtEVALyyyy.Value = Null
txt_r_db_lower.Value = Null
txt_r_db_upper.Value = Null
txt_l_db_lower.Value = Null
txt_l_db_upper.Value = Null
End Sub

Private Sub cmdCancel_Click()
Unload Me
ActiveDocument.Close SaveChanges:=False
End Sub

Private Sub cmdEnter_Click()
Dim current As Date
current = DateTime.Now()
Dim xr_2, xr_4, xr_6, xr_8, lx_2, lx_4, lx_6, lx_8 As Variant
xr_2 = r_2
xr_4 = r_4
xr_6 = r_6
xr_8 = r_8
lx_2 = l_2
lx_4 = l_4
lx_6 = l_6
lx_8 = l_8
If xr_2 = "" Then
xr_2 = 0
End If
If xr_4 = "" Then
xr_4 = 0
End If
If xr_6 = "" Then
xr_6 = 0
End If
If xr_8 = "" Then
xr_8 = 0
End If
If lx_2 = "" Then
lx_2 = 0
End If
If lx_4 = "" Then
lx_4 = 0
End If
If lx_6 = "" Then
lx_6 = 0
End If
If lx_8 = "" Then
lx_8 = 0
End If

With ActiveDocument
.Bookmarks("date").Range.Text = current
.Bookmarks("patient_name").Range.Text = txtPatientName.Value & " " & txtPatientLname.Value
.Bookmarks("dos").Range.Text = DateValue(txtDOS.Value)
.Bookmarks("ref_doc").Range.Text = txtReferringDoctor.Value + cbo_Degr
.Bookmarks("ref_doc1").Range.Text = txtReferringDoctor.Value + cbo_Degr
.Bookmarks("patient_name1").Range.Text = txtPatientName.Value
.Bookmarks("age").Range.Text = AgeCalc(txtDOBmm.Value, txtDOBdd.Value, txtDOByyyy.Value)
.Bookmarks("evaldate").Range.Text = DateValue(txtDOS.Value)
.Bookmarks("gender").Range.Text = cboPatientGender
.Bookmarks("ptstatus").Range.Text = txt_pthistory
.Bookmarks("r_lower_limit").Range.Text = txt_r_db_lower.Value
.Bookmarks("r_upper_limit").Range.Text = txt_r_db_upper.Value
.Bookmarks("r_air_bone").Range.Text = airbone(xr_2, xr_4, xr_6, xr_8)
.Bookmarks("l_lower_limit").Range.Text = txt_l_db_lower.Value
.Bookmarks("l_upper_limit").Range.Text = txt_l_db_upper.Value
.Bookmarks("l_air_bone").Range.Text = airbone(lx_2, lx_4, lx_6, lx_8)
.Bookmarks("impression_r").Range.Text = "Right " + lossinwords(txt_r_db_lower.Value) + " to"
.Bookmarks("impression_r_u").Range.Text = lossinwords(txt_l_db_upper.Value)
.Bookmarks("r_type_loss").Range.Text = cboRtypehearloss
.Bookmarks("impression_l").Range.Text = "Left " + lossinwords(txt_l_db_lower.Value) + " to"
.Bookmarks("impression_l_u").Range.Text = lossinwords(txt_l_db_upper.Value)
.Bookmarks("l_type_loss").Range.Text = cboLtypehearloss
.Bookmarks("return_ref_doc").Range.Text = txtReferringDoctor.Value + cbo_Degr
End With
Application.ScreenUpdating = True
Unload Me
End Sub

Function AgeCalc(pmonth As Integer, pday As Integer, pyear As Integer)
Dim Age As Integer
Dim LValue As String
LValue = Format(Date, "yyyy/mm/dd")
nyear = Left(LValue, 4)
nday = Right(LValue, 2)
nmonth = Mid(LValue, 6, 2)
If pmonth <= nmonth Then
AgeCalc = (nyear - pyear)
ElseIf (pmonth > nmonth) Then
AgeCalc = ((nyear - pyear) - 1)
End If
End Function

Function lossinwords(x As Integer)
If x >= 0 And x <= 20 Then
lossinwords = "normal"
ElseIf x <= 40 And x > 20 Then
lossinwords = "mild"
ElseIf x <= 55 And x > 40 Then
lossinwords = "moderate"
ElseIf x <= 70 And x > 55 Then
lossinwords = "moderately severe"
ElseIf x <= 90 And x > 70 Then
lossinwords = "severe"
ElseIf x > 90 Then
lossinwords = "profound"
End If
End Function

Function airbone(a, b, c, d)
If a = 0 And b = 0 And c = 0 And d = 0 Then
airbone = "There was no air-bone gap"
Else
airbone = "There was an air-bone gap of " & a & "dB" & " to " & b & "dB" & " at the frequency range of " & c & " to " & d
End If

End Function