Udacity cs344-Introduction to Parallel Programming学习笔记-第三单元

2023-05-16

1、第一个quiz答案:6,21,问题很简单,数一下就好了。


2、什么是“归约”操作

归约操作有两个输入:

1)输入对象的集合

2)归约运算符:满足二元操作符、满足可结合性


3、第二个quiz答案:multiply、minimum、logical or、bitwise and


4、第三个quiz答案:2、3选项是对的


5、第四个quiz答案:(a+b)+(c+d)


6、第五个quiz答案:logn


7、第六个quiz答案:3倍(不是特别理解)

根据视频中的解答,对全局内存来说,假设N=1024,read操作一共要(1024+512+...+1),write操作需要(512+256+...+1),对共享内存来说read操作需要1024次操作,write操作需要1次。用N表示的话,全局内存需要约3N次操作,共享内存需要N+1次操作,大约相差3倍。


8、scan操作

scan操作就是计算它的输入项的当前和,scan操作中有一个概念叫标识元素,标识元素针对特定操作符,与其他元素操作后的结果仍等于该元素。


9、第七个quiz答案:1、0、1


10、第八个quiz答案:

identity:0

output:0、3、3、4、4、5


11、第九个quiz答案:

代码如下

 for(int i = 0; i < ARRAY_SIZE; i++){     
        out[i] = acc;
 acc = acc + elements[i]; }


12、第十个quiz答案:
steps:o(logn)
work:o(n^2)



13、第十一个quiz答案:
steps:logn
works:nlogn



14、第十二个quiz答案:
2、4、4、0、0、2、0、2、2、4


15、H-S算法总结:
steps:o(logn)
works:o(nlogn)
        Blelloch算法总结:
steps:o(2logn)
works:o(2n)


16、第十三个quiz答案:
H-S、Blelloch、serial


17、第十四个quiz答案:exclusive scan 


18、第十五个quiz答案:
n,n/b,较简单。


19、第十六个quiz答案:
1000,较简单。


20、第十七个quiz答案:
no


21、第十八个quiz答案:
reduce


22、第十九个quiz答案:
256,8

作业代码,参考别人的,写的非常棒。但是step 4有些难,不过Blelloch算法倒是看懂了。

/* Udacity Homework 3
   HDR Tone-mapping

  Background HDR
  ==============

  A High Definition Range (HDR) image contains a wider variation of intensity
  and color than is allowed by the RGB format with 1 byte per channel that we
  have used in the previous assignment.  

  To store this extra information we use single precision floating point for
  each channel.  This allows for an extremely wide range of intensity values.

  In the image for this assignment, the inside of church with light coming in
  through stained glass windows, the raw input floating point values for the
  channels range from 0 to 275.  But the mean is .41 and 98% of the values are
  less than 3!  This means that certain areas (the windows) are extremely bright
  compared to everywhere else.  If we linearly map this [0-275] range into the
  [0-255] range that we have been using then most values will be mapped to zero!
  The only thing we will be able to see are the very brightest areas - the
  windows - everything else will appear pitch black.

  The problem is that although we have cameras capable of recording the wide
  range of intensity that exists in the real world our monitors are not capable
  of displaying them.  Our eyes are also quite capable of observing a much wider
  range of intensities than our image formats / monitors are capable of
  displaying.

  Tone-mapping is a process that transforms the intensities in the image so that
  the brightest values aren't nearly so far away from the mean.  That way when
  we transform the values into [0-255] we can actually see the entire image.
  There are many ways to perform this process and it is as much an art as a
  science - there is no single "right" answer.  In this homework we will
  implement one possible technique.

  Background Chrominance-Luminance
  ================================

  The RGB space that we have been using to represent images can be thought of as
  one possible set of axes spanning a three dimensional space of color.  We
  sometimes choose other axes to represent this space because they make certain
  operations more convenient.

  Another possible way of representing a color image is to separate the color
  information (chromaticity) from the brightness information.  There are
  multiple different methods for doing this - a common one during the analog
  television days was known as Chrominance-Luminance or YUV.

  We choose to represent the image in this way so that we can remap only the
  intensity channel and then recombine the new intensity values with the color
  information to form the final image.

  Old TV signals used to be transmitted in this way so that black & white
  televisions could display the luminance channel while color televisions would
  display all three of the channels.
  

  Tone-mapping
  ============

  In this assignment we are going to transform the luminance channel (actually
  the log of the luminance, but this is unimportant for the parts of the
  algorithm that you will be implementing) by compressing its range to [0, 1].
  To do this we need the cumulative distribution of the luminance values.

  Example
  -------

  input : [2 4 3 3 1 7 4 5 7 0 9 4 3 2]
  min / max / range: 0 / 9 / 9

  histo with 3 bins: [4 7 3]

  cdf : [4 11 14]


  Your task is to calculate this cumulative distribution by following these
  steps.

*/

