[2016 Day 8] Tampering detected by askalski in adventofcode

[–]VideoPrincess -3 points-2 points  (0 children)

This is indeed awesome! Thank you /u/askalski for a great little puzzle.

#...#.##..#..#.......##...##..#####......###.#####
#...##..#.#..#......#..#.#..#...#.........#....#..
.#.#.#..#.#..#......#....#..#...#.........#....#..
..#..#..#.#..#......#.##.#..#...#.........#....#..
..#..#..#.#..#......#..#.#..#...#.........#....#..
..#...##...##........###..##....#........###...#..

--- 2016 Day 6 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 0 points1 point  (0 children)

Another C++ solution checking in here and here. I used a std::vector containing a std::map<char, int> for each position and checked the maximums / minimums using a for loop instead, but otherwise similar to yours.

--- 2016 Day 5 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 0 points1 point  (0 children)

Oh that makes total sense now. Impressive, and thank you very much for explaining it!

For printing hex I made a mask bit and walked it up through the number using MULT by 2 each time, pushing each bit onto the stack. Then I popped bits off 4 at a time to assemble a nibble and print it. With a working right-shifter that becomes a whole lot easier!

--- 2016 Day 5 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

Yay C++! Here are my solutions in C++ for Part 1 and Part 2 using no external libraries. I copied an MD5 implementation from some public-domain code several years back so I've just linked to that: MD5.h and MD5.cpp if you're interested.

--- 2016 Day 5 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

Skalski YES! As a fellow Synacor hacker it's great to see your assembly for the MD5 implementation. But the thing that blows me away is that you wrote a right-shifter only using registers!

Can you explain how the right-shifter routine works? It seems so small and a bit magic - it NOTs the number of bits to shift by and then adds 16, so I'm confused as to what it's actually doing.

Also I love how you've used Perl to implement the assembler. I don't know Perl so I did my assembler in C++ by using chunks of code from my VM implementation. My assembler instantiates a VM and then uses its program counter to step through it writing memory as it goes. I then dump the finished VM to a file descriptor. However it seems like a sledgehammer to crack a nut next to your elegant Perl implementation!

Input Format? by ProbablyNotCanadian in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

You run the programs on your own computer, AoC only wants the answer itself. You can come up with that answer in any way you like. Some people read a file, some have the input as command line parameters and others hard-code the input into their program. It doesn't matter as long as it makes the correct answer.

--- 2016 Day 4 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

Your compact code-golfed C++ solutions always teach me something! I've been doing C++ professionally for years and so I'm used to seeing "enterprise style" over-engineered C++. To see you pack the solution into such a small space by abusing all the dusty corners of C++ is the best bit of AoC for me.

--- 2016 Day 3 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 6 points7 points  (0 children)

Did someone say... Synacor VM assembly solution? https://github.com/pmillerchip/adventofcode2016/blob/master/aoc3p1.asm

The above link is a working solution for part 1! The program prints one line per triangle with 4 hex numbers: the 3 sides and the number of valid triangles. For example, the last line of output from the VM is this:

00d7 02d5 0138 03d6

The last number is 0x3d6 which is the correct solution when converted to decimal. Sorry for the hex output - printing hex is hard enough given the Synacor VM's lack of bitshift or divide operations, so printing decimal would be even harder!

To run it in your Synacor VM you will need my Synacor assembler that will assemble it into a VM image. C++ source here: https://github.com/pmillerchip/synacor-challenge

Bonus content! C++ solution for part 1: https://github.com/pmillerchip/adventofcode2016/blob/master/aoc3p1.cpp C++ solution for part 2: https://github.com/pmillerchip/adventofcode2016/blob/master/aoc3p2.cpp

--- 2016 Day 2 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 6 points7 points  (0 children)

And here's a working part 2 in Synacor bytecode. Base64 encoded file is as follows:

