Pages

Sunday, December 8, 2013

Finding Computer Name Using IP


NSLOOKUP  host

NSLOOKUP  ipaddress
tracert host





Agile Team Practices with Scrum

Scrum

**) Product progress: Sprint (created by scrum team)
**) All requirements in:  Product Backlog  (created by product owner)

**) Every month there is a working demo, no mock-ups or slide shows



Scrum Roles
  1. Product owner
  2. Team members
  3. Scrum Master


Thursday, December 5, 2013

Agile Team Practices with Scrum

Estimate Software:

**) Never say how long this thing will take?
say how big this thing relatively to something else

**) Compare the work that need to be done, with something historically happend before.
**) Estimation must be very quick not taking weeks
**) Estimate with numbers called story points
1,2,3,5,8,13,20,40,100

**) Use the team for estimations not just one person
do it quickly using poker planning cards

Handling conflict
Wait for convergence








Agile Team Practices with Scrum

User Story recipe:

As a  I want  so that 

  • As a <traveller> I want to <reserve> a hotel room. so that <I have a place to stay
  • As a <vacation planner> I want to <see picture of Hotel> a hotel room. so that <I have better decision

**) Use Role not user

**) Each user story will create more questions and more requirements, in this case we can create a work item, and list all the new requirements under the user story, or simply create more user stories

**) Detail sub stories may be the best



Testing requirements in a user story formula:

Given [and more context],
When
Then [and other outcomes]

For example

Given I am a premium member 
When I canceled under 24 hours
Then I incurred no penalty 


Given I am non-a premium member 
When I canceled under 24 hours
Then I pay 50%

Given I am site member 
When I canceled my reservation
Then I will receive a confirmation email


**) Now per each main user story or work item, it will be good to have a title like
(User cancels reservation)

**) we can name the validation, or test requirements (Given, when that) as scenarios

**) All scenarios can be turned to an automatic tests


Story Card:

Story Title:
Story Description:As a  I want  so that 

Success Criteria
  • Given [and more context],
    When 
    Then [and other outcomes]
  • Given [and more context],
    When 
    Then [and other outcomes]
  • Given [and more context],
    When 
    Then [and other outcomes]


----------------------------





Wednesday, December 4, 2013

backup android app with all internal files

C:\Users\rwahib>adb backup -nopak com.example.helloworld -f  c:\backup.ab
Now unlock your device and confirm the backup operation.

Thursday, November 21, 2013

Android dev setup


  1. Install Eclipse IDE for Java developer
    http://www.eclipse.org/downloads/
  2. Install Android SDK starter Package
    Windows installer version
    http://developer.android.com/sdk/index.html
    download for Existing IDE
    http://dl.google.com/android/installer_r22.3-windows.exe

    Install it in c:\AndroidSDK
  3. ADT for eclipse

    add repository

    ADT - https://dl-ssl.google.com/android/eclipse/

    to eclipse then install Development tools & NDK Plugins



    from Android SDK manager, Install tools and platforms that you wish to install

    ----------------------------

    To Run first Project via devise


    1-Enable debugging the device to run the app

    Settings -> Developer Options then select USB Debugging (Android 4+)Enable debugging the device to run the app

    2-Install Samsung Kies for Samsung devices
    3-ADB (Android Debug Bridge)
    If running the app in real device, sometimes Eclipse cannot find the device. Then ADB needs to be restarted.
    Useful ADB commands (to be run from Command Prompt)
    Stop ADB Server: adb kill-server
    Start ADB Server: adb start-server
    See all the devices attached through USB: adb devices

Sunday, June 23, 2013

Mapping network resources, with impersonation


net use [drive:] [sharedfolder] password /user[domain\username]

like:
net use e: \\usrsvr002\smithmark Ue345Ii /user:pdc01

legends: password full user name


disconnect


net use e: /d


Stopping automatic login with different account

start-->run--> rundll32.exe keymgr.dll, KRShowKeyMgr


Wednesday, May 29, 2013

AD commands

Get user by display name
http://technet.microsoft.com/en-us/library/cc754525(v=ws.10).aspx


  • DSQUERY USER -name "Wahib, Refky"
  • DSQUERY USER -name "W*"
  • DSQUERY group  -name "PS_NSW - Learning_and_Business_Systems - LS"




Monday, May 20, 2013

Useful scripts for database migration




 DECLARE @name nvarchar(50);
   DECLARE tableCursor CURSOR FOR
       SELECT name
FROM sys.Tables

  OPEN tableCursor

  FETCH NEXT FROM tableCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name

     --exec( 'drop table ['+@name+']');

        exec( 'select top 1000 * from  "'+@name+'"');

    FETCH NEXT FROM tableCursor into @name

  end  
  CLOSE tableCursor;
  DEALLOCATE tableCursor;
  go

Tuesday, May 7, 2013

Cursor, drop all tables,views, procedures



USE LRRV6Portal
GO



--SELECT name
--FROM sys.Tables
--GO




  DECLARE @name nvarchar(50); 
   DECLARE tableCursor CURSOR FOR
       SELECT name
FROM sys.Tables
 
  OPEN tableCursor
 
  FETCH NEXT FROM tableCursor into @name
 
  WHILE @@FETCH_STATUS = 0
  BEGIN
  
  
 
         PRINT @name
        
        exec( 'drop table "'+@name+'"');

    FETCH NEXT FROM tableCursor into @name

  end   
  CLOSE tableCursor;
  DEALLOCATE tableCursor;
  go

------------

 DECLARE @name nvarchar(50);
   DECLARE viewCursor CURSOR FOR
       SELECT name
FROM sys.views

  OPEN viewCursor

  FETCH NEXT FROM viewCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name
       
        exec( 'drop view "'+@name+'"');

    FETCH NEXT FROM viewCursor into @name

  end  
  CLOSE viewCursor;
  DEALLOCATE viewCursor;
  go

----------

 DECLARE @name nvarchar(50);
   DECLARE procedCursor CURSOR FOR
       SELECT name
FROM sys.procedures

  OPEN procedCursor

  FETCH NEXT FROM procedCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name
       
        exec( 'drop procedure "'+@name+'"');

    FETCH NEXT FROM procedCursor into @name

  end  
  CLOSE procedCursor;
  DEALLOCATE procedCursor;
  go

Friday, February 1, 2013

MSBuild Sample



xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" DefaultTargets="Main" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
  <PropertyGroup>
    <Source>.\Source\</Source>
    <Exported>.\Exported\</Exported>
    <TargetFolder>C:\Temp\Build\SampleA</TargetFolder>
    <ProjectGuid>{8170B353-A8B2-40BC-B4E5-F443635E3BA4}</ProjectGuid>
  </PropertyGroup>
 
  <PropertyGroup Condition="'$(Configuration)' == 'Main'">
    <OutputPath>bin\Main\</OutputPath>
  </PropertyGroup>
 
  <PropertyGroup Condition="'$(Configuration)' == 'Variable-Samples'">
    <OutputPath>bin\Variable-Samples\</OutputPath>
  </PropertyGroup>
 
  <ItemGroup>
    <AllSource Include="$(Source)**\*.*" />
    <AllExportedSource Include="$(Exported)**\*.*" />
  </ItemGroup>
 
  <Target Name="Main">
    <CallTarget Targets="Variable-Samples" />
   
   
  </Target>
 
  <Target Name="Clean">
    <Message Text="###################### Clean has been called #####################">
    </Message>
    <RemoveDir Directories="$(Exported)" ContinueOnError="true">
    </RemoveDir>
    <MakeDir Directories="$(Exported)" ContinueOnError="true">
    </MakeDir>
    <RemoveDir Directories="$(TargetFolder)" ContinueOnError="true">
    </RemoveDir>
    <MakeDir Directories="$(TargetFolder)" ContinueOnError="true">
    </MakeDir>
    <Message Text="###################### Clean has been finished #####################">
    </Message>
  </Target>
 
  <Target Name="Export" DependsOnTargets="Clean">
    <Exec Command="svn export file:///C:/SVN-REP/MSBUILD-TEST/trunk/Clips.WebClientNewDesign/Templates $(Exported)Source-Tempaltes/">
    </Exec>
  </Target>
 
  <Target Name="Deploy" DependsOnTargets="Clean">
    <Message Text="###################### Deployed has been called #####################" />
    <Copy SourceFiles="@(AllExportedSource)" DestinationFolder="$(TargetFolder)\**\*.*" />
    <Message Text="###################### Deployed has been finished #####################" />
  </Target>
 
  <Target Name="Variable-Samples">
   
    <PropertyGroup>
      <Source Condition="false">.\New-Source\</Source>
    </PropertyGroup>
    <Message Text="Source value= $(Source)">
    </Message>
    <CreateProperty Value="Hello Oz">
      <Output TaskParameter="Value" PropertyName="Greating" />
    </CreateProperty>
    <Message Text="Greating :$(Greating)">
    </Message>
   
    <CreateProperty Value="Hello World">
      <Output TaskParameter="Value" PropertyName="Greating" />
    </CreateProperty>
    <Message Text="Greating :$(Greating)">
    </Message>
    <CreateProperty Value="Hello Entire world">
      <Output TaskParameter="Value" PropertyName="Greating" Condition="true" />
    </CreateProperty>
    <Message Text="Greating :$(Greating)">
    </Message>
  </Target>
 
  <Target Name="Config-Target">
   
   
   
    <Message Text="Config value= $(Configuration)">
    </Message>
    <CreateProperty Value="DEV">
      <Output TaskParameter="Value" PropertyName="Type" />
    </CreateProperty>
  </Target>

  <Target Name="Metadata" DependsOnTargets="Export">
    <ItemGroup>
      <AllSource Include="$(Source)**\*.*" />
      <AllExportedSource Include="$(Exported)**\*.*" />
    </ItemGroup>
   
   
   
   
   
    <Message Text="All exported source : @(AllExportedSource->'%(RecursiveDir)%(Filename)%(Extension)%0D%0A')"></Message>
  
  </Target>
