arXiv papers

DSOS and SDSOS Optimization: More Tractable Alternatives to Sum of Squares and Semidefinite Optimization

Amir Ali Ahmadi, Anirudha Majumdar

https://arxiv.org/abs/1706.02586

In recent years, optimization theory has been greatly impacted by the advent of sum of squares (SOS) optimization. The reliance of this technique on large-scale semidefinite programs however, has limited the scale of problems to which it can be applied. In this paper, we introduce DSOS and SDSOS optimization as more tractable alternatives to sum of squares optimization that rely instead on linear and second order cone programs respectively. These are optimization problems over certain subsets of sum of squares polynomials (or equivalently subsets of positive semidefinite matrices), which can be of interest in general applications of semidefinite programming where scalability is a limitation. We show that some basic theorems from SOS optimization which rely on results from real algebraic geometry are still valid for DSOS and SDSOS optimization. Furthermore, we show with numerical experiments from diverse application areas—polynomial optimization, statistics and machine learning, derivative pricing, and control theory—that with reasonable tradeoffs in accuracy, we can handle problems at scales that are currently far beyond the reach of sum of squares approaches. Finally, we provide a review of recent techniques that bridge the gap between our DSOS/SDSOS approach and the SOS approach at the expense of additional running time. The appendix of the paper introduces an accompanying MATLAB package for DSOS and SDSOS optimization.

https://www.solidot.org/story?sid=56606

A Practical \( O(R\log\log n+n) \) time Algorithm for Computing the Longest Common Subsequence

Daxin Zhu, Lei Wang, Yingjie Wu and Xiaodong Wang

https://arxiv.org/abs/1508.05553

In this paper, we revisit the much studied LCS problem for two given sequences. Based on the algorithm of Iliopoulos and Rahman for solving the LCS problem, we have suggested 3 new improved algorithms. We first reformulate the problem in a very succinct form. The problem LCS is abstracted to an abstract data type DS on an ordered positive integer set with a special operation Update(S,x). For the two input sequences X and Y of equal length n, the first improved algorithm uses a van Emde Boas tree for DS and its time and space complexities are \( O(R\log\log n+n) \) and O(R), where R is the number of matched pairs of the two input sequences. The second algorithm uses a balanced binary search tree for DS and its time and space complexities are \( O(R\log L+n) \) and O(R), where L is the length of the longest common subsequence of X and Y. The third algorithm uses an ordered vector for DS and its time and space complexities are O(nL) and O(R).

React技术栈相关

适用

  • If you plan to build a large scale app, go with React.
  • If you want a library that is adaptable for both web and native apps, go with React.
  • If you want the biggest ecosystem, go with React.

Vue作者尤雨溪(Evan You)论React

  • 要区分两个概念:React 本身和 React 生态圈所推崇的主流应用架构
  • React 本身其实还算简单的。最简单的理解,一个组件的渲染函数就是一个基于 state 和 props 的纯函数,state 是自己的,props 是外面来的,任何东西变了就重新渲染一遍,是不是很简单?
  • Flux/Redux 的繁琐,本质上是针对大型应用的复杂度所作出的权衡:用繁琐一些的 API,换长线的可维护性。
  • MobX 是适合中小规模应用的状态解决方案,然而用 React + MobX 本质上就是一个更繁琐的 Vue

Redux – 状态管理方案

Redux 的设计思想

  • Web 应用是一个状态机,视图与状态是一一对应的。
  • 所有的状态,保存在一个对象里面。

Spring Boot

Spring Boot:构建 Spring 应用程序的现代方式

Spring Boot 基础


Spring Boot的文档
https://docs.spring.io/spring-boot/docs/current/reference/

Building an Application with Spring Boot
https://spring.io/guides/gs/spring-boot/

Building Java Projects with Maven
https://spring.io/guides/gs/maven/

Building Java Projects with Gradle
https://spring.io/guides/gs/gradle/

Working a Getting Started guide with STS
https://spring.io/guides/gs/sts/

Spring Tool Suite
https://spring.io/tools/sts/all


深入学习微框架:Spring Boot
http://www.infoq.com/cn/articles/microframeworks1-spring-boot


From Zero to Hero with Spring Boot

Brian Clozel shows how Spring Boot can help build web applications, tests to production-ready features, that leverage the Spring ecosystem.

https://www.infoq.com/presentations/spring-boot-web-dev

https://github.com/bclozel/issues-dashboard/


Getting Started with Microservices in SpringBoot
https://www.infoq.com/articles/Microservices-SpringBoot

