- iOS基础(17)之:iOS面试题
godgnay
2019iOS面试题大全:https://www.jianshu.com/p/69d719568ae2掘金iOS搜索:https://juejin.im/search?query=iOS&type=all2018年iOS面试心得:https://juejin.im/post/5b4cd5aae51d455b5d3efa2c2018年iOS面试珠玑:https://juejin.im/post/5b
- 面试珠玑 在unix文件系统中,inode节点包括哪些内容?
skdkjzz
面试珠玑
不同文件系统的inode内容不太一样,但通常都含有以下信息:structinode{inti_mode;文件类型(目录、块设备、字符设备、普通文件、权限等)chari_nlink;文件硬链接数chari_uid;属主ID(UID)chari_gid;属主组ID(GID)chari_size0;文件大小char*i_size1;文件所使用的磁盘块的实际数目inti_addr[8];块地址数组inti
- 百度最新面试题集锦
面试题
百度最新面试题集锦 分类:
面试珠玑 2012-03-13 15:10 17272人阅读
评论(67)
收藏
举报
1、实现一个函数,对一个正整数n,算得到1需要的最少操作次数。操作规则为:如果n为偶数,将其除以2;如果n为奇数,可以加1或减1;一直处理下去。
例子:func(7) = 4,可以证明最少需要4次运算n =
- 二分搜索及其扩展(循环递增数组的搜索)
数组
转自:
http://blog.csdn.net/hackbuteer1/article/details/7581596
二分搜索及其扩展(循环递增数组的搜索) 分类:
面试珠玑 2012-05-18 21:40 1076人阅读
评论(6)
收藏
举报 二分搜索需要注意开闭区间的问题,限制条件和边界要保持配对
- 百度最新面试题集锦
u014114990
面试珠玑
百度最新面试题集锦分类: 面试珠玑2012-03-1315:10 100697人阅读 评论(109) 收藏 举报百度面试treequerydns服务器转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/73489681、实现一个函数,对一个正整数n,算得到1需要的最少操作次数。操作规则为:如果n为偶数,将其除以2;如果n为奇数
- 卡特兰数
u014774781
数学面试珠玑
Catalan数——卡特兰数分类: 面试珠玑2012-04-1116:40 13821人阅读 评论(14) 收藏 举报c工作Catalan数——卡特兰数 今天阿里淘宝笔试中碰到两道组合数学题,感觉非常亲切,但是笔试中失踪推导不出来后来查了下,原来是Catalan数。悲剧啊,现在整理一下一、Catalan数的定义令h(1)=1,Catalan数满足递归式:h(n)=h(1)*h(n-1)+h(2)
- C++中的static关键字
a2796749
面试珠玑
C++中的static关键字分类:面试珠玑2012-04-2222:0621550人阅读评论(25)收藏举报c++存储cC++的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static。前者应用于普通变量和函数,不涉及类;后者主要说明static在类中的作用。一、面向过程设计中的static1、静态全局变量在全局变量前,加上关键字static,该变量就被定义成为一
- 面试珠玑 tasklet和工作队列 区别
skdkjxy
tasklet tasklet vs 内核定时器 相同:始终在中断期间运行,始终会在调度他们的同一CPU上运行,而且都接收一个unsignedlong参数不同:不可以要求tasklet在某一给定的时间执行tasklet对中断处理例程来说尤其有用。中断处理例程必须尽可能快的管理硬件中断,而大部分数据管理则可以安全的延迟到其后的时间。实际上,与内核定时器类似,tasklet也会在“软件中断”上下文以原
- 面试珠玑 淘宝2011.9.23校园招聘会面试题
skdkjxy
1、操作系统中的同步和异步有什么区别?分别应用在什么场合?答:同步,就是说你的程序在执行某一个操作时一直等待直到操作完成。 最常见的例子就是SendMessage。该函数发送一个消息给某个窗口,在对方处理完消息之前,这个函数不返回。当对方处理完毕以后,该函数才把消息处理函数所返回的LRESULT值返回给调用者。异步,就是说程序在执行某一个操作时,只是发出开始的指令;由另外的并行程序执行这段代码
- 面试珠玑 C/C++笔试题目大全
skdkjxy
1、以下程序的运行结果是()[cpp] viewplaincopyint main(void) { printf("%s , %5.3s\n","computer","computer"); return 0; } A、computer,puter B、computer,comC、computer,computer
- 面试珠玑 微软面试题小汇
skdkjxy
1、有一个整数数组,请求出两两之差绝对值最小的值,记住,只要得出最小值即可,不需要求出是哪两个数。1usingSystem;2usingSystem.Linq;3usingSystem.Collections.Generic;4namespaceConsoleApplication15{6classProgram7{8staticRandomRand=newRandom();910staticvo
- 面试珠玑 C++中的static关键字
skdkjxy
C++的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static。前者应用于普通变量和函数,不涉及类;后者主要说明static在类中的作用。一、面向过程设计中的static1、静态全局变量在全局变量前,加上关键字static,该变量就被定义成为一个静态全局变量。我们先举一个静态全局变量的例子,如下:[cpp] viewplaincopy#include usin
- 面试珠玑 快速排序、希尔排序、插入排序、选择排序、归并排序、堆排序总结
skdkjxy
一、快速排序的基本思想 设当前待排序的无序区为R[low..high],利用分治法可将快速排序的基本思想描述为:①分解: 在R[low..high]中任选一个记录作为基准(Pivot),以此基准将当前无序区划分为左、右两个较小的子区间R[low..pivotpos-1)和R[pivotpos+1..high],并使左边子区间中所有记录的关键字均小于等于基准记录(不妨记为pivot)的关键
- 面试珠玑 各大IT公司校园招聘程序猿笔试、面试题集锦
skdkjxy
百度一面1、给定一个字符串比如“abcdef”,要求写个函数编程“defabc”,位数是可变的。这个比较简单,我用的是strcpy和memcpy,然后他问有什么优化的办法,我就不知道了。2、socket过程就是socket的server和client整个流程写下来,这个还是没啥问题的。3、数据结构二叉树的遍历,给了个二叉树,前序、中序、后序写出来,这个没什么难度。http://blog.csdn.
- 面试珠玑 遍历二叉树的各种操作(非递归遍历)
skdkjxy
先使用先序的方法建立一棵二叉树,然后分别使用递归与非递归的方法实现前序、中序、后序遍历二叉树,并使用了两种方法来进行层次遍历二叉树,一种方法就是使用STL中的queue,另外一种方法就是定义了一个数组队列,分别使用了front和rear两个数组的下标来表示入队与出队,还有两个操作就是求二叉树的深度、结点数。。。[cpp] viewplaincopy#include #include #
- [面试珠玑]一道关于C++虚函数和多继承的面试题
SunnyYoona
面试题多重继承
问题:假设有两个基类A和B,它们有一个相同签名的虚函数voidfoo(),但是拥有不同的实现。现在要求创建一个新类C,它同时继承A和B,也有相同的签名的函数voidfoo(),并能分别对A和B中的foo函数进行重写(overwrite)。 已知条件对应的代码如下:classA{
public:
virtualvoidfoo(){
coutfoo();//这里会输出和A相关的信息
pB->fo
- [面试珠玑]C++空类中的默认函数
SunnyYoona
C++面试题空类
参加面试的时候,面试官问到这个问题,我的回答:默认构造函数、默认析构函数、默认拷贝构造函数、默认赋值函数。现在回想起来感觉不对,就google,揭示一下这个看似简单的问题:一个空的class在C++编译器处理过后就不再为空,编译器会自动地为我们声明一些memberfunction,如果你写 classA{}; 编译器处理后,就相当于: classA
{
public:
A();//默认构造函数
A
- [面试珠玑]如何学好c++
SunnyYoona
C++面试
下面是转载的在博客上看到的一个C++书籍阅读清单,可以参考下:阶段1《EssentialC++》这是一本内容不多但很实用的C++入门书籍,强调快速上手与理解C++编程。本书主要围绕一系列逐渐复杂的程序问题,以及用以解决这些问题的语言特性展开讲解。你不只学到C++的函数和结构,也会学习到它们的设计目的和基本原理。《C++Primer》本书对C++基本概念、技术、以及现代C++编程风格进行了全面而且权
- 网易游戏2011.10.15校园招聘会笔试题
pi9nc
面试珠玑
网易游戏2011.10.15校园招聘会笔试题分类: 面试珠玑2011-10-1620:39 11719人阅读 评论(49) 收藏 举报游戏网易招聘freebsdcwindows1、对于一个内存地址是32位、内存页是8KB的系统。0X0005F123这个地址的页号与页内偏移分别是多少。页面大小是8KB,那么页内偏移量是从0x0000(0)~0x1FFF(2的13次方-1)。0x5F123/8K=2
- 有趣的面试智力题
pi9nc
【面试珠玑】
【面试】有趣的面试智力题分类: 【面试珠玑】2013-04-1318:42 88人阅读 评论(0) 收藏 举报目录(?)[+]1.扑克牌问题问题:一付54张扑克牌,其中有十张是翻过来的。现在把你的眼睛蒙上(绝对没有偷看的可能),让你把扑克牌分成两叠(两叠的多少可以不一样)。要求在两叠中翻过来的扑克牌是相等的。请问该怎么做?除了扑克牌的数目,其它因数(扑克牌大小,重量,颜色,表面触摸的感觉,等等)不
- 字符串的全排列和组合算法
jfkidear
面试珠玑
分类: 面试珠玑2012-04-1511:24 5746人阅读 评论(8) 收藏 举报算法permutationstringiterator面试vector全排列在笔试面试中很热门,因为它难度适中,既可以考察递归实现,又能进一步考察非递归的实现,便于区分出考生的水平。所以在百度和迅雷的校园招聘以及程序员和软件设计师的考试中都考到了,因此本文对全排列作下总结帮助大家更好的学习和理解。对本文有任何补充
- Java常用排序算法/程序员必须掌握的8大排序算法
cugfy
java
分类:
1)插入排序(直接插入排序、希尔排序)
2)交换排序(冒泡排序、快速排序)
3)选择排序(直接选择排序、堆排序)
4)归并排序
5)分配排序(基数排序)
所需辅助空间最多:归并排序
所需辅助空间最少:堆排序
平均速度最快:快速排序
不稳定:快速排序,希尔排序,堆排序。
先来看看8种排序之间的关系:
1.直接插入排序
(1
- 【Spark102】Spark存储模块BlockManager剖析
bit1129
manager
Spark围绕着BlockManager构建了存储模块,包括RDD,Shuffle,Broadcast的存储都使用了BlockManager。而BlockManager在实现上是一个针对每个应用的Master/Executor结构,即Driver上BlockManager充当了Master角色,而各个Slave上(具体到应用范围,就是Executor)的BlockManager充当了Slave角色
- linux 查看端口被占用情况详解
daizj
linux端口占用netstatlsof
经常在启动一个程序会碰到端口被占用,这里讲一下怎么查看端口是否被占用,及哪个程序占用,怎么Kill掉已占用端口的程序
1、lsof -i:port
port为端口号
[root@slave /data/spark-1.4.0-bin-cdh4]# lsof -i:8080
COMMAND PID USER FD TY
- Hosts文件使用
周凡杨
hostslocahost
一切都要从localhost说起,经常在tomcat容器起动后,访问页面时输入http://localhost:8088/index.jsp,大家都知道localhost代表本机地址,如果本机IP是10.10.134.21,那就相当于http://10.10.134.21:8088/index.jsp,有时候也会看到http: 127.0.0.1:
- java excel工具
g21121
Java excel
直接上代码,一看就懂,利用的是jxl:
import java.io.File;
import java.io.IOException;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.write.Label;
import
- web报表工具finereport常用函数的用法总结(数组函数)
老A不折腾
finereportweb报表函数总结
ADD2ARRAY
ADDARRAY(array,insertArray, start):在数组第start个位置插入insertArray中的所有元素,再返回该数组。
示例:
ADDARRAY([3,4, 1, 5, 7], [23, 43, 22], 3)返回[3, 4, 23, 43, 22, 1, 5, 7].
ADDARRAY([3,4, 1, 5, 7], "测试&q
- 游戏服务器网络带宽负载计算
墙头上一根草
服务器
家庭所安装的4M,8M宽带。其中M是指,Mbits/S
其中要提前说明的是:
8bits = 1Byte
即8位等于1字节。我们硬盘大小50G。意思是50*1024M字节,约为 50000多字节。但是网宽是以“位”为单位的,所以,8Mbits就是1M字节。是容积体积的单位。
8Mbits/s后面的S是秒。8Mbits/s意思是 每秒8M位,即每秒1M字节。
我是在计算我们网络流量时想到的
- 我的spring学习笔记2-IoC(反向控制 依赖注入)
aijuans
Spring 3 系列
IoC(反向控制 依赖注入)这是Spring提出来了,这也是Spring一大特色。这里我不用多说,我们看Spring教程就可以了解。当然我们不用Spring也可以用IoC,下面我将介绍不用Spring的IoC。
IoC不是框架,她是java的技术,如今大多数轻量级的容器都会用到IoC技术。这里我就用一个例子来说明:
如:程序中有 Mysql.calss 、Oracle.class 、SqlSe
- 高性能mysql 之 选择存储引擎(一)
annan211
mysqlInnoDBMySQL引擎存储引擎
1 没有特殊情况,应尽可能使用InnoDB存储引擎。 原因:InnoDB 和 MYIsAM 是mysql 最常用、使用最普遍的存储引擎。其中InnoDB是最重要、最广泛的存储引擎。她 被设计用来处理大量的短期事务。短期事务大部分情况下是正常提交的,很少有回滚的情况。InnoDB的性能和自动崩溃 恢复特性使得她在非事务型存储的需求中也非常流行,除非有非常
- UDP网络编程
百合不是茶
UDP编程局域网组播
UDP是基于无连接的,不可靠的传输 与TCP/IP相反
UDP实现私聊,发送方式客户端,接受方式服务器
package netUDP_sc;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.Ine
- JQuery对象的val()方法执行结果分析
bijian1013
JavaScriptjsjquery
JavaScript中,如果id对应的标签不存在(同理JAVA中,如果对象不存在),则调用它的方法会报错或抛异常。在实际开发中,发现JQuery在id对应的标签不存在时,调其val()方法不会报错,结果是undefined。
- http请求测试实例(采用json-lib解析)
bijian1013
jsonhttp
由于fastjson只支持JDK1.5版本,因些对于JDK1.4的项目,可以采用json-lib来解析JSON数据。如下是http请求的另外一种写法,仅供参考。
package com;
import java.util.HashMap;
import java.util.Map;
import
- 【RPC框架Hessian四】Hessian与Spring集成
bit1129
hessian
在【RPC框架Hessian二】Hessian 对象序列化和反序列化一文中介绍了基于Hessian的RPC服务的实现步骤,在那里使用Hessian提供的API完成基于Hessian的RPC服务开发和客户端调用,本文使用Spring对Hessian的集成来实现Hessian的RPC调用。
定义模型、接口和服务器端代码
|---Model
&nb
- 【Mahout三】基于Mahout CBayes算法的20newsgroup流程分析
bit1129
Mahout
1.Mahout环境搭建
1.下载Mahout
http://mirror.bit.edu.cn/apache/mahout/0.10.0/mahout-distribution-0.10.0.tar.gz
2.解压Mahout
3. 配置环境变量
vim /etc/profile
export HADOOP_HOME=/home
- nginx负载tomcat遇非80时的转发问题
ronin47
nginx负载后端容器是tomcat(其它容器如WAS,JBOSS暂没发现这个问题)非80端口,遇到跳转异常问题。解决的思路是:$host:port
详细如下:
该问题是最先发现的,由于之前对nginx不是特别的熟悉所以该问题是个入门级别的:
? 1 2 3 4 5
- java-17-在一个字符串中找到第一个只出现一次的字符
bylijinnan
java
public class FirstShowOnlyOnceElement {
/**Q17.在一个字符串中找到第一个只出现一次的字符。如输入abaccdeff,则输出b
* 1.int[] count:count[i]表示i对应字符出现的次数
* 2.将26个英文字母映射:a-z <--> 0-25
* 3.假设全部字母都是小写
*/
pu
- mongoDB 复制集
开窍的石头
mongodb
mongo的复制集就像mysql的主从数据库,当你往其中的主复制集(primary)写数据的时候,副复制集(secondary)会自动同步主复制集(Primary)的数据,当主复制集挂掉以后其中的一个副复制集会自动成为主复制集。提供服务器的可用性。和防止当机问题
mo
- [宇宙与天文]宇宙时代的经济学
comsci
经济
宇宙尺度的交通工具一般都体型巨大,造价高昂。。。。。
在宇宙中进行航行,近程采用反作用力类型的发动机,需要消耗少量矿石燃料,中远程航行要采用量子或者聚变反应堆发动机,进行超空间跳跃,要消耗大量高纯度水晶体能源
以目前地球上国家的经济发展水平来讲,
- Git忽略文件
Cwind
git
有很多文件不必使用git管理。例如Eclipse或其他IDE生成的项目文件,编译生成的各种目标或临时文件等。使用git status时,会在Untracked files里面看到这些文件列表,在一次需要添加的文件比较多时(使用git add . / git add -u),会把这些所有的未跟踪文件添加进索引。
==== ==== ==== 一些牢骚
- MySQL连接数据库的必须配置
dashuaifu
mysql连接数据库配置
MySQL连接数据库的必须配置
1.driverClass:com.mysql.jdbc.Driver
2.jdbcUrl:jdbc:mysql://localhost:3306/dbname
3.user:username
4.password:password
其中1是驱动名;2是url,这里的‘dbna
- 一生要养成的60个习惯
dcj3sjt126com
习惯
一生要养成的60个习惯
第1篇 让你更受大家欢迎的习惯
1 守时,不准时赴约,让别人等,会失去很多机会。
如何做到:
①该起床时就起床,
②养成任何事情都提前15分钟的习惯。
③带本可以随时阅读的书,如果早了就拿出来读读。
④有条理,生活没条理最容易耽误时间。
⑤提前计划:将重要和不重要的事情岔开。
⑥今天就准备好明天要穿的衣服。
⑦按时睡觉,这会让按时起床更容易。
2 注重
- [介绍]Yii 是什么
dcj3sjt126com
PHPyii2
Yii 是一个高性能,基于组件的 PHP 框架,用于快速开发现代 Web 应用程序。名字 Yii (读作 易)在中文里有“极致简单与不断演变”两重含义,也可看作 Yes It Is! 的缩写。
Yii 最适合做什么?
Yii 是一个通用的 Web 编程框架,即可以用于开发各种用 PHP 构建的 Web 应用。因为基于组件的框架结构和设计精巧的缓存支持,它特别适合开发大型应
- Linux SSH常用总结
eksliang
linux sshSSHD
转载请出自出处:http://eksliang.iteye.com/blog/2186931 一、连接到远程主机
格式:
ssh name@remoteserver
例如:
ssh
[email protected]
二、连接到远程主机指定的端口
格式:
ssh name@remoteserver -p 22
例如:
ssh i
- 快速上传头像到服务端工具类FaceUtil
gundumw100
android
快速迭代用
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOExceptio
- jQuery入门之怎么使用
ini
JavaScripthtmljqueryWebcss
jQuery的强大我何问起(个人主页:hovertree.com)就不用多说了,那么怎么使用jQuery呢?
首先,下载jquery。下载地址:http://hovertree.com/hvtart/bjae/b8627323101a4994.htm,一个是压缩版本,一个是未压缩版本,如果在开发测试阶段,可以使用未压缩版本,实际应用一般使用压缩版本(min)。然后就在页面上引用。
- 带filter的hbase查询优化
kane_xie
查询优化hbaseRandomRowFilter
问题描述
hbase scan数据缓慢,server端出现LeaseException。hbase写入缓慢。
问题原因
直接原因是: hbase client端每次和regionserver交互的时候,都会在服务器端生成一个Lease,Lease的有效期由参数hbase.regionserver.lease.period确定。如果hbase scan需
- java设计模式-单例模式
men4661273
java单例枚举反射IOC
单例模式1,饿汉模式
//饿汉式单例类.在类初始化时,已经自行实例化
public class Singleton1 {
//私有的默认构造函数
private Singleton1() {}
//已经自行实例化
private static final Singleton1 singl
- mongodb 查询某一天所有信息的3种方法,根据日期查询
qiaolevip
每天进步一点点学习永无止境mongodb纵观千象
// mongodb的查询真让人难以琢磨,就查询单天信息,都需要花费一番功夫才行。
// 第一种方式:
coll.aggregate([
{$project:{sendDate: {$substr: ['$sendTime', 0, 10]}, sendTime: 1, content:1}},
{$match:{sendDate: '2015-
- 二维数组转换成JSON
tangqi609567707
java二维数组json
原文出处:http://blog.csdn.net/springsen/article/details/7833596
public class Demo {
public static void main(String[] args) { String[][] blogL
- erlang supervisor
wudixiaotie
erlang
定义supervisor时,如果是监控celuesimple_one_for_one则删除children的时候就用supervisor:terminate_child (SupModuleName, ChildPid),如果shutdown策略选择的是brutal_kill,那么supervisor会调用exit(ChildPid, kill),这样的话如果Child的behavior是gen_