Geek Challenge

Its a good effort. I didnt get chance to look today, been buggering around with a 3D printer I just bought.

That’s the problem with brute force approaches on NP hard problems, they dont scale, the more waypoints you add the permutations grow exponentially. Thats why ships use ISO containers for freight. Its too hard to properly stack different shapes and work it out each time.

Heuristics is the approach for optimisation. You could even multi thread the sub problems, although that can be a pain. Lastly offload the heavy lifting in to AWS :slight_smile:

1 Like

Of course another sneaky approach is this. Random number generators in Python, Java, .Net etc are pseudo-random number generators, they not truly random and are predictable. Run a bunch of scenarios of the random biscuit placing. You will notice bunching together. You could see your algorithm with intel based on hacking the pseudo-random generator.

I have a fairly quiet work day tomorrow so will give it another bash.

That all sounds, er , really difficult (but really interesting too)

Think I have definitely gone as far down this rabbit hole as my brain will allow for now

Bit of deep learning to solve it. Might try a crack at that.

Is your son interested in a career in IT or is this just shits and giggles?

He is pretty interested, or at least he was until mid afternoon when he lost interest and left Dad to it…

He’s doing A-level comp sci, his elder brother is doing comp sci at uni and I think that’s what he wants to do to.

It’s fascinating being a passenger on their journey, I enjoyed programming in BASIC and then QBasic back in the 80s and 90s but then forgot all about it for about 25 years, coming back to Python after all this time has been bizarrely enjoyable

Are you in IT @GRamsay ?

1 Like

Yes. I’ve worked in software development for 20 years. Started as a developer, last 7-8 years I’ve been managing dev teams.

It’s not a bad career. Pays a lot of money, can be stressful but not massively. Way more jobs than there are people, and it gets worse every day. That’s why salaries are so high.

I never went to uni. Taught myself. Coding can be learnt by most people, others it comes totally naturally. For me, it just made sense. Except Perl and associative arrays, they will never make sense.

2 Likes

Regular Expressions for me :rofl:

I can write one, does as it should, come back to it three months later and I’m like “Who wrote this?” :exploding_head::rofl::see_no_evil:

But the joy of being able to multiply a number by a letter of the alphabet will always be Perl’s crowning glory… :grin:

[^a…b][poets|sanity][/]

EDIT… hah hah… the regex on this site has escaped my escapes in my regex based pun

PPS… if its still wrong, its been 20 years since I wrote any regex, so I seek sympathy not education… :joy:

1 Like

Is there not a code block?

 dash = "([2-9]\d\d)-[2-9]\d\d-\d\d\d\d"; 

I always have to look the things up.
But, I know it’s there and roughly how to do it, which is always 80% of the battle.

Anyhow, this is consuming me and I’m looking at Djikstra’s algorithm now.
Where this = hungry caterpillar

Lost count of the the number of t9imes I have looked at some code and thought what twat wrote this. Then checked source control, “Oh, it was me”.

4 Likes

apparently so!

But, since I haven’t written a line of code in 20 years, and the platforms I coded for are now found in technology museums with funny caricatured reel to reel tape machines next to them, it’s best I know as little as possible on that front.

1 Like

I saw a dev comment on a code line a few years ago, with words to the effect of “yes, I know this is a terrible way of addressing this problem, and that it would have been much better to use xxxxx, but I really really can’t be arsed to rewrite it all”

Yes I have written plenty that say, this is shit but I don’t have time to do it better

1 Like

Yep. All of the time!

“This is clunky/bulky, but works.
There’s a better way to do it, but the deadline is tomorrow. “

But… using Python

 import this 

So :man_shrugging:t4:

“ Now is better than never.
Although never is often better than right now.”

Too many Devs in here… yes Im in Testing :grin:

1 Like

Was having a play at the weekend with one of my sons using a website called leetcode, which offers some problems to solve.

The problem we were working on was this:

Given a list of numbers, nums, return a list of all possible subsets that can be made from combining any of those numbers. The list can be in any order.

So for example, if nums = [1,2,3] your code would have to return [[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]]

We both came up with working solutions in python but they were kind of clunky. Reading the discussion page there were some beautifully simple and elegant solutions that other people had come up with though.

3 Likes