</Project>


Monday, January 28, 2013

Knock-out simple code



// Here's my data model

///
///

var ViewModel = function (first, last) {
    this.firstName = ko.observable(first);
    this.lastName = ko.observable(last);

    this.fullName = ko.computed(function () {
        // Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.
        return this.firstName() + " " + this.lastName();
    }, this);
};

var ViewMode2 = function (first, last) {
    var self = this;
    this.firstName = ko.observable(first);
    this.lastName = ko.observable(last);

    this.fullName = ko.computed(function () {
        // Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.
        if (self.firstName().length == 0 || self.lastName().length == 0) return 'missing data';
        return self.firstName() + " " + self.lastName();
    }, this);
};


$(function () {
   // ko.applyBindings(new ViewModel("Refky", "Wahib")); // This makes Knockout get to work   
    ko.applyBindings(new ViewMode2("Refky", "Wahib")); // This makes Knockout get to work   
});

 -------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      
        <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
        <script type="text/javascript" src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
      
        <script type="text/javascript" src="js/main.js"></script>

        <link rel="stylesheet" type="text/css" href="css/main.css" />
        <title>sample 1</title>
   
    </head>
<body>
<div class='liveExample'>
    <p>First name:
        <input data-bind='value: firstName' />
    </p>
    <p>Last name:
        <input data-bind='value: lastName' />
    </p>
     <h2>Hello <span data-bind='text: fullName'> </span></h2>
</div>
<div data-bind='text: firstName' class='demo'></div>
<input type='submit'></input>
</body>
</html>

 ---------------------------

body {

    font-family: arial;

    font-size: 14px;

}

.liveExample {

    padding: 1em;

    background-color: #EEEEDD;

    border: 1px solid #CCC;

    max-width: 655px;

}

.liveExample input {

    font-family: Arial;

}

.liveExample b {

    font-weight: bold;

}

.liveExample p {

    margin-top: 0.9em;

    margin-bottom: 0.9em;

}

.liveExample select[multiple] {

    width: 100%;

    height: 8em;

}

.liveExample h2 {

    margin-top: 0.4em;

    font-weight: bold;

    font-size: 1.2em;

}

.demo, input[type=submit] {

    background-color:lightgreen;

    padding:5px;

    margin-top:2px;

}