OpenGL® is the only cross-platform graphics API that enables developers of software for PC, workstation, and supercomputing hardware to create high- performance, visually-compelling graphics software applications, in markets such as CAD, content creation, energy, entertainment, game development, manufacturing, medical, and virtual reality.
OpenGL® is the only cross-platform graphics API that enables developers of software for PC, workstation, and supercomputing hardware to create high- performance, visually-compelling graphics software applications, in markets such as CAD, content creation, energy, entertainment, game development, manufacturing, medical, and virtual reality.
Python: Object oriented programming, RTS Tech. Indore
This is a presentation to take your skills to next level. Hope you will like our work to make programming easier for you.
Feel free to contact for the online/offline batches.
OpenGL® ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles. It consists of well-defined subsets of desktop OpenGL, creating a flexible and powerful low-level interface between software and graphics acceleration. OpenGL ES includes profiles for floating-point and fixed-point systems and the EGL™ specification for portably binding to native windowing systems. OpenGL ES 1.X is for fixed function hardware and offers acceleration, image quality and performance. OpenGL ES 2.X enables full programmable 3D graphics.
C programming, RTS Tech. Indore
This is a presentation to take your skills to next level. Hope you will like our work to make programming easier for you.
Feel free to contact for the online/offline batches.
Python: Object oriented programming, RTS Tech. Indore
This is a presentation to take your skills to next level. Hope you will like our work to make programming easier for you.
Feel free to contact for the online/offline batches.
OpenGL® ES is a royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles. It consists of well-defined subsets of desktop OpenGL, creating a flexible and powerful low-level interface between software and graphics acceleration. OpenGL ES includes profiles for floating-point and fixed-point systems and the EGL™ specification for portably binding to native windowing systems. OpenGL ES 1.X is for fixed function hardware and offers acceleration, image quality and performance. OpenGL ES 2.X enables full programmable 3D graphics.
C programming, RTS Tech. Indore
This is a presentation to take your skills to next level. Hope you will like our work to make programming easier for you.
Feel free to contact for the online/offline batches.
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
The slides from the C++ and OOPS Crash Course conducted for ACM DBIT by Grejo Joby.
Learn the concepts of OOPS and C++ Programming in the shortest time with these notes.
Final Project SkeletonCipherClient.javaFinal Project SkeletonC.docxvoversbyobersby
Final Project Skeleton/CipherClient.javaFinal Project Skeleton/CipherClient.javaimport java.io.*;
import java.net.*;
import java.security.*;
import javax.crypto.*;
publicclassCipherClient
{
publicstaticvoid main(String[] args)throwsException
{
String message ="The quick brown fox jumps over the lazy dog.";
String host ="paradox.sis.pitt.edu";
int port =7999;
Socket s =newSocket(host, port);
// YOU NEED TO DO THESE STEPS:
// -Generate a DES key.
// -Store it in a file.
// -Use the key to encrypt the message above and send it over socket s to the server.
}
}
Final Project Skeleton/CipherServer.javaFinal Project Skeleton/CipherServer.javaimport java.io.*;
import java.net.*;
import java.security.*;
import javax.crypto.*;
publicclassCipherServer
{
publicstaticvoid main(String[] args)throwsException
{
int port =7999;
ServerSocket server =newServerSocket(port);
Socket s = server.accept();
// YOU NEED TO DO THESE STEPS:
// -Read the key from the file generated by the client.
// -Use the key to decrypt the incoming message from socket s.
// -Print out the decrypt String to see if it matches the orignal message.
}
}
Final Project Skeleton/ElGamalAlice.javaFinal Project Skeleton/ElGamalAlice.javaimport java.io.*;
import java.net.*;
import java.security.*;
import java.math.BigInteger;
publicclassElGamalAlice
{
privatestaticBigInteger computeY(BigInteger p,BigInteger g,BigInteger d)
{
// IMPLEMENT THIS FUNCTION;
}
privatestaticBigInteger computeK(BigInteger p)
{
// IMPLEMENT THIS FUNCTION;
}
privatestaticBigInteger computeA(BigInteger p,BigInteger g,BigInteger k)
{
// IMPLEMENT THIS FUNCTION;
}
privatestaticBigInteger computeB(String message,BigInteger d,BigInteger a,BigInteger k,BigInteger p)
{
// IMPLEMENT THIS FUNCTION;
}
publicstaticvoid main(String[] args)throwsException
{
String message ="The quick brown fox jumps over the lazy dog.";
String host ="paradox.sis.pitt.edu";
int port =7999;
Socket s =newSocket(host, port);
ObjectOutputStream os =newObjectOutputStream(s.getOutputStream());
// You should consult BigInteger class in Java API documentation to find out what it is.
BigInteger y, g, p;// public key
BigInteger d;// private key
int mStrength =1024;// key bit length
SecureRandom mSecureRandom =newSecureRandom();// a cryptographically strong pseudo-random number
// Create a BigInterger with mStrength bit length that is highly likely to be prime.
// (The '16' determines the probability that p is prime. Refer to BigInteger documentation.)
p =newBigInteger(mStrength,16, mSecureRandom);
// Create a randomly generated BigInteger of length mStrength-1
g =newBigInteger(mStrength-1, mSecureRandom);
d =newBigInteger(mStrength-1, mSecureRandom);
y = computeY(p, g, d);
// At this point, you have both the public key and the private key. Now compute the signature.
BigInteger k = computeK(p);
BigInteger a = computeA(p, g, k);
BigInteger b = computeB(message, d, a, k, p);
// send public key
...
Our fall 12-Week Data Science bootcamp starts on Sept 21st,2015. Apply now to get a spot!
If you are hiring Data Scientists, call us at (1)888-752-7585 or reach info@nycdatascience.com to share your openings and set up interviews with our excellent students.
---------------------------------------------------------------
Come join our meet-up and learn how easily you can use R for advanced Machine learning. In this meet-up, we will demonstrate how to understand and use Xgboost for Kaggle competition. Tong is in Canada and will do remote session with us through google hangout.
---------------------------------------------------------------
Speaker Bio:
Tong is a data scientist in Supstat Inc and also a master students of Data Mining. He has been an active R programmer and developer for 5 years. He is the author of the R package of XGBoost, one of the most popular and contest-winning tools on kaggle.com nowadays.
Pre-requisite(if any): R /Calculus
Preparation: A laptop with R installed. Windows users might need to have RTools installed as well.
Agenda:
Introduction of Xgboost
Real World Application
Model Specification
Parameter Introduction
Advanced Features
Kaggle Winning Solution
Event arrangement:
6:45pm Doors open. Come early to network, grab a beer and settle in.
7:00-9:00pm XgBoost Demo
Reference:
https://github.com/dmlc/xgboost
We have successfully created and continue developing PVS-Studio analyzer for C/C++ languages. Over the time, it became clear that many of the diagnostics that we have implemented are not related to a specific programming language, so we decided to apply our experience to another programming language, namely C#. In this article, we are talking about the analysis of Code Contracts project by Microsoft done by our C# analyzer
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2PVS-Studio
This is the second and last part of the large article about analysis of the Haiku operating system. In the first article, we discussed a variety of possible errors all of which one way or another deal with conditions. In this article, we will discuss the remaining analyzer warnings I have selected for you. The bug examples are grouped into several categories.
Need to revise working code below,A good design means the applicat.pdfarchgeetsenterprises
Need to revise working code below,
A good design means the application should scale easily -- that is, the application should be
designed so that additional processing requirements can be added without making having to
rewrite the application each time. Revise code below to add the following design features:
Move the code to display the menu to it\'s own method.
Create a method to handle capturing the shape dimensions. One approach may be to pass to the
method the dimension to enter (\"base\", \"height\", \"side\" or \"radius\") as a String.
Processing for each of the shapes matched in the switch statement should also be moved to their
own methods.
Notes -
The program should \"look and feel\" like the code below.
The program should display the menu and prompt the user for a shape (or an exit).
If the user enters a value that corresponds to a shape, program control (via the switch statement)
should transfer control to a method specific to the shape that will pass control to prompt for the
appropriate dimensions to another method, then calculate the area and perimeter (circumference)
as directed in PLP06, and display the result.
The program should repeat from step 1 above.
import java.util.Scanner;
public class Pickashape {
//Declaring constant
public static final double PI = 3.14159;
public static void main(String[] args) {
//Declaring variable
int choice;
//Scanner class Obejct is used to read the inputs entered by the user
Scanner sc = new Scanner(System.in);
//This loop continues to execute until user enters choice \'5\'
do {
//Displaying the menu
System.out.println(\"\ \ Choose the shape\");
System.out.println(\"1. Square\");
System.out.println(\"2. Rectangle\");
System.out.println(\"3. Circle\");
System.out.println(\"4. Triangle\");
System.out.println(\"5. Quit\");
System.out.print(\"Enter your choice:\");
choice = sc.nextInt();
//Based on the User selection the corresponding case will be executed
switch (choice) {
//This case will calculate the area and perimeter of the square
case 1: {
//Declaring variables
double side, area, perimeter;
//Getting the side of the square entered by the user
System.out.print(\"Enter the side (as a decimal):\");
side = sc.nextDouble();
//calculating the area of the square
area = side * side;
//calculating the perimeter of the square
perimeter = 4 * side;
//Displaying the area of the square
System.out.println(\"The area is \" + area);
//Displaying the perimeter of the square;
System.out.println(\"The perimeter is \" + perimeter);
break;
}
case 2: {
//Declaring variables
double firstside, secondside, area, perimeter;
//Getting the first side of the rectangle
System.out.print(\"Enter the first side (as a decimal):\");
firstside = sc.nextDouble();
//Getting the second side of the rectangle
System.out.print(\"Enter the second side (as a decimal):\");
secondside = sc.nextDouble();
//Calculating the area of the rectangle
area = firstside * secondside;
//Calculating the perimeter of the rectangle
perimeter = 2 * fi.
Similar to 0853352_Report_Valuing Warrants With VBA (20)
2. 2 | P a g e
Note: The Program has been written in Visual Basic Version 6.5.1024
Salient Features of the Code
• Consists of an ‘error trapping’ mechanism which prevents the user from entering negative or zero strike prices.
• Includes a ‘For Next Loop’ which enables the user to input a range, along with a desired tick size. Also uses ‘Clear
contents’ to clear the cells before a range is specified to run.
• The main ‘sub’ of the code reads in the values from the frontend and calculates the Call Value of an option using
the Black‐Scholes method, calculates the Price of the Warrant using the Call Value and finally calculates the
number of Warrants, based on the given data.
• The program uses the ‘If’ function to replace negative values of the Call values with zero, since a call value may
only be positive or zero.
• Calculations are carried out in the code at the backend, based on the data given, and the range of the strikes
specified by the user.
• All the above activities occur with the single click of a ‘Calculate’ button at the frontend.
Benchmarking the Program using a different approach
While the program follows the Black Scholes method to value warrants, in order to test for possible errors, I have
benchmarked it against the Binomial valuation method, performing the calculations in the front end.
The above table are the results from running Black Scholes in Visual Basic.
While the table above displays the results from using the same data and range of strike prices, to calculate through the
Binomial method. Clearly, there is little difference in the Call Value between the 2 methods, attributable to the Binomial
method being an approximation, while the Black Scholes being the more robust method. This indicates that the code in the
backend is acceptable.
4. 4 | P a g e
The Program Code
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Code to calculate Number of warrants to issue based on a range of
'XX Strike prices
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Option Explicit
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Global Type declaration
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Type Kartik_data
S As Double 'stock price
sig As Double 'volatility
r As Double 'risk free rate
X As Double 'strike price
T As Double 'time to maturity
lx As Double 'lower limit of range
ux As Double 'upper limit of range
dx As Double 'tick size of range
End Type
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Main sub which reads in the data from the frontend
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Sub main()
Dim ws As Worksheet, sheet As Worksheet 'Code to clear previous
contents each time the sub is run
Set sheet = ActiveSheet
ActiveSheet.Range("b13:e113").ClearContents
Dim Kartik As Kartik_data: Call ReadInData(Kartik)
Dim N As Integer: N = (Kartik.ux-Kartik.lx)/Kartik.dx 'Index loop will
will run from 0 to N
Kartik.X = Kartik.lx
If Kartik.X <= 0 Then 'Error trapping to ensure negative strike
price is not entered
GoTo error_label
Else: Kartik.X = Kartik.lx 'if error does not occur, function will run
normally
End If
Dim i As Long
Dim X As Double
5. 5 | P a g e
For X = Kartik.lx To Kartik.ux Step Kartik.dx 'initiating a loop, enables the
user to enter a range
i = (X - Kartik.lx) / Kartik.dx
'Cells(13 + i, 1).Value = i
Cells(13 + i, 2).Value = Kartik.X 'displays the strike price
following the range
Kartik.X = X
Cells(13 + i, 3).Value = Blck_Schls(Kartik) 'displays the call price
Cells(13 + i, 4).Value = Val_Warrant(Kartik) 'displays the price of the
warrant
Cells(13 + i, 5).Value = Num_Warr(Kartik) 'displays the number of
warrants needed to issue
Kartik.X = Kartik.X + Kartik.dx
Next X
Dim Call_Price As Double: Call_Price = Blck_Schls(Kartik)
Dim Price_Warrant As Double: Price_Warrant = Val_Warrant(Kartik)
Exit Sub
error_label: 'function to be performed when negative strike price is entered
Beep
MsgBox prompt:="Strike price cannot be zero or negative"
Exit Sub
End Sub
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Main Sub reads in the following data from the frontend references
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Sub ReadInData(ByRef Kartik As Kartik_data) 'data is referenced from the
frontend
Kartik.X = Kartik.lx
Kartik.lx = Cells(5, 3).Value
Kartik.ux = Cells(6, 3).Value
Kartik.dx = Cells(7, 3).Value
Kartik.S = Cells(5, 5).Value
Kartik.sig = Cells(6, 5).Value
Kartik.r = Cells(7, 5).Value
Kartik.T = Cells(8, 5).Value
Dim P As Long: P = (Kartik.ux - Kartik.lx) / Kartik.dx 'Index loop will
will run from 0 to N
End Sub
6. 6 | P a g e
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX The Black Scholes function, using defined type and referencing
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Function Blck_Schls(Kartik As Kartik_data) As Double
Dim Pres_Val As Double: Pres_Val = Kartik.X * Exp(-Kartik.r * Kartik.T)
'present value of the strike
Dim Vol_Root As Double: Vol_Root = Kartik.sig * Sqr(Kartik.T)
'sqaureroot of volatility
Dim d1 As Double: d1 = Log(Kartik.S/Pres_Val)/Vol_Root + 0.5 * Vol_Root
'defines d1
Blck_Schls = Kartik.S * Application.NormSDist(d1) - Pres_Val *
Application.NormSDist(d1 - Vol_Root)
End Function
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Calculating the value of the warrants
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Function Val_Warrant(Kartik As Kartik_data) As Double
Dim Pres_Val As Double: Pres_Val = Kartik.X * Exp(-Kartik.r * Kartik.T)
Dim Vol_Root As Double: Vol_Root = Kartik.sig * Sqr(Kartik.T)
Dim d1 As Double: d1 = Log(Kartik.S / Pres_Val) / Vol_Root + 0.5 * Vol_Root
Val_Warrant = (Kartik.S * Application.NormSDist(d1) - Pres_Val *
Application.NormSDist(d1 - Vol_Root)) - 0.1
If Val_Warrant < 0 Then 'Using If function to ensure that the value is
positive or 0
GoTo error_label
End If
Exit Function
error_label:
Val_Warrant = 0
End Function
7. 7 | P a g e
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX Calculating the number of warrants to be issued
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Private Function Num_Warr(Kartik As Kartik_data) As Double
Dim Pres_Val As Double: Pres_Val = Kartik.X * Exp(-Kartik.r * Kartik.T)
Dim Vol_Root As Double: Vol_Root = Kartik.sig * Sqr(Kartik.T)
Dim d1 As Double: d1 = Log(Kartik.S / Pres_Val) / Vol_Root + 0.5 * Vol_Root
Num_Warr = 20/((Kartik.S*Application.NormSDist(d1)-Pres_Val*
Application.NormSDist(d1 - Vol_Root)) - 0.1)
If Num_Warr < 0 Then 'Again using If function to ensure that the number of
the warrants is positive
GoTo error_label
End If
Exit Function
error_label:
Num_Warr = 0
End Function
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XX
'XX end of file
'XX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8. 8 | P a g e
Inferring the results
This program enables the user to understand how the value of the warrants and the corresponding number of warrants to
be issued changes across a range of strike prices. If we set the strike price range between £2 and £6, with a tick size of
£0.25, we get the following plots
As we observe, the number of warrants to be issued by the company increases at an exponential rate as strike price
increases, while the value of the warrant falls correspondingly and approaches zero simultaneously.