Blogs

Twelve-Factor Applications

This post is just my notes about Twelve-Factor Applications. You can consider it my extended version of the original website.

“Twelve-factor applications” is a methodology that focus mainly on developing software-as-a-service applications (or SAAS for short). Although that’s was the main concern, factors in this methodology can be used or inspire engineering practices in other types of software development.

Facor 1 - Codebase

One codebase tracked in revision control, many deploys.

Project Euler - Problem 1 - Multiples of 3 and 5

As part of my effort to refresh my memory in the areas of algorithms, data structures and mathematics, I’m going to use problems from Project Euler. Now, let’s get to problem 1.

/*
Project Euler - Problem 1 - Multiples of 3 and 5 [ https://projecteuler.net/problem=1 ]
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. 
The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.

This is a generic implementation of the solution.
Input Format: 
The first line of the input contains the multiples ( 3 and 5 in our case).
The second line of input contains the upper bound (1000 in our case).
*/
public static void Problem1() {
	string multiplesRawInput = Console.ReadLine();
	int upperBound = int.Parse(Console.ReadLine());
	int[] multiples = new int[(multiplesRawInput.Split(" ".ToCharArray())).Count()];
	int i = 0;
	foreach(string multiple in multiplesRawInput.Split(" ".ToCharArray())) {
		multiples[i] = int.Parse(multiple);
		i++;
	}

	int result = 0;
	for (int j = 1; j < upperBound; j++) {
		if (((j % 3) == 0) || ((j % 5) == 0)) result = result + j;
	}
	Console.WriteLine(result);
}

Syntax Modification using Microsoft Roslyn

In the previous two posts we just used the analysis capabilities of Microsoft Roslyn. In other words, we only get information about the code under inspection, we never changed it. In this post we going to change the code through Roslyn.

Before we start we need to highlight that data structures that represent code under inspection in Roslyn APIs are immutable. This means that it cannot be changed after they are created (in order to safely share them between tools). This applies to syntax trees, compilations, symbols, semantic models, and every other data structure in the Roslyn API. Instead of modification, new objects are created based on specified differences to the old ones.

Semantic Analysis using Microsoft Roslyn

In a previous post we talked about using Microsoft Rosyln Syntax API to deal with syntax text in terms of SyntaxTrees and SyntaxNodes. But as we we all know, a single source code or code snippet can’t make a useful program. 99% of the time we end up with many source code files that depend on so many externals: assembly references, namespace imports, or other code files. The meaning (semantic) of SyntaxNodes depend heavily on these externals and may change due changes in these externals even if its enclosing source code file have not been changed.

Syntax Analysis using Microsoft Roslyn

In a previous post we talked about Microsoft Roslyn. In this post will get our hands dirty with Roslyn syntax analysis in order to develop our first code-focused program. We will see how the SyntaxTree of HelloWorld program look like and how we can traverse and query it.

The Syntax API exposes the syntax trees the compilers use to understand Visual Basic and C# programs. They are produced by the same parser that runs when a project is built or a developer hits F5. The four primary building blocks of syntax trees are:

Overview of Microsoft Roslyn – The first compiler-as-service product.

Introduction

From developer perspective, compilers are black boxes – source code goes in one end, magic happens in the middle, and object files or assemblies come out the other end. During their job, compilers build up a deep understanding of our code. For decades this valuable information was unreachable.

The Roslyn project aims to open compilers for developers and offer it as services. Through Roslyn, compilers become services with APIs that can be used for code related tasks in your tools and applications.

Convert Microsoft Pex path conditions from Z3 native format to SMT-LIB

We talked before about getting the code path conditions from Microsoft Pex as in Z3 native format(.z3 file).

Sometimes you may need to convert from Z3 native format to SMT-LIB standard. You can do that using the Z3 C# APIs. The only trick here is: you have to use the Microsoft.Z3.dll that come with your current Microsoft Pex installation (C:\Program Files\Microsoft Pex\bin\Microsoft.Z3.dll).

The Z3 Constraint Solver, a developer perspective

Z3 is a high-performance SMT solver developed at Microsoft Research. It have been integrated with many many tools that came out from Microsoft for program analysis, testing, and verification.

What SAT means ?

SAT refers to Boolean satisfiability problem where we want to determine if there exists an interpretation that satisfies a given Boolean formula. In other words, it establishes if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to true.

Get path conditions from Microsoft Pex

We talked in a previous post about Microsoft Pex and how it choose values to explore your code through symbolically executing it and getting all its paths. A code path is the represented by all the conditions that have to be satisfied in order to make the code execution go to this path. Your code conditional statements will lead to different paths according to different input values. Test cases generated by Pex represents the code behavior for specific input values that lead to specific code path.

Bring “Sign in as Different User” back to SharePoint 2013

If you new to SharePoint 2013 like me and get confused looking for “Sign in as a Different User” menu command, don’t worry it is not there by design but we can easily bring it back.

Do the following steps to get the link back:

  • Locate the file \15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx and open it for editing.
  • Add the following snippet before the existing element that have id of “ID_RequestAccess”.
  
 Text="<%$Resources:wss,personalactions\_loginasdifferentuser%>"  
 Description="<%$Resources:wss,personalactions\_loginasdifferentuserdescription%>"  
 MenuGroupId="100"  
 Sequence="100"  
 UseShortId="true"  
 />

Save and close the file. Now you should get the link “Sign in as Different User” back.

Testing stateful components using Microsoft Pex

<>
Pattern. This pattern applies for statefull component x that expose members that may transition the state. For each member f(x), one defines a transition type Tf (x; o) which contains a method to invoke f(x) and where o is the test oracle.
Let us illustrate this pattern with the XmlWriter class from the System.Xml library. This class contains a number of methods (Write…) which have to be called in a particular order to build valid XML documents. The writer also exposes a WriteState property which gives a partial view on the state of the writer:

Getting started with Neo4j

Neo4j is an open-source graph database implemented in Java. The developers describe Neo4j as “embedded, disk-based, fully transactional Java persistence engine that stores data structured in graphs rather than in tables”. According to DB-Engines report, Neo4j is the most popular graph database.

