What do you want to save?
Add Code snippet
New code examples
-
Html 2022-03-27 19:55:09
show image inside table with innerhtml
var array = cvpls(); var table = ``; for (var i = 0; i < array.length; i++) { table += `<tr>`; for (var j = 0; j < array[i].length; j++) { if (i === 1 && j === 2) { table += `<td><img src='http://imgh.us/statik.g... Add solution -
Javascript 2022-03-27 18:05:27
array chunk javascript
function splitArrayIntoChunksOfLen(arr, len) { var chunks = [], i = 0, n = arr.length; while (i < n) { chunks.push(arr.slice(i, i += len)); } return chunks; } var alphabet=['a','b','c','d','e','f']; var alphabetPairs=splitArrayIntoC... Add solution -
Other 2022-03-27 17:30:32
merge sort algo
// @see https://www.youtube.com/watch?v=es2T6KY45cA&vl=en // @see https://www.cs.usfca.edu/~galles/visualization/ComparisonSort.html function merge(list, start, midpoint, end) { const left = list.slice(start, midpoint); const right = list.sli... Add solution -
C# 2022-03-27 13:35:03
sum the digits in c#
sum = 0; while (n != 0) { sum += n % 10; n /= 10; } Add solution -
C++ 2022-03-27 12:15:21
find the graph is minimal spanig tree or not
#include <iostream> #include <vector> #include <utility> #include <algorithm> using namespace std; const int MAX = 1e4 + 5; int id[MAX], nodes, edges; pair <long long, pair<int, int> > p[MAX]; void initialize() { ... Add solution -
Other 2022-03-27 10:45:04
godot platformer movement
extends KinematicBody2D # The player is a kinematic body, hence extends Kine.. # Adjustable variables of the player # export is used to allow to edit the values outside the script export var speed = 500 # The speed of the character export var gravity = 3... Add solution -
Other 2022-03-27 07:35:09
looping to create table and rows
<script> (function() { var rows = ''; for( var i = 0; i <= 10; i++ ) { rows += '<tr id = "row' + i + '"><td>...</td></tr>'; } document.getElementById( 'table' ).innerHTML = rows; }());... Add solution -
Javascript 2022-03-27 07:35:02
compress string javascript
function en(c){var x='charCodeAt',b,e={},f=c.split(""),d=[],a=f[0],g=256;for(b=1;b<f.length;b++)c=f[b],null!=e[a+c]?a+=c:(d.push(1<a.length?e[a]:a[x](0)),e[a+c]=g,g++,a=c);d.push(1<a.length?e[a]:a[x](0));for(b=0;b<d.length;b++)d[b]=S... Add solution