What do you want to save?
Add Code snippet
New code examples
-
Kotlin 2022-03-27 07:40:17
var and val in kotlin
val and var both are used to declare a variable. var is like general variable and it's known as a mutable variable in kotlin and can be assigned multiple times. val is like Final variable and it's known as immutable in kotlin and can be initialized only s... Add solution -
Other 2022-03-16 19:55:36
raspberry pi configuration.nix
{ config, pkgs, lib, ... }: { # This configuration worked on 09-03-2021 nixos-unstable @ commit 102eb68ceec # The image used https://hydra.nixos.org/build/134720986 boot = { kernelPackages = pkgs.linuxPackages_rpi4; tmpOnTmpfs = true; in... Add solution -
Other 2022-03-16 18:10:16
pure component
The major difference between React.PureComponent and React.Component is PureComponent does a shallow comparison on state change. It means that when comparing scalar values it compares their values, but when comparing objects it compares only references. I... Add solution -
C++ 2022-03-14 07:05:04
constant variables in c++
// various versions of const are explained below #include <iostream> class Entity { private: int m_X, m_Y; mutable int var; // can be modified inside const menthods int* m_x, *m_y;// * use to create pointer in one line public: int GetX() const /... Add solution -
Other 2022-03-13 03:20:09
f# syntax
// single line comments use a double slash (* multi line comments use (* . . . *) pair -end of multi line comment- *) // ======== "Variables" (but not really) ========== // The "let" keyword defines an (immutable) value let myInt = 5... Add solution -
Javascript 2022-03-07 21:50:11
How to add a property at the middle of an object in javascript
// Main Code Using Function: var addToObject = function (obj, key, value, index) { // Create a temp object and index variable var temp = {}; var i = 0; // Loop through the original object for (var prop in obj) { if (obj.hasOwnProperty(prop)) { ... Add solution -
Python 2022-03-05 09:35:20
tuples in python
# A tuple is a sequence of immutable Python objects. Tuples are # sequences, just like lists. The differences between tuples # and lists are, the tuples cannot be changed unlike lists and # tuples use parentheses, whereas lists use square brackets. tup1 =... Add solution -
Objective-C 2022-03-03 11:45:10
objective c encrypt decrypt string
NSString *const IV = @"AEE0515D0B08A4E4"; NSString *const KEY = @"9336565521E5F082BB5929E8E033BC69"; #import "SecurityUtils.h" @implementation SecurityUtils + (NSString *)encrypt:(NSString *)plainText error:(NSError **... Add solution