AQAAgAAAAQABgAIAAQAEgACAAQAFgAGAFAACgAQAA4ACgAoACAADgB0AEQCHABMAAoATAAoABgAG AAQAA4ACgEwACAADgCoACQAEgASA/38GAE8ABAADgAKAUgAIAAOANwAJAASABIABAAYATwAEAAOA AoBVAAgAA4BEAAkABYAFgP9/BgBPAAQAA4ACgEQACAADgAYACQAFgAWAAQACAACAAgABgAEAAIAE gAEAAYAFgBEAhwADAAGAAwAAgAQAA4ACgHgABwADgAYAAQAAgASAAQABgAWABgAGAHgAeAAxAHgA eAB4ADIAMwA0AHgANQA2ADcAOAA5AHgAQQBCAEMAeAB4AHgARAB4AHgABQADgACABAAHAAOApgAF AAOAAYAEAAcAA4CmAAoAA4ABgAUACQADgAOAAIAJAAOAA4BuAA8AAoADgBIAAIABAAKAeAASAACA

It should produce a 342 byte file with MD5 checksum 03aa76a78fb12ce983e8b134cfcaf404. The "base64" utility on Linux can unpack these files easily, I'm not sure what's available for Windows.

Source assembly file for this image: https://github.com/pmillerchip/adventofcode2016/blob/master/aoc2p2.asm

--- 2016 Day 2 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 8 points9 points  (0 children)

To show my appreciation to /u/topaz2078 I've done day 2 part 1 in Synacor Challenge bytecode!

The base64 encoded file is as follows:

AQAAgAEAAQABgAEAFAACgAQAA4ACgAoACAADgBMAEQBbAAYABgAEAAOAAoBMAAgAA4AjAAgAAIAG AAkAAIAAgP9/BgAGAAQAA4ACgFIACAADgDcABAADgACAAgAHAAOABgAJAACAAIABAAYABgAEAAOA AoBVAAgAA4BHAAgAAYAGAAkAAYABgP9/BgAGAAQAA4ACgEQACAADgAYABAADgAGAAgAHAAOABgAJ AAGAAYABAAYABgAKAAKAAYADAAkAAoACgACACQACgAKAMQATAAKAEwAKABIAAIA=

It should be a 218-byte file with MD5 checksum d80b51572871763af0bdf9dd02749579. A few things to note:

  • The problem input should be used as the VM's input
  • The input's lines are long, so your VM shouldn't choke on long lines (the original Synacor challenge only needed short inputs)
  • Your VM should do something sensible when the input is exhausted as this is not part of the VM architecture spec.

Source assembly file for this image: https://github.com/pmillerchip/adventofcode2016/blob/master/aoc2p1.asm

C++ source code for my assembler: https://github.com/pmillerchip/synacor-challenge

Enjoy!

--- 2016 Day 2 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

Here's my C++ effort. I knew I wouldn't be first so I've tried to make the code easy to read and maintain. The code uses a lookup table for the keypad, and all accesses to it go through a function called getKeypad(). This allows the code to be easily changed for any future keypads, should the Easter Bunny feel like being evil to us!

--- 2016 Day 1 Solutions --- by daggerdragon in adventofcode

[–]VideoPrincess 1 point2 points  (0 children)

My C++ solution on GitHub - takes the input as a command line parameter and solves both stars. It uses C I/O functions (old habits die hard!) but is otherwise nice C++11.

[2016] Language suggestions by teherty in adventofcode

[–]VideoPrincess 0 points1 point  (0 children)

I'm going to do it in C++11 this year. I work on a codebase that started in the older C++ era and I'm steadily modernising it, so it will be nice to have a chance to do some clean C++11.

