Something More for Research

Explorer of Research #HEMBAD

Posts Tagged ‘windows’

cppconlib: A C++ library for working with the Windows console

Posted by Hemprasad Y. Badgujar on July 20, 2015


cppconlib is built with C++11 features and requires Visual Studio 2012 or newer. The library is available in a single header called conmanip.h and provides a set of helper classes, functions and constants for manipulating a Windows console (using the Windows console functions). The library features the following components:

  • console_context<T>: represents a context object for console operations; its main purpose is restoring console settings; typedefs for the three consoles are available (console_in_context, console_out_context and console_err_context)
  • console<T>: represents a console objects providing operations such as changing the foreground and background colors, the input mode, screen buffer size, title, and others; typedefs for the three consoles are available (console_in, console_out and console_err)
  • manipulating functions that can be used with cout/wcout and cin/wcin: settextcolor()/restoretextcolor(), setbgcolor()/restorebgcolor(), setcolors(),setmode()/clearmode(), setposx()/setposy()/setpos().

The library can be downloaded from here. Detailed documentation is available here.

cppconlib

Examples

The following example prints some text in custom colors and then reads text in a different set of colors.

cppconlib2

The following code prints a rhomb to the console:

cppconlib3

For more details and updates check the project at codeplex: https://cppconlib.codeplex.com.

UPDATE: A NuGet package for cppconlib is available.

Advertisements

Posted in Computer Software, Computer Vision | Tagged: , , , , , | Leave a Comment »

Setting Up Git on Windows in Four Easy Steps

Posted by Hemprasad Y. Badgujar on May 6, 2015


Introduction

Setting up Git can be intimidating, especially for those that are trying a version control system for the first time or moving from Subversion. It used to be the case that Git was a huge hassle to install and use on Windows. However, nowadays it’s super easy to use Git on Windows either through Git Bash, if you’re a fan of the command line, or if you prefer a graphical interface, through programs like TortoiseGit. Below we’ll show you how to set everything up and connect it with Assembla.

Table of Contents

  1. Download and Install Git for Windows
  2. Download and Install TortoiseGit (Optional but recommended for first timers)
  3. Generate SSH keys
  4. Link SSH key with Assembla

Prerequisites

  1. Assembla Git repository – sign up if you haven’t already, Git and all our other project management tools are totally free for teams up to 3 people.
  2. A strong desire to install Git on Windows.
  3. That’s it, let’s go!

1. Download and Install Git for Windows

To get things started, you’ll need to download and install Git for Windows. If you’re unsure of which one to choose, just go with the full installer. After downloading, run the installer.

welcome_Git-setup

If you have PuTTY/TortoiseSVN installed, you may see this screen, otherwise just ignore this. Regardless, use OpenSSH to make things easy.
SSH Executable

From here, the process become quite streamlined. Simply follow the setup steps to ensure optimal settings. We recommend selecting “Use Git Bash only” as it provides an unmodified PATH.

Git_adjustPath

After selecting next, we recommend chosing the option of “Checkout Windows-style, commit Unix-style line endings”. Select next once you have done this.

Git_Configure_LineEndings

Git_Installation_InProgress

Git_Installation_complete

Download and Install TortoiseGit

TortoiseGit is a Windows Shell Interface to Git and based on TortoiseSVN.
This step is optional. If you are comfortable using the command line for interacting with Git, you do not need to install TortoiseGit.

Next up, let’s download and install TortoiseGit. Before you start the installation, please make sure that you choose the right installer for your PC, otherwise the setup will fail.

Tortoise_Git_3

Tortoise_Git_4

Tortoise_Git_5

Tortoise_Git_7
We’ll need to configure TortoiseGit – to do this, right click anywhere on your Desktop, select “TortoiseGit” and then “Settings.”

tortoise8
Find “Git” and then click on “Config” from the menu on the left. Then fill in your Name and Email, making sure to use the same email that you used to sign up for Assembla.

Don’t forget to click OK when you’re done.

tortoise9

Great, now TortoiseGit is all set!

Generate SSH keys

There’s two ways to generate SSH keys:
1. If you installed TortoiseGit, use the method directly below. 2. If you only installed Git on Windows and are not using TortiseGit, jump to the “Git Bash SSH Keys” section.

TortoiseGit SSH Keys

SSH creates a secure connection from your computer to Assembla, making sure that you are who you claim to be so that only authorized persons can commit to your repository. Assembla needs to know your public SSH key to make the secure connection, so let’s fire up Puttygen to generate an SSH key pair.

Start -> Programs -> TortoiseGit -> Puttygen

puttygen1
In Puttygen, first click on the “Generate” button.

puttygen2
Next, you’ll move your mouse around the big gray area under the progress bar to generate randomness for super security.

puttygen3
Once the key is generated, you should copy it onto your clipboard. You’ll use this later to authenticate with Assembla.

puttygen4
Afterwards, choose a memorable password and confirm it. Don’t forget your password!

puttygen5
Lastly, click on the “Save private key” button and save your private key somewhere you’ll remember.

puttygen6

Git Bash SSH Keys

If you did not install TortoiseGit, you’re at the right place! If you did install TortoiseGit, follow the steps above and skip this section.

  • Start up Git Bash: Start -> All Programs -> Git -> Git Bash
  • On the command prompt, type in the following command substituting with the email you used to sign up for Assembla.
  • When it asks you for the file, just hit Enter.
  • Please note that you should definitely enter a passphrase; when you type, nothing will show up. This is normal, don’t worry about it.

ssh-keygen -t rsa -C “me@email.com”

Use Notepad to open up the .ssh/id_rsa.pub file you just generated and copy the all of the contents of that file.

Link Your SSH key with Assembla

Open up your Assembla profile which is where you’ll paste the public key you just copied from the previous step.

key1
Click “Add Key” after you’ve pasted the key into the box. You should see something like the following picture below. If so, congratulations, you’re done with this section!
key2

Posted in Mixed | Tagged: , , , , | Leave a Comment »

Run a makefile in Windows?

Posted by Hemprasad Y. Badgujar on October 12, 2014


If you have Visual Studio, run the Visual Studio Command prompt from the Start menu, change to the directory containing Makefile.win and type this:

nmake -f Makefile.win

You can also use the normal command prompt and run vsvars32.bat (c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools for VS2008). This will set up the environment to run nmake and find the compiler tools.

Posted in Mixed | Tagged: , , , , | Leave a Comment »

 
Extracts from a Personal Diary

dedicated to the life of a silent girl who eventually learnt to open up

Num3ri v 2.0

I miei numeri - seconda versione

ThuyDX

Just another WordPress.com site

Algunos Intereses de Abraham Zamudio Chauca

Matematica, Linux , Programacion Serial , Programacion Paralela (CPU - GPU) , Cluster de Computadores , Software Cientifico

josephdung

thoughts...

Tech_Raj

A great WordPress.com site

Travel tips

Travel tips

Experience the real life.....!!!

Shurwaat achi honi chahiye ...

Ronzii's Blog

Just your average geek's blog

Karan Jitendra Thakkar

Everything I think. Everything I do. Right here.

VentureBeat

News About Tech, Money and Innovation

Chetan Solanki

Helpful to u, if u need it.....

ScreenCrush

Explorer of Research #HEMBAD

managedCUDA

Explorer of Research #HEMBAD

siddheshsathe

A great WordPress.com site

Ari's

This is My Space so Dont Mess With IT !!

%d bloggers like this: