Technology and More

Install Citrix Receiver in Ubutnu 16.04

Posted by: David Hill on

Go to: https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-latest.html

Receiver 13.4 for Linux

Expand: Debian Packages

Click (to download):

Full Package (Self-Service Support) > Receiver for Linux (x86_64)

Read: End-User License Agreement

Click: "Yes, I accept"

Download: icaclient13.5.0.10185126amd64.deb

Click to install with Software Installer

When you get: SSL error

(from: https://www.guyrutenberg.com/2012/12/22/installing-citrix-receiver-on-ubuntu-64bit/)

issue this command:

sudo mv /usr/share/ca-certificates/mozilla/AddTrust_External_Root.crt /opt/Citrix/ICAClient/keystore/cacerts/

Visual Studio Build Events: Copy DLL file

Posted by: David Hill on

When the assembly is built in Visual Studio, I want to copy it to the bin folder of my dev site.

My solution structure is as follows:

= Solution

= = instances

= = = wwwroot

= = project

Project > Properties > Build Events > Post-build events command line:

XCOPY "$(ProjectDir)bin\$(ProjectName).dll" "..\..\Instances\wwwroot\bin\" /y

Force HTTPS in an ASP.NET Web Application

Posted by: David Hill on

Here is how to force an ASP.NET Web Application to use HTTPS instead of HTTP (assuming you have a certificate installed).

Modify Web.config, in the <system.webServer> section, add:

    <rewrite>
      <rules>
        <rule name="HTTP to HTTPS redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
            <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
        </rule>
      </rules>
     </rewrite>
  </system.webServer>
  <runtime>

Thanks to: Paul S.

Import A SQL Server Database from Plesk

Posted by: David Hill on

Plesk is a web hosting platform with a control panel. This applies to the Windows Server hosting platform.

  1. In the Plesk control panel, navigate to the database of interest.
  2. Click "Export Dump".
  3. Download the dump file.
  4. In Windows, right-click the downloaded zip file, select "Properties".
  5. Click "Unblock" and click "OK".
  6. Double-click the zip file to reveal the file contained within.
  7. Copy (ctrl+c) the file and paste (ctrl+v) into the folder.
  8. Rename the file: at the end of the filename is an underscore followed by the date/time. Replace it with ".bak".
  9. Open SQL Server Management Studio; Expand "Databases".
  10. Right-click the database you want to replace with the newly downloaded data, select Tasks > Restore > Database.
  11. In the Source section, select "Device", click the box with the three dots (on the right side)
  12. In the window namced. "Select backup devices", click "Add", select the .bak file you pasted and renamed from the zip file. Click "OK" and then "OK" again to close the window.
  13. In the "Destination" section, make sure the correct database is selected to be restored.
  14. In the "Select a page" pane on the left side, choose "Files". In the "Restore As" column, remove the long string of numbers in the filenames for .mdf and .ldf files (this will overwrite the existing database files).
  15. In the "Select a page" pane on the left side, choose "Options". Check "Overwrite the existing database (WITH REPLACE)".
  16. Click "OK" and see the message that says "Database 'xyz' restored successfully." If you don't see the message, correct the issue and try again.

Good Luck!

For my web applications, I always need to re-connect the security configurations. To do this:

  1. Expand the database of interest; Expand "Security"; Expand "Users"; Delete the user, owner of the database.
  2. Expand the "Security" section in the Object Expolorer; Expand "Logins"; Double-click the owner of the database.
  3. In the "Login Properties" window for that Login, click "User Mapping" and click the database of interest. Then in the section labeled, "Database role membership for: xyz", check "db owner" and click "OK" to close the window.

Now you're done.

Decimal Only (jQuery)

Posted by: David Hill on
// decimalOnly.js
// allows only numeric with decimal in a textbox
// used mainly for US Dollar currency fields

function decimalOnly(textBox) {
var perFlag = false;

$(textBox).keydown(function (event) {
    if ((event.keyCode == 190 || event.keyCode == 110) && !perFlag) {
        if (!this.value.contains('.')) {
            return;
        }
    }// Allow: backspace, delete, tab, escape, and enter
    if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
        // Allow: Ctrl+A
    (event.keyCode == 65 && event.ctrlKey === true) ||
        // Allow: home, end, left, right
    (event.keyCode >= 35 && event.keyCode <= 39)) {
        // let it happen, don't do anything
        return;
    }
    else {
        // Ensure that it is a number and stop the keypress
        if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode
        < 96 || event.keyCode > 105)) {
            event.preventDefault();
        }
    }
});
}

Requirements Management Notes

Posted by: David Hill on

Requirements Management Remarks
Quote from Martin Fowler
“Models are neither good nor bad, they are simply more or less useful.”
DFH Note: Without documented requirements, how can a project be deemed unsuccessful (or successful).
Requirements Management = Risk Management
From a business perspective, requirements answer the “what” (not how).
Requirements management efforts can help in structuring a system from an object-oriented or class-based standpoint.
Four phases of requirements management
Discovery
Discovery – The learning process
Techniques for discovery are determined by: organizational culture, project type, other factors.
Techniques for discovery (ordered from least to most effective): Mining, Investigation, Collaboration, imersion.

Mining
(Least effective)
You’re given a stack of documents that others have produced – you have to go through and find all the requirements. Least effective because you have to interpret what the requirements are. You don’t know what you don’t know.

Investigation
Talk with people alone or in small groups . Down side: if you miss stakeholders, you miss requirements.
If groups have conflicting requirements, there can be trouble because groups with more power usually get what they want more often that groups with little power.

Collaboration
Similar to investigation but you get ALL stakeholders together at one time. This is a good technique for new products and major revisions.

Conversation
Use Index cards; don’t waste time; don’t get too detailed (keeps low investment in ideas on cards);
Different colors of index cards represents different concepts.
Note: used terms for the concepts that are “meaning neutral” to avoid associating with a bad connotation on the part of the stakeholders. Example: you might have one color card for “use cases”. Stakeholders have a bad idea of use cases due to negative prior experience. This leads to negative view of present concept.
Business Goals
(Blue)
Evaluate all other goals as to how they align to these business goals. Business goals help in framing the scope of the project.
Actors
(Green)
People and other entities that have interaction with the product or system.
Assumptions
(Red)
Statements made that you don’t know for certain to be factual. You don’t know it but you assume it.
System Processes
(White)
Functionality, use cases, features, user story, etc.
System Subjects (optional)
(Yellow)
purely business people may not need to participate in this part of the conversation. The system subjects cross over into the design – The “how”; includes entities, objects, classes… object oriented modeling.
Deliverable for the conversation session: “Conceptual View” document. This constitutes the transitions from requirements discovery into documentation.
This is the process of “memorializing” the results of the conversation. In this document you create a narrative of the process flow.
Follow Up
One-on-one sessions.

Immersion
The most effective technique for requirements discovery.
Cannot be used every time.
The idea is to “live” in the environment for a while.

Documentation
Our firm uses MS Word and Rational Requisite Pro (a requirements management tool)
With Requisite Pro, attributes can be assigned to requirements.
Delivery of requirements to programming team can be incremental as they emerge.
The requirements are written down in MS Word.
Key Point: The requirements should be stated at an atomic level, that is, they should NOT be open to interpretation.
If they are open to interpretation, they are less useful.
This creates the need for requirements that are very “wordy” – that’s OK.
Story boards are a good way of depicting system processes – Visio is a good tool for this.

Communication
This means translating the language of the stakeholders (Marketing, Sales, Accounting, etc.) into the language of software development.
This is often underestimated in terms of its importance.
Requirements are “micro-projects”. They have their own lifecycle.
A Requirements management tool allows attributes to be associated with the requirements.
Examples of requirement attributes:
Type of Requirement
Example values: Business rule.
Status
Example values: Proposed, Approved, In Development, In Testing, Passed, Failed, Pending Customer Validation (this one is a good way t get “customer signoff” when they wouldn’t do it otherwise).
Notes
Example values: Whatever.
Scheduled Iteration
This provides a way of managing risks.
History
Requisite Pro can keep an audit trail of requirements but it is hard to use; History attribute allows it to be manipulated like other attributes.
Requisite Pro allows filtered views to be exported to Excel and delivered to team members.

Verification
Also known as QA. Often gets left out. Ron’s opinion: Organizations often neglect this step because they don’t think it’s important or don’t want to spend the money/resources to do it.
Testing is based on requirements precisely.
In this model, QA is not tasked with identifying defects that are not directly associated with requirements. QA should not introduce new requirements.
Types of testing:
a. Unit testing
b. Integration / functional testing
Verify that the functional requirements are satisfied
Our firm uses “Rapid Requirements Gathering”.
Start with a vision then move to a requirements perspective.
Insist that all stakeholders are present at the requirements meeting.
End users tend to be focused on their personal interaction with the software and less on the overall goals.
Identifying stakeholders is NOT a requirements gathering activity.
The larger the group of stakeholders, the longer the requirements meeting takes.
It is not the role of the software development team to resolve conflicts between stakeholders.

Reset Visual Studio

Posted by: David Hill on

Sometimes you just need to reset everything back to the defaults.

If you need to do that in the Visual Studio integrated development environment (IDE), it's pretty quick and easy - just let it be known that it will remove all your customizations, options, preferences, tabs, windows, etc.

The development environment executable on many machines is located in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE.

First close Visual Studio.

Then open a command prompt window (press Windows + R then type CMD in the "Run" window).

Navigate to the IDE folder as described above.

Then enter this command: devenv.exe /resetuserdata

It runs quickly but after you start Visual Studio again, it may take a minute to start as if it were the first time.

Visual Studio Debug In Current Browser Window

Posted by: David Hill on

After the upgrade of Visual Studio 2017 Community Edition to ver. 15.7.3 all debugging suddenly launched a new browser window. This is annoying.

The solution is this:

Tool > Options > Projects and Solutions > Web Projects

Uncheck: "Stop debugger when browser window is closed".

I found the solution here:

Stack Overflow

Umbraco Installation Procedure – Manual Method

