Show HN: Give 7B people an instant physical address
91–100 of 205 posts
Re: Show HN: Give 7B people an instant physical address
#92My current location is 5308 AFRAID ANUS. Might be best to exclude ANUS from the word list.
8529 WANT FILTHY
8529 WANT EXPLOSIONS
Re: Show HN: Give 7B people an instant physical address
#93Additionally:
* What if you live at an apartment?
* What if your address doesn't correspond to a fixed physical location, like an APO?
* Aren't the city and country redundant if you have a physical lat/long location?
Still, we need to look at how we send information to our fellow humans. Addresses are important and I'm glad folks like the OP are taking a closer look.
Re: Show HN: Give 7B people an instant physical address
#94Great idea / initiative but I must ask, are you new to Ruby? I've rarely come across code that was so not idiomatic.
Thanks, yes, I'm ashamed of my code, this is my first project in ruby , my last programming work was 15 years ago, (Foxpro for DOS) so this is my comeback to programming. I hope that being opensource will help it to improve.
Now, for some low hanging fruits / pointers:
- $name is a global variable. Virtually unused in idiomatic Ruby.
- @name is an instance variable. So it's perfectly ok to use it... within a class.
- You should omit the 'then' after each if.
- I'd use find_words rather than busca_palabras.
- Except for rare edge cases, you can drop the .nil? from if my_var.nil?. If my_var is nil it will on its own make the condition false.
- I would use more spaces. 'a = 1' instead of 'a=1', 'b == 0' rather than 'b==0'.
- Use indentation consistently. 2 spaces.
- The else clause is indented at the same level as the leading if.
- Use && instead of 'and' in conditionals. Likewise || instead of 'or'. These short circuit the evaluation for you. So if the first argument is false && won't bother evaluating the second argument. Likewise, if the first argument is true || won't bother executing the second argument as it doesn't matter.
- Ruby is an Object-Oriented programming language. I would look into modules and classes to restructure the code in a less procedural way.
Re: Show HN: Give 7B people an instant physical address
#95Re: Show HN: Give 7B people an instant physical address
#96As a sidenote, Australia moves about 7cm north annually [1], so any encoding of GPS location is not flexible enough in the long term. Also only encoding lat/long makes it so you would not be able to address a single floor in a large building. [1] http://www.bbc.com/news/technology-36912700
[0] http://stackoverflow.com/questions/6841333/why-is-subtractin...
Re: Show HN: Give 7B people an instant physical address
#97Earlier quoted context omitted.
Thanks, yes, I'm ashamed of my code, this is my first project in ruby , my last programming work was 15 years ago, (Foxpro for DOS) so this is my comeback to programming. I hope that being opensource will help it to improve.
No sweat, man. You are new to the language and you're putting yourself out there. Major kudos for that. Now, for some low hanging fruits / pointers: - $name is a global variable. Virtually unused in idiomatic Ruby. - @name is an instance variable. So it's perfectly ok to use it... within a class. - You should omit the 'then' after each if. - I'd use find_words rather than busca_palabras. - Except for rare edge cases,…
Re: Show HN: Give 7B people an instant physical address
#98As a sidenote, Australia moves about 7cm north annually [1], so any encoding of GPS location is not flexible enough in the long term. Also only encoding lat/long makes it so you would not be able to address a single floor in a large building. [1] http://www.bbc.com/news/technology-36912700
Re: Show HN: Give 7B people an instant physical address
#99Earlier quoted context omitted.
This is why he's incorporated the avatar - in the example he provides you wouldn't see the "boot" avatar if you had missed a letter, the boot is part of the address and should be communicated verbally when giving the address verbally.
If you are sending or telling someone the adress you can't expect them to check the avatar. How would it work e.g. over the phone?
If you want to transmit your Xaddress by phone you will say "7150 MAGICAL PEARL - Maluku ,Indonesia" my avatar is a boot
Re: Show HN: Give 7B people an instant physical address
#100My current location is 5308 AFRAID ANUS. Might be best to exclude ANUS from the word list.
thanks codev, added to the TODO!
I realised when I was living in Japan recently how much I miss the UK postcode system. When I'm in the UK I can give anyone a short alphanumeric string and they can find me. A global coordinate system like this is really useful. I hope you can get some traction with it.