|
Hi Team
I am novice developer in C# and was given a test to complete. There is an existing class, but i dont know how to implement these two functions and methods; Please team i sincerely need help and once i passed it would be employed as C# developer.
using System.Collections.Generic;
using System.Linq;
using TestCode.Models;
namespace TestCode
{
public class StatsCalculator
{
public IEnumerable<team> TeamReferenceData { get; set; }
public IStatsWeighting StatsWeighting { get; set; }
public StatsCalculator(IEnumerable<team> teamReferenceData, IStatsWeighting statsWeighting)
{
TeamReferenceData = teamReferenceData;
StatsWeighting = statsWeighting;
}
// TODO: Return the player for the specified player number, or null if not located.
// The playerNumber parameter must be > 0. If it is not then return a null result.
// Note
// Team.Players has the players for the team.
// Player.PlayerNumber is the field to be compared against
public Player PlayerByPlayerNumber(int playerNumber)
{
return null;
}
// TODO: For each team return their win % as well as their players win %, sorted by the team 'win %' highest to lowest.
// If a teamId is specified then return data for only that team i.e. result list will only contain a single entry
// otherwise if the teamId=0 return item data for each team in TeamReferenceData supplied in the constructor.
// If a team is specified and cannot be located then return a empty list (list must be empty and not null).
// NB! If any player on the team has played 100 or more matches then IStatsWeighting must be invoked with the required parameters
// ONLY make this call if one or more of the player matches is >= 100.
// The result must be stored in the PlayerWeighting field inside the TeamValue result class.
// If all the players within the team has played less than 100 matches each then PlayerWeighting must be set to 0.
// Note
// Team Win % is Team.Victories over Team.Matches
// Player Win % is Player.Wins over Player.Matches i.e. the sum of all players win / matches on the team.
public IEnumerable<teamvalue> TeamWinPercentage(int teamId = 0)
{
return new List<teamvalue>();
}
}
}
// instructions for this test
What must be completed:
Inside StatsCalculator.cs are 2 methods with ToDos that must be implemented. These are PlayerByPlayerNumber and TeamWinPercentage
Read the ToDo's in order to understand what each method must do.
You must implement these 2 methods. Please implemented any tests (in the test project) you feel are relevant.
|
|
|
|
|
This is effectively your homework: it's a test to see how well you can do a specific task (which may or may not have any bearing on the final employment). As such, if we do it for you - which is what you are asking - then that gives the company the wrong idea about your skill and ability level. They will believe that you are an experienced developer with significant experience in C# and perhaps give you the job on that basis.
That isn't fair: not on them (recruitment is a very expensive process), not on you (who wouldn't last long in the job once they find out you lied about doing it yourself), and especially not on your fellow applicants who can do the job they are being hired for.
If you can't follow instructions such as those you have been given, then you aren't ready for that job. I'd suggest that you try applying for jobs you can do until you have brought your skill level up to the required standard.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have to question you getting this job. The assignment you've given is not complicated at all. In fact, it's pretty trivial. If you can't do this assignment, you're not going to be in that job for very long.
Sorry, but that's the brutal reality of the industry.
modified 8-Aug-17 10:29am.
|
|
|
|
|
Hello everyone,
I want ask about very old libraries / snippers
- CommandLine Parser,
- NDesk Console ( ManyConsole )
- PowerArgs
- CommandLine
and more...
Why do they not work for me? I tried libraries but they are not successful. Just I have idea own parameters like mkbundle.cs from Github. I already read. mkbundle is great helper and you think mkbundle's example parameters better than hard understandable libraries: Is it correct?
I found https://github.com/mono/mono/blob/master/mcs/tools/mkbundle/mkbundle.cs mkbundle.cs from Github and shows how do I understand like I create arguments / parameters.
I write example:
class Program
{
private SDLWindow game;
static int Main(string[] args)
{
int argIndex = args.Length;
game = new SDLWindow();
for (int i = 0; i < argIndex; i++)
{
switch (args[i])
{
case "-width":
case "-w":
game.Width = int.Parse(args[++i]);
break;
case "-height":
case "-h":
game.Height = int.Parse(args[++i]);
break;
case "-game":
break;
default:
break;
}
}
game.Run(60);
return argIndex;
}
}
class SDLWindow : GameWindow
{
public SDLWindow()
{
WindowBorder = WindowBorder.Fixed;
}
}
Just example like game's parameters
game -w 1024 -h 600
output: http://i.imgur.com/lP8R3hF.jpg
Is it correct? If I understand parameters like hl.exe -game for example changes current game directory:
/basedir is default directory - If I use "-game" than /othergamedir -> "-game othergamedir"
Thanks for answer!
Example of game's parameters like hl.exe -w 1200 -h 600, etc any game with parameters
modified 4-Aug-17 21:47pm.
|
|
|
|
|
What results are you getting? Do you have an error message you can share with us?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Really? I don't see that....
Non errors! Just I want know if they have same. Thanks!
I thought you have code like mkbundle.cs from Github.
Thanks!
|
|
|
|
|
Here's mine:
ParsedCommandLine[^]
I have a list of several others. You may have to roll your own or change how you want it to work.
|
|
|
|
|
Thanks! I will roll for my own. And I am very happy because I know C# language now.
Best regards
|
|
|
|
|
Member 13310103 wrote: Why do they not work for me? Most likely because you are doing something wrong. But unless you explain what you mean by "not work" it is impossible to give a useful answer.
|
|
|
|
|
Aug-03-2017
Hi everybody and thanks in advance.
I'm writing my own media player using c# and the windows media player.
It's all going ok while working in the VS2013 but when I tried to share the resulting .exe file, the application don't start, don't display anything, don't do anything...
Am I missing something..? Any ideas please...
Thank you all..
|
|
|
|
|
Have a look in the event log see if anything is being written there. That's generally the best place to start hunting for clues.
This space for rent
|
|
|
|
|
Hi,
As soon as you rely on external components (i.c. WMP) several things could go wrong: WMP may not be installed, or it may be disabled (maybe this[^] could help), or you are trying to use a WMP browser plug-in that isn't installed (possibly by using the WebBrowser Control).
As such possibilities exist, your code should be such that it gracefully degrades, so the least you should do is catch exceptions and report to the user in functional terms; what I tend to always do is include a log facility that reports to the programmer in technical terms. Furthermore, if you were to use some operation that may never terminate, you should figure out a way to give it a timeout anyway.
FWIW: if you access Controls on a thread that didn't create them, all kind of weird things may happen, and not necessarily in a reproducible way.
Hope this helps,
|
|
|
|
|
I believe you can also get to the Event-Logs in windows via Visual Studios Env; which is better, since it groups up items for you. The path I use is Server Explorer>Servers>[Computer]>Event Logs>Application>[Your App].
Ben Scharbach
Temporalwars.Com
YouTube:Ben Scharbach
|
|
|
|
|
Hi all of you...
Thanks for your replies, still can't figure out what's going on but yes, I'm looking into the log..
It's helping... thanks!
|
|
|
|
|
Hi, my office hire a vendor to develop MIS system for internal use. The system is develop and configured with Microsoft SharePoint and their code is written in C#.Net language. Everything is running fine but one thing that really concern me is the implication of wrong setting or functionality when we we ask them to update the new feature or fix any issue, the target feature/issue is developed or fixed. But their code is impact to the other module of the system that cause something wrong. I have discussed with them and found that they are modify some share function or code which work great for target request module but impact the function of other module which later on we found.
My question from here is: do anyone in here know any style or tool to help them to manage their code more efficiency so making the progress of updating some feature won't impact to the functionality of other feature. Thank in advance!
Best regards,
Kanel
|
|
|
|
|
All this is kind of vague: what's a specific example you have observed ?
Are you competent enough in C# and .NET architecture to understand the code base ? To judge how well it's put together ? Is it your job to deal with the code ?
The possible structural issue here ... your dependency on a 3rd. party's code which you can't maintain/fix yourself (evidently) ... well, that may be something you can't modify. And, the idea of giving the 3rd. party some magic tool that will change everything ... seems like a fantasy.
On a business level, do you have any form of leverage with the 3rd. party ? Are they willing, able, to change ? The best leverage, of course, is financial; can you take your business elsewhere; are there funds they have not been paid, yet, etc.
You'd really have to describe the full context of the business relationship to say much more.
«Differences between Big-Endians, who broke eggs at the larger end, and Little-Endians gave rise to six rebellions: one Emperor lost his life, another his crown. The Lilliputian religion says an egg should be broken on the convenient end, which is now interpreted by the Lilliputians as the smaller end. Big-Endians gained favor in Blefuscu.» J. Swift, 'Gulliver's Travels,' 1726CE
|
|
|
|
|
What i have found in here is when the vendor change/update one module to meet our requirement, there is an impact to the functionality of the other module in our MIS system. As talk with them, I found that the problem because they use the share code module that is why they change their code to fit with one module it is impact to the code in another module.
It is hard for me to raise to management for the support contract to fix an issue that is not produce during first system development but it is an issue of produced by another support task. I think if there is any method or tool that help them to manage their code efficiency so there is no impact from one module to another module when there is any change made in the code.
|
|
|
|
|
I don't think there is any such thing as a tool to fix bad design/programming. You need to get your management involved in this, it is a business issue not a technical one.
|
|
|
|
|
|
As Richard suggested you are suffering from bad design or probably undisciplined coding. There are various tools built into Visual Studio to help find dependencies, these have obviously not been used.
There are also various practices and strategies to avoid the situation you find yourself in. It is good and normal practice to create shared methods, what you are missing is the skill and discipline to support the application. You have a crappy vendor!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't know if your vendor is better or worse than average ("bug" wise); however, most "professionals" use "version control software" (VCS) that allows for maintaining a "history" of software changes so that one can always (or most of the time) "fall back" to a previous version of the "app" that worked.
"$ cost" is not a factor since there are open-source VCS: e.g. GIT, SVN.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Possibly a 3-rd party vendor like telerik. Use of the XAML Dictionary to group up the styles. Also, on the WPF Themes - Home[^] on CodePlex, there are additional toolkits that might help.
Ben Scharbach
Temporalwars.Com
YouTube:Ben Scharbach
|
|
|
|
|
The second time my program encounters this linq statement it changes the resolution of the application.
List<type> ZObjects = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(assembly => assembly.GetTypes())
.Where(x=> x.FullName.Contains("MyDataClasss") &&
x.Name.Substring(0,1) == "Z").ToList();
Can anyone explain why this would happen?
Thanks
|
|
|
|
|
Well, the first problem is what do you mean by "changes the resolution of the application". Also, what kind of application is this? Windows Forms, WPF, Console, ...?
On the surface, the only explanation is "not possible".
There is something else going on that's causing this, possibly very subtle, but it's not possible with the code shown.
|
|
|
|
|
It is a Windows Form application using DevExpress controls. I am running Windows 10 and a friend saw the same behavior on his Apple running a Windows emulator. Another friend did not see the same behavior on his Windows 7 machine. I am using a Surface and not in its highest resolution.
I am not sure how else to explain the action, but the form, which is maximized and takes up the full screen the first time its run shrinks to about 2/3's of the screen and shows maximized. If I click the normal / maximize button it toggles to non maximized and back, but never takes more than 2/3's of the display. Its like its in its own screen which is maximized at about 2/3's of the available display size. But the rest of my programs show underneath at their normal resolution.
I fixed the problem by using a different approach but remain interested in why this happened. I am trying to replicate it in a simple project that I can share but so far no luck. When I do I will post back to this thread.
Thanks
|
|
|
|