scratchpad | scratchpad is a place for notes
kandi X-RAY | scratchpad Summary
kandi X-RAY | scratchpad Summary
scratchpad is a place for notes. The notes are saved in your browser so they should be there when you come back.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Filter suggestions based on suggestions
- shuffle items in order
- change event handler
- Remove duplicated suggestions
- Matches a regex .
- Generates a random password .
- Replace the suggestion with the given reason .
- Get the column position of a given line .
- Repeats a string .
- Generate the index of a line starting from a given line .
scratchpad Key Features
scratchpad Examples and Code Snippets
Community Discussions
Trending Discussions on scratchpad
QUESTION
I'm trying to setup a simple project using Typescript and Parcel.
Within this project, I'm trying to import a .html
file (or, more accurately, its path) from a .ts
:
ANSWER
Answered 2022-Apr-15 at 12:54Parcel string inlining is done using bundle-text:
prefix.
QUESTION
Hi guys when my page is full screen the main content scrolls and nav is fixed.
What I would like to do is set the nav to a smaller heigher (e.g. 250px) and have the nav links scroll to take up less space.
I can't see all of the nav when it is set to scroll.
Code below! I have used a CSS style reset not shown.
...ANSWER
Answered 2022-Mar-11 at 14:23Here you go...
Add this to your CSS:
QUESTION
I followed the MMIO Peripherals page from the Chipyard documentation to learn about adding modules to rocket-chip within Chipyard framework - and all that seems to have worked pretty well. I summed up my experiences and tried to write it in a slower pace on the pages of the Chisel Learning Journey <== adding that only if the person answering question may want to take a look and see that I've got everything working correctly. In other words, I added the MMIO with in the example
package of Chipyard and it compiles, generates simulator, responds properly to toy benchmark I devised, I even see the corresponding waveforms in gtkwave.
Now, the next step I would like to take is to separate this dummy design (it literally just reads from a memory mapped register that holds a hardcoded value) from the chipyard/rocket-chip infrastructure in the sense that it is housed in a separate repo, that will become a submodule of my chipyard. So, to do that, I've started from this page and took all the steps as given there:
- a new repo was created, called it
my-chip
- into the
my-chip
I addedbuild.sbt
of the following content:
ANSWER
Answered 2022-Mar-03 at 16:36The error comes from the -
in lazy val my-chip
and package my-chip
. If you want to use a -
in a scala name you can wrap the name in backticks, like `my-chip`
.
QUESTION
TL;DR: The issue will be fixed in version 3.0 of TextX. The workaround is to use regex for matching escaped (\
) characters, such as \n
.
FULL QUESTION: Using TextX, I am parsing a homegrown mark-up language, where paragraph and line breaks are significant. I think I am missing a fundamental understanding when trying to match new lines: Why are "\n"
and "\n\n"
not working, while their regex counterparts /\n/
and /\n\n/
do?
NOTE: whitespace is redefined at parser level to exclude \n
using ws=" \t"
.
ANSWER
Answered 2022-Mar-01 at 17:16It is the problem addressed in the current development version. Please see this textX issue.
The fix will be a part of the upcoming textX 3.0 release.
QUESTION
VS Code version: 1.64.2
Prettier Extension version: 9.2.0
I want it so Prettier runs on auto save, which should be every 500 milliseconds. I have the following in my workspace JSON:
...ANSWER
Answered 2022-Feb-20 at 02:38Going by this answer, the editor cannot format on save when the afterDelay
option is selected. It has to be either onFocusChange
or onWindowChange
.
As an example, a user level JSON file that looks like this will work. It will automatically save and format the file when focus is taken off the editor (by, say, clicking on another open file):
QUESTION
Using:
- Delphi 10.2.3 Tokyo
- IPWorks SSL, IPWorks Encrypt
I'm writing a Delphi app to get order list from Amazon MWS API.
I've followed their instructions here:
and here:
But I am stuck at the signature generation process, specifically generating the Base64 HMAC.
I'm using IPWorks SSL components (Hash component) and am able to generate the SHA 256 signature based on the inputs. Upto this step everything is okay.
Its the next step that I am unable / unsure how to perform.
I'm using the Amazon scratchpad to generate the request and am seeing the request details, and the signatures generated: both SHA 256 and then the Base 64.
My Delphi code does not produce a Base 64 string like the one generated in the scratchpad. Please see the attached screen capture (sensitive information has been redacted).
This is my Delphi code to convert the SHA 256 string to Base 64:
...ANSWER
Answered 2021-Oct-30 at 20:29That's because you don't understand the whole point of Base64 at all, including how to write it correctly. Its main purpose is to carry 8bit data (i.e. whole bytes) safely thru 7bit (i.e. ASCII):
- When encoding 6bits are taken and displayed as one letter.
- When decoding one letter is taken and 6bit of original data are restored.
Which is also the reason why encoding inflates the size by 1/3. When sending attachments in emails the former are stored in Base64, because emails are only 7bit safe. Which is the reason why sending a 4 MiB big picture ends up producing an email of at least 5.2 MiB.
No, it makes no sense to Base64 encode something that is already ASCII and as such 7bit safe. Everybody should be alarmed when someone wants him to Base64 encode the text 9660152e55a7178db9a9521cd80b7f4872f4be2290d1dd0f32205708f2e06589
.
You want to encode bytes, not text. What you see is the hex representation of those bytes. You actually want this:
QUESTION
I would like to make run an old N-body which uses OpenCL.
I have 2 cards NVIDIA A6000 with NVLink
, a component which binds from an hardware (and maybe software ?) point of view these 2 GPU cards.
But at the execution, I get the following result:
Here is the kernel code used (I have put pragma that I estimate useful for NVIDIA cards):
...ANSWER
Answered 2021-Aug-07 at 12:36Your kernel code looks good and the cache tiling implementation is correct. Only make sure that the number of bodies is a multiple of local size, or alternatively limit the inner for loop to the global size additionally.
OpenCL allows usage of multiple devices in parallel. You need to make a thread with a queue for each device separately. You also need to take care of device-device communications and synchronization manually. Data transfer happens over PCIe (you also can do remote direct memory access); but you can't use NVLink with OpenCL. This should not be an issue in your case though as you need only little data transfer compared to the amount of arithmetic.
A few more remarks:
- In many cases N-body requires FP64 to sum up the forces and resolve positions at very different length scales. However on the A6000, FP64 performance is very poor, just like on GeForce Ampere. FP32 would be significantly (~64x) faster, but is likely insufficient in terms of accuracy here. For efficient FP64 you would need an A100 or MI100.
- Instead of 1.0/sqrt, use rsqrt. This is hardware supported and almost as fast as a multiplication.
- Make sure to use either FP32 float (1.0f) or FP64 double (1.0) literals consistently. Using double literals with float triggers double arithmetic and casting of the result back to float which is much slower.
EDIT: To help you out with the error message: Most probably the error at clCreateKernel
(what value does status
have after calling clCreateKernel
?) hints that program
is invalid. This might be because you give clBuildProgram
a vector of 2 devices, but set the number of devices to only 1 and also have context
only for 1 device. Try
QUESTION
I'm creating small scratchpad app. The entire app is single column and 3 rows. The row0 will have a close button aligned to the right, row1 is the Text area and row2 will have a few buttons to format the text + 1 button to delete/clear the text area. I want that delete/clear button to align to the right while the rest of the buttons will align to the left such that there's a space between the format buttons and the delete button. So that you don't accidentally clear the text. Here is the code:
...ANSWER
Answered 2021-Sep-19 at 15:08You can use grid_columnconfigure
to get it to work:
QUESTION
The following array contains a sample of data from a larger data set -
...ANSWER
Answered 2021-Sep-17 at 06:39You can use usort
to accomplish this with isset
checks for versesFirst
key.
Snippet:
QUESTION
ANSWER
Answered 2021-Sep-01 at 13:52- Add maven to project
- Build uberjar with http://maven.apache.org/plugins/maven-shade-plugin/
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scratchpad
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