Posted by: David Hill on

Requirements:

SQL Server

SQL Server management studio

IIS

Umbraco version 4

Download the Umbraco zip file

Download the zip file

Unblock the zip file:

right-click|properties

if the message “Security: This file came from another computer and may be blocked…” is visible (at the bottom of the properties window) along with an “Unblock” button, click the “Unblock” button

if the message and button are not present – no unblocking action is needed

Unzip the file: this should produce the Umbraco folders (AppBrowsers, AppCode, App_Data, bin, etc.) and files

Make sure SQL Server authentication mode is set to “SQL server and Windows authentication mode”

In SQL Server Management Studio:

Set server authentication to “SQL server and Windows authentication mode”

from the object Explorer window, highlight the server name, right click, select “Properties”

Select page: “security”

under server authentication, select “SQL server and Windows authentication mode”

click OK

stop and restart SQL Server

Create a new database for Umbraco

In SQL Server Management Studio:

Right-click “databases”

Select “New Database…”

Enter a name for the new database

In the “Database files” area:

Choose a path for the database files (or use default)

Click OK

Add a new SQL Server login

In SQL Server Management Studio:

From the root server node (in Object Explorer pane)

Expand “Security” node

Right-click “Logins”

Select “New Login…”

Choose a name for the new login

Click “SQL Server authentication”

Choose a password for the new login

(this login name and pwd are needed for the Umbraco install)

Uncheck “Enforce password policy” (don’t click OK yet)

Click “User Mapping” from the left side

In the “Map” column, put a check by the new database – then check “db_owner” in the Database role membership area

Click OK

Close SQL Server Management Studio

Create a folder to hold the Umbraco installation

Create a folder for the Umbraco installation.

(frequently, this is a subdirectory of c:\inetpub – but it doesn’t need to be)

Set the permissions for the new folder that is to contain the Umbraco instance

First note the name of the Application Pool for ASP.NET v4.0 from IIS

Open IIS

Expand the server in the “Connections” panel

Click “Application Pools”

Note the name of the application pool for ASP.NET v4.0/Integrated (the name is probably “ASP.NET v4.0”)

On the new folder that is to contain the Umbraco instance Right-click|properties

Click the “Security” tab

Click the “Edit” button to change permissions

Click the “Add” button to add a new user

In the window labeled “Enter the object names to select”, type: “IIS AppPool\ASP.NET v4.0” (without the quotes)

Click the “Check Names” button – if the name is OK, it will be underlined (and the “IIS AppPool” part will disappear)

Click “OK”

In the list of permissions, place a check mark by “Full Control” in the “Allow” column

Click “OK”. That will close the properties window

Create a new website

Open IIS

From the “Connections” pane, expand the root node

Right click “Sites”.

Click “Add Web site…”.

In the “Add Web Site” window,

Enter the site name (can be anything – for example: “ClientA.local”).

Next to the “Application Pool:” field click the “Select” button. In the dropdown list of App Pools, select the one for ASP.NET v4.0 that you noted earlier

Select the Physical Path of the folder created earlier.

Enter a name in the Host Name field – this is frequently the same as the site name (example: “ClientA.local”)

Click “OK”. That will close the “Add Web Site” window

Start the website if not already started (Actions pane, Manage Web Site)

Close IIS

Add an entry in the Hosts file

Open the hosts file with Notepad

On 64-bit Windows, this is located at C:\Windows\System32\drivers\etc\hosts

On 32-bit Windows, this MAY be located at C:\Windows\System\drivers\etc\hosts

On a separate line, add an entry similar to this: “127.0.0.1 ClientA.local” (without the quotes)

the name should exactly match the name typed into the Host Name field in IIS

Copy the Umbraco folders and files to the folder you created to hold the Umbraco installation

Copy the Umbraco folders and files

Install Umbraco

Open a browser

Navigate to http://ClientA.local

Sooner or later the Umbraco page will load with the Installation procedure started

Click “Let’s get started!”

Click “Accept and Continue” (on the license page)

Check: “I already have a blank SQL Server, SQL Azure or MySQL database”

Choose: Microsoft SQL Server

For Connection details (if you are using SQL Server Express Edition)

Server: .\SQLEXPRESS

Database name: [the name of the database you created]

Username: [the login you created in SQL Server Management Studio]

Password: [the password you entered for the database in SQL Server Management Studio]

Click “Install” and hope for the best

If you have configured the database and login properly – the tables will be installed and then you will see the “Installation Completed!” message.

Click “Continue”

Provide an admin password

Click “Create User”

Follow the rest of the instructions…

Good Luck!

To access the site

Open a browser

Navigate to http://ClientA.local

To access Umbraco

Open a browser

Navigate to http://ClientA.local/umbraco/

SQL Server Management Studio Error: Saving changes is not permitted.

Posted by: David Hill on

SQL Server Management Studio

Error: Saving changes is not permitted. The change you have made requires the following table to be dropped and re-created. What to do: Tools > Options > Designers > Table and Database Designers. See the checkbox: "Prevent saving changes that require the table to be re-created". Uncheck it.