Programming: Web Applications

Web Programming

Posted At: 2/5/2025 2:30:20 PM
Posted By: Comfortably Anonymous
Viewed: 196 times
0 Dislikes: 0
1. Combine Arrays (Concatenate Arrays)There are a variety of ways to combine arrays, but the spread operator allows you to place this at any place in an array. If you'd like to combine two arrays and place elements at any point within the array, you can do as follows:var arr1 = ['two', 'three']; var arr2 = ['one', ...arr1, 'four', 'five']; // arr2 = ["one", "two", "three", "four", "five"] 2. Copying ArraysWhen we wanted a copy of an array, we used to have the Array.prototype.slice() method. But, you can do the same with the spread operator.var arr = [1,2,3]; var arr2 = [...arr]; // arr2 = [1,2,3] 3. Calling Functions without ApplyIn ES5, to pass an array of two numbers to the doStuff() function, you often use the Function.prototype.apply() method as follows:function doStuff (x, y, z) {} var args = [0, 1, 2]; // Call the function, passing args doStuff.apply(null, args); However, by using the spread operator, you can pass an array into the function.doStuff(...args); 4. Destructuring ArraysYou can use destructuring and the rest operator together to extract the information into variables as you'd like them:let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; console.log(x); // 1 console.log(y); // 2 console.log(z); // { a: 3, b: 4 } 5. Function Arguments as Rest ParametersES6 also has three dots (...) which indicates a rest parameter that collects all remaining arguments of a function into an array.function f(a, b, ...args) { console.log(args); } f(1, 2, 3, 4, 5); // [3, 4, 5] 6. Using Math FunctionsAny function where spread is used as ...
Posted At: 1/23/2023 12:57:32 PM
Posted By: Comfortably Anonymous
Viewed: 1416 times
0 Dislikes: 0
This is a good quick reference, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items).A Complete Guide to Flexbox
Posted At: 11/9/2022 1:30:36 PM
Posted By: Comfortably Anonymous
Viewed: 1248 times
0 Dislikes: 0
I would seriously lose my temper and find a new job!
Posted At: 5/17/2022 4:11:09 PM
Posted By: Comfortably Anonymous
Viewed: 1339 times
0 Dislikes: 0
Continuous integration has changed the way we develop software. But a CI environment is different from production, and synthetic tests are not always enough to reveal problems. Some issues only appear when they hit production, and by that time, the damage is already done. Canary deployments allow us to test the waters before jumping in.Learn how carrying a small bird in your pocket, or, Canary Deployment can help save your sanity!
Posted At: 5/17/2022 4:09:07 PM
Posted By: Comfortably Anonymous
Viewed: 1465 times
0 Dislikes: 0
Have your users ever experienced downtime caused by a buggy release? Have you ever been called on a weekend to roll back an upgrade? Do you usually have to wake up at insane hours because that is the only time you can take down a system? Do release days make you feel anxious?Learn about Blue/Green Deployment to keep from tearing out your hair!
Posted At: 10/30/2020 3:56:57 AM
Posted By: Comfortably Anonymous
Viewed: 2717 times
0 Dislikes: 0
Both for you and your site's users. With the advent of dual-key/partitioned caching in all modern browsers, the speed boost you might have used to get is no longer possible. CDN Javascript is now an anti-pattern and a security risk.A good discussion and more technical info at Please stop using CDNs for External Javascript Libraries
Posted At: 9/30/2019 4:38:26 PM
Posted By: Comfortably Anonymous
Viewed: 2011 times
0 Dislikes: 0
Not really sure why this happens, usually every time you check out a clean copy of the code to a new directory, but the fix is easy:Open the NuGet Package Manager Console (Tools | NuGet Package Manager | Package Manager Console) and run the following command:Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r
Posted At: 6/18/2019 9:13:44 PM
Posted By: Comfortably Anonymous
Viewed: 1929 times
0 Dislikes: 0
Intellectually, anyone can learn to code. Anyone can also learn to play piano. But at least with piano someone else can hear the result and recognize the effort. Plus one bad note doesn't cause the piano to burst into flames.
Posted At: 4/18/2019 2:58:45 PM
Posted By: Comfortably Anonymous
Viewed: 2389 times
0 Dislikes: 0
The biggest "relevant" problem with REST APIs here is the clients need to communicate with multiple data API endpoints. REST APIs require clients to do multiple network round-trips to get their data. They are usually a collection of endpoints where each endpoint represents a resource, so when a client needs data about multiple resources it needs to perform multiple network requests to a REST API and then put together the data it needs by combining multiple responses. In a pure REST API (not a customized one), a client cannot specify which fields to select for a record in that resource. That information is in the REST API service itself and the REST API service will always return all of the fields regardless of which ones the client actually needs. GraphQL’s term for this problem is over-fetching of information that is not needed. It is a waste of network and memory resources for both the client and the server. GraphQL speaks to the data as a graph and data is naturally a graph. If you need to represent any data, the right structure is a graph. The GraphQL runtime allows us to represent our data with a graph API that matches the natural graph shape of that data.https://graphql.org/
Posted At: 11/2/2018 3:26:11 PM
Posted By: Comfortably Anonymous
Viewed: 2316 times
0 Dislikes: 0
A few good queries to find out why Oracle is running slow...Show current table locks:select object_name, object_type, session_id, type, -- Type of lock lmode, -- lock mode request, block, ctime -- Time elapsedfrom v$locked_object, all_objects, v$lockwhere v$locked_object.object_id = all_objects.object_id AND v$lock.id1 = all_objects.object_id AND v$lock.sid = v$locked_object.session_idorder by session_id, ctime desc, object_nameCurrently running queries:select S.USERNAME, s.sid, s.osuser, t.sql_id, sql_textfrom v$sqltext_with_newlines t, V$SESSION swhere t.address =s.sql_addressand t.hash_value = s.sql_hash_valueand s.status = 'ACTIVE'and s.username <> 'SYSTEM'order by s.sid,t.pieceLong-running operations:COLUMN percent FORMAT 999.99 SELECT sid, to_char(start_time,'hh24:mi:ss') stime, message,( sofar/totalwork)* 100 percent FROM v$session_longopsWHERE sofar/totalwork < 1