As part of a project I’m working on I need to create a cross join of users against symbols; the idea being that any of the given users might look at any of the given symbols. I have a list of users and a list of symbols which I essentially need a cross-join on.
For this example I’ll use cars and engine/transmission variants.
From these two lists I need to quickly create all possible combinations;
I can’t find any function that will do what I was so I’ve created a VBA function that will do it;
Function CrossJoin(r1 As Range, r2 As Range) As Variant
Dim size As Integer
Dim arr As Variant
Dim offset As Integer
size = r1.Rows.Count * r2.Rows.Count
ReDim arr(0 To size, 0 To 1)
offset = 0
For i = 1 To r1.Rows.Count
For j = 1 To r2.Rows.Count
arr(offset, 0) = r1.Cells(i, 1).Value2
arr(offset, 1) = r2.Cells(j, 1).Value2
offset = offset + 1
CrossJoin = arr
To use the function select and empty cell and insert =CROSSJOIN(A1:A4, B1:B4) (adjusting the input range as required) then when the function has evaluated extend the range to the size of the expected cross join. (in this case 16x2).
To calculate the array function hit F2 then press Ctrl+Shift+Enter to calculate the array.
I have been doing some work for a company who have a user base who primarily use iPads to access the SharePoint site. There was a requirement to allow those users to easily access the team site without getting their screens filled with the quick launch and the bloated title.
The problem with this approach was the short delay from the page loading to the screen resizing to remove the side bar etc which was undesirable.
I was asked to find a better way to remove the menus that was more instantaneous so I turned to css media queries.
To achieve this, I looked at what the SharePoint SetFullScreenMode function actually did. I found that in addition to setting the cookie, it also applies the ms-fullscreenmode css class to the body element, which led me to the following CSS in the master page;
I got the result and feedback for the first assignment of the final Open University project today. Its been a long week waiting for it, not least because a significant number of others on the course have been reporting back very low marks.
The difference with TM470 assignments is that they are a little more wooly in what is required. For the past 3 years, the assignments have been a series of questions that need answering in a specified order and within a specified structure. With this course we’re expected to guide the project, determine what is relevant for the content of the assignment and hope that we got it right.
I eventually got my mark, 60%. It’s work 5% of the overall module so it can be used as a learning experience. The tutor did give me some good feedback which will help when writing the next assignment for the middle of April.
So, the project I’m working on is based on my dad’s job in modern tram systems. The focus of the project will be to provide a software library that can be used to assist in the validation of chose routes for a tram system. Basically a route is made up of a series of segments that can be straight, curved or a transition from straight to curved. Along the route there may be platforms, crossing, traffic lights etc but essentially these three segment types cover most of it.
When a tram is travelling through a curve there are a number of factors which dictate the speed the tram can travel. Sections of track may have environmental factors which dictate a maximum speed (eg; an area of high pedestrian traffic). The library will seek to provide a journey time for each type of tram through the route by calculating the permissible speed through each segment of the route.
I’ll update as I go, you might think its a dry subject, however the calculation logic should make for some interesting challenges.