- IOS面试题object-c 71-80
️ 邪神
IOS面试题ios面试题objective-c
71.简单介绍下NSURLConnection类及+sendSynchronousRequest:returningResponse:error:与–initWithRequest:delegate:两个方法的区别?NSURLConnection主要用于网络访问,其中+sendSynchronousRequest:returningResponse:error:是同步访问数据,即当前线程会阻塞,并
- Java 文件断点下载
super.aladdin
javajava开发语言
互联网的连接速度慢且不稳定,有可能由于网络故障导致断开连接。在客户端下载一个大对象时,因网络断开导致上传下载失败的概率就会变得不可忽视。客户端在GET对象请求时通过设置Range头部来告诉接口服务需要从什么位置开始输出对象的数据。判断是否支持断点下载,根据文档:14.35.1ByteRangeshttps://www.w3.org/Protocols/rfc2616/rfc2616-sec14.h
- TCP/HTTP/Socket
__Gavin__
HTTP和Scoket通信的区别。http是客户端用http协议进行请求,发送请求时候需要封装http请求头,并绑定请求的数据,服务器一般有web服务器配合(当然也非绝对)。http请求方式为客户端主动发起请求,服务器才能给响应,一次请求完毕后则断开连接,以节省资源。服务器不能主动给客户端响应(除非采取http长连接技术)。iphone主要使用类是NSUrlConnection。scoket是客户
- Android Okhttp断点续传
消失的旧时光-1943
okhttp
什么是断点续传指的是在上传/下载时,将任务(一个文件或压缩包)人为的划分为几个部分,每一个部分采用一个线程进行上传/下载,如果碰到网络故障,可以从已经上传/下载的部分开始继续上传/下载未完成的部分,而没有必要从头开始上传/下载。可以节省时间,提高速度。OkHttp断点下载断点下载思路step1:判断检查本地是否有下载文件,若存在,则获取已下载的文件大小downloadLength,若不存在,那么本
- ios中URLConnection和URLSession的区别
MiniCoder
URLSessionNSURLSession是iOS7中新的网络接口,与NSURLConnection是并列的.当程序在前台时,NSURLSession和NSURLConnection大部分可以互相替代.NSURLSession支持后台网络操作,除非用户强行关闭.NSURLSession提供的功能:1.通过URL将数据下载到内存;通过URL将数据下载到文件系统;将数据上传到指定的URL;在后台完成
- pixel6编译&kernelsu
sugar椰子皮
爬虫逆向零基础爬虫第一天python
pixel6编译&kernelsu系统编译相关前置aosp内核驱动源码下载:http://mirrors.ustc.edu.cn/help/aosp.htmlmkdir~/bincd~/binwgethttps://mirrors.ustc.edu.cn/aosp-monthly/aosp-latest.tarwget可以使用-c选项,来支持断点下载md5sumaosp-latest.tartar
- 2018-03-10 android多线程断点下载实现
紫杉叶子
笔记如下什么是多线程下载?图二多线程下载的分析.jpg首先要获得要下载文件的总大小并创建规定大小的空文件//拿到文件的大小intlength=conn.getContentLength();//getPathName(path)是得到文件名称Filefile=newFile(getPathName(path));//首先创建规定大小的空文件RandomAccessFileraf=newRandom
- 深入理解文件上传下载的原理及实现逻辑
Lion Long
图床项目服务器数据库FastDFS后端linuxhttphttps
文件上传下载原理及实现一、文件上传原理1.1、http请求格式1.2、服务器解析二、文件上传类型2.1、秒传2.2、分片上传2.3、大文件上传2.4、断点续传三、断点下载原理四、多线程下载逻辑总结一、文件上传原理1.1、http请求格式文件上传的是根据http协议的规范和定义,完成请求消息体的封装和消息体的解析,然后将二进制内容保存到文件。在上传一个文件时,需要把form标签的enctype设置为
- 大文件断点下载Range下载zip包显示文件损坏
Buiiil
前端
问题:大文件下载,其它格式的文件及rar格式的压缩包正常下载但是之后zip包下载后解压失败原因分析:1.查看上传文件的属性值如图,10.4kb是已经约去小数点的值,准确的大小应该是10663字节=10.4130859375KB,所以用10.4或者10.41都是不准确的后端返回的文件大小不够准确解决办法:1)不约去小数点2)fileSize向上取整3)前端可以在后端返回的fileSize上多加102
- iOS网络请求策略——NSURLSession的基本使用
听海听心
今天和大家一起来学习一下NSURLSession的基本使用,有疏忽的地方,还望各位不吝赐教。一、NSURLSession的基本使用/*关于NSURLSession的介绍在《iOS网络请求策略——NSURLConnection的基本使用》中已经写过了,在此就略过了,直接上诚意。*使用步骤*1、使用NSURLSession对象创建Task然后执行Task*Task的类型*NSURLSessionTas
- AFNetworking 学习笔记
祥子_HelloWorld
AFNetwork是一个轻量级的网络请求api类库。是以NSURLConnection,NSOperation和其他方法为基础的。Github:https://github.com/AFNetworking/AFNetworking/下面这个例子是用来处理json请求的:NSURL*url=[NSURLURLWithString:@"https://alpha-api.app.net/stream
- Spring Boot 大文件上传(断点上传)、服务端分片下载、客户端分片下载(断点下载)
响彻天堂丶
案例javaservlet前端
1大文件上传(支持断点续传)1.1前端upload#upload-container{width:500px;height:500px;background:lightskyblue;padding-bottom:10px;}文件拖拽上传点击上传$('#upload-container').click(function(event){$("#picker").find('input').click
- SpringBoot+Vue 实现大文件断点下载
康世行
后端springbootvue.jsjava
目录效果代码SpringBootVue效果步骤点击下载在输入框输入下载的文件名称点击暂停再次点击开始下载完成代码SpringBootpomorg.apache.httpcomponentshttpcoreorg.apache.httpcomponentshttpclientorg.springframework.bootspring-boot-starter-webcommons-iocommon
- 关于AFNetwork的应用----知识储备
买俩西瓜的程序员
知识储备1.1AFNetworking是一个轻量级的iOS网络通信类库1.2AFNetworing基于NSOperation和NSURLConnection等类库的基础上,让很多网络通信的功能变得更简单1.2.1NSURLConnection用于处理网络连接1.2.2NSOperation是管理NSURLConnection的,可以监视一个网络请求的生命周期.1.3AFNetworking支持HT
- iOS-AFN3.0与2.0区别
路飞_Luck
序言AFNetworking是一款在OSX和iOS下都令人喜爱的网络库。为了迎合iOS新版本的升级,AFNetworking在3.0版本中删除了基于NSURLConnectionAPI的所有支持。如果你的项目以前使用过这些API,建议您立即升级到基于NSURLSession的API的AFNetworking的版本。一发展历程AFNetworking1.0建立在NSURLConnection的基础A
- 2020-09-29 TOOLs:高通量测序数据下载之aspera和SRA Toolkit
__一蓑烟雨__
来源:https://www.jianshu.com/p/da75f0753178高通量数据库的数据,下载方法有三种:常规下载(wget,迅雷、IDM)asperaSRAToolkit的prefetchwget下载数据速度很慢,比较容易断。wget-c下载地址保持断点下载下载数据库优先选择快速下载fq格式的数据,EBI数据库下载。从EBI数据库直接获取到aspera的下载代码,复制到本地服务器,可
- SDWebImage访问HTTPS站点获取图片资源失败解决办法
Nadeal
iOS
在使用SDWebImage第三方库是,访问http站点的图片不成问题,但当访问https站点时,会遇到一个提示:error:NSURLConnection/CFURLConnectionHTTPloadfailed(kCFStreamErrorDomainSSL,-9813)遇到这个提示时,首先说说怎么解决这个问题。在SDWebImageDownloaderOperation.m文件中增加以下方法
- 通过NSURLProtocol来做UIWebView的cache
认真的人最可爱
iOS技术研发
最近的工作与UIWebView太相关了,索性把这方面的技术都写到博客里来;我提供的这个版本的NSURLProtocol是基于NSURLSession类来做的(NSURLConnection类在9.0之后就会被遗弃)。支持的功能:1、缓存URL的请求数据;2、支持缓存的过期处理;3、支持配置过滤URL,注意,NSURLProtocol这个类一旦被注册,就是属于APP级别的协议类,他会监听所有的htt
- java大视频在线预览(支持断点下载)
kenick
javajava开发语言
1.说明大视频的在线预览,如果不支持断点下载,将无法在苹果手机上播放,同时不支持进度条拖动.之所以这样,是因为视频文件太大了,通过二进制流向浏览器传输时,整个文件尚未传输完成时,会被浏览器强制关闭流,不再接收,等缓存播放到一定程度时,浏览器会再次向后端请求视频文件,同时附带range参数,指定获取数据范围,后端需支持对range参数的处理.2.代码@ResponseBody@GetMapping(
- python 断点续传
不侠居
python爬虫python开发语言后端爬虫
python断点续传1.前序2.技术原理2.1Content-Range2.2Range3.代码实现1.前序当下载突然断开后,断点续传就需要了,继续前面下载的内容下载。解决了不需要重复下载2.技术原理HTTP/1.1开始支持断点续传,一般断点下载会用到Range和Content-Range实体头Range是请求头,Content-Range是响应头2.1Content-Range用于响应头中语法:
- 文件上传下载
骆驼整理说
系统架构设计java后端
目录文件断点上传文件断点下载SpringBoot实现excel导入导出文件断点上传文件上传可以直接把文件转化为字节流上传到服务器,但在文件比较大的情况下,消耗时间较长,当文件上传到一半中断后,继续上传却只能重头开始上传,如何解决这个问题呢。分片上传,就是将所要上传的文件,按照一定的大小,将整个文件分隔成多个数据块(我们称之为Part)来进行分别上传,上传完之后再由服务端对所有上传的文
- iOS-NSURLConnection与NSURLSession
lalu
NSURLSessionNSURLConnection
变化和NSURLConnection一样,NSURLSession指的也不仅是同名类NSURLSession,还包括一系列相互关联的类。NSURLSession包括了与之前相同的组件,NSURLRequest与NSURLCache,但是把NSURLConnection替换成了NSURLSession、NSURLSessionConfiguration以及NSURLSessionTask的3个子类:
- iOS WKWebview实现拦截js,css,html以及图片资源替换为本地资源的两种方式(NSUrlProtocol)
夏日冰霜
NSURLProtocol简介NSURLProtocol是URLLoadingSystem的重要组成部分。它是一个抽象类。可以拦截网络请求。可以拦截的网络请求包括NSURLSession,NSURLConnection以及UIWebvIew。现也支持WKWebview框架,本文就是采用WKWebview。方式拦截做替换的方式有两种重定向到本地资源,利用canonicalRequestForRequ
- GitHub 上排名前 100 的 IOS 开源库简介
孙卓卓
项目名称项目信息AFNetworking作者是NSHipster的博主,iOS开发界的大神级人物,毕业于卡内基·梅隆大学,开源了许多牛逼的项目,这个便是其中之一,AFNetworking采用NSURLConnection+NSOperation,主要方便与服务端API进行数据交换,操作简单,功能强大,现在许多人都用它取代ASIHTTPRequestGPUImage一款强大的图片滤镜工具,支持自定义
- ##什么af2.0有常驻的子线程,3.0为什么没有(AFNetworking3.0后为什么不再需要常驻线程?)
Adam_潜
https://www.jianshu.com/p/b5c27669e2c1NSURLConnection的一大痛点就是:发起请求后,这条线程并不能随风而去,而需要一直处于等待回调的状态。苹果也是明白了这一痛点,从iOS9.0开始deprecated了NSURLConnection。替代方案就是NSURLSession。当然NSURLSession还解决了很多其他的问题,这里不作赘述。NSURLS
- iOS9适配http,微信、qq、支付宝添加白名单
遇见更好的自己_Steve
iOS9适配支付宝白名单微信白名单qq白名单支付宝跳转
:一、网络适配由http改成https苹果官方对AppTransportSecurityTechnote的解释如下:翻译成中文的意思就是说:iOS9.0SDK在编译的时候,默认所有从NSURLConnection、CFURL和NSURLSession发出的http请求,都改为https请求。由于AFNetworking版本底层是用了NSURLConnection,所以使用AFNetworking的
- iOS-NSURLConnection与NSURLSession区别
FlyElephant
2013年苹果全球开发者大会上(WWDC2013)发布的iOS7系统中推出的NSURLSession,是对NSURLConnection替代者。从iOS9开始,NSURLConnection中发送请求的两个方法已经过期(同步请求,异步请求),初始化网络连接的方法也被设置为过期,系统不再推荐使用,建议使用NSURLSession发送网络请求。-(nullableinstancetype)initWi
- iOS - AFNetworking 网络请求
自我修炼的小石头
前言在iOS开发中,一般情况下,简单的向某个Web站点简单的页面提交请求并获取服务器的响应,用Xcode自带的NSURLConnection是能胜任的。但是,在绝大部分下我们所需要访问的Web页面则是属于那种受到权限保护的页面,并不是有一个简单的URL可以访问的。这就涉及到了Session和Cookie的处理了,在此时使用NSURLConnection也是能够达到要求的,只是其中处理起来的复杂度和
- [iOS]-网络请求总结
&Carry
ios网络网络请求
目录:参考的博客:最原始的网络下载---`NSData+NSURL`方式NSURLConnection和NSURLSessionGET请求下载完成的事件采用block形式下载完成的事件采用delegate形式POST请求GET和POST操作的区别使用情况使用POST方法使用GET方法HTTP与HTTPSNSURLSessionConfiguration创建方式文件下载断点续传NSURLSessio
- iOS AFNetworking 取消网络请求
忆江南的博客
IOS开发学习点滴AFNetworking
AFNetworking是我们常用的轻量级网络请求,文章的前提是你已经对AFNetworking有了基本的掌握。不太了解的,请链接iOS使用AFNetworking。一:唠唠叨叨。AFNetworking是建立在NSURLConnection和NSOperation等类库的基础之上的,取消的网络的请求的操作也就变得很简单。但AFNetworking又没有直接的给出我们取消的方式,这就需要我们添加。
- ztree设置禁用节点
3213213333332132
JavaScriptztreejsonsetDisabledNodeAjax
ztree设置禁用节点的时候注意,当使用ajax后台请求数据,必须要设置为同步获取数据,否者会获取不到节点对象,导致设置禁用没有效果。
$(function(){
showTree();
setDisabledNode();
});
- JVM patch by Taobao
bookjovi
javaHotSpot
在网上无意中看到淘宝提交的hotspot patch,共四个,有意思,记录一下。
7050685:jsdbproc64.sh has a typo in the package name
7058036:FieldsAllocationStyle=2 does not work in 32-bit VM
7060619:C1 should respect inline and
- 将session存储到数据库中
dcj3sjt126com
sqlPHPsession
CREATE TABLE sessions (
id CHAR(32) NOT NULL,
data TEXT,
last_accessed TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
<?php
/**
* Created by PhpStorm.
* User: michaeldu
* Date
- Vector
171815164
vector
public Vector<CartProduct> delCart(Vector<CartProduct> cart, String id) {
for (int i = 0; i < cart.size(); i++) {
if (cart.get(i).getId().equals(id)) {
cart.remove(i);
- 各连接池配置参数比较
g21121
连接池
排版真心费劲,大家凑合看下吧,见谅~
Druid
DBCP
C3P0
Proxool
数据库用户名称 Username Username User
数据库密码 Password Password Password
驱动名
- [简单]mybatis insert语句添加动态字段
53873039oycg
mybatis
mysql数据库,id自增,配置如下:
<insert id="saveTestTb" useGeneratedKeys="true" keyProperty="id"
parameterType=&
- struts2拦截器配置
云端月影
struts2拦截器
struts2拦截器interceptor的三种配置方法
方法1. 普通配置法
<struts>
<package name="struts2" extends="struts-default">
&
- IE中页面不居中,火狐谷歌等正常
aijuans
IE中页面不居中
问题是首页在火狐、谷歌、所有IE中正常显示,列表页的页面在火狐谷歌中正常,在IE6、7、8中都不中,觉得可能那个地方设置的让IE系列都不认识,仔细查看后发现,列表页中没写HTML模板部分没有添加DTD定义,就是<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3
- String,int,Integer,char 几个类型常见转换
antonyup_2006
htmlsql.net
如何将字串 String 转换成整数 int?
int i = Integer.valueOf(my_str).intValue();
int i=Integer.parseInt(str);
如何将字串 String 转换成Integer ?
Integer integer=Integer.valueOf(str);
如何将整数 int 转换成字串 String ?
1.
- PL/SQL的游标类型
百合不是茶
显示游标(静态游标)隐式游标游标的更新和删除%rowtyperef游标(动态游标)
游标是oracle中的一个结果集,用于存放查询的结果;
PL/SQL中游标的声明;
1,声明游标
2,打开游标(默认是关闭的);
3,提取数据
4,关闭游标
注意的要点:游标必须声明在declare中,使用open打开游标,fetch取游标中的数据,close关闭游标
隐式游标:主要是对DML数据的操作隐
- JUnit4中@AfterClass @BeforeClass @after @before的区别对比
bijian1013
JUnit4单元测试
一.基础知识
JUnit4使用Java5中的注解(annotation),以下是JUnit4常用的几个annotation: @Before:初始化方法 对于每一个测试方法都要执行一次(注意与BeforeClass区别,后者是对于所有方法执行一次)@After:释放资源 对于每一个测试方法都要执行一次(注意与AfterClass区别,后者是对于所有方法执行一次
- 精通Oracle10编程SQL(12)开发包
bijian1013
oracle数据库plsql
/*
*开发包
*包用于逻辑组合相关的PL/SQL类型(例如TABLE类型和RECORD类型)、PL/SQL项(例如游标和游标变量)和PL/SQL子程序(例如过程和函数)
*/
--包用于逻辑组合相关的PL/SQL类型、项和子程序,它由包规范和包体两部分组成
--建立包规范:包规范实际是包与应用程序之间的接口,它用于定义包的公用组件,包括常量、变量、游标、过程和函数等
--在包规
- 【EhCache二】ehcache.xml配置详解
bit1129
ehcache.xml
在ehcache官网上找了多次,终于找到ehcache.xml配置元素和属性的含义说明文档了,这个文档包含在ehcache.xml的注释中!
ehcache.xml : http://ehcache.org/ehcache.xml
ehcache.xsd : http://ehcache.org/ehcache.xsd
ehcache配置文件的根元素是ehcahe
ehcac
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL
白糖_
javaeclipsespringtomcatWeb
今天学习spring+cxf的时候遇到一个问题:在web.xml中配置了spring的上下文监听器:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
随后启动
- angular.element
boyitech
AngularJSAngularJS APIangular.element
angular.element
描述: 包裹着一部分DOM element或者是HTML字符串,把它作为一个jQuery元素来处理。(类似于jQuery的选择器啦) 如果jQuery被引入了,则angular.element就可以看作是jQuery选择器,选择的对象可以使用jQuery的函数;如果jQuery不可用,angular.e
- java-给定两个已排序序列,找出共同的元素。
bylijinnan
java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CommonItemInTwoSortedArray {
/**
* 题目:给定两个已排序序列,找出共同的元素。
* 1.定义两个指针分别指向序列的开始。
* 如果指向的两个元素
- sftp 异常,有遇到的吗?求解
Chen.H
javajcraftauthjschjschexception
com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:460)
at com.jcraft.jsch.Session.connect(Session.java:154)
at cn.vivame.util.ftp.SftpServerAccess.connec
- [生物智能与人工智能]神经元中的电化学结构代表什么?
comsci
人工智能
我这里做一个大胆的猜想,生物神经网络中的神经元中包含着一些化学和类似电路的结构,这些结构通常用来扮演类似我们在拓扑分析系统中的节点嵌入方程一样,使得我们的神经网络产生智能判断的能力,而这些嵌入到节点中的方程同时也扮演着"经验"的角色....
我们可以尝试一下...在某些神经
- 通过LAC和CID获取经纬度信息
dai_lm
laccid
方法1:
用浏览器打开http://www.minigps.net/cellsearch.html,然后输入lac和cid信息(mcc和mnc可以填0),如果数据正确就可以获得相应的经纬度
方法2:
发送HTTP请求到http://www.open-electronics.org/celltrack/cell.php?hex=0&lac=<lac>&cid=&
- JAVA的困难分析
datamachine
java
前段时间转了一篇SQL的文章(http://datamachine.iteye.com/blog/1971896),文章不复杂,但思想深刻,就顺便思考了一下java的不足,当砖头丢出来,希望引点和田玉。
-----------------------------------------------------------------------------------------
- 小学5年级英语单词背诵第二课
dcj3sjt126com
englishword
money 钱
paper 纸
speak 讲,说
tell 告诉
remember 记得,想起
knock 敲,击,打
question 问题
number 数字,号码
learn 学会,学习
street 街道
carry 搬运,携带
send 发送,邮寄,发射
must 必须
light 灯,光线,轻的
front
- linux下面没有tree命令
dcj3sjt126com
linux
centos p安装
yum -y install tree
mac os安装
brew install tree
首先来看tree的用法
tree 中文解释:tree
功能说明:以树状图列出目录的内容。
语 法:tree [-aACdDfFgilnNpqstux][-I <范本样式>][-P <范本样式
- Map迭代方式,Map迭代,Map循环
蕃薯耀
Map循环Map迭代Map迭代方式
Map迭代方式,Map迭代,Map循环
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
蕃薯耀 2015年
- Spring Cache注解+Redis
hanqunfeng
spring
Spring3.1 Cache注解
依赖jar包:
<!-- redis -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
- Guava中针对集合的 filter和过滤功能
jackyrong
filter
在guava库中,自带了过滤器(filter)的功能,可以用来对collection 进行过滤,先看例子:
@Test
public void whenFilterWithIterables_thenFiltered() {
List<String> names = Lists.newArrayList("John"
- 学习编程那点事
lampcy
编程androidPHPhtml5
一年前的夏天,我还在纠结要不要改行,要不要去学php?能学到真本事吗?改行能成功吗?太多的问题,我终于不顾一切,下定决心,辞去了工作,来到传说中的帝都。老师给的乘车方式还算有效,很顺利的就到了学校,赶巧了,正好学校搬到了新校区。先安顿了下来,过了个轻松的周末,第一次到帝都,逛逛吧!
接下来的周一,是我噩梦的开始,学习内容对我这个零基础的人来说,除了勉强完成老师布置的作业外,我已经没有时间和精力去
- 架构师之流处理---------bytebuffer的mark,limit和flip
nannan408
ByteBuffer
1.前言。
如题,limit其实就是可以读取的字节长度的意思,flip是清空的意思,mark是标记的意思 。
2.例子.
例子代码:
String str = "helloWorld";
ByteBuffer buff = ByteBuffer.wrap(str.getBytes());
Sy
- org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1, column 1
Everyday都不同
$转义el表达式
最近在做Highcharts的过程中,在写js时,出现了以下异常:
严重: Servlet.service() for servlet jsp threw exception
org.apache.el.parser.ParseException: Encountered " ":" ": "" at line 1,
- 用Java实现发送邮件到163
tntxia
java实现
/*
在java版经常看到有人问如何用javamail发送邮件?如何接收邮件?如何访问多个文件夹等。问题零散,而历史的回复早已经淹没在问题的海洋之中。
本人之前所做过一个java项目,其中包含有WebMail功能,当初为用java实现而对javamail摸索了一段时间,总算有点收获。看到论坛中的经常有此方面的问题,因此把我的一些经验帖出来,希望对大家有些帮助。
此篇仅介绍用
- 探索实体类存在的真正意义
java小叶檀
POJO
一. 实体类简述
实体类其实就是俗称的POJO,这种类一般不实现特殊框架下的接口,在程序中仅作为数据容器用来持久化存储数据用的
POJO(Plain Old Java Objects)简单的Java对象
它的一般格式就是
public class A{
private String id;
public Str