- 博客(34)
- 资源 (1)
- 收藏
- 关注
原创 git创建新分支、推送到新分支、删除本地分支精简版
git branch -a查看所有分支git checkout -b test01创建本地test01分支git push --set-upstream origin test01把本地test01分支推送到远程once created a local branch by accident:git branch -d [branch_name] to de...
2019-12-12 14:46:56
143
原创 推荐一个图片转换工具ffmpeg
由于弄人脸识别的sdk,需要,手上的jpg需要转换成bgr24等格式,这里提供一个方便的转换工具:ffmpeg,它可以把常见图片格式(jgp,png,bmp等)转换成二进制文件。apt-get install ffmpeg使用ffmpeg进行格式转换1.jpg toI420ffmpeg -i 001.jpg -pix_fmt yuv420p 001_I420_fromJPG...
2019-12-05 15:01:16
583
原创 my raw answers for leetcode - 10. Regular Expression Matching
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.T...
2019-11-21 18:01:17
207
原创 An algorithm to calculate the greater 2^n close to num.
ifnum&(num-1)!=0{ fornum&(num-1)!=0{ num&=(num-1) } num=num<<1}
2019-11-21 11:45:03
89
原创 my raw answers for leetcode - 9. Palindrome Number
Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanat...
2019-11-20 11:46:34
96
原创 my raw answers for leetcode - 8. String to Integer (atoi)
Implement atoi whichconverts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...
2019-11-19 18:25:15
87
原创 my raw answers for leetcode - 7. Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21code:classSolution{pub...
2019-11-13 18:24:03
121
原创 leetcode 11/10/19 周赛记录。
第一题:1252. Cells with Odd Values in a MatrixGivennandmwhich are the dimensions of a matrix initialized by zeros and given an array indiceswhere indices[i] = [ri, ci]. For each pair of [ri, ci]...
2019-11-12 11:40:16
139
原创 my working bash script for restarting services 11/11/19
#!/bin/bash#DEBUG_MODE=onunset DEBUG_MODERESOURCE_SERVER_LOCKFILE=/tmp/resource_service.lockFAST_CGI_LOCK_FILE=/tmp/fastcgi.lock. /home/teaegg/bin/functions-eucs.sh. /home/teaegg/bin/functions....
2019-11-11 11:21:09
229
原创 my raw answers for leetcode - 6. ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)And then read line by lin...
2019-11-08 15:08:42
121
原创 Program open configuration file with it's relative path on Linux.
The problem is, if you open a programin another directory(not the executable directory). A bad program can't read the configuration file in it's relative path. To solve this, We can either wrap it...
2019-11-05 15:26:09
121
原创 leetcode 11/02/19, 11/03/19 周赛记录。
第一次参加周赛就单双周一起报了。刷的题还不多,因此每场只记录2-3道自己掌握的(比赛时提交通过或完了通不过,事后看一眼就明白怎么回事的)。Cuz my current goal is to get completely control of questions which are easy or medium-hard to solve(The label "hard" marked by Lee...
2019-11-04 11:10:04
319
原创 my raw answers for leetcode - 5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Exampl...
2019-10-18 17:27:55
130
原创 my raw answers for leetcode - 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and n...
2019-10-17 16:46:19
115
原创 My first implementation of Cpp for Binary Search Tree.
After gettingthrough of some video lessons about such Binary Tree, Binary Search Tree, I get comprehend of this kind of algorithm method and would like to do a brief implementation. Following is my C...
2019-10-15 15:08:35
102
原创 my raw answers for leetcode - 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:In...
2019-10-12 11:58:37
98
原创 my raw answers for leetcode - 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...
2019-10-10 11:32:52
119
原创 my raw answers for leetcode - 1. Two Sum
1. Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not u...
2019-10-09 15:05:58
117
原创 boot kali without gui
https://forums.kali.org/showthread.php?27191-RPi2-Kali2-0-1-boot-to-commandline-instead-of-XTypically I have a old laptop(bought around Jan 18th 2014 i guess, Best Buy in marlborough, Massachuset...
2019-08-24 20:12:45
387
原创 filter for dirty string.
When I invoke somewhere my function the parameter is within dirty string, thus I did filtering:char username[20] = { 0 };memcpy(username, _username->user.s, _username->user.len);...
2019-08-08 17:41:06
138
原创 My demons for restarting a program.
My program(interphone_manager) has encountered a situation that when it is on WAN it's connection sometimes fail to connect to pjsip service. Then the program will quit. Thus I wrote a demons for rest...
2019-08-06 18:28:02
95
原创 "bad prefix" when i was compiling libcurl with openssl
I tried "./configure --disable-shared --enable-static --prefix=/home/libinterphone_manger/curlout--with-ssl=/lib64" with libssl.so in"/lib64".However it comes out with "configure: error: /lib64 is...
2019-07-08 15:10:46
1728
原创 git pull unix file with windows format problem
When I git push some file suffix with .ini and then git pull it, it always lead format wrong problem.2 ways to solve:1)use command dos2unix: $ dos2unix [filename].2)setoption to pull with un...
2019-07-03 11:38:35
227
原创 libcurl don't download completely problem
Greetings everyone read this topic, my platform is win32. And I'm using libcurl with a problem.My goal is to coding with libcurl for a download program, which it includes requesting a url to downloa...
2019-03-28 17:14:44
156
转载 多线程程序设计的8个规则
在Intel,并行化技术主要有四个步骤:分析,设计与实现,调试以及性能调优。这些步骤用来对一段串行代码进行并行化。尽管这四个步骤中的第一、三、四步都已经有了很多相关文档,但是关于怎样进行设计与实现的却不多。 并行编程更像是一门艺术,而不是一门科学。这里将会给出八条设计多线程程序的简单规则,你可以把他们一一放进你的多线程程序设计百宝箱中。通过参考这些规则,你能写出高质量、高效率的多线程程序。我努...
2019-01-15 15:49:32
981
2
原创 Some parameters, struct and return values about epoll
#include <sys/epoll.h>int epoll_create(int size);int epoll_create1(int flags);--When you program on linux kernel version higher than 2.6.8, you should ignore the parameter "size", you shou...
2018-11-27 16:03:10
128
原创 SIP会话发起协议流程——自己根据rfc3261复写的一个例子
作者:sight根据:rfc-3261 直接进入如下例子,此例同rfc3261,更多的是我的理解+我的注解以及我潦草的翻译。 发起者:Alice@atlanta.com响应者:Bob@biloxi.com Text-encode 会话细节如媒体类型、编码器、样本率等没在SIP里描述,而是在SDP(...
2018-09-26 16:50:50
884
原创 What does C# delegate do?
Skimming through a book about .NET C#, I was attracted to its language features different from C/C++. Delegate is a known feature from JAVA series language which draw my attention when I skip-read thi...
2018-09-07 14:19:59
124
原创 My ~/.vimrc until 20180717
" 07/17/2018 theta 1.0 notes" 1.basic settings for coing in C/C++" 2.ctags" 3.omnicppcomplete" 4.quickfix for make in vim "=======================" from example vimrc"=================...
2018-07-17 17:17:17
129
原创 my original studying notes for readn(),writen(),and readline() function
#include "unp.h"ssize_t readn(int fd, void *vptr, size_t n){ size_t nleft; ssize_t nread; char *ptr; ptr = vptr; /
2017-11-13 22:03:09
128
原创 Some thing about kali linux lite
I was just hesitate for installing kali or kali light on my raspberry pi...For kali linux full iso version, it says to save all packages but... What about kali light?here I grabbed some info about
2017-10-05 21:21:29
287
原创 some useful stuff about TCP/IP
A online calculator for GLOP multicast and AS number map each others : http://gigapop.uoregon.edu/glop/
2017-10-04 20:18:09
144
原创 Install Linux upon Windows10 and some set-up
I've been using CentOS7.1 for months, 2 years ago, in Massachusetts.More Linux joy is what I want for now.So, I installed Ubuntu*GamePack 16.04 (http://ualinux.com), for fun and coding.Here
2017-09-26 17:35:22
205
C/C++ GUI Programming with Qt4 (S - Jasmin Blanchette),pdf
2018-07-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人