This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"node": true, | |
"commonjs": true, | |
"es6": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": { | |
"linebreak-style": [ | |
"error", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xattribute_t* add_xattribute(xelement_t* e, const char* name, const char* value){ | |
// either element already has some attributes or not | |
// in both situations we have to create a new attribute to add | |
// we call it "atr" and first we initate it | |
xattribute_t* atr = (xattribute_t*)malloc(sizeof(xattribute_t)); | |
atr->name = strdup(name); | |
atr->value = strdup(value); | |
atr->next = NULL; | |
// Now we check if element has no attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts a number to another base. | |
* | |
* @param {Number} num A number to get converted. If it's float, it's integer part will get converted. | |
* @param {Number} [base=2] Number's new base. | |
* | |
* @returns {String} String representation of number in new base. | |
* | |
* @throws {TypeError} First parameter must be a number. | |
* @throws {RangeError} First Parameter must be >= 0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main_image = imread('image.jpg'); | |
red_part = uint8(zeros(size(main_image))); | |
red_part(:, :, 1) = main_image(:, :, 1); | |
green_part = uint8(zeros(size(main_image))); | |
green_part(:, :, 2) = main_image(:, :, 2); | |
blue_part = uint8(zeros(size(main_image))); | |
blue_part(:, :, 3) = main_image(:, :, 3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def matrix_multiply(a, b): | |
c = [[] for _ in range(len(a))] | |
for i in range(len(a)): | |
for j in range(len(a)): | |
sum = 0 | |
for k in range(len(a)): | |
sum += a[i][k] * b[k][j] | |
c[i].append(sum) | |
return c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "m32def.inc" | |
.macro array_operation | |
push r16 | |
push xl | |
push xh | |
push yl | |
push yh | |
push zl | |
push zh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Solving producer-consumer problem using semaphores | |
""" | |
import threading | |
# Buffer size | |
N = 10 | |
# Buffer init |
The font-family property specifies the font for an element. There are two types of font family names:
- font family: a specific font family (like Times New Roman or Arial)
- generic family: a group of font families with a similar look (like Serif or Monospace)
Separate each value with a comma to indicate that they are alternatives.
If the name of a font family is more than one word, it must be in quotation marks: "Times New Roman".