Skip to content

Instantly share code, notes, and snippets.

View hmasum52's full-sized avatar
🎯
Focusing

Hasan Masum hmasum52

🎯
Focusing
View GitHub Profile

In ns-2, the reserved field in the TCP header can be accessed and modified using the C++ programming language. Here is an example of how you might use the reserved field in a simulation:

Include the necessary headers in your simulation script:

#include "tcp.h"
#include "ip.h"
Create a new class that inherits from the existing TCP class:
Copy code
class MyTCP : public TCP {
public:
@hmasum52
hmasum52 / gsm_test.ino
Created August 28, 2022 19:43
Sim 900a GSM module test code
#include <SoftwareSerial.h>
#define RXgsm 10
#define TXgsm 11
const uint32_t GSMBaud = 115200;
SoftwareSerial gsmSerial(RXgsm, TXgsm);
void sendMessage(String msg)
{
#include <Wire.h> //Library for I2C communication
#include "LiquidCrystal_I2C.h" //I2C LCD library
#include<Servo.h>
#include "DHT.h"
#include <SoftwareSerial.h>
// HC-SR04 : sonar sensor
#define TRIGPIN 5
#define ECHOPIN 6
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
<div class="mb-3">
<label for="inputCategoryLogo" class="form-label">Logo Image</label>
<input type="file"
accept="image/*"
class="form-control form-control-sm"

Login in psql

psql -U postgres -h localhost

See list of database

\l 

See list of users with list of roles

@hmasum52
hmasum52 / google_sheet_parser.dart
Last active May 17, 2022 08:15
Parse data from public(shared) google sheet in dart and flutter
import 'dart:convert';
import 'dart:developer';
import 'package:html/dom.dart' as dom;
import 'package:html/parser.dart';
import 'package:http/http.dart' as http;
class GoogleSheetParser {
/// Parses the google sheet and returns a list of maps
/// with the keys being the column names and the values being the values
/// in the column
@hmasum52
hmasum52 / Api.java
Last active October 29, 2021 15:26
Fastest way to call API endpoints in android using retrofit2
public class Api {
public static Api instance = new Api();
public Endpoints endpoints;
private Api(){
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.level(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor)