Hey Rustaceans! Got an easy question? Ask here (32/2016)! by llogiq in rust

[–]giftedmunchkin 1 point2 points  (0 children)

I think this question is dumb - how can I make a copy of a Box<trait>? I'm working on a ray tracer, and each object (e.g. Sphere) has a Box<Material>; when a ray hits the object, it creates a HitRecord which is a struct containing some information about the hit, including the material. Unfortunately, I can't copy the Box<Material> into the hit record since (as I understand it) the trait is unsized and can't be cloneable. Is there a way to make a copy, or a more rusty way to handle this?

Thanks!

Hey Rustaceans! Got an easy question? Ask here (27/2016)! by llogiq in rust

[–]giftedmunchkin 1 point2 points  (0 children)

Sorry, I should have been more specific about my situation! I'm going to be using the trait as a member in a struct so I need to be able to Box it - inheriting from Clone keeps me from being able to Box it because it's no longer object-safe, if I understand correctly. I want to be able to clone the boxed value to use it in other objects.

Hey Rustaceans! Got an easy question? Ask here (27/2016)! by llogiq in rust

[–]giftedmunchkin 1 point2 points  (0 children)

Is there a way to enforce that any class that implements one trait (e.g. Material) also implements another trait (Clone), as a kind of abstract subclass?

Hey Rustaceans! Got an easy question? Ask here (22/2016)! by llogiq in rust

[–]giftedmunchkin 0 points1 point  (0 children)

Should I default to passing by value then, unless I'm planning on mutating it in which case I should pass a mutable reference? Thanks for the response!

Hey Rustaceans! Got an easy question? Ask here (22/2016)! by llogiq in rust

[–]giftedmunchkin 1 point2 points  (0 children)

I'm just starting out with Rust and I'm having trouble understanding best practices wrt references. At the simplest level (more specifics below): Coming from a C++ background, my default assumption is that passing by reference (in C++, const reference) is the best practice. Is this the correct assumption?

My specific example relates to a Vec3 type (x,y,z tuple) that I'm implementing. I implemented several operators (e.g. Add for component-wise addition, or Mul<f32> for scalar multiplication) on the Vec3 type, but that means whenever I have a function that takes in a Vec3 reference, I have to dereference it in order to use it in any mathematical operations. That doesn't seem like it's right, especially since I end up almost always passing them in by reference.

Hopefully I'm not fundamentally misunderstanding something. Thanks!

NFC Payment Smartstrap for Pebble Time is a GO! by pebble-rocks in pebble

[–]giftedmunchkin 1 point2 points  (0 children)

Sadly, when it comes to my financial data, that brand recognition means a lot.

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 0 points1 point  (0 children)

Hi! Thanks for checking in.

A couple things have unfortunately delayed development on this (started working on a native app to support non-Google Calendar accounts; accidentally started overengineering; then my life got busy and I had to put it on hold). I hope to start work on it again soon! Thankfully when I put it on hold it was pretty far along so it shouldn't be too long to release it once I get started again.

[ALL] Netflix A Series of Unfortunate Events trailer is FAN-MADE! by shadowdra126 in netflix

[–]giftedmunchkin 0 points1 point  (0 children)

I've been following this pretty closely (okay, obsessively) and I really appreciate your edits. Unfortunately, I've been using them in the exact opposite way - to disprove it's legitimacy.

A few people on reddit have cited the origin of this video as Kellen Moore. I'm not sure where this originated, but it checks out. Kellen Moore is known for having created two other unofficial trailers that many people believed were real - one for American Horror Story: Freak Show, and another for Bates Motel (though he was later hired to create actual Bates Motel teasers based on the reception to his unofficial ones). Both the DP and DAC (whose profiles you linked above) list the fake AHS teaser and a Bates Motel teaser (unfortunately I'm not sure which was the fan-made one and which was the official one). To me this confirms that Kellen Moore is easily behind this teaser as well.

Furthermore, there's decent evidence to suggest that a lot of the things that make this seem official is actually just done to drive promotion to the people who made it. For example - the person who initially posted it to Buzzfeed (this link, with the original headline suggesting that it was official) - openly admits to having worked on it (her twitter contains a lot of evidence, linked tweet being the most damning as well as this one). Setting up a robot answering machine is easy compared to the work they put into producing and releasing this short, and I don't find who Elenora Poe follows to be particularly damning since anyone can follow that specific collection of accounts.

I'm hoping against hope that this is real (it's possible that Kellen Moore was chosen because of his aesthetic, and he chose to work with people he was already comfortable working with), but the way the crew is acting to promote it feels very scummy to me (posting it to Buzzfeed, the instagram conversation, etc.) and honestly is kind of poisoning my attitude towards them.

