CK's BLOG
this site the web

Have you ever used MsBuild with Multi-core supported to boost the build speed of your projects (probably more than 100) to improve your productivity?


Have you ever used MsBuild with Multi-core supported to boost the build time of your projects (probably more than 100) to improve your productivity?

We can either build the whole solution or just specific project from Visual Studio using MsBuidl with Multi-Core supported.
I have used it for a while now I think already more than a year and happy with it.
We can print the output to VS's Build Output or print to console (I prefer the console.)
Using MsBuild to build our stuffs we can use Visual Studio at ease I knew that some environment that has less RAM might probably encounter an issue that when you build your projects/solution
from Visual Studio it just halted (or even the text/codes/tabs are mixed up when you are debugging) and you might really hate it! I do.
So using MsBuild I am happy with that so far. My productivity is better. I feel less stress when building a huge solution consisting more than 170 projects :).

To be continued, I will write a step by step on how to do MsBuild from VS.
Peace Out!

RENAME SQL SERVER database name in Multiple user mode with killing all users' session (FORCE RENAME))

*Note: it has to be run against database master (select on master -> new query or add use master)


DECLARE @ID INT
DECLARE @MSG CHAR(8)

While 1 = 1
BEGIN
    Set RowCount 1

SELECT
  @id = spid
FROM
  Master..Sysprocesses P,
  Master..Sysdatabases D
WHERE
  D.Name= N'MYDATABASE'
AND
  D.dbid = P.dbid


    IF @@rowcount = 0
    break

    SELECT @msg = 'KILL ' + convert(char(8) ,@ID)
    Print @msg
    EXEC( @msg)
    --break
END

GO

Alter database MYDATABASE
set MULTI_USER
with rollback immediate
exec sp_renamedb N'MYDATABASE',N'MYDATABASE_STH_ELSE'

To run Batch Script as Administrator can be a little challenge.

Sometimes you need batch script to run as administrator:

There is 2 alternatives:
1- Convert your batch script to exe and make exe run as administrator:


2- Add another batch script to open your batch script as administrator:

For example:

ExecuteDBBlank.bat will execute DBBlankExecution.bat as administrator but it requires you to enter password administrator:

 ExecuteDBBlank.bat
runas /noprofile /user:PC_NAME\Administrator C:\Users\COUK\Desktop\DBBlankExecution.bat

Where PC_NAME is your PC name and your main execution batch file can be located at any directory please update yours accordingly.

If we click on ExecuteDBBlank.bat it will ask you for Administrator password if you enter correctly DBBlankExecution.bat will be executed:




If you sometimes have to write some batch script (I do mainly for automation stuff) here is a very good complete DOS tutorial

http://www.dostips.com/

If you are a fan of building Robot or maybe a fan of Arduino (I am.)

http://www.robotshop.com/blog/en/how-to-make-a-robot-lesson-1-3707
http://www.robotshop.com/blog/en/arduino-5-minute-tutorials-lesson-1-software-3640

I recommended

The Arduino Starter Kit


Checking specific process listening on specific port

- Microsoft Start button + R
- Type CMD
- netstat -aon | findstr 0.0:PORT_NUM

*PORT_NUM is your port number.

Ex: netstat -aon | findstr 0.0:8080

Curently to activate license for monotouch per IMAC, you have to install later version of Xamarin which probably will come with Xamarin.IOS Framework that your existing IOS application is not supported


Curently to activate license for monotouch per IMAC, you have to install later version of Xamarin which probably will come with Xamarin.IOS Framework that your existing IOS application is not supported.
So how to activate license for monotuch per IMAC without having to install Xamarin.

Here is the work around (so-called Offline Activation http://docs.xamarin.com/guides/ios/getting_started/installation/offline_activation):

1- Install Xamrin and activate the IMAC
2-   Go to Finder and Hold down Ctrl Key on Go Menu in Finder and you will see Library
3-  Click on Library and go to Library\Monotouch\ And back up License.v2
4- Erase HD, Redownload Lion OS, Re-install, and Clone Co-worker’s HD using Migration/Assistance tool so that you do not have to re-install
all the applications again
(tip: http://www.youtube.com/watch?v=OtUw-vo606w)
- Then past the back up of License.v2 under Library\Monotouch\ and It compliles successfully now.
There you go! try to compile your project now.

Remark of the issues that leads to the solution above:
- If we do not activate the monotouch per IMAC we will get error - mtouch exited with code 98
that means you have not activated your monotouch on your MAC system.
http://www.gregoryvarghese.com/index.php/mtouch-exited-with-code-98/
- If you add reference to dll Microsoft.Synchronization.Data.dll in your project mainly for client/server database Synchronization:
after you install later version of Xamarin to activate your IMAC you might get errors  "is marked as an override but no suitable method found to override" on Methdo ApplyChange(...) which is an abstract method
on Base class ClientSynProvider
public abstract SyncContext ApplyChanges (
SyncGroupMetadata groupMetadata,
DataSet dataSet,
SyncSession syncSession
)

Following the solution I have mentioned got rid of these issues.
 

Just An Information

I will updat useful information as frequent as I could...

Technology

Usage Policies