Typescripts `as unknow as number` usage? - typescript2.0

I am new to Typescripts and I searched for more than 30 min to figure a usage of as unknown as but couldn't find an answer. What is the purpose of using as unknown as number in the following line of code?
public maxConnections: number = process.env[Env.MAX_CONNECTIONS] as unknown as number;

This might be a possible explanation, as unknown as is at the end of the article, just not with number.

Related

Solving mixed integer program with Lingo 19.0

I need to solve the below problem in LINGO
enter image description here
enter image description here
I declared the sets and data but there is an error in function. i think my syntax is wrong. anybody can help me writing it correct. the error is
[Error Code: 23] Improper number of arguments.
40] ost_ik(set_i, set_k) + (0,1)*(Cost_kl(set_k,set_l))
^

WxWidgets CheckListBox getting value issue

I have a problem with WxWidgets version 3.0.2. Currently I'm trying to get the value of a 'ChecklistBox' with index number 0.
It seems to work, however I can't get it to fill a string variable from C++.
I tried a lot of things, such as .ToString(), .mb_str(), (string)varname, etc.
The code I am using to get the value which I presume works, but returns a non 'string' result, so I can't use it in my C++ code... (at least not yet..)
The Code I use to get the value of index number 0 returns no errors:
CheckListBox = new wxCheckListBox(this, CHECKBOX1, wxDefaultPosition, wxSize(208,63), 0, 0, 0, wxDefaultValidator, _T("CHECKBOX1"));
CheckListBox->GetItem(0); //Seems to work (at least gives no errors)
String Test = CheckListBox->GetItem(0); //Fails
Error returned: conversion from ‘wxOwnerDrawn’ to non-scalar type std::__cxx11::string {aka std::__cxx11::basic_string}|*
Simple test such as the following work since I see 'Test' added to the CheckListBox:
CheckListbox->Check(CheckListBox->Append("Test"));
Thanks for any advice!
I can't see GetItem(idx) in CheckListBox.
Perhaps you are looking for virtual wxString GetString (unsigned int n) const which is inherited from wxListBox.

MS Access: The expression you entered is too complex

I'm trying to call this VBA function in the following update query and I'm getting this error. I'm stuck and I don't know what to do. The function signature seems ok to me.
Compute([ep].[ReferenceNumber],[ep].[ITU3Number],[ep].[AuthorizationNumber],[ep].[Ent],[ep].[Indicator],[ep].[LineCode],[ep].[ProductLinee],[ep].[Inp_ProfitCenterCode],[ep].[Inp_ParisBOCode],[ep].[StartDate],[ep].[EndDate],[ep].[ExtractionDate],[ep].[OffBalance],[ep].[IType],[ep].[Counterparty],[ep].[WAL],[ep].[Inp_BackupLineIndicator],[ep].[Indicator],[ep].[FinalRating],[ep].[Amount],[ep].[Currency],[ep].[Historical],[ep].[rice],[ep].[MaturityIndicator],[ep].[pproachType],[ep].[SignatureDate],[ep].[IMaturityDate],[ep].[ProductType],[ep].[Inp_StepupDuration],[ep].[ProbabilityOfStepup],[ep].[SCF],[ep].[ICollateralSCF],[ep].[MobilFlag,[ep].[MarginBp],[ep].[ExtensionCode],[ep].[ExtensionYear],[ep].[UsageType],"a","a")
The expression is too long for Access to process:
The maximum acceptable length appears to be around 560 characters The maximum number of arguments seems to be 29.
For example, by truncating some fields, this works:
Compute([ep].[ReferenceNumber],[ep].[ITU3Number],[ep].[AuthorizationNumber],[ep].[Ent],[ep].[Indicator],[ep].[LineCode],[ep].[ProductLinee],[ep].[Inp_ProfitCenterCode],[ep].[Inp_ParisBOCode],[ep].[StartDate],[ep].[EndDate],[ep].[ExtractionDate],[ep].[OffBalance],[ep].[IType],[ep].[Counterparty],[ep].[WAL],[ep].[Inp_BackupLineIndicator],[ep].[Indicator],[ep].[FinalRating],[ep].[Amount],[ep].[Currency],[ep].[Historical],[ep].[rice],[ep].[MaturityIndicator],[ep].[pproachType],[ep].[SignatureDate],[ep].[IMaturityDate],[ep].[ProductType],[ep].[Inp_StepupDuration])
This works:
Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29)
But this fails:
Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)
So, you could do something like this:
Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,SubCompute(29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56))

INDEXOF returning "Scalars can be only used with projections" error

Am trying to find whether one field is sub string of another field by using INDEXOF(f1,f2) > -1 where f1,f2 are both char arrays. But am getting error message as "Scalars can be only used with projections".
Is this error message because of, lack of support for two variables comparison in INDEXOF or something else? Can some one help with this?
Thanks in advance.

CX_SY_CONVERSION_NO_NUMBER when divide on i type?

I am trying to divide my 2 number. And I determine them with different type. I am getting error when I try to divide them.
But my point is, when I am in debug, why does the first number show '*'? The problem is happening because of this.
EXCEPTION : CX_SY_CONVERSION_NO_NUMBER
DATA : sayi1, sayi2 TYPE i.
DATA : sonuc TYPE p LENGTH 3.
BREAK-POINT.
sayi1 = 16.
sayi2 = 19.
sonuc = sayi1 / sayi2.
WRITE : / sonuc.
You should define every parameter differently in ABAP, you cant do it with like one "type i" :) its not like other languages such as C, C++, Java :)
So it should be like this:
DATA : sayi1 type i,
sayi2 TYPE i.
DATA : sonuc TYPE p LENGTH 3.
Hope it was helpful
Talha