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 ConstExample { | |
final String someValue; | |
const ConstExample ({this.someValue}); | |
} | |
void main() { | |
const d = ConstExample(someValue: "teste"); | |
print(d.hashCode); | |
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 Example { | |
final String someText; | |
const Example(this.someText); | |
} | |
void main() { | |
int value = 2; | |
value = 3; // Ok, field is not final | |
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 User { | |
final String name; | |
User({this.name}); | |
} | |
/// Exemplo de erro | |
class UserNotFound implements Exception {} | |
User getUser() { |
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
void main() { | |
var shouldSucceed = "ARARA"; | |
var shouldFail = "ARAR"; | |
print(isPalindrome(shouldSucceed)); | |
print(isPalindrome(shouldFail)); | |
} | |
bool isPalindrome(String testString) { | |
var start = 0; |
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
void main() async { | |
Future<String> processamento = processamentoAsyncrono(); | |
print("calculo que nao depende do resultado acima eh executado imediatamente"); | |
String resultado = await processamento; // ele vai esperar nesse ponto! | |
print(resultado); | |
} | |
Future<String> processamentoAsyncrono() { |
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
// generic callbacks in dart sdk would be very helpfull | |
// otherwise we should typedef those for every project | |
// (or maybe i should create a package with this :thinking:) | |
typedef void IntCallback(int foo); | |
class AnAwesomeWidget { | |
// user can take some action. eg. when switching pages in a PageView | |
final IntCallback somethingHappened; | |
int someState = 0; |
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
type User { | |
id: Int! @id(strategy: SEQUENCE) @sequence(name: "users_id_seq", initialValue: 1, allocationSize: 1) | |
email: String! @unique | |
globoToken: String | |
password: String! | |
team: Team! | |
wallet: Wallet! @db(name: "wallet_id") @unique @relation(link: INLINE) | |
createdAt: DateTime! @createdAt |
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 pymssql | |
import pandas as pd | |
## Hey Look, college data | |
stmt = "SELECT * FROM AlumniMirror..someTable" | |
## instance a python db connection object- same form as psycopg2/python-mysql drivers also | |
with pymssql.connect(server="<server address>", user="<user>",password="<password>", port=63642) as conn: # You can lookup the port number inside SQL server. | |
# Excute Query here | |
df = pd.read_sql(stmt,conn) |
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
package niddho.sorting; | |
import niddho.sorting.core.Sort; | |
import java.util.concurrent.ThreadLocalRandom; | |
public class Main { | |
private static Integer[] getRandomizedIntegerArray(int arraySize, int randomRange) { |
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
#include <stdio.h> | |
#include <string.h> | |
#include <mpi.h> | |
int main (int argc, char** argv) | |
{ | |
int stackSize, currentRank; | |
char vetor[100]; | |
MPI_Init(&argc, &argv); |
NewerOlder