id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
Miigon_blog/sort6_40_0.txt | The reference to the original array, now sorted. Note that the array is sorted
in place , and no copy is made.
## Description | |
Miigon_blog/638132_2_0.txt | I have a tag - “Today”. That tag, say has 20 tasks. When that tag is open in a
window, I can manually sort the order of tasks, and when I switch to say
another tag and come back to “Today” tag, the manual resort that I did, is
retained. So Omnifocus has a way to know the order to display the tasks in.
What I would lik... | |
Miigon_blog/sort6_57_0.txt | There is an open source library available called mapsort which applies this
approach.
### sort() returns the reference to the same array | |
Miigon_blog/638132_40_0.txt | > My vote for the book. Or a short post here or on a blog.
I will consider it. In the meantime, just ask here if you find something
unfamiliar. | |
Miigon_blog/3097419_18_0.txt | Resolution
function alphabeticalOrder(arr) {
// Add your code below this line
return arr.sort();
// Add your code above this line
}
alphabeticalOrder(["a", "d", "c", "a", "z", "g"]);
| |
Miigon_blog/choosing-javascript-sorting-algorithm8_4_0.txt | 109
Oct 26, 2023 ⋅ 11 min read | |
Miigon_blog/sort6_42_0.txt | Note: In UTF-16, Unicode characters above ` \uFFFF ` are encoded as two
surrogate code units, of the range ` \uD800 ` \- ` \uDFFF ` . The value of
each code unit is taken separately into account for the comparison. Thus the
character formed by the surrogate pair ` \uD855\uDE51 ` will be sorted before
the character ` \... | |
Miigon_blog/638132_16_0.txt | Am unfamiliar with Omni Automation - sounds like what you are using is not JXA
but Omni Automation. And sounds like moveTasks will only move relative to a
project?
* * * | |
Miigon_blog/choosing-javascript-sorting-algorithm8_72_0.txt | Loading Comments...
Write a Comment... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_9_0.txt | There are many popular sorting algorithms, each with its advantages and
disadvantages. Different data-sorting techniques can affect the speed and
efficiency of computations. Inefficient sorting can result in sluggish system
performance and negatively impact UX.
It’s crucial to choose the appropriate sorting technique ... | |
Miigon_blog/638132_14_0.txt | sam70 October 23, 2021, 11:53pm #6
unlocked2412: | |
Miigon_blog/638132_42_0.txt | > Did that proved useful to solve your problem, or were you referring to
> something else ?
@unlocked2412 thank you for helping and for your time. I have not been able
to get to this as got tied up with some work. Will get to it. | |
Miigon_blog/638132_46_0.txt | sam70:
> add tasks with Today tag and the right order estimated time to add the task
> to the perspective. | |
Miigon_blog/638132_20_0.txt | unlocked2412 October 24, 2021, 5:33pm #7
sam70: | |
Miigon_blog/3097419_22_0.txt | s0ukke05 August 28, 2019, 3:54am 7
The a and b in the sort method will refer to 2 numbers in what you are trying
to iterate over. For example, with this given array: | |
Miigon_blog/638132_1_0.txt | Automation OmniFocus Automation
sam70 October 23, 2021, 3:45pm #1 | |
Miigon_blog/3097419_19_0.txt | Jessica2019 August 28, 2019, 3:27am 6
Thanks! @JacksonBates @snowmonkey | |
Miigon_blog/3097419_17_0.txt | Hi @snowmonkey and @JacksonBates
Is mine code a good solution or a bad one? Or not correct in this case? What
do you think guys?
| |
Miigon_blog/638132_31_0.txt | github.com
### GitHub - RobTrew/prelude-jxa: Generic functions for macOS and iOS
scripting in... | |
Miigon_blog/Miigon_blog_4_7.txt | edia ](//en.wikipedia.org/wiki/Wikipedia:Contact_us)
* [ Code of Conduct ](https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct)
* [ Developers ](https://developer.wikimedia.org)
* [ Statistics ](https://stats.wikimedia.org/#/en.wikipedia.org)
* [ Cookie statement ](https://... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_15_0.txt | * Best case : ` O(n) ` when the array is nearly sorted; the ` insertionSort ` function only needs to make one pass through the array
* Average case : ` O(n^2) ` , where n is the number of elements; the ` insertionSort ` function may need to pass through the array multiple times
* Worst case : ` O(n^2) ` when... | |
Miigon_blog/sort6_71_0.txt | The ` compareFn ` function here is not well-formed, because it does not
satisfy anti-symmetry: if ` a > b ` , it returns ` 1 ` ; but by swapping ` a `
and ` b ` , it returns ` 0 ` instead of a negative value. Therefore, the
resulting array will be different across engines. For example, V8 (used by
Chrome, Node.js, etc.... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_14_0.txt | The ` insertionSort ` function takes in an array, sorts it, and returns the
sorted array. The function uses a for loop to iterate over elements and a
while loop for comparison while sorting and inserting the sorted data into the
array.
Here are the best-, average-, and worst-case scenarios for using the insertion
sort... | |
Miigon_blog/sort6_53_0.txt | ### Sorting non-ASCII characters
For sorting strings with non- ASCII characters, i.e. strings with accented
characters (e, é, è, a, ä, etc.), strings from languages other than
English, use ` String.prototype.localeCompare() ` . This function can compare
those characters so they appear in the right order. | |
Miigon_blog/sort6_6_0.txt | * Web APIs
Interfaces for building web applications | |
Miigon_blog/638132_11_0.txt | OmniJS source :
(() => {
'use strict';
// OMNI JS CODE ---------------------------------------
const omniJSContext = () => {
// main :: IO ()
const main = () => {
const
win = document.windows[0],
... | |
Miigon_blog/Miigon_blog_1_1.txt | as saparate global variables will work as well, but using `
struct ` is usually a better practice.
It makes the code easier to understand. And also enables us to do some other
cool things.
(eg. an “undo” feature, which we will talk about later)
# Draw the board
Next, we need a way to show our board on the scree... | |
Miigon_blog/sort6_69_0.txt | If a comparing function does not satisfy all of purity, stability,
reflexivity, anti-symmetry, and transitivity rules, as explained in the
description , the program's behavior is not well-defined.
For example, consider this code: | |
Miigon_blog/638132_55_0.txt | sam70 December 26, 2021, 11:51pm #17
sam70: | |
Miigon_blog/3097419_24_0.txt | So now that the first comparison has been done, b will shift onto the next
number in the array which will be 4, while a stays the same, until it has been
compared to every single number in the array. And once the first iteration of
a has been compared to everything, a will shift to the next number in the
array and do t... | |
Miigon_blog/3097419_4_0.txt |
function alphabeticalOrder(arr) {
// Add your code below this line
return arr.sort(function(a,b){return a>b; });
// Add your code above this line
}
alphabeticalOrder(["a", "d", "c", "a", "z", "g"]);
console.log((alphabeticalOrder(["a", "d", "c", "a", ... | |
Miigon_blog/sort6_22_0.txt | 1. References
2. JavaScript
3. Reference
4. Standard built-in objects
5. Array
6. Array.prototype.sort()
Article Actions | |
Miigon_blog/638132_41_0.txt | sam70 November 1, 2021, 1:46pm #14
unlocked2412: | |
Miigon_blog/choosing-javascript-sorting-algorithm8_30_0.txt | * Improving UX : Frontend sorting significantly enhances UX by allowing users to interact and view data more effectively. It empowers users to customize how they perceive and access information, making applications more user-centric
* Displaying data interactively in UI components : Frontend sorting is commonly ... | |
Miigon_blog/638132_19_0.txt | And finally, your coding style - so cool. Have you by chance created a YouTube
video explaining some of your videos or written up some post somewhere sharing
how you structure your code in your mind? The coding style appears that you
are able to spin up scripts in a hurry and significantly reuse your code.
Fascinating.... | |
Miigon_blog/638132_39_0.txt | unlocked2412 October 26, 2021, 7:15pm #13
sam70: | |
Miigon_blog/choosing-javascript-sorting-algorithm8_34_0.txt | While the performance of sorting algorithms may not differ across frameworks,
the way different frameworks detect data-changing models and trigger re-
renders can vary.
For instance, React uses a virtual DOM to limit the number of actual DOM
mutations. However, it can still be a bottleneck if the dataset changes
fre... | |
Miigon_blog/sort6_72_0.txt | js
const arr = [3, 1, 4, 1, 5, 9];
const compareFn = (a, b) => (a > b ? -1 : 0);
arr.sort(compareFn);
| |
Miigon_blog/choosing-javascript-sorting-algorithm8_51_0.txt | This article discussed popular sorting algorithms and how to implement them
with JavaScript. You also learned about the importance of and differences
between implementing sorting in your frontend and backend applications.
Choosing the suitable sorting algorithm for a specific task depends on various
factors, including... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_1_0.txt | * Start Monitoring for Free
* Sign In
2023-10-26 | |
Miigon_blog/choosing-javascript-sorting-algorithm8_67_0.txt | October 27, 2023 at 2:58 am
Thank you for such great article. | |
Miigon_blog/sort6_32_0.txt |
sort()
sort(compareFn)
### Parameters | |
Miigon_blog/3097419_29_0.txt | @camperextraordinaire
That’s true, that would get rid some edge cases that can pop up when comparing
strings. Just wasn’t sure if that has been introduced yet in this particular
curriculum. Isn’t localeCompare slower than the regular sort as well?
DanCouper August 28, 2019, 10:45am 12 | |
Miigon_blog/3097419_20_0.txt | However, i still don’t understand the role of the comparison function in the
sorting process.
For example, | |
Miigon_blog/choosing-javascript-sorting-algorithm8_59_0.txt | May 2, 2024 ⋅ 8 min read
#### Using React Shepherd to build a site tour | |
Miigon_blog/Miigon_blog_4_0.txt | Jump to content
Main menu
Main menu
move to sidebar hide
Navigation
* [ Main page ](/wiki/Main_Page "Visit the main page \[z\]")
* [ Contents ](/wiki/Wikipedia:Contents "Guides to browsing Wikipedia")
* [ Current events ](/wiki/Portal:Current_events "Articles related to current events")
* [ Random arti... | |
Miigon_blog/638132_56_0.txt | > unlocked2412:
>
>> Perhaps I can do a little book to explain in the future ? I am not sure. | |
Miigon_blog/choosing-javascript-sorting-algorithm8_10_0.txt | In this article, we’ll discuss various sorting techniques and how to use them
effectively in JavaScript projects. We’ll cover:
* Overview of JavaScript sorting algorithms
* Insertion sort
* Quicksort
* Merge sort
* Other relevant sorting algorithms
* Sorting algorithms in frontend vs. backend ... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_60_0.txt | React Shepherd stands out as a site tour library due to its elegant UI and
out-of-the-box, easy-to-use React Context implementation.
Onuorah Bonaventure | |
Miigon_blog/sort6_25_0.txt | * Try it
* Syntax
* Description
* Examples
* Specifications
* Browser compatibility
* See also
1. Standard built-in objects
2. ` Array `
3. Constructor
1. ` Array() constructor `
4. Static methods
1. ` Array.from() `
2. ` Array.fromAsync() `
3. ` Array.isArray() `
4.... | |
Miigon_blog/638132_60_0.txt | > have you solved AOC challenges in the past, or by any chance AoC 2021?
Hello. Glad to receive your message. I haven’t looked at any of those
challenges. | |
Miigon_blog/638132_10_0.txt | > there is no way to reorder tasks in a project or tag
You can certainly reorder the tasks in a project. If you want, for example, to
sort top-level selected tasks in a certain project by name… | |
Miigon_blog/638132_61_0.txt | sam70 December 27, 2021, 2:13pm #19
unlocked2412: | |
Miigon_blog/sort6_65_0.txt | The ` students ` variable will then have the following value:
js | |
Miigon_blog/choosing-javascript-sorting-algorithm8_7_0.txt | Introducing Galileo AI
LogRocket’s Galileo AI watches every session, surfacing impactful user
struggle and key behavior patterns. | |
Miigon_blog/638132_25_0.txt | Ok, I see what you are trying to do. Could you test this script ? As a proof
of concept, does it solve this problem ?
(() => {
'use strict';
// jxaContext :: IO ()
const jxaContext = () => {
// main :: IO ()
const main = () => {
const
... | |
Miigon_blog/638132_37_0.txt | unlocked2412 October 26, 2021, 7:14pm #12
sam70: | |
Miigon_blog/choosing-javascript-sorting-algorithm8_40_0.txt | To optimize backend database queries with sorting, you must consider various
factors, including the volume of data, query complexity, and the specific
database management system you use.
You can use techniques like indexing, batch processing, pagination,
asynchronous sorting, and caching for faster operations. | |
Miigon_blog/choosing-javascript-sorting-algorithm8_25_0.txt | Merge sort has consistent ` O(n log n) ` time complexity in all cases, making
it efficient for both small and large datasets. It’s also a stable sorting
technique that preserves the order of equal elements.
Merge sort is commonly used in external sorting algorithms for large data sets
that do not fit entirely in memor... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_43_0.txt | For small data sets, the choice of sorting algorithm may not significantly
impact performance. Simple algorithms like insertion sort or selection sort
can be efficient enough and easy to implement.
When dealing with medium-sized data sets, algorithms like merge sort,
quicksort, or heap sort may be more efficient. Thes... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_62_0.txt | Cookies are crucial to web development. This article will explore how to
handle cookies in your Next.js applications.
Georgey V B | |
Miigon_blog/sort6_68_0.txt |
[
{ name: "Eagle", grade: 13 },
{ name: "Sam", grade: 14 },
{ name: "Devlin", grade: 15 }, // original order not maintained
{ name: "Alex", grade: 15 }, // original order not maintained
];
### Sorting with non-well-formed comparator | |
Miigon_blog/3097419_13_0.txt | sort 793×285 19.5 KB
As @snowmonkey points out, the sort function will deal with ` 1 ` , ` 0 ` ,
and ` -1 ` values. String comparison such as ` "a" > "b" ` can only return `
true ` or ` false ` . | |
Miigon_blog/638132_17_0.txt | unlocked2412:
> Are you trying to directly add a task to the today perspective via Quick
> Entry ? | |
Miigon_blog/choosing-javascript-sorting-algorithm8_64_0.txt | Use the Tempo library to format dates and times in JavaScript while accounting
for time zones, daylight saying time, and date internationalization.
Amazing Enyichi Agu | |
Miigon_blog/sort6_44_0.txt |
function compareFn(a, b) {
if (a is less than b by some ordering criterion) {
return -1;
} else if (a is greater than b by the ordering criterion) {
return 1;
}
// a must be equal to b
return 0;
}
More formally, the comparator is expected to have the... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_17_0.txt |
function quickSort(arr) {
// Base case: If the array has one or no elements, it is already sorted.
if (arr.length <= 1) return arr;
// Choosing the first element in the array as the pivot.
const pivot = arr[0];
// Creating two empty arrays to store elements less than (le... | |
Miigon_blog/choosing-javascript-sorting-algorithm8_12_0.txt | You can implement popular sorting algorithms with JavaScript. Understanding
these algorithms and their practical applications is essential for making
informed choices when dealing with different datasets.
### Insertion sort | |
fastapi_security_advanced_user_guide/fastapi_security_3_1.txt | * [ Declare Request Example Data ](../schema-extra-example/)
* [ Extra Data Types ](../extra-data-types/)
* [ Cookie Parameters ](../cookie-params/)
* [ Header Parameters ](../header-params/)
* [ Response Model - Return Type ](../response-model/)
* [ Extra Models ](../extra-models/... | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_255_0.txt | ### Automatic Documentation With pydantic | |
fastapi_security_advanced_user_guide/configuration_54_0.txt | Method name | Docker variable | Description
---|---|---
` initOAuth ` | [ _See` oauth2.md ` _ ](https://github.com/swagger-
api/swagger-ui/blob/master/docs/usage/oauth2.md) | ` (configObj) => void ` .
Provide Swagger UI with information about your OAuth server - see the [ OAuth
2.0 documentation ](https://github.... | |
fastapi_security_advanced_user_guide/fastapi_security_6_5.txt | if x_token != "fake-super-secret-token":
raise HTTPException(status_code=400, detail="X-Token header invalid")
async def get_query_token(token: str):
if token != "jessica":
raise HTTPException(status_code=400, detail="No Jessica token provided")
Tip
Prefer to use th... | |
fastapi_security_advanced_user_guide/thebenefits_23_0.txt | Swagger and OpenAPI are powerful tools for building APIs with FastAPI. They allow you to automatically generate API documentation, test APIs using a web-based interface, and validate requests and responses to ensure that your API is working as intended. If you're building an API with FastAPI, be sure to check out Swagg... | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_124_0.txt | In each case, you would use the appropriate path operation decorator above a
function that is in charge of handling those requests. | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_327_0.txt | [ 
](/team/gahjelle/) | |
fastapi_security_advanced_user_guide/thebenefits_27_0.txt | Enjoy coding! | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_59_0.txt |
Copied! | |
fastapi_security_advanced_user_guide/configuration_50_0.txt | ##### Authorization | |
fastapi_security_advanced_user_guide/configuration_24_0.txt | # Configuration | |
fastapi_security_advanced_user_guide/thebenefits_19_0.txt | COPY
from fastapi import FastAPI
from pydantic import BaseModel | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_304_0.txt | ## Conclusion | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_71_0.txt | JSON | |
fastapi_security_advanced_user_guide/thebenefits_34_0.txt | Courageous to face new challenges and without barriers at work, to evolve and improve professionally. Eager to learn and improve. | |
fastapi_security_advanced_user_guide/fastapi_advanced_user_guide_5_6.txt | ma for a model was called
` Item.schema() ` , in Pydantic version 2, the method is called `
Item.model_json_schema() ` .
Nevertheless, although we are not using the default integrated functionality,
we are still using a Pydantic model to manually generate the JSON Schema for
the data that we want to receive in YAML.
... | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_305_0.txt | In this tutorial, you learned about **FastAPI** and how to use it to create
production-ready APIs that have best practices by default while providing the
best developer experience possible. You learned how to: | |
fastapi_security_advanced_user_guide/anintroductiontopyth_68_0.txt | [
](https://medium.com/m/signin?actionUrl=%2F_%2Fapi%2Fsubscriptions%2Fnewsletters%2F756902fd6638&operation=register&redirect=https%3A%2F%2Fayselaydin.medium.com%2Fan-
introduction-to-python-fastapi-swagger-ui-
fb68d8861fad&newsletterV3=8f989c1f1548&newsletterV3Id=756902fd6638&user=Aysel+Aydin&userId=8f989c1f1548&sourc... | |
fastapi_security_advanced_user_guide/fastapi_security_0_1.txt | rial/schema-extra-example/)
* [ Extra Data Types ](/tutorial/extra-data-types/)
* [ Cookie Parameters ](/tutorial/cookie-params/)
* [ Header Parameters ](/tutorial/header-params/)
* [ Response Model - Return Type ](/tutorial/response-model/)
* [ Extra Models ](/tutorial/extra-models/)... | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_215_0.txt | When you need to send data from a client to your API, you send it as a request
body. | |
fastapi_security_advanced_user_guide/configuration_21_0.txt | [ Resources ](/resources/) | |
fastapi_security_advanced_user_guide/configuration_29_0.txt | ### Parameters | |
fastapi_security_advanced_user_guide/fastapi_security_11_10.txt | aders={"WWW-Authenticate": "Bearer"},
)
return user
async def get_current_active_user(
current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
return curr... | |
fastapi_security_advanced_user_guide/fastapi_security_9_0.txt | [ Follow **@fastapi** on **Twitter** to stay updated
](https://twitter.com/fastapi)
[ Subscribe to the **FastAPI and friends** newsletter 🎉
](https://fastapi.tiangolo.com/newsletter/)
[ You can now sponsor **FastAPI** 🍰 ](https://github.com/sponsors/tiangolo)
[ sponsor  ](htt... | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_151_0.txt | You can return a [ dictionary ](https://realpython.com/python-dicts/) , [ list
](https://realpython.com/python-lists-tuples/) , or singular values as [
strings ](https://realpython.com/python-strings/) , [ integers
](https://realpython.com/python-numbers/) , and so on. You can also return
pydantic models, which you’ll ... | |
fastapi_security_advanced_user_guide/anintroductiontopyth_59_0.txt | [
](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Ffb68d8861fad&operation=register&redirect=https%3A%2F%2Fayselaydin.medium.com%2Fan-
introduction-to-python-fastapi-swagger-ui-
fb68d8861fad&source=--------------------------bookmark_footer-----------) | |
fastapi_security_advanced_user_guide/configuration_56_0.txt | If you're using the Docker image, you can also control most of these options
with environment variables. Each parameter has its environment variable name
noted, if available. | |
fastapi_security_advanced_user_guide/fastapipythonwebapis_35_0.txt | This tutorial is written by the [ author of FastAPI
](https://realpython.com/team/sramirez/) . It contains a careful selection of
fragments from the official documentation, avoiding getting lost in technical
details while helping you get up to speed as fast as possible. | |
fastapi_security_advanced_user_guide/fastapi_security_4_5.txt | OAuth2PasswordBearer(tokenUrl="token")
@app.get("/items/")
async def read_items(token: str = Depends(oauth2_scheme)):
return {"token": token}
Tip
Here ` tokenUrl="token" ` refers to a relative URL ` token ` that we haven't
created yet. As it's a relative URL, it's equivalent to ` ./tok... | |
fastapi_security_advanced_user_guide/configuration_78_0.txt |
### Docker-Compose | |
fastapi_security_advanced_user_guide/fastapi_security_9_1.txt | rial/schema-extra-example/)
* [ Extra Data Types ](/tutorial/extra-data-types/)
* [ Cookie Parameters ](/tutorial/cookie-params/)
* [ Header Parameters ](/tutorial/header-params/)
* [ Response Model - Return Type ](/tutorial/response-model/)
* [ Extra Models ](/tutorial/extra-models/)... | |
fastapi_security_advanced_user_guide/fastapi_security_7_2.txt | des ](../../advanced/testing-dependencies/)
* [ Testing a Database ](../../advanced/testing-database/)
* [ Async Tests ](../../advanced/async-tests/)
* [ Settings and Environment Variables ](../../advanced/settings/)
* [ OpenAPI Callbacks ](../../advanced/openapi-callbacks/)
* [ OpenA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.