remark | A simple , in-browser , markdown-driven slideshow tool
kandi X-RAY | remark Summary
kandi X-RAY | remark Summary
A simple, in-browser, markdown-driven slideshow tool targeted at people who know their way around HTML and CSS, featuring:. Check out this remark slideshow for a brief introduction. To render your Markdown-based slideshow on the fly, checkout Remarkise.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of remark
remark Key Features
remark Examples and Code Snippets
def calculate_prob(text: str) -> None:
"""
This method takes path and two dict as argument
and than calculates entropy of them.
:param dict:
:param dict:
:return: Prints
1) Entropy of information based on 1 alphabet
function remark(responseTime) {
var responseString = "";
if (responseTime < 0.6) {
responseString = "Dang you defeated Levi!";
}
if (responseTime >= 0.6) {
responseString = "Noice :)";
}
if (responseTime >= 0.8) {
res
Community Discussions
Trending Discussions on remark
QUESTION
I'm trying to make sure gcc vectorizes my loops. It turns out, that by using -march=znver1
(or -march=native
) gcc skips some loops even though they can be vectorized. Why does this happen?
In this code, the second loop, which multiplies each element by a scalar is not vectorised:
...ANSWER
Answered 2022-Apr-10 at 02:47The default -mtune=generic
has -mprefer-vector-width=256
, and -mavx2
doesn't change that.
znver1 implies -mprefer-vector-width=128
, because that's all the native width of the HW. An instruction using 32-byte YMM vectors decodes to at least 2 uops, more if it's a lane-crossing shuffle. For simple vertical SIMD like this, 32-byte vectors would be ok; the pipeline handles 2-uop instructions efficiently. (And I think is 6 uops wide but only 5 instructions wide, so max front-end throughput isn't available using only 1-uop instructions). But when vectorization would require shuffling, e.g. with arrays of different element widths, GCC code-gen can get messier with 256-bit or wider.
And vmovdqa ymm0, ymm1
mov-elimination only works on the low 128-bit half on Zen1. Also, normally using 256-bit vectors would imply one should use vzeroupper
afterwards, to avoid performance problems on other CPUs (but not Zen1).
I don't know how Zen1 handles misaligned 32-byte loads/stores where each 16-byte half is aligned but in separate cache lines. If that performs well, GCC might want to consider increasing the znver1 -mprefer-vector-width
to 256. But wider vectors means more cleanup code if the size isn't known to be a multiple of the vector width.
Ideally GCC would be able to detect easy cases like this and use 256-bit vectors there. (Pure vertical, no mixing of element widths, constant size that's am multiple of 32 bytes.) At least on CPUs where that's fine: znver1, but not bdver2 for example where 256-bit stores are always slow due to a CPU design bug.
You can see the result of this choice in the way it vectorizes your first loop, the memset-like loop, with a vmovdqu [rdx], xmm0
. https://godbolt.org/z/E5Tq7Gfzc
So given that GCC has decided to only use 128-bit vectors, which can only hold two uint64_t
elements, it (rightly or wrongly) decides it wouldn't be worth using vpsllq
/ vpaddd
to implement qword *5
as (v<<2) + v
, vs. doing it with integer in one LEA instruction.
Almost certainly wrongly in this case, since it still requires a separate load and store for every element or pair of elements. (And loop overhead since GCC's default is not to unroll except with PGO, -fprofile-use
. SIMD is like loop unrolling, especially on a CPU that handles 256-bit vectors as 2 separate uops.)
I'm not sure exactly what GCC means by "not vectorized: unsupported data-type". x86 doesn't have a SIMD uint64_t
multiply instruction until AVX-512, so perhaps GCC assigns it a cost based on the general case of having to emulate it with multiple 32x32 => 64-bit pmuludq
instructions and a bunch of shuffles. And it's only after it gets over that hump that it realizes that it's actually quite cheap for a constant like 5
with only 2 set bits?
That would explain GCC's decision-making process here, but I'm not sure it's exactly the right explanation. Still, these kinds of factors are what happen in a complex piece of machinery like a compiler. A skilled human can easily make smarter choices, but compilers just do sequences of optimization passes that don't always consider the big picture and all the details at the same time.
-mprefer-vector-width=256
doesn't help:
Not vectorizing uint64_t *= 5
seems to be a GCC9 regression
(The benchmarks in the question confirm that an actual Zen1 CPU gets a nearly 2x speedup, as expected from doing 2x uint64 in 6 uops vs. 1x in 5 uops with scalar. Or 4x uint64_t in 10 uops with 256-bit vectors, including two 128-bit stores which will be the throughput bottleneck along with the front-end.)
Even with -march=znver1 -O3 -mprefer-vector-width=256
, we don't get the *= 5
loop vectorized with GCC9, 10, or 11, or current trunk. As you say, we do with -march=znver2
. https://godbolt.org/z/dMTh7Wxcq
We do get vectorization with those options for uint32_t
(even leaving the vector width at 128-bit). Scalar would cost 4 operations per vector uop (not instruction), regardless of 128 or 256-bit vectorization on Zen1, so this doesn't tell us whether *=
is what makes the cost-model decide not to vectorize, or just the 2 vs. 4 elements per 128-bit internal uop.
With uint64_t
, changing to arr[i] += arr[i]<<2;
still doesn't vectorize, but arr[i] <<= 1;
does. (https://godbolt.org/z/6PMn93Y5G). Even arr[i] <<= 2;
and arr[i] += 123
in the same loop vectorize, to the same instructions that GCC thinks aren't worth it for vectorizing *= 5
, just different operands, constant instead of the original vector again. (Scalar could still use one LEA). So clearly the cost-model isn't looking as far as final x86 asm machine instructions, but I don't know why arr[i] += arr[i]
would be considered more expensive than arr[i] <<= 1;
which is exactly the same thing.
GCC8 does vectorize your loop, even with 128-bit vector width: https://godbolt.org/z/5o6qjc7f6
QUESTION
My flutter app run well, but when I try to upload the app to App Store by archive it:
Xcode -> Product -> Archive
it failed and get two errors
First one in flutter_inappwebview with following error message:
ANSWER
Answered 2022-Mar-22 at 07:22Downgrading Xcode from 13.3 to 13.2.1 solved my problems.
QUESTION
I tried to find the error myself, but don't see it. The following code produces warnings (same problem in Perl 5.18.2 and 5.32.1).
...ANSWER
Answered 2022-Mar-24 at 15:16Normally, the sort
function uses two package variables called $a
and $b
to do the sorting. Specifically, sort
sets the variables called $a
and $b
on the current package to be the current sort values. Those are not arguments to your { $count{$b} <=> $count{$a} }
block; they're global variables in the current package.
Now, $b
is fine. Since you never do anything else with it, Perl picks up the package variable just fine. But you declared a lexical (my
) variable called $a
earlier in your code, and that lexical is shadowing the package variable.
So sort
is setting a variable called, effectively, $YourPackage::a
, and your code is accessing a local variable called my $a
, which is unrelated to the other one.
You can fix this by changing the my $a = join '',@words;
variable to be called something else, and in fact you should probably do that. The names $a
, $b
, and $_
are used for things like this indiscriminately in Perl for historical reasons, so it's probably best to never have your own variables named any of those names.
But if you don't want to (or can't) change any of the rest of the code, you can expose the package variable with our
.
QUESTION
I was trying to follow the documentation on including rehype plugins for gatsby-plugin-mdx. Specifically I was trying to use the rehype-slug
plugin. I installed the packaged with npm and set my gatsby.config.js
file to
ANSWER
Answered 2021-Sep-14 at 04:51Not sure if it will work but, instead of using require from ES modules have you tried something like:
QUESTION
[NOTE: I asked this question based on an older version of Rakudo. As explained in the accepted answer, the confusing output was the result of Rakudo bugs, which have now been resolved. I've left the original version of the Q below for historical reference.]
Raku sometimes prohibits re-binding; both of the following lines
...ANSWER
Answered 2021-Sep-22 at 00:26A decidedly non-authoritative answer. Curiously, like jnthn in your prior Q, it feels natural to answer your questions in reverse order:
Is there any way to tell Raku "don't rebind this name to a new value, no-really-I-mean-it"?
As far as I can tell so far -- purely by testing variations, not by checking roast or the compiler source -- you can and must declare a sigil free symbol, and it must not be one declared with my \symbol ...
:
QUESTION
I am working on a Next.js project using TypeScript and for testing I use Jest and React Testing Lib. However, I encounter a SyntaxError: Cannot use import statement outside a module for components where I import rehype-raw.
As far as I understand this, Jest does not support ES6 so node_modules may need to be transformed. This can be configured using transformIgnorePatterns
. For example if rehype-raw
is causing this error using "transformIgnorePatterns": ["node_modules/(?!rehype-raw)/"]
should allow transformation of the rehype-raw
but no other module. And thus solve this error.
However, this does not work for me. But idk why and how I can solve this. No suggested solution I have found could solve this problem. I have attached my error output, jest.config.js and babel.rc file below.
Error output
...ANSWER
Answered 2022-Jan-30 at 16:55Did you already use type:"module" in package.json?
QUESTION
After migrating from Remark to MDX, my builds on Netlify are failing.
I get this error when trying to build:
...ANSWER
Answered 2022-Jan-08 at 07:21The problem is that you have Node 17.2.0. locally but in Netlify's environment, you are running a lower version (by default it's not set as 17.2.0). So the local environment is OK, Netlify environment is KO because of this mismatch of Node versions.
When Netlify deploys your site it installs and builds again your site so you should ensure that both environments work under the same conditions. Otherwise, both node_modules
will differ so your application will have different behavior or eventually won't even build because of dependency errors.
You can easily play with the Node version in multiple ways but I'd recommend using the .nvmrc
file. Just run the following command in the root of your project:
QUESTION
I have written a code for NA button in which it disable the question after click.But if user click it by mistake i am not able to make it enable after 2nd click.
Below is the code for button.
...ANSWER
Answered 2021-Dec-15 at 09:54I've would change 2 things reguarding this problem.
1: $('.answers.disabled').not($(this).closest('.answers')).length
^this counts all .answers
that is disabled, but not the one you click on. That will ensure that we can enable the input if it's disabled.
2: $(this).closest('.answers').find("input").attr('disabled', !$(this).closest('.answers').find("input").is(":disabled")); $(this).closest('.answers').toggleClass('disabled')
^This will switch between disabled and enabled based on if it's disabled or ntoe.
Result
QUESTION
Is there a difference between the UUIDs created by calling UuidCreate and CoCreateGuid from the Win32 API?
The documentation says CoCreateGuid just calls UuidCreate, but the remarks in the documentation are quite different.
Only CoCreateGuid specifically mentions the use case:
[...] absolutely unique number that you will use as a persistent identifier in a distributed environment.
While Uuidcreate is instead focused on explaining the non-traceability:
[...] generates a UUID that cannot be traced to the ethernet address of the computer on which it was generated. It also cannot be associated with other UUIDs created on the same computer.
I assume the difference might just be historic, the doc mentions UuidCreate was changed from MAC-based version 1 UUIDs to random non-traceable version 4 some time in the past for security reasons. UuidCreateSequential was introduced if MAC based UUIDs are needed.
If so, the return values of UuidCreate (RPC_S_OK, RPC_S_UUID_LOCAL_ONLY, RPC_S_UUID_NO_ADDRESS) are nowadays just included for legacy compatibility, and basically obsolete?
Does anyone know more about this? As far as I can tell, there is no difference.
...ANSWER
Answered 2021-Sep-21 at 13:38CoCreateGuid calls UuidCreate.
UuidCreate
used to be the only function, and it was a type 1 (mac + datetime) uuid.
Later, after a kid was arrested after software he wrote was traced back to his laptop because of his MAC address, Windows Vista changed UuidCreate
to be a type 4 (random) uuid.
And Microsoft added UuidCreateSequential
as the legacy type 1 uuid.
For security reasons, UuidCreate was modified so that it no longer uses a machine's MAC address to generate UUIDs. UuidCreateSequential was introduced to allow creation of UUIDs using the MAC address of a machine's Ethernet card.
QUESTION
This is from a Java process running with a 24G heap, G1GC, on some open source variant of JDK 11.
...ANSWER
Answered 2021-Sep-14 at 10:19Yes, its not a pause time.
You can also add safepoint logger to see any additional pauses.
But otherwise I think all actual pauses are logged in clear way, stating what part is a pause. For examplePause Young (Mixed) (G1 Evacuation Pause)
It should be
GC(number of GC) Concurrent Mark(clock start time, clock end time) time
Where click time is relative time from aplication launch. And time at the end is just how long it took, also real wall time. You can verify this stright in the source: https://github.com/openjdk/jdk/blob/7ccf4358256a0fef895e4081f90b04f71d21bf9d/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp#L184-L220
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install remark
Create an HTML file to contain your slideshow (see boilerplate below)
Open the HTML file in a decent browser
Edit the Markdown and/or CSS styles as needed, save and refresh!
Press C to clone a display; then press P to switch to presenter mode. Open help menu with h.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page