C++ + Visual Studio 2012 (VS2012) + Win8 , converting projects up some conflicts I found 

Having loved the ability to compile VS2010 projects inside the VS2012 shell as a way of delaying the update, I thought it was time to stop delaying ( 1 Year late ).

std::cout << "Minimum value for int: " << std::numeric_limits<int>::min() << std::endl;
std::cout << "Maximum value for int: " << std::numeric_limits<int>::max() << std::endl;

Generates error:

error C2059: syntax error : '::' [path]\source.cpp

There is a good chance if you have these lines and are including the windows header you will hit an error. The Windows team put in a solution to the #define min conflict in <minwindef.h>.

So instead of

#include <windows.h>

You use a #define to avoid this

#define NOMINMAX
#include <windows.h>

Another issue I found was with an annoying char define, again from the Windows team in <rpcndr.h>.

#define small char

This one doesn’t have the ability to comment out for so if you have a small function with something like:

AnObj small = large.resize(val);

Generates error:

error C2628:'AnObj' followed by 'char' is illegal (did you forget a ';'?) [path]\source.cpp

You will have to suffer and change the name, in some ways it teaches you (me) for not being very specific, still annoying though. Hopefully this is all the conversion errors I’ll hit.

Gravatar
Posted by Stuart James Sunday, May 12, 2013 4:13:00 PM Categories: API C++ Visual Studio Windows8

Rotor Style Skeleton Browser 

A while ago I found a paper from a research project called MediaMill. They presented a technique for viewing different facets of video content in a windmill fashion. Recently I was exploring how we could visualise skeletons and thought would give the technique a try, here is a screenshot of a basic approach:

 

 

image

In this example each joint (of which there are 10) is represented on a “blade”. This very simple example visualise joint variation a better approach would to measure the distance between the body and variations on a specific joint but hey was just a sample.

 

References

To see more about different video browsers see the MediaMill project

http://www.science.uva.nl/research/mediamill

See related Rotor Browser papers at ICME or CIVR from 2007.

Gravatar
Posted by Stuart James Sunday, May 12, 2013 10:40:00 AM Categories: Evaluation Publication Retrieval WebDev

S3 Push and Pull – Backup a EC2 Instance or just some data 

I stumbled across a great tool to just push and pull data from an S3 bucket last week wrapped into one light weight executable. Requires .NET 2.0 or Mono so on Linux becomes a little heavy weight.

 

So start by pulling down the latest version:

http://s3.codeplex.com/

 

So to get started you need to configure your bucket, this is stored in the registry so you will need to consider the security implications, but it does allow you to set a password. For simplicity I’ll avoid this and assume that you don't mind it being visible to users/hackers!

Navigate to where you downloaded and  run the command

s3 auth

 

image

 

As you can see you get the option to password protect or not is easy and hopefully there isn’t any problems following this through to configure your bucket ID and Key.

 

Now you are ready to start shifting some data!

s3 get <bucket [/folder]> <path>

Some good options are

/backup /sync /nogui

Should be fairly clear what these options do.

If you still are a little stuck try this for a full set of options.

s3 help
Gravatar
Posted by Stuart James Saturday, May 11, 2013 10:14:00 PM Categories: Amazon HowTo Tech Trips

Windows 8, Ad-Hoc where did you go? 

image

For some reason that I haven’t been able to find in Windows 8 Ad-Hoc networks have been removed. Well not actually removed but the UI is removed, confused? Well there is a simple couple of commands you can use to launch an Ad-Hoc network. It may not be as nice but it is better than  Win7, is not labelled as Ad-Hoc and you can connect Android devices to it!

You will need a Command Prompt with Administrative Permissions

 

netsh wlan set hostednetwork mode=allow ssid=<wifi name> key=<password>

Now enable it:

netsh wlan start hostednetwork

 

Simple hey? Oh remember you may actually want an internet connection go to Network Connections and edit the properties of your network connection with Internet and change the Internet Connection sharing option to the Network newly created, looks like this the * gives it away.

image

 

Lazy and want to automatically do this create a bat file with your custom details, create a new Task in the Task Scheduler and remember to up the permissions or will fail!

Edit:
You may find that the connection turns off therefore a more robust script is to disable first.

netsh wlan stop hostednetwork
netsh wlan set hostednetwork mode=allow ssid=<wireless> key=<password>
netsh wlan start hostednetwork
Gravatar
Posted by Stuart James Saturday, May 11, 2013 4:00:00 PM Categories: HowTo Windows8

Boost Graph Visualisation using dot and Graphviz 

Debugging graphs can sometimes be annoying a useful way is to visualise it. No problem Boost has not only a graph solution but a way to visualise it too.

