Saturday, 17 August 2013

Trianlgle homework

Trianlgle homework

The triangle formed by A(-2,-3) , B(1,3) and C(10,k) is roght-angled
triangle at A, find a)the value of k, b)the area of triangle ABC, c)the
length of AM where M is the mid-point of BC.

Friday, 16 August 2013

Qt:exe file not running

Qt:exe file not running

I started using Qt 5.1 with MinGW on Windows 7. I use QtCreator to create
the application in debug mode. When I run the exe of any application as a
standalone it shows the following error...how ever the same application
runs smoothly...I tried setting the environment variable PATH to the bin
of the QTCreator and MinGW bin (which QtCreator uses) I am new to this
windows environment and MinGW.. any suggestions are welcome...

Thursday, 8 August 2013

_com_util::ConvertStringToBSTR - Access Violation

_com_util::ConvertStringToBSTR - Access Violation

I'm invoke COM server's method and randomly get access violation error in
the _com_util::ConvertStringToBSTR:
g_quote->RegisterQuote(_bstr_t(pszTicker), _bstr_t(_T("*")));
More information:
int GetQuotesEx(LPCTSTR pszTicker, int nPeriodicity, int nLastValid, int
nSize, struct Quotation* pQuotes, GQEContext* pContext) {
const RecentInfoMap::const_iterator it = g_mapRecentInfo.find(pszTicker);
if (it == g_mapRecentInfo.end()) {
g_quote->RegisterQuote(_bstr_t(pszTicker), _bstr_t("*"));
return nLastValid + 1;
}
}
I don't know why this bug happens. I can provide additional info if needed.

Salesforce - Custom page for new related list of Custom Object

Salesforce - Custom page for new related list of Custom Object

I have custom objects A and B. The relationship between A & B is set using
a custom object C, with object A & B (master detail) as fields of C.
I have created a custom lookup page to bind object B (to A) which is set
as related list to Object A.
I want to invoke the custom page when I click on New button in the related
list. How can I achieve this?
Thanks.

C# LuaInterface class operators

C# LuaInterface class operators

I'm using LuaInterface in C# and I "exported" some custom C# classes to be
used in Lua. For instance:
local myVector = Vector2(10, 100)
But, when I want to use class operators like in this example:
local v1 = Vector2(1, 1)
local v2 = Vector2(2, 2)
local v3 = v1 + v2
I'm getting the following error: attempt to perform arithmetic on local
'p1' (a userdata value)
The C# variant of the class does have the + operator:
public static cVector2 operator +(cVector2 vector1, cVector2 vector2)
{
return new cVector2(vector1.X + vector2.X, vector1.Y + vector2.Y);
}
I know that you should make use of the Lua metatables and add a function
to "__mul" for the * operator for example. But doesn't LuaInterface does
that automatically? And if not, how could I automate this myself?

fisher exact test for testing ratios of two columns

fisher exact test for testing ratios of two columns

I am trying to see if the ratios of Non_syn_snps to Total_SNps is
significant or not for all 10 chromosomes. Here is the dataframe
Ch Non_Syn Total_Snps ratios
1 A01 4658 23657 0.1968973
2 A02 3347 16685 0.2005993
3 A03 7292 36963 0.1972784
4 A04 2608 13161 0.1981612
5 A05 1883 10665 0.1765588
6 A06 4141 22033 0.1879454
When i tried to do fisher test on the fourth column
fisher.test(data_total[,4])
I am getting this error "Error in fisher.test(test_fish[, 4]) : if 'x' is
not a matrix, 'y' must be given"
I even tried to convert this to matrix and do the same thing but still i
am getting the same error.
Can somebody tell me what i am doing wrong here? Also is it ok to just use
the fourth column for fisher test?
Thanks Upendra

Cannot add or update a child row: a foreign key constraint fails

Cannot add or update a child row: a foreign key constraint fails

I'm trying to use an SQL script to automatically add a schedule to and
from every airport. Here is the code I have so far:
INSERT INTO phpvms_schedules (depicao, arricao, distance)
SELECT
depart.icao,
arrive.icao,
ROUND(GreaterCircleNm(depart.lat,depart.lng,arrive.lat,arrive.lng),2)
as Nm
FROM phpvms_airports AS depart
INNER JOIN phpvms_airports AS arrive ON depart.icao <> arrive.icao
GreaterCircleNm function:
DROP FUNCTION IF EXISTS GreaterCircleNm;
DELIMITER go
CREATE FUNCTION GreaterCircleNm( lat1 FLOAT, lon1 FLOAT, lat2 FLOAT, lon2
FLOAT ) RETURNS float
BEGIN
DECLARE pi, q1, dist FLOAT;
SET pi = PI();
SET lat1 = lat1 * pi / 180;
SET lon1 = lon1 * pi / 180;
SET lat2 = lat2 * pi / 180;
SET lon2 = lon2 * pi / 180;
SET q1 = ACOS(sin(lat1)*sin(lat2)+COS(lat1)*COS(lat2)*COS(lon1-lon2));
SET dist = q1*180*60/pi;
RETURN dist;
END;
go
DELIMITER ;
All in all I really need help fixing this error:
1452 - Cannot add or update a child row: a foreign key constraint fails
(virtu259_phpvms.phpvms_schedules, CONSTRAINT phpvms_schedules_ibfk_1
FOREIGN KEY (code) REFERENCES phpvms_airlines (code) ON UPDATE CASCADE)
phpvms_airports:

phpvms_schedules: