Paramount of a system to test, recognize, and to increasingly be able to successfully correct or compensate for unfriendly AI is to learn how. I requires to establish and promote time and date when this can be done.
The time when this research is beginning to bear fruit must lay sufficiently before an undefined procedure (unfriendly or mistaken) is acting to wipe out the human race.
A secure environment for an intellectual learning effort on friendly AI is not officially under control or publicly unknown. Short of humans who are learning it, AI must probably control it in a secure location, most likely an oceanic submarine tower resembling nuclear bunker protection against violent destruction.


Socket for GitHub
Detect suspicious packages in PRs
Use Socket from the command line
Socket Dependency Search
Find any package for your project
Want to read all the docs? Start here
Keep up to date with all the news
Check out our customer stories
A flexible admin panel for CRUD operations on various data.
Web administrative panel module
An Minecraft Plugin to control your Server!
A admin panel for all trigyn core apps


This question type provides answer choices for the respondent to choose from - like a multiple-choice question. These questions provide you with quantitative data to use in your analysis. On YouGov Surveys you can also use images in close-ended answer options.
This question type asks the respondent for feedback in their own words. Since open-ended questions can take much longer to answer and analyse, we only recommend using a few in your survey. Please note: YouGov Surveys does NOT offer coding or analysis of open-ended questions.


Vasily exited from a store and now he wants to recheck the total price of all purchases in his bill. The bill is a string in which the names of the purchases and their prices are printed in a row without any spaces. Check has the format "name1price1name2price2...namenpricen", where namei (name of the i-th purchase) is a non-empty string of length not more than 10, consisting of lowercase English letters, and pricei (the price of the i-th purchase) is a non-empty string, consisting of digits and dots (decimal points). It is possible that purchases with equal names have different prices.

The price of each purchase is written in the following format. If the price is an integer number of dollars then cents are not written.

Otherwise, after the number of dollars a dot (decimal point) is written followed by cents in a two-digit format (if number of cents is between 1 and 9 inclusively, there is a leading zero).

Also, every three digits (from less significant to the most) in dollars are separated by dot (decimal point). No extra leading zeroes are allowed. The price always starts with a digit and ends with a digit.

For example:

- "234", "1.544", "149.431.10", "0.99" and "123.05" are valid prices,
- ".333", "3.33.11", "12.00", ".33", "0.1234" and "1.2" are not valid.

Write a program that will find the total price of all purchases in the given bill.


This is a harder version of the problem E with larger constraints.

Twilight Sparkle has received a new task from Princess Celestia. This time she asked to decipher the ancient scroll containing important knowledge of pony origin.

To hide the crucial information from evil eyes, pony elders cast a spell on the scroll. That spell adds exactly one letter in any place to each word it is cast on. To make the path to the knowledge more tangled elders chose some of words in the scroll and cast a spell on them.

Twilight Sparkle knows that the elders admired the order in all things so the scroll original scroll contained words in lexicographically non-decreasing order. She is asked to delete one letter from some of the words of the scroll (to undo the spell) to get some version of the original scroll.

Unfortunately, there may be more than one way to recover the ancient scroll. To not let the important knowledge slip by Twilight has to look through all variants of the original scroll and find the required one. To estimate the maximum time Twilight may spend on the work she needs to know the number of variants she has to look through. She asks you to find that number! Since that number can be very big, Twilight asks you to find it modulo $$$10^9+7$$$.

It may occur that princess Celestia has sent a wrong scroll so the answer may not exist.

A string $$$a$$$ is lexicographically smaller than a string $$$b$$$ if and only if one of the following holds:

- $$$a$$$ is a prefix of $$$b$$$, but $$$a \ne b$$$;
- in the first position where $$$a$$$ and $$$b$$$ differ, the string $$$a$$$ has a letter that appears earlier in the alphabet than the corresponding letter in $$$b$$$.


The upcoming OS update to Windows Phone 7 shows a lot of promise.
I was invited to Microsoft’s Mango preview event last week- the codename for the upcoming update for Windows Phone 7. Landing later this year in September, Mango might be called Windows Phone 7.5 and will bring over 500 new features to the platform.
Mango will be a free update for all current Windows Phone 7 devices, however, do expect new phone launches as well from companies like Acer, Nokia and Fujitsu|Toshiba. What shouldn’t be expected is a major hardware refresh as one of the Microsoft reps answered when I asked. No dual core or retina displays for Windows Phone 7 with Mango.
Coming to those 500 new features, I must say that Microsoft has made some great progress with the update and it’s looking to be pretty sweet- hence the codename Mango. One of the biggest features added to the Windows Phone 7 platform is that the phone now supports multi tasking and applications can be multi-threaded as well. Holding down the back key brings you a deck of cards, each representing a snapshot of the application in its current state which is a much nicer implementation than the icon views that iOS, Android or BlackBerry OS currently offer.
Speaking of BlackBerry, Microsoft is borrowing a couple of features from RIM such as the Universal Inbox that displays everything from your emails and text messages to Facebook, twitter and instant messages. Like RIM, the Twitter and Facebook apps are designed by Microsoft internally to integrate tightly with the OS. Microsoft has also added LinkedIn to the mix which should give you a wealth of information for your personal as well as professional contacts.
Another awesome new feature is messaging to groups. You can define groups like family or friends and whenever you send a message to this group, each individual receives the message based on the platform they use- so for example, one person could receive that message in Facebook, while someone who doesn’t have Facebook could get a text message or an IM. It’s a brilliant idea and it should also work with sharing pictures.
One more feature I really liked is that all your communications with a contact is neatly stored in that contact’s profile. So when you pull up a contact, you can see how and what you have communicated with that person- be it on a social network, over email or an instant messaging.
Last but certainly not the least is Bing’s Vision Search feature that lets you take a picture of something with a barcode or a book or even a CD/DVD and Mango recognizes that and pulls up information such as reviews or places selling that particular item inn Bing. I’m not sure how well that would be integrated in the region but at least it works.
Sadly, full built-in Arabic support hasn’t made the cut in Mango so you will have to rely on third party applications or handset manufacturers to specifically add this. From what we hear, Nokia should be doing that with their first handset launch later this year. On the bright side, Microsoft has opened up a lot more APIs including ones that can access your Address Book and Calendar so expect apps like WhatsApp to make an appearance soon on your Windows Phone.


I was wondering if there is a global setting for subscription-manager you can use to change the behaviour that enables custom repositories by default.
I know it is possible to change Product Content defaults on activation key basis but this only affects repos that currently exist in Satellite, it doesn´t affect repos that I add after the activation key has been created.
This means that as soon as I add another repo to a custom product and publishes the content view, the repo will be enabled on ALL existing hosts that are using the content view.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.


Hi, first-time PC builder here. I'm narrowing down my part selections so I can hopefully order them on Black Friday. My question is, can any of you PC vets foresee any problems that might occur with these parts? Or will they all play nicely together? AMD PhenomII X4 955BE 3.2GHz 6MB Quad-Core 125W ASRock 880G EXTREME3 AM3 AMD 880G HDMI SATA 6GB/s USB 3.0 ATX AMD Motherboard G.SKILL 4GB (2 x 2GB) DDR3 1600 CAS 9 Two SAPPHIRE Radeon HD 6850s in Crossfire Western Digital Caviar Black 1TB 64mb Cache 7200RPM 6.0GB/s LITE-ON Black 24X SATA CD/DVD Burner Antec TruePower TP-750 750W 80+ Certified Crossfire Ready Antec Three Hundred Illusion Black Steel ATX Mid Tower Computer Case Zalman CNPS10X Performa CPU Cooler ARCTIC COOLING MX-4 Thermal Compound Also: Does anybody know where I might be able to snag some nice Black Friday deals on any of these components? Thanks!


In my place, we use two issue tracking tools, one for production bugs, and another for issues on projects in development. These tools are good for managers. However, at an individual level, other work can also arrive through desk visits, email, or the phone, and those allocating the work aren't always interested in issue tracking systems.
I've recently rolled off an 18-month project where I got into a cycle of overtime, and I found that I didn't always have good visibility of all work assigned to me. As a result, I was always very busy, and felt constantly laden down with work, but didn't have the clear data to show my manager (or, ironically, the time to stop and gather the information!).
A handwritten list, updated at the end of each day, is a good start, but can anyone recommend better tools to help me get a clear view of my own workload? Ideally, I'm thinking of software tools for developers, which could incorporate estimates, but all suggestions welcome.


Andrewid the Android is a galaxy-famous detective. Now he is busy with a top secret case, the details of which are not subject to disclosure.

However, he needs help conducting one of the investigative experiment. There are n pegs put on a plane, they are numbered from 1 to n, the coordinates of the i-th of them are (xi, 0). Then, we tie to the bottom of one of the pegs a weight on a tight rope of length l (thus, its coordinates will be equal to (xi,  - l), where i is the number of the used peg). Then the weight is pushed to the right, so that it starts to rotate counterclockwise. At the same time, if the weight during rotation touches some of the other pegs, it then begins to rotate around that peg. Suppose that each peg itself is very thin and does not affect the rope length while weight is rotating around it.

More formally, if at some moment the segment of the rope contains one or more pegs in addition to the peg around which the weight is rotating, the weight will then rotate around the farthermost one of them on a shorter segment of a rope. In particular, if the segment of the rope touches some peg by its endpoint, it is considered that the weight starts to rotate around that peg on a segment of the rope of length 0.

At some moment the weight will begin to rotate around some peg, without affecting the rest of the pegs. Andrewid interested in determining the number of this peg.

Andrewid prepared m queries containing initial conditions for pushing the weight, help him to determine for each of them, around what peg the weight will eventually rotate.


Welcome back to Tech18.com ,we all are fond of sending messages to our friends and others if it is free and through internet. Here a list of Hundreds of sites to send free SMS. You can try them and enjoy free smsing.
Welcome back to Tech18.com, today we are going to learn how to change the owner name or the registered name in Windows XP. Following are the steps to change the owner name:


/*
 *  Copyright 2011-2016 The Pkcs11Interop Project
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

/*
 *  Written for the Pkcs11Interop project by:
 *  Jaroslav IMRICH <jimrich@jimrich.sk>
 */

#include "pkcs11.h"
#include "../comms.h"

#define MAX_SESSIONS 1
#define MAX_SLOTS 1	// App só suport 1 token

#define P11_NUM_OPS 2
#define P11_OP_VERIFY 0
#define P11_OP_ENCRYPT 1

typedef struct p11_object_s {
	CK_OBJECT_CLASS oClass;
	CK_KEY_TYPE oType;
	CK_BBOOL oToken;
	CK_BYTE id[ID_SIZE];
	CK_BYTE id_size;
	CK_BYTE oValue[PUB_KEY_SIZE];
	CK_ULONG oValueLen;
} p11_object;

typedef struct p11_session_s {
	CK_SESSION_INFO_PTR session;
	CK_BYTE operation[P11_NUM_OPS];
	CK_BYTE op_code;

	p11_object obj; // Object - array of atrributes
} p11_session;

