Skip to content

Instantly share code, notes, and snippets.

View hoganlong's full-sized avatar

Hogan Long hoganlong

View GitHub Profile

How to Auction cards on Faceboook

  1. Edit your post, for each auction item post an individual pictures as a comment.

    • To bid on the item people will reply to that comment.
    • Typically when someone bids the auctioner will like the bid comment to show it was recieved.
    • Even if there were prior offers, you should have those people comment below the picture to show there was a bid on that item.
  2. Make sure you also comment and have an end time -- this will impact an auction a lot but you can't have an auction without one. Often people will also have anti-snipe rules.

  3. Anti-snipe

In programming we are constantly applying different layers of abstraction. At the root level data is just 1 and 0 and moving between memory cells and registers. Most people have no concern for that when they program. They have an object oriented or strongly typed language that adds a layer of abstraction over the internal machine code, instructions, and bytes.

Worrying about the endian of integers is a case of not looking at problems form the correct level of abstraction, in almost all cases. It is very rare a programmer will ever have to worry about the details of how the hardware stores the number in memory -- unless you are writing in machine language or doing hardware level data transfer it won't matter.

The compiler (yes even low level compilers like C) will take care of it for you. It just won't matter as long as you use the abstract typing of compiler.

Lets say you need to create a transport protocol -- in this case it may or may not matter depending on the protocol. If the protocol is in JSON or so

@hoganlong
hoganlong / Creating a local file based upstream remote for Git and GitHub for Windows.md
Last active September 9, 2021 14:08 — forked from toolmantim/setting_up_a_new_remote_git_repository.textile
Creating a local file based upstream remote for Git and GitHub for Windows

#Creating a local file based upstream remote for Git.

#####(This works with GitHub for windows without pushing to the web!)

###Set up the new bare repo on the on your local file system: (a bare repo has not workspace it is used for sharing only. By convention it has .git in the folder name since there is no .git sub-directory in the repositiory)

C:\ORIGIN >git init --bare MyProject.git
Initialized empty Git repository in C:/ORIGIN/MyProject.git/
C:\ORIGIN >cd MyProject.git

How to make a Tarot card

We want to make an image that is

  • 2.75" by 4.75" or
  • 70mm by 120mm or
  • 897px by 1497px

36 px on each edge will be cropped to get a "bleed" (so that the image goes all the way to the edge.)

let Uxxankyun = {
a: 8,
b: 6,
draw: function(x) {
document.write("<pre>");
if (x) {
for (let i = 0; i < this.a; i++) {
for (let j = 0; j < this.b; j++) {
document.write(" * ")
}
with data(id, dept, age, name) as
(
values
(1, 'A', 60, 'A A' ),
(2, 'A', 70, 'B B' ),
(3, 'A', 80, 'C C' ),
(4, 'A', 90, 'D D' ),
(5, 'A', 100, 'E E' ),
(6, 'B', 10, 'F F' ),
(7, 'B', 20, 'G G' ),
with data(id, dept, age, name) as
(
values
(1, 'A', 60, 'A A' ),
(2, 'A', 70, 'B B' ),
(3, 'A', 80, 'C C' ),
(4, 'A', 90, 'D D' ),
(5, 'A', 100, 'E E' ),
(6, 'B', 10, 'F F' ),
(7, 'B', 20, 'G G' ),
for example if you have
Id State1 State2
1 1 DE
2 1 GA
3 1 AL
4 1 DC
5 1 FG
6 1 KG
7 1 PM
@hoganlong
hoganlong / BitField.SQL
Created February 16, 2012 16:42
Example of BitField in SQL / TSQL / SQLServer
CREATE TABLE [dbo].[testBF](
[field1] [varchar](max) NOT NULL,
[field2] [varchar](max) NOT NULL,
[bitfield] [int] NOT NULL CONSTRAINT [DF_testBF_bitfield] DEFAULT ((0))
) ON [PRIMARY]
INSERT INTO testBF(field1,field2)
VALUES ('F1start1','F2start1');
INSERT INTO testBF(field1,field2)
import java.io.FileNotFoundException;
import java.util.*;
public class TwoDArray {
public static void main(String[] args) throws FileNotFoundException {
java.io.File file = new java.io.File("2DArray.txt");
Scanner input = new Scanner(file);
int totalRow = 6;