Skip to content

Instantly share code, notes, and snippets.

View alazyer's full-sized avatar

Yuliang Zhang alazyer

  • Nanjing
View GitHub Profile
@alazyer
alazyer / shallow_update_git.md
Created June 15, 2022 01:37 — forked from gobinathm/shallow_update_git.md
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@alazyer
alazyer / cloud_router_vnfd.yaml
Created June 26, 2017 09:32 — forked from Ladas/cloud_router_vnfd.yaml
Working NSD and VNFD
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: OPNFV-Demo-flavor
# NOT USED
#imports:
# - tacker_nfv_defs.yaml
# - tacker_defs.yaml
metadata:
var vv = window,
w = vv.innerWidth,
h = vv.innerHeight;
var svg = d3.select("#animviz")
.append("svg")
.attr("width", w)
.attr("height", h);
svg.append("g").attr("class", "links");
@alazyer
alazyer / forms.py
Last active August 29, 2015 14:06 — forked from maraujop/forms.py
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
%% Read Netflix dataset
A = readSMAT('/scratch/dgleich/netflix/netflix.smat');
k = [10 25 50 100 150 200];
l = size(k,2);
%% Matlab's SVDS
for i= 1:l
tic;
[U,S,V] = svds(A,k(i));
@alazyer
alazyer / pprcd.py
Created March 11, 2014 03:12 — forked from dgleich/pprcd.py
import collections
import sys
# setup the graph
G = {
1:set([ 2, 3, 5, 6,]),
2:set([ 1, 4,]),
3:set([ 1, 6, 7,]),
4:set([ 2, 5, 7, 8,]),
5:set([ 1, 4, 6, 8, 9, 10,]),
@alazyer
alazyer / curl.md
Created March 10, 2014 00:39 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
#!/usr/bin/env python
"""
"""
import random
import igraph
from numpy import mean, nan_to_num, nan
from pprint import pprint
import nose
import logging
logging.basicConfig(level=logging.DEBUG)