As a graph database, Neo4j focuses more on the relationships between values than on the commonalities among sets of values (such as collections of documents or tables of rows). Neo4j is small enough to be embedded into nearly any application. On the other hand, Neo4j can store tens of billions of nodes and as many edges. Let’s get started with Neo4j !

Create a new Web Part Page with Quick Launch menu

This post is about a simple task we do daily in SharePoint 2010, creating a new Web Part page. Every time we need a new Web Part page, we go to All Site Content > Create > Web Part Page > Create. Now we have a Web Part page but no quick launch menu on the left.

To show the quick launch menu on the new created page:

  • Open the page for editing in SharePoint 2010.
  • Switch to the Code view.
  • Click on the Advanced Mode button on the ribbon.
  • Now look for the following code snippet and delete it.

<SharePoint:UIVersionedContent ID=“WebPartPageHideQLStyles” UIVersion=“4"runat=“server”>

body # {s4-leftpanel
display: none;
}
. s4 {ca-
margin-left: 0px;
}
</ style>
</ ContentTemplate>
</ SharePoint: UIVersionedContent>

Getting Started with MongoDB – Part 2

In the previous post we explored the basics of MongoDB. In this post we going to dig deeper in MongoDB.

Indexing

Whenever a new collection is created, MongoDB automatically creates an index by the _id field. These indexes can be found in the system.indexes collection. You can show all indexes in the database using db.system.indexes.find() . Most queries will include more fields than just the _id, so we need to make indexes on those fields.

Getting Started with MongoDB – Part 1

MongoDB (from “humongous”) is an open source document-oriented database system developed and supported by 10gen (founded by Dwight Merriman). First publicly released in 2009, and since then it have been a rising star in the NoSQL world. MongoDB stores structured data as JSON-like documents with dynamic schemas (technically data is stored in a binary form of JSON known as BSON), making the integration of data in certain types of applications easier and faster.

Installation

  1. Download the latest mongoDB version from here.
  2. Extract the archive to your preferred location (in my case C:\mongodb). MongoDB is self-contained and does not have any other system dependencies. You can run MongoDB from any folder you choose. You may install MongoDB in any directory.
  3. MongoDB requires a data folder to store its files (default is C:\data\db ). You may specify a different path with the dbpath setting when lunching mongod.exe.

Starting the Server

To start MongoDB, open the command prompt window, and run mongod.exe from the bin directory (specify the data path if needed)
CWindowssystem32cmd.exe - mongod.exe  –dbpath Cmongodbdata_2013-07-09_16-10-49The waiting for connections message in the console output indicates that the mongod.exe process is running successfully and waiting for connections on port 27017

Getting Started with Apache Cassandra

Apache Cassandra is “an open source, distributed, decentralized, elastically scalable, highly available, fault-tolerant, tuneably consistent, column-oriented database that bases its distribution design on Amazon’s Dynamo and its data model on Google’s Bigtable” (source: “Cassandra: The Definitive Guide,” O’Reilly Media, 2010, p. 14).

Cassandra is built to store lots of data across a variety of machines arranged in a ring, in other words scaling horizontally, rather than vertically.

جريدة الشروق : تقرير شهادات سكان عمارات العبور

سكان «عمارات العبور»: ضرب النار والغاز بدأ من الحرس الجمهوري بدون مقدمات

تعليقات: 117شارك بتعليقك

نشر فى : الإثنين 8 يوليو 2013 - 4:13 م
آخر تحديث : الإثنين 8 يوليو 2013 – 4:13 م


اشتباكات الحرس الجمهوري – أرشيفية

كتب- مصطفى هاشم:

رصدت “الشروق” أحداث الحرس الجمهوري التي أودت بحياة أكثر من 50 من مؤيدي الرئيس المعزول محمد مرسي و2 من الشرطة، من خلال سكان العمارات المقابلة للحرس الجمهوري، والتي يطلق عليها عمارات"العبور".

Redis 101– Part 2

We introduced many of the Redis’s fundamental concepts and commands in the last post. In this post we going to introduce some advanced features.

Publish-Subscribe

Previously we queued data that could be read by a blocking pop command. Using that queue, we made a very basic publish-subscribe model. Any number of messages could be pushed to this queue, and a single queue reader would pop messages as they were available. This is powerful but limited. Redis provides some specialized publish-subscribe (or pub-sub) commands.

Running multiple Redis instances on the same server

Redis runs as a background process that listens to a specific port (6379 by default) for incoming requests from clients. Running multiple instances requires a separate conf file and a new init script. The conf file specifies details for the new instance, and the init script handles starting/stopping of the instance background process.

  1. Make a copy of the redis.conf file at C:\Program Files\Redis\Conf and give it a new name redis-s1.conf. Leave both files in the same directory C:\Program Files\Redis\Conf

Redis 101

Redis (REmote DIctionary Service) is an open-source networked in-memory key-value data store. First released in 2009, currently sponsored by VMware, and since then it have been ranked the most popular key-value store by DB-Engine. Redis creator Salvatore Sanfilippo refers to his project as a “data structure server” to capture its unique handling of complex data types and other features. Interested ? Enough talking, let’s get down to business.

PostgreSQL 101

PostgreSQL is the finest open source example of the relational database management system (RDBMS) tradition. This means that PostGreSQL is a design-first data store. First you design the schema, and then you enter data that conforms to the definition of that schema.

History of PostgreSQL

PostgreSQL has existed in the current project incarnation since 1995, but its roots
are considerably older. The original project was written at Berkeley in the early 1970s
and called the Interactive Graphics and Retrieval System, or “Ingres” for short. In the
1980s, an improved version was launched post-Ingres—shortened to Postgres. The
project ended at Berkeley proper in 1993 but was picked up again by the open source
community as Postgres95. It was later renamed to PostgreSQL in 1996 to denote its
rather new SQL support and has remained so ever since.

Parameterized Models Patterns using Microsoft Pex

