This file contains hidden or 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
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ ) | |
Installing Brew | |
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command. | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
Installing Mosquitto MQTT |
This file contains hidden or 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
{"abRemainingSeatList":[],"ticketList":[{"Track_Id":"ODR3691200559234","UserTrackId":"0","adultConcessionAmount":"0.0","adultCount":1,"adultSeats":"9","agesList":"36","amentyAmount":"0.0","boardedLatitude":"17.496448","boardedLongitude":"78.297269","boardingPoint":"1661","boardingSeqNo":1,"boardingTime":"1661^KEERTHI MAHAL BUS STOP \u0026 CITY BUS PASS COUNTER IN BHEL TOWNS^9:30 PM","cessAmount":"0.0","childConcessionAmount":"0.0","childCount":0,"childSeats":"0","concessionAmount":"0.0","concessionId":"1347688949874","concessionShortCode":"REGU","couponCode":"","destination":1188,"destinationId":"10641","dropingPoint":"10641","dropingSeqNo":6,"email":"[email protected]","gstAmount":"0.0","gt_lt":"1","isBoarded":"1","isConcession":"0","isStandingSeat":"0","jDate":"09 May 2020","mobile":"9542829992","offline_online":1,"passengerName":"Yakub","pisAmount":"0.0","psgrGender":"M","safetyCessAmount":"0.0","seatType":"0","selectedSeats":"9","serviceCharge":"","serviceKey":"1437000010515","serviceName":"BHEL(KMHL)-MTM", |
This file contains hidden or 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
//1. Factory constructor | |
class SingletonOne { | |
SingletonOne._privateConstructor(); | |
static final SingletonOne _instance = SingletonOne._privateConstructor(); | |
factory SingletonOne() { | |
return _instance; | |
} |
This file contains hidden or 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
final yesterday = DateTime(now.year, now.month, now.day); // today 12.00.00 | |
final tomorrow = DateTime(now.year, now.month, now.day +1); //tomorrow 12.00.00 | |
int diffInDays = tomorrow.difference(yesterday).inDays; | |
if (diffInDays == 0){ | |
//custom code | |
print( "same day"); | |
} else if( diffInDays > 0 ) { | |
// custom code | |
print("tomorrow is greater "); |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or 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 Foundation | |
class Array2D<T> { | |
let columns: Int | |
let rows: Int | |
var array: Array<T?> | |
init(columns: Int, rows: Int) { | |
self.columns = columns | |
self.rows = rows |
This file contains hidden or 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' as math; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains hidden or 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:convert'; | |
import 'package:moor_flutter/moor_flutter.dart'; | |
part 'database.g.dart'; | |
@DataClassName("Journal") | |
class Journals extends Table { | |
IntColumn get id => integer().autoIncrement()(); | |
TextColumn get name => text().withLength(min: 1, max: 50)(); | |
TextColumn get description => text().withLength(min: 1, max: 100)(); |
This file contains hidden or 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
public class StringTest{ | |
String a = "a"; // String constant pool | |
String b = new String("a"); // heap | |
a==b // not true becuase of different memory location based on the way they created | |
a.equlas(b) // true | |
//String b = "a" | |
StringBuilder builder = new StringBuilder(); // Extends the AbstractStringBuilder class - no thread saftey | |
StringBuffer buffer = new StringBuffer(); // Extends the AbstractStringBuilder class but all the required methods are synchrnozed so its thread safe |