OpenglES2.0 for Android:来画个矩形吧
上一节中我们绘制了一个三角形,我们在上一节的基础上来完成矩形的绘制 。
OK,开始动手做吧,首先在上一节的项目中的shape目录下新建一个类——Square (Square.java),然后定义矩形的四个顶点的坐标,此时代码如下(Square.java):
package com.cumt.shape;...
分类:
移动开发 时间:
2016-06-02 14:00:02
阅读次数:
299
题目链接:https://leetcode.com/problems/maximal-square/
题目:
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.
For example, given the...
分类:
其他好文 时间:
2016-05-31 06:29:17
阅读次数:
172
题目链接:https://leetcode.com/problems/perfect-squares/
题目:
Given a positive integer n, find the least number of perfect square numbers (for example, 1,
4, 9, 16, ...) which sum to n.
For examp...
分类:
其他好文 时间:
2016-05-30 15:34:19
阅读次数:
156
一天一道LeetCode
本系列文章已全部上传至我的github,地址:ZeeCoder‘s Github
欢迎大家关注我的新浪微博,我的新浪微博
欢迎转载,转载请注明出处
(一)题目
Implement int sqrt(int x).
Compute and return the square root of x.
(二)解题实现sqrt(x),找到一个数,...
分类:
其他好文 时间:
2016-05-30 15:18:40
阅读次数:
104
题目链接:https://leetcode.com/problems/sqrtx/
题目:
Implement int sqrt(int x).
Compute and return the square root of x.
思路:
二分法搜索平方数 要注意,如果不能完整的开方,要取靠左边的数,
算法:
public int mySqrt(int x) { ...
分类:
其他好文 时间:
2016-05-27 12:27:07
阅读次数:
175
最小二乘法Least Square Method,做为分类回归算法的基础,有着悠久的历史(由马里·勒让德于1806年提出)。它通过最小化误差的平方和寻找数据的最佳函数匹配。利用最小二乘法可以简便地求得未知的数据,并使得这些求得的数据与实际数据之间误差的平方和为最小。最小二乘法还可用于曲线拟合。其他一些优化问题也可通过最小化能量或最大化熵用最小二乘法来表达。
那什么是最小二乘法呢?别着急,我们先从...
分类:
编程语言 时间:
2016-05-27 12:19:23
阅读次数:
398
Description A permutation of length n is an array containing each integer from 1 to n exactly once. For example, q?=?[4,?5,?1,?2,?3] is a permutation. ...
分类:
其他好文 时间:
2016-05-25 18:39:51
阅读次数:
266
和上一题一样,把平方因子除去,然后对应的数就变成固定的 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; c ...
分类:
其他好文 时间:
2016-05-25 18:35:32
阅读次数:
126
Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The first line of input c ...
分类:
其他好文 时间:
2016-05-24 22:20:32
阅读次数:
193
square公司开源了一系列的优秀库,比如Retrofit,OkHttp,Picasso等,
前面简单分析了Picasso的源码,这里来分析下Retrofit的使用:一、gradle添加依赖compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compi...
分类:
其他好文 时间:
2016-05-23 10:45:45
阅读次数:
299