This file contains 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
grid.collection.on("backgrid:editing", function(e){ | |
alert('editando..'); | |
}); | |
grid.collection.on("backgrid:selected", function (model, selected) { | |
alert('hola'); | |
}); |
This file contains 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 describe_favorites(*games) | |
games.each{|game| puts "Favorite Game: #{game}"} | |
end | |
describe_favorites('Mario', 'Contra', 'Metroid') |
This file contains 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
func adjacentElementsProduct(inputArray []int) int { | |
h := 0 | |
for i := 0; i < len(inputArray); i ++ { | |
if (i + 1) < len(inputArray) { | |
if h <= (inputArray[i] * inputArray[i+1]) { | |
h = inputArray[i] * inputArray[i+1] | |
} | |
This file contains 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
import "strings" | |
func checkPalindrome(inputString string) bool { | |
var p []string | |
for i := len(inputString)-1; i >= 0; i-- { | |
p = append(p, string(inputString[i])) | |
} |
This file contains 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
func centuryFromYear(year int) int { | |
r := 1 | |
s := strconv.Itoa(year) | |
if len(s) == 4 { | |
a := string(s[0:2]) | |
b := string(s[2:4]) | |
c, _ := strconv.Atoi(a) |
This file contains 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
String scream(int length) => "A${'a' * length}h!"; | |
main() { | |
final values = [1, 2, 3, 5, 10, 50]; | |
values.map(scream).forEach(print); | |
values.skip(1).take(3).map(scream).forEach(print); | |
} |
This file contains 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
import 'dart:math'; | |
abstract class Shape { | |
factory Shape(String type) { | |
if (type == 'circle') return Circle(2); | |
if (type == 'square') return Square(2); | |
throw 'Can\'t create $type.'; | |
} | |
num get area; | |
} |
This file contains 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
import 'dart:math'; | |
class Rectangle { | |
int width; | |
int height; | |
Point origin; | |
Rectangle({this.origin = const Point(0, 0), this.width = 0, this.height = 0}); | |
@override |
This file contains 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
class Bicycle { | |
int cadence; | |
int _speed = 0; | |
int get speed => _speed; |
This file contains 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
DateTimeFormatter formatterFecha = DateTimeFormat.forPattern("dd/MM/yyyy"); | |
DateTime primerDiaDelMes = new DateTime().dayOfMonth().withMinimumValue(); | |
String desde = new LocalDate(primerDiaDelMes).toString(formatterFecha); | |
DateTime ultimoDiaDelMes = new DateTime().dayOfMonth().withMaximumValue(); | |
String hasta = new LocalDate(ultimoDiaDelMes).toString(formatterFecha); |