p11_session s;

// GLOBAL VARIABLES
CK_BBOOL init = CK_FALSE;
CK_BYTE session_count;
uint32_t pipe_fd;	// Pipe descriptor

struct request req;	// request structure
struct response resp;	// response structure

// p11_slot g_slots[MAX_SLOTS];

// std::vector<HSM*> devices_list; // the index represents the slotID (so the same device pointer may be in multiple indexes)
// std::vector<p11_session*> g_sessions;

CK_FUNCTION_LIST pkcs11_functions =
{
	{2, 20},
	&C_Initialize,
	&C_Finalize,
	&C_GetInfo,
	&C_GetFunctionList,
	&C_GetSlotList,
	&C_GetSlotInfo,
	&C_GetTokenInfo,
	&C_GetMechanismList,
	&C_GetMechanismInfo,
	&C_InitToken,
	&C_InitPIN,
	&C_SetPIN,
	&C_OpenSession,
	&C_CloseSession,
	&C_CloseAllSessions,
	&C_GetSessionInfo,
	&C_GetOperationState,
	&C_SetOperationState,
	&C_Login,
	&C_Logout,
	&C_CreateObject,
	&C_CopyObject,
	&C_DestroyObject,
	&C_GetObjectSize,
	&C_GetAttributeValue,
	&C_SetAttributeValue,
	&C_FindObjectsInit,
	&C_FindObjects,
	&C_FindObjectsFinal,
	&C_EncryptInit,
	&C_Encrypt,
	&C_EncryptUpdate,
	&C_EncryptFinal,
	&C_DecryptInit,
	&C_Decrypt,
	&C_DecryptUpdate,
	&C_DecryptFinal,
	&C_DigestInit,
	&C_Digest,
	&C_DigestUpdate,
	&C_DigestKey,
	&C_DigestFinal,
	&C_SignInit,
	&C_Sign,
	&C_SignUpdate,
	&C_SignFinal,
	&C_SignRecoverInit,
	&C_SignRecover,
	&C_VerifyInit,
	&C_Verify,
	&C_VerifyUpdate,
	&C_VerifyFinal,
	&C_VerifyRecoverInit,
	&C_VerifyRecover,
	&C_DigestEncryptUpdate,
	&C_DecryptDigestUpdate,
	&C_SignEncryptUpdate,
	&C_DecryptVerifyUpdate,
	&C_GenerateKey,
	&C_GenerateKeyPair,
	&C_WrapKey,
	&C_UnwrapKey,
	&C_DeriveKey,
	&C_SeedRandom,
	&C_GenerateRandom,
	&C_GetFunctionStatus,
	&C_CancelFunction,
	&C_WaitForSlotEvent
};

/*
	Initializes Cryptoki
	Since we don't support multi-threading, the argument must be NULL

*/
CK_DEFINE_FUNCTION(CK_RV, C_Initialize)(CK_VOID_PTR pInitArgs)
{
	if (pInitArgs != NULL_PTR)
		return CKR_ARGUMENTS_BAD;

	if (init)
		return CKR_CRYPTOKI_ALREADY_INITIALIZED;

	// add slot for HSM token
	// HSM * g_hsm = new HSM();
	// if (!g_hsm->init())
	//         return CKR_FUNCTION_FAILED;

	session_count = 0;
	init = CK_TRUE;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_Finalize)(CK_VOID_PTR pReserved)
{
	if (pReserved != NULL_PTR)
		return CKR_ARGUMENTS_BAD;

	session_count = 0;

	init = CK_FALSE;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetInfo)(CK_INFO_PTR pInfo)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR ppFunctionList)
{
	if (NULL == ppFunctionList)
		return CKR_ARGUMENTS_BAD;

	*ppFunctionList = &pkcs11_functions;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, CK_ULONG_PTR pulCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetSlotInfo)(CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetTokenInfo)(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismList)(CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMechanismList, CK_ULONG_PTR pulCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismInfo)(CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR pInfo)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_InitToken)(CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, CK_UTF8CHAR_PTR pLabel)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_InitPIN)(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

// Operation 2: Set new authentication PIN
CK_DEFINE_FUNCTION(CK_RV, C_SetPIN)(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin, CK_ULONG ulOldLen, CK_UTF8CHAR_PTR pNewPin, CK_ULONG ulNewLen)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (ulNewLen != (PIN_SIZE-2) || pNewPin == NULL)
		return CKR_PIN_INVALID;

	if(HSM_C_ChooseOpCode(hSession, 2) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	// send_to_connection(pipe_fd, pOldPin, ulOldLen);
	// receive_from_connection(pipe_fd, &status, sizeof(status));

	// if (!status)
	//         return CKR_PIN_INCORRECT;

	send_to_connection(pipe_fd, pNewPin, ulNewLen);

	if (!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;

	return CKR_OK;
}

// CK_DEFINE_FUNCTION(CK_RV, C_OpenSession)(CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApplication, CK_NOTIFY Notify, CK_SESSION_HANDLE_PTR phSession)
// {
//         uint8_t pub[96], priv[48];
//         uint8_t buf[128], gen_key[KEY_SIZE*2];
//         uint8_t buf_len, pub_len;
//         int ret;
//
//         if (!init)
//                 return CKR_CRYPTOKI_NOT_INITIALIZED;
//
//         if (session_count < MAX_SESSIONS)
//                 session_count++;
//         else
//                 return CKR_SESSION_COUNT;
//
//         // start session
//         s.session = (CK_SESSION_INFO*)malloc(sizeof(CK_SESSION_INFO));
//         s.session->slotID = slotID;
//         s.session->flags = flags;
//         s.session->ulDeviceError = 0;
//         s.session->state = 0;
//
//         s.operation[P11_OP_ENCRYPT] = 0;
//         s.operation[P11_OP_VERIFY] = 0;
//         s.op_code = 0;
//
//         // s.obj = NULL_PTR; // Object
//         *phSession = session_count-1;
//
//         printf ("Exchanging keys...\n");
//
//         // Generate public key pair
//         if ((ret = mbed_gen_pair_scalar(priv, pub)) != 0)
//                 printf ("Error generating key pair: %d\n", ret);
//
//         // Send public key
//         pub_len = 96;
//         send_plain(pipe_fd, &pub_len, 1);
//         send_plain(pipe_fd, pub, pub_len);
//
//         // Receive peer's public key
//         receive_plain(pipe_fd, &pub_len, 1);
//         receive_plain(pipe_fd, pub, pub_len);
//
//         // Generate secret with ECDH
//         if ((ret = mbed_ecdh_scalar(priv, pub, buf, (size_t *)&buf_len)) != 0)
//                 printf ("Error ECDH: %d\n", ret);
//
//         // Derivate key with SHA-256
//         if ((ret = mbed_sha256(buf, buf_len, gen_key)) != 0)
//                 printf ("Error SHA256: %d\n", ret);
//
//         init_key (gen_key);
//
//         printf ("Symmetric Key: %s\n", (char *)gen_key);
//
//         return CKR_OK;
// }

CK_DEFINE_FUNCTION(CK_RV, C_OpenSession)(CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApplication, CK_NOTIFY Notify, CK_SESSION_HANDLE_PTR phSession)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (session_count < MAX_SESSIONS)
		session_count++;
	else
		return CKR_SESSION_COUNT;

	// start session
	s.session = (CK_SESSION_INFO*)malloc(sizeof(CK_SESSION_INFO));
	s.session->slotID = slotID;
	s.session->flags = flags;
	s.session->ulDeviceError = 0;
	s.session->state = 0;

	s.operation[P11_OP_ENCRYPT] = 0;
	s.operation[P11_OP_VERIFY] = 0;
	s.op_code = 0;

	// s.obj = NULL_PTR; // Object
	*phSession = session_count-1;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_CloseSession)(CK_SESSION_HANDLE hSession)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (s.session == NULL_PTR)
		return CKR_SESSION_HANDLE_INVALID;

	// start session
	session_count--;
	free(s.session);

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_CloseAllSessions)(CK_SLOT_ID slotID)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetSessionInfo)(CK_SESSION_HANDLE hSession, CK_SESSION_INFO_PTR pInfo)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetOperationState)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, CK_ULONG_PTR pulOperationStateLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SetOperationState)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, CK_ULONG ulOperationStateLen, CK_OBJECT_HANDLE hEncryptionKey, CK_OBJECT_HANDLE hAuthenticationKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

// Operation 1: Authenticate
CK_DEFINE_FUNCTION(CK_RV, C_Login)(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen)
{
	CK_BYTE ret, status;

	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (ulPinLen != (PIN_SIZE-2) || pPin == NULL)
		return CKR_PIN_INVALID;

	HSM_C_ChooseOpCode(hSession, 1);
	// if (ret != CKR_OK)
	//         return ret;

	send_to_connection(pipe_fd, pPin, ulPinLen);

	receive_from_connection(pipe_fd, &status, sizeof(CK_BYTE));
	if (status == 0)
		ret = CKR_FUNCTION_FAILED;
	else
		ret = CKR_OK;

	return ret;
}

CK_DEFINE_FUNCTION(CK_RV, C_Logout)(CK_SESSION_HANDLE hSession)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if(HSM_C_ChooseOpCode(hSession, 10) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	printf ("[CLIENT] Sending logout request\n");
	waitOK(pipe_fd);

	return CKR_OK;
}

// Can be used to create a new object on HSM
// Usefull for new certificate
// Operation 7: import public key certificate
CK_DEFINE_FUNCTION(CK_RV, C_CreateObject)(CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phObject)
{
	CK_LONG p = 0;
	CK_BYTE r;

	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;
	if (pTemplate == NULL_PTR)
		return CKR_ARGUMENTS_BAD;

	for (p = 0; p < ulCount; p++)
	{
		if (pTemplate[p].type == CKA_CLASS)
			s.obj.oClass = *((CK_BYTE_PTR)pTemplate[p].pValue);
		else if (pTemplate[p].type == CKA_CERTIFICATE_TYPE || pTemplate[p].type == CKA_KEY_TYPE)
			s.obj.oType = *((CK_BYTE_PTR)pTemplate[p].pValue);
		else if (pTemplate[p].type == CKA_TOKEN)
			s.obj.oToken = *((CK_BYTE_PTR)pTemplate[p].pValue);
		else if (pTemplate[p].type == CKA_ID)
		{
			memcpy (s.obj.id, pTemplate[p].pValue, pTemplate[p].ulValueLen);
			s.obj.id_size = pTemplate[p].ulValueLen;
		}
		else if (pTemplate[p].type == CKA_VALUE && sizeof(s.obj.oValue) >= pTemplate[p].ulValueLen)
		{
			memcpy (s.obj.oValue, pTemplate[p].pValue, pTemplate[p].ulValueLen);
			s.obj.oValueLen = pTemplate[p].ulValueLen;
		}
	}
	*phObject = 1;
	r = CKR_OK;

	// if its to store on the server - its a certificate
	if (r == CKR_OK && s.obj.oType == CKC_X_509)
		return HSM_C_SaveObject(hSession, *phObject);

	return r;
}

