How To Use Microsoft Remote Desktop App on Windows Phone 8.1

Last week, Microsoft announced the preview of the Remote Desktop app for Windows Phone 8.1. But there are some questions; How to add and access a new desktop? If you wonder it, keep going to read !

1-) Download the app from the Windows Phone Store.

2-)  You have to allow remote connections on your computer. To allow; search “remote” and then select “Allow remote access to your computer”

1

2

3-) Now, open your app, click add bar, then there is a textbox for your PC’s IP address.

3

4

4-) Use Command Prompt(CMD) to learn your IP address. (ipconfig)

5

6

5-) Enter your ip address to textbox and save it.

7

6-) Tap image and enter your credential which is your mail address and password to login your PC.

8

9

7-) That’s it ! Now, you can connect your PC from your Windows Phone device.

Here are my screenshots from my phone:

 

10

11

Reklamlar

Splitting a Linked List

I’ll try to explain how to split a linked list and return second part to another list. Logic is, first pass the list and count items. After that pass list till half of count and after passes return the address of list. Let’s look codes;

node struct should look like;

1

typedef struct tagNode{
	int data;
	struct tagNode* pNext;
}Node;

I have AddItemToEnd function;

 

Node* AddItemToEnd(Node* pList, int data)
{
	Node* pTemp;
	Node* pNewItem = malloc(sizeof(Node));
	pNewItem->data = data;
	pNewItem->pNext = NULL;

	if (NULL == pList)
		return pNewItem; // If list is empty, return new item.
	pTemp = pList;
	while (NULL != pTemp->pNext)
		pTemp = pTemp->pNext; // Pass the list until the end.
	pTemp->pNext = pNewItem; // Add my new item to the end.

	return pList; // return list
}

Let me add four item like 1,2,3,4. You can imagine it as like this picture:

2

And my Split function;

 

Node* SplitList(Node* pList){
	Node* pTemp;
	int count=1;
	int i;


	pTemp = pList; // I don't want to change my original list, thats why I used temp.

	if (NULL == pList->pNext || NULL == pList){
		return pList; // If list is empty or has only one item, cannot split and return list back.
	}

	while (NULL != pList->pNext){
		count++; // Counts items on the list. When pList's pNext become NULL counting will stop.
		pList = pList->pNext;
	}


	for (i = 0; i < count / 2; i++) 		
            pTemp = pTemp->pNext;
	
	return pTemp;

}

I’ve tried to trace it with an image;

3Finally my print and main functions here;

 

void PrintList(Node* list){

	while (NULL != list){
		printf("Data: %d\n", list->data);
		list = list->pNext;
	}

}


int main(int argc, char** argv)
{
	Node* list = NULL;
	Node* Split;
	int i;

	for (i = 0; i < 4; i++)
		list = AddItemToEnd(list, i + 1);

	Split = SplitList(list);

	printf("*****Before Split*****\n");
	PrintList(list);
	printf("\n*****After Split*****\n");
	PrintList(Split);

	return EXIT_SUCCESS;
}

My output is like this:

4

C++ Program to Convert Decimal to Binary Using Stack

Today I’m going to explain that how you can convert decimal to binary using stack class in c++. Logic is clear, first, we’ll divide the decimal by 2 and remainder is pushed onto stack and our new decimal will be decimal/2. This is carried out until the decimal becomes 0. Then we’ll pop all remainders into a integer array and display it on the screen. Let’s see codes below;

I’ve stack header file and .cpp file;

Stack.h:

#ifndef STACK_H
#define STACK_H

class Stack
{
public:
	Stack(int size);
	virtual ~Stack();

	bool Pop(int *pData);
	bool Push(int data);
	bool IsFull();
	bool IsEmpty();
	bool Peek(int *pData);

private:
	int m_capacity;
	int m_size;
	int *m_pData;

};

#endif

Stack.cpp:

#include "Stack.h"
#include iostream

using namespace std;

Stack::Stack(int size)
:m_capacity(size),
m_size(0)
{
	m_pData = new int[size];
}

Stack::~Stack()
{
	delete[] m_pData;
}

bool Stack::IsEmpty()
{
	if (m_size == 0)
		return true;
	else
		return false;
}
bool Stack::IsFull()
{
	if (m_size == m_capacity)
		return true;
	else
		return false;
}

bool Stack::Push(int data)
{
	if (IsFull())
		return false;
	else{
		m_pData[m_size] = data;
		m_size++;
		return true;
	}

}

bool Stack::Pop(int* pData)
{
	if (IsEmpty())
		return false;
	else{
		*pData = m_pData[m_size - 1];
		m_size--;
		return true;
	}
}

bool Stack::Peek(int* pData)
{
	if (IsEmpty())
		return false;
	else{
		*pData = m_pData[m_size - 1];
		return true;
	}
}

Now, in my main.cpp I’ll make the convert.

Okumaya devam et