首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏c++与qt学习

    CS 144 Lab One -- 流重组器

    Lab Checkpoint 1: stitching substrings into a byte stream ---- 实验结构 这幅图完整的说明了CS144 这门实验的结构: 其中, ByteStream StreamReassembler 中存在一个 ByteStream 用于输出,当重组器知道了流的下一个字节,它就会将其写入至 ByteStream中。 ByteStream,将图中存放红色区域的内存范围(即 first unassembled - first unacceptable)称为 Unassembled_strs。 CS144 要求将 ByteStream + Unassembled_strs 的内存占用总和限制在 Reassember 中构造函数传入的 capacity 大小。 @{ const ByteStream &stream_out() const { return _output; } ByteStream &stream_out() { return

    46540编辑于 2023-10-11
  • 来自专栏一英里广度一英寸深度的学习

    机器学习入门数据集--3.手写数字识别

    255] down to [-0.5, 0.5]. """ print('Extracting', filename) with gzip.open(filename) as bytestream : bytestream.read(16) buf = bytestream.read(IMAGE_SIZE * IMAGE_SIZE * num_images * NUM_CHANNELS print('Extracting', filename) with gzip.open(filename) as bytestream: bytestream.read(8) buf = bytestream.read(1 * num_images) labels = numpy.frombuffer(buf, dtype=numpy.uint8

    1.2K20发布于 2019-03-04
  • 来自专栏c++与qt学习

    CS 144 Lab Zero -- 可靠的内存字节流

    ByteStream(const size_t capacity); //! Write a string of bytes into the stream. ::ByteStream(const size_t capacity) : buffer_() , capacity_(capacity) , is_ended_(false) \param[in] len bytes will be copied from the output side of the buffer string ByteStream::peek_output ByteStream::buffer_size() const { return buffer_.size(); } bool ByteStream::buffer_empty() const { return buffer_.empty(); } bool ByteStream::eof() const { return is_eof_; } size_t ByteStream::bytes_written

    51420编辑于 2023-10-11
  • 来自专栏Deep Learning 笔记

    CNN+MNIST+INPUT_DATA数字识别

    print('Extracting', filename) with gzip.open(filename) as bytestream: magic = _read32(bytestream ) rows = _read32(bytestream) cols = _read32(bytestream) buf = bytestream.read(rows * cols print('Extracting', filename) with gzip.open(filename) as bytestream: magic = _read32(bytestream print('Extracting', filename) with gzip.open(filename) as bytestream: magic = _read32(bytestream ) rows = _read32(bytestream) cols = _read32(bytestream) buf = bytestream.read(rows * cols

    1.1K30发布于 2018-08-19
  • 来自专栏桃花源

    使用JAVA获取ActiveMQ队列数据和状态

    ,因为FileInputStream 是InputStream的实现类;InputStream是个抽象类; ByteArrayOutputStream bytestream (ch); } bytestream.close() FileInputStream 是InputStream的实现类;InputStream是个抽象类; ByteArrayOutputStream bytestream FileInputStream 是InputStream的实现类;InputStream是个抽象类; ByteArrayOutputStream bytestream (ch); } bytestream.close

    2.4K20编辑于 2022-11-13
  • 来自专栏关键帧Keyframe

    AVCC/HVCC 与 Annexb 码流格式相互转换丨音视频工业实战

    _init(gb, ctx->par_in->extradata, ctx->par_in->extradata_size); bytestream2_skipu(gb, 4); / sps_done++) { unit_nb = bytestream2_get_byteu(gb); /* number of pps unit(s) */ _init(&gb, ctx->par_in->extradata, ctx->par_in->extradata_size); bytestream2_skip(&gb, 21); length_size = (bytestream2_get_byte(&gb) & 3) + 1; num_arrays = bytestream2_get_byte(&gb); = bytestream2_get_be16(&gb); if (!

    2.7K20编辑于 2023-10-22
  • 来自专栏机器学习算法与Python学习

    TensorFlow实战:SoftMax手写体MNIST识别(Python完整源码)

    ): dt = numpy.dtype(numpy.uint32).newbyteorder('>') return numpy.frombuffer(bytestream.read(4), dtype Raises: ValueError: If the bytestream does not start with 2051. """ print('Extracting', f.name ) with gzip.GzipFile(fileobj=f) as bytestream: magic = _read32(bytestream) if magic ! ) rows = _read32(bytestream) cols = _read32(bytestream) buf = bytestream.read(rows * cols : magic = _read32(bytestream) if magic !

    2.8K60发布于 2018-04-08
  • 来自专栏开源技术小栈

    基于 Revolt 非阻塞套接字连接/服务器实现

    use Amp\ByteStream; use Amp\Socket\ClientTlsContext; use Amp\Socket\ConnectContext; use League\Uri\Http ; use function Amp\Socket\connect; use function Amp\Socket\connectTls; $stdout = ByteStream\getStdout connectContext); $socket->write("GET {$path} HTTP/1.1\r\nHost: $host\r\nConnection: close\r\n\r\n"); ByteStream /vendor/autoload.php'; use Amp\ByteStream; use Amp\Socket\ClientTlsContext; use Amp\Socket\ConnectContext use League\Uri\Http; use function Amp\Socket\connect; use function Amp\Socket\connectTls; $stdout = ByteStream

    18900编辑于 2025-07-02
  • 来自专栏安恒网络空间安全讲武堂

    phar反序列化rce

    在组件中寻找删除函数,全局搜索定位unlink() 最终在swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php php class Swift_ByteStream_AbstractFilterableInputStream { /** * Write sequence. */ * * @var Swift_InputByteStream[] */ private $mirrors = []; } class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterableInputStream { /** The internal pointer offset */ extends Swift_ByteStream_FileByteStream { public function __construct() { $filePath = "/

    1.7K30发布于 2018-12-27
  • 来自专栏IT云清

    java文件转二进制

    try { InputStream is = new FileInputStream(file); ByteArrayOutputStream bytestream = -1) { bytestream.write(bb, 0, ch); ch = is.read(bb); } by = bytestream.toByteArray(); } catch (Exception ex) { throw new RuntimeException

    3.8K30发布于 2019-01-22
  • 来自专栏算法微时光

    深度学习之卷积神经网络(六)

    return filepath def _read32(bytestream): dt = numpy.dtype(numpy.uint32).newbyteorder('>') return print('Extracting', filename) with gzip.open(filename) as bytestream: magic = _read32(bytestream ) rows = _read32(bytestream) cols = _read32(bytestream) #print num_images #print rows #print cols buf = bytestream.read(rows * cols * num_images) data = numpy.frombuffer(buf print('Extracting', filename) with gzip.open(filename) as bytestream: magic = _read32(bytestream

    1.2K30发布于 2020-04-24
  • 来自专栏c++与qt学习

    CS 144 Lab Two -- TCPReceiver

    TCPReceiver 除了将读入的数据写入至 ByteStream 中以外,它还需要告诉发送者两个属性: 第一个未组装的字节索引,称为确认号ackno,它是接收者需要的第一个字节的索引。 SYN_RECV:获取到了 SYN 包,此时可以正常的接收数据包 FIN_RECV:获取到了 FIN 包,此时务必终止 ByteStream 数据流的输入。 状态 Window Size 是当前的 capacity 减去 ByteStream 中尚未被读取的数据大小,即 reassembler 可以存储的尚未装配的子串索引范围。 Receives and reassembles segments into a ByteStream, and computes //! 由于 ByteStream 和 StreamRessembler 总容量为一致, 因此可以用 stream_out().remaining_capacity() 表示.

    47020编辑于 2023-10-11
  • 来自专栏Flutter&Dart

    Dart-Aqueduct框架开发(七)

    FileController controller, Request req) async { final file = File('static/bird.jpg'); final byteStream = file.openRead(); return Response.ok( byteStream, ) ..encodeBody FileController controller, Request req) async { final file = File('static/bird.jpg'); final byteStream = file.openRead(); return Response.ok( byteStream, ) ..encodeBody

    78830发布于 2020-04-09
  • 来自专栏JAVA

    如何使用Java进行文件压缩和解压缩

    zipFilePath = "path/to/compressed.zip"; // 创建一个字节数组输出流,用于存储压缩包数据 ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); try (ZipOutputStream zipOutputStream = new ZipOutputStream(byteStream 将压缩包数据写入文件 try (FileOutputStream fileOutputStream = new FileOutputStream(zipFilePath)) { byteStream.writeTo 设置响应的内容类型和头部信息 try (FileOutputStream fileOutputStream = new FileOutputStream(zipFilePath)) { byteStream.writeTo // 将压缩包数据写入响应输出流 try (OutputStream out = response.getOutputStream()) { byteStream.writeTo

    93810编辑于 2024-11-20
  • 来自专栏【计网】Cisco

    【斯坦福计网CS144】Lab1终结笔记

    它将接收子串(由一串字节和大数据流中该串的第一个字节的索引组成),并提供一个“ByteStream”,其中所有的数据都被正确排序。 2 而在Lab0已经实现了双向字节流ByteStream。 而在后续实验需要完成两个ByteStream:一个出向ByteStream(outbound),一个入向ByteStream(inbound),此时TCP会接收从远端发来的数据,然后被本地应用所读取。

    38910编辑于 2024-02-20
  • 来自专栏服务化进程

    Sftp工具类

    public byte[] inputStreamToByte (InputStream iStrm) throws IOException { ByteArrayOutputStream bytestream = -1) { bytestream.write(ch); } byte imgdata[] = bytestream.toByteArray() ; bytestream.close(); return imgdata; } /** * 创建远程目录 * @param

    4.1K60发布于 2019-08-02
  • 来自专栏一英里广度一英寸深度的学习

    深度学习入门数据集--2.fasion-mnist数据集

    extract_data(filename, num_images): print('Extracting', filename) with gzip.open(filename) as bytestream : bytestream.read(16) buf = bytestream.read(IMAGE_SIZE * IMAGE_SIZE * num_images * NUM_CHANNELS print('Extracting', filename) with gzip.open(filename) as bytestream: bytestream.read(8) buf = bytestream.read(1 * num_images) labels = numpy.frombuffer(buf, dtype=numpy.uint8

    2K20发布于 2019-03-06
  • 来自专栏sukuna的博客

    Stanford CS144 Lab

    图片 private类中还有一个ByteStream类型的变量,所有的内容都输出给ByteStream,还有一个容量变量.其中ByteStream中的bytes_read返回ByteStream处理了多少元素 这个时候我们回忆一下对应数据的表示: output.bytes_read():接收端从ByteStream获得的字符数量. output.bytes_write():流重组器写入ByteStream的字符数量 Receives and reassembles segments into a ByteStream, and computes //! @{ ByteStream &stream_out() { return _reassembler.stream_out(); } const ByteStream &stream_out @{ ByteStream &stream_in() { return _stream; } const ByteStream &stream_in() const { return _

    95220编辑于 2023-03-20
  • 来自专栏Java探索之路

    钉钉企业应用网关接入(保姆级教程)

    plainTextBytes.length); byte[] corpidBytes = corpId.getBytes(CHARSET); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); byteStream.write(randomBytes); byteStream.write (lengthByte); byteStream.write(plainTextBytes); byteStream.write(corpidBytes) ; byte[] padBytes = PKCS7Padding.getPaddingBytes(byteStream.size()); byteStream.write (padBytes); byte[] unencrypted = byteStream.toByteArray(); byteStream.close()

    2.5K10编辑于 2022-09-28
  • 来自专栏C/C++基础

    C++字节流与二进制字符串相互转换(一个简单的明文加解密程序)

    include <string.h> #include <stdint.h> #include <iostream> #include <fstream> using namespace std; int byteStream2BinaryString byteLen*8]; ifs.seekg(0,ios::beg); ifs.read((char*)byteBuf,byteLen); int ret=byteStream2BinaryString uint8_t[byteLen]; ifs.seekg(0,ios::beg); ifs.read(charBuf,charLen); int ret=byteStream2BinaryString 0:success;-1:error *@author:dablelv *@date:20160809 ******************************************/ int byteStream2BinaryString

    2.4K20发布于 2018-08-03
领券