- 博客(52)
- 资源 (9)
- 收藏
- 关注
转载 高并发性能调试经验分享
作者:helloworlds链接:https://zhuanlan.zhihu.com/p/21348220来源:知乎引文4月份的时候看到一道面试题,据说是腾讯校招面试官提的:在多线程和高并发环境下,如果有一个平均运行一百万次才出现一次的bug,你如何调试这个bug?知乎原贴地址如下:腾讯实习生面试,这两道题目该怎么回答? - 编程 遗憾的是知乎很多答案在抨击这道题本身的正确性,虽然我不...
2018-10-10 20:06:02
285
原创 位运算的函数整理
/***************************************************** 判断参数x是否是偶数** param[in] x 数值* return 1 是偶数* 0 是奇数************************************
2018-01-03 09:05:29
509
转载 svn使用 BCompare比较工具
在windows环境下,安装Subversion和BCompare。 配置: 在C:\Users[用户]\AppData\Roaming\Subversion文件夹下找到config文件 在config文件中找到 diff-cmd选项,编辑diff-cmd的路径。diff-cmd ="C:\Users\[用户]\AppData\Roaming\Subversion\winmergediff.b
2017-12-08 14:43:05
4117
转载 批量删除.svn文件
windows环境 新建文件 deleteSVN.reg,复制下面内容到 deleteSVN.regWindows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN] @="Delete SVN Folders"[HKEY_LOCAL_MACHINE\SOFTWARE\
2017-12-08 14:29:23
330
转载 UTF-8编码占几个字节?
占2个字节的:带有附加符号的拉丁文、希腊文、西里尔字母、亚美尼亚语、希伯来文、阿拉伯文、叙利亚文及它拿字母则需要二个字节编码占3个字节的:基本等同于GBK,含21000多个汉字占4个字节的:中日韩超大字符集里面的汉字,有5万多个一个utf8数字占1个字节一个utf8英文字母占1个字节少数是汉字每个占用3个字节,多数占用4个字节。占用3个字节的范围U+2E80 - U+2EF3 : 0xE2 0xBA
2016-12-14 16:56:48
813
原创 【leetcode】26. Remove Duplicates from Sorted Array
对于一个已排序数组,删除其中的重复元素,并返回不重复元素的长度
2016-06-06 15:44:53
268
转载 C++中const总结(比较全)
对于基本声明const int r=100; //标准const变量声明加初始化,因为默认内部连接所以必须被初始化,其作用域为此文件,编译器经过类型检查后直接用100在编译时替换extend const int r=100; //将const改为外部连接,作用于扩大至全局,编译时会分配内存,并且可以不进行初始化,仅仅作为声明,编译器认为在程序其他地方进行了定义const int r[ ]={1
2016-05-31 14:19:22
252
转载 C++中placement new操作符(经典)
placement new是重载operator new的一个标准、全局的版本,它不能被自定义的版本代替(不像普通的operator new和operator delete能够被替换成用户自定义的版本)。它的原型如下:void *operator new( size_t, void *p ) throw() { return p; }首先我们区分下几个容易混淆的关键词:new、operator n
2016-05-31 13:50:37
277
原创 【leetcode】17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent
2016-05-23 16:09:03
192
原创 【leetcode】16. 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target.
2016-05-23 12:41:25
276
原创 【leetcode】12. Integer to Roman
整数转罗马数字,罗马数字共有七个,即I(1),V(5),X(10),L(50),C(100),D(500),M(1000)
2016-05-20 14:19:27
236
原创 【leetcode】9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space
2016-05-17 14:25:27
204
原创 【leetcode】8. String to Integer (atoi)
Implement atoi to convert a string to an integer
2016-05-17 13:25:56
197
原创 【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)
2016-05-04 17:00:33
208
原创 【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, and there exists one unique longest palindromic substring.
2016-04-27 11:42:31
233
原创 动态调试APK-超实用
经过两天的苦逼奋战,终于得到想要的东西了,出现的磕磕碰碰的心情,在出结果的那一刻,无以言表,所有资料来源于网络,我稍稍整理一下。1. 工具IntelliJ IDEAeclipseapktool(2.0以上版本,下载地址:http://connortumbleson.com/)Android真机2.反编译apk 并 生成新apk用apktool 反编译apk java -jar apkt
2016-04-21 20:15:00
1713
原创 【leetcode】3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb"
2016-04-13 15:28:17
232
原创 【leetcode】2. Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
2016-04-12 19:42:17
235
原创 【leetcode】 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
2016-04-12 19:36:55
260
原创 c 保存json数据到结构体
在c语言跟android打交道时,避免不了从android层传递json数据到c层,如果传来的是一个配置项,保存到c的结构体中,如果配置项中有一、两项,那一个一个解析放到结构体中也并不麻烦,问题来了,如果配置项多一些就显的代码冗余并且比较麻烦,这里总结了个小方法:#include "cjson.h"typedef unsigned char uint8_tstruct __cache_info
2015-12-11 17:56:08
1531
转载 动态规划:从新手到专家
本文转载自:http://hawstein.com/posts/dp-novice-to-advanced.html (作者:Hawstein)前言我们遇到的问题中,有很大一部分可以用动态规划(简称DP)来解。 解决这类问题可以很大地提升你的能力与技巧,我会试着帮助你理解如何使用DP来解题。 这篇文章是基于实例展开来讲的,因为干巴巴的理论实在不好理解。注意:如果你对于其中某一节已经了解并且不想阅读它
2015-12-11 17:43:42
271
原创 vs 2013 cl 查看内存模型使用方法
开始->所有程序->Visual Studio 2013 -> Visual Studio Tools 在打开的文件夹中选择 VS2013 x86 Native Tools Command Prompt命令行输入 cl [文件路径] /d1reportSingleClassLayout[类名] 例:cl D:\vs2013\test\Source.cpp /d1reportSingle
2015-11-11 11:23:19
553
原创 c简单定时器(兼容window/linux)
#include <stdio.h>#include <stdlib.h>#include <time.h>#ifdef WIN32 #include <windows.h> typedef __int64 int64_t; #define sleep(t) Sleep(t*1000) #define usleep(t) Sleep((t)/1000)#else
2015-09-18 12:36:19
770
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人