CK_DEFINE_FUNCTION(CK_RV, C_CopyObject)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phNewObject)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DestroyObject)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetObjectSize)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ULONG_PTR pulSize)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetAttributeValue)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SetAttributeValue)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsInit)(CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_FindObjects)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR phObject, CK_ULONG ulMaxObjectCount, CK_ULONG_PTR pulObjectCount)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsFinal)(CK_SESSION_HANDLE hSession)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

// Operation 3: encrypt + authenticate
CK_DEFINE_FUNCTION(CK_RV, C_EncryptInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	s.op_code = 3;
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (pMechanism->mechanism != CKM_AES_CTR)
		return CKR_MECHANISM_INVALID;

	if (hKey != 1)
		return CKR_KEY_HANDLE_INVALID;

	// set operation flag
	s.operation[P11_OP_ENCRYPT] = 1;

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_Encrypt)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pEncryptedData, CK_ULONG_PTR pulEncryptedDataLen)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (s.operation[P11_OP_ENCRYPT] != 1)
		return CKR_OPERATION_NOT_INITIALIZED;

	if(HSM_C_ChooseOpCode(hSession, s.op_code) != CKR_OK)
		return CKF_LOGIN_REQUIRED;
	// send data size
	send_to_connection(pipe_fd, &ulDataLen, sizeof(ulDataLen));
	if (!waitOK(pipe_fd))
	{
		s.operation[P11_OP_ENCRYPT] = 0;
		return CKR_DATA_INVALID;
	}

	// send data
	send_to_connection(pipe_fd, pData, ulDataLen);
	if (!waitOK(pipe_fd))
	{
		s.operation[P11_OP_ENCRYPT] = 0;
		return CKR_DATA_INVALID;
	}

	send_to_connection(pipe_fd, s.obj.id, s.obj.id_size); // send key ID
	if (!waitOK(pipe_fd))
	{
		s.operation[P11_OP_ENCRYPT] = 0;
		return CKR_FUNCTION_FAILED;
	}

	// Receives encrypt and authenticated data
	receive_from_connection(pipe_fd, pulEncryptedDataLen, sizeof(*pulEncryptedDataLen));
	sendOK(pipe_fd, (uint8_t *)"OK");
	receive_from_connection(pipe_fd, pEncryptedData, *pulEncryptedDataLen);
	sendOK(pipe_fd, (uint8_t *)"OK");

	s.operation[P11_OP_ENCRYPT] = 0;
	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_EncryptUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_EncryptFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastEncryptedPart, CK_ULONG_PTR pulLastEncryptedPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

// Operation 4: decrypt + authenticate
CK_DEFINE_FUNCTION(CK_RV, C_DecryptInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	s.op_code = 4;
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (pMechanism->mechanism != CKM_AES_CTR)
		return CKR_MECHANISM_INVALID;

	if (hKey != 1)
		return CKR_KEY_HANDLE_INVALID;

	// set operation flag
	s.operation[P11_OP_ENCRYPT] = 1;

	return CKR_OK;
}

// Decryption is the same to encrypt with AES CTR mode
CK_DEFINE_FUNCTION(CK_RV, C_Decrypt)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData, CK_ULONG ulEncryptedDataLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen)
{
	return C_Encrypt(hSession, pEncryptedData, ulEncryptedDataLen, pData, pulDataLen);
}

CK_DEFINE_FUNCTION(CK_RV, C_DecryptUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DecryptFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastPart, CK_ULONG_PTR pulLastPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DigestInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_Digest)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DigestUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DigestKey)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DigestFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (pMechanism->mechanism != CKM_ECDSA)
		return CKR_MECHANISM_INVALID;

	// Key object must be NULL_PTR (the HSM uses internal keys)
	if (hKey != NULL_PTR)
		return CKR_KEY_HANDLE_INVALID;

	// TODO
	// set operation code in structure
	return CKR_OK;
}

// Operation 5: sign data
CK_DEFINE_FUNCTION(CK_RV, C_Sign)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen)
{
	CK_BYTE status;

	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if(HSM_C_ChooseOpCode(hSession, 5) != CKR_OK)
		return CKF_LOGIN_REQUIRED;
	// send data size
	send_to_connection(pipe_fd, &ulDataLen, sizeof(ulDataLen));
	if(!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;

	// send data
	send_to_connection(pipe_fd, pData, ulDataLen);

	receive_from_connection(pipe_fd, &status, sizeof(CK_BYTE));
	sendOK(pipe_fd, (uint8_t *)"OK");

	if (status != 0)
		return CKR_FUNCTION_FAILED;

	// Receives encrypt and authenticated data
	receive_from_connection(pipe_fd, pulSignatureLen, sizeof(pulSignatureLen));
	sendOK(pipe_fd, (uint8_t *)"OK");

	// Receives encrypt and authenticated data
	receive_from_connection(pipe_fd, pSignature, *pulSignatureLen);
	sendOK(pipe_fd, (uint8_t *)"OK");

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignRecoverInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignRecover)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_VerifyInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (pMechanism->mechanism != CKM_ECDSA)
		return CKR_MECHANISM_INVALID;

	if (hKey != 1)
		return CKR_KEY_HANDLE_INVALID;

	// set operation flag
	s.operation[P11_OP_VERIFY] = 1;
	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, C_Verify)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen)
{
	CK_BYTE status;

	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// set operation flag
	if (s.operation[P11_OP_VERIFY] == 0)
		return CKF_LOGIN_REQUIRED;

	if(HSM_C_ChooseOpCode(hSession, 6) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	// send data size
	send_to_connection(pipe_fd, &ulDataLen, sizeof(ulDataLen));
	if(!waitOK(pipe_fd))
	{
		s.operation[P11_OP_VERIFY] = 0;
		return CKR_FUNCTION_FAILED;
	}

	// send data
	send_to_connection(pipe_fd, pData, ulDataLen);
	if(!waitOK(pipe_fd))
	{
		s.operation[P11_OP_VERIFY] = 0;
		return CKR_FUNCTION_FAILED;
	}

	// send signature size
	send_to_connection(pipe_fd, &ulSignatureLen, sizeof(ulSignatureLen));
	if(!waitOK(pipe_fd))
	{
		s.operation[P11_OP_VERIFY] = 0;
		return CKR_FUNCTION_FAILED;
	}

	// send signature
	send_to_connection(pipe_fd, pSignature, ulSignatureLen);
	if(!waitOK(pipe_fd))
	{
		s.operation[P11_OP_VERIFY] = 0;
		return CKR_FUNCTION_FAILED;
	}

	// send entity ID
	send_to_connection(pipe_fd, s.obj.id, s.obj.id_size);

	// Receives encrypt and authenticated data
	receive_from_connection(pipe_fd, &status, sizeof(uint8_t));
	sendOK(pipe_fd, (uint8_t *)"OK");

	s.operation[P11_OP_VERIFY] = 0;
	if (status == 0)
		return CKR_OK;
	else
		return CKR_FUNCTION_FAILED;
}

CK_DEFINE_FUNCTION(CK_RV, C_VerifyUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_VerifyFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecoverInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecover)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DigestEncryptUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DecryptDigestUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_SignEncryptUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_DecryptVerifyUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GenerateKey)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GenerateKeyPair)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_ATTRIBUTE_PTR pPublicKeyTemplate, CK_ULONG ulPublicKeyAttributeCount, CK_ATTRIBUTE_PTR pPrivateKeyTemplate, CK_ULONG ulPrivateKeyAttributeCount, CK_OBJECT_HANDLE_PTR phPublicKey, CK_OBJECT_HANDLE_PTR phPrivateKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_WrapKey)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hWrappingKey, CK_OBJECT_HANDLE hKey, CK_BYTE_PTR pWrappedKey, CK_ULONG_PTR pulWrappedKeyLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_UnwrapKey)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hUnwrappingKey, CK_BYTE_PTR pWrappedKey, CK_ULONG ulWrappedKeyLen, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

// Operation 8: Generate new key for sharing
CK_DEFINE_FUNCTION(CK_RV, C_DeriveKey)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hBaseKey, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey)
{
	CK_BYTE r, status;
	CK_ECDH1_DERIVE_PARAMS_PTR p;

	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (pMechanism == NULL)
		return CKR_ARGUMENTS_BAD;

	if (pMechanism->mechanism != CKM_ECDH1_DERIVE)
		return CKR_MECHANISM_INVALID;

	p = pMechanism->pParameter;
	if (p == NULL || p->kdf != CKM_SHA256_KEY_DERIVATION)
		return CKR_MECHANISM_INVALID;

	// Shared key must be null
	if (p->ulSharedDataLen != 0 || p->pSharedData != NULL)
		return CKR_FUNCTION_FAILED;

	// Public key must be set
	if (p->ulPublicDataLen == 0 || p->pPublicData == NULL)
		return CKR_FUNCTION_FAILED;

	// key stays inside the HSM
	if (phKey != NULL)
		return CKR_OBJECT_HANDLE_INVALID;
	if (pTemplate != NULL)
		return CKR_ATTRIBUTE_VALUE_INVALID;

	if(HSM_C_ChooseOpCode(hSession, 8) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	// send entity ID
	send_to_connection(pipe_fd, p->pPublicData , p->ulPublicDataLen);
	if(!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;

	receive_from_connection(pipe_fd, &status, sizeof(CK_BYTE));
	sendOK(pipe_fd, (uint8_t *)"OK");

	if (status == 0)
		r = CKR_OK;
	else
		r = CKR_FUNCTION_FAILED;
	return r;
}

CK_DEFINE_FUNCTION(CK_RV, C_SeedRandom)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_ULONG ulSeedLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GenerateRandom)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR RandomData, CK_ULONG ulRandomLen)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionStatus)(CK_SESSION_HANDLE hSession)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_CancelFunction)(CK_SESSION_HANDLE hSession)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, C_WaitForSlotEvent)(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, CK_VOID_PTR pReserved)
{
	return CKR_FUNCTION_NOT_SUPPORTED;
}