Exploring Micro-frameworks: Spring Boot
https://www.infoq.com/articles/microframeworks1-spring-boot

Mozilla 的 Rust 编程语言

Why you should learn the Rust programming language

Discover the history, key concepts, and tools for using Rust
https://www.ibm.com/developerworks/library/os-developers-know-rust/index.html


Rust 编程语言入门

您是开发人员吗?如果是,您需要知道 Rust。
https://www.ibm.com/developerworks/cn/opensource/os-developers-know-rust/index.html


Beginner’s Guide to Rust
Get to know Rust
A compiled alternative to C and C++
https://www.ibm.com/developerworks/opensource/library/os-know-rust/index.html

Rust 初学者指南
初识 Rust
一种替代 C 和 C++ 的编译语言
https://www.ibm.com/developerworks/cn/opensource/os-know-rust/index.html


Beginner’s Guide to Rust
Start coding with the Rust language
Put your Rust skills to use by building a simple Tic Tac Toe game
https://www.ibm.com/developerworks/opensource/library/os-using-rust/index.html

开始使用 Rust 语言进行编码
运用您的 Rust 技能构建一个简单的井字棋游戏
https://www.ibm.com/developerworks/cn/opensource/os-using-rust/index.html


Why you should learn the Rust programming language
Discover the history, key concepts, and tools for using Rust
https://www.ibm.com/developerworks/library/os-developers-know-rust/index.html


Why Rust is the Most Loved Language by Developers

https://medium.com/mozilla-tech/why-rust-is-the-most-loved-language-by-developers-666add782563


Mozilla bets its Rust language will make your internet safer

JavaScript, a smash hit among programmers, made the web powerful. Now Mozilla’s Rust could protect the web from hack attacks.

https://www.cnet.com/news/mozilla-designs-rust-language-for-safe-secure-internet/


What is Rust? Safe, fast, and easy software development

The Rust language’s unique approach results in better code with fewer compromises than C, C++, Go, and the other languages you probably use

https://www.infoworld.com/article/3218074/application-development/what-is-rust-safe-fast-and-easy-software-development.html


Rust in 2018: it’s way easier to use!

https://jvns.ca/blog/2018/01/13/rust-in-2018--way-easier-to-use/

I’ve been using Rust on and off since late 2013. 4 weeks ago, I picked up Rust again, and the language is SO MUCH EASIER than it was the last time I tried it (May 2016). I think that’s really exciting!


tweets of John Carmack

Quality, reliable software can be delivered in any language, but language choice has an impact. For me, C would be a middle-of-the-road choice; better than a dynamic language like javascript or python, but not as good as a more modern strongly static typed languages. However, the existence of far more analysis tools for C is not an insignificant advantage. If you really care about robustness, you are going to architect everything more like old Fortran, with no dynamic allocations at all, and the code is going to look very simple and straightforward.

So an interesting question: What are the aspects of C++ that are real wins for that style over C? Range checked arrays would be good. What else?

Rust would be the obvious things, and I don’t have any reason to doubt it would be good, but I haven’t implemented even a medium sized application in it. I have been checking on the progress for a while, and I like what I see, but I haven’t coded in it.

值得关注的GitHub用户及项目

project

Algorithms, 4th edition textbook code and libraries
https://github.com/kevin-wayne/algs4

JavaPerformanceTuning
https://github.com/ScottOaks/JavaPerformanceTuning

Examples for O’Reilly & Associates Java Performance Tuning: The Definitive Guide

Code for the book Grokking Algorithms
https://github.com/egonSchiele/grokking_algorithms

Grokking Algorithms

An illustrated guide for programmers and other curious people

Aditya Y. Bhargava

people

Zhiqiang Zhang
https://github.com/zhangzq

Yihui Xie
https://github.com/yihui

Ruan YiFeng
https://github.com/ruanyf

Hao Chen
https://github.com/haoel

bigsai
https://github.com/javasmall

xiaolai
https://github.com/xiaolai

Brian Clozel
https://github.com/bclozel

常用git命令

git init 会将当前目录直接转换为 Git 工作目录并在此处创建的 .git(隐藏)目录中创建存储库。

查看哪些文件处于什么状态
Show the working tree status
git status

git status 有助于跟踪已添加的更改、未添加的更改以及更改所在的分支。

查看尚未暂存的文件更新了哪些部分
git diff

直接将远程镜像克隆到本地仓库
git clone git@github.com:sikaozhe1997/Xin-Yue.git

查看远程仓库
git remote -v

从远程获取最新版本到本地
git fetch origin master

比较本地的仓库和远程参考的区别
git log -p master.. origin/master

