Skip to content

Instantly share code, notes, and snippets.

@ErikZhou
ErikZhou / For Mac 4.2.6 unlimited trial.md
Created March 24, 2022 05:29 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6,4.3.7,it's works , this is the way which makes Always in evaluation mode 。

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare : touch BCompare && chmod a+u BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@ErikZhou
ErikZhou / Flyweight.cs
Created August 7, 2013 11:28
Structural Patterns - Flyweight
using System;
using System.Collections;
class MainApp
{
static void Main()
{
// Arbitrary extrinsic state
int extrinsicstate = 22;
@ErikZhou
ErikZhou / Flyweight2.cpp
Created August 7, 2013 11:20
Structural Patterns - Flyweight
#include <iostream>
#include <string>
using namespace std;
class Icon
{
public:
Icon(char *fileName)
{
strcpy(_name, fileName);
@ErikZhou
ErikZhou / Flyweight1.cpp
Created August 7, 2013 11:19
Structural Patterns - Flyweight
// Flyweight.h
#include <string>
#include <map>
#include <vector>
#include <iostream>
using namespace std;
class AbstractFont // Flyweight抽象类
{
protected:
@ErikZhou
ErikZhou / Facade.cpp
Created August 7, 2013 07:27
Structural Patterns - Facade
#include <iostream>
using namespace std;
class MisDepartment
{
public:
void submitNetworkRequest()
{
_state = 0;
}
@ErikZhou
ErikZhou / Decorator.cs
Created August 7, 2013 06:35
Structural Patterns - Decorator C# demo
using System;
class MainApp
{
static void Main()
{
// Create ConcreteComponent and two Decorators
ConcreteComponent c = new ConcreteComponent();
ConcreteDecoratorA d1 = new ConcreteDecoratorA();
ConcreteDecoratorB d2 = new ConcreteDecoratorB();
@ErikZhou
ErikZhou / Decorator2.cpp
Created August 7, 2013 06:24
Decorator
#include <iostream>
#include <string>
using namespace std;
class Interface
{
public:
virtual ~Interface(){}
virtual void write(string &) = 0;
virtual void read(string &) = 0;
@ErikZhou
ErikZhou / Decorator.cpp
Created August 7, 2013 05:30
Structural Patterns - Decorator
#include <iostream>
using namespace std;
// 1. "lowest common denom"
class Widget
{
public:
virtual void draw() = 0;
};
@ErikZhou
ErikZhou / Composite.cpp
Created August 7, 2013 02:27
Composite design pattern - multiple container classes
//Composite design pattern - multiple container classes
#include <iostream>
#include <vector>
using namespace std;
class Component
{
public:
virtual void traverse() = 0;
};
@ErikZhou
ErikZhou / Bridge.cs
Last active December 20, 2015 11:00
Structural Patterns - Bridge C# sample
// Bridge pattern -- Structural example
using System;
// "Abstraction"
class Abstraction
{
// Fields
protected Implementor implementor;
// Properties