Skip to content

Instantly share code, notes, and snippets.

View orihpt's full-sized avatar
🏋️‍♂️
I'm either at the gym or programming

Ori Hauptman orihpt

🏋️‍♂️
I'm either at the gym or programming
  • Level App
  • Rishon le Zion, Israel
  • 17:30 (UTC +03:00)
View GitHub Profile
@orihpt
orihpt / TwoNumbersCompression.java
Created February 11, 2023 16:00
This code demonstrates how it's possible to compress two numbers into one and then convert it back to two numbers.
public class TwoNumbersCompression {
public static void main(String[] args) {
double compressed = compress(-5.57,8);
System.out.println("Compressed: " + compressed);
double[] decompressed = decompress(compressed);
System.out.println("Decompressed: " + decompressed[0] + ", " + decompressed[1]);
}
// Convert to between 0 and 1
public static double convert(double a) {
@orihpt
orihpt / willCommit.m
Last active August 9, 2022 09:55
Resolve conflicts between apps in Matlab
tic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -+= Welcome =+-
% This script was created by Ori Hauptman from Israel.
%
% Because of the way Matlab Apps are saved, it's hard and sometimes
% even not possible to resolve conflicts with Git.
%
% Run this script every time before commiting your changes to Git
% to create a folder for each of your apps, so you can reslove