Pex provides an infrastructure to implement parameterized models. We refer to parameterized models as they build on top of Pex infrastructure to generate new parameters on the fly, which we usually refer as choices. Parameterized models can be used to replace traditional mocked-based testing as a single model captures all possible behavior.
For a modeled component, instead of defining a single input/output pair as with mock objects, a parameterized model can specify a general input/output relationship, and it can use test parameters to act in various ways. In unit testing, mock objects are used to simulate the behavior of external components in order to test each component in isolation.
Although mock object frameworks have greatly improve the usability in recent years, mock-based testing is still a tedious task. Note that the term mock object is used for somewhat different concepts by developers practicing unit testing. The meaning ranges from very simple (empty) stubs to complex and precise behavior with expected inputs and correctly computed outputs.
Martin Fowler discusses this in detail here. In this sense, the first parameterized model patterns we present start out as simple stubs, but the patterns allow sophisticated models that assert expected inputs and restrict possible outputs.
There are many frameworks that make it easy to write mock objects—for example, for .NET. Similar to how NUnit relates to Pex, these existing frameworks make it easy to manage mock objects—for example, by reducing the amount of code that must be written—but they do not help in exploring different behaviors. Note that Pex comes with a simple stubs framework. This framework was designed to be friendly with the kind of code analysis Pex does.

Parameterized Test Patterns using Microsoft Pex

We talked before about the difference between unit tests and parameterized unit tests. In this post we will talk about common patterns for writing good parameterized unit tests. Keep in mind that we will use these tests with Microsoft Pex (as an automatic test input generation tool) to get test inputs that trigger all the possible scenarios of the code-under-test.

Before anything, let’s clarify what are the questions we want to answer using the parameterized unit tests. There are  two core questions:

Microsoft Pex: Understanding Assumptions, Assertions, and Test-Case Failures

In a previous post we started using Microsoft Pex and showed how it helped exploring all possible code paths, and how that helped discovering a defect in our program logic. In that example, even our program logic is defective, all test cases succeeded. A test case fails if there is an un-caught exception or a failed assertion.

To see an example of a failed test case and how Pex could help in fixing it, let’s add the following basic function to our code:

Getting started with Microsoft Code Digger

Microsoft Code Digger is Visual Studio 2012 extension that have been released few days ago by RiSE team at Microsoft Research (the same team who developed Pex). You can download the it from the Visual Studio Gallery here.

Microsoft Code Digger uses the same engine that Pex uses, and the same techniques under the hood (dynamic symbolic execution and constraint solvers). The only constrain that Code Digger have is that it only works on public .NET code in Portable Class Libraries.

Why Pex Choose These Inputs

In the example we gave in the previous post, it may seem that Pex chose random numbers as inputs for the Triang() method but it is not. But also its not all possible values for the inputs.

Actually, Pex generates test inputs by analyzing your program code, so it is called whitebox test generation (as opposed to blackbox test generation). For every statement in the code, Pex will eventually try to create a test input that will reach that statement. Pex will do a case analysis for every conditional branch in the code—for example, if statements, assertions, and all operations that can throw exceptions.

Getting started with Microsoft Pex

Microsoft Pex is a white box test generation for .NET that came out of Microsoft Research and have been successfully integrated into Visual Studio 2010. It have been a result of collaborative work between Microsoft Research and the Automated Software Engineering Research Group at North Carolina State University led by  Dr. Tao Xie.

You can download and install Microsoft Pex for Visual Studio 2010 from here. We have talked in a previous post about parameterized unit tests and the possibilities it brings. In this post and the following we will explore Microsoft Pex and how it can help you in understanding the input/output behavior of your code, finding inputs that cause the code-under-test to crash, and exploring parameterized unit tests to check whether your code implements the desired functionality for all inputs.

Unit Tests vs Parametrized Unit Tests

Unit Tests

Using the conventions of NUnit unit tests as test methods contained in test classes. A parameterless method decorated with a custom attribute like [TestMethod] is a test method. Usually, each unit test explores a particular aspect of the behavior of the class-under-test.

Here is a unit test written in C# that adds an element to a .NET ArrayList instance. The test first creates a new array list, where the parameter to the constructor is the initial capacity, then adds a new object to the array list, and finally checks that the addition was correctly performed by verifying that a subsequent index lookup operation returns the new object.

Getting Started with Java PathFinder

Java™ Pathfinder, or “JPF” as we call it from here, is a highly customizable execution environment for verification of Java™ bytecode programs. JPF was developed at the NASA Ames Research Center, open sourced in 2005, and is freely available here under the NOSA 1.3 license. JPF started as a software model checker but it integrates model checking, program analysis and testing.

In this post  we will go in a step by step process to setup the  environment where Java Path Finder can be used within Eclipse IDE environment. We will show a simple example of using JPF.

Introduction to Probability

1 - What is probability ?

There is three different interpretations of probability :

  1. The Frequency Interpretation of Probability : The probability that some specific outcome of a process will be obtained can be interpreted to mean the relative frequency with which that outcome would be obtained if the process were repeated a large number of times under similar conditions. In this case probability is based on history.

  2. what exactly large number means ?

Introduction to R – Charts and Graphics

R includes several packages for visualizing data:

  • graphics contains plotting functions for the “base” graphing systems, including plot, hist, boxplot and many others.
  • lattice contains code for producing Trellis graphics, which are independent of the “base” graphics system; including functions like xyplot, bwplot, levelplot. It built on grid which implements a different graphing system independent of the “base” system.
  • grDevices contains all code implementing the various graphics devices, including X11, PDF, PostScript, PNG, etc.

before making you chart, you need to think in the following:

Introduction to R – Random Variables Generation &amp; Probability Distribution Functions

Simulation is important topic for statistical applications and scientific purposes in general.

Generating Random Numbers

The first step in simulation is to generate random values based on your variables distribution. R has a large number of functions that generate the standard random variables.

for Normal random variable generation

rnorm() simulate a simple random normal variable with a given mean and standard deviation and generate as many random values as requested.

Introduction to R – Basic Debugging

