Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ephphatha
Dec 18, 2009




That'd be more feasible as a browser plugin if there's a particular browser you use. Something like https://chrome.google.com/webstore/detail/day-counter/glnbjmdjpcccpdlckpenknmacmgbecpa?hl=en might be appropriate?

Adbot
ADBOT LOVES YOU

ephphatha
Dec 18, 2009




Step 3 is the important one. This command is used to discard all the map data except parking areas:
code:
osmfilter great-britain-latest.osm.o5m --keep="amenity=parking" -o=great-britain-parking.osm
To get what you're after you'd need to also keep roads with the parking:lane:* tags having a value of parallel, perpendicular, or diagonal (to cover the most common cases). Then you'd need to work out some way of calculating area based on the parking type which as far as I can tell OSM doesn't provide.

ephphatha
Dec 18, 2009




Glad you got it sorted. For reference you could also surround the variable name in curly braces
code:
mv ${DATE}10* /${DATE}/October/
or quote the variable (using double quotes specifically)
code:
mv "$DATE"10* /"$DATE"/October/
I usually prefer the first form since it's a syntax that's been reused in many other languages.

ephphatha
Dec 18, 2009




This is a really basic implementation, only bubblesort for now and no fancy styling/instructions. It's a single html file that you can download and run anywhere and should work in any reasonably modern browser. Using only basic HTML and JS concepts so it'll use default browser alerts for feedback/prompts, I was mainly interested in knocking something up with no dependencies so hopefully someone else can do a prettier version if that's desirable.

https://ephphatha.github.io/html-sort-game/sort.html - instructions.

ephphatha
Dec 18, 2009




Sad Panda posted:

Lovely, thank you for knocking that together. Some quick feedback about functionality...

1. Big thing - They should swap when first element < second element. If they don't (ie swap when shouldn't or don't swap when should) - "You need to swap these items. Lose a life." / "You don't need to swap these items. Lose a life."
2. Minor - If the list isn't sorted but they say it is, it currently says "The list is not sorted, keep going." Could you let them know they lost a life? - "You must continue making passes until you do a pass without making a swap. Lose a life."
3. Query/Alternate idea - Is it possible to give different options than OK/cancel or is that just a consequence of using the default alerts? Maybe as an alternative - at the end of the pass could have two buttons become visible to the right of the current list. Finished / New pass.
4. Improvement idea - If they finish a pass and need a new pass could you add a new line for the current pass like in the attached picture? It really helps visualise the progress of the sort.



1, 2, 4 are all easy done, I've updated the js to handle that. Apologies for missing that requirement, I didn't actually download the program you linked to so I had/have no idea what the existing behaviour is like.

3 is because of the use of default alerts. Browsers don't give any room for customising these simple dialogs so a different approach is needed to make it more user friendly. Your suggestions sounds good, I was mainly trying to avoid having buttons appear/disappear repeatedly on the page as it make the logic slightly more complicated and I'm lazy. Would you be comfortable having the buttons always be visible? Do they need to appear to the right of the lists or would it be acceptable to have Skip/Next/Finished/New Pass buttons in a row?

I've updated the hotkeys and embedded the instructions on the page below the buttons, same link as before.

ephphatha
Dec 18, 2009




Most of the state has been handled by css classes and the dom itself so I've added ".dirty" as a class for (the first of the pair of) items which have been swapped. This isn't made visible with a style rule or copied to the history, but could be done if you wanted to make it more visible by adding a rule to the style section similar to the following:

code:
item.dirty {
	background-color: red;
}
I could also polish the visuals a bit and move away from browser alerts, given this started as a quick hack I went simple :). I'll play with improving it when I have time so if there's any particular layout for the prompts you had in mind that'd be helpful.

Adbot
ADBOT LOVES YOU

ephphatha
Dec 18, 2009




Sad Panda posted:

Thank you for that update I've been playing around and here's the next bit of feedback. :)

3 bugs
1. If you have successfully completed the sort (finish a pass correctly without swapping) and tell it you need a new pass, you should lose a life, but don't. "You finished a pass without making a swap. The list is sorted. Lose a life."
2. Minor visual thing - If you swap the final element in the list, "Have you finished sorting the numbers" comes up before the numbers are updated on the page.
3. Inconsistent behaviour - If I should swap, but tell it not to swap I lose a life and stay on the same two elements. If I shouldn't swap, but tell it to swap I lose a life and move on to the next two elements. Could you make it so both are like the first one - it doesn't progress until you get the choice right?

I actually updated this to fix 1 and 3 a few days back, never got around to posting to let you know. 2 is a side effect of using browser alerts. I have a timeout set before it pops up in the hopes that the browser renders the changes but it's still not consistent. I'll get in touch via PM about the enhancements you suggested here since I don't wanna dominate the thread :D

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply