Skip to content

Instantly share code, notes, and snippets.

@zontyp
zontyp / hellostateful.dart
Created April 27, 2020 19:06
hellostateful.dart
import 'package:flutter/material.dart';
void main() {
runApp(new HelloWorld());
}
class HelloWorld extends StatefulWidget {
@override
_HelloWorldState createState() => _HelloWorldState();
}
class _HelloWorldState extends State<HelloWorld> {
@zontyp
zontyp / hellostateless.dart
Created April 27, 2020 19:04
hellostateless.dart
import 'package:flutter/material.dart';
void main() {
runApp(new HelloWorld());
}
class HelloWorld extends StatelessWidget {
String mytext = "Hello World";
void goodbyeText(){
this.mytext = "GoodBye World";
print("inside goodbye text") ;
@zontyp
zontyp / helloflutterscaffold.dart
Created April 27, 2020 18:57
helloflutterscaffold
import 'package:flutter/material.dart';
void main() {
runApp(new HelloWorldText());
}
class HelloWorldText extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
@zontyp
zontyp / hellofluttercenter.dart
Last active April 28, 2020 07:48
Hello Flutter Center
import 'package:flutter/material.dart';
void main() {
runApp(
Center(
child: Text(
'Hello, world!',
textDirection: TextDirection.ltr,
),
),
);
@zontyp
zontyp / helloflutter.dart
Last active April 28, 2020 08:14
Flutter Hello World
import 'package:flutter/material.dart';
void main() {
runApp(
Text(
'Hello, world!',
textDirection: TextDirection.ltr,
),
);
}
@zontyp
zontyp / helloworld.dart
Last active May 29, 2020 11:47
Dart Hello World
void main (){
print("start - please guess number");
int secretNumber = 5;
int userNumber = 3;
if (userNumber < secretNumber)
print("my number is high");
if (userNumber > secretNumber)
print("my number is low");
@zontyp
zontyp / perceptron.py
Last active March 13, 2020 16:05
Perceptron neural network in python from scratch - Under 10 lines of code - works for and gate , or gate
#Read this first - https://jontysinai.github.io/jekyll/update/2017/09/24/the-mcp-neuron.html
#Set The inputs and the desired Outputs for and gate.
x1,x2,y = [0,0,1,1],[0,1,0,1], [0,0,0,1]
#Set Random values for weights w1,w2 and for the bias b. initialize all to 0
w1,w2,b = 0,0,0
#try 100 iterations to see if the perceptron can guess that we need a fucking and gate.
for _ in range(100):
#iterate for each input:
for i in [0,1,2,3]:
#just guess a y value based on our random weights and bias
@zontyp
zontyp / test.rb
Last active October 3, 2019 14:27
# new topic
table(autolink: false) do
# Add label in config/locales/en.yml , filter is route of your admin, resource
admin:
filter:
buttons:
myfilter: "View Filter Results"
table(autolink: false) do
public class Lesson1neeraj{
public static void main(String[] args){
System.out.println("Hello "+args[0]);// array index out of bounds exception
}
}