首页 \ 问答 \ 极限编程冒险在C#勘误?(Errata in Extreme Programming Adventures in C#?)

极限编程冒险在C#勘误?(Errata in Extreme Programming Adventures in C#?)

我试图通过Ron Jeffries在C#中的极限编程冒险工作。 然而,我在第3章中被卡住了,因为代码没有, 也不能做作者说的那样。

基本上,文字说我应该能够在启用文字包装的文本框中编写一些文本。 如果我然后将光标移动到中间行并按回车键,则代码应该重新显示光标前面的行,添加几行和一组HTML段落标记,然后附加其余行。 代码与文本不匹配,因为它使用了textbox.lines属性。 那么,无论文本框中有多少个文字包装线,在Lines属性中只有一行,直到您按回车。 因此,代码应该“将其余行复制到缓冲区中”的说法对我来说似乎是错误的。

我会很感激任何有这本书经验的人告诉我我在读什么,或者在做什么,错的!

谢谢。

始盗龙


I'm trying to work my way through Ron Jeffries's Extreme Programming Adventures in C#. I am stuck, however, in Chapter 3 because the code does not, and cannot, do what the author says it does.

Basically, the text says that I should be able to write some text in a word-wrap enabled text box. If I then move the cursor to an intermediate line and hit enter, the code should re-display the lines before the cursor, add a couple of lines and a set of HTML paragraph tags, then append the rest of the lines. The code doesn't match the text because it uses the textbox.lines property. Well, no matter how many word-wrapped lines there are in a text box, there's only ONE line in the Lines property until you hit a carriage return. So, the statement that the code should, "Copy the rest of the lines into the buffer" appears wrong to me.

I'd appreciate anybody having experience with the book telling me what I'm reading, or doing, wrong!

Thanks.

EoRaptor


原文:https://stackoverflow.com/questions/310164
更新时间:2022-01-15 08:01

最满意答案

按照上面cricket_007的建议,我开始挖掘Android Studio,看它是否会报告安装命令。 我找到了命令,将它们放在一个shell脚本文件中,现在我可以将apk安装到四个磨损设备上。 首先,在Android Studio中,我转到:Build | 建立APK。 生成穿戴apk文件。 然后我使用以下命令执行shell脚本:

echo "Installing 422E..."
adb -s G6NZCJ00401422E push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ00401422E shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 422E..."
adb -s G6NZCJ00401422E shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER


echo "Installing 6227..."
adb -s G6NZCJ004076227 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ004076227 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 6227..."
adb -s G6NZCJ004076227 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER


echo "Installing 922a..."
adb -s G5NZCJ02746922A push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G5NZCJ02746922A shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 922A..."
adb -s G5NZCJ02746922A shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."

echo "Installing Moto…”
adb -s localhost:4444 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s localhost:4444 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting Moto…”
adb -s localhost:4444 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."

当然,这也可以扩展到安装移动应用程序。 我确信我可以找到gradle命令来实际编译.apk文件作为脚本的一部分。 如果我发现了,我也会发布它。


Following the recommendations above from cricket_007, I started digging around Android Studio to see if it would report the commands for installation. I found the commands, put them in a shell script file and am now able to install the apk to four wear devices at once. So first, in Android Studio, I go to: Build | Build APK. The generates the wear apk file. Then I execute a shell script with the following commands:

echo "Installing 422E..."
adb -s G6NZCJ00401422E push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ00401422E shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 422E..."
adb -s G6NZCJ00401422E shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER


echo "Installing 6227..."
adb -s G6NZCJ004076227 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G6NZCJ004076227 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 6227..."
adb -s G6NZCJ004076227 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER


echo "Installing 922a..."
adb -s G5NZCJ02746922A push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s G5NZCJ02746922A shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting 922A..."
adb -s G5NZCJ02746922A shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."

echo "Installing Moto…”
adb -s localhost:4444 push /Users/fred/abcdec/apps/myWearApp/wear/build/outputs/apk/wear-debug.apk /data/local/tmp/com.xyz.myWearApp
adb -s localhost:4444 shell pm install -r "/data/local/tmp/com.xyz.myWearApp"
echo "Starting Moto…”
adb -s localhost:4444 shell am start -n "com.xyz.myWearApp/com.xyz.myWearApp.MainWearActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
echo "Done."

Of course, this could be extended to install the mobile app as well. I'm sure that I can find the gradle command to actually compile the .apk file as part of the script. If I find that, I will also post it.