#include "utils.h"

__global__ void reduce_minimum(float * d_out, const float * const d_in, const size_t numItem) {
    // sdata is allocated in the kernel call: 3rd arg to <<<b, t, shmem>>>
  extern __shared__ float sdata[];

  int myId = threadIdx.x + blockDim.x * blockIdx.x;
  int tid  = threadIdx.x;

  // load shared mem from global mem
  sdata[tid] = 99999999999.0f;
  if (myId < numItem)
    sdata[tid] = d_in[myId];

  __syncthreads();            // make sure entire block is loaded!

  // do reduction in shared mem
  for (unsigned int s = blockDim.x / 2; s > 0; s >>= 1) {
    if (tid < s) {
        sdata[tid] = min(sdata[tid], sdata[tid + s]);
    }
    __syncthreads();        // make sure all adds at one stage are done!
  }

  // only thread 0 writes result for this block back to global mem
  if (tid == 0) {
    d_out[blockIdx.x] = sdata[0];
  }
}

__global__ void reduce_maximum(float * d_out, const float * const d_in, const size_t numItem) {
  // sdata is allocated in the kernel call: 3rd arg to <<<b, t, shmem>>>
  extern __shared__ float sdata[];

  int myId = threadIdx.x + blockDim.x * blockIdx.x;
  int tid  = threadIdx.x;

  // load shared mem from global mem
  sdata[tid] = -99999999999.0f;
  if (myId < numItem)
    sdata[tid] = d_in[myId];

  __syncthreads();            // make sure entire block is loaded!

  // do reduction in shared mem
  for (unsigned int s = blockDim.x / 2; s > 0; s >>= 1) {
    if (tid < s) {
      sdata[tid] = max(sdata[tid], sdata[tid + s]);
    }
    __syncthreads();        // make sure all adds at one stage are done!
  }

  // only thread 0 writes result for this block back to global mem
  if (tid == 0) {
    d_out[blockIdx.x] = sdata[0];
  }
}

__global__ void histogram(unsigned int *d_bins, const float * const d_in, const size_t numBins, const float min_logLum, const float range, const size_t numRows, const size_t numCols) {
  
  int myId = threadIdx.x + blockDim.x * blockIdx.x;
  if (myId >= (numRows * numCols))
    return;

  float myItem = d_in[myId];
  int myBin = (myItem - min_logLum) / range * numBins;
  atomicAdd(&(d_bins[myBin]), 1);
}

