예제 #1
0
 public void startOriginalWork(String [,,] globalArray, bool semesterCheck)
 {
     for (int dayNum = 1; dayNum <= 5; dayNum++)       //  traversal of 5 days
     {
         if (dayNum == 1)
         {
             mondaySetClasses(dayNum, FLP1, monday, semesterCheck, globalArray);
         }
         else if (dayNum == 2)
         {
             mondaySetClasses(dayNum, FLP2, tuesday, semesterCheck, globalArray);
         }
         else if (dayNum == 3)
         {
             mondaySetClasses(dayNum, FLP3, wednesday, semesterCheck, globalArray);
         }
         else if (dayNum == 4)
         {
             mondaySetClasses(dayNum, FLP4, thursday, semesterCheck, globalArray);
         }
         else
         {
             mondaySetClasses(dayNum, FLP5, friday, semesterCheck, globalArray);
         }
     }
 }
예제 #2
0
        public virtual String[] SendArraysString(String[,] arr2, String[,,] arr3, String[,,,] arr4)
        {
            BSyncResult <String[]> asyncResult = new BSyncResult <String[]>();

            SendArraysString(arr2, arr3, arr4, BAsyncResultHelper.ToDelegate <String[]>(asyncResult));
            return(asyncResult.GetResult());
        }
예제 #3
0
        public override void write(Object obj1, BOutput bout1, long version)
        {
            BOutputBin bout = (BOutputBin)bout1;
            BBufferBin bbuf = bout.bbuf;

            String[,,] arr = (String[, , ])obj1;

            // lengths
            int n2 = arr.GetLength(0);
            int n1 = arr.GetLength(1);
            int n0 = arr.GetLength(2);

            bbuf.putLength(n2);
            bbuf.putLength(n1);
            bbuf.putLength(n0);

            // write
            for (int i2 = 0; i2 < n2; i2++)
            {
                for (int i1 = 0; i1 < n1; i1++)
                {
                    for (int i0 = 0; i0 < n0; i0++)
                    {
                        bbuf.putString(arr[i2, i1, i0]);
                    }
                }
            }
        }
예제 #4
0
 static void Test3()
 {
     String[,,] s1 = { { { "aaa", "bbb", "ccc" }, { "ddd", "eee", "fff" } }, { { "aa", "bb", "cc" }, { "dd", "ee", "ff" } } };
     foreach (string s in s1)
     {
         Console.WriteLine(s);
     }
 }
예제 #5
0
        public virtual void SendArraysString(String[,] arr2, String[,,] arr3, String[,,,] arr4, BAsyncResult <String[]> asyncResult)
        {
            BRequest_RemoteArrayTypes23_sendArraysString req = new BRequest_RemoteArrayTypes23_sendArraysString();

            req.arr2Value = arr2;
            req.arr3Value = arr3;
            req.arr4Value = arr4;
            transport.sendMethod(req, asyncResult);
        }
예제 #6
0
        // checkpoint byps.gen.cs.GenRemoteStub:133
        public async Task <String[]> SendArraysStringAsync(String[,] arr2, String[,,] arr3, String[,,,] arr4)
        {
            BRequest_RemoteArrayTypes23_sendArraysString req = new BRequest_RemoteArrayTypes23_sendArraysString();

            req.arr2Value = arr2;
            req.arr3Value = arr3;
            req.arr4Value = arr4;
            Task <String[]> task = Task <String[]> .Factory.FromAsync(transport.BeginSend <String[]>, transport.EndSend <String[]>, req, null);

            return(await task);
        }
