- G. Best ACMer Solves the Hardest Problem
WYW___
数学
Problem-G-Codeforces有一天,一位优秀的ACMer将离开这个领域,面对新的挑战,就像前辈们所做的一样。他们中的一些人接管了家族企业,一些人在失业的边缘挣扎。一些人有勇气展示自己,成为专业的Ingress玩家,一些人仍在不断挑战自己的极限,尝试解决ProjectEuler中的所有问题。但是,对于前国王BenecoldeCecco来说,所有这些目的都太肤浅了。他现在所做的就是成为St
- Project Euler #1.Multiples of 3 and 5
朴文的文
原题链接:https://projecteuler.net/problem=1题目描述Ifwelistallthenaturalnumbersbelow10thataremultiplesof3or5,weget3,5,6and9.Thesumofthesemultiplesis23.Findthesumofallthemultiplesof3or5below1000.题目分析:求出1000以内3
- FileNotFoundError: [Errno 2] No such file or directory
攻城狮杰森
#PythonPython工作区vscodeOpen
问题描述最近用Python解决欧拉计划第十三题时,打开文件时总是报错FileNotFoundError:[Errno2]Nosuchfileordirectory:'/ProjectEuler/data/013.txt'map(int,open('data/013.txt'))后来查了下,发现是和编辑器有关系,涉及到工作区的概念,下面给出解决方案解决方案首先给大家看下我的工作区,Vscode编辑器
- python蓝桥杯打卡第二天
Pureliop
蓝桥杯蓝桥杯python
一.ProjectEuler(暴力+数学)通过欧拉计划:https://pe-cn.github.io/,进行暴力循环和数学的训练,练习思维。Problem1题目描述:3或5的倍数在小于10的自然数中,3或5的倍数有3、5、6和9,这些数之和是23。求小于1000的自然数中所有3或5的倍数之和。sum=0foriinrange(1001):ifi%3==0ori%5==0:sum+=iprint(
- How I Failed, Failed, and Finally Succeeded at Learning How to Code
hacwalker
读书笔记学习体会
HowIFailed,Failed,andFinallySucceededatLearningHowtoCodeByJamesSomersTheprogrammingwebsiteProjectEulerprovidesaplanforhowtolearnanythinginfun,discretestepsWhenColinHugheswasaboutelevenyearsoldhisparen
- 刷题网站总结
leetcode前端后端
LeetCode网站不用多说了,刷题必备牛客网站不仅可以刷题,还可以看面经Codewars网站有一些和业务很像的题,有一部分题的背景也很有趣,英语Hackerrank网站外企用的多,可以通过链接分享的形式来面试测试,想熟悉环境的话可以试试,英语Codility网站外企用的多,可以通过链接分享的形式来面试测试,想熟悉环境的话可以试试,英语ProjectEuler网站英语,数学类的题很多LintCod
- 【Project Euler】03
hello world 999
#TrashCan算法刷题
ProjectEuler03OVERVIEWProjectEuler031.E22:Namescore2.E32:Pandigitalproducts3.E33:Digitcancellingfractions4.E36:Double-basepalindromes5.E30:Digitfifthpowers6.onlineJ599:两数之和(1)暴力法:(2)二分法:(3)双指针法:(4)哈希表
- ARTS 打卡第三周
philiphili
AlgorithmProjectEuler25.1000-digitFibonaccinumberSimple-linearimportjava.math.BigInteger;publicclassLinear{publicstaticvoidmain(String[]args){inti=1;BigIntegerfi=BigInteger.ONE,fj=BigInteger.ONE;while
- Python3 欧拉计划 问题1-5
AiFany
EulerProject.png 欧拉计划(ProjectEuler)是一个解题网站,包括一系列有挑战性的数学与计算机编程题;要解开它们,需要的不止是数学知识:尽管数学能够帮助你找到一些优雅而有效的方法,大多数题目仍需要借助计算机和编程技巧来完成解答。本系列会持续按序更新对全部问题的基于Python3的解决方法。此外本系列文章仅提供问题的中文版,英文题目请参见网站。1、3和5的倍数 小于10的
- 只有lisp能做——欧拉计划第66题
算法lisp数学后端
仅以此文膜拜八年前的自己序言欧拉计划(ProjectEuler)就像LeetCode,是一个编程答题的网站。不同于LeetCode的是,欧拉计划只要求用户提交最终答案即可(一般是一个数字),而不需要完整代码。因此,可以尽情地使用自己喜欢的编程语言——不少题目甚至光靠笔和纸便能解决。欧拉计划的第66题非常有意思,它的题目很简单,就是要求找出在不大于1000的整数中,以哪一个数字为丢番图方程的系数,可
- 04-23.eri-test 欧拉计划:问题4演练
cunbang3337
\nThisarticleisafullwalkthroughonProjectEulerproblem4.Ifyou\xe2\x80\x99restumpedonsolvingthisproblem,you\xe2\x80\x99reintherightplace.Thisarticle...\n\nThepostProjectEuler:Problem4Walkthroughappearedf
- 硬币组合
realjc
编程基础
这是ProjectEuler的第31题,要求找出200pens的所有组合数,硬币包括1,2,5,10,20,50,100,200。#include#includeusingnamespacestd;longlongdfs(intrest,intk,vector&coins,vector>&memo){if(rest==0){memo[rest][k]=1;return1;}if(memo[rest
- 不同的幂值
realjc
编程基础
这是ProjectEuler的29题,链接:https://projecteuler.net/problem=29#include#include#include#include#includeusingnamespacestd;intmain(){setsp;intl=2,h=100;for(inti=l;imi;intk=i;while(k!=1){for(intj=2;jvs(h-l+1,"
- Pandigital products
realjc
编程基础
这是ProjectEuler的第32题,需要用1-9组成乘积等式,求所有的乘积和。#include#include#include#include#includeusingnamespacestd;boolcheck(inti,intj,intk){strings=to_string(i)+to_string(j)+to_string(k);sort(s.begin(),s.end());retu
- Quadratic primes
realjc
编程基础
这是ProjectEuler的第27题,题目解释起来有点长,放链接吧:https://projecteuler.net/problem=27#include#includeusingnamespacestd;constintS=8;longlongmult_mod(longlonga,longlongb,longlongc){a%=c;b%=c;longlongret=0;longlongtmp=
- Code Kata编码套路练习网站参考
shanzhizi
pythonpython
帮助编程学习者进行套路练习的网站有很多。知道这类编程练习网站之后,我做了一些搜索,收藏了一些国外程序员推荐的站点,在这里推荐给大家。CodewarscodeforcesHackerRankProjectEulerLeetCodeSPOJ:Quora上的朋友说,这个网站的难度最高。练习编码套路,贵在坚持、专注。当然,练习到了一定的水平之后,确实再做一些简单的题目,很难有较大的提高。建议高水平的朋友,
- python获取字母在字母表对应位置的几种方法及性能对比较
weixin_34198453
python获取字母在字母表对应位置的几种方法及性能对比较某些情况下要求我们查出字母在字母表中的顺序,A=1,B=2,C=3,以此类推,比如这道题目https://projecteuler.net/problem=42其中一步解题步骤就是需要把字母换算成字母表中对应的顺序。获取字母在字母表对应位置的方法,最容易想到的实现的是:使用str.index或者str.find方法:In[137]:"ABC
- 资料收集
lestat
other
一些简单的编程练习题本文由伯乐在线-敏敏翻译自AdrianNeumann。欢迎加入技术翻译小组。转载请参见文章末尾处的要求。每当成为入门CS课程(学生们学习编程语言的课程)的助教时,都困于提出好的练习题。ProjectEuler和类似的问题通常对初学者来说来难了,尤其是对于那些没有很强数学背景的同学。在这篇文章中,AdrianNeumann收集了一些从初级到高级逐级困难的练习题,适合刚开始学习
- ProjectEuler欧拉计划题解1-10
yolo_Leo
欧拉计划python编程语言
No.Title1Multiplesof3and52EvenFibonaccinumbers3Largestprimefactor4Largestpalindromeproduct5Smallestmultiple6Sumsquaredifference710001stprime8Largestproductinaseries9SpecialPythagoreantriplet10Summatio
- Project Euler Problem 71-80
hikean
C/C++经典小问题Project-EulerPython学习
ProjectEulerProblem71-80Problem71Orderedfractions有序分数考虑形如n/d的分数,其中n和d均为正整数。如果n#includeusingnamespacestd;constdoublelimit=1000000;doubledelt=1;inta,b;intgcd(inta,intb){if(!b)returna;returngcd(b,a%b);}i
- 【ProjectEuler】ProjectEuler_051(找出最小的能够通过改变同一部分得到八个质数的质数)
sytzz
【C/C++】【ProjectEuler】
#pragmaonce#include#include#includeusingnamespacestd;classMoonMath{public:MoonMath(void);~MoonMath(void);//************************************//Method:IsInt//Access:public//Describe:判断double值在epsilon
- project euler 解题
Hank_hust
projecteuler3:Anyintegergreaterthan1iseitheraprimenumber,orcanbewrittenasauniqueproductofprimenumbers(ignoringtheorder).每一个数都能表示成质数的乘积。constlongnumm=600851475143;longnewnumm=numm;longlargestFact=0;int
- Project Euler解题汇总 051 ~ 060
JavaSxy
数学&编程
[color=red]注[/color]:本文代码中会使用[url=http://eastsun.iteye.com/admin/blogs/207614]按字典顺序生成所有的排列[/url]与[url=http://eastsun.iteye.com/admin/blogs/240339]筛法求素数[/url]中介绍的函数。[url=http://projecteuler.net/index.p
- Project Euler|欧拉计划 1~10 (python 3.6)
全部梭哈一夜暴富
ProjectEuler
一,ProjectEuler.Problem1:Multiplesof3and5Multiplesof3and5Ifwelistallthenaturalnumbersbelow10thataremultiplesof3or5,weget3,5,6and9.Thesumofthesemultiplesis23.Findthesumofallthemultiplesof3or5below1000.P
- 【ProjectEuler】ProjectEuler_055(10000以下有多少Lychrel数?)
sytzz
【C/C++】【ProjectEuler】
#pragmaonce#include#includeusingnamespacestd;classMoonBigNum{public:MoonBigNum(void);MoonBigNum(conststring&num);MoonBigNum(constUINT32&num);MoonBigNum(constMoonBigNum&bigNum);~MoonBigNum(void);//****
- 【ProjectEuler】ProjectEuler_054(在扑克游戏中玩家1能赢多少局?)
sytzz
【C/C++】【ProjectEuler】
//Pokerhands//Problem54//Inthecardgamepoker,ahandconsistsoffivecardsandareranked,fromlowesttohighest,inthefollowingway:////HighCard:Highestvaluecard.//OnePair:Twocardsofthesamevalue.//TwoPairs:Twodiff
- 【ProjectEuler】ProjectEuler_053(对于1≤n≤100,C(n,r)有多少超过100万?)
sytzz
【C/C++】【ProjectEuler】
//Combinatoricselections//Problem53//Thereareexactlytenwaysofselectingthreefromfive,12345:////123,124,125,134,135,145,234,235,245,and345////Incombinatorics,weusethenotation,5C3=10.////Ingeneral,////nC
- 【ProjectEuler】ProjectEuler_052(找出最小的正整数x,使得2x, 3x, 4x, 5x和6x都包含同样的数字)
sytzz
【ProjectEuler】【C/C++】
#pragmaonce#include#include#includeusingnamespacestd;classMoonMath{public:MoonMath(void);~MoonMath(void);//************************************//Method:IsInt//Access:public//Describe:判断double值在epsilon
- 【ProjectEuler】ProjectEuler_042
sytzz
【C/C++】【ProjectEuler】
//Problem42//25April2003////Thenthtermofthesequenceoftrianglenumbersisgivenby,tn=½n(n+1);sothefirsttentrianglenumbersare:////1,3,6,10,15,21,28,36,45,55,...////Byconvertingeachletterinawordtoanumbercor
- 【ProjectEuler】ProjectEuler_022
sytzz
【ProjectEuler】【C/C++】
//Problem22//19July2002////Usingnames.txt(rightclickand'SaveLink/TargetAs...'),a46Ktextfilecontainingoverfive-thousandfirstnames,beginbysortingitintoalphabeticalorder.Thenworkingoutthealphabeticalvalu
- ASM系列六 利用TreeApi 添加和移除类成员
lijingyao8206
jvm动态代理ASM字节码技术TreeAPI
同生成的做法一样,添加和移除类成员只要去修改fields和methods中的元素即可。这里我们拿一个简单的类做例子,下面这个Task类,我们来移除isNeedRemove方法,并且添加一个int 类型的addedField属性。
package asm.core;
/**
* Created by yunshen.ljy on 2015/6/
- Springmvc-权限设计
bee1314
springWebjsp
万丈高楼平地起。
权限管理对于管理系统而言已经是标配中的标配了吧,对于我等俗人更是不能免俗。同时就目前的项目状况而言,我们还不需要那么高大上的开源的解决方案,如Spring Security,Shiro。小伙伴一致决定我们还是从基本的功能迭代起来吧。
目标:
1.实现权限的管理(CRUD)
2.实现部门管理 (CRUD)
3.实现人员的管理 (CRUD)
4.实现部门和权限
- 算法竞赛入门经典(第二版)第2章习题
CrazyMizzz
c算法
2.4.1 输出技巧
#include <stdio.h>
int
main()
{
int i, n;
scanf("%d", &n);
for (i = 1; i <= n; i++)
printf("%d\n", i);
return 0;
}
习题2-2 水仙花数(daffodil
- struts2中jsp自动跳转到Action
麦田的设计者
jspwebxmlstruts2自动跳转
1、在struts2的开发中,经常需要用户点击网页后就直接跳转到一个Action,执行Action里面的方法,利用mvc分层思想执行相应操作在界面上得到动态数据。毕竟用户不可能在地址栏里输入一个Action(不是专业人士)
2、<jsp:forward page="xxx.action" /> ,这个标签可以实现跳转,page的路径是相对地址,不同与jsp和j
- php 操作webservice实例
IT独行者
PHPwebservice
首先大家要简单了解了何谓webservice,接下来就做两个非常简单的例子,webservice还是逃不开server端与client端。我测试的环境为:apache2.2.11 php5.2.10做这个测试之前,要确认你的php配置文件中已经将soap扩展打开,即extension=php_soap.dll;
OK 现在我们来体验webservice
//server端 serve
- Windows下使用Vagrant安装linux系统
_wy_
windowsvagrant
准备工作:
下载安装 VirtualBox :https://www.virtualbox.org/
下载安装 Vagrant :http://www.vagrantup.com/
下载需要使用的 box :
官方提供的范例:http://files.vagrantup.com/precise32.box
还可以在 http://www.vagrantbox.es/
- 更改linux的文件拥有者及用户组(chown和chgrp)
无量
clinuxchgrpchown
本文(转)
http://blog.163.com/yanenshun@126/blog/static/128388169201203011157308/
http://ydlmlh.iteye.com/blog/1435157
一、基本使用:
使用chown命令可以修改文件或目录所属的用户:
命令
- linux下抓包工具
矮蛋蛋
linux
原文地址:
http://blog.chinaunix.net/uid-23670869-id-2610683.html
tcpdump -nn -vv -X udp port 8888
上面命令是抓取udp包、端口为8888
netstat -tln 命令是用来查看linux的端口使用情况
13 . 列出所有的网络连接
lsof -i
14. 列出所有tcp 网络连接信息
l
- 我觉得mybatis是垃圾!:“每一个用mybatis的男纸,你伤不起”
alafqq
mybatis
最近看了
每一个用mybatis的男纸,你伤不起
原文地址 :http://www.iteye.com/topic/1073938
发表一下个人看法。欢迎大神拍砖;
个人一直使用的是Ibatis框架,公司对其进行过小小的改良;
最近换了公司,要使用新的框架。听说mybatis不错;就对其进行了部分的研究;
发现多了一个mapper层;个人感觉就是个dao;
- 解决java数据交换之谜
百合不是茶
数据交换
交换两个数字的方法有以下三种 ,其中第一种最常用
/*
输出最小的一个数
*/
public class jiaohuan1 {
public static void main(String[] args) {
int a =4;
int b = 3;
if(a<b){
// 第一种交换方式
int tmep =
- 渐变显示
bijian1013
JavaScript
<style type="text/css">
#wxf {
FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#97FF98);
height: 25px;
}
</style>
- 探索JUnit4扩展:断言语法assertThat
bijian1013
java单元测试assertThat
一.概述
JUnit 设计的目的就是有效地抓住编程人员写代码的意图,然后快速检查他们的代码是否与他们的意图相匹配。 JUnit 发展至今,版本不停的翻新,但是所有版本都一致致力于解决一个问题,那就是如何发现编程人员的代码意图,并且如何使得编程人员更加容易地表达他们的代码意图。JUnit 4.4 也是为了如何能够
- 【Gson三】Gson解析{"data":{"IM":["MSN","QQ","Gtalk"]}}
bit1129
gson
如何把如下简单的JSON字符串反序列化为Java的POJO对象?
{"data":{"IM":["MSN","QQ","Gtalk"]}}
下面的POJO类Model无法完成正确的解析:
import com.google.gson.Gson;
- 【Kafka九】Kafka High Level API vs. Low Level API
bit1129
kafka
1. Kafka提供了两种Consumer API
High Level Consumer API
Low Level Consumer API(Kafka诡异的称之为Simple Consumer API,实际上非常复杂)
在选用哪种Consumer API时,首先要弄清楚这两种API的工作原理,能做什么不能做什么,能做的话怎么做的以及用的时候,有哪些可能的问题
- 在nginx中集成lua脚本:添加自定义Http头,封IP等
ronin47
nginx lua
Lua是一个可以嵌入到Nginx配置文件中的动态脚本语言,从而可以在Nginx请求处理的任何阶段执行各种Lua代码。刚开始我们只是用Lua 把请求路由到后端服务器,但是它对我们架构的作用超出了我们的预期。下面就讲讲我们所做的工作。 强制搜索引擎只索引mixlr.com
Google把子域名当作完全独立的网站,我们不希望爬虫抓取子域名的页面,降低我们的Page rank。
location /{
- java-归并排序
bylijinnan
java
import java.util.Arrays;
public class MergeSort {
public static void main(String[] args) {
int[] a={20,1,3,8,5,9,4,25};
mergeSort(a,0,a.length-1);
System.out.println(Arrays.to
- Netty源码学习-CompositeChannelBuffer
bylijinnan
javanetty
CompositeChannelBuffer体现了Netty的“Transparent Zero Copy”
查看API(
http://docs.jboss.org/netty/3.2/api/org/jboss/netty/buffer/package-summary.html#package_description)
可以看到,所谓“Transparent Zero Copy”是通
- Android中给Activity添加返回键
hotsunshine
Activity
// this need android:minSdkVersion="11"
getActionBar().setDisplayHomeAsUpEnabled(true);
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- 静态页面传参
ctrain
静态
$(document).ready(function () {
var request = {
QueryString :
function (val) {
var uri = window.location.search;
var re = new RegExp("" + val + "=([^&?]*)", &
- Windows中查找某个目录下的所有文件中包含某个字符串的命令
daizj
windows查找某个目录下的所有文件包含某个字符串
findstr可以完成这个工作。
[html]
view plain
copy
>findstr /s /i "string" *.*
上面的命令表示,当前目录以及当前目录的所有子目录下的所有文件中查找"string&qu
- 改善程序代码质量的一些技巧
dcj3sjt126com
编程PHP重构
有很多理由都能说明为什么我们应该写出清晰、可读性好的程序。最重要的一点,程序你只写一次,但以后会无数次的阅读。当你第二天回头来看你的代码 时,你就要开始阅读它了。当你把代码拿给其他人看时,他必须阅读你的代码。因此,在编写时多花一点时间,你会在阅读它时节省大量的时间。让我们看一些基本的编程技巧: 尽量保持方法简短 尽管很多人都遵
- SharedPreferences对数据的存储
dcj3sjt126com
SharedPreferences简介: &nbs
- linux复习笔记之bash shell (2) bash基础
eksliang
bashbash shell
转载请出自出处:
http://eksliang.iteye.com/blog/2104329
1.影响显示结果的语系变量(locale)
1.1locale这个命令就是查看当前系统支持多少种语系,命令使用如下:
[root@localhost shell]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
- Android零碎知识总结
gqdy365
android
1、CopyOnWriteArrayList add(E) 和remove(int index)都是对新的数组进行修改和新增。所以在多线程操作时不会出现java.util.ConcurrentModificationException错误。
所以最后得出结论:CopyOnWriteArrayList适合使用在读操作远远大于写操作的场景里,比如缓存。发生修改时候做copy,新老版本分离,保证读的高
- HoverTree.Model.ArticleSelect类的作用
hvt
Web.netC#hovertreeasp.net
ArticleSelect类在命名空间HoverTree.Model中可以认为是文章查询条件类,用于存放查询文章时的条件,例如HvtId就是文章的id。HvtIsShow就是文章的显示属性,当为-1是,该条件不产生作用,当为0时,查询不公开显示的文章,当为1时查询公开显示的文章。HvtIsHome则为是否在首页显示。HoverTree系统源码完全开放,开发环境为Visual Studio 2013
- PHP 判断是否使用代理 PHP Proxy Detector
天梯梦
proxy
1. php 类
I found this class looking for something else actually but I remembered I needed some while ago something similar and I never found one. I'm sure it will help a lot of developers who try to
- apache的math库中的回归——regression(翻译)
lvdccyb
Mathapache
这个Math库,虽然不向weka那样专业的ML库,但是用户友好,易用。
多元线性回归,协方差和相关性(皮尔逊和斯皮尔曼),分布测试(假设检验,t,卡方,G),统计。
数学库中还包含,Cholesky,LU,SVD,QR,特征根分解,真不错。
基本覆盖了:线代,统计,矩阵,
最优化理论
曲线拟合
常微分方程
遗传算法(GA),
还有3维的运算。。。
- 基础数据结构和算法十三:Undirected Graphs (2)
sunwinner
Algorithm
Design pattern for graph processing.
Since we consider a large number of graph-processing algorithms, our initial design goal is to decouple our implementations from the graph representation
- 云计算平台最重要的五项技术
sumapp
云计算云平台智城云
云计算平台最重要的五项技术
1、云服务器
云服务器提供简单高效,处理能力可弹性伸缩的计算服务,支持国内领先的云计算技术和大规模分布存储技术,使您的系统更稳定、数据更安全、传输更快速、部署更灵活。
特性
机型丰富
通过高性能服务器虚拟化为云服务器,提供丰富配置类型虚拟机,极大简化数据存储、数据库搭建、web服务器搭建等工作;
仅需要几分钟,根据CP
- 《京东技术解密》有奖试读获奖名单公布
ITeye管理员
活动
ITeye携手博文视点举办的12月技术图书有奖试读活动已圆满结束,非常感谢广大用户对本次活动的关注与参与。
12月试读活动回顾:
http://webmaster.iteye.com/blog/2164754
本次技术图书试读活动获奖名单及相应作品如下:
一等奖(两名)
Microhardest:http://microhardest.ite