In this post we will talk about native debugging support in R. Mostly, you start debugging when something goes wrong, which have many indications:

  • message A generic notification/diagnostic message produced by the message function; execution of the function continues.
  • warning An indication that something is wrong but not necessarily fatal; execution of the function continues; generated by the warning function; you got it after the function completion.
  • error An indication that a fatal problem has occurred; execution stops; produced by the stop function.
  • condition A generic concept for indicating that something unexpected can occur; programmers can create their own conditions.

The primary tools for debugging functions in R are:

Introduction to R – Control Structures

Like every other programing language, R have control structures that allow you control the flow of your code execution.

If, else for testing a condition. else section is optional.

RGui (64-bit)_2013-01-15_15-43-49

if it’s all about assigning a value to a variable, you can do like this

RGui (64-bit)_2013-01-15_15-46-22

for for executing a loop for a fixed number of times. It takes a variable and assign it successive values from a sequence or vector.

Introduction to R – Functions

Functions

Functions are just like what you remember from math class. Most functions are in the following form: f(argument1, argument2, …) Where f is the name of the function, and argument1, argument2, . . . are the arguments
to the function. Here are a few examples of built-in functions:
RGui (64-bit)_2013-01-08_16-25-25_thumb[1]
Note in the last example that if you give the argument in the default order, you can omit the names. Some built-in functions have operator form like the following examples:
RGui (64-bit)_2013-01-08_16-29-23_thumb[3]
A function in R is just another object that is assigned to a symbol. You can define your own functions in R, assign them a name, and then call them just like the built-in functions. Writing your function code on the R Console is hard, so R provided a simple text editor for that. To write your code go to File » New Script. This will open the R Editor, enter the following code
RGui (64-bit)_2013-01-10_09-05-56

Introduction to R – Matrix Operations

Operations can be done on matrices in two fashions:

  • Element-wise : where operations performed on corresponding elements in the matrices. Just use the desired operator.

RGui (64-bit)_2013-01-09_13-41-07

  • Matrix-wise: where operations are performed on the whole matrices in the way you used to do in math. Use the desired operator between a couple of % %

RGui (64-bit)_2013-01-09_13-44-44

Stay tuned for more R notes.

Introduction to R – Removing missing values

A common task in preparing you data is to remove missing values(NAs). One way to do that is to retrieve a vector of the missing values in your data, and then filter them out from your structure.
RGui (64-bit)_2013-01-09_13-17-45
If you want to filter out the missing values from more than one vector , you can use complete.cases() to get the indices that contains good data in both vectors.
RGui (64-bit)_2013-01-09_13-25-29
Here good will contain TRUE only for indices that hold good data in both vectors; FALSE otherwise. complete.cases() works with data frames also. In that case it removes any row that contains NA in any column.The returned data frame will not contain any NAs.
Stay tuned for more R notes.

Introduction to R – Importing/Exporting Data to External Files

There are many functions that read/write data in R and export it files

read.table, read.csv for reading tabular data and return it in data frames from delimited files. read.csv is identical to read.table except that default separator is coma. There are so many arguments for these functions, the most commonly used arguments are:

  • file : string –> file name or URL
  • header : logical –> TRUE if the file first line is a header line, FALSE if first line is data.
  • sep : string –> represents the data separator
  • quote “ string –> if character values are enclosed in quotes, this argument should specify the type of quotes.
  • colClasses : string vector –> represent the data tyoe of each column in file.
  • nrows : integer –> the number of rows in file (optional)
  • comment.char : string –> the comment indicator string
  • skip : integer –> number of lines to skip from the file beginning
  • stringsAsFactors : logical –> should character variables be coded as factors?

save the following file into your default user directory

Introduction to R – Getting Started