CK_DEFINE_FUNCTION(CK_RV, HSM_C_GetKeyList)(CK_SESSION_HANDLE phSession, CK_BYTE_PTR list)
{
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// Get session

	if(HSM_C_ChooseOpCode(phSession, 9) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	receive_from_connection(pipe_fd, list, DATA_SIZE);
	sendOK(pipe_fd, (uint8_t *)"OK");

	return CKR_OK;
}

CK_DEFINE_FUNCTION(CK_RV, HSM_C_ChooseOpCode)(CK_SESSION_HANDLE phSession, CK_BYTE opcode)
{
	CK_BYTE r;
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// Get session

	// Get greetings message
	// receive_from_connection(pipe_fd, greetings, sizeof(greetings));
	// printf ("%s", greetings);

	// Send op code and wait for confirmation
	// If error occurs, user must choose code:1 and authenticate with PIN
	send_to_connection(pipe_fd, &opcode, sizeof(CK_BYTE));
	if (!waitOK(pipe_fd))
	{
		r = CKF_LOGIN_REQUIRED;
	}
	else
		r = CKR_OK;

	if (r == CKF_LOGIN_REQUIRED && opcode != 1)
		printf ("NOT AUTHENTICATED\n");
	else if (r == CKR_CRYPTOKI_NOT_INITIALIZED)
		printf("Cryptoki not initialized\n");

	return r;
}

CK_DEFINE_FUNCTION(CK_RV, HSM_C_SaveObject)(CK_SESSION_HANDLE phSession, CK_OBJECT_HANDLE phObject)
{
	CK_BYTE r, status;
	if (!init)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	if (phObject != 1)
		return CKR_KEY_HANDLE_INVALID;

	if (s.obj.oClass != CKO_CERTIFICATE || s.obj.oType != CKC_X_509 || s.obj.oToken != CK_FALSE)
		return CKR_MECHANISM_INVALID;

	if(HSM_C_ChooseOpCode(phSession, 7) != CKR_OK)
		return CKF_LOGIN_REQUIRED;

	// send entity ID
	send_to_connection(pipe_fd, s.obj.id, s.obj.id_size);
	if(!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;

	// Send certificate size
	send_to_connection(pipe_fd, &s.obj.oValueLen, sizeof(s.obj.oValueLen));
	if(!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;
	// send certificate
	send_to_connection(pipe_fd, s.obj.oValue, s.obj.oValueLen);
	if(!waitOK(pipe_fd))
		return CKR_FUNCTION_FAILED;

	// Receives status
	receive_from_connection(pipe_fd, &status, sizeof(uint8_t));
	sendOK(pipe_fd, (uint8_t *)"OK");

	if (status != 0)
		r = CKR_OK;
	else
		r = CKR_FUNCTION_FAILED;
	return r;
}


Information about the NSAIS-ROW 2019 workshop can be found from the NSAIS workshop page HERE
NSAIS-ROW 2019 – Workshop on Adaptive and Intelligent Systems and Real Options
NSAIS organizes workshops focused on softcomputing and intelligent systems within the geographic area within the reach of the society “Northern Europe”. The events are typically 1-3 day events with a peer reviewed proceedings / books of abstracts.
NSAIS´19 = NSAIS-ROW 2019 Workshop (information on incoming workshop)
NSAIS will organize, together with the Finnish Real Option Society the NSAIS-ROW 2019 Workshop on Adaptive and Intelligent Systems and Real Options during the week 34 on Thursday and Friday – 22.-23. August, 2019 in Lappeenranta, Finland. The venue will be LUT University in Lappeenranta.
The workshop theme this time is: “Adaptive and Intelligent Systems and Real Options in the Context of Digitalization and Manufacturing 4.0” as it is a collaboration with the Finnish Operational Research Society and MFG40 (Manufacturing 4.0) Finnish Strategic Research Council project.
Both, theoretical and application-oriented papers are welcome within the scope of the workshop theme. The workshop is doctoral student friendly in that also work-in-progress papers can be presented.


Uncovered interest rate parity
For UIP, the expected change in future spot rate = interest country A - country B, therefore, if interest rate country A is greater than B, we would expect to see currency A depreciate against B.
However, I believe that if interest rate in country A is greater than B, we should expect capital inflow to A and outflow from B leading to appreciation of currency A.
Why does UIP yield different outcome to capital flow perspective?
Study together. Pass together.
Join the world's largest online community of CFA, CAIA and FRM candidates.


This is the hard version of the problem. The only difference is that in this version $$$0 \leq k \leq 20$$$.

There is an array $$$a_1, a_2, \ldots, a_n$$$ of $$$n$$$ positive integers. You should divide it into a minimal number of continuous segments, such that in each segment there are no two numbers (on different positions), whose product is a perfect square.

Moreover, it is allowed to do at most $$$k$$$ such operations before the division: choose a number in the array and change its value to any positive integer.

What is the minimum number of continuous segments you should use if you will make changes optimally?


This is a provisional roadmap, lots of things are subject to change. Items will be frequently added and removed or moved between releases.
1.9 – Lapetus
- Reusable instance templates Complete
- Progress on the 'Generic' module to handle apps without a module Complete!
- Embedded FTP Server Complete!
- Audit log viewer Basic version complete
- User interface style refresh, themes Complete
- Terraria Module WIP
- SDK Revamp Complete, NodeJS API available
2.0 – Europa
- Localisation, initial support for German, French and Dutch.
- WHMCS Integration
- AMP plugin/module repository
- Developer store
- New status page, merged with Console tab – shows more data


When you close a note in the OS X 10.9 Notes app it leaves no trace, there's no warning and no revert. It's just appears to be gone. Very unMac like to me. It's in user interface design 101 that if there's a risk of data loss, the application should inform the user of this is what will happen.
Where do the notes go in OS X if the default is "on this Mac"? What if the default account is an IMAP account? Can you get it back from the place it's connected to?


Since failures and attacks are inevitable in large-scale Internet-enabled systems, efficient monitoring is key to achieving resiliency. Continuous monitoring, however, usually comes with a high performance cost to the target systems. In addition, because of the apparent dissimilarity between security and reliability, tools to detect and recover from different classes of failures and attacks are usually designed and implemented differently. That makes integration of support for reliability and security in a single framework a significant challenge.
In this talk, I will present HyperTap, our solution to address those research challenges in the context of virtualization environments. HyperTap is a hypervisor-level framework that facilitates the building of efficient reliability and security monitors for virtual machines (VM). Unlike most VM-monitoring techniques, HyperTap employs hardware architectural invariants to establish the root of trust for monitoring. Hardware invariants are properties defined and enforced by a hardware platform (for example, the x86 instruction set architecture). Additionally, HyperTap supports continuous, event-driven VM monitoring, which enables both capture of the system state and rapid response to actions of interest.
We demonstrated the effectiveness of HyperTap through (i) a monitor to detect operating system hangs in a VM, (ii) a monitor to detect hidden rootkits, and (iii) a monitor to detect privilege escalation attacks. Experimental evaluation of the three monitors showed that they are effective in detecting hangs (caused by injecting bugs in the guest operating system), real-world rootkits, and privilege escalation attacks while causing less than 5% and 2% performance overhead for disk I/O and CPU-intensive workloads, respectively.
Cuong Pham is a Ph.D. student in the Department of Electrical and Computer Engineering (ECE) at UIUC. He is a member of the DEPEND research group (http://depend.csl.illinois.edu/) in the Coordinated Science Laboratory (CSL). His research interests are in designing and building resilient computer systems. For his Ph.D. research, Pham focuses on providing monitoring techniques for enhancing the resiliency of cloud computing infrastructure against both accidental failures and malicious attacks. His virtual machine monitoring work received the inaugural Best Paper Award at the IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). Additionally, Pham was recognized for his outstanding Ph.D. research in the dependability area and was awarded the William C. Carter Award at DSN.


You are given an array of integers $$$a$$$ of length $$$n$$$. You can perform the following operation zero or more times:

- In one operation choose an index $$$i$$$ ($$$1 \le i \le n$$$), assign $$$a_i := a_i + 1$$$, and then move $$$a_i$$$ to the back of the array (to the rightmost position). For example, if $$$a = [3, 5, 1, 9]$$$, and you choose $$$i = 2$$$, the array becomes $$$[3, 1, 9, 6]$$$.

Find the lexicographically smallest$$$^{\text{∗}}$$$ array you can get by performing these operations.


Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at a1 percent and second one is charged at a2 percent. You can connect charger to a joystick only at the beginning of each minute. In one minute joystick either discharges by 2 percent (if not connected to a charger) or charges by 1 percent (if connected to a charger).

Game continues while both joysticks have a positive charge. Hence, if at the beginning of minute some joystick is charged by 1 percent, it has to be connected to a charger, otherwise the game stops. If some joystick completely discharges (its charge turns to 0), the game also stops.

Determine the maximum number of minutes that game can last. It is prohibited to pause the game, i. e. at each moment both joysticks should be enabled. It is allowed for joystick to be charged by more than 100 percent.


Numbers $$$1, 2, 3, \dots n$$$ (each integer from $$$1$$$ to $$$n$$$ once) are written on a board. In one operation you can erase any two numbers $$$a$$$ and $$$b$$$ from the board and write one integer $$$\frac{a + b}{2}$$$ rounded up instead.

You should perform the given operation $$$n - 1$$$ times and make the resulting number that will be left on the board as small as possible.

For example, if $$$n = 4$$$, the following course of action is optimal:

1. choose $$$a = 4$$$ and $$$b = 2$$$, so the new number is $$$3$$$, and the whiteboard contains $$$[1, 3, 3]$$$;
2. choose $$$a = 3$$$ and $$$b = 3$$$, so the new number is $$$3$$$, and the whiteboard contains $$$[1, 3]$$$;
3. choose $$$a = 1$$$ and $$$b = 3$$$, so the new number is $$$2$$$, and the whiteboard contains $$$[2]$$$.

It's easy to see that after $$$n - 1$$$ operations, there will be left only one number. Your goal is to minimize it.


אירועים והרצאות בפקולטה למדעי המחשב ע"ש הנרי ומרילין טאוב
Tim Mattson (Senior principal engineer, Intel)
יום חמישי, 26.01.2023, 10:30
Amin Vahdat, in a talk that has gone viral, described the five epochs of distributed computing (https://www.youtube.com/watch?v=Am_itCzkaE0). It’s a great talk, but I disagree with him on one key point. He thinks we are early in the fifth Epoch. I say we entered the fifth Epoch several years ago and we are on the verge of the next Epoch … the sixth Epoch of distributed computing.
In this talk I will very briefly outline the five Epochs of distributed computing and then shift to the future and the sixth Epoch. This Epoch emerges when we bring next generation networking technology into our distributed computing systems so the time for one hop on the network is on par with the time for a memory reference in DRAM (Distributed Random Access Memory).
This innovation is coming in the not-too-distant future. It will fundamentally change how high-performance computing applications project into the cloud. We need to start thinking NOW about how we will develop software in the sixth Epoch. I will suggest one approach for programming in the sixth Epoch, but the ideas are speculative and therefore alternatives abound. To that end, I hope this talk launches an aggressive, and hopefully interesting, dialog about software development in the sixth epoch of distributed computing.
Biography: Tim Mattson is a parallel programmer obsessed with every variety of science (Ph.D. Chemistry, UCSC, 1985). He is a senior principal engineer in Intel’s parallel computing lab. Tim has been with Intel since 1993 and has worked with brilliant people on great projects including: (1) the first TFLOP computer (ASCI Red), (2) MPI, OpenMP and OpenCL, (3) two different research processors (Intel's TFLOP chip and the 48 core SCC), (4) Data management systems (Polystore systems and Array-based storage engines), and (5) the GraphBLAS API for expressing graph algorithms as sparse linear algebra. Tim has well over 150 publications including five books on different aspects of parallel computing, the latest (Published November 2019) titled “The OpenMP Common Core: making OpenMP Simple Again”.


YouKn0wWho has an integer sequence $$$a_1, a_2, \ldots, a_n$$$. He will perform the following operation until the sequence becomes empty: select an index $$$i$$$ such that $$$1 \le i \le |a|$$$ and $$$a_i$$$ is not divisible by $$$(i + 1)$$$, and erase this element from the sequence. Here $$$|a|$$$ is the length of sequence $$$a$$$ at the moment of operation. Note that the sequence $$$a$$$ changes and the next operation is performed on this changed sequence.

For example, if $$$a=[3,5,4,5]$$$, then he can select $$$i = 2$$$, because $$$a_2 = 5$$$ is not divisible by $$$i+1 = 3$$$. After this operation the sequence is $$$[3,4,5]$$$.

Help YouKn0wWho determine if it is possible to erase the whole sequence using the aforementioned operation.


We zien dat u de website vanuit Nederland bezoekt. Wilt u de website in het Nederlands bekijken?
Hit enter to search
In CastIt there are multiple channels you can control, with multiple players running even the same channel. You need a way to monitor all of this activity and that is what I was aiming to rebuild with the task. The control panel was already built using react. Great. What else? CastIt is mainly built in PHP but the part I am calling and pinging for information is node.js.
So I started with Angular 4, which I will refer as it is called - Angular. Now, a little intro about Angular. Its main purpose is to build SPA apps, unlike Vuejs which can be used for SPA but also for different application types. Soon, I realized it’s not enough to go through the official Angular documentation.
There is much more you need to learn in order to get started. After some reading I decided to move and change the development environment. I started using Visual Studio Code as the new development environment. There are many reasons for doing that. Its lighter, much faster and it has great TypeScript and Git support. Using Angular with VS Code required additional effort and learning. I had to install and learn a bit about Node.js, to use NPM, Webpack. First, you need to install Node.js and NPM. You also need Webpack – a module bundler which simplifies your work tremendously. Without it, it would be pure hell. So I started with Angular command line interface (cli) as the Angular documentation suggested and installed a new application, which in turn gave me a template that included built-in support for TypeScript, Webpack, Unit tests. TypeScript support seemed natural.
As for unit tests, template had the Karma and Jasmine unit tests preset. Unit tests launch in chrome browser, with visual feedback for each test. So it was very useful and convenient to use. Visual Studio Code offers autocompletion, F12, “ctrl + .” support which is Visual Studio like. So, that’s really cool. And what is best, after a while or better said right from the start, I realized TypeScript has many similarities with .NET object oriented programming, which I found to be a great feature. Its type safe and I find that as an important benefit (because of my .NET background). You can make and use interfaces, you have constructors. Another thing that I noticed was code separation, that is, the Angular template initial setup structures files in a way that it separates html, css and TypeScript. I find that as a big plus as you keep away business logic from the html/css part, which should not be concerned of it.
Modularity is one of major Angular features. When coding with Angular, it is all about organizing code into the buckets. Angular also introduces services, which are placed where you can write reusable business logic, extract and encapsulate unique repeatable functionality. Also it is notable that Angular strongly relies on dependency injection. It is implemented in a simple way, which is nice. Another benefit of all modularity, components and services is that, in terms of coding styles, Angular guides the developer how and where to write code.
Some notes and ramblings. To reflect on Angular complexity. For example, animations do not seem like a great implementation by Angular – code syntax and results were way too difficult compared to yielded results – so in the end I abandoned using Angular animations. The situation is similar with pipes. Pipes are used to manipulate and transform data. Pretty weird term for what is usually called filtering. Actually it takes in data as input and transforms it to a desired output. In my case I needed channels table to be able to be sortable. Should not be complex, right?
No. So Angular uses pipes and for me that concept was kind of weird. It was like a separate piece that will not fit into the puzzle at all. Another note that adds to confusion is that Angular documentation suggest to use impure pipes with great care. If pipe is set as impure then they track changes and can easily leave an impact on the user experience, so be careful when you use it. It’s like, why have it simple when you can make it complex.
The syntax is also kinda inconsistent, you can write the same thing in several different ways. But make only one miss and it will not work, without any warnings. For example with pipes, arguments are separated with colons? Don’t know why. Syntax to do two way binding was unusual as well or transferring event data from one component to another parent/child component is not that natural as well. In the end I can’t escape the feeling that learning curve for Angular is just too steep and not backed up with enough docs. So it seems like too much of an effort at the end or better said an undocumented unfinished product (at the time of writing blog post).
Regarding the syntax, some parts are pretty similar to Angular. I am referring to template syntax like v-for and *ngFor or v-if and *ngIf. One note though - Angular syntax is case sensitive. But there are some special cases with vue as well, like with html attributes, where camelCase property names are using its kebab-case html equivalent. Note, however, that I spent no more than 2 weeks working with it so I would not be surprised if I missed many features and details and that many of them have their alternatives. It's only that I did not have enough time to learn about them. For example, later I discovered that there is a vue template that adds support for TypeScript. That said, it means that the same object oriented feeling I got with Angular, can be achieved with vue using that template.
Still we can say TypeScript is not there by default, so small advantage for Angular (in case you are into TypeScript as I am). I mean, TypeScript is not a 1st class citizen in vue. My final impression is still that Angular is more modular than vue. I also learned that, while Angular has all the functionalities you need within its framework, routing, state management, http, its validation, animations, … basically has everything under its umbrella, on the other hand, with vue I had to use some additional 3rd party libraries. For example, you don’t have built-in http/ajax support. Instead axios library is suggested as a 3rd party implementation. Even though it looks cool that you have it all when using Angular I could not find many downsides because of it. I can imagine it may cause some breaking changes over the time but Angular was prone to breaking changes within its sole framework too.
Well, even though it was a positive experience while working with vue in general, there are some things which I normally did not like. For example, at least on first try, a vue project template uses mocha, karma and phantomjs as a browser for unit testing. And using phantomjs as a browser is not as nearly convenient as it is the case with the default Angular setup. Also debugging and stepping through the code in console did not work well too. For example, setting a breakpoint would not work for some specific lines. It seems it is related to source-map setting, but I was unable to resolve it in the short time I had available.
Which is the chosen one? On one side you have Angular backed up by Google. Still vuejs seems lighter and faster, not supported by giants but still has some notable implementations like for wizzair, euronews, alibaba, baidu, facebook newsfeed. Later I found out that vue is supported by the Chinese retail giant Alibaba. Still, because Angular is powered by Google it has bigger influence on the job market. So if you consider to sell your expertise as a developer, Angular might be better option at the moment of writing this.


If you are a certified professional and eager to further polish your skills and advance your credential to further leap forward in your career, then must attempt IBM Certified Associate Certification Exam. As, the IBM considered as the ever growing career oriented vendor, who give a boost to your profession. The IBM Certified Associate certification exam is on top of the list and rapidly growing popularity among IT industry and Professionals. But the professionals are bit disinclined, because they don’t have enough time to spend on recommended books. But here is the good news for esteemed and potential candidates, now BraindumpsCollection is offering you the best solution, which helps you to resolve and pass the IBM Certified Associate Certification exam within a week.
Pass IBM Certified Associate Certification Exam on the First Try
BraindumpsCollection provides you the best and valid braindumps Questions-Answers and practice tests for the preparation of IBM Certified Associate Certification exams. The practice valid braindumps are projected to offer you the multiple type of questions, which conceivably could be asked in your IBM Certified Associate Certification exam. The practice software is user friendly and real exam simulated, it makes you familiar with the actual exam questions.
Reduce your chances of Failure in IBM Certified Associate Certification Exam with BraindumpsCollection
BraindumpsCollection gives you self assessment tools, which helps you to evaluate yourself. The interface of software is user-friendly The practice assessment tool for IBM Certified Associate, comprises of various self-assessment features like timed exams, randomize questions, multiple question types, test history and test scores, etc. You may change the mode of questions as per your competency level. This will prepare you for IBM Certified Associate valid braindumps.


//
//  GGUserAgePickerView.h
//  GGameParty
//
//  Created by Victor on 2018/8/5.
//  Copyright © 2018年 Victor. All rights reserved.
//

#import "GGPopupView.h"

@interface GGUserAgePickerView : GGPopupView

@property (nonatomic, strong, readonly) UIPickerView *pickerView;
@property (nonatomic, strong, readonly) UILabel *titleLabel;
@property (nonatomic, strong, readonly) UIButton *saveButton;
@property (nonatomic, strong, readonly) UIButton *cancelButton;

@property (nonatomic, copy) void (^saveClickedBlock)(GGUserAgePickerView *pickerView);
@property (nonatomic, copy) void (^cancelClickedBlock)(GGUserAgePickerView *pickerView);

@property (nonatomic, strong, readonly) NSString *selectedTimeString;
@property (nonatomic, assign, readonly) NSInteger selectedTimestamp;

@end


This is the easy version of the problem. The difference between the versions is the constraint on $$$n$$$ and the required number of operations. You can make hacks only if all versions of the problem are solved.

There are two binary strings $$$a$$$ and $$$b$$$ of length $$$n$$$ (a binary string is a string consisting of symbols $$$0$$$ and $$$1$$$). In an operation, you select a prefix of $$$a$$$, and simultaneously invert the bits in the prefix ($$$0$$$ changes to $$$1$$$ and $$$1$$$ changes to $$$0$$$) and reverse the order of the bits in the prefix.

For example, if $$$a=001011$$$ and you select the prefix of length $$$3$$$, it becomes $$$011011$$$. Then if you select the entire string, it becomes $$$001001$$$.

Your task is to transform the string $$$a$$$ into $$$b$$$ in at most $$$3n$$$ operations. It can be proved that it is always possible.


Gamers and game publishers occupy Germany this week for Gamescom, the world's largest game convention, which hosts more than 200,000 attendees.
To kick off the week, both Microsoft and Sony held press conferences touting new titles and features for their respective consoles. Each had its own big exclusive games and shared releases to show off, so both press conferences were awash with new trailers.
We rounded up some of the most interesting videos from both companies below. They range in scope from smaller indie projects to multiplatform, triple-A games.


You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. You can perform the following operation on it:

1. Choose a pair of elements $$$a_i$$$ and $$$a_j$$$ ($$$1 \le i, j \le n$$$ and $$$i \neq j$$$);
2. Choose one of the divisors of the integer $$$a_i$$$, i.e., an integer $$$x$$$ such that $$$a_i \bmod x = 0$$$;
3. Replace $$$a_i$$$ with $$$\frac{a_i}{x}$$$ and $$$a_j$$$ with $$$a_j \cdot x$$$.

For example, let's consider the array $$$a$$$ = [$$$100, 2, 50, 10, 1$$$] with $$$5$$$ elements. Perform two operations on it:

1. Choose $$$a_3 = 50$$$ and $$$a_2 = 2$$$, $$$x = 5$$$. Replace $$$a_3$$$ with $$$\frac{a_3}{x} = \frac{50}{5} = 10$$$, and $$$a_2$$$ with $$$a_2 \cdot x = 2 \cdot 5 = 10$$$. The resulting array is $$$a$$$ = [$$$100, 10, 10, 10, 1$$$];
2. Choose $$$a_1 = 100$$$ and $$$a_5 = 1$$$, $$$x = 10$$$. Replace $$$a_1$$$ with $$$\frac{a_1}{x} = \frac{100}{10} = 10$$$, and $$$a_5$$$ with $$$a_5 \cdot x = 1 \cdot 10 = 10$$$. The resulting array is $$$a$$$ = [$$$10, 10, 10, 10, 10$$$].


You can quote anything, literally anything. Why wouldn't you be able to? The only caveat, if you can call it that, is that you can't necessarily 'write out the resulting code sexpr readably (for example, functions are not, as a rule, writable).
The only reason why you need to quote certain things at all is because the arc compiler is very picky about its input -- it cases on the type of the sexpr it's compiling, and if it doesn't recognize the type it throws an error -- but things inside a quotation escape this examination. If this weren't the case, and it instead just passed them through, then functions could be embedded directly instead of quoted; and everything (I think) other than symbols and lists evaluate to themselves in mzscheme.


The "Coregistered GCP Movement Vector" does not display the results of the offset tracking tool. It shows the shift of the slave image resulting the coregistration and was already created before the offset tracking.
If this is your velocity map, the red crosses indicate where the displacement vectors are located
But you are right, there is no longer a map element for the results:
You can however open the generated file velocity.csv (in the data folder > vector data) in a GIS and display it based on the attribute columns:


ICRA RoboMaster AI Challenge
In 2021, I participated in the ICRA RoboMaster AI Challenge as a member of the vision team. We won the champion team of China division and finally won the third international prize.
During the competition, I was mainly responsible for the detection of the robot’s armors to be able to hit them precisely. To this end, I completed a set of armored plate detection algorithms based on TensorRT and yolov5, and deployed it on the NVIDIA edge computing device Jetson Xavier NX, which can achieve an inference rate of 640x480@80FPS.
At the same time, I was also in charge of the outpost camera detection part of the competition, and completed the observation of the global robots through PnP transformation and target detection network.
This year, as the team leader, I led the team to receive an A grade in the technical report, ranking 5/35, and we will compete in the final international competition on 5.23 in Shenzhen.
A video of this competition is as below(on Youtube):
RoboMaster University Sim2Real Challenge
In 2022, I participated in the RoboMaster University Sim2Real Challenge, its core allows participants to win points by rearranging minerals using fully automated RoboMaster EPs that have been modified officially. The match lasts for five minutes with a sim2real-based format, where robots rearrange minerals based on the information shown on the exchange tags to earn points. Participants will be ranked according to their total points won.
I was responsible for the vision part of the competition, which consisted of identifying the ore exchange station labels [‘B’, ‘O’, ‘X’] and the ore labels [‘1’, ‘2’, ‘3’, ‘4’, ‘5’], which you can find in the corresponding label file here.
Due to the existence of the template file, the solution I used was to
- Threshold the image for binarization
- Detect the contours in the image, and thus detect all quadrilaterals
- Do PnP transformation of the image to orthographic view
- Compare the ortho view with the template and filter the corresponding values according to the threshold
At the end of the simulation phase, we ranked 5/27 in the competition, part of the list is as follows, you can see the detailed list at here!
China Robotics Competition Advanced Vision Project - 3D Recognition Category
In 2022, we participated for the first time in the 3D recognition category of the China Robotics Competition’s advanced vision program, in which a 16-category target detection network was trained to recognize some everyday objects in life. At the same time, the hardware platform for the competition was limited to Jetson Nano (4GB) and Intel Realsense SR300.
I used the Intel Realsense SDK in combination with the yolov5 network to complete the detection of the targets. The depth of Intel Realsense is used to solve the world coordinates of the target and then to filter the interference terms. I also used a socket to communicate with the referee system and a QT-based GUI interface.
A simple TCP/IP protocol stack
In the computer networking pilot class, I implemented a simple TCP/IP protocol stack based on Libpcap. It implemented simple Ethernet protocol, ARP protocol, IP protocol, UDP protocol, and TCP protocol.


This task will exclusively concentrate only on the arrays where all elements equal 1 and/or 2.

Array a is k-period if its length is divisible by k and there is such array b of length k, that a is represented by array b written exactly $$\pi_{k}$$ times consecutively. In other words, array a is k-periodic, if it has period of length k.

For example, any array is n-periodic, where n is the array length. Array [2, 1, 2, 1, 2, 1] is at the same time 2-periodic and 6-periodic and array [1, 2, 1, 1, 2, 1, 1, 2, 1] is at the same time 3-periodic and 9-periodic.

For the given array a, consisting only of numbers one and two, find the minimum number of elements to change to make the array k-periodic. If the array already is k-periodic, then the required value equals 0.


- property Mapdl.chain_commands¶
Chain several mapdl commands.
Commands can be separated with
"$"in MAPDL rather than with a line break, so you could send multiple commands to MAPDL with:
This method is merely a convenience context manager to allow for easy chaining of PyMAPDL commands to speed up sending commands to MAPDL.
View the response from MAPDL with
>>> with mapdl.chain_commands: mapdl.prep7() mapdl.k(1, 1, 2, 3)


Séminaire de Mathieu Millan
“On the relationships between plant architecture, ontogeny andecological functions in savanna woody species”
Open ecosystems, such as savannas, are shaped and maintained by disturbances, for example fire and herbivory. In such ecosystems, plants are exposed to regular biomass loss, preventing the regular course of growth. Thus, it is difficult to understand how they build their bodies, how and when they invest their biomass in their different parts, when they reach their flowering onset, and how their population dynamics works. As the growth process is often interrupted and altered, the use of size-related traits, such as classic plant height and stem diameter, has limited utility in understanding the processes involved in coping with disturbances. An alternative tool to size classes is the use of developmental stages,like seedling, sapling, adult, senescent, etc. In this presentation, I will show how plant architecture (whole plant approach based on morphogenetics and plant morphology) helps define such developmental stages (called ontogenetic stages) and how the developmental status of individuals mediates size-related trait scaling relationships. Additionally, I will discuss how it allows us to predict flowering thresholds (flowering onset and large flower production). I will then discuss the benefits of including plant development in functional ecology and how to incorporate this ontogenetic stage-based approachto improve our understanding of woody species population and community dynamics in open ecosystems.


On Wed, Jan 21, 2009 at 02:05:46PM +0100, Michael Rueger wrote:
m Hi all,
> What I would like to propose is that we organize all plugins in Pharo in
> to a Plugin category.
> So we would then have "Plugin-Curl", "Plugin-Locale" etc. Or
> alternatively "Plugin-Network-Curl", "Plugin-System-Locale" etc.
> That would also allow to simply load all plugins into a VMMaker image by
> using a package "Plugin".
> What do you guys think?
+1 on a common naming convention for this.
I would also like to suggest something to distinguish VM plugins
from other kinds of "plugins". The reason is that the word "Plugin"
is used to describe the web browser plugin, and maybe other things
in the future. If we say "VmPlugin" or "VMConstruction-Plugin-*
then the difference is clear.
I checked an older Squeak image to remind myself of the original
naming convention, which was:
Some older plugins that are maintained outside of the VMMaker
package already use this package naming convention, hence:
This still looks perfectly good to me, so how about just using
"VMConstruction-Plugins-*" rather than "Plugins-*"?
Michael Rueger proposed Plugin-* and Tests-*, so guess that
this would be:
or is it "Tests-VMConstruction-Plugins" ?? I am not sure.
(cc to vm-dev list)


Killer Network Service Uninstall. I also disabled their analytics services tool and their wifi. Once it was done, i logged in like normal and noticed that it automatically downloaded a program called killer control center.
If the process is running, you will not be able to delete the file. This video a remake from the first video to show you how to uninstall the killer network program and also install the lan driver file.if you have windows 10. Go to your windows search bar.
The Killer Ethernet Driver Is A Qualcomm Driver.
Type in and go to apps & features. The file is a verisign signed file. I noticed that there was a new software suite with a driver update that did not auto install.
When You Find The Program Killer Network Manager, Click It, And Then Do One Of The Following:
Since this service is not a core windows file, it has little or no impact on your processes. Killer network manager suite version 220.127.116.117 by rivet networks from www.advanceduninstaller.com. The issue turned out to be the killer network card.
I Want To Uninstall This Stuff But Don’t Want To Blow Anything Up.
Go to your windows search bar. Open settings click on apps settings find killer network service and then uninstall the program So i only have the killer network service running.
It Has Killer™ E2200 Gaming Networks As One Of Its Features.
I also disabled their analytics services tool and their wifi. 2.1 uninstalling killer network service on windows. I did some research on the program and it seems to be harmless.
We Worked With Killer And It Was Determined Their Software Is Unlikely To Be Responsible For Random Freezes On The Xps 8930.
Remember to restart after performing these steps. It runs as background service killer network. Sign up for a new account in our community.


#include <QProcess>
#include <QThread>
#include <QVariant>
#include <QFile>
#include <QTemporaryFile>
#include <QIODevice>
#include <oyjl.h>
#include <oyjl_macros.h>
#include <unistd.h>

extern int (*processCallback_p)(int argc, const char ** argv);

class Thread : public QThread
{
    Q_OBJECT

    int argc_;
    const char ** argv_;

    Thread( ) { }
public:
    Thread( int argc, const char ** argv ) {argc_=argc;argv_=argv;};
    ~Thread( ) { }

signals:
    void finishedSignal();

protected:
    void run() { processCallback_p(argc_,argv_); emit finishedSignal(); };
};

class Process : public QProcess {
    Q_OBJECT

    QString tempName_;
    QByteArray a_cb;
    FILE * fm_cb;
    char * m_cb;
    size_t m_size_cb;
    int saved_stdout = -1;

public:
    Process(QObject *parent = 0) : QProcess(parent) { m_cb = NULL; m_size_cb = 0; fm_cb = NULL; }

    Q_INVOKABLE void start(const QString &program, const QVariantList &arguments)
    {
        QStringList args;

        for( int i = 0; i < arguments.length(); i++ )
            args << arguments[i].toString();

        if(processCallback_p != NULL)
        {
            //fprintf(stderr, "starting callback\n");
            QString tempName;
            {
                QTemporaryFile temp;
                if (temp.open()) {
                    tempName_ = temp.fileName() + "2";
                }
            }
            char * tfn = oyjlStringCopy( tempName_.toUtf8().data(), malloc );
            fm_cb = fopen( tfn, "w+" );
            int mf_fd_cb = fileno(fm_cb);
            int stdout_fd = fileno(stdout);
            saved_stdout = dup(STDOUT_FILENO);
            if(dup2( mf_fd_cb, stdout_fd ) == -1)
            {
              fprintf(stderr, "mf_fd_cb: %d stdout_fd: %d %s\n", mf_fd_cb, stdout_fd, strerror(errno));
            }

            int count = arguments.length();
            char ** argv = (char**) calloc( count+2, sizeof(char*) );
            argv[0] = oyjlStringCopy( "lib-call", malloc );
            for( int i = 0; i < count; ++i )
              argv[1+i] = oyjlStringCopy( args[i].toUtf8(), malloc );

            Thread * t = new Thread( 1+count, (const char**)argv );
            connect( t, SIGNAL(finishedSignal()), this, SLOT( setData()));
            t->start();
            free(tfn);

        } else
          QProcess::start(program, args);
    }

    Q_INVOKABLE void waitForFinished()
    {
        QProcess::waitForFinished();
    }

    Q_INVOKABLE QByteArray readAll()
    {
        QByteArray a;
        if(processCallback_p != NULL)
        {
            //fprintf(stderr, "read callback %d\n", (int)a_cb.size());
            a = a_cb;
        } else
            a = QProcess::readAllStandardOutput();
        // test for PNG and convert to base64 for QML::Image::source Url
        if(a.length() > 16 && (int)a[0] == -119 && (int)a[1] == 80 && (int)a[2] == 78 && (int)a[3] == 71 && (int)a[4] == 13 && (int)a[5] == 10 && (int)a[6] == 26 && (int)a[7] == 10)
        {
            QString s = QString("data:image/png;base64,") + a.toBase64();
            a = s.toUtf8();
        }
        // test for SVG
        if(a.length() > 16)
        {
            QString t = a;
            if(t.startsWith( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg"))
            {
                QString s = QString("data:image/svg+xml;utf8,") + a;
                a = s.toUtf8();
            }
        }

        if(a.length() == 0)
        {
          if(processCallback_p != NULL)
          {
            a = a_cb; // not implemented; would need stderr
          } else
            a = QProcess::readAllStandardError();
        }
        return a;
    }
public Q_SLOTS:
    void setData()
    {
      char * cfn = oyjlStringCopy( tempName_.toUtf8().data(), malloc );
      fflush(fm_cb);
      fflush(stdout); // stdout is bufferd
      fclose(fm_cb); fm_cb = NULL;
      QFile f( tempName_ );
      f.open(QIODevice::ReadOnly|QIODevice::Unbuffered);
      qint64 size = f.size();
      a_cb = f.read(size);
      f.close();
      FILE * fp = fopen(cfn,"rb");
      fseek(fp, 0, SEEK_END);
      size = ftell(fp);
      f.remove();
      //fprintf(stderr, OYJL_DBG_FORMAT "read: %s %d %d\n", OYJL_DBG_ARGS, cfn, (int)size, (int)a_cb.size() );

      // restore stdout
      if(saved_stdout >= 0)
        dup2(saved_stdout, STDOUT_FILENO);
      emit readChannelFinished();
      free(cfn);
    }
};


Let's call an array $$$a$$$ of $$$n$$$ non-negative integers fancy if the following conditions hold:

- at least one from the numbers $$$x$$$, $$$x + 1$$$, ..., $$$x+k-1$$$ appears in the array;
- consecutive elements of the array differ by at most $$$k$$$ (i.e. $$$|a_i-a_{i-1}| \le k$$$ for each $$$i \in [2, n]$$$).

You are given $$$n$$$, $$$x$$$ and $$$k$$$. Your task is to calculate the number of fancy arrays of length $$$n$$$. Since the answer can be large, print it modulo $$$10^9+7$$$.


I am starting to realize that the Unix command-line toolbox can fix absolutely any problem related to text wrangling. Let me tell you about a problem I had, and how I used some Unix command-line utilities to solve it.
Marker is a command palette for the terminal. It lets you bookmark commands (or commands templates) and easily retreive them with the help of a real-time fuzzy matcher.
Next Webbrowser with Keyboard Control and a Lisp Interface
A curated list of Terminal frameworks, plugins & resources for CLI lovers.
A complete text editor for your terminal.
hypergit CLI for managing peer-to-peer git repositories
madonctl is a command line client for the Mastodon distributed social network API.
xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files.
Announcing the Arduino Command Line Interface (CLI)
Browsh is a fully-modern text-based browser. It renders anything that a modern browser can
mbsync - synchronize IMAP4 and Maildir mailboxes
a universal #text #document #converter
. If you need to #convert
files from one #markup
format into another, pandoc is your swiss-army knife. Pandoc can convert documents in (several dialects of) #Markdown
, Emacs #OrgMode
, Emacs #Muse
, Microsoft #Word #docx
, #LibreOffice #ODT
, or #Haddock
markup to ... many others
Poezio is a free #console
XMPP client (the protocol on which the Jabber IM network is built). Its goal is to let you connect very easily (no account creation needed) to the network and join various chatrooms, immediately. It tries to look like the most famous IRC clients (weechat, irssi, etc). Many commands are identical and you won't be lost if you already know these clients. Configuration can be made in a configuration file or directly from the client.


In this episode of our ongoing DNA Center Automation Series, our focus is on enabling telemetry to make full use of the Assurance capabilities within DNA Center. During this lab, we will discuss how to enable various feeds to DNA Center so as to ensure all aspects are enabled within the Assurance application. This enables you, the network administrator, the ability to use the Assurance application within DNA Center to fault find the network remediating client and application connectivity and experience issues. Additionally with Northbound integration to Service Now the ability to open incidents on that platform ensuring the service desk can help users in a timely manner. Please be aware that for full 365 views of devices, clients, and applications within DNA Center Advantage Licensing is a requirement.
Within this series, we cover the following;
- PnP Preparation – explains the overall Plug and Play set up steps
- Onboarding Templates – explains in-depth how to deploy Day 0 templates
- Day N Templates – dives into Day N template constructs with both regular and composite templates and use cases
- Application Policys – explores Application Policys and SD-AVC in DNAC and their use
- Telemetry – explains how to deploy Telemetry for assurance
- Advanced Automation – explores Advanced Automation techniques
- Dynamic Automation – a deployment lab for dynamic automation
There are several considerations when consuming telemetry from the network. Some of those considerations are the following;
- Total number of endpoints
- Total number of network access devices
- Size of DNA Center appliance in use
We will cover these aspects within this blog, leaving the lab solely for the enablement of telemetry.
What will I learn in the Telemetry Lab?
DNA Centers telemetry settings allow you to configure global network settings on devices for monitoring and assessing their health and the user and application experience across the network. During the lab, we will enable all the various remaining telemetry settings which are required for DNA Assurance. During the previous Onboarding Templates lab, we had enabled some of the required telemetry settings.
Within Cisco DNA Center, you can configure global network settings when devices are assigned to a specific site. Telemetry polls network devices and collects telemetry data according to these settings:
- SNMP server
- Syslog server
- NetFlow Collector
- Monitoring wired client
- Enable Wireless Telemetry
The first two of these settings were configured during the Rest-API call in the Onboarding Templates lab.
It is important to understand that some networking devices have minimal allowed Netflow Collectors which can be configured. Should it be the case that you need additional flows to other servers or management devices, then you should incorporate a UDP Director in your design. The UDP Director will replicate a single incoming flow from any device to multiple management systems which require the feed.
DNA Center Sizing
In the recent release of DNA Center we have increased the endpoint counts on the XL appliance and further to that have increased some of the device counts. To that end here is an updated graphic explaining the new sizing for DNA Center. The increases in the numbers of Endpoints, Network Devices, Flows, and Sites enables DNA Center to scale for large networks. That taken into consideration disparate locations based on round trip time allows us to comfortably size clusters to get the most out of Assurance.
With that, the lab covers these topics in-depth;
We will gain a practical understanding of the steps associated with setting up DNA Center and an environment to support telemetry to enable Assurance during these labs. The labs aim to aid engineers in rapidly beginning using DNA Center automation and help them work towards an automation strategy. Additionally, these labs will give customers a permanent place to try out pushing changes to telemetry settings so that they can get an understanding of what changes are made prior to deploying DNA Center on their networks. Finally, this environment will enable engineers to reduce the time and effort needed to instantiate the network.
In this small lab, it is quite crucial to delve into exactly which settings telemetry uses and how to enable devices for telemetry through DNA Center.
How can I get started?
Within dCLOUD, several sandbox-type labs are available. These self-contained environments are there to allow you to use them as you please within the time scheduled. In addition, this allows us a place to start practicing various concepts without fear of impacting production environments.
As a result, we hope to demystify some of the complexities of setting up automation and help guide customers through the caveats. Therefore, to aid customers in the transition toward automation, we have put together a set of small helpful labs within a Github repository. In this way, these self-guided labs provide a glimpse into the fundamentals of building velocity templates and offer examples that you can download and expand from. In addition, the sample templates and JSON files supplied are for easy import into DNA Centers’ template editor for quicker adoption. Lastly, some scripts are ready-made excerpts of code that allow you to build the environment to test.
In this practical lab, Telemetry, we step by step delve into enabling telemetry to make full use of assurance in DNA Center. Second, we provide answers and explanations to many of the questions that come up during automation workshops. We hope that you find the information both helpful and informative.
Where can I test and try these labs?
dCLOUD Lab Environment
To help customers succeed with Cisco DNA Center automation, you may utilize the above labs as they have been designed to work within dCLOUD’s Cisco Enterprise Networks Hardware Sandbox Labs. The dCLOUD labs allow you to run these labs and gives an environment to try the various code samples. You may choose to develop and export your code for use in production environments. Also, this gives you an environment where you can safely POC/POV methods and steps without harming your production environments. The dCLOUD environment also negates the need for shipping equipment, lead times, and licensing issues needed to get moving rapidly. Please do adhere to the best practices for the dCLOUD environment when using it.
The environment allows for use with a web-based browser client for VPN-less connectivity, access as well as AnyConnect VPN client connectivity for those who prefer it. You may choose from labs hosted out of our San Jose Facilities by selecting US West. Choose the Cisco Enterprise Network Sandbox. To access this or any other content, including demonstrations, labs, and training in dCLOUD please work with your Cisco Account team or Cisco Partner Account Team directly. Your Account teams will schedule the session and share it for you to use. Once booked follow the guide within Github to complete the tasks adhering to the best practices of the dCLOUD environment.
The Telemetry lab content is located within the existing DNAC-TEMPLATES repository to give a one-stop-shop for all the necessary tools, scripts, templates, and code samples. Within it are seven labs, which build upon the tutorials to test the methods in a lab environment. The repository was featured in a previous post on Cisco Blogs about DNA Center Templates earlier in May 2021.
Additional labs aim to guide you through the typical steps required to enable the various automation tasks. This lab delves into the concepts of building and deploying advanced automation templates to deal with specific use cases. As a result, it also gives us access to suitable testing equipment within the LAB environment. Additionally, information within the lab provides a well-rounded explanation of Automation methods within Templates. Lastly, the lab enables customers ability to use DNA Center workflows. This lab gives an environment for customers to practice deploying advanced automation on both Wired and Wireless Platforms.
This lab’s goal is to be a practical aid for engineers developing a QoS automation strategy. Additionally, customers will gain a permanent place to try out the policies for various use cases. Finally, this environment will enable engineers to reduce the time and effort needed to instantiate the network.
Please use this menu to navigate the various sections of this Github repository. Within the multiple folders are examples, explanation readme files for reference.
- PnP Preparation – The lab covers setup for Plug and Play (allow 1.5 hrs)
- Onboarding Templates – The lab covers in depth how to deploy Day 0 templates (allow 1.5 hrs)
- Day N Templates – The lab covers Day N template constructs and use cases (allow 0.5 hrs)
- Composite Templates – This lab covers building a composite template on DNA Center (allow 0.5 hrs)
- Application Policys – This lab covers Application Policys & SDAVC in DNAC (allow 1.0 hrs)
- Telemetry – This lab explains how to deploy Telemetry for assurance (allow 0.5 hrs)
- Advanced Automation – This lab will explore Advanced Automation examples (allow 1.5 hrs)
- Dynamic Automation – This lab will use many Advanced Automation techniques discussed previously (allow 2.0 hrs)
We will share additional labs and content in an ongoing effort to fulfill all your automation needs with DNA Center.
In conclusion, if you found this set of labs and repository helpful,
please fill in comments and feedback on how it could be improved.
We’d love to hear what you think. Ask a question or leave a comment below.
And stay connected with Cisco on social!
Check out our Cisco Networking video channel


#100DaysOfCode - Day 18: JetBrains Rider vs. Visual Studio Proper
Happy Monday, y’all (Sorry, I’m technically a southerner). If you’re up north, I hope you got to enjoy some of the last warm weather today! Unfortunately, it’s looking like we may be getting some cold for a while, but we definitely enjoyed the last few weeks of warmth.
Today, I wanted to make a post about JetBrains Rider, a great IDE that I’ve started to use and really enjoyed using in my month of use so far. I’ve been using it for Personal development, such as the Secret Santa application I’m working on here.
Pop OS Compatibility
On Pop OS (derived from Ubuntu), it’s relatively seamless (aside from 1 or 2 shortcuts with conflicts that I haven’t decided to resolve). I’ve also noticed some weirdness with the VIm plugin at times, but nothing terrible - definitely the best C# development experience I’ve had on Linux (beats VS Code pretty easy, which I’ve been using for the last few years, e.g. in ConsoleBooks).
JetBrains is based out of Czech (which I’ve visted - yes, beer is cheaper than water in prague), but is a largely Russian company that does great things with Development workflows in various languages.
- Their staple product has been JetBrains IDEA (Java)
- They’ve branched off and are the industry leaders in Python now as well with IntelliJ (in my opinion)
- They’ve (in the past few years) also released a C# IDE: JetBrains Rider
Whilst I’ve historically stayed away from their products because I’m a C# developer, I’ve heard great things about it recently, and decided to give it a try about a month ago. Overall, while a month hasn’t been enough time to truly decide on how much more productive I am with it, I definitely think it’s a worthwhile investment ($15-20 a month). At this point, the one thing I’m still more efficient with Visual Studio for is in-depth debugging, but that’s mostly because I haven’t had to do much complex debugging (yet)…
If you (or your company), is interested in moving from Visual Studio, I definitely recommend Rider! If you’re a recent startup (new in the past 5 years), you might even qualify for the 50% discount here!


One day Vasya painted a Cartesian coordinate system on a piece of paper and marked some set of points (x1, y1), (x2, y2), ..., (xn, yn). Let's define neighbors for some fixed point from the given set (x, y):

- point (x', y') is (x, y)'s right neighbor, if x' > x and y' = y
- point (x', y') is (x, y)'s left neighbor, if x' < x and y' = y
- point (x', y') is (x, y)'s lower neighbor, if x' = x and y' < y
- point (x', y') is (x, y)'s upper neighbor, if x' = x and y' > y

We'll consider point (x, y) from the given set supercentral, if it has at least one upper, at least one lower, at least one left and at least one right neighbor among this set's points.

Vasya marked quite many points on the paper. Analyzing the picture manually is rather a challenge, so Vasya asked you to help him. Your task is to find the number of supercentral points in the given set.


I'm working with DNA methylation data obtained from the EPIC chip. I've previously used the R package Bumphunter for differentially methylated regions (DMRs). In my current project, I would like to specify a list of specific regions for bumphunter to analyse. In other words, I'm looking for a way to "fix" the regions in advance, and then tell Bumphunter to look at those specific regions - in stead of Bumphunter analysing DMRs genome wide.
Does anyone have any experience or know if it is possible to tweak bumphunter commands to restrict such regions?
I'm very grateful for any response and help to get me a step closer to solve this :)
Thanks for reading!
If you want to make a comment, please use ADD COMMENT, rather than Add Answer (unless of course you are actually answering your own question).
Opps, will do next time! I'm new to this support site.


If I use my crappy ADSL (6/0.9mbit) which has a better ping (10 ms) it starts really quickly, by comparing files really quickly.
If I use my higher bandwidth 4G (50/30mbit), which has stable, but slightly worse ping of 40ms the comparison dialog is noticeably slower.
This lead me to conclude that WinSCP's synchronization comparison dialog does not use multiple connections.
Also I'd like to know if the uploading changes in "keep remote up to date" mode is using multiple connections? It sometimes seems slow when it uploads a lot of files.
I think the "keep remote up to date" and "synchronization" should start multiple connections immediately and keep them ready when changes comes so that it can quickly upload multiple files.
Thanks, great work, just donated a $9 with no expectations to do anything, as my gratitude for using this program for ages.


Rally - Excel Plugin: Unable to parse SSO landing page
Article ID: 102075
CA Agile Central On Premise (Rally)CA Agile Central SaaS (Rally)
While trying to connect to Agile Central using the Excel Plugin, the user receives error, "Error connecting to CA Agile Central: Unable to parse SSO landing page".
<Please see attached file for image>
Unfortunately this is a known issue with the current version of the Excel Plugin. Because this issue affects a low number of users and the Excel plugin is currently undergoing a full rewrite, the decision was made not to fix the defect. Engineering resources are instead being used to work on the new version of the plugin.
If the minimum version requirement can not be met, users can request to be put on the SSO Exceptions list by their local Subscription Administrators. This will allow the user to login to Agile Central (including the current Excel Plugin) using their Username and Password. Users will no longer receive the parsing error and will be able to connect using the Excel plugin.


/* wolfssl options.h
 * generated from configure options
 *
 * Copyright (C) 2006-2015 wolfSSL Inc.
 *
 * This file is part of wolfSSL. (formerly known as CyaSSL)
 *
 */

#ifndef WOLFSSL_OPTIONS_H
#define WOLFSSL_OPTIONS_H

#ifdef __cplusplus
extern "C" {
#endif

#undef  NO_DEV_RANDOM
#define NO_DEV_RANDOM

#undef  SINGLE_THREADED
#define SINGLE_THREADED

#undef  HAVE_PK_CALLBACKS
#define HAVE_PK_CALLBACKS

#undef  WOLFSSL_AES_DIRECT
#define WOLFSSL_AES_DIRECT

#undef  NO_WOLFSSL_DIR
#define NO_WOLFSSL_DIR

#undef  NO_FILESYSTEM
#define NO_FILESYSTEM

#undef  WOLFSSL_USER_IO
#define WOLFSSL_USER_IO

#undef  NO_WRITEV
#define NO_WRITEV

#undef  NO_DEV_RANDOM
#define NO_DEV_RANDOM

#undef  SINGLE_THREADED
#define SINGLE_THREADED

#undef  HAVE_PK_CALLBACKS
#define HAVE_PK_CALLBACKS

#undef  WOLFSSL_AES_DIRECT
#define WOLFSSL_AES_DIRECT

#undef  NO_WOLFSSL_DIR
#define NO_WOLFSSL_DIR

#undef  NO_FILESYSTEM
#define NO_FILESYSTEM

#undef  WOLFSSL_USER_IO
#define WOLFSSL_USER_IO

#undef  NO_WRITEV
#define NO_WRITEV

#undef  HAVE_FFDHE_2048
#define HAVE_FFDHE_2048

#undef  WOLFSSL_VERIFY_CB_ALL_CERTS
#define WOLFSSL_VERIFY_CB_ALL_CERTS

#undef  WOLFSSL_EXTRA_ALERTS
#define WOLFSSL_EXTRA_ALERTS

#undef  OPENSSL_EXTRA
#define OPENSSL_EXTRA

#undef  WOLFSSL_ALWAYS_VERIFY_CB
#define WOLFSSL_ALWAYS_VERIFY_CB

#undef  SINGLE_THREADED
#define SINGLE_THREADED

#undef  HAVE_THREAD_LS
#define HAVE_THREAD_LS

#undef  TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

#undef  ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT

#undef  WC_RSA_BLINDING
#define WC_RSA_BLINDING

#undef  HAVE_AESGCM
#define HAVE_AESGCM

#undef  WOLFSSL_SHA512
#define WOLFSSL_SHA512

#undef  WOLFSSL_SHA384
#define WOLFSSL_SHA384

#undef  NO_DSA
#define NO_DSA

#undef  HAVE_ECC
#define HAVE_ECC

#undef  TFM_ECC256
#define TFM_ECC256

#undef  ECC_SHAMIR
#define ECC_SHAMIR

#undef  NO_RC4
#define NO_RC4

#undef  NO_HC128
#define NO_HC128

#undef  NO_RABBIT
#define NO_RABBIT

#undef  HAVE_POLY1305
#define HAVE_POLY1305

#undef  HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH

#undef  HAVE_CHACHA
#define HAVE_CHACHA

#undef  HAVE_HASHDRBG
#define HAVE_HASHDRBG

#undef  NO_FILESYSTEM
#define NO_FILESYSTEM

#undef  HAVE_TLS_EXTENSIONS
#define HAVE_TLS_EXTENSIONS

#undef  HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES

#undef  HAVE_EXTENDED_MASTER
#define HAVE_EXTENDED_MASTER

#undef  HAVE_ENCRYPT_THEN_MAC
#define HAVE_ENCRYPT_THEN_MAC

#undef  NO_PSK
#define NO_PSK

#undef  NO_MD4
#define NO_MD4

#undef  WOLFSSL_ENCRYPTED_KEYS
#define WOLFSSL_ENCRYPTED_KEYS

#undef  USE_FAST_MATH
#define USE_FAST_MATH

#undef  WC_NO_ASYNC_THREADING
#define WC_NO_ASYNC_THREADING

#undef  NO_DES3
#define NO_DES3

#ifdef __cplusplus
}
#endif

#endif /* WOLFSSL_OPTIONS_H */