- iOS实现WIFI传书
善斋书社
问题业务场景上存在需要将手机里的文件、图片传递给其他的设备,不仅仅局限于传书、资料啥的都有可能传递方案最base的方法:设备之间加个云,设备上传资料到云,云同步资料到各个设备,适用于多设备之间,这个没讲的必要如果是两设备之间,忽略服务器,怎么搞?联想到图书App中的WiFi传书,貌似没云端概念的,怎么做到的?上菜采用框架GCDWebServer,通过CocoaPods引入pod"GCDWebSer
- H5在WKWebView中读取沙盒文件
幽玄727
方法一:一种通过Base64的编码来解决H5Image标签显示图片的问题,当然了这里我就不介绍了方法二:在Podfile写入(关于GCDWebServer,一个轻量级的AppServer框架。)pod"GCDWebServer","~>3.0"importGCDWebServer///启动Server参数自己定,但是directoryPath和forBasePath要定义好,我们写的是沙盒路径。f
- GCDWebServer上传页调整
赳赳赴渔洲
使用GCDWebServer第三方的Wi-Fi功能上传本地文件到APP,会在浏览器的上传页显示UploadFiles…这种英文,而我们用户大都是汉语使用者,所以需要修改这个框架的文件内容。在GCDWebUploader.bundle中,可以找到index.html文件,这个就是我们在浏览器输入本地网址显示出的页面文件框架文件结构上传书文件创建同类夹刷新1、我们可以看到我们用的三个按钮
- GCDWebServer搭建本地服务器(iOS端)
赵诗诗ScarlettZhao
工具类iosclientserver
一、下载集成GCDWebServergit地址:https://github.com/swisspol/GCDWebServer或pod'GCDWebServer','~>3.5.4'podinstall二、使用说明1.当前文章仅做了非跨域访问(客户端和服务器端在同一ip,port)2.该库不支持HTTPS和长连接3.切到后台会断掉,到后台不断的话可以设置参数,这里没做三、搭建本地服务器////V
- iOS通过本地server创建桌面快捷方式
野码道人
iOS14苹果添加本地网络权限使用苹果的bonjour技术在iOS14开始被检测,并且会弹窗访问权限弹窗,很鸡肋,即便点击拒绝也是可以正常访问本地网络的,一旦苹果检测到NSNetService相关api,就会在app的设置界面出现一个选项叫做本地网络,很难受,GCDWebServer使用套接字实现,直接访问CFNetwork层,可以跳过这个权限的检测下载链接原理GCDWebServer负责启动本地
- DLNA(三)
dandelionYD
上节DLNA(二)我们说了对于DLNA的网络的资源投屏,但是要实现本地的,还是需要其他的方式看到网上有人使用Platinum在本地搭建服务器,结果看到的是C++代码实现那我们就换种方式,使用GCDWebServer/WebDAV三方来实现(里面是OC的框架哟)下面我就贴出关键的代码:具体的实现可参考gitHubDemo里面的具体的包括实现都有具体的实现本地视频网络话:__weaktypeof(se
- 借助微信 构建 Android Project 编译通知
轻微
dim.red一背景最近萌生一个想法,在项目编译成功的时候给自己发送一条微信.效果图.png二原理我们需要跟微信进行交互,为了达到这个效果.我们在微信App内开启一个Http服务.当项目编译完成以后发起一个Http请求.Http服务响应这个请求.将获取的数据转发发送给自己.三实现1Http服务.我们在WeChatPlugin-MacOS的基础上做扩展.同时使用第三方库GCDWebServer进行快
- 如何使用IOS实现WIFI传输
问题业务场景上存在需要将手机里的文件、图片传递给其他的设备,不仅仅局限于传书、资料啥的都有可能传递方案最base的方法:设备之间加个云,设备上传资料到云,云同步资料到各个设备,适用于多设备之间,这个没讲的必要如果是两设备之间,忽略服务器,怎么搞?联想到图书App中的WiFi传书,貌似没云端概念的,怎么做到的?上菜采用框架GCDWebServer,通过CocoaPods引入pod"GCDWebSer
- CocoaPods 安装或者更新第三方库失败 报错/usr/local/bin/git
CoderWilly
Xcode
[!]ErrorinstallingGCDWebServer[!]/usr/local/bin/gitclonehttps://github.com/swisspol/GCDWebServer.git/var/folders/cs/7ct14gxn00nbwdss3qb_m1cw0000gn/T/d20200316-4781-1i826cx--template=--single-branch--d
- iOS WKWebView加载本地文件之权威解说
JackLee18
Object-CIOS
在实际的iOS开发中,我们有很多的地方需要通过WKWebView加载本地的文件。但是由于WKWebview存在着一些跨域的问题。UIWebView直接加载的方法不能正常使用了。这里就和大家分享一下常见的几种处理方法。GCDWebServer启动本地服务器加载 就是在本地启动一个本地服务器,可以使用GCDWebServer这个库,大家感兴趣的话可以看看。GCDWebServer介绍的文章(ht
- 记一次无从下手的二进制流文件解析
Raven_zwu
最近做的项目使用到了GCDWebServer,通过跟一个类似单片机的东西进行udp发送,然后它会访问我手机上的WebServer给我一个file。最开始我是这么写的,想看看单片机给我发的是什么样的数据。data为它发给我的数据str打印内容为我当时一看,就感觉不太对劲了,怎么会这样。Connectiononsocket15processingrequest"POST/znjj/home/devic
- GDCWebServer使用
毛毛_1e13
由于项目要求需要ios原生端加载沙盒docment目录中的html文件,需要App应用内架一个服务器,git中找到了GCDWebServer这个库。pod'GCDWebServer','~>3.0'pod'GCDWebServer/WebUploader','~>3.0'pod'GCDWebServer/WebDAV','~>3.0'调用如下:1.启动GCDWebServer:-(void)GCD
- 如何播放沙盒里的m3u8
HOHO521
播放沙盒里的m3u8流,大致流程为:1、在沙盒里搭建本地虚拟服务器2、下载m3u8文件到沙盒(本文采取把已下载好的流拷贝到沙盒里)3、以虚拟host+port的方式,播放m3u8流一、搭建沙盒虚拟服务器我们借助开源项目GCDWebServer,附上github链接GCDWebServer1、创建工程,导入GCDWebServerpod'GCDWebServer/WebDAV','~>3.3.3'2
- GCDWebServer / GCDWebUploader
StevenC
GCDWebServer不支持HTTPSGCDWebServer支持Basic/DigestAuthenticate如果想在GCDWebServer上添加Login功能,可行的方法是:开启DigestAuthenticate-(BOOL)startWithPort:(NSUInteger)portbonjourName:(NSString*)name{NSMutableDictionary*opt
- WKWebView 加载沙盒图片和音视频文件失败
风___________
先来段html文件(此html直接加载的真机沙盒目录下的一张图,用WKWebView加载无法显示)原因:貌似是WebKit现在的bug解决办法:本地开了一个类似Apache服务器(亲测有效)步骤如下:集成一个工具pod'GCDWebServer','~>3.0'开启一个本地服务器(只写了问题相关的代码)#import//本地服务器@interfaceAppDelegate()@property(n
- 轻量级iOS/OSX服务器GCDWebServer
寻雨的人
简述GCDWebServer是一个基于GCD的轻量级服务器框架,用于内嵌到OSX或者iOS系统的应用中提供HTTP1.1的服务。实现目标1.设计优雅,易于使用。仅仅包含4个核心类:server,connection,requestandresponse2.设计良好的API。头文件注释齐全,非常易于继承和定制个性化需求。3.事件驱动模型。基于GCD框架,实现最佳性能和并发。4.不依赖任何第三方源码。
- 基于GCDWebServer开发iOS媒体管理功能思路
RyanWong_iOS
之前公司有个需求,需要在产品里面加入新功能“网页能对手机直接访问、查看、下载、上传媒体”。最终功能实现的效果图如下:图1、图片为系统相册中的照片,视频为系统相册中的视频,音乐为APP沙盒中的音乐,其他为APP沙盒中的其他图2、左边为多个相册的封面列表与标题,右边为具体某相册里的所有照片图3、系统相册中视频的信息图4、APP沙盒中的相关文件开发这个功能的时候,我借助了GCDWebServer的搭建本
- ios M3U8的播放
虞小虞
首先先说一下我们这篇教程所需要用到的工具1、TS链接2、m3u8文件(这里的m3u8文件是由接口返回的)2、GCDWebServer搭建本地服务器3、AVPlayer播放器4、AFNetworking一、TS的播放TS的播放思路是这样的:首先通过哈希算法将TS链接转为一串数字,由这串数字作为我们的文件名(分为.ts文件和.m3u8文件)。再将我们的文件保存在document路径下,通过服务器将m3
- GCDWebServer
三秋树下
GCDWebServer摘要关键词:iOS服务器框架,基于GCDGCDWebServer是一个现代和轻量级的基于HTTP1.1的服务器,它的设计旨在嵌入OSX和iOS应用程序中。它的实现在一开始就考虑了以下目标:一个优雅轻巧的使用架构带有四个核心的类:请求类,连接类,请求类和响应类(详情请参阅“了解GCDWebServer的架构”下)。一个精心设计的可以轻松集成和定制完整的方便查看的头文件完全使用
- iOS端使用GCDWebServer搭建本地服务器
拂晓拂晓
一.下载集成GCDWebServer地址:https://github.com/swisspol/GCDWebServer将GCDWebServer文件夹拉进项目中即可。二.使用基本的搭建跟使用源作者写的很清楚了,可以自己参考下。下面是我自己在实际使用中遇到的需要注意的问题,贴上代码跟说明:1.搭建本地服务器#import"LocalServerTestController.h"#import"G
- iOS WKWebView加载本地文件之权威解说
JackLee18
Object-CIOS
在实际的iOS开发中,我们有很多的地方需要通过WKWebView加载本地的文件。但是由于WKWebview存在着一些跨域的问题。UIWebView直接加载的方法不能正常使用了。这里就和大家分享一下常见的几种处理方法。GCDWebServer启动本地服务器加载 就是在本地启动一个本地服务器,可以使用GCDWebServer这个库,大家感兴趣的话可以看看。GCDWebServer介绍的文章(ht
- GCDWebServer 源码解读
nsrx
iOSGCDServerWebServer源码阅读
本文主要介绍GCDWebServer内部的处理过程,关于GCDWebServer的使用可以参考GCDWebServerGitHubGCDWebServer的处理流程分为三个步骤:-启动&&监听请求-处理请求-响应启动&&监听请求GCDWebServer提供了若干个启动方法:-(BOOL)start;-(BOOL)startWithPort:(NSUInteger)portbonjourName:(
- iOS本地服务器-GCDWebServer支持后台运行
Yin_M
1、项目的需求:项目需要做一个iOS端App,响应网页定时频繁发出的请求,App就相当于一个服务器。经查阅资料,有两个框架可供使用:CoCoaHTTPServer(GitHub地址);GCDWebServer(GitHub地址;中文翻译)。因为前者很多年没有维护,所以我选择了用GCDWebServer实现这个需求。2、项目需要实现的功能:保持网页在前台操作运行,App在后台不断的提供请求响应。3、
- 用GCDWEBSERVER在手机上架HTTP SERVER
jnbbwyth
ioswebserver
由swisspol提供的开源库GCDWebServer是一个轻量的HTTPserver,它基于GCD并可用于OSX&iOS,该库还实现了基于web的文件上传以及WebDAVserver等扩展功能。源码地址:https://github.com/swisspol/GCDWebServerGCDWebServer支持最新的HTTP1.1协议,使用GCD事件驱动设计可高效地支持并发,支持解析使用“app
- 二分查找排序算法
周凡杨
java二分查找排序算法折半
一:概念 二分查找又称
折半查找(
折半搜索/
二分搜索),优点是比较次数少,查找速度快,平均性能好;其缺点是要求待查表为有序表,且插入删除困难。因此,折半查找方法适用于不经常变动而 查找频繁的有序列表。首先,假设表中元素是按升序排列,将表中间位置记录的关键字与查找关键字比较,如果两者相等,则查找成功;否则利用中间位置记录将表 分成前、后两个子表,如果中间位置记录的关键字大于查找关键字,则进一步
- java中的BigDecimal
bijian1013
javaBigDecimal
在项目开发过程中出现精度丢失问题,查资料用BigDecimal解决,并发现如下这篇BigDecimal的解决问题的思路和方法很值得学习,特转载。
原文地址:http://blog.csdn.net/ugg/article/de
- Shell echo命令详解
daizj
echoshell
Shell echo命令
Shell 的 echo 指令与 PHP 的 echo 指令类似,都是用于字符串的输出。命令格式:
echo string
您可以使用echo实现更复杂的输出格式控制。 1.显示普通字符串:
echo "It is a test"
这里的双引号完全可以省略,以下命令与上面实例效果一致:
echo Itis a test 2.显示转义
- Oracle DBA 简单操作
周凡杨
oracle dba sql
--执行次数多的SQL
select sql_text,executions from (
select sql_text,executions from v$sqlarea order by executions desc
) where rownum<81;
&nb
- 画图重绘
朱辉辉33
游戏
我第一次接触重绘是编写五子棋小游戏的时候,因为游戏里的棋盘是用线绘制的,而这些东西并不在系统自带的重绘里,所以在移动窗体时,棋盘并不会重绘出来。所以我们要重写系统的重绘方法。
在重写系统重绘方法时,我们要注意一定要调用父类的重绘方法,即加上super.paint(g),因为如果不调用父类的重绘方式,重写后会把父类的重绘覆盖掉,而父类的重绘方法是绘制画布,这样就导致我们
- 线程之初体验
西蜀石兰
线程
一直觉得多线程是学Java的一个分水岭,懂多线程才算入门。
之前看《编程思想》的多线程章节,看的云里雾里,知道线程类有哪几个方法,却依旧不知道线程到底是什么?书上都写线程是进程的模块,共享线程的资源,可是这跟多线程编程有毛线的关系,呜呜。。。
线程其实也是用户自定义的任务,不要过多的强调线程的属性,而忽略了线程最基本的属性。
你可以在线程类的run()方法中定义自己的任务,就跟正常的Ja
- linux集群互相免登陆配置
林鹤霄
linux
配置ssh免登陆
1、生成秘钥和公钥 ssh-keygen -t rsa
2、提示让你输入,什么都不输,三次回车之后会在~下面的.ssh文件夹中多出两个文件id_rsa 和 id_rsa.pub
其中id_rsa为秘钥,id_rsa.pub为公钥,使用公钥加密的数据只有私钥才能对这些数据解密 c
- mysql : Lock wait timeout exceeded; try restarting transaction
aigo
mysql
原文:http://www.cnblogs.com/freeliver54/archive/2010/09/30/1839042.html
原因是你使用的InnoDB 表类型的时候,
默认参数:innodb_lock_wait_timeout设置锁等待的时间是50s,
因为有的锁等待超过了这个时间,所以抱错.
你可以把这个时间加长,或者优化存储
- Socket编程 基本的聊天实现。
alleni123
socket
public class Server
{
//用来存储所有连接上来的客户
private List<ServerThread> clients;
public static void main(String[] args)
{
Server s = new Server();
s.startServer(9988);
}
publi
- 多线程监听器事件模式(一个简单的例子)
百合不是茶
线程监听模式
多线程的事件监听器模式
监听器时间模式经常与多线程使用,在多线程中如何知道我的线程正在执行那什么内容,可以通过时间监听器模式得到
创建多线程的事件监听器模式 思路:
1, 创建线程并启动,在创建线程的位置设置一个标记
2,创建队
- spring InitializingBean接口
bijian1013
javaspring
spring的事务的TransactionTemplate,其源码如下:
public class TransactionTemplate extends DefaultTransactionDefinition implements TransactionOperations, InitializingBean{
...
}
TransactionTemplate继承了DefaultT
- Oracle中询表的权限被授予给了哪些用户
bijian1013
oracle数据库权限
Oracle查询表将权限赋给了哪些用户的SQL,以备查用。
select t.table_name as "表名",
t.grantee as "被授权的属组",
t.owner as "对象所在的属组"
- 【Struts2五】Struts2 参数传值
bit1129
struts2
Struts2中参数传值的3种情况
1.请求参数绑定到Action的实例字段上
2.Action将值传递到转发的视图上
3.Action将值传递到重定向的视图上
一、请求参数绑定到Action的实例字段上以及Action将值传递到转发的视图上
Struts可以自动将请求URL中的请求参数或者表单提交的参数绑定到Action定义的实例字段上,绑定的规则使用ognl表达式语言
- 【Kafka十四】关于auto.offset.reset[Q/A]
bit1129
kafka
I got serveral questions about auto.offset.reset. This configuration parameter governs how consumer read the message from Kafka when there is no initial offset in ZooKeeper or
- nginx gzip压缩配置
ronin47
nginx gzip 压缩范例
nginx gzip压缩配置 更多
0
nginx
gzip
配置
随着nginx的发展,越来越多的网站使用nginx,因此nginx的优化变得越来越重要,今天我们来看看nginx的gzip压缩到底是怎么压缩的呢?
gzip(GNU-ZIP)是一种压缩技术。经过gzip压缩后页面大小可以变为原来的30%甚至更小,这样,用
- java-13.输入一个单向链表,输出该链表中倒数第 k 个节点
bylijinnan
java
two cursors.
Make the first cursor go K steps first.
/*
* 第 13 题:题目:输入一个单向链表,输出该链表中倒数第 k 个节点
*/
public void displayKthItemsBackWard(ListNode head,int k){
ListNode p1=head,p2=head;
- Spring源码学习-JdbcTemplate queryForObject
bylijinnan
javaspring
JdbcTemplate中有两个可能会混淆的queryForObject方法:
1.
Object queryForObject(String sql, Object[] args, Class requiredType)
2.
Object queryForObject(String sql, Object[] args, RowMapper rowMapper)
第1个方法是只查
- [冰川时代]在冰川时代,我们需要什么样的技术?
comsci
技术
看美国那边的气候情况....我有个感觉...是不是要进入小冰期了?
那么在小冰期里面...我们的户外活动肯定会出现很多问题...在室内呆着的情况会非常多...怎么在室内呆着而不发闷...怎么用最低的电力保证室内的温度.....这都需要技术手段...
&nb
- js 获取浏览器型号
cuityang
js浏览器
根据浏览器获取iphone和apk的下载地址
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" content="text/html"/>
<meta name=
- C# socks5详解 转
dalan_123
socketC#
http://www.cnblogs.com/zhujiechang/archive/2008/10/21/1316308.html 这里主要讲的是用.NET实现基于Socket5下面的代理协议进行客户端的通讯,Socket4的实现是类似的,注意的事,这里不是讲用C#实现一个代理服务器,因为实现一个代理服务器需要实现很多协议,头大,而且现在市面上有很多现成的代理服务器用,性能又好,
- 运维 Centos问题汇总
dcj3sjt126com
云主机
一、sh 脚本不执行的原因
sh脚本不执行的原因 只有2个
1.权限不够
2.sh脚本里路径没写完整。
二、解决You have new mail in /var/spool/mail/root
修改/usr/share/logwatch/default.conf/logwatch.conf配置文件
MailTo =
MailFrom
三、查询连接数
- Yii防注入攻击笔记
dcj3sjt126com
sqlWEB安全yii
网站表单有注入漏洞须对所有用户输入的内容进行个过滤和检查,可以使用正则表达式或者直接输入字符判断,大部分是只允许输入字母和数字的,其它字符度不允许;对于内容复杂表单的内容,应该对html和script的符号进行转义替换:尤其是<,>,',"",&这几个符号 这里有个转义对照表:
http://blog.csdn.net/xinzhu1990/articl
- MongoDB简介[一]
eksliang
mongodbMongoDB简介
MongoDB简介
转载请出自出处:http://eksliang.iteye.com/blog/2173288 1.1易于使用
MongoDB是一个面向文档的数据库,而不是关系型数据库。与关系型数据库相比,面向文档的数据库不再有行的概念,取而代之的是更为灵活的“文档”模型。
另外,不
- zookeeper windows 入门安装和测试
greemranqq
zookeeper安装分布式
一、序言
以下是我对zookeeper 的一些理解: zookeeper 作为一个服务注册信息存储的管理工具,好吧,这样说得很抽象,我们举个“栗子”。
栗子1号:
假设我是一家KTV的老板,我同时拥有5家KTV,我肯定得时刻监视
- Spring之使用事务缘由(2-注解实现)
ihuning
spring
Spring事务注解实现
1. 依赖包:
1.1 spring包:
spring-beans-4.0.0.RELEASE.jar
spring-context-4.0.0.
- iOS App Launch Option
啸笑天
option
iOS 程序启动时总会调用application:didFinishLaunchingWithOptions:,其中第二个参数launchOptions为NSDictionary类型的对象,里面存储有此程序启动的原因。
launchOptions中的可能键值见UIApplication Class Reference的Launch Options Keys节 。
1、若用户直接
- jdk与jre的区别(_)
macroli
javajvmjdk
简单的说JDK是面向开发人员使用的SDK,它提供了Java的开发环境和运行环境。SDK是Software Development Kit 一般指软件开发包,可以包括函数库、编译程序等。
JDK就是Java Development Kit JRE是Java Runtime Enviroment是指Java的运行环境,是面向Java程序的使用者,而不是开发者。 如果安装了JDK,会发同你
- Updates were rejected because the tip of your current branch is behind
qiaolevip
学习永无止境每天进步一点点众观千象git
$ git push joe prod-2295-1
To
[email protected]:joe.le/dr-frontend.git
! [rejected] prod-2295-1 -> prod-2295-1 (non-fast-forward)
error: failed to push some refs to '
[email protected]
- [一起学Hive]之十四-Hive的元数据表结构详解
superlxw1234
hivehive元数据结构
关键字:Hive元数据、Hive元数据表结构
之前在 “[一起学Hive]之一–Hive概述,Hive是什么”中介绍过,Hive自己维护了一套元数据,用户通过HQL查询时候,Hive首先需要结合元数据,将HQL翻译成MapReduce去执行。
本文介绍一下Hive元数据中重要的一些表结构及用途,以Hive0.13为例。
文章最后面,会以一个示例来全面了解一下,
- Spring 3.2.14,4.1.7,4.2.RC2发布
wiselyman
Spring 3
Spring 3.2.14、4.1.7及4.2.RC2于6月30日发布。
其中Spring 3.2.1是一个维护版本(维护周期到2016-12-31截止),后续会继续根据需求和bug发布维护版本。此时,Spring官方强烈建议升级Spring框架至4.1.7 或者将要发布的4.2 。
其中Spring 4.1.7主要包含这些更新内容。