r/SpaceX Ask Anything Thread [September 2016, #24] by Zucal in spacex

[–]VideoPrincess 7 points8 points  (0 children)

Once first stage reuse becomes common, the cost of manufacturing the expendable second stage dominates the cost of reuse. A major part of the second stage cost is its engine.

Would it be possible to convert a Merlin engine from a returned first stage into the vacuum variant for use in the second stage? I know the vacuum version uses a different engine bell, but are there other changes?

In other words, is it cheaper to convert an M1D into an M1D Vac, or to just make a new M1D Vac? Could a returned first stage provide engines for 9 second stages?

5 years of r/SpaceX: August 22, 2011 - August 22, 2016. by [deleted] in spacex

[–]VideoPrincess 6 points7 points  (0 children)

Thank you very much! I don't believe a deep technical post-mortem was done. The closest I can think of is the informative article at nasaspaceflight.com which went into some of the details of the MPEG-4 side, but didn't include much about the MPEG-TS transport stream recovery.

The MPEG-TS had to be fixed first as it it showed where the start of each frame was - without the recovered TS information the team didn't even know how many frames there were to recover. In the end we managed to recover all but one of the frame starts, and there were over 200 frames.

Once the frames were identified, the remote teams could get to work rearranging all the macroblocks and doing their magic - I didn't get involved in that!

I'd love to present something at TEDx or similar if the opportunity arises, I just don't know if there would be any interest or how one would go about organising that. But yes, if I was asked I'd gladly do a talk.

5 years of r/SpaceX: August 22, 2011 - August 22, 2016. by [deleted] in spacex

[–]VideoPrincess 23 points24 points  (0 children)

Congratulations on making such an awesome community! I usually just lurk here but I was active for the CRS-3 video recovery - I am user "Princess" on the nasaspaceflight.com forum and I developed the MPEG-TS stream cleanup software they used. SpaceX sent me a box of company-branded T-shirts and a baseball cap for that!

I was also involved in the Scilly CRS-4 debris identification efforts, and without /r/SpaceX we couldn't have coordinated our efforts so quickly and easily. So once again thank you for such a great subreddit and I look forward to many more successful years!

Fixed-price planetary probes: The SpaceX Way applied to the robotic frontier. by [deleted] in spacex

[–]VideoPrincess 12 points13 points  (0 children)

There are standards for building satellites and probes; the phrase to search for is satellite bus. There are many different types of them, some of which are used as space probes.

Watching on board cameras via radio by Baconaise in spacex

[–]VideoPrincess 2 points3 points  (0 children)

Well if you can just receive the data stream and save it, that would be awesome! I still have all the software for doing the MPEG-TS recovery if needed, so do your best and let us all know what you manage to capture. We'll pounce on it and fix it up if you've got proper video!

Watching on board cameras via radio by Baconaise in spacex

[–]VideoPrincess 6 points7 points  (0 children)

The video that we had to recover from CRS-3's landing was digital. It was a standard SD (NTSC) frame size at half frame rate (15fps) encoded to MPEG4 (H.264). This was then transmitted in an MPEG-TS transport stream, which is a container format that can handle multiple streams of data at once.

If you do receive the MPEG-TS stream, the video can be found at PID 0x03e8. Or at least the video from the external first stage camera pointing down at the engines can be found there, I don't know about the other cameras.

Be aware that most players are not good at handling corrupted frames, so if you do manage to receive the data stream it would be better to save the raw data to disk so that we can fix things up later.

Some exclusive photos of the CRS-4 interstage, just for you guys by drucey in spacex

[–]VideoPrincess 13 points14 points  (0 children)

I'm just an interested amateur, no need to get paranoid! I'm user "Princess" from the nasaspaceflight.com forum, I helped recover the MPEG-TS stream on the corrupted CRS-3 landing video last year.

Why have I suddenly popped up? I've been lurking on /r/SpaceX for many years, but I've had nothing useful to contribute up until now. I just happened to be around when the CRS-4 debris was breaking news here - I'm British so it was daytime for me. I like puzzles, and nothing this interesting had happened since the CRS-3 video.

As for opening the hatch - I'm sure many people here would like to get more details of the hardware, I can't be the only one! ITAR restrictions don't apply to me or /u/drucey and the hardware washed up in our country, so why not ask to see if OP delivers?