【题目】【分析】本题较为简单,设置一个计数器,当接收的字符为"("时候自增,为")"时自减,为B时候退出循环。AC的C++代码如下:#include#includeusingnamespacestd;intmain(){strings;intcount;while(getline(cin,s)){count=0;intlen=s.length();for(inti=0;i
【算法随笔:HDU 3333 Turing tree】(线段树 | 离线 | 离散化 | 贪心)
XNB's Not a Beginner
算法算法哈希算法leetcodec++排序算法
https://acm.hdu.edu.cn/showproblem.php?pid=3333https://acm.hdu.edu.cn/showproblem.php?pid=3333https://vjudge.net.cn/problem/HDU-3333https://vjudge.net.cn/problem/HDU-3333题目很简单,给出长度为N的数组,Q次询问,每次给出区间[x,
test_Time_2h
爱思考的小伙
#基础数据结构与算法图论算法c++
文章目录RelicDiscoveryHDU-5982TextReverseHDU-1062DownloadManagerHDU-3233看病要排队HDU-1873RedandBlackHDU-1312最短路HDU-2544https://vjudge.csgrandeur.cn/contest/499778RelicDiscoveryHDU-5982#include#includeusingnam
hdu 4408 Minimum Spanning Tree
luckycoding
hdu
题目连接:点击打开链接解法:利用kruskal算法把图划分成森林,同一点有相同最小的权值到别的点,通过determinant计算树的课数。总结:模板+自己不太懂=记录+重新学代码君:#include#include#include#defineLLlonglongusingnamespacestd;constintMAX=105;constintMAXE=1005;structnode{intse
2019年2月第一周复盘——Tina
简均写记
图片发自App二月第一周,整个人总体上比较懒散。对待学习很松懈,运动更是完全暂停。第一周只做到了流利说每天坚持打卡,但是学习效率非常低下,边带娃边打卡,总会让孩子误以为我在玩手机,影响很不好,我强烈反对,要求自己在早上恢复五点早起进行学习。连续两天睡懒觉到八点多,没有早起学习。可能是因为太久没有回到爸爸妈妈的身边,让我感觉非常的放松。这是借口之一,关键是自己对自己不够严格。只是为了打卡而早起打卡,
怎么才能轻松地成功
嗨皮娜娜
今天是Tina与您分享的第145篇原创昨天晚上和伙伴开会,图图在我身边画画,画完以后,说要跟我说一句悄悄话,然后就贴在我耳边说了一句:“辛苦啦!”然后就出去书房了。当下那刻,感情特别复杂。就觉得图图突然变得更懂事了,她理解妈妈了,就像我的伙伴一样。因为当下在开会,没有和她多说,会议结束后我就感谢图图,并问她为何想到说这样的话。图图说因为我看你一直在忙,听她说完我就直接去亲了她。我内心很感激图图的理
2024/2/17 图论 最短路入门 dijkstra 1
极度的坦诚就是无坚不摧
寒假集训寒假算法图论算法c++c语言dijkstra
目录算法思路Dijkstra求最短路AcWing849.Dijkstra求最短路I-AcWing850.Dijkstra求最短路II-AcWing题库最短路最短路-HDU2544-VirtualJudge(vjudge.net)【模板】单源最短路径(弱化版)P3371【模板】单源最短路径(弱化版)-洛谷|计算机科学教育新生态(luogu.com.cn)【模板】单源最短路径(标准版)P4779【模板
2048
不绝_7647
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2048思路:该题运用了错排公式,即D(n)=(n-1)*(D(n-1)+D(n-2))。计算出n张字条错排给n个人的可能性(每个人得到的都非自己的字条),再除以n张字条给n个人的所有可能性,就能得出结果。做法:建立数组a,并给a[0],a[1].a[2],a[3]分别赋值0,0,1,2.(其中1和2对应
mysql 优化查询in_MySQL中where条件中IN的慢查询优化
weixin_39736047
mysql优化查询in
MySQL中where条件中IN的慢查询优化我们在编写SQL查询语句时,有时候会遇到连表查询的情况,有时的业务场景为,要查询满足某种条件的一系列id的数据。优化方式一:示例:查询出指定时间之后凡是上传过图片的用户所在的镇和镇的管理员名。这种优化方式是另外一个博主那里借鉴过来的。SQL:SELECTDISTINCTuser_name,town_nameFROMt_farmersWHEREidIN(S
上帝为你关上一扇门,同时也为你打开一扇窗
Ange_eccb
今年三月我从工作近八年的公司离开后,进入了人生中的第一次失业状态,没了方向没了目标,对未来的惶恐和不安与日俱增,日趋严重的失眠和焦虑让我一度怀疑自己快抑郁了……偶然的一天是与Tina相约来到益百分长沙工作室认识了一群我以前从未接触过的友人们,品茗茶,喝花酒,体验产品。让我这个井底蛙看到了世界还有这样的温情快乐,健康美好的一面,了解到还有这样一个有温度的公司,能给人们带来健康的产品,助力更多的人实现
杭电Oj第二周
J_4d20
做题有个习惯,就是没通过一道题之后都会找下答案,对比一下我的代码还有没有可以在优化的地方,使他更简便链接:http://acm.hdu.edu.cn/showproblem.php?pid=2016我的代码是:#includeintmain(){intn,a[100],t,i,b;while(scanf("%d",&n)!=EOF){if(na[j]){t=a[j];min=j;}for(i=1;
Carla自学整理——其它基本API
小新奕
自动驾驶人工智能
设置ClientandWorld#localhost为当前主机,2000为端口client=carla.Client('localhost',2000)#最长连接时间,若2s后仍未连接上则自动退出client.set_timeout(2.0)#加载想要的地图——‘Town01’在路径Unreal/CarlaUE4/Content/Carla/Maps中client.load_world('Town
钻石行动21天
致力于努力修正自己的杨青
今天金刚智慧晚上分享课!前天我还记得!今天早上起来就开始迷迷糊糊的给忘了,闺蜜提醒才想起来!然后匆匆换了身装束!下午去参加课程路上还迷迷糊糊的没在意怎么走!就只管跟着闺蜜的导航!到了之后听着老师们的分享我开始兴奋起来了!听到王校长讲他当成是怎样的一个学习的瘾让自己陷入抑郁的,当时只是简单的联想了一下自己!后来听到Tina老师讲笔的故事,让我意识到我之前讲的缺失的部分在哪里!听到她在分享后面,如何思
柳婷老师(Tina老师):《坚强与脆弱的背后》
ProPARTY
【ProRARTY台湾特色知识课堂】-2018025坚强与脆弱的背后有人问我矢车菊与橡树两种花精性格都是乐于为人服务,有何不同?两者的起心动念都是良善、热心、愿意助人。柔弱娇小的矢车菊矢车菊失去平衡时,被人利用,甚至践踏,因为她渴求获得他人的肯定,不敢拒绝。因而认同了自己的软弱,却忘记自己内在的力量。找到自己力量后的矢车菊会绽放得亭亭玉立,自立立人。坚毅承担的橡树相反地,橡树坚强、勇于承担,总是一
Smiles to the death(3)
KevinZucker
Oneday,a60-year-oldmanexperiencedchestpainandshortnessofbreathduetoexcessiveactivity.Hiswife,whoismorethan10yearshisjunior,wasalarmedatthesightofherhusbandandrushedtomassagehiminanattempttoincreasehis
一件小事
骑驴书生
下班的时候,我坐上厂车。前面的Tina原本靠在位置上,这时看后面有人,立刻就把椅子的角度调小了一点,以便坐在后面的人感觉舒服一点。这本是一件小事,却让我有些感触。同样一起做厂车的很多人,为了自己坐或者靠的舒服,都喜欢把椅子的角度调整的很大,这样一来坐在后面的人会觉得自己的空间很压抑,连进出都不是很方便。可是厂车就是这么多位置,只能说运气好的话,可以碰到极个别像Tina这样的人,即使他跟你坐在一起,
2018-10-29 G211第五组 Tina 周检视
e9b6eca5c0ee
G211第五组Tina周检视20181028日历,周记Evernote电子日记上加的自动内容越来越多,好处是可以打勾,缺点是看不到重点,当天内容不明显。日记和周检视都有停顿清单Omnifocus又放了不少东西在OF,还是没有分类好,有效使用。本周成绩本周学习收获:[x]基本每天都有听到Ping教练的读书会的好书[x]工作压力大的时候用“一个番茄”App帮助时间管理吃青蛙(怎样坚持用下去?)[x]订
在Rock Home Town里重新“发现”石家庄
命彡
石家庄,这个被戏称为“全中国存在感最低的省会城市”,最近的存在感不是一点点强。一周前,有媒体援引石家庄市文化广电和旅游局消息称,将于今年7月至10月,举办“RockHomeTown”——中国“摇滚之城”音乐演出季,并不定期安排摇滚乐手随机乘坐公交车,创新举办“快闪式”即兴演出,增强市民参与感和互动性,全面打造中国“摇滚之城”。不是说说而已。这两天,官方乘势推出另类城市宣传片《杀不死的石家庄》,彻底
任意IOS16系统iPad/Iphone开启台前调度
zxfBdd
工作效率ipadiphoneios
方法来自GitHub:GitHub-khanhduytran0/TrollPad:TrollSpringBoardintothinkingit'srunningoniPadOS注意操作前iPad/iPhone上需要安装巨魔手机助手和Filza,关于这两个软件的安装自行百度方法。备注一个巨魔手机助手的下载地址ReleaseTrollStar1.2·34306/TrollStar·GitHub原文内容
一、Town and Country Life in England
slumberland蓝地
音频地址:https://www.ximalaya.com/waiyu/7746889/35900958原文:ThereisabigdifferencebetweentownlifeandcountrylifeinEngland.Inthecountry,everybodyknowseverybodyelse.Theyknowwhattimeyougetup,whattimeyougotobeda
朋友懵了:公司正在裁员
齐梁小生
上周四,朋友Tina在微信群里心态崩了。公司正在裁员,第一轮裁员结束,已经裁了30多人,后面还要看形势,决定是否需要第二轮。又要开始狂刷招聘APP了。Tina所在公司是一家规模不小的机床设备制造外企,去年9月份才入职。之前一直在微信群跟我们炫新工作,厂车接送,4点半下班,食堂伙食OK,办公室氛围好,工作还清闲,跟以前的东家比起来,简直不要太棒。没想到今年一场全球规模的疫情,让公司业务大受影响,不得
上海交大的一对夫妇学习喜剧公式我是喜剧喜剧。
yanchao0910
中国新网上海新闻12月14日讯(XuYin)记者今天获悉,在第七期的我是漫画狂节目中,一位金发女郎将登上西部舞台,一部标准的北京电影令人惊叹。金发碧眼,白皙的皮肤,高高的鼻子,长长的双腿,这个美丽的女人在她来到我痴迷于喜剧的舞台上是非常引人注目的。她的开幕式也让蔡明、潘长江、Mun三个喜剧伙伴惊呆了:大家好,我的名字叫TiNa,我我是俄罗斯人的混血儿,我们家的老人北京,老婆婆,对不起,我说话带点口
麦豆悦读英文绘本讲师训练营【第20期】---14/21--绘本赏析《Pat the cat》
白鹭丝
20期3王海霞Tina这是一本小册子书,专业一点叫口袋书吧!随身携带完成不成问题,适合低幼段的宝宝,比如我家英语零基础的娃,所以果断搬回家。这本书,虽然小,但是它的词汇量还是有一点多的,用来磨耳朵还可以,但是要小朋友输出可以说,对我们家小朋友还是有一定难度,不过搞懂整个故事,已经很不容易了。第一页是做一个简介,然后“Won'tyoubeourfriendtoday?Youcandoalltheth
jvm调优总结(从基本概念 到 深度优化)
oloz
javajvmjdk虚拟机应用服务器
JVM参数详解:http://www.cnblogs.com/redcreen/archive/2011/05/04/2037057.html
Java虚拟机中,数据类型可以分为两类:基本类型和引用类型。基本类型的变量保存原始值,即:他代表的值就是数值本身;而引用类型的变量保存引用值。“引用值”代表了某个对象的引用,而不是对象本身,对象本身存放在这个引用值所表示的地址的位置。
【Scala十六】Scala核心十:柯里化函数
bit1129
scala
本篇文章重点说明什么是函数柯里化,这个语法现象的背后动机是什么,有什么样的应用场景,以及与部分应用函数(Partial Applied Function)之间的联系 1. 什么是柯里化函数
A way to write functions with multiple parameter lists. For instance
def f(x: Int)(y: Int) is a
HashMap
dalan_123
java
HashMap在java中对很多人来说都是熟的;基于hash表的map接口的非同步实现。允许使用null和null键;同时不能保证元素的顺序;也就是从来都不保证其中的元素的顺序恒久不变。
1、数据结构
在java中,最基本的数据结构无外乎:数组 和 引用(指针),所有的数据结构都可以用这两个来构造,HashMap也不例外,归根到底HashMap就是一个链表散列的数据
Java Swing如何实时刷新JTextArea,以显示刚才加append的内容
周凡杨
java更新swingJTextArea
在代码中执行完textArea.append("message")后,如果你想让这个更新立刻显示在界面上而不是等swing的主线程返回后刷新,我们一般会在该语句后调用textArea.invalidate()和textArea.repaint()。
问题是这个方法并不能有任何效果,textArea的内容没有任何变化,这或许是swing的一个bug,有一个笨拙的办法可以实现
servlet或struts的Action处理ajax请求
g21121
servlet
其实处理ajax的请求非常简单,直接看代码就行了:
//如果用的是struts
//HttpServletResponse response = ServletActionContext.getResponse();
// 设置输出为文字流
response.setContentType("text/plain");
// 设置字符集
res
FineReport的公式编辑框的语法简介
老A不折腾
finereport公式总结
FINEREPORT用到公式的地方非常多,单元格(以=开头的便被解析为公式),条件显示,数据字典,报表填报属性值定义,图表标题,轴定义,页眉页脚,甚至单元格的其他属性中的鼠标悬浮提示内容都可以写公式。
简单的说下自己感觉的公式要注意的几个地方:
1.if语句语法刚接触感觉比较奇怪,if(条件式子,值1,值2),if可以嵌套,if(条件式子1,值1,if(条件式子2,值2,值3)
linux mysql 数据库乱码的解决办法
墙头上一根草
linuxmysql数据库乱码
linux 上mysql数据库区分大小写的配置
lower_case_table_names=1 1-不区分大小写 0-区分大小写
修改/etc/my.cnf 具体的修改内容如下:
[client]
default-character-set=utf8
[mysqld]
datadir=/var/lib/mysql
socket=/va
我的spring学习笔记6-ApplicationContext实例化的参数兼容思想
aijuans
Spring 3
ApplicationContext能读取多个Bean定义文件,方法是:
ApplicationContext appContext = new ClassPathXmlApplicationContext(
new String[]{“bean-config1.xml”,“bean-config2.xml”,“bean-config3.xml”,“bean-config4.xml
mysql 基准测试之sysbench
annan211
基准测试mysql基准测试MySQL测试sysbench
1 执行如下命令,安装sysbench-0.5:
tar xzvf sysbench-0.5.tar.gz
cd sysbench-0.5
chmod +x autogen.sh
./autogen.sh
./configure --with-mysql --with-mysql-includes=/usr/local/mysql
sql的复杂查询使用案列与技巧
百合不是茶
oraclesql函数数据分页合并查询
本片博客使用的数据库表是oracle中的scott用户表;
------------------- 自然连接查询
查询 smith 的上司(两种方法)
&
深入学习Thread类
bijian1013
javathread多线程java多线程
一. 线程的名字
下面来看一下Thread类的name属性,它的类型是String。它其实就是线程的名字。在Thread类中,有String getName()和void setName(String)两个方法用来设置和获取这个属性的值。
同时,Thr
JSON串转换成Map以及如何转换到对应的数据类型
bijian1013
javafastjsonnet.sf.json
在实际开发中,难免会碰到JSON串转换成Map的情况,下面来看看这方面的实例。另外,由于fastjson只支持JDK1.5及以上版本,因此在JDK1.4的项目中可以采用net.sf.json来处理。
一.fastjson实例
JsonUtil.java
package com.study;
impor
【RPC框架HttpInvoker一】HttpInvoker:Spring自带RPC框架
bit1129
spring
HttpInvoker是Spring原生的RPC调用框架,HttpInvoker同Burlap和Hessian一样,提供了一致的服务Exporter以及客户端的服务代理工厂Bean,这篇文章主要是复制粘贴了Hessian与Spring集成一文,【RPC框架Hessian四】Hessian与Spring集成
在
【RPC框架Hessian二】Hessian 对象序列化和反序列化一文中
【Mahout二】基于Mahout CBayes算法的20newsgroup的脚本分析
bit1129
Mahout
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information re
nginx三种获取用户真实ip的方法
ronin47
随着nginx的迅速崛起,越来越多公司将apache更换成nginx. 同时也越来越多人使用nginx作为负载均衡, 并且代理前面可能还加上了CDN加速,但是随之也遇到一个问题:nginx如何获取用户的真实IP地址,如果后端是apache,请跳转到<apache获取用户真实IP地址>,如果是后端真实服务器是nginx,那么继续往下看。
实例环境: 用户IP 120.22.11.11
java-判断二叉树是不是平衡
bylijinnan
java
参考了
http://zhedahht.blog.163.com/blog/static/25411174201142733927831/
但是用java来实现有一个问题。
由于Java无法像C那样“传递参数的地址,函数返回时能得到参数的值”,唯有新建一个辅助类:AuxClass
import ljn.help.*;
public class BalancedBTree {
BeanUtils.copyProperties VS PropertyUtils.copyProperties
诸葛不亮
PropertyUtilsBeanUtils
BeanUtils.copyProperties VS PropertyUtils.copyProperties
作为两个bean属性copy的工具类,他们被广泛使用,同时也很容易误用,给人造成困然;比如:昨天发现同事在使用BeanUtils.copyProperties copy有integer类型属性的bean时,没有考虑到会将null转换为0,而后面的业
[金融与信息安全]最简单的数据结构最安全
comsci
数据结构
现在最流行的数据库的数据存储文件都具有复杂的文件头格式,用操作系统的记事本软件是无法正常浏览的,这样的情况会有什么问题呢?
从信息安全的角度来看,如果我们数据库系统仅仅把这种格式的数据文件做异地备份,如果相同版本的所有数据库管理系统都同时被攻击,那么
vi区段删除
Cwind
linuxvi区段删除
区段删除是编辑和分析一些冗长的配置文件或日志文件时比较常用的操作。简记下vi区段删除要点备忘。
vi概述
引文中并未将末行模式单独列为一种模式。单不单列并不重要,能区分命令模式与末行模式即可。
vi区段删除步骤:
1. 在末行模式下使用:set nu显示行号
非必须,随光标移动vi右下角也会显示行号,能够正确找到并记录删除开始行
清除tomcat缓存的方法总结
dashuaifu
tomcat缓存
用tomcat容器,大家可能会发现这样的问题,修改jsp文件后,但用IE打开 依然是以前的Jsp的页面。
出现这种现象的原因主要是tomcat缓存的原因。
解决办法如下:
在jsp文件头加上
<meta http-equiv="Expires" content="0"> <meta http-equiv="kiben&qu
不要盲目的在项目中使用LESS CSS
dcj3sjt126com
Webless
如果你还不知道LESS CSS是什么东西,可以看一下这篇文章,是我一朋友写给新人看的《CSS——LESS》
不可否认,LESS CSS是个强大的工具,它弥补了css没有变量、无法运算等一些“先天缺陷”,但它似乎给我一种错觉,就是为了功能而实现功能。
比如它的引用功能
?
.rounded_corners{
[入门]更上一层楼
dcj3sjt126com
PHPyii2
更上一层楼
通篇阅读完整个“入门”部分,你就完成了一个完整 Yii 应用的创建。在此过程中你学到了如何实现一些常用功能,例如通过 HTML 表单从用户那获取数据,从数据库中获取数据并以分页形式显示。你还学到了如何通过 Gii 去自动生成代码。使用 Gii 生成代码把 Web 开发中多数繁杂的过程转化为仅仅填写几个表单就行。
本章将介绍一些有助于更好使用 Yii 的资源:
Apache HttpClient使用详解
eksliang
httpclienthttp协议
Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且也方便了开发人员测试接口(基于Http协议的),即提高了开发的效率,也方便提高代码的健壮性。因此熟练掌握HttpClient是很重要的必修内容,掌握HttpClient后,相信对于Http协议的了解会
zxing二维码扫描功能
gundumw100
androidzxing
经常要用到二维码扫描功能
现给出示例代码
import com.google.zxing.WriterException;
import com.zxing.activity.CaptureActivity;
import com.zxing.encoding.EncodingHandler;
import android.app.Activity;
import an
纯HTML+CSS带说明的黄色导航菜单
ini
htmlWebhtml5csshovertree
HoverTree带说明的CSS菜单:纯HTML+CSS结构链接带说明的黄色导航
在线体验效果:http://hovertree.com/texiao/css/1.htm代码如下,保存到HTML文件可以看到效果:
<!DOCTYPE html >
<html >
<head>
<title>HoverTree
fastjson初始化对性能的影响
kane_xie
fastjson序列化
之前在项目中序列化是用thrift,性能一般,而且需要用编译器生成新的类,在序列化和反序列化的时候感觉很繁琐,因此想转到json阵营。对比了jackson,gson等框架之后,决定用fastjson,为什么呢,因为看名字感觉很快。。。
网上的说法:
fastjson 是一个性能很好的 Java 语言实现的 JSON 解析器和生成器,来自阿里巴巴的工程师开发。
基于Mybatis封装的增删改查实现通用自动化sql
mengqingyu
DAO
1.基于map或javaBean的增删改查可实现不写dao接口和实现类以及xml,有效的提高开发速度。
2.支持自定义注解包括主键生成、列重复验证、列名、表名等
3.支持批量插入、批量更新、批量删除
<bean id="dynamicSqlSessionTemplate" class="com.mqy.mybatis.support.Dynamic
js控制input输入框的方法封装(数字,中文,字母,浮点数等)
qifeifei
javascript js
在项目开发的时候,经常有一些输入框,控制输入的格式,而不是等输入好了再去检查格式,格式错了就报错,体验不好。 /** 数字,中文,字母,浮点数(+/-/.) 类型输入限制,只要在input标签上加上 jInput="number,chinese,alphabet,floating" 备注:floating属性只能单独用*/
funct
java 计时器应用
tangqi609567707
javatimer
mport java.util.TimerTask; import java.util.Calendar; public class MyTask extends TimerTask { private static final int
erlang输出调用栈信息
wudixiaotie
erlang
在erlang otp的开发中,如果调用第三方的应用,会有有些错误会不打印栈信息,因为有可能第三方应用会catch然后输出自己的错误信息,所以对排查bug有很大的阻碍,这样就要求我们自己打印调用的栈信息。用这个函数:erlang:process_display (self (), backtrace).需要注意这个函数只会输出到标准错误输出。
也可以用这个函数:erlang:get_s