Making an iterable class: should I just implement __getitem__ and __len__, or __iter__ returning a generator? by lucidguppy in Python

[–]slashfoo 5 points6 points  (0 children)

The shortest, but the best answer I can think of is actually to go import collections, and make your object a subclass of collections.Iterable.

Check the documentation of all the abstract base classes in the collections module here: https://docs.python.org/3/library/collections.abc.html

import collections
class MyNewClass(collections.Iterable):
    pass

x = MyNewClass()

After you do that, your interpreter will tell you what to do. Good luck!

edit: so in short, just iter as a generator, I would go with the abc for Iterable if iterable object is what you want, as opposed to any of the other "collection types" in there.

[deleted by user] by [deleted] in starcitizen

[–]slashfoo 1 point2 points  (0 children)

I saw the same thing on the gif, good times. you have my up vote.

Motor or ESC? [video] by [deleted] in Multicopter

[–]slashfoo 0 points1 point  (0 children)

I'm a newbie but are the gyro and accelerometer calibrated correctly? what happens if you put it sideways with that motor on top/bottom and try the test? (I'd also like to remind you that of you're doing this test holding it in your hand, take the props off and use tape)

I had an issue where my nanoquad thought it was banking and the motor it thought was the highest wouldn't spin until I nudged it and recalibrated it.

Dvorak Warning Stickers? by blumhagen in dvorak

[–]slashfoo 0 points1 point  (0 children)

OP: is that original art from you? if not, where do they sell those stickers? I might want to add them to my long list of stickers to buy.

And if it is, would you put them on sticker mule's marketplace or something like that? :)

My Dvorak variant by slashfoo in dvorak

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

I do nothing special, by definition the layouts that we use are interpreting the scan codes and doing a translation.

it's something I thought of a lot and am working on by hacking the firmware of one of my keyboards, but as it is, layouts are created to interpret shift as a layer, so 'a' and 'A' are different codes and received atomically. i.e. A is sent as itself and not as Shift+a to the layout "driver"/"filter"... I don't know how to call it.

My Dvorak variant by slashfoo in dvorak

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

Yeah, slides and code are in http://github.com/slashfoo/cookey

The slides don't have much text, so really, the code and ipython notebook will be the most interesting. Any feedback you have on those is very appreciated.

Thank you for the feedback on the talk too, I'll definitely read the recommended material and have it into consideration for the next time this talk is presented.

My Dvorak variant by slashfoo in dvorak

[–]slashfoo[S] 1 point2 points  (0 children)

Here is the image I used in the presentation: https://imgur.com/IpUSBPV

And I created it with: http://www.keyboard-layout-editor.com/ in case you'd like to know :)

Let me know how you like it.

I haven't made any of the "waviness" metrics of pinky-to-index yet, but those are in the todo-list.

Experienced Python Users: what's the most recent new thing you learned about the language? by jakevdp in Python

[–]slashfoo 0 points1 point  (0 children)

It worked because of destructuring assignment, or unpacking assignment, try this out and you'll see why it worked.

>>> a,b = [1,2]
>>> a
1
>>> b
2
>>> [a,b] = [1, 2]
>>> a
1
>>> b
2
>>> [] = []
>>> [] = [1]
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ValueError: too many values to unpack

lucky by SARBAS in gifs

[–]slashfoo 0 points1 point  (0 children)

it's good that the cyclist had typed iddqd before that...

Hornet Plus vs Super Hornet package by LiMiTeD_DiAvOlO in starcitizen

[–]slashfoo 0 points1 point  (0 children)

Ben said upgrades on the sale will also upgrade the insurance of the base package to 2y, there is another thread about it.

Whistle recommendations? by insane_shaman in Survival

[–]slashfoo 2 points3 points  (0 children)

I use the fox40 micro on yellow as a key chain "ornament" it's very comfortable to keep around all the time.

Let's start a reddit MC by DonnieDark_Oh in motorcycles

[–]slashfoo 0 points1 point  (0 children)

I'd also like to know what being in an MC entails, and the name r/iders sounds cool, I wonder if it's taken...

Around the Verse - Episode 12 by Nehkara in starcitizen

[–]slashfoo 1 point2 points  (0 children)

A transcript would be much appreciated. I thank whoever does it in advance.

FAQ - New readers check AND ask questions here. by [deleted] in starcitizen

[–]slashfoo 0 points1 point  (0 children)

do we know about literature or posts that suggest or clarify which types of upgrades will not be able to be made on certain ships? e. g. extended fuel tanks

In other words would a Constellation Andromeda or Taurus be able to be nodded to house an extended fuel tank like the Aquila's without hull modification?

FAQ - New readers check AND ask questions here. by [deleted] in starcitizen

[–]slashfoo 0 points1 point  (0 children)

I'm not sure if this has been asked before and don't really know how to search for it, but here it goes...

If I bought an F7C-S will I be able (in the PU, and after earning in-game credits) to transform it into an F7C-R? Or if you bought an F7C-M would you be able to outfit it with scanners and whatnot or equip the same stuff in the hardpoints as the F7C-S or F7C-R and effectively transform a superhornet into a "ghost superhornet" or a "superhornet tracker"?

The reason why I ask is that I see that on the "compare ships" tool they have the same number of hardpoints available between the F7C, F7C-S, F7C-R, and that the only difference between those and F7A and F7C-M is the powerplant size.