[Solved] Need Someone That Can Read This VBA Script! Fairly Simple [closed]

Public Sub MakeColumnsFromRows() Dim totalCutsToMake As Integer Dim currentColumn As Integer Dim currentCut As Integer Dim rowsToCut As Integer Sheets(4).Activate rowsToSkip = 10 totalCutsToMake = (ActiveSheet.UsedRange.Rows.Count / rowsToSkip) currentColumn = 1 Dim RowCount As Integer For currentCut = 1 To totalCutsToMake RowCount = Cells(Rows.Count, currentColumn).End(xlUp).Row Range(Cells(rowsToSkip + 1, currentColumn), Cells(RowCount, currentColumn + 2)).Select Selection.Cut Cells(1, … Read more

[Solved] Unit Testing with ForEach [closed]

There is probably a lot you could do, but the first thing to do would be to make it more readable. Perhaps something like this: var nullActivities = from p in partnerList from t in p.Tenants let activity = agent.GetShopActivity(t, startDate, endDate) where activity == null select activity; Assert.Empty(nullActivities); Moreover: you may want to think … Read more

[Solved] You are given an array consisting of n integers. Print the last two digits of the product of its array values [duplicate]

You can try this (it’s version of Python3): n = int(input()) arr = list(map(int, input().rstrip().split())) result = 1 for num in arr: result = (result * num) % 100 print(“{:02d}”.format(result)) A little bit modify for better algorithm: n = int(input()) arr = list(map(int, input().rstrip().split())) result = 1 for num in arr: result = (result * … Read more

[Solved] Python List of Dictionaries by Loops

If you want only print the resulting dictionaries, uncomment the print statement (and comment the following 2). d1 = [ {‘index’:’1′,’color’:’red’}, {‘index’:’2′,’color’:’blue’}, {‘index’:’3′,’color’:’green’} ] d2 = [ {‘device’:’1′,’name’:’x’}, {‘device’:’2′,’name’:’y’}, {‘device’:’3′,’name’:’z’} ] result_list = [] for dict1 in d1: merged_dict = dict1.copy() for dict2 in d2: merged_dict.update(dict2) # print(merged_dict) result_list.append(merged_dict.copy()) print(result_list) The result: [{‘name’: ‘x’, ‘device’: … Read more