R is an open source programming language and software environment for statistical computing and graphics. The R language is widely used among statisticians for developing statistical software and data analysis. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and now, R is developed by the R Development Core Team.
To download R and install it on your computer, you can get it at the Comprehensive R Archive Network (http://cran.r-project.org). One option that you may want to explore is RStudio (http://rstudio.org) which is a very nice front-end to R and works on all platforms.
The R System is divided into 2 conceptual parts:

Introduction to R Programming Language

R is an open source programming language and software environment for statistical computing and graphics. The R language is widely used among statisticians for developing statistical software and data analysis. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and now, R is developed by the R Development Core Team. To download R and install it on your computer, you can get it at the Comprehensive R Archive Network (http://cran.r-project.org). One option that you may want to explore is RStudio (http://rstudio.org) which is a very nice front-end to R and works on all platforms.
The R System is divided into 2 conceptual parts:

Basic statistics using Microsoft Excel

Microsoft Excel is a powerful software that have been used my end users and professionals for many years for various purposes. In this post we going to introduce basic statistical features of Excel. This post is using Microsoft Excel 2013, but it is easy to map it to your Excel version.

Basic Formulas

Computations in Excel are carried out using formulas. A formula is a mathematical expression that is used to calculate a value. In Excel, a formula is entered into the active cell by typing an expression. In certain situations, Excel will automatically insert a formula for you.

Microsoft Dynamics CRM 2011 for Developers | Plug-ins

Contents

  1. Introduction
  2. Common Uses of Plug-ins
  3. Plug-ins Basics
    1. Event Framework
    2. Event Execution Pipeline
    3. Pipeline Stages
    4. Message Processing
    5. Inclusion in Database Transactions 
    6. Plug-in Isolation
    7. Trusts
  4. Develop Plug-ins
  5. Register Plug-ins

Introduction

A plug-in is .Net assembly that can be used to intercept events generated from the CRM system. Plug-ins subscribe to a set of events and run when the events occur regardless of how the event raised (or the method that is used to perform the activity that raised the event).

SWAP

Movie Production:
Basic After Effects Training - The best set of free introduction videos for After Effects beginners.
After Effects Tutorials - More great After Effects tutorial videos.
CyberCollege - A free site that goes in-depth into TV production and covers everything, including Directing, Cameras, Lighting, and Audio. It even has quizzes at the bottom to test your knowledge and help you retain what you have learned.
Detonation Films - A site with a lot of effects stock footage that can be easily composited over video for explosions, fire, sparks, etc. They’re all shot either against a blue sky for bluescreen keying or against black for luma keying.
Camcorderinfo.com - One of THE best websites for information and specifications on camcorders. If you’re looking to purchace a camera, check out this site to find extensive reviews and opinions on the latest in video technology.

Microsoft Dynamics CRM 2011 for Developers | Creating Custom Reports Using Microsoft SQL Server 2008 Reporting Services

Contents

  1. Introduction
  2. Setup the Development Environment
  3. Report Development Process
  4. Create Custom Reports Using Business Intelligence Development Studio
    1. Create a Custom SQL-Based Report
    2. Create a Custom Fetch-Based Report
  5. Import Custom Reports into Dynamics CRM

Introduction

Microsoft Dynamics CRM provides many out-of-box reports for viewing business data. You can view a list of reports you have access to by navigating to Workplace > My Work > Reports. You can also see a list of all reports available by navigating to Settings > Customization > Customizations > Customize the System > Report [left navigation]. In both lists, you can select a report and click Run Report from the ribbon to preview the report in running mode.

Microsoft Dynamics CRM 2011 for Developers | Web Resources Part 1

Contents

  1. Introduction
  2. Types of Web Resources
  3. Where can Web Resources be Used ?
  4. Web Resources Limitations
  5. Web Resources Management
  6. Using Web Resources on a Form
  7. Using Web Resources from the Form Navigation 
  8. Using Web Resources on a Dashboard
  9. Using Web Resources Direct from SiteMap  
  10. Using Web Resources as a Solution Configuration Page
  11. Referencing Other Web Resources

Introduction

Web resources are a new feature of Dynamics CRM 2011 that allows storing of client side content in the CRM server database in order to be used for extending the Dynamics CRM web application. That content is then available to be delivered to users as needed during their interaction with the user interface. These resources can be used by URL, which also allows relative path referencing.

Microsoft Dynamics CRM 2011 for Developers | Accessing Microsoft Dynamics CRM 2011 using WCF

Contents

  1. Introduction
  2. Creating a client application
  3. Using the Discovery Service
  4. Using the Organization Service
  5. Working with CRM Data
    1. Late Binding Approach
      1. Using RetrieveMultiple method
      2. Using Retrieve method
      3. Using Update method
      4. Using Delete method
      5. Using Create method
    2. Early binding Approach
      1. generating Client Types
      2. Enable ProxyTypeBehavior
      3. Using RetrieveMultiple method
      4. Using Retrieve method
      5. Using Create method

Introduction

Microsoft Dynamics CRM is a Customer Relationship Management software package developed to focus mainly on Sales, Marketing, and Service (help desk) sectors. The Microsoft Dynamics family of business applications includes other related products such as Microsoft Dynamics AX, Microsoft Dynamics GP, Microsoft Dynamics NAV, and Microsoft Dynamics SL.

JSON–yet another tutorial :)

What is JSON?

JSON (or JavaScript Object Notation) is a highly portable data interchange format. While its structure is recognized natively by Javascript (as it is Javascript), its formatting conventions are easily recognized by other C-like languages.

JSON is built on two structures:

  • A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. Example:
var jason = {  
 "age" : "28",  
 "hometown" : "Cairo, Egypt",  
 "gender" : "male"  
 };

The object created in the example could be accessed like any other object.

An introduction to Microsoft Message Queuing–Part 2

In the previous post, we explored very basic concepts of MSMQ. We used non-transactional queue to send and receive a message. In this post we will try to dive more into Message Queuing Queues.

Simply, queues are logical containers that Message Queuing uses to store and later forward messages, providing the bases for the loosely coupled aspects of Message Queuing. Queues can be created by applications and by Message Queuing. Queues created by applications or by users in an MMC snap-in are referred to as application queues. Queues created by Message Queuing are referred to as system-generated queues (we will talk about system- generated queues in another post).

An introduction to Microsoft Message Queuing

What is MSMQ ? Message Queuing (also known as MSMQ) is a messaging infrastructure and a development tool for creating distributed messaging applications for Microsoft Windows operating systems. Applications developed for Message Queuing send messages to queues, which are temporary storage locations, from which messages can proceed to their final destination as conditions permit.

Installing MSMQ The procedures to install MSMQ on Windows Server 2008, Winows Server 2008 R2, Windows 7, Windows Vista, Windows XP, and Windows Server 2003 are available here

An introduction to jQuery

What is jQuery ? jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

Get jQUery jQuery is licensed under MIT and GPL. You can downlad the latest version from http://docs.jquery.com/Downloading_jQuery. In this post we will use release 1.7.

Getting started

To get started with jQuery, create a folder for our demos. Create a new file in it (e.g. HTMLPage1.htm). Create a folder in it (e.g. Script). Copy the downloaded jquery-1.7.js to it. Now edit your HTML page to look like so:

Asserts in NUnit

Assertions (or asserts for short) are helper methods that can assist us in determining whether a method under test is performing correctly or not. They let us assert conditions, data, and so on. All assertion methods will report failures (that’s when the assertion is false) or errors (that’s when we get an unexpected exception) and report these through the NUnit test runner. when a failure or error occurs, execution of the current test method is aborted. Other Test within the same test fixture will still be run.

Structuring unit tests in NUnit

Our goal in the previous post Introduction to NUnit, was just to introduce the unit testing using NUnit as simple as possible. Now it is the time to elaborate more on NUnit framework, structuring and organizing your test cases. If you examined the test code again:.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }

Introduction to NUnit

What is unit testing?

According to Jeff Canna, unit testing ensures that a particular method of a class successfully performs a set of specific tasks. Each test confirms that a method produces the expected output when given a known input.

What is NUnit? NUnit is an open source framework that facilitates unit testing for all .NET languages. It allows you to build your test cases directly into the code of the project.

Log4net Extended Tutorial

Logging is one of the most effective debugging and troubleshooting techniques although some engineers claim that it is not that helpful or it will slow the application. My experience with it is always positive.

I use log4net from the Apache Software Foundation as my logging layer for .Net applications. log4net is available here as a zip archive.

Hello World Example [uses BasicConfigurator]
  1. Download log4net from here.
  2. Open Visual Studio and create a new Console application project.
  3. Add to the project a reference to the \bin\net\2.0\release\log4net.dll assembly in the log4net distribution.
  4. Modify your Main() method like so:

