Repository navigation
Replies: 2 comments
|
A practical Kotlin Multiplatform resource for the collection: building a reminder-input demo with DateParser Kotlin. It walks through sharing offline date/time parsing across Android, JVM and iOS while keeping the scheduling step in the application. I maintain the MIT-licensed library. It uses a documented rule-based grammar for English/Russian dates, ranges and recurrence periods, so it is also a small example of designing explicit parsing limits instead of accepting arbitrary natural language. Runnable consumer tests accompany the article. If the resource helps you, please consider a GitHub star. |
|
JavaScript note: test an area calculation before rounding it for display One metre contains ten decimetres, but a square metre contains a hundred square decimetres. This matters when checking a pupil’s decimal answer. Here’s a tiny exercise based on two examples we wrote for ModuMath. A 41.3 m by 23.3 m pond has a 2.7 m border. Keep the inputs in whole decimetres (413, 233 and 27). Subtract the pond area from the outer area before converting the result. This lets a unit test compare exact integers for these examples. function borderAreaDm2(lengthDm, widthDm, borderDm) {
const outerLength = lengthDm + 2 * borderDm;
const outerWidth = widthDm + 2 * borderDm;
return outerLength * outerWidth - lengthDm * widthDm;
}
const examples = [[413, 233, 27, 37800], [284, 164, 16, 15360]];
for (const [length, width, border, expected] of examples) {
if (borderAreaDm2(length, width, border) !== expected) {
throw new Error("Check the units or the two sides of the border");
}
}The outputs in square metres are 378 and 153.6. Try changing the |
Uh oh!
There was an error while loading. Please reload this page.
Welcome to the Code Note Repository! We believe in the power of collaboration to create a better, faster, and easier way of learning. This is a place where you can contribute to building a network of knowledge that helps everyone learn more effectively. We encourage all members to share ideas, notes, and useful resources.
Ways you can contribute:
Suggest Ideas or Request Topics
Share any topics or concepts you feel are missing or would be useful for others to learn. Your suggestions can help guide the direction of the repository.
Contribute by Sharing Your Notes and Works
All reactions