It is really simple first the header,

#include <boost/graph/graphviz.hpp>

Define the name of each node, easily done by an array

const std::string names [] = {"A", "B", "C", "D", "E" } ;

or via a vector

std::vector<std::string> names;
for (int i = 0 ; i < _nodes.size() ; i++){
    std::stringstream ss;
    names.push_back(ss.str());
}

Then save it out

std::ofstream dmp;
dmp.open("dmp.dot");
boost::write_graphviz(dmp,g, boost::make_label_writer(&names[0]));

And then the result:

 

Graph_Dot_Undirected Graph_Dot_Directed

Left undirected graph, right directed hence the arrow heads.

Gravatar
Posted by Stuart James Friday, March 29, 2013 11:49:00 PM Categories: C++ HowTo

The old Windows 8 argument on a non-touch laptop 

We have already heard many arguments about Windows 8 with and without touch, the new “metro” UI and the missing start button. I dont intend to add anything to this I think it really comes down to your personal preference. In my case I found it awkward to use so wanted a solution to make things better.

My solution is that developed by StarDock this was brought to my attention by Paul Thurrott on Windows Weekly.

Start8

Start8

ModernMix

ModernMix

ModernMix works amazing allowing you to be able to run “Metro” apps in Windows. I have always played games in Windows so the idea of using full screen will take me a long time to grasp, and ModernMix allows me to completely avoid that!

Gravatar
Posted by Stuart James Friday, March 29, 2013 9:47:00 PM Categories: Windows8

mojoPortal Inline Editing, easy user content editing! 

I have always liked the style of mojoPortal making it easy to understand what you are editing. The approach is quite in contrast to other CMS where you end up with a front house and back house style system, mojoPortal does a nice job of merging this.

With version 2.3.9.6 it gets even better with inline editing, so for example take my home home page.

image

 

If you have completed the update and if you have CKEditor as your content editor you will notice little locks appearing on your page when in content editor view

image

If you click the lock, it will unlock(image), you can then click on the content for editing and your page will look like this:

image

 

Now if this isn’t easy for users to understand what is? Well done mojoPortal for integration of another useful feature.

Gravatar
Posted by Stuart James Sunday, March 17, 2013 12:10:47 PM

Windows Intune a must for SMB administrators 

With the push of large amount of cloud services from many different vendors it takes time to explore and see what is now available. Today I did a brief excursion into Windows Intune.

Intune provides system administrators to monitor computers within their organisation. Allowing you to install software from a common pool force policies and keep an eye on computers that may be coming to the end of their life or just short on storage.

I am just getting started but thought would share some screenshots.

Admin Panel

image

Some computer hardware info:

image

User web view (I do love the tiles layout to be clean and elegant):

image

I have done some experiments adding up an installer to the cloud storage is easy to do, and seems to work quite well. If you have a pool of computers seems like a nice offering. I had looked into alternatives such as that provided by LogMeIn, but the price point is a bit of a put off and the integration was somewhat limited.

I have still to get my Surface or other mobile devices into Intune, but sure will get some nice info out of the 30 day trial that will probably turn into a tool inside the company’s IT I manage(JCS Technology).

Sunday, January 27, 2013 3:55:00 PM Categories: Microsoft Tech

Performance I just don’t understand Win 2008 vs Win 2012 on AWS 

After having some weird connection issues over the last week since migrating my blog and portfolio to an alternative configuration instance based on Windows Server 2008 I decided to do a load test to see whether this was a bigger issue than I expected. The results I just cant explain.

 

Windows Server 2008, IIS Installed only with .NET4

AWS_Win2008_Performance

 

Windows Server 2012, IIS Installed only with .NET4

AWS_Win2012_Performance

 

As can be seen from the 2008 graph the server fell over very quickly and took a very long time to recover. After looking at this went to the CPU load and found the answer:

Windows Server 2008, IIS Installed only with .NET4

AWS_Win2008_CPULoad

Windows Server 2012, IIS Installed only with .NET4

AWS_Win2012_CPULoad

 

This wasn’t the profile of the CPU when I first set up the instance, I have no idea what has caused the development of this maxed CPU issue. Will have to look into more, but for the moment am back on 2012! Does demonstrate the importance of setting up alarms though, another nice functionality on the AWS platform.

 

Edit:

Maximum Load Test

I have also done a max load test just to see how much the server could take, maxes out about 70 users. Tested against blog, so all img,js and css are additional calls wrapped into one user call. Granted when server hits max capacity is essentially unresponsive.

AWS_Win2012_Max_Performance

Saturday, January 26, 2013 3:36:47 PM Categories: Amazon Evaluation Microsoft Tech
Stuart James