예제 #7
0
        private void open_Click(object sender, EventArgs e)
        {
            flowLayoutPanel1.Controls.Clear(); //to remove all controls (for reset button)
            flowLayoutPanel2.Controls.Clear(); //to remove all controls (for reset button)
            flowLayoutPanel3.Controls.Clear(); //to remove all controls (for reset button)
            flowLayoutPanel4.Controls.Clear(); //to remove all controls (for reset button)
            flowLayoutPanel5.Controls.Clear(); //to remove all controls (for reset button)



            if (!checkInitialValues())             //  checks all values filled correctly by the user
            {
                return;
            }

            int timehours = calculateTimeHours();       //  no. of classes (hours)

            label4.Left = ((Convert.ToInt32(timehours) + 1) * 160);
            label7.Top  = (Convert.ToInt32(rooms.Value) * 24 * 7);

            flowLayoutPanel1.Top = (Convert.ToInt32(rooms.Value) * 23);
            flowLayoutPanel2.Top = (Convert.ToInt32(rooms.Value) * 23 * 2);
            flowLayoutPanel3.Top = (Convert.ToInt32(rooms.Value) * 23 * 3);
            flowLayoutPanel4.Top = (Convert.ToInt32(rooms.Value) * 23 * 4);
            flowLayoutPanel5.Top = (Convert.ToInt32(rooms.Value) * 23 * 5);
            buildInitialGUI("Monday", timehours);
            buildInitialGUI("Tuesday", timehours);
            buildInitialGUI("Wednesday", timehours);
            buildInitialGUI("Thursday", timehours);
            buildInitialGUI("Friday", timehours);


            dayArray = new String[5, Convert.ToInt32(rooms.Value) + 1, timehours + 1];
            for (int a = 0; a < 5; a++)
            {
                for (int b = 1; b < Convert.ToInt32(rooms.Value) + 1; b++)
                {
                    for (int c = 1; c < timehours + 1; c++)
                    {
                        dayArray[a, b, c] = "null";
                    }
                }
            }


            bECF = new BackEndClashFree(Convert.ToInt32(rooms.Value), timehours, flowLayoutPanel1, flowLayoutPanel2, flowLayoutPanel3, flowLayoutPanel4, flowLayoutPanel5, dayArray);

            bECF.printGlobalArray(dayArray);
        }
예제 #8
0
        public void printGlobalArray(String [,,] globalArray)
        {
            Console.Write("\n\n\t\t\t\tGlobal Array\n\n");

            for (int a = 0; a < 5; a++)
            {
                Console.Write("\n\t\t\t" + a + 1 + "\n");
                for (int b = 1; b < rooms + 1; b++)
                {
                    for (int c = 1; c < timeHours + 1; c++)
                    {
                        Console.Write(globalArray[a, b, c] + ",   ");
                    }
                    Console.Write("\n");
                }
            }
        }
예제 #9
0
 public static void Process3DArray(String[,,] a)
 {
     for (int i = 0; i < size; i++)
     {
         for (int j = 0; j < size; j++)
         {
             double temp = Convert.ToDouble(a[i, size, j]);
             temp += Convert.ToDouble(a[0, size, j]) + Convert.ToDouble(a[1, size, j]);
             temp *= Convert.ToDouble(a[i, size, j]) + Convert.ToDouble(a[2, size, j]);
             temp -= Convert.ToDouble(a[i, size, j]) * Convert.ToDouble(a[3, size, j]);
             temp /= Convert.ToDouble(a[i, size, j]) + Convert.ToDouble(a[4, size, j]);
             for (int k = 5; k < size; k++)
             {
                 temp += Convert.ToDouble(a[k, size, j]);
             }
             a[i, size, j] = Convert.ToString(temp);
         }
     }
 }
예제 #10
0
    public static void Init3DMatrix(String[,,] m, String[][] refm)
    {
        int i, j;

        i = 0;
        double temp;

        while (i < size)
        {
            j = 0;
            while (j < size)
            {
                temp          = GenerateDbl();
                m[i, size, j] = Convert.ToString(temp - 60);
                refm[i][j]    = Convert.ToString(temp - 60);
                j++;
            }
            i++;
        }
    }
예제 #11
0
파일: stringarr.cs 프로젝트: yukozh/coreclr
    public static void InnerProduct3D(out String res, String[,,] a, String[,,] b, int row, int col)
    {
        int i;

        res = "";

        int temp1, temp2, temp3;

        temp3 = 0;

        i = 0;
        while (i < size)
        {
            temp1 = Convert.ToInt32(a[row, 0, i]);
            temp2 = Convert.ToInt32(b[i, 0, col]);
            temp3 = temp3 + temp1 * temp2;
            res   = Convert.ToString(temp3);
            i++;
        }
    }
예제 #12
0
파일: stringarr.cs 프로젝트: yukozh/coreclr
    public static void Init3DMatrix(String[,,] m, String[][] refm)
    {
        int i, j, temp;

        i = 0;

        while (i < size)
        {
            j = 0;
            while (j < size)
            {
                temp       = rand.Next();
                temp       = temp - (temp / 120) * 120 - 60;
                m[i, 0, j] = Convert.ToString(temp);
                refm[i][j] = Convert.ToString(temp);
                j++;
            }
            i++;
        }
    }