switch branches: git checkout <branch>

switch branches with new branch created: git checkout -b <branch>

view branches: git branch

add files: git add file1 file2

commit: git commit -m “comments”

放弃修改

没有使用git add到暂存区

git checkout – filename

已经git add到暂存区

git reset HEAD filename

git add & git commit 之后

git reset commit_id

这个id是你想要回到的那个节点,可以通过 git log 查看

Configure your DVCS username for commits

global

git config --global user.name “FIRST_NAME LAST_NAME”

git config --global user.emailMY_NAME@example.com

repository-specific

git config user.name “FIRST_NAME LAST_NAME”

git config user.emailMY_NAME@example.com

git-stash

  • git stash

  • git stash list

  • git stash apply

  • git stash apply stash@{1} or git stash apply stash@"{1}"

  • git stash drop stash@{0} or git stash drop stash@"{0}"

  • git stash save "message"

  • git stash pop stash@{1} or git stash pop stash@"{1}"

pop vs apply

  • pop : Remove a single stashed state from the stash list and apply it on top of the current working tree state
  • apply: Like pop, but do not remove the state from the stash list.

checkout

  • git checkout --track origin/newsletter

Branch newsletter set up to track remote branch newsletter from origin.
Switched to a new branch ‘newsletter’

  • git checkout branch_name -- paths

clone

git clone --depth 1 url

Create a shallow clone with a history truncated to the latest commits.

rename branch

git branch -m main

del branch

delete local branch

  • git branch -d branch_name
  • git branch -D branch_name

The -d option stands for –delete, which would delete the local branch, only if you have already pushed and merged it with your remote branches.

The -D option stands for –delete –force, which deletes the branch regardless of its push and merge status, so be careful using this one!

delete remote branch

git push origin --delete branch_name

diff

  • git diff pom.xml
  • git diff branch1 branch2 – file

Unable to clone Git repository due to self signed certificate

git config --global http.sslVerify false

Git Pull Vs Git Fetch

Fetch

git fetch really only downloads new data from a remote repository - but it doesn’t integrate any of this new data into your working files. Fetch is great for getting a fresh view on all the things that happened in a remote repository.
Due to it’s “harmless” nature, you can rest assured: fetch will never manipulate, destroy, or screw up anything.

Pull

git pull, in contrast, is used with a different goal in mind: to update your current HEAD branch with the latest changes from the remote server. This means that pull not only downloads new data; it also directly integrates it into your current working copy files. This has a couple of consequences:

  • Since “git pull” tries to merge remote changes with your local ones, a so-called “merge conflict” can occur. Check out our in-depth tutorial on How to deal with merge conflicts for more information.
  • Like for many other actions, it’s highly recommended to start a “git pull” only with a clean working copy. This means that you should not have any uncommitted local changes before you pull.

keep a git branch in sync with master

1
2
3
4
5
6
7
git checkout master

git pull

git checkout feature_branch

git merge master
1
2
3
4
5
git checkout master

git merge feature_branch

git push origin master

git-reset

  • git reset --hard HEAD@{1} : if you’re feeling the moxy and haven’t done anything else

git reflog

git log

git log path

git-cherry-pick

git cherry-pick master

list conflicted files

git diff --name-only --diff-filter=U

force git pull to overwrite local files

1
2
git fetch --all
git reset --hard origin/branch_name

Force git stash to overwrite added files

git checkout stash -- .

github fork sync

1
2
git remote add upstream https://github.com/kevin-wayne/algs4.git
git pull upstream master

analyze metadata

ordered list of authors by commit count

git shortlog -sn

git shortlog -sn --no-merges

checkout any branch and overwrite local changes

git fetch --all

git reset --hard origin/abranch

git checkout $branch

Changing a commit message

change the most recent commit message

git commit --amend

change GitHub default branch from master to main

git config –global init.defaultBranch main

Hexo博客常用命令

  • 新建md格式的博文(create a new post):hexo new 标题
  • 启动node http服务,实时预览:hexo server
  • 生成静态网页:hexo generate, Generating static files
  • 增量生成静态网页:hexo generate --watch, Hexo can watch for file changes and regenerate files immediately. Hexo will compare the SHA1 checksum of your files and only write if file changes are detected.
  • 浏览静态网页:hexo server -s, In static mode, only files in the public folder will be served and file watching is disabled.
  • hexo version
  • Cleans the cache file (db.json) and generated files (public) : hexo clean
  • upgrade: npm install hexo-cli -g
  • theme: git clone --depth 1 https://github.com/hexojs/hexo-theme-landscape themes/landscape