__global__ void scan(unsigned int *d_out, unsigned int *d_sums, const unsigned int * const d_in, const unsigned int numBins, const unsigned int numElems)  {

  extern __shared__ float sdata[];
  int myId = blockIdx.x * blockDim.x + threadIdx.x;
  int tid = threadIdx.x;
  int offset = 1;

  // load two items per thread into shared memory
  if ((2 * myId) < numBins) {
    sdata[2 * tid] = d_in[2 * myId];
  }
  else {
    sdata[2 * tid] = 0;
  }
  
  if ((2 * myId + 1) < numBins) {
    sdata[2 * tid + 1] = d_in[2 * myId + 1];
  }
  else {
    sdata[2 * tid + 1] = 0;
  }

 	// Reduce
  for (unsigned int d = numElems >> 1; d > 0; d >>= 1) {
    if (tid < d)  {
      int ai = offset * (2 * tid + 1) - 1;
      int bi = offset * (2 * tid + 2) - 1;
      sdata[bi] += sdata[ai];
    }
    offset *= 2;
    __syncthreads();
  }
    
  // clear the last element
  if (tid == 0) {
    d_sums[blockIdx.x] = sdata[numElems - 1];
    sdata[numElems - 1] = 0;
  }
  
  // Down Sweep
  for (unsigned int d = 1; d < numElems; d *= 2) {
    offset >>= 1;
    if (tid < d) {
      int ai = offset * (2 * tid + 1) - 1;
      int bi = offset * (2 * tid + 2) - 1;
 	    float t = sdata[ai];
      sdata[ai] = sdata[bi];
      sdata[bi] += t;
    }
    __syncthreads();
  }
 
  // write the output to global memory
  if ((2 * myId) < numBins) {
    d_out[2 * myId] = sdata[2 * tid];
  }
  if ((2 * myId + 1) < numBins) {
    d_out[2 * myId + 1] = sdata[2 * tid + 1];
  }
}

// This version only works for one single block! The size of the array of items
__global__ void scan2(unsigned int *d_out, const unsigned int * const d_in, const unsigned int numBins, const unsigned int numElems)  {

  extern __shared__ float sdata[];
  int tid = threadIdx.x;
  int offset = 1;

  // load two items per thread into shared memory
  if ((2 * tid) < numBins) {
    sdata[2 * tid] = d_in[2 * tid];  
  }
  else {
    sdata[2 * tid] = 0;
  }

  if ((2 * tid + 1) < numBins) {
    sdata[2 * tid + 1] = d_in[2 * tid + 1];  
  }
  else {
    sdata[2 * tid + 1] = 0;
  }

 	// Reduce
  for (unsigned int d = numElems >> 1; d > 0; d >>= 1) {
    if (tid < d)  {
      int ai = offset * (2 * tid + 1) - 1;
      int bi = offset * (2 * tid + 2) - 1;
      sdata[bi] += sdata[ai];
    }
    offset *= 2;
    __syncthreads();
  }
    
  // clear the last element
  if (tid == 0) {
    sdata[numElems - 1] = 0;
  }
  
  // Down Sweep
  for (unsigned int d = 1; d < numElems; d *= 2) {
    offset >>= 1;
    if (tid < d) {
      int ai = offset * (2 * tid + 1) - 1;
      int bi = offset * (2 * tid + 2) - 1;
 	    float t = sdata[ai];
      sdata[ai] = sdata[bi];
      sdata[bi] += t;
    }
    __syncthreads();
  }
 
  // write the output to global memory
  if ((2 * tid) < numBins) {
    d_out[2 * tid] = sdata[2 * tid];
  }

  if ((2 * tid + 1) < numBins) {
    d_out[2 * tid + 1] = sdata[2 * tid + 1];
  }
}

__global__ void add_scan(unsigned int *d_out, const unsigned int * const d_in, const unsigned int numBins) {

  if (blockIdx.x == 0)
    return;

  int myId = blockIdx.x * blockDim.x + threadIdx.x;
  unsigned int myOffset = d_in[blockIdx.x];

  if ((2 * myId) < numBins) {
    d_out[2 * myId] += myOffset;
  }
  if ((2 * myId + 1) < numBins) {
    d_out[2 * myId + 1] += myOffset;
  }

}

void your_histogram_and_prefixsum(const float* const d_logLuminance,
                                  unsigned int* const d_cdf,
                                  float &min_logLum,
                                  float &max_logLum,
                                  const size_t numRows,
                                  const size_t numCols,
                                  const size_t numBins)
{
  //TODO
  /*Here are the steps you need to implement
    1) find the minimum and maximum value in the input logLuminance channel
       store in min_logLum and max_logLum
    2) subtract them to find the range
    3) generate a histogram of all the values in the logLuminance channel using
       the formula: bin = (lum[i] - lumMin) / lumRange * numBins
    4) Perform an exclusive scan (prefix sum) on the histogram to get
       the cumulative distribution of luminance values (this should go in the
       incoming d_cdf pointer which already has been allocated for you)       */

  // Initialization
  unsigned int numItem = numRows * numCols;
  dim3 blockSize(256, 1, 1);
  dim3 gridSize(numItem / blockSize.x + 1, 1, 1);
    
  float * d_inter_min;
  float * d_inter_max;
  unsigned int * d_histogram;
  unsigned int * d_sums;
  unsigned int * d_incr;

  checkCudaErrors(cudaMalloc(&d_inter_min, sizeof(float) * gridSize.x));
  checkCudaErrors(cudaMalloc(&d_inter_max, sizeof(float) * gridSize.x));
  checkCudaErrors(cudaMalloc(&d_histogram, sizeof(unsigned int) * numBins));
  checkCudaErrors(cudaMemset(d_histogram, 0, sizeof(unsigned int) * numBins));
     
  // Step 1: Reduce (min and max). It could be done in one step only!
  reduce_minimum<<<gridSize, blockSize, sizeof(float) * blockSize.x>>>(d_inter_min, d_logLuminance, numItem);
  reduce_maximum<<<gridSize, blockSize, sizeof(float) * blockSize.x>>>(d_inter_max, d_logLuminance, numItem);
  numItem = gridSize.x;
  gridSize.x = numItem / blockSize.x + 1;

  while (numItem > 1) {
    reduce_minimum<<<gridSize, blockSize, sizeof(float) * blockSize.x>>>(d_inter_min, d_inter_min, numItem);
    reduce_maximum<<<gridSize, blockSize, sizeof(float) * blockSize.x>>>(d_inter_max, d_inter_max, numItem);
    numItem = gridSize.x;
    gridSize.x = numItem / blockSize.x + 1;
  }

  // Step 2: Range
  checkCudaErrors(cudaMemcpy(&min_logLum, d_inter_min, sizeof(float), cudaMemcpyDeviceToHost));
  checkCudaErrors(cudaMemcpy(&max_logLum, d_inter_max, sizeof(float), cudaMemcpyDeviceToHost));

  float range = max_logLum - min_logLum;

  // Step 3: Histogram
  gridSize.x = numRows * numCols / blockSize.x + 1;
  histogram<<<gridSize, blockSize>>>(d_histogram, d_logLuminance, numBins, min_logLum, range, numRows, numCols);

  // Step 4: Exclusive scan - Blelloch
  unsigned int numElems = 256;
  blockSize.x = numElems / 2;
  gridSize.x = numBins / numElems;
  if (numBins % numElems != 0)
    gridSize.x++;
  checkCudaErrors(cudaMalloc(&d_sums, sizeof(unsigned int) * gridSize.x));
  checkCudaErrors(cudaMemset(d_sums, 0, sizeof(unsigned int) * gridSize.x));

  // First-level scan to obtain the scanned blocks
  scan<<<gridSize, blockSize, sizeof(float) * numElems>>>(d_cdf, d_sums, d_histogram, numBins, numElems);

  // Second-level scan to obtain the scanned blocks sums
  numElems = gridSize.x;

  // Look for the next power of 2 (32 bits)
  unsigned int nextPow = numElems;
  nextPow--;
  nextPow = (nextPow >> 1) | nextPow;
  nextPow = (nextPow >> 2) | nextPow;
  nextPow = (nextPow >> 4) | nextPow;
  nextPow = (nextPow >> 8) | nextPow;
  nextPow = (nextPow >> 16) | nextPow;
  nextPow++;

  blockSize.x = nextPow / 2;
  gridSize.x = 1;
  checkCudaErrors(cudaMalloc(&d_incr, sizeof(unsigned int) * numElems));
  checkCudaErrors(cudaMemset(d_incr, 0, sizeof(unsigned int) * numElems));
  scan2<<<gridSize, blockSize, sizeof(float) * nextPow>>>(d_incr, d_sums, numElems, nextPow);

  // Add scanned block sum i to all values of scanned block i
  numElems = 256;
  blockSize.x = numElems / 2;
  gridSize.x = numBins / numElems;
  if (numBins % numElems != 0)
    gridSize.x++;
  add_scan<<<gridSize, blockSize>>>(d_cdf, d_incr, numBins);

  // Clean memory
  checkCudaErrors(cudaFree(d_inter_min));
  checkCudaErrors(cudaFree(d_inter_max));
  checkCudaErrors(cudaFree(d_histogram));
  checkCudaErrors(cudaFree(d_sums));
  checkCudaErrors(cudaFree(d_incr));
}




