Monday, December 15, 2014

SSDT get your DB back in sync with your project

So I've been using SQL Server Data Tools (SSDT) in visual studio to manage database changes.  I'm the only one really using it on my team right now.  I had been working on a branch project in isolation for a while and the trunk database schema kept changing.

Today I am working in trunk (HEAD/master) again.  So I need to switch to the trunk branch of my SSDT solution and get it back in sync with everyone else.  I was amazed at how easy this was.

Simply do a database schema compare using a database with the most recent schema as the source and the SSDT project as the target.  Run the update to make changes to all the SQL files in the target (the project).  Then you can commit all those changes to your source control and VOILA!  - Your SSDT project is back in sync.

Now I can develop my own schema changes and generate the change scripts easily.  Sweet!

Saturday, December 6, 2014

Print from an iPhone to an HP Photosmart plus all in one

JI used to be able to print from my iPhone 4S.  But I don't print much and I have since upgraded my router and upgraded to an iPhone 6. 

I couldn't remember how I set it up a few years ago.  Anyway, it's really easy. This printer does support a way of emailing documents to the printer which is one way to do it. 

The other way is to go to the App Store on your iPhone. Search for HP ePrint. Download and install the app (it's free). If your printer is not detected right away, restart it by simply powering it off powering it back on. You may also have to restart your wireless router.  These resetting steps are a pain, but they really work. Next add your wireless printer. Now you can print from any app on your iPhone.

Wednesday, December 3, 2014

HTML CSS Form Layout

I just created an awesome plunker showing a form with different layout markup and styling.  I have one for percent widths, 2 using floats and one using a table.

Tuesday, December 2, 2014

touchend javasccript event not working

So I came to find out today that I think the touchend event has a pageX and pageY populated in Safari, but not in the Android browser.

Here's the code.

if (canvas.addEventListener) {
canvas.addEventListener("mousedown", function(e) {
   click(e.pageX, e.pageY);
}, false);
canvas.addEventListener("touchstart", function(e) {
   click(e.touches[0].pageX, e.touches[0].pageY);
}, false);

Originally, I was using e.pageX and e.pageY and it worked on chrome (desktop) and mobile safari, but it was failing on a Samsung device.  So, reading about the touchend event on Mozilla, I found that there is a touches array with the list of touches.  That was populated on a mobile.