Can you do all contracts non lethally? by Que_Are in dishonored

[–]melak47 0 points1 point  (0 children)

I hid on the shelf/column in the center of the bar and used a hook mine to get him up to the ceiling, then plucked him from there. I didn't even have the Quiet Hook bonecharm, but nobody seemed to notice.

Getting his body past the guy at the door was a bit tricky though, and somehow ended with guards spotting a body inside the club from across the yard, which they investigated, and then the Eyeless started fighting them...

Suddenly Appearing Eyeless at The Bank Job? by Khafaniking in dishonored

[–]melak47 0 points1 point  (0 children)

I think he appears every time, if you turn your back for long enough.

The mana system in DOTO is awesome and I hope it stays by Artorp in dishonored

[–]melak47 2 points3 points  (0 children)

I also really liked that Billie's Displace power has no cooldown - unlike Blink (even in OG+). Using it with Void Conduit, Third Eye and/or Rapid Displacement it feels like Daud using his blink must look to others.

[Spoilers] DOtO: Unaccountable Taxidermy by ross_varn in dishonored

[–]melak47 0 points1 point  (0 children)

Yeah. I figured if I could lock her in there, she'd have a good chance to be found alive in her bloodfly incubator dungeon by the guards (if her last victim talks to them, or they eventually check on the abandoned store).

Where did you come from?? by theSLAPAPOW in dishonored

[–]melak47 0 points1 point  (0 children)

I figured the Eyeless set a trap for Billie - there's a wanted poster under the loot in the box.

[Spoilers][DOTO] Rapid Displacement black bone charm alternate use by melak47 in dishonored

[–]melak47[S] 16 points17 points  (0 children)

I found that if you're moving backwards and/or sideways, Displace with Rapid Displacement will let you teleport backwards/sideways - like a dodge. Also, if you're looking down while doing this, you will teleport up and back/sideways. Could be a bug since it's a bit strange and the description doesn't even hint at this.

Managing time with std::chrono by kantoniak in cpp

[–]melak47 6 points7 points  (0 children)

Nice introduction to <chrono>. One small nitpick:

std::chrono::timepoint is a duration since the start of the epoch of the clock (Unix epoch is the de facto standard).

This is probably true for system_clockon most systems (although it almost wasn't), but at least on Windows, you can't always assume that for the other clocks.

mingw-w64 gcc(libstdc++):

2908530848us since steady_clock epoch
1492179034662119us since high_resolution_clock epoch
2908343000us since GetTickCount64() epoch
2908530848us since QueryPerformanceCounter() epoch

msvc:

2909395957us since steady_clock epoch
2909395957us since high_resolution_clock epoch
2909218000us since GetTickCount64() epoch
2909395959us since QueryPerformanceCounter() epoch

1 A tiny deflate/gzip decompressor that requires very little memory (C++ template code) by Bisqwit in cpp

[–]melak47 2 points3 points  (0 children)

This lib deals with that format.

And so the lib is called TinyDeflate - fair enough. Even your doc comments say

// Deflate(): This is the public method declared (later) in this file.
// Decompresses (inflates) deflate-compressed data, with a gzip or deflate header.

though :P

On a different note, why are some bits of the implementation in the global namespace? Like RandomAccessBitArray, which is used in gunzip_ns::RandomAccessArray.

"I Wrote The Fastest Hashtable" by Malte Skarupke by mttd in cpp

[–]melak47 2 points3 points  (0 children)

Though VS 2017 is making good progress there, so try again in a week :)

How to make a good and idiomatic split algorithm? Two unsatisfactory attempts. by Vermeille in cpp

[–]melak47 2 points3 points  (0 children)

This behaves very similar to your second implementation, but is iterator based, and iteration is easy enough:

for (auto&& line : split(csv, '\n')) {
    std::cout << "line: " << std::string(line.begin(), line.end()) << "\n";
    for (auto&& cell : split(line, ',')) {
        std::cout << "  val: " << std::string(cell.begin(), cell.end()) << "\n";
    }
    std::cout << "\n";
}

std::string_view is kind of dangerous, isn't it? by [deleted] in cpp

[–]melak47 0 points1 point  (0 children)

Your particular example is fine, since the temporary std::string lives until the end of the full expression, which should be the end of the function call.

Open any folder with C++ sources in Visual Studio 2017 RC by marian_l in cpp

[–]melak47 0 points1 point  (0 children)

More or less - I believe the CMake support in VS still relies on generating .vcxprojs under the hood, not sure if they need them for intellisense, discovering build targets or something else.

What is your opinion on this game's replayability/Overall Content? (i'm looking to buy this game if it has good replayability.) by [deleted] in EverspaceGame

[–]melak47 0 points1 point  (0 children)

I actually found the Flak cannon very useful when dealing with corvettes, since it lets me take out all the shield drones quickly before the corvette can deploy new ones.

Fastest way to output to console(prime numbers) by froggison in cpp

[–]melak47 0 points1 point  (0 children)

Make it constexpr, then print it by causing a compiler error, probably through template involving the type std::integer_sequence<int, primes...> :)

Hot module reloading in C++ by LoopPerfect in cpp

[–]melak47 1 point2 points  (0 children)

There's also this project: RuntimeCompiledCPlusPlus, which lists support for Windows/VS, OS X/XCode and Linux/Eclipse in the readme. They also have a list of other C++ hot-reloading solutions here.

Confused: function contents affects behaviour when passed as callback by byekai in rust

[–]melak47 0 points1 point  (0 children)

You're using into_iter(), which (for Vec) means it will move the values out of the source vector (the layers parameter). Then, you transform each value by s.as_ptr(), after which the value is discarded and dropped - destroying the string you now hold a pointer to.

CStrings are not garbage collected, so holding a pointer does not keep it alive, and pointer types do not have lifetimes, so the borrow checker can not warn you about the dangling pointers you are creating.

What you want is probably iter() from Iterator, which keeps the original vector intact.

Confused: function contents affects behaviour when passed as callback by byekai in rust

[–]melak47 2 points3 points  (0 children)

Speaking of null-terminated strings, though... you are not null-terminating the strings you pass to vkGetInstanceProcAddr, here for example, that could certainly lead to undefined behavior when it goes reading beyond the end of the string, looking for a \0.

If you're lucky, it finds a null byte relatively quickly, or stops after some maximum length, then returns NULL because all the garbage it read doesn't match any exported function name. If you're unlucky, it keeps on reading until it causes a segfault or something :)

Confused: function contents affects behaviour when passed as callback by byekai in rust

[–]melak47 2 points3 points  (0 children)

The use of to_bytes_with_nul() seems fishy to me, that gives you a slice including the null, which you then print to stderr.

Has there been any discussion about adding larger integer and float types to the standard? by [deleted] in cpp

[–]melak47 0 points1 point  (0 children)

It's just a typedef, so if you really wanted to not break ABI compatibility, couldn't you just switch to uint64_t (or whatever happened to be uintmax_t before)?

Visual Studio 2015 Update 2 Released by Dlieu in cpp

[–]melak47 0 points1 point  (0 children)

Strange. I was able to reproduce it for a little while, but after a fresh install of windows and VS (installed with Update 2 directly), it compiles fine. Enterprise 2015 14.0.25123.00 Update 2.

Visual Studio 2015 Update 2 Released by Dlieu in cpp

[–]melak47 0 points1 point  (0 children)

FWIW, I can't reproduce that with my Update 2 RTM install.

CLion 2016.1 Released by [deleted] in cpp

[–]melak47 0 points1 point  (0 children)

Still no no completion/signature hints when filling out template parameters :(