예제 #13
0
 //Draw the track based on the completetrack 3d string array
 public static void DrawTrackComponentWithCompleteTrackArray(String[,,] completeTrack, List <SectionBuildingDetails> detail)
 {
     for (int y = 0; y < GetHighestYValue(detail); y++)
     {
         for (int k = 0; k < 4; k++)
         {
             for (int x = 0; x < GetHighestXValue(detail); x++)
             {
                 if (completeTrack[y, x, k] == null)
                 {
                     Console.Write("    ");
                 }
                 else
                 {
                     Console.Write(completeTrack[y, x, k]);
                 }
             }
             Console.WriteLine();
         }
     }
     Console.WriteLine($"Current highest points: {Data.Competition.DriverPoints.GetHighest()}");
 }
예제 #14
0
        public ProductImageCollection(int ProductID, string ImageFileNameOverride, string SKU, int SkinID, string Locale, string Colors)
        {
            _ProductID             = ProductID;
            _SkinID                = SkinID;
            _Locale                = Locale;
            _ImageFileNameOverride = ImageFileNameOverride;
            _SKU = SKU;


            _ColorIndex = new Dictionary <string, int>();
            String[] colorArray;
            _ColorIndex.Add(String.Empty, 0);

            if (Colors != "")
            {
                colorArray = Colors.Split(',');
                for (int i = 0; i < colorArray.Length; i++)
                {
                    _ColorIndex.Add(AppLogic.RemoveAttributePriceModifier(colorArray[i]), i + 1);
                }
            }
            int colorInt;

            _ImageArray = new String[3, _ColorIndex.Count, 11];
            foreach (ImageSize sz in Enum.GetValues(typeof(ImageSize)))
            {
                foreach (String key in _ColorIndex.Keys)
                {
                    colorInt = _ColorIndex[key];
                    for (int i = 0; i < 11; i++)
                    {
                        _ImageArray[(int)sz, colorInt, i] = GetImage(sz, key, i);
                    }
                }
            }
        }
예제 #15
0
 public void export1(String[,,] globalArray)
 {
 }
예제 #16
0
        /*
         * public BackEndClashFree (int rm, int th, FlowLayoutPanel p1, FlowLayoutPanel p2, FlowLayoutPanel p3, FlowLayoutPanel p4, FlowLayoutPanel p5)
         * public void startOriginalWork ()        //  5 day traversal
         * public void proceedFurthure (int num, FlowLayoutPanel flowLayoutPanel, String [,] dayArray)
         *
         *
         *
         * public void refresh ()                                      //  to refresh the flow layout panel
         * public void print(int num)                                  //  num shows number of day
         */
        public BackEndClashFree(int rm, int th, FlowLayoutPanel p1, FlowLayoutPanel p2, FlowLayoutPanel p3, FlowLayoutPanel p4, FlowLayoutPanel p5, String [,,] globalArray)
        {
            rooms     = rm;
            timeHours = th;
            FLP1      = p1;
            FLP2      = p2;
            FLP3      = p3;
            FLP4      = p4;
            FLP5      = p5;

            monday    = new String[rooms + 1, timeHours + 1];
            tuesday   = new String[rooms + 1, timeHours + 1];
            wednesday = new String[rooms + 1, timeHours + 1];
            thursday  = new String[rooms + 1, timeHours + 1];
            friday    = new String[rooms + 1, timeHours + 1];
            for (int a = 1; a < rooms + 1; a++)
            {
                for (int b = 1; b < timeHours + 1; b++)
                {
                    monday[a, b]    = "null";
                    tuesday[a, b]   = "null";
                    wednesday[a, b] = "null";
                    thursday[a, b]  = "null";
                    friday[a, b]    = "null";
                }
            }

            sem_1and2_Courses   = db.getSemWiseCourses(1, 2);
            sem_3and4_Courses   = db.getSemWiseCourses(3, 4);
            sem_5and6_Courses   = db.getSemWiseCourses(5, 6);
            sem_7and8_Courses   = db.getSemWiseCourses(7, 8);
            sem_9and10_Courses  = db.getSemWiseCourses(9, 10);
            sem_11and12_Courses = db.getSemWiseCourses(11, 12);

            allDetailedCourses = db.getAllCoursesWithoutLabs();
            //     allDetailedCourses = allDetailedCourses.OrderBy(o => o.course.semester).ToList();


            change();


            startOriginalWork(globalArray, true);
            startOriginalWork(globalArray, false);
            //    startOriginalWork(globalArray, false);


            for (int zx = 1; zx < 6; zx++)
            {
                print(zx);
            }
            printArray(monday);

            printRemainingCourses();
        }