.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }

How I prepared for CSDP ?

After I became an IEEE Certified Software Development Professional, many of my friends asked me about it and how to prepare for it. As a CSDP holder, let me introduce CSDP for you and how I prepared for it.

The CSDP credential is intended for mid-career software development professionals that want to confirm their proficiency of standard software development practices and advance in their careers.

Who is eligible to take the CSDP?

Business analysis &amp; Requirements Engineering Certifications

I was searching for certifications on requirements engineering and I found that there is a lot of mixing between business analysis and requirements engineering. This mix exists both on the daily use, professional certifications and organizations.

Starting by the definitions:

  • Business analysis is the discipline of identifying business needs and determining solutions to business problems. Solutions often include a systems development component, but may also consist of process improvement, organizational change or strategic planning and policy development. (Kathleen B Hass, Richard Vander Horst, Kimi Ziemski (2008). From Analyst to Leader: Elevating the Role of the Business Analyst Management Concepts, 2008. ISBN 1567262139. p94: “As the discipline of business analysis becomes professionalized”)
  • Requirement engineering according to Laplante is “a sub-discipline of systems engineering and software engineering that is concerned with determining the goals, functions, and constraints of hardware and software systems.”. (Phillip A. Laplante (2007) What Every Engineer Should Know about Software Engineering. ISBN 0849372283 p44)

This may lead us to conclude that business analysis as a discipline has a heavy overlap with requirements engineering, but focuses on identifying the changes to an organization that are required for it to achieve strategic goals. These changes include changes to strategies, structures, policies, processes, and information systems.

How to educate the next generation of software engineers ?

After my completion of my master in software engineering at Nile University which we faced many problems at it (I hope it be better in the future), I tried to search for what globally constitutes a master of software engineering and I found the following:

  • The last effort to create a reference curriculum for graduate software engineering education was by the SEI in the early 1990s.
  • There were, in effect, no current community-endorsed recommendations on what to teach software engineers.
  • Response: create a project to create a new reference curriculum in software engineering (iSSec Project)

The Integrated Software and
Systems Engineering Curriculum iSSec Project

SQL Server Metadata

Many times when you need to troubleshoot an SQL Server issue, you will need to collect metadata about the server, databases, and server resources in general. Here we will briefly review the mechanisms to collect these metadata.

System Base Tables

SQL server maintains a set of tables that store information about all the objects, data types, constraints, configuration options, and resources available to SQL Server. These tables are called the system base tables.

SQL Server Dedicated Administrator Connection

Microsoft SQL Server provides a dedicated administrator connection (DAC) which allows an administrator to access a running instance of SQL Server Database Engine to troubleshoot problems on the server—even when the server is unresponsive to other client connections. The DAC is available through the sqlcmd utility and SQL Server Management Studio. The connection is only allowed from a client running on the server. No network connections are permitted.

To use SQL Server Management Studio with the DAC, connect to an instance of the SQL Server Database Engine with Query Editor by typing ADMIN: before the server name. Object Explorer cannot connect using the DAC.

What is the SWEBOK Guide?

SWEBOK  SWEBOK or Software Engineering Body Of Knowledge is an all-inclusive term that describes the sum of knowledge within the profession of software engineering. Since it is usually not possible to put the full body of knowledge of even an emerging discipline, such as software engineering, into a single document, there is a need for a Guide to the Software Engineering Body of Knowledge. This Guide will seek to identify and describe that subset of the body of knowledge that is generally accepted.

I’m Certified Software Development Professional:CSDP

untitledIt is my pleasure to share with you my recent achievement. Now I’m IEEE Computer Society Certified Software Development Professional CSDP.

The CSDP credential is intended for mid-career software development professionals that want to confirm their proficiency of standard software development practices and advance in their careers.

Certified Software Development Professional should:

  • Possesses fundamental knowledge and understanding of computing principles and concepts and their application to the definition, design, construction, testing of software.
  • Be able to apply design principles with technical and economic tradeoffs to modules, subsystems, and systems in accordance with standards of practice, specifications, and principles of behavior of software as required to perform the functions as stated in the software requirements.
  • Has met the IEEE CS CSDP education, experience, and examination requirements.

How to become an CSDP:

Bugs in the generated code of Repository Factory for Visual Studio 2008

If you are considering using repository factory for visual studio 2008 in your next project, please be aware that it had 2 bugs in code generation. These are in the generated Remove method in the repository classes of the DAL. This happens only if the corresponding table is a bridge table that links two tables together.

If you had simple three tables in your database like the following:

tables

The generated Remove method in User_RoleRepository class will be like the following:

Wisdom of Experts: Programming in vs. Programming into a language

David Gries (1981)  pointed out that “your programming tools don’t have to determine how you think about programming”. He also made a distinction between programming in a language vs. programming into a language.

Programmers who program “in” a language limit their thoughts to constructs that the language directly supports. If the language tools are primitive, the programmers thoughts will be also be primitive.

Programmers who program “into” a language, first decide what thoughts they want to express, and then they determine how to express thoughts using the tools provided by their specific language.

Using Python Scripts with IIS 7

Here are the steps you should make if you want to use python scripts on IIS 7:

  • Please make sure Python is installed properly or refer to Python Notes – 1 : Setup for installation steps.
  • Make sure CGI module is installed in IIS 7.

Control Panel -> Programs -> Program and Features -> Turn Windows features on and off -> Internet Information Services -> World Wide Web Services -> Application Development Features -> CGI module (Ensure that it is selected).

Introduction to Peer-to-Peer Computing

Peer-to-peer (P2P) has become a buzzword that subsumes concepts used in communication technologies, distributed system models, applications, platforms, etc. It is not a particular initiative, nor architecture or specific technology; it rather describes a set of concepts and mechanisms for decentralized distributed computing and direct peer-to-peer information and data interchange.

So, What is Peer-to-Peer Computing ?

