球拍:内在减少与懒惰评估?(Racket: inner reduction vs. lazy evaluation?)
我认为球拍总是进行内部减少评估,但我发现例如“if”(和cond?!)是球拍中的懒惰评价......为什么需要?
通过内部还原来实现if语句是不可能的吗?
我无法弄清楚懒惰评价在哪里比内在更好,反之亦然? 有人可以提供一个例子吗?
I thought racket does inner reduction always for evaluation but I found out e.g. "if" (and cond?!) is lazy evaluation in racket...why is this needed?
Is it impossible to realize an if-statement via inner reduction?
I can not figure out where lazy evaluation is better than inner and vice versa? Could someone supply an example?
原文:
最满意答案
您似乎有一些自动安装服务正在运行,它会检测闪存盘并安装分区。 但是,您已经知道该分区是什么,所以我建议您只需在脚本中安装磁盘,自己选择合适的安装点。
mkfs.vfat -I -F32 -n "LABELNAME" /dev/sdb echo "Format complete, remounting" mount /dev/sdb $mountpoint #<-- you would choose $mountpoint echo "Running make master." perl /home/labelname_master.20120830.pl
It seems that you have some automatic mounting service running which detects the flash disk and mounts the partition. However, you already know what the partition is, so I recommend that you simply mount the disk in your script, choosing a suitable mount point yourself.
mkfs.vfat -I -F32 -n "LABELNAME" /dev/sdb echo "Format complete, remounting" mount /dev/sdb $mountpoint #<-- you would choose $mountpoint echo "Running make master." perl /home/labelname_master.20120830.pl
相关问答
更多-
Linux下如何挂载usb硬盘?[2022-10-21]
fdisk -l → 磁盘标识符mount -o iocharset = gb2312 磁盘标识符 /mnt格式:mount 参数 目标标识符 挂接点 -o iocharset = gb2312 //以简体中文方式挂接文件系统 -o ro // 以只读方式挂接文件系统 -o rw // 以读写方式挂接文件系统 -o wid=用户ID // 修改挂接文件系统的所有者 -o gid=组ID // 修改挂接文件系统的组 -
Linux下的命令与Linux的shell script有什么不同?[2022-07-03]
linux的shell script 是有命令加一些条件组合起来的 可以多关注《Linux就该这么学》这本书,我都是从这里面学到的 -
我如何控制Linux中USB端口的电源输出?(How would I control the output of the power in USB ports in Linux?)[2022-11-29]
USB电压固定在标称的5伏特上,不能被控制。 USB设备关于其电流消耗的行为在USB规范中已有明确定义。 除非USB设备已经从USB主机协商出更高的负载,否则USB设备应该消耗1个单位负载(100mA)。 很有可能您所拥有的伺服电机需要耗费更高的电流,并且如果不是USB设备并与主机协商,将无法请求伺服电机。 根据您试图控制的伺服电机,也可能需要提供PWM信号或模拟电压来控制电机位置。 USB主机不打算提供这些。 从电脑驱动电机的最佳选择是: 为您的伺服电机获取一个专用的USB控制器(如果有的话) 根据一个小 ... -
Linux USB恐怖(Linux USB horror)[2022-05-29]
显然发生了I / O错误,内核决定卸载设备并再次检测它。 它可能反过来了:设备被移除(通过USB子系统)并导致错误,因为它仍然被挂载。 这看起来像是一个硬件问题 - AFAIK设备检测和删除是在主机控制器或集线器的硬件中完成的。 检查电缆和连接,包括焊接连接。 用示波器观察USB上的+5伏电压也很有价值 - 电压可能超出规格几毫秒,导致USB复位。 Apparently an I/O error occurred and the kernel decided to unmount the device an ... -
在C ++中卸载USB驱动器(unmount USB drive in C++)[2022-09-10]
卸载文件系统需要适当的权限(Linux: CAP_SYS_ADMIN功能)。 每次umount代码umount 。 但是,您需要特权才能卸载设备。 CAP_SYS_ADMIN功能允许进程执行各种管理任务,即:调用mount(),umount()。 这里有两篇关于功能的文章: CAP_SYS_ADMIN:新根 Linux功能概述(功能列表) Appropriate privilege (Linux: the CAP_SYS_ADMIN capability) is required to unmount fi ... -
我会建议一个类似下面的解决方案: using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; ///
/// Represents our program class which contains the entry point of our application. /// public cla ... -
我发现这段代码完全符合我的需要: foreach (const QStorageInfo &storage, QStorageInfo::mountedVolumes()) { qDebug() << storage.rootPath(); if (storage.isReadOnly()) qDebug() << "isReadOnly:" << storage.isReadOnly(); qDebug() << "name:" << storage.name(); ...
-
UPDATE 正如Chris Stratton在评论中指出的那样,这个问题与OTG无关。 我试图读取的设备是FAT12文件系统,该手机不支持。 在与公司的工程师联系后,我正在尝试连接设备,我终于得到了答案。 USB OTG是USB协议的扩展。 如果设备不支持OTG扩展(此特定设备没有)并且Android上的USB大容量存储驱动程序需要这些扩展,则主机将无法成功枚举USB设备。 UPDATE As pointed out by Chris Stratton in the comments, the issue ...
-
这似乎与/proc/partitions和ephimient采用的/sys/class/block方法相结合。 #!/usr/bin/python import os partitionsFile = open("/proc/partitions") lines = partitionsFile.readlines()[2:]#Skips the header lines for line in lines: words = [x.strip() for x in line.split()] ...
-
在Linux Shell脚本中准备好时检测USB拇指驱动器(Detecting USB Thumb Drive when Ready in Linux Shell Script)[2023-09-02]
您似乎有一些自动安装服务正在运行,它会检测闪存盘并安装分区。 但是,您已经知道该分区是什么,所以我建议您只需在脚本中安装磁盘,自己选择合适的安装点。 mkfs.vfat -I -F32 -n "LABELNAME" /dev/sdb echo "Format complete, remounting" mount /dev/sdb $mountpoint #<-- you would choose $mountpoint echo "Running make master." perl /home/labe ...