예제 #17
0
        public void mondaySetClasses(int num, FlowLayoutPanel flowLayoutPanel, String[,] dayArray, bool semesterCheck, String [,,] globalArray)
        {
            for (int x = 0; x < allDetailedCourses.Count; x++)           //  all course list traversal
            {
                bool checkDay1 = getDayBool(num, allDetailedCourses[x]); //  check that class has set on this day or not

                if (allDetailedCourses[x].remainingC_Hours != 0 && checkDay1 == false && semesterCheck)
                {
                    if (num == 1 || num == 3)
                    {
                        if (allDetailedCourses[x].course.semester == 1 || allDetailedCourses[x].course.semester == 2 || allDetailedCourses[x].course.semester == 5 || allDetailedCourses[x].course.semester == 6 || allDetailedCourses[x].course.semester == 9 || allDetailedCourses[x].course.semester == 10 || allDetailedCourses[x].course.semester == 11 || allDetailedCourses[x].course.semester == 12)
                        {
                            alot(num, flowLayoutPanel, dayArray, x, globalArray);
                        }
                    }

                    else if (num == 2 || num == 4)
                    {
                        if (allDetailedCourses[x].course.semester == 3 || allDetailedCourses[x].course.semester == 4 || allDetailedCourses[x].course.semester == 7 || allDetailedCourses[x].course.semester == 8 || allDetailedCourses[x].course.semester == 9 || allDetailedCourses[x].course.semester == 10 || allDetailedCourses[x].course.semester == 11 || allDetailedCourses[x].course.semester == 12)
                        {
                            alot(num, flowLayoutPanel, dayArray, x, globalArray);
                        }
                    }
                    else if (num == 5)
                    {
                        if (allDetailedCourses[x].course.semester <= 12 && allDetailedCourses[x].course.semester >= 1)
                        {
                            alot(num, flowLayoutPanel, dayArray, x, globalArray);
                        }
                    }
                }
                if (semesterCheck == false && allDetailedCourses[x].remainingC_Hours != 0)
                {
                    alot(num, flowLayoutPanel, dayArray, x, globalArray);
                }



                //    Console.Write("\n");
            }
        }
예제 #18
0
        public void alot(int num, FlowLayoutPanel flowLayoutPanel, String[,] dayArray, int x, String [,,] globalArray)
        {
            //    Console.Write("\n"+x+") "+allDetailedCourses[x].course.courseName);
            if (traverseSlots(allDetailedCourses[x], dayArray))
            {
                dayArray[row, col] = allDetailedCourses[x].course.courseCode;
                globalArray [num - 1, row, col] = allDetailedCourses[x].course.courseCode;
                //   allDetailedCourses[x].monday = true;
                setDayBool(num, x, true);
                allDetailedCourses[x].remainingC_Hours--;

                updateButton(flowLayoutPanel, row, col, allDetailedCourses[x].course.courseName + " (" + allDetailedCourses[x].course.section + ")", allDetailedCourses[x].course.semester);
                flowLayoutPanel.Refresh();
                //    Console.Write("\t\t(" + row + ", " + col + ")\n");

                int rowCheck  = 1;  //  to check, that we have more row (rooms) in current time slot
                int saveIndex = x;
                while (true)
                {
                    if ((row + rowCheck) < (rooms + 1))  //  if next room available in same col
                    {
                        //     Console.Write("yes   ");
                        int indexList = findAnyPreOrPostReqCourseIndex(num, allDetailedCourses[saveIndex].course);

                        if (indexList != -1 && isTeacherClash(col, allDetailedCourses[indexList], dayArray) == false && isStudentClash(col, allDetailedCourses[indexList], dayArray) == false)              //  b=col to check clashes
                        {
                            saveIndex = indexList;
                            dayArray[row + rowCheck, col]             = allDetailedCourses[indexList].course.courseCode;
                            globalArray[num - 1, row + rowCheck, col] = allDetailedCourses[indexList].course.courseCode;
                            //         allDetailedCourses[indexList].monday = true;
                            setDayBool(num, indexList, true);
                            allDetailedCourses[indexList].remainingC_Hours--;
                            //    Console.Write("\tSet");

                            updateButton(flowLayoutPanel, row + rowCheck, col, allDetailedCourses[indexList].course.courseName + " (" + allDetailedCourses[indexList].course.section + ")", allDetailedCourses[indexList].course.semester);
                            flowLayoutPanel.Refresh();
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        //      Console.WriteLine("\tNo more rooms");
                        break;
                    }
                    rowCheck++;
                    //       Console.Write("\n");
                }
                //      Console.Write("\n");
            }
        }