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
var name = 'Isto é uma string. Dart sabe disso mesmo com var.'; | |
dynamic name = 'Isto é uma string, mas pode ser qualquer coisa no futuro.'; | |
String name = "Nem precisa falar."; | |
var s1 = ''' | |
Dá pra criar strings | |
com várias linhas como esta. | |
'''; | |
var s2 = """Está também é uma string |
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
// Função de entrada | |
void main() { | |
var a = 3; | |
var b = 2; | |
print('$a + $b = ${somar(a, b)}'); | |
} | |
// Função que soma dois inteiros | |
int somar(int a, int b) { | |
return a + b; |
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 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', |
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
console.log(solution(9)); | |
function solution(N) { | |
const range = [1, 2147483647]; | |
if(N >= range[0] && N <= range[1]) { | |
var binary = decimalToBinary(N); | |
return maxBinaryGap(binary); |
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
console.log(solution([1, 2, 3], 1)); | |
function solution(A, K) { | |
if(A.length < 1) | |
return []; | |
var rotatedA = []; | |
var copyA = [...A]; // copy array |
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
<isdecorate template="account/pt_account"> | |
<isinclude template="util/modules"> | |
<isloop items="${pdict.items}" var="item"> | |
<img src="${item.media.m}" alt=""/> | |
</isloop> | |
</isdecorate> |
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
// CRIAR SERVIÇO LocalServiceRegistry | |
'use strict'; | |
const LocalServiceRegistry = require('dw/svc/LocalServiceRegistry'); | |
var flickrGetPhotos = LocalServiceRegistry.createService("flickr.get.photos", { | |
createRequest: function(svc, params) { | |
var serviceUrl = svc.getConfiguration().getCredential().getURL(); |
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
function performHttpRequest(requestURL) { | |
var message = null; | |
var requestResult = {}; | |
var httpClient = new HTTPClient(); | |
var status = new Status(Status.OK); | |
httpClient.setTimeout(25000); | |
httpClient.setTimeout(25000); |
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
function openDialog(resourceMsg) { | |
dialog.open({ | |
html: '<h1>' + resourceMsg + '</h1>', | |
options: { | |
buttons: [{ | |
text: Resources.OK, | |
click: function () { | |
$(this).dialog('close'); | |
} | |
}] |
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
Response.renderJSON({ | |
isProductMaster: isProductMaster | |
}); |
OlderNewer