自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

代码菌的blog

Just for fun

  • 博客(275)
  • 资源 (3)
  • 收藏
  • 关注

原创 Lua与面向对象

影响一个人最好的方式不是语言本身,而是语言背后所表露的情感。待续

2016-11-24 16:19:19 664

原创 5分钟学会Lua编程(简明教程)

关键字:and break do else elseif end false goto for function if in local nil not or repeat return then true until while标识符有字母,数字,下划线组成,非数字开头,_这个标识符Lua特意留给用户使用。

2016-11-23 17:15:18 6847 3

原创 Visual Studio Code 使用指南大全

常用快捷键:移动当前行代码:Alt + down / alt + up

2016-11-17 16:19:15 22362

原创 四大美女之一王昭君

王昭君王昭君,名嫱,字昭君,乳名皓月, 西汉南郡秭归人, 今湖北省宜昌市兴山县人。汉元帝建昭元年,下诏征集天下美女补充后宫,王昭君年当二八,仿如空谷幽兰,自然被选入宫。从全国各地挑选入宫的美女数以千计,皇帝无法一一见面,首先由画工毛延寿各画肖像一幅呈奉御览。出生富贵的人家,就贿赂毛延寿,而王昭君自恃美冠群芳,也无力贿赂,就不行贿毛延寿,这让毛延寿很不满,于是就把王昭君画的丑

2017-09-04 00:43:11 2433 1

原创 Leetcode551. Student Attendance Record I一趟遍历

You are given a string representing an attendance record for a student. The record only contains the following three characters:'A' : Absent.'L' : Late.'P' : Present.A student could be

2017-07-02 21:58:24 794

原创 Leetcode628. Maximum Product of Three Numbers不要太简单

Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:Input: [1,2,3,4]Output: 24

2017-07-02 21:48:47 923 1

原创 LeetCode53. Maximum Subarray一种很好的做法

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] ha

2017-06-30 17:25:05 709

原创 SVN报错“Previous operation has not finished; run 'cleanup' if it was interrupted”的解决方法

百试不爽的解决方法1. 网上可以下到sqlite-shell-win32-x86: sqlite3.exe2.将sqlite3.exe放到svn 项目的主目录下,和.svn目录同级下。3.执行  sqlite3 .svn/wc.db "select * from work_queue" ,可以看到操作记录4.执行  sqlite3 .svn/wc.db "delete fr

2017-05-22 20:52:39 1079

原创 C#文件读写追加创建目录,判断目录是否存在等操作

