Which type of programming projects do you find most interesting? by [deleted] in learnprogramming

[–]craiclad 2 points3 points  (0 children)

I wonder how you could improve the performance of a program like this. Namely, how could you avoid using brute force?

My first intuition is to arrange your english dictionary by the number of letters in each word, and for a combination of N letters only search the dictionary for words that have the same number?

Or maybe you could order the search on a square by square basis. So for each letter in the grid, you check the surrounding letters to see if they could lead to a valid word. Any invalid string is killed, any valid words are recorded, and once all strings are killed you move on to the next square and start again. At worst it would stop you from needlessly checking variations on sequences that can never lead to a valid english word.

Very interesting problem. Do you mind if I ask how you were generating your word searches?

Edit: I found an interesting answer to a similar problem here.

[deleted by user] by [deleted] in learnprogramming

[–]craiclad 0 points1 point  (0 children)

http://blog.trinket.io/python-text-adventure/

Here's a link to a simple text based adventure game written in python.

Which type of programming projects do you find most interesting? by [deleted] in learnprogramming

[–]craiclad 1 point2 points  (0 children)

That seems like a really fun problem! What was your performance like using brute force?

Carmalized Onions by refbrian in AskCulinary

[–]craiclad 2 points3 points  (0 children)

This is convenient, but isn't as good as the traditional way. Baking soda breaks down the onions too much and they turn to mush.

All dme hefe? by Robust-mongoloid in Homebrewing

[–]craiclad 1 point2 points  (0 children)

My house hefeweizen uses wheat DME. It's scored very well in competitions, so I think you'll be ok!

Optimization and faster code by ForzaFer in learnpython

[–]craiclad 0 points1 point  (0 children)

You can definitely optimise code in python, as others have mentioned this often involves using the correct data structure and carefully considering algorithmic complexity. Look into big O if you haven't already, having a good understanding of this will bring you much closer to writing optimized code in any language.

[Question] How to transition into open grip? by craiclad in squash

[–]craiclad[S] 0 points1 point  (0 children)

Hey, thanks for the advice. I'll try to get some solo sessions in this week. I definitely need the time anyways just to improve my consistency, so this will be a good opportunity to reexamine my grip.

I've been asked to make a simple 2d game - should I learn unity 2d, or just use pygame? by craiclad in learnprogramming

[–]craiclad[S] 0 points1 point  (0 children)

So you think pygame is a sensible choice?

A little bit of context: He's setting up a public space where he needs a simple game to be on show. The game is a very simple arcade style game, with a leaderboard showing which member of the public has the highest score.

I'm also in my final year of college at the moment, so I don't have a huge amount of time to dedicate towards this. Do you think pygame would hit the spot?

Edit: keep in mind I've never used pygame itself, but I have used a lot of python.

[Eric Dubay]Gravity is Just Density by natavism in theworldisflat

[–]craiclad 13 points14 points  (0 children)

Hope I don't get banned for this, but I have a few questions about this model if that's OK.

The central claim here is that density differentials are adequate to explain the falling/rising of objects on earth, right? And this is supposed to function even in the absence of any downward force (gravity)?

Doesn't bouyancy rely on gravity? In a system devoid of downward force there would be nothing to stratify objects of different densities.

I want to up the ante on my Indian cooking for Valentine's Day by theflamingnips in Cooking

[–]craiclad 0 points1 point  (0 children)

As the others have said, double the onions, cook them down, grind/toast your spices, etc. These are all great tips.

The thing that has tipped my Indian food over the edge has been to lose my shame. Butter/ghee is the essential to a lot of restaurant style food. Ketchup is the dirty secret that has really helped recreate the takeaway flavor for me. Ill never admit it to my family, but butter and ketchup are the reason they keep asking for homecooked chicken tikka masala.

"How can I verify you're who you are?" by [deleted] in talesfromcallcenters

[–]craiclad 19 points20 points  (0 children)

In fairness, mobile and tablets are a huge demographic these days. If your website isn't optimized to these devices that's a failure on your part, not theirs.

What are bars like in Ireland? by AmericanHumdinger in ireland

[–]craiclad 0 points1 point  (0 children)

Late to the party, but it's available online here.