Help, can’t connect my IDE to Xamarin / Genymotion Android Emulator!!1!

Standard

Hey, you, yes you, desperate developer, who’s using Genymotion, Xamarin Android Player or something similar, that was just working but now you can’t connect your IDE to it for no apparent reason, have you experience one of the following problems?

adb server is out of date. killing...
* daemon started successfully *
ADB is outdated
(Exception in IDE) Timeout waiting for device
(Exception in IDE) Can't find devices

If your answer is yes to any of the above (or similar), then brace yourself, for 0.00€ you’ll have your problem solved, that’s correct, 0.00€, no credit card required AND, if you do this in the next 5 minutes, you won’t just stop being desperate but, you’ll be overall awesome instead ! (i.e., until you compile your program and find a bucket full of errors)

After struggling with this for days I found the source of the problem, it all comes down to updates! Momma always said, “Life is a box of updates, you never know what you gonna get“.

Continue reading

How to: Bullet Physics in Visual Studio 2012

Standard

I’m going to use Bullet Physics in a university course this semester, as usual, the online documentation to create projects from scratch always lacks something / are outdated / all sorts of useless time consuming crap.

Creating a project from scratch with Bullet is actually pretty simple, this are the steps:

In this example I’m supposing you downloaded the file “bullet-2.81-rev2613.zip” and extracted it to “c:\bullet-2.81-rev2613”

  • Bullet comes already with all the compiled to your environment, but you can compile them for yourself using CMake ( Bullet wiki has a fairly good tutorial on this ) or Premake4. We are going to use the ones that already come with Bullet for simplicity.
  • Create a new C++ Win32 Console Project (I recommend that you use the Precompiled Headers, if you don’t know what they are, google it 😉 )
  • Now Add all the Bullet projects you need. For this example, in VS go to File>Add> Existing Project and, separately, add:
  1. c:\bullet-2.81-rev2613\build\vs2010\BulletCollision.vcxproj
  2. c:\bullet-2.81-rev2613\build\vs2010\BulletDynamics.vcxproj
  3. c:\bullet-2.81-rev2613\build\vs2010\LinearMath.vcxproj
  • In Solution Explorer, go to your project Properties (select it and ALT+ENTER)
  • Go to Common Properties> Framework and References and click on “Add New References…”. Choose all the projects you’ve previosly added
  • Click on Configuration Properties
  • At the top, change Configuration to All Configurations
  • Go to Configuration Properties> C/C++> General
  • In Additional Include Directories, add c:\Bullet-2.81-rev2613\src\

That’s it.

To test it, use this code in your project .cpp:

#include "stdafx.h"
#include "btBulletDynamicsCommon.h"
int _tmain(int argc, _TCHAR* argv[]){
btBoxShape * box = new btBoxShape(btVector3(1,1,1));
delete box;
return 0;
}

Did it run or did you got this error?

If so, the projects you’ve added have weird references. Do this:

  • In each added project, go to project Properties Page (ALT+ENTER)
  • In Common Properties> Framework and References, remove references to ZERO_CHECK

Run it again. Worked?

Compiled

Pimp My Visual Studio !

Standard

(Jump to my Visual Studio extensions list)

First of all, happy new year everyone! Wish you the best, hope every project gets done (but it isn’t, according to Mayas, who cares right? )

Pacman 2012

"Pacman 2012" by ~plufim @ DeviantArt

Just kidding, moving on, as a (wannabe-full-time) programmer i spent a lot of time in Visual Studio so, as almost everything in my life, i want it personalized for my taste and necessities, customizing everything that i think of so i can feel “at home”, to the point that when i fresh install Visual Studio or for some reason have to work in another laptop that isn’t mine, Visual Studio feels like a hole new different application, lacking all my awesome extensions. A friend of mine asked me to list him everything i used so, i’m going to just post it here.

Default visual of Visual Studio (no pun intended):

Default visual studio UI

Default visual studio UI. From Google Images

 

Meet, my Visual Studio:

My Pimped Visual Studio

My Pimped Visual Studio

And i love it!

My extensions list:

  • Visual Studio Color Theme Editor
  • Hide Main Menu
    • Another straight forward extension, it hides the Main Menu.
    • To show the menu just hit ALT (or use the menu’s shortcuts, e.g: ALT+F for File menu), the bar will hide when focus is lost.
  • Productivity Power Tools
    • This adds a lot of cool and REALLY useful addins to Visual Studio, by far one of the most useful addins (so useful that Visual Studio 2011 will have this integrated by default ). I advise you to see all the features of this addin, if you don’t you will definitely not notice some, for instance, Column Guides, you should set one to 80 or 100 char’s (i prefer 80)
  • NuGet
    • NuGet is a Visual Studio 2010 extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework.
    • Used it to install Silverlight for Windows Phone Toolkit
  • ReSharper, also known as R# (paid) *
    • This is an addin specific for C# programing
    • From ReSharper site: “ReSharper is a renowned productivity tool that makes Microsoft Visual Studio a muchbetter IDE. Thousands of .NET developers worldwide wonder how they’ve ever lived without ReSharper’s code inspections, automated refactorings, blazing fast navigation, and coding assistance.” I’m not here to advertise but, amen to that, they tell the truest of the stories, after “Productivity Power Tools” addin this is the next most usefull plugin for Visual Studio, this adds a LOT of new features, after you know everything you need about this tool your productivity will increase sky-high
  • Visual Assist X, also known as VAX (paid) *
    • This addin is like ReSharper, but a little more general, i used it because it adds some of the R# features to C/C++, Whole Tomato (the creators of VAX) squeezed the most they could out of C/C++, this eases the pain in the ass that is programing in C/C++ at least. Another thumbs up for productivity gain!
  • Visual Studio Text color schemes
    • I’m not using this for now because i have to temporarily program some things in C and VAX changes the syntax color, the VAX colors are useful but incompatible with the color scheme i generally use, you can change the VAX colors but i just didn’t want to go through all of that work.
    • You can find some cool color schemes in Studio Styles , i use Monokai (the newer one) ! It’s the same i use in Notepad++ too.
  • Snippet Designer
    • Huge helper when you want to create a snippet. This should be integrated in future releases of Visual Studio, adding snippets without addins it’s really a primitive process.
  • Debugger Canvas**
    • It’s an experimental project in development by Microsoft
    • The idea behind this is nice and useful but it takes a little more to start the debugging building process, i have this disabled for now but i will use it in a huge project that i have full of bugs, you will find the usefulness of this when you have a massive call stack and you wish you could see it all without having to hoop through all the codes and files. You should see the presentation video.

* I started to program back in my 9th/10th grade but the base of what i know about programing i’ve learned from one of the greatest teachers i had the luck to come across, Luís Cruz Filipe, back in 2008, he almost prohibited us from using IDE’s, we used Emacs to program (it’s like Notepad with syntax color highlighting) , a lot of students where against this approach because it’s basically a productivity nightmare, i wasn’t too happy with it but i used it anyway. After that semester i discussed that with a friend of mine and realized how much programing in Emacs had cemented my programing foundations, people always learn better when they have to do everything. The use (or not) of IDE’s when learning is debatable but about this 2 extensions, IMHO,  i DON’T recommend you using them if you are learning / training to program (specially if you’re in college and have hand written programing tests), you will miss a lot of things you need.

** Visual Studio 2011 Ultimate only

That's all folks