using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;namespace FundData{ static class FileUtil { publi

2017-04-27 23:01:10 1096

原创 C#多线程实例清晰易懂

using System;using System.Threading;public class Fibonacci{ private int _n; private int _fibOfN; private ManualResetEvent _doneEvent; public int N { get { return _n; } } pub

2017-04-27 22:57:05 1196

原创 LeetCode347. Top K Frequent Elements【map+priority_queue解法】

Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number

2017-04-03 21:07:27 632

原创 优先队列priority_queue的使用

#include #include #include using my_pair_t = std::pair;using my_container_t = std::vector;void test_priority_queue(){auto my_comp = [](const my_pair_t e1, const my_pair_t& e2){

2017-04-03 19:51:56 650

原创 LeetCode530. Minimum Absolute Difference in BST中序遍历真神奇

Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1 \ 3 / 2Output:1Explanation:

2017-03-31 22:17:10 651

原创 LeetCode541. Reverse String II小学生都会

Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse all of th

2017-03-30 22:05:40 723

原创 LeetCode504. Base 7 我是如何解答的

Given an integer, return its base 7 string representation.Example 1:Input: 100Output: "202"Example 2:Input: -7Output: "-10"Note: The input will be in range of [-1e7, 1e

2017-03-30 21:28:01 678

原创 LeetCode520. Detect Capital有那么难解吗

Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in t

2017-03-28 21:44:12 486

原创 LeetCode415. Add Strings小学生都会

Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is Both num1 and num2 contains only digits 0-9.

2017-02-12 22:47:16 495

原创 Leetcode506. Relative Ranks简单粗暴

Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal".class Solution

2017-02-11 22:16:29 874

原创 LeetCode496. Next Greater Element I使用map解答

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums

2017-02-08 23:59:43 704

原创 LeetCode500. Keyboard Row我的C++解法

Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.Example 1:Input: ["Hello", "Alaska",

2017-02-07 22:41:18 1161

原创 Leetcode501. Find Mode in Binary Search Tree大道至简

Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST.Assume a BST is defined as follows:The left subtree of a node contains onl

2017-02-06 15:53:52 1540

原创 LeetCode447. Number of Boomerangs时间复杂度O(N2)

Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of the tup

2017-02-05 17:20:30 459

原创 Leetcode350. Intersection of Two Arrays II很简单的做法

Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as ma

2017-02-04 17:14:29 318

原创 Leetcode492. Construct the Rectangle最简洁解法

For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L

2017-02-04 11:43:38 633

原创 LeetCode485. Max Consecutive Ones有你真好

Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutiv

2017-01-19 20:40:37 437

原创 LeetCode476. Number Complement位操作面试题

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range

2017-01-14 23:42:26 405

原创 LeetCode453. Minimum Moves to Equal Array Elements我是这么解答的

Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n - 1 elements by 1.Example:Input:[1,2,3]Ou

2017-01-08 23:32:52 280

原创 C#编程命名规范

这盛世,如你所愿。每当看到一些混蛋的官员言论,内心挺愤怒的,即痛恨这种混蛋,也痛恨自己无能为力。命名约定:在.NET Framework名称空间中有两种命名约定,称为PascalCase和camelCase在camelCase中,有一个规则,如果多个单词命名变量名,从第二个单词开始,每个单词首字母大写命名规则:命名空间、类、常量等的名称都遵循Pascal规则!

2017-01-08 23:06:31 298

原创 LeetCode448. Find All Numbers Disappeared in an Array新年第一篇

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.

2017-01-01 11:00:55 301

原创 LeetCode455. Assign Cookies简单的做法

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a c

2016-12-31 11:28:29 397 2

原创 Leetcode461. Hamming Distance不要太简单哦

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, 

2016-12-23 10:40:18 2395

原创 463. Island Perimeter我的解法

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completel

2016-12-20 10:32:24 357

原创 用Irony实现一个计算器附上源码

满足的功能如下:加减乘除四则运算括号优先级比如:3+2*4 - 8/4 的结果是92* (2 + 3) - 2的结果是8Irony是.net平台下实现语言的开发工具箱。作者把C#这种强大的现代语言引入编译器解析领域,语法规则直接通过C#语言来描述。下面看看这个计算器的语法是怎么写的:Terminal num = new NumberLiteral

2016-12-15 10:19:38 578

原创 关于C#的virtual,Override和new的坑

先看这么一段代码:    public class Base    {        public virtual void DoWork( int a) { Console.WriteLine( "base dowork"); }    }    public class Derived : Base    {        public overri

2016-12-14 10:18:16 327

原创 比尔盖茨给年轻人的14条建议

Some rules kids won't learn in school                        Text By Charles J. Sykes                   Printed in San Diego Union Tribune                            September 19, 1996

2016-12-13 14:37:15 1524

原创 大数相乘

local bignum = {}function bignum.len(num)    return string.len(num)endfunction bignum.splitAt(num, pos)    local low = string.sub(num, -pos)    local high = string.sub(num, 1, -pos

2016-11-25 18:42:00 391

原创 大数big number的加减运算

以下是Lua的实现:function plus(str1, str2)    local increase = 0    local t = {}    local max = math.max(string.len(str1), string.len(str2))    for i = 0, max-1 do        local ch1 = string.sub(s

2016-11-25 14:37:34 5613

原创 LeetCode 401. Binary Watch

A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED represents a zero or one, with the least significant bit o

2016-10-29 16:53:58 392

原创 是爱情,让我们直立行走

你来自北京周口,我来自云南元谋。牵着你毛茸茸的小手,轻轻地亲上一口。是爱情,让我们直立行走。

2016-10-16 23:12:33 1174 1

原创 Leetcode412. Fizz Buzz爱美之心人皆有之

Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.

2016-10-15 22:08:40 738

csv大文件打开器

csv大文件打开器

2013-11-06

The C++ Programming Language 3rd Edition.pdf

对初学者来说绝对是好书,c++之父写的

2012-07-26

OpenGL(全)

OpenGL库文件大全

2012-05-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除