本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Udacity cs344-Introduction to Parallel Programming学习笔记-第三单元 的相关文章

  • VMware Ubuntu安装详细过程(非常靠谱)

    不是每一个程序员都必须玩过linux xff0c 只是博主觉得现在的很多服务器都是linux系统的 xff0c 而自己属于那种前端也搞 xff0c 后台也搞 xff0c 对框架搭建也感兴趣 xff0c 但是很多生产上的框架和工具都是安装在服
  • linux命令行无故换行的恼人问题

    在敲linux命令时 xff0c 明明本行远远没有满 xff0c 就自动换行了 xff0c 而且还覆盖 xff0c 颇为恼人 在网上找了很多地方 xff0c 也没有比较好的解决方法 xff0c 勉强忍受了一段时间 最近 xff0c 偶然看到
  • ZeroMQ“发布/订阅”模型的C++代码

    ZeroMQ环境的搭建就不说了 xff0c 之前已经说过 来看ZeroMQ的 发布 订阅 模型的C 43 43 代码 xff1a pub cpp代码为 xff1a include lt stdio h gt include lt stdli
  • CentOS7启动vncserver命令

    在CentOS7上 xff0c 使用yum安装vncserver xff0c 默认会安装tigerVNC xff0c 安装配置完成后 xff0c 启动vncserver的命令如下 xff08 通过systemctl启动 xff09 xff1
  • ubuntu安装cuda8.0+tensorflow+pytorch

    Data 2017 7 23 Author cjh 1 下载cuda8 0 https developer nvidia com cuda downloads 本人选择的是deb local xff0c 网上很多教程都是根据runfile
  • 【神经网络并行训练(上)】基于MapReduce的并行算法的实现

    前言 最近看了一些基于MapReduce的神经网络并行训练方面的论文 xff0c 老师让我自己去实现一下 xff0c 更深入的体会其中的原理 MapReduce是基于java语言的框架 xff0c 于是一开始想用java写深度学习代码 但是
  • dicom文件与bmp和jpg文件的相互转化

    前面工作需要 xff0c 将dicom医学文件转化为普通图像 xff0c 如bmp xff0c jpg等 xff0c 中间应用到了CxImage x64和dcmtk包 实现过程中 xff0c 遇到了不少麻烦 xff0c 现将相关过程分享如下
  • Caffe 安装OpenCV-2.4.13

    有一段时间没写博客了 xff0c 主要是有一段时间没弄Ubuntu的Caffe配置了 最近NVIDIA把驱动啥的都升级到了CUDA 8 0版本 xff0c 安装OpenCV的时候会出现版本不兼容的问题 相信大家的OpenCV安装包都是Git
  • Nginx配置 https 证书

    1 阿里云创建免费SSL证书 2 证书申请 3 填写相关信息执行下一步 4 云服务器ECS安全组开放443端口 安全 5 下载证书 这里选择的是Nginx 6 证书上传服务器 1 把证书存放在指定目录得到两个文件后缀为 key 一个是 pe
  • ubuntu16.04 装机3:安装xrdp, 远程界面化操作

    前言 xff1a 本文教程自己试过多次 xff0c 在ubuntu16 04上都安装成功了 但是有可能在ubuntu18上会有些问题 经同学推荐 xff0c 在ubuntu18上安装xrdp xff0c 可以参考 xff1a Ubuntu1
  • 对 pretext tasks 的理解

    在读一些自监督学习算法的时候 xff0c 遇到了pretext tasks这个术语 xff0c 所以对这个术语的含义做了下了解 pretext tasks 通常被翻译作 前置任务 或 代理任务 xff0c 有时也用 surrogate ta
  • ubuntu下中文文件名乱码

    windows下的中文文件名拷贝到ubuntu下面以后 xff0c 文件名直接变成乱码 xff0c 原因为windows下的文件名以GBK编码 xff0c 而Ubuntu下的文件 名为utf span class hljs subst sp
  • 树莓派3B+的基础配置

    一 文章背景 本文写于北京时间2019年11月13日 我前两天刚到杭州导师的实验室 xff0c 很多事情都还是一窍不通 方向是物联网相关 xff0c 最近在结合 物联网应用快速开发 从创意到原型 学习一些物联网的基础知识 xff0c 书中的
  • Centos在vm中设置网络环境、防火墙设置

    本次实践采用Centos 7 的操作系统 新建虚拟机选择安装文件这里就不多说了 xff0c 从选择好配置之后 xff0c 启动安装之前说起 1 添加网卡 在系统安装之前一定要设置下虚拟机的硬件配置 xff0c 在硬件设置中添加网卡 xff0
  • webpack优化打包速度(thread-loader)

    文档地址thread loader webpack 中文文档 v4 15 1 可配选项 use loader 34 thread loader 34 有同样配置的 loader 会共享一个 worker 池 worker pool opti
  • ubuntu14.04如何安装英伟达显卡驱动

    Data 2017 07 23 Author cjh 1 驱动下载 http www geforce cn drivers 手动选择对应的驱动进行下载 2 xff0e 安装 将下载好的驱动放到 home user目录下 xff0c 添加驱动
  • 推荐三大文献检索下载网站,超级实用!重点是免费

    据说 xff0c 科研院校每年因购买数据库就要花掉几百万 xff0c 而且现在价格越来越贵 xff0c 于是很多高校开始不再购买部分数据库 xff0c 这可真苦了研究生们 下面推荐三个中外文献免费的网站 xff0c 觉得有用就拿走吧 1 掌
  • NLP大神推荐的机器学习入门书单(附大量百度网盘电子书)

    https blog csdn net surgent777 article details 53895048 biz id 61 102 amp utm term 61 python E8 87 AA E7 84 B6 E8 AF AD
  • softmax(a,axis=0)的用法理解 总结

    对于3维度数组 总结axis 61 0 1 2 axis 61 0 沿着 axis 61 0方向 可以认为是时间的方向 取每个单元对应元素进行计算softmax 通俗理解就是今天8点钟的对应行对应列的元素a 2 0 0 与昨天8点钟的对应行
  • No module named ‘tensorflow_hub‘

    发现先导入pip install tensorflow datasets 再执行pip installl tensorflow hub就可以了 https blog csdn net qq 37051669 article details

