Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited


This user doesn't have any awards

About camjocotem

  • Title
  • Birthday 1991-07-22

Profile Information

  • Gender
  • Location
    United Kingdom
  • Interests
    Anime, coding, gaming, baking
  • Occupation
    Software Developer


  • CPU
    Intel Core i7 7700HQ

Recent Profile Visitors

259 profile views
  1. public static Task<Task<T>>[] Interleaved<T>(IEnumerable<Task<T>> tasks) { var inputTasks = tasks.ToList(); var buckets = new TaskCompletionSource<Task<T>>[inputTasks.Count]; var results = new Task<Task<T>>[buckets.Length]; for (int i = 0; i < buckets.Length; i++) { buckets[i] = new TaskCompletionSource<Task<T>>(); results[i] = buckets[i].Task; } int nextTaskIndex = -1; Action<Task<T>> continuation = completed => { var bucket = buckets[Interlocked.Increment(ref nextTaskIndex)]; bucket.TrySetResult(completed); }; foreach (var inputTask in inputTasks) inputTask.ContinueWith(continuation, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); return results; } //Example usage foreach (var task in Interleaved(tasks)) { Task<T> t = await task; T result = await t; ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { SpecificLargeProcessingHere(result.thing); }), null); } This might be a bit overkill but I've used this before when I've had to crunch a lot of tasks as once. It process all items pretty much at the same time. Found this on https://blogs.msdn.microsoft.com/pfxteam/2012/08/02/processing-tasks-as-they-complete/
  2. camjocotem

    Motivation for sports/exercise

    I'm happy with what I look like haha XD
  3. camjocotem

    Motivation for sports/exercise

    I could definitely appreciate the time alone to myself, and now that I'm thinking about it if I could find a beneficial development podcast to listen to I could probably kill two birds with one stone.
  4. camjocotem

    Motivation for sports/exercise

    Well when I'm there, I can't stop thinking that the time I spent getting there and doing that thing could be better spent again learning something I know would definitely benefit me in both my personal projects and my job. To me the sports feel like a talking point at best. I suppose each sport I've tried I've just not really felt like I enjoyed it to the point of wanting to continue. My friends were telling me that at least with climbing I need to keep going to really see the appeal of it; I mean I've been getting better at it sure but it still just doesn't feel like a good use of time when I could be learning something lol I've been interested in coding since high school and now that I actually have a job in it I can finally show what I know and continually improve stuff and actually make use of all this. x] I walk to and from work which is about 45 minutes each way which I figure is probably an okay minimum health-wise
  5. camjocotem

    Motivation for sports/exercise

    Hey guys, Trying to find some motivation/benefit to sport here. So I really like coding, I like to learn a lot in my spare time and work on some personal projects (which hopefully will turn into something profitable when complete! :] ), when I need to switch off I'll probably end up watching something on netflix or playing some game. I don't eat too bad either so I personally feel okay with my body. I just find every sport I try boring, I've been going climbing with friends the past 3 weeks and prior to that went to the gym for about 3 weeks and when I'm there I just feel like I could be doing something more productive or at least something I'd find entertaining. Anyone else in the same boat?
  6. Been accepted as one of the 25 participants into the Code in the dark competition!

    Gonna be practicing most evenings on stream apart from Thursdays


  7. camjocotem

    New programmer, language question

    Add Resharper to C# for the ultimate hand-holding experience
  8. camjocotem

    New programmer, language question

    Depending on what job(s) you get, I feel like you'll need to use SQL at some point inevitably Though that would be learned alongside Python or Java (My preference personally would be Python)
  9. camjocotem

    Cache decoder

    I think Cain can do that? Oxid.it or something
  10. camjocotem

    Solving 'real life' problems

    For example: I have to do work on a rather old website which uses VB Asp.NET / JQuery This was under no source control / had no build process / had no deployment methods and all changes are literally made by connecting to the project on the server with Visual Studio and making the changes directly. Long story short, I wasn't able to work on this on my local machine or implement it in any build/deployment process. I used to take .zip backups of the website (Yuck!) before doing any changes but after some time realised I could make a local git repository on the server that I could work with. It's still a crap solution but it's a bit more managed than what I was working with before.
  11. camjocotem

    Solving 'real life' problems

    I am aware of best practice methods and ways that things should be implemented but across some jobs I've ended up with systems that put me in a hard place. I was thinking maybe it would be useful to get a list of short-term fixes to problems to tide people over until time gets allocated to solve problems properly if anyone wants to share?
  12. camjocotem

    [Javascript] Why I can't insert the Form element?

    Sounds like it might be browser caching?
  13. camjocotem

    How Did You Get with Your Girlfriend (or Boyfriend)?

    14 Years old - I went to a Center Parcs holiday park and helped this girl that was struggling to get her fencing armour on, and she helped me with mine Later coincidentally met her (and her boyfriend of the time lol) at this high ropes activity and I asked if I could join them since they were the only similarly aged people there which they seemed super happy about. Her boyfriend was actually the one who suggested we stay in contact and so we swapped emails/numbers and so following that we chatted every day on MSN / Skype / Texting / Online Games and I flew over to visit for two weeks every year for 10 years (she had broken up with her boyfriend by year 2) 23.5 Years old(ish) - We were watching a TV series together while cuddling, which was pretty normal for us but then I went to hold her hand, not sure why, then I kinda sorta developed feelings for her. I kinda became self-conscious of my feelings and was worried if I told her that I'd ruin this amazing best-friendship we've had for 10 years! She noticed I was acting different and pretty much demanded to know what was up with me so I told her and as it turns out she had feelings for me too! We planned a holiday together and had our first official date at Disneyland Paris. I manage to get a job over where she lived and stayed with her and her parents saving up money to buy a house 24 Years old - We buy a house together and finally establish our independence! 26 Years old - I propose to her at our favourite steak place and she accepted It was tough getting the engagement ring, I had to get help from her dad to keep her distracted for part of a day while I went out with her mum looking at engagement rings, turns out the one I liked most was the first one I saw haha We wanted to have our wedding as soon as possible as we were concerned that some elderly relatives may not be able to make it so 6 months later we had our wedding; it was probably smaller than other weddings but it was amazing :') 27.5 Years old(Now) - Sorry this is so wordy.
  14. I'd personally say go for if you feel like programming is an area you are interested in personally / could potentially see yourself doing some hobby projects in. It's just an area which is constantly changing and so if you are expected to keep up then constant learning may not seem quite so appealing. Even if you yourself don't care much for learning the new stuff, people you work with probably will, which inevitably means you'd need to learn it too. I personally think programming is a fantastic job! (If you get the right employer / colleagues) If you walk into a job then likely everyone there will have their own obligations to attend to; you as the new starter could decide to focus your learning into an area the rest of the team don't know quite as well and become the "go-to guy/gal" for that topic, and then do some basic learning for the rest of the areas / get help from others. See T-Shaped knowledge
  15. camjocotem

    The under 100 line challenge!

    Here's a function I've been using to take line-separated entries you can convert to be used in a SQL 'IN' statement /** * text {text} The line separated string to be converted * options {object} Set 'oneLinePerItem' to true to output each item on new line * Set 'ignoreDuplicates' to only output one of each item * Set 'ignoreWhiteLines' to not take white line inputs into consideration **/ function convertCommaSepList(text, options = {}) { if (text || text === 0) { var stringOutput = []; text.split("\n").forEach(function(n){ var strToOutput; if (typeof n === "string" && (!(!isNaN(parseFloat(n)) && isFinite(n)))) { strToOutput = ("'" + n.trim().replace("'", "''") + "'"); } else if (!isNaN(parseFloat(n)) && isFinite(n)) { if (options.treatListNumbersAsStrings) { strToOutput = ("'" + n.trim().replace("'", "''") + "'"); } else { strToOutput = n; } } if (options.oneLinePerItem) { stringOutput.push(strToOutput + "\r\n"); } else { stringOutput.push(strToOutput); } }); if (options.ignoreDuplicates) { stringOutput = stringOutput.filter(function(value, index, self) { return self.indexOf(value) === index; }); } var result = stringOutput.join(",").trimEnd(); if (options.ignoreWhiteLines) { result = result.replace(/'',/g, ""); } return result; } return text }