public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     WriteAndReadToDisk(
         logger,
         parameters.GetValue<int>(0),
         parameters.GetValue<long>(1));
 }
 public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     RequestRiverBedHomePageMultiThreaded(
         logger,
         parameters.GetValue<int>(0),
         parameters.GetValue<int>(1));
 }
 public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     SumNumbersInArray(
         logger,
         parameters.GetValue<long>(0),
         parameters.GetValue<int>(1));
 }
Example #4
0
 public Value ToNumber( List Arguments )
 {
     Value value = Arguments.GetValue( 0 );
     if ( value is Number )
     {
         return value as Number;
     }
     if ( value is String )
     {
         return new Number( double.Parse( ( value as String ).Val ) );
     }
     if ( value is Boolean )
     {
         return new Number( ( value as Boolean ).Val ? 1 : 0 );
     }
     return NoValue.Value;
 }
        public virtual void SignIn(User user, bool isPersistant = false)
        {
            Tracing.Information(String.Format("[ClaimsBasedAuthenticationService.Signin] called: {0}", user.Username));

            if (String.IsNullOrWhiteSpace(user.Username)) throw new ArgumentException("username");

            // gather claims
            var claims = new List<Claim>();
            foreach (UserClaim uc in user.Claims)
                claims.Add(new Claim(uc.Type, uc.Value));

            if (!String.IsNullOrWhiteSpace(user.Email))
            {
                claims.Insert(0, new Claim(ClaimTypes.Email, user.Email));
            }
            claims.Insert(0, new Claim(ClaimTypes.AuthenticationMethod, AuthenticationMethods.Password));
            claims.Insert(0, new Claim(ClaimTypes.AuthenticationInstant, DateTime.UtcNow.ToString("s")));
            claims.Insert(0, new Claim(ClaimTypes.Name, user.Username));
            claims.Insert(0, new Claim(ClaimTypes.NameIdentifier, user.Username));

            // create principal/identity
            var id = new ClaimsIdentity(claims, "Forms");
            var cp = new ClaimsPrincipal(id);

            // claims transform
            cp =
                FederatedAuthentication.FederationConfiguration.IdentityConfiguration.ClaimsAuthenticationManager
                    .Authenticate(String.Empty, cp);

            // issue cookie
            var sam = FederatedAuthentication.SessionAuthenticationModule;
            if (sam == null)
                throw new Exception("SessionAuthenticationModule is not configured and it needs to be.");

            var token = new SessionSecurityToken(cp,
                isPersistant
                    ? FormsAuthentication.Timeout
                    : TimeSpan.FromMinutes(SessionHelpers.GetSessionTimeoutInMinutes))
            {
                IsPersistent = isPersistant
            };
            sam.WriteSessionTokenToCookie(token);

            Tracing.Verbose(String.Format("[ClaimsBasedAuthenticationService.Signin] cookie issued: {0}",
                claims.GetValue(ClaimTypes.NameIdentifier)));
        }
 public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     RequestRiverBedHomePageAsync(
         logger,
         parameters.GetValue<int>(0));
 }
 public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     SendTcpTraffic(
         logger,
         parameters.GetValue<string>(0),
         parameters.GetValue<int>(1),
         parameters.GetValue<string>(2),
         parameters.GetValue<int>(3),
         parameters.GetValue<int>(4),
         parameters.GetValue<int>(5));
 }
 public void Execute(IMethodLogger logger, List<SamplerMethodParameter> parameters)
 {
     AllocateObjects(logger, parameters.GetValue<long>(0));
 }
        public List<SHSubjectSemesterScoreInfo> SortSHSubjectSemesterScore(List<SHSubjectSemesterScoreInfo> firstSemesterSubjectScoreInfo, List<SHSubjectSemesterScoreInfo> secondSemesterSubjectScoreInfo)
        {
            SHSubjectSemesterScoreInfo[] byteSecondSemesterSubjectScoreInfo = new List<SHSubjectSemesterScoreInfo>().ToArray();
            if (secondSemesterSubjectScoreInfo != null && secondSemesterSubjectScoreInfo.Count>0)
                byteSecondSemesterSubjectScoreInfo = secondSemesterSubjectScoreInfo.ToArray();

            List<SHSubjectSemesterScoreInfo> reSortedSecondSemesterSubjectScoreInfo = new List<SHSubjectSemesterScoreInfo>();

            if ((firstSemesterSubjectScoreInfo == null || firstSemesterSubjectScoreInfo.Count == 0) && (secondSemesterSubjectScoreInfo == null || secondSemesterSubjectScoreInfo.Count == 0))
                return new List<SHSubjectSemesterScoreInfo>();

            if (secondSemesterSubjectScoreInfo == null || secondSemesterSubjectScoreInfo.Count == 0)
                return firstSemesterSubjectScoreInfo;

            if (firstSemesterSubjectScoreInfo == null || firstSemesterSubjectScoreInfo.Count == 0)
                return secondSemesterSubjectScoreInfo;

            int j = 0;
            SHSubjectSemesterScoreInfo s2 = new SHSubjectSemesterScoreInfo();
            foreach (SHSubjectSemesterScoreInfo s1 in firstSemesterSubjectScoreInfo)
            {
                bool found = false;
                for (int i = 0; i < (byteSecondSemesterSubjectScoreInfo.Length - j); i++)
                {
                    s2 = (byteSecondSemesterSubjectScoreInfo.GetValue(i) as SHSubjectSemesterScoreInfo);

                    if ((s1.SubjectName.Trim() == s2.SubjectName.Trim()) && (s1.GradeYear.HasValue && s2.GradeYear.HasValue && s1.GradeYear == s2.GradeYear))
                    {
                        found = true;

                        reSortedSecondSemesterSubjectScoreInfo.Add(s2);
                        byteSecondSemesterSubjectScoreInfo.SetValue(byteSecondSemesterSubjectScoreInfo.GetValue((byteSecondSemesterSubjectScoreInfo.Length - 1 - j)), i);
                        byteSecondSemesterSubjectScoreInfo.SetValue(s2, (byteSecondSemesterSubjectScoreInfo.Length - 1 - j));

                        j++;
                    }
                }
                if (!found)
                {
                    SHSubjectSemesterScoreInfo _SHSubjectSemesterScoreInfo = new SHSubjectSemesterScoreInfo();

                    _SHSubjectSemesterScoreInfo.SubjectName = string.Empty;
                    _SHSubjectSemesterScoreInfo.StudentID = s2.StudentID;
                    _SHSubjectSemesterScoreInfo.Semester = s2.Semester;
                    _SHSubjectSemesterScoreInfo.Score = null;
                    _SHSubjectSemesterScoreInfo.SchoolYearAdjustScore = null;
                    _SHSubjectSemesterScoreInfo.SchoolYear = s2.SchoolYear;
                    _SHSubjectSemesterScoreInfo.RequiredBy = string.Empty;
                    _SHSubjectSemesterScoreInfo.Required = null;
                    _SHSubjectSemesterScoreInfo.ReExamScore = null;
                    _SHSubjectSemesterScoreInfo.ReCourseScore = null;
                    _SHSubjectSemesterScoreInfo.Pass = null;
                    _SHSubjectSemesterScoreInfo.NotIncludedInCredit = null;
                    _SHSubjectSemesterScoreInfo.NotIncludedInCalc = null;
                    _SHSubjectSemesterScoreInfo.ManualScore = null;
                    _SHSubjectSemesterScoreInfo.Level = null;
                    _SHSubjectSemesterScoreInfo.Entry = string.Empty;
                    _SHSubjectSemesterScoreInfo.Credit = null;
                    _SHSubjectSemesterScoreInfo.CoreSubject = false;
                    _SHSubjectSemesterScoreInfo.Comment = string.Empty;
                    _SHSubjectSemesterScoreInfo.GradeYear = null;
                    _SHSubjectSemesterScoreInfo.ProSubject = false;

                    reSortedSecondSemesterSubjectScoreInfo.Add(_SHSubjectSemesterScoreInfo);
                }
            }
            for (int i = 0; i < (byteSecondSemesterSubjectScoreInfo.Length - j); i++)
            {
                reSortedSecondSemesterSubjectScoreInfo.Add(byteSecondSemesterSubjectScoreInfo[i]);
            }
            return reSortedSecondSemesterSubjectScoreInfo;
        }