Skip to content

Instantly share code, notes, and snippets.

View minhan1910's full-sized avatar
🎯
Focusing

Minh An minhan1910

🎯
Focusing
View GitHub Profile
@Neilblaze
Neilblaze / CPP_Template.cpp
Last active September 24, 2024 19:46
CP Template — C++ </>
#include <bits/stdc++.h>
using namespace std;
/* clang-format off */
/* TYPES */
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
class Student
{
public string Name { get; set; }
public int Number { get; set; }
public int SerialNo { get; set; }
public int Grade { get; set; }
public static IEqualityComparer<Student> SerialNoComparer { get => new SerialNoEqualityComparer(); }
public static IEqualityComparer<Student> NumberComparer { get => new NumberEqualityComparer(); }
@chatton
chatton / SendObjectsOverSockets.java
Created September 26, 2017 15:27
Example of how to send an Object over a Socket in Java.
import java.io.Serializable;
// must implement Serializable in order to be sent
public class Message implements Serializable{
private final String text;
public Message(String text) {
this.text = text;
}
@ondravondra
ondravondra / EFExtensions.cs
Created November 2, 2012 12:49
C# extension for executing upsert (MERGE SQL command) in EF with MSSQL
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace EFExtensions