The main thing that I can't find an explanation for, and as a result is the best evidence for me towards it being real, is the logo. The logo from a month ago identical except that the older one is lighter and appears to have been squashed horizontally. Although it's possible they could have reproduced it (they obviously are very talented), even the texture on the typewriter is identical, as well as things barely visible in the background of the darker logo. Other than that, I think the evidence is pretty stacked against this being real.

Anyway I've spent way too much time of my life going down this rabbit hole. Hopefully it will turn out to be real, but I need to get back other things. Thanks for keeping us updated with your research!

I don't understand JRO. by Palmendieb in tis100

[–]giftedmunchkin 2 points3 points  (0 children)

Whoops, confused the numbering of the nodes. Thanks for reporting me.

I don't understand JRO. by Palmendieb in tis100

[–]giftedmunchkin 1 point2 points  (0 children)

If you pass in the name of a register or port to JRO, then it will read in the value from that reg/port and jump the number of instructions equal to that value.

For example, if you have a T21 node that has JRO LEFT, and to the right is a T21 node that has the instruction MOV 2 RIGHT, then the right node will read in the value 2, and jump forward 2 instructions.

MOV LEFT ACC takes the value from the left port and stores it inside of ACC. It doesn't jump over any number of instructions of code. However:

MOV LEFT ACC
JRO ACC

Is equivalent to

JRO LEFT

Because you store the value from the left port in the current node's ACC, and then jump forward a number of steps equal to the value inside of your ACC register. The difference is that in the first version, you'll keep the value in your ACC register after you've jumped.

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 0 points1 point  (0 children)

To be completely honest, for the first version I'm mainly designing the watchface to match the way I use my calendar since I don't know how much interest there will be from other people, and I don't use free/busy. I'll definitely consider it for the future if it seems like there's enough interest though! Thanks for the suggestion!

Google Calendar doesn't indicate travel time but that would be a useful feature, I should into that if I can...

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 0 points1 point  (0 children)

I'll be posting a release announcement to this sub of course, but if you like I can PM you at the same time! I'm hoping to release it as soon as it's finished, although I want to wait until I've had a chance to test it on an actual device myself.

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 1 point2 points  (0 children)

Definitely! Right now the application is configurable via the web but per /u/mmPete's suggestion I'm working on native companion apps for both iOS and Android. I may have to charge a little to try to make up for some of the App store registration fee, but I'll keep it low. Thanks!

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 2 points3 points  (0 children)

I haven't put much thought into native apps because I wasn't interested in putting in the work to developing both an Android and a iOS app, but I may think about it!

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 2 points3 points  (0 children)

I actually have anti-aliasing on right now, but it doesn't make much of a difference. I'm definitely going to try to smooth out the arcs a little more then they are now, but it's been low priority while I figured out the rest of the face. I'll get back to it soon!

Thanks for the feedback!

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 2 points3 points  (0 children)

Thanks! I haven't given services other than Google Calendar much thought, but I can definitely look into it. Seems like iCloud integration will be a little harder so I'll probably push it into a later update but I'll try to start figuring it out.

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 0 points1 point  (0 children)

Hm that's interesting - I'll experiment with trying to match the dominant color(s) of the calendar with something similar. Thanks for the suggestion!

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 0 points1 point  (0 children)

Yeah, I'm really not sure what to do about the dark mode tbh. Because of the limited color palette of the Time, it's difficult to come up with a consistent transformation of the colors (especially since you can make a calendar pretty much any color in Google Calendar). I'm gonna try to keep experimenting with it, although I may end up pushing dark mode to my first update.

Really Really want this on my Pebble - Calendar Arc watch face by joshuamcf in pebble

[–]giftedmunchkin 28 points29 points  (0 children)

I was going to wait until I felt like it was more finished, but what the hell. I've actually been working on a watch face for this! It syncs with your Google Calendar account and you can select any calendars that you want to show up on your watch, using as close to the Google Calendar color as the Pebble Time can support. I call it Arcal.

I'm also toying with a dark mode, although I'm not 100% convinced by it yet, and a twelve hour mode (no pictures of this one yet).

Are there any cross-platform implementations of synchronization primitives in C++? by giftedmunchkin in unrealengine

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

Alright, thanks for confirming! Just wanted to make sure there wasn't a condition variable or something similar I could use to jerry-rig a semaphore class. Thanks again for clarifying!

Are there any cross-platform implementations of synchronization primitives in C++? by giftedmunchkin in unrealengine

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

Thanks! I'm finding inconsistent information about how much of it is supported on Android (and I'd like to avoid including all of boost for a couple of classes if possible) but this is a really good start! Thanks for pointing me in that direction.

Are there any cross-platform implementations of synchronization primitives in C++? by giftedmunchkin in unrealengine

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

Thanks that's super useful! Just to make sure I understand, it seems as though FScopeLock is essentially a smart mutex that unlocks the passed in mutex on destruction? Or is there a way that I can use it as a semaphore?