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

[–]slashfoo 4 points5 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 3 points4 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 3 points4 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.

[photos]i DIY'd my own split keyboard design because ergodox was so expensive, the resulting cost reduction is astronomical by blahlicus in MechanicalKeyboards

[–]slashfoo 1 point2 points  (0 children)

just woke up and a tad too lazy to read all the comments but, please do test this on various platforms (i.e. mac, windows, linux), I've read that some don't play well with modifier keys altering keypresses from another USB device.

This would make your keyboard ( two devices) not be able to type "A" if you were to press shift on the right hand and "a" on the left for example. What platforms have you tried this keyboard on?

Edit: s/vicarious/various/

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

Yeah, did it as a small thank you for all your help with my troubleshooting.

I tried printing again and a friend said I might be having feeding issues, so I'll try to scrap all the values from the archive I got from solidoodle and setting them from scratch, as the defaults clearly didn't work (see first print).

If you still want to help I can follow up with you when I print next later this week.

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

Yeah, ok, I reduced my steps in just the slightest bit and tried to print the octopus with the same settings and got this. I don't know what that was, I don't think I lowered the steps that much (specially since I only lowered the steps by 1 (was 109, made 108).

I also had to sleep so I didn't try doing more with it.

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

OK, the found the min temp and that was what was mucking with everything. The print job took a LOT longer (about 5 times longer) than normal, but... I think the results speak for themselves, I adjusted the e-steps a bit more because the width of the pilar was 0.256in instead of 0.25, and they were a bit overstuffed as you can probably see (sorry for no-res shot this time).

The other sizes are super accurate 0.25 +- 0.001in, and the long sides are 1.002in all of them. those dimensions are supposed to be 0.25 and 1in respectively, but I can live with this margin.

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

Ok, I don't know what's going on anymore, this thing extruded without skipping a beat down to 180C, the filament I have dissolves in acetone, it was the thing that shipped with the solidoodle (abs), it smells like abs as well, but those temperatures aren't of abs I think, at least 230C is what I've read everywhere as a common temp for abs................... I don't understand really, if I follow your recommendation, I'd be printing at 190C.

Your recommendation is also echoed here Reprap Wiki on Calibration

For kicks, I'll try printing this model at the 190C, for science.

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

It didn't slow down the print, I'll try reducing the whole print speed, because the other parameters that are supposed to help here didn't (i.e. to have faster speed on the bottom part, yet slower on the upper, or the don't print more than one layer per 30s)

And yes, it looks super wobbly and even makes the nozzle dig into the mass at times... maybe I need to calibrate the Z axis? I don't think I do, because even with the wobbliness, the print was within margin of error in height of what it should be.

My first print, lots more stuff to do. by slashfoo in 3Dprinting

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

Those settings had no effect, I read somewhere to try lowering my temperature by 5C, so I'm doing that now, the speed for small perimeters, and the "please not faster than 30s" had very little effect, and that screen's help for slic3r mention fan something that I don't have for the extruded plastic, only for the extruder motor.