So I am trying to make a changelogs sort of thing
auto request = cpr::Post (
cpr::Url{ "http://leoservices.xyz/pchangelogs.php" }
);
auto response = request.text.c_str ( );
sprintf_s ( G->changelogsBuffer , "Changelogs: %s" , response );
ImGui::InputTextMultiline ( "##Change Logs" , G->changelogsBuffer , sizeof ( G->changelogsBuffer ) , ImVec2 ( ImGui::GetContentRegionAvail ( ).x - 10 , ImGui::GetContentRegionAvail ( ).y - 58 ) , ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_NoMarkEdited );
This is the current code but when I got to this tab it just starts laggin' is their something I am doing wrong?
Related
This measure isn't calculating as expected.
SumAfter1300 =
CALCULATE (
COUNTROWS ( 'Fulfillment' ),
'Fulfillment'[DateCreated] > TIME ( 13, 0, 0 ),
'Fulfillment'[Status]
IN { "Awaiting Response", "In Progress", "Routed", "Unresolved" }
)
SumAfter1300 = CALCULATE(COUNTROWS('Fulfillment'),
'Fulfillment'[DateCreated]> today()+ TIME(13,0,0),
'Fulfillment'[Status] IN {"Awaiting Response","In Progress","Routed","Unresolved"})
I am trying to create a service which is going to be used for monitoring client machines and providing updates but part of the service is reporting the hardware that is being used. I currently have the following code to get the GPU information which works when run as a command line application but when it is running as a service no information is returned.
I believe this is due to services not having access to the display but I cannot find any other ways to get the GPU information that would work from a service.
QByteArrayList GetGpuNames ()
{
QByteArrayList list;
IDirect3D9* d3dobject = Direct3DCreate9 ( D3D_SDK_VERSION );
if ( !d3dobject )
return list;
D3DPRESENT_PARAMETERS d3dpresent;
memset ( &d3dpresent , 0 , sizeof ( D3DPRESENT_PARAMETERS ) );
d3dpresent.Windowed = TRUE;
d3dpresent.SwapEffect = D3DSWAPEFFECT_DISCARD;
UINT adaptercount = d3dobject->GetAdapterCount ();
D3DADAPTER_IDENTIFIER9* adapters = ( D3DADAPTER_IDENTIFIER9* ) malloc ( sizeof ( D3DADAPTER_IDENTIFIER9 ) * adaptercount );
for ( int i = 0; i < adaptercount; i++ )
{
d3dobject->GetAdapterIdentifier ( i , 0 , &( adapters [ i ] ) );
list << QByteArray ( adapters [ i ].Description );
}
return list;
}
What differences exist between QueryRequest and QuerySpec?
QuerySpec spec = new QuerySpec()
.withKeyConditionExpression("#n_channel = :v_channel")
.withFilterExpression("#n_type = :v_type")
.withNameMap( new NameMap()
.with( "#n_type", DATABASE_CONTENT_TYPE_NAME )
.with( "#n_channel", PRIMARY_KEY_NAME ))
.withValueMap(new ValueMap()
.withString(":v_type", type)
.withString(":v_channel",channelId))
.withConsistentRead(true);
With QuerySpec - works
keyConditions.put( PRIMARY_KEY_NAME, new Condition().withComparisonOperator( ComparisonOperator.EQ ).withAttributeValueList( new AttributeValue().withS( channelId ) ) );
keyConditions.put( RANGE_KEY_NAME, new Condition().withComparisonOperator( ComparisonOperator.NOT_NULL ) );//default value
typeFilterExpression = "#n_type = :v_type";
nameMap.with( "#n_type", DATABASE_CONTENT_TYPE_NAME );
values.put( ":v_type", new AttributeValue().withS( type ) );
//
QueryRequest request = new QueryRequest().withTableName( tableName )
.withKeyConditions( keyConditions ).withLimit( QUERY_LIMIT )
.withReturnConsumedCapacity( ReturnConsumedCapacity.TOTAL ).withConsistentRead( false );
if( StringUtils.isNotBlank( typeFilterExpression ) ) {
request.withFilterExpression( typeFilterExpression );
}
if( !MapUtils.isEmpty( nameMap ) ) {
request.withExpressionAttributeNames( nameMap );
}
if( !MapUtils.isEmpty( values ) ) {
request.withExpressionAttributeValues( values );
}
With the same QueryRequest - not works.
com.amazonaws.AmazonServiceException: Attempted conditional constraint is not an indexable operation
Amazon version:
compile 'com.amazonaws:aws-java-sdk:1.10.65'
Thanks!
For QueryRequest need use filters map:
filters.put( TYPE, new Condition() //
.withComparisonOperator( ComparisonOperator.EQ ) //
.withAttributeValueList( //
new AttributeValue() //
.withS( type.name() ) //
) //
);
request.withQueryFilter( filters );
All works!
I have US standard keyboard but I would like to simulate the italian or chinese type of keystrokes by using SendInput method.
I use SendInput metode like this,
KEYBDINPUT kb = { 0 } ;
ZeroMemory ( & kb , sizeof ( KEYBDINPUT ) ) ;
ZeroMemory ( & kInput , sizeof ( INPUT ) ) ;
kb.wVk = 0 ;
kb.dwFlags = KEYEVENTF_UNICODE ;
kb.wScan = vk ; //vk is result of MapVirtualKey key API
kInput.type = INPUT_KEYBOARD ;
kInput.ki = kb ;
UINT res = SendInput ( 1 , & kInput , sizeof ( INPUT ) ) ;
Note :-
Without change the keyboard settings.
When using KEYEVENTF_UNICODE, the kb.wScan just has to be the wchar_t unicode character.
Don't use MapVirtualKey.
Also, don't forget to send the "Key Up" transition, just after the Key Down.
UINT res = SendInput ( 1 , & kInput , sizeof ( INPUT ) ) ;
kb.dwFlags |= KEYEVENTF_KEYUP;
res = SendInput ( 1 , & kInput , sizeof ( INPUT ) ) ;
I'm trying to debug my model (QAbstractItemModel) with ModelTest. And I can't understand one assertion.
There are two slots in ModelTest that intercept signals generated by my model.
ModelTest::rowsAboutToBeInserted
ModelTest::rowsInserted
Slot/function 1 looks like this
void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, int end )
{
Changing c;
// ...
c.last = model->data ( model->index ( start - 1, 0, parent ) );
c.next = model->data ( model->index ( start, 0, parent ) );
insert.push ( c );
}
And slot 2 looks like this
void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end )
{
Changing c = insert.pop();
// other asserts ...
(*) Q_ASSERT ( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) );
}
I don't understand dla last assertion (*). Lets assume that in my app I add 1 row.
This row is the only row that is stored in my model. So the row number would be 0.
In my model before adding the row I call
beginInsertRows(parentIndex, 0, 0);
So why does modeltest require
model->data ( model->index ( start, 0, parent ) )
to be equal to
model->data ( model->index ( end + 1, 0, c.parent ) )
What am I missing here ? Please help :)
The idea behind this assert is to check if first row after added ones was correctly moved. If there are some rows after inserted ones, then their data are compared. If there aren't any, your model should both in the line
c.next = model->data ( model->index ( start, 0, parent ) );
and in
Q_ASSERT ( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) );
should return invalid (empty) QVariant. If both return empty QVariant (as they should) assertion succedes, thus providing some level of error-checking even in case of no rows after currently inserted.