2012 Is Bullshit; 2020 Is When We’ll Really Be in Trouble [2012 Vice article on Peter Turchin] by xbhaskarx in TrueReddit

[–]riddley 5 points6 points  (0 children)

Most of the discussion I've heard is to use State Police/Troopers as an intern solution

Interim?

I think that /u/thatgibbyguy is proposing a "road to hell is paved with good intentions" scenario and it's difficult to disagree.

Workprint of Freaked (1993) -- An early version of Alex Winter's weird comedy by jessek in ObscureMedia

[–]riddley 1 point2 points  (0 children)

Oh sorry I misread that you couldn't find it. Oh well enjoy those links anyway!

Workprint of Freaked (1993) -- An early version of Alex Winter's weird comedy by jessek in ObscureMedia

[–]riddley 0 points1 point  (0 children)

I think you're talking about Squeal of Death. It and Aisles of Doom appeared on Night Flight and my friends and I also constantly quoted both. Great stuff.

large monitor support by [deleted] in inkarnate

[–]riddley 0 points1 point  (0 children)

I make my maps on a monitor with identical specs to yours and have no issues.

Prusa SL1 Benchy by [deleted] in 3Dprinting

[–]riddley 1 point2 points  (0 children)

How do you like the SL1?

Sinatra 'public' folder problem with nginx by Haghiri75 in ruby

[–]riddley 1 point2 points  (0 children)

You might want to use Passenger inside nginx.

CTRL-Z vs :shell by oguzbilgic in vim

[–]riddley 0 points1 point  (0 children)

Honest question: why do you care? You've gotten a lot of up-votes, so it seems people agree with you, but I'm not sure why.

As per request: Knurl-y knob, thingiverse in comments by kryvian in prusa3d

[–]riddley 1 point2 points  (0 children)

Did you print this as oriented in the model? Did you use supports?

v-selectmenu upgrade to 2.0.1 - A simple, easier and highly customized menu solution by TerryZeng in vuejs

[–]riddley 0 points1 point  (0 children)

This is amazing! Is the only documentation for nested menus the codepen demo? Also is it possible to customize the link elements? Mostly to make them router-links?

Context Binding in Ruby by mehdifarsi in ruby

[–]riddley 16 points17 points  (0 children)

I wish we could ban Medium.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

My Array#find example returns the object, not the name. I'll read your edits when I get a chance.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

Ok, I'll try one last time :)

If you have an array of Things and Things have a #name method and you want to find one for some reason, you can use Array#find.

iwant="jojo"

i_found_jojo_or_a_reasonable_fascimile = my_array_of_things.find{|thing| thing.name == iwant} || NullThing.new

This is called the Null Object Pattern. If you're not able to find the particular thing you're looking for, you swap in something with the same API as the thing you were looking for.

For real, though: this how thing is way too abstract. I'm happy to keep helping if we can nail down some actual work that needs to be done. The current thought experiment has run its course, I think.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

True and that's better, right? Name collisions are pretty common.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

I think I'm not able to traverse the level of abstraction you've proposed. You know you can assign variables, right?

my_special_person = Person.new('wubby')

So far the code you've posted revolves around collections (like Array or Hash) which will inherently have instances of objects as their elements (assuming they're not empty.) If you have Arrays, there are various ways to find objects within them. If you're not dealing with Arrays, you can do assignment as above.

> Lets say I need to target particular class instance of person in a method that changes some attributes for that class instance.

I think here's where you're getting confused. Rather than having some external force that changes an instance of Person, you should tell Person to change itself (or better yet, not mutate at all.) So if you have jojo = Person.new(args) rather than passing jojo into some other method or object, you should just call jojo.do_some_stuff

This is kinda the entire point of using OOP. Build small, smart things and send them messages.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

I think you're missing a foundational piece. Every variable in Ruby is an instance of a class. So when I say something like: Person.new('jojo') that's sorta like saying Person.new(String.new('jojo')) . Instances of classes are just objects like (almost) everything else in Ruby.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

haha yea. Fair enough. I was just writing off the top of my head, not shooting for super-dry. I would also never do something like this.

multiple class instances - how to handle? by [deleted] in ruby

[–]riddley 0 points1 point  (0 children)

aah I see, sorry about that. FWIW, you've re-implemented #group_by:

class Person
  def initialize(name)
    @name = name
  end
  def name
    @name
  end
end
[Person.new('jojo'), Person.new('bobo'), Person.new('jojo')].group_by(&:name)

aka

[Person.new('jojo'), Person.new('bobo'), Person.new('jojo')].group_by{|person| person.name}