There is no one definition of P2P.

  • P2P is a class of applications that takes advantages of resources available at the edges of the internet.
  • The sharing of computer resources and services by direct exchange between systems.
  • In Peer-to-Peer computing, each computer can serve the function of both client and server. Any computer in the network can initiate questions (as a client), receive questions and transmit data (as a server).

We could conclude these definitions by proposing the following definition.

Python Notes 14: Advanced Network Operations

We have explored the usual issues in network programming, both on client side and server side. In this post we will discuss some advanced topics in network programming.

Half-Open Sockets
Normally, sockets are bidirectional—data can be sent across them in both directions. Sometimes, you may want to make a socket be unidirectional so data can only be sent in one direction. A socket that’s unidirectional is said to be a half-open socket. A socket is made half-open by calling shutdown(), and that procedure is irreversible for that socket. Half-open sockets are useful when

Python Notes 13: Network servers

For a client, the process of establishing a TCP connection is a two-step process that includes the creation of the socket object and a call to connect() to establish a connection to the server. For a server, the process requires the following four steps:

  1. Create the socket object.
  2. Set the socket options (optional).
  3. Bind to a port (and, optionally, a specific network card).
  4. Listen for connections.

Example of these steps:

Python Notes 12 : Network clients

After we have explored the basics of network programming in brief in the previous post, we will discuss network clients in more details in this post.

Understanding Sockets
Sockets are an extension to the operating system’s I/O system that enable communication between processes and machines. It can be treated the same as standard files, with the same interface methods so in many cases, a program need not know whether it’s writing data to a file, the terminal, or a TCP connection. While many files are opened with the open () call, sockets are created with the socket () call and additional calls are needed to connect and activate them.

Python Notes 11 : Introduction to Network Programming

Network Overview

Python provides a wide assortment of network support.

  • Low-level programming with sockets (if you want to create a protocol).
  • Support for existing network protocols (HTTP, FTP, SMTP, etc…).
  • Web programming (CGI scripting and HTTP servers).
  • Data encoding

Network Basics: TCP/IP

Python’s networking modules primarily support TCP/IP.

  • TCP - A reliable connection-oriented protocol (streams).
  • UDP - An unreliable packet-oriented protocol (datagrams).

TCP is the most common (HTTP, FTP, SMTP, etc…). Both protocols are supported using “sockets”.

Python Notes – 10 : Threading

Welcome to our tenth note in the Python learning process. In this note we will talk about threading, threads communication and synchronization.

Threads basics

A running program is called a “process”. Each process has memory, list of open files, stack, program counter, etc…. Normally, a process executes statements in a single sequence of control-flow.

The following commands create an entirely new process: fork(),system(), popen(), etc… This child process runs independently of the parent. Has own set of resources. There is minimal sharing of information between parent and child.

Python Notes – 9 : Serialization

Welcome to our ninth note in our Python learning process. We talked previously about files and how to handle it but we talked about writing and reading only the primitive data types as integers and strings. We also talked about objects and classes. Now, what if we want to write a compound data type or a complex object to a file. This note will talk about writing objects to files, which is called object serialization.

Python Notes – 8 : Object-Oriented Basics

Welcome to our eighth note in our Python learning process. This note will talk about object oriented features in Python.

Classes and Objects

A class definition looks like this:

class Point:

    pass

Class definitions can appear anywhere in a program, but they are usually near the beginning (after the import statements). By creating the Point class, we created a new type, also called Point. The members of this type are called instances of the type or objects. Creating a new instance is called instantiation. To instantiate a Point object, we call a function named Point:

Python Notes – 7 : Files &amp; directories

Welcome to our seventh note in our Python learning process. This note will talk specifically about files, directories, and exceptions.

Files

Opening a file creates a file object. Syntax is like that:

>» f = open(“test.dat”,“w”)

>» print f

<open file ’test.dat’, mode ‘w’ at fe820>

The first parameter to open is the file name, the second parameter is the mode. Modes are: w for write, r for read.

To write data in the file we invoke the write method on the file object:

Python Notes – 6 : Tuples &amp; Dictionaries

Welcome to our sixth note in our Python learning process. In this note we will talk about tuples and dictionaries.

Tuples

Tuples are similar to lists but its elements can’t be modified. Syntactically, a tuple is a comma-separated list of values:

>» tuple = ‘a’, ‘b’, ‘c’, ’d’, ’e’

Although it is not necessary, it is conventional to enclose tuples in parentheses:

>» tuple = (‘a’, ‘b’, ‘c’, ’d’, ’e’)

Python Notes – 5 : Objects &amp; Values

Welcome to our fifth note in our Python learning process. In this note we will talk about one of the core concepts of the Python language semantics .

Objects and Values

An object is something a variable can refer to. Every object has a unique identifier, which we can obtain with the id function.

>» a = “banana”

>» b = “banana”

>» id(a)

135044008

>» id(b)

135044008

Interestingly, lists behave differently. When we create two lists, we get two

Python Notes – 4 : Lists

Welcome to our third note in our Python learning process. In this note we will talk mainly about lists, its functions and how to use it.

Lists - Creation

A list is an ordered set of values, where each value is identified by an index. The values that make up a list are called its elements. You could create it like:

>» X = [12, 56, 87]

>» print X

[12, 56, 87]

Python Notes – 3 : Control Statements

Welcome to our third note in our Python learning process. In this note we will talk about conditional statements, iteration and keyboard input.

Conditional Statements

The normal flow of statements execution is sequential where the interpreter executes the statements in the same sequence that it appears in the script. If your program logic requires a different flow than the that, you should use conditional statements. The syntax looks like:

if x%2 == 0:

Python Notes – 2 : Variables, Statements, Expressions, Operators, and Functions

Welcome to our second note in our Python learning process. In this note we will talk about variables, statements, expressions, operators, comments, and functions. These are the very basic building blocks of you programs whatever its final size

Variables

The assignment statement creates new variables and gives them values

>» message = “What’s up, Doc?”

>» n = 17

>» pi = 3.14159

Python is a dynamically typed language. Which means that variables’ types don’t have to be defined before the variables use. The python interpreter figure out what type a variable is when you first assign it a value.

Python Notes – 1 : Setup

I write this notes about Python during my learning process of it. I’m not an expert in Python. I’m just writing this notes while I learn Python aiming to help others who are learning it too. Never hesitate to comment on anything you want.

Origins of Python

  • Developed by Guido van Rossum.
  • Derived from ABC, a teaching language that was developed in 1980s.

Why Pyhton ?

  • Python code is pretty simple, compact and easy to learn.
  • Code simplicity let you focus on the core program functionality.
  • Suitable for programming languages introductory courses.
  • Provides a balance between the practical and the conceptual. You start writing after the first tutorial; and if you want to go further in advanced topics you will find a large library of modules that can be used to do all sorts of tasks ranging from web-programming to graphics.
  • Python borrows features from both functional programming languages and object-oriented programming languages, which enables it to serve as an excellent foundation for introducing important computer science concepts.
  • Python allow you to see higher level of success and a lower level of frustration :)

How to setup Python ?

Python is free downloadable from many source, and it have also many IDEs and editors. Aiming to start coding quickly without wasting time in IDE exploration, setup, configuration problems; we will use just the ActivePython. Let’s see how to do that:

Type checking in programming languages

To discuss type checking in programming languages we have to define type checking. Simply,Type checking is how type errors are checked.

Type checking could happen at compile-time or at run-time. When type checking happens at the compile-time it is called Static Type Checking. When type checking happens at the run-time it is called Dynamic Type Checking.

Programming Languages differs in

  • when they check types.
  • Were it enforces types or not.

Based on these two factors, programming languages could be classified from the type checking perspective into the following classes:

Introduction to Mining Software Engineering Data

Tao Xie | North Carolina State University | xie@csc.ncsu.edu

Ahmed E. Hassan | University of Victoria | ahmed@uvic.ca

Part I

Mining Software Engineering Data goals:

  • Transform static record-keeping SE data to active data.
  • Make SE data actionable by uncovering hidden patterns and trends.

Uses of mining SE data:

  • Gain empirically-based understanding of software development.
  • Predict, plan, and understand various aspects of a project.
  • Support future development and project management activities.

clip_image001

Types of SE Data:

Center of Innovation & Competitiveness (INCOM) - Nile University

Nile University Center for Innovation and Competitiveness (NU/INCOM) is primarily focused on identifying, researching and promoting innovation practices that have improved competitiveness at the company, industry and country levels, with special emphasis on Egypt and the MENA region. Innovation is one of the most important competitive priorities in firms and in nations, and it is a major driving force for change in today’s world. It is critical in the formulation of successful manufactoring strategies for nations, at the micro and macro levels, and in enhancing their economic development and global market positioning. Innovation guides any business, small, medium or large, in its ability to successfully compete in the global market, thus impacting the international competitiveness of firms and nations.

Bug Counts vs. Test Coverage

What to Do When Bug Counts Don’t Speak for Themselves?

Bug counts on a project speak volumes about the quality of testing for a particular product and how vigorous the test team is working to “assure quality.” Bug counts are invariably a primary area of test metrics that are reported to management. What is the rationale behind drawing so much attention to the number of bugs being found through the course of a project?
I have heard it said that QE’s job is to find bugs. If this is the assumption of management, bug counts will be an important indicator to them that QE is doing its job. They expect to see bug counts rise dramatically in the early stages of testing, and they expect to see the find rate decrease as the project comes to an end. These are management’s statistical expectations when they believe bug counts are a metric to assess quality of testing.
If high bug counts, then, are an indicator that quality is going up, low bug counts can be seen as an indicator that something just isn’t right with the testing process. Management might imagine different problems that are preventing bugs from being found:

7 Habits of Highly Insecure Software

Habit # 1: Poorly Constrained Input

By far, the number one cause of security vulnerabilities in software stems from the failure to properly constrain input. The most infamous security vulnerability resulting from this habit is the buffer overflow. Buffer overflows happen when application developers use languages (like C and C++) that allow them to allocate a fixed amount of memory to hold some user-supplied data. This usually doesn’t present a problem when input is properly constrained or when input strings are of the length that developers expected. When data makes it past these checks, though, it can overwrite space in memory reserved for other data, and in some cases force commands in the input string to be executed. Other unconstrained input can cause problems, too, like escape characters, reserved words, commands, and SQL (Structured Query Language) statements.

ICT Centers in Egypt

I have wondered so many times. Do we have research and development centers for the IT industry in Egypt ?
Then question become wider; what are the ICT centers do we have in Egypt ?

During my search and my experince I have found many centers in egypt working in relation to the communications and Information Technology.

And here what I got:

· Data Mining and Computer Modeling Center [MCIT]
· Wireless Communication and Electronic Design Center [MCIT]
· Cairo Microsoft Innovation Center (CMIC) [Microsoft]
· Center for Wireless Intelligent Networks (WINC) [Nile University ]
· Center for Informatics Science (CIS) [Nile Univerity]
· Center for Innovation & Competitiveness (CIC) [Nile Univerity]
· Orange Labs R&D http://www.orange.com/en_EN/finance/news/cp071204en1.html
· CISCO - Core competency e-learning institute
· ZTE & Huwaei – Wi-Max R&D centers
· Center for Advanced Studies [IBM] http://www.mcit.gov.eg/PressreleaseDetailes.aspx?id=RxuKovZSBhw=
· Nanotechnology Center [IBM] http://www.mcit.gov.eg/NewsDetails.aspx?id=1ewQtSMf+gs=
· Regional Platform Definition Center [Intel]
· Regional Software Enablement Lab [Intel]
· Developer Support Center for Regional Developers [Microsoft]

What Great .NET Developers Ought To Know [Answers]

Everyone who writes code

  • Describe the difference between a Thread and a Process?
  • What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
  • What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
  • What is the difference between an EXE and a DLL?
  • What is strong-typing versus weak-typing? Which is preferred? Why?
  • Corillian’s product is a “Component Container.” Name at least 3 component containers that ship now with the Windows Server Family.
  • What is a PID? How is it useful when troubleshooting a system?
  • How many processes can listen on a single TCP/IP port?
  • What is the GAC? What problem does it solve ?

Mid-Level .NET Developer