随机推荐

  • 莫烦老师的tensorflow降级方法

    tf2 0以上版本的 xff0c 开始加两行 import tensorflow compat v1 as tf tf disable v2 behavior https blog csdn net AI future article de
  • tensorflow对应的python版本清单

    https tensorflow google cn install source windows cpu
  • RandomForestClassifier参数min_samples_leaf和min_samples_split理解

    而min samples split限定 xff0c 个结点必须要包含 少min samples split个训练样本 xff0c 这个结点才允许 被分 xff0c 否则分 就不会发 min samples leaf限定 xff0c 个结点
  • UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb0 in position 0: invalid start byte

    UnicodeDecodeError utf 8 codec can t decode byte 0xb0 in position 0 invalid start byte
  • ubuntu18.04子网掩码 - 255.255.255.0 -判断网络是否在同一网段

    ubuntu18 04子网掩码 255 255 255 0 优选网
  • 两个电脑面对面ping 不通,都是用的wifi网络,执行traceroute报错 !H 主机不可达

    traceroute 192 168 106 81 traceroute to 192 168 106 81 192 168 106 81 64 hops max 1 192 168 106 101 53 267ms H 0 004ms H
  • 2018届校招提前批大华面经

    大华提前批面试 xff1a 一共三面 xff0c 一面技术面 xff0c 二面技术面 xff0c 三面HR面 面试岗位 xff1a 算法优化 一面 xff1a 本人这次人品比较棒 xff0c 一面两个人聊得很high xff0c 主要聊了简
  • SVN commit,update用法

    您是否有過這樣子的經驗 在編修檔案的過程中 尤其是在撰寫程式檔 突然改爛了 而想說 如果我有辦法知道剛才改了什麼地方有多好 或是在一份大作業或者是專案的情況下 須要多個人一同改一份檔案 總須事先說好誰要改哪個檔案 改的時候別人都不能動 以免
  • ORACLE EXP命令

    本文对Oracle数据的导入导出 imp exp 两个命令进行了介绍 并对其相应的参数进行了说明 然后通过一些示例进行演练 加深理解 文章最后对运用这两个命令可能出现的问题 如权限不够 不同oracle版本 进行了探讨 并提出了相应的解决方
  • unzip命令用法

    我使用过的Linux 命令之unzip 解压zip 文件 本文链接 xff1a http codingstandards javaeye com blog 792040 xff08 转载请注明出处 xff09 用途说明 zip 文件是一种常
  • System.in.read()的用法

    System in read 的用法 2007 10 25 22 00 24 分类 xff1a 默认分类 标签 xff1a 字号 大 中 小 订阅 用读取键盘输入必须构建 1 输入流 System in 2 字符输入流 InputStrea
  • django中的models的常用字段及属性

    django 模型models 常用字段 1 models AutoField 自增列 61 int 11 如果没有的话 xff0c 默认会生成一个名称为 id 的列 如果要显式的自定义一个自增列 xff0c 必须设置primary key
  • Ubuntu 20.04本地源使用(用apt-get 安装本地包)

    系统版本 xff1a Ubuntu 20 04 一 新建一个文件夹 xff0c 用于存放下载的某个 deb包 xff08 例 xff1a 2048 xff09 Tips 相关命令 xff1a mkdir 文件名 二 把本地的 deb包移动至
  • C++程序员经常问的11个问题

    下面的这些要点是对所有的C 43 43 程序员都适用的 我之所以说它们是最重要的 xff0c 是因为这些要点中提到的是你通常在C 43 43 书中或网站上无法找到的 如 xff1a 指向成员的指针 xff0c 这是许多资料中都不愿提到的地方
  • Ubuntu配置任意版本的apt-get镜像

    我们知道 xff0c 迄今为止 xff0c Ubuntu已有多个发行版 xff0c 如11 04 11 10 xff0c 以至于现在最新的16 而我们平常通过apt get来安装软件 xff0c 如果OS版本不同 xff0c 那么镜像源的配
  • 在APK中获取鸿蒙应用Ability信息

    Android开发工具箱大概在版本2 2 0 xff08 2021 06 10 xff09 就已经支持查看鸿蒙系统信息以及鸿蒙应用信息了 这里我讲一下Android开发工具箱是如何在Android应用中 xff08 APK xff09 获取
  • Maven

    Maven Maven 翻译为 34 专家 34 内行 Maven 是一个项目管理工具 xff0c 可以对 Java 项目进行构建 依赖管理 它包含了一个项目对象模型 POM Project Object Model 一组标准集合 xff0
  • Jetson TX1内核kernel编译与烧写

    Data 2017 09 13 Author cjh Theme Jetson TX1内核kernel编译与烧写 PS xff1a 本人用的JetPack版本为3 0 1 Getting bootloader and kernel 本文内核
  • 关于ST-linkV2的修复问题-----重新烧录固件

    之前一直用串口下载C8t6 xff0c 后面发现不如link方便 xff0c 然后在这个月换回来st link之后下载了一次就坏了 xff0c 一直没用 xff0c 让我在网上找了很多攻略 xff0c 也没有翻出头绪 xff0c 然后就想重
  • Udacity cs344-Introduction to Parallel Programming学习笔记-第三单元

    1 第一个quiz答案 xff1a 6 xff0c 21 xff0c 问题很简单 xff0c 数一下就好了 2 什么是 归约 操作 归约操作有两个输入 xff1a 1 xff09 输入对象的集合 2 xff09 归约运算符 xff1a 满足