相关问答

更多
  • Android Studio是否有用于设置.gradle文件内容的GUI或是否必须通过手动编辑完成所有操作? 可以通过Android Studio主菜单中的文件>项目结构配置一些内容。 但是,Gradle基于Groovy脚本语言,因此在“项目结构”对话框中有很多事情是您无法做到的。 如果是后者,Android Studio是否有一个可以标记语法错误的gradle-aware源编辑器等? 是。 Does Android Studio have a GUI for setting the things that ...
  • 注意 :这个答案是一个纯粹的Gradle答案,我在IntelliJ中定期使用这个答案,但是我不知道Android Studio是如何集成的。 我相信知道我正在发生什么,所以这是我如何使用Gradle和Android。 TL; DR完整示例 - https://github.com/ethankhall/driving-time-tracker/ 免责声明 :这是我正在/正在开展的项目。 Gradle有一个定义的结构(你可以改变,底部的链接告诉你怎么样),如果你曾经使用过,这与Maven非常相似。 Proje ...
  • 您未明确包含的库有时可以传递到您的构建中 - 例如,您添加的库依赖于另一个库。 您可以运行gradle dependencies来显示gradle dependencies树,以分析哪些依赖关系拉入哪些传递依赖关系。 I figured out the issue it was the stax-api-1.0.jar this included the javax.xml.stream.events.* classes after removing the jar i was able to build ...
  • 看起来解决方法是将SDK工具降级到版本25.2.5。 可以从这里下载。 对于我的环境,我保留了两个版本的SDK工具,使用符号链接在它们之间切换: tools -> /c/devtools/Android/SDK/tools.25.2.5 tools.25.2.5 tools.26.0.2 Looks like workaround is to downgrage SDK tools to the version 25.2.5. Can be downloaded from h ...
  • 菜单位于“文件”>“项目结构”下。 然后从左侧列表中选择您的模块,切换到签名选项卡,然后添加您的签名信息。 这将对build.gradle进行两处更改: 首先,它会添加一个看起来像这样的signingConfigs {}部分 - signingConfigs { release { storeFile file("your.keystore") storePassword 'mySecreKystorePassword' keyAlias 'myKey ...
  • 您需要为每个不同的目标创建一个运行xcodebuild的脚本,其中包含不同的参数。 还有Application Loader的命令行工具,它允许您扩展此脚本以自动将二进制文件上载到应用商店。 You need to create a script which runs xcodebuild with different arguments for each of the different targets. There is also Application Loader’s command-line to ...
  • 按照上面cricket_007的建议,我开始挖掘Android Studio,看它是否会报告安装命令。 我找到了命令,将它们放在一个shell脚本文件中,现在我可以将apk安装到四个磨损设备上。 首先,在Android Studio中,我转到:Build | 建立APK。 生成穿戴apk文件。 然后我使用以下命令执行shell脚本: echo "Installing 422E..." adb -s G6NZCJ00401422E push /Users/fred/abcdec/apps/myWearApp/ ...
  • 错误:(14,25)找不到与给定名称匹配的资源(在'label'处,值为'@ string / Midgar-Flower-Girl')。 这意味着Android Studio在res/values/strings.xml文件夹中找不到@string/Midgar-Flower-Girl 。 我该如何纠正这个问题? 确保你的res/values/strings.xml有一个名为Midgar-Flower-Girl的string ,如果你这样做,也许最好的解决办法是清理代码 Error:(14, 25) No ...
  • 在teamcity构建步骤中试试这个。 在两个构建步骤中使用相同的解决方案。 这是一个垃圾,但没有更好的。 buildstep0 runner类型:msbuild 命令行参数:/ p:Configuration = Debug buildstep1 runner类型:msbuild 命令行参数:/ p:Configuration = Release In teamcity build steps try this. In both build steps use the same solution. It' ...
  • 由于下载Gradle需要很长时间,当您的网络状况不佳时,您必须自行下载。 我的解决方案是: 1. 下载新版本的gradle ,例如gradle-4.3-all.zip等,并将文件放入AS Gradle位置( Mac :转到Application文件夹并打开AS的包,然后放入新的Gradle文件夹中的Gradle PS:如果你没有找到新的gradle版本文件夹,那么你可以自己创建。Windows :就像前面的两个答案一样); 2. 断开您的Wifi或LAN; 3.像往常一样打开Android Studio 3 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)