从android应用程序写入usb端口(Write to usb port from android application)
我正在编写一个Android应用程序,需要从Android应用程序向PC的USB端口(Windows / Linux)写入一些数据。 我搜索了很多,找不到任何关于如何进行这种沟通的线索。 无论如何都可以这样做吗? 你能给我一些例子或者什么来帮忙吗?
I am writing an android application and need to write some data to PC's USB port (Windows/Linux) from android application. I've searched a lot and cannot find any clue about how to do this kind of communication. Is it possible to do this in anyway? Can you suggest me some example or something to help?
原文:https://stackoverflow.com/questions/42300506
最满意答案
映射器的输入类型由您怀疑的InputFormat设置。
通常,当您像这样将作业链接在一起时,最好使用
SequenceFileOutputFormat
并在下一个作业SequenceFileInputFormat
。 这样就可以为您处理类型,并将类型设置为相同,即映射器输入与先前的reducer输出相同。The input types to your mapper are set by the InputFormat as you suspect.
Generally when you're chaining jobs together like this, its best to use
SequenceFileOutputFormat
and in the next jobSequenceFileInputFormat
. This way the types are handled for you and you set the types to be the same, ie the mappers inputs are the same as the previous reducers outputs.
相关问答
更多-
hadoop中的IntWritable和Text是指什么?[2023-12-31]
你可以理解为int 和string -
映射器的输入取决于使用什么InputFormat。 InputFormat负责读取传入数据并将其转换为Mapper预期的格式。默认的InputFormat是TextInputFormat ,它扩展了FileInputFormat
。 如果您不更改InputFormat,则使用带有不同键值类型签名而不是 的Mapper将导致此错误。 如果您期望 输入,您将不得不选择适当的InputFormat。 您可以在作业设 ... -
在Hadoop中将相同的密钥传递给Mapper时会发生什么(What happens when identical keys are passed to the Mapper in Hadoop)[2022-05-05]
输入拆分是由单个映射处理的输入块。 每个地图处理一次拆分。 每个拆分都分为记录,地图依次处理每个记录 - 一个键值对。 因此映射器将具有相同密钥的记录视为单独的记录。 An input split is a chunk of the input that is processed by a single map. Each map processes a single split. Each split is divided into records, and the map processes each ... -
Hadoop流式作业执行中映射器的“文本文件繁忙”错误(“Text file busy” error for the mapper in a Hadoop streaming job execution)[2023-04-28]
你能否先尝试使用'stop-all'停止所有守护进程,然后在重启守护进程后重新运行你的MR作业(使用'start-all')? 让我们看看它是否有帮助! Can you please try stopping all the daemons using 'stop-all' first and then rerun your MR job after restarting the daemons (using 'start-all')? Lets see if it helps! -
Hadoop - 未加载的IntWritable(int)构造函数[关闭](Hadoop - IntWritable(int) constructor not loaded [closed])[2021-08-24]
Yout缺少new关键字。 在线 context.write(wordKey, IntWritable(Integer.parseInt(s))); 您没有创建IntWritable的实例,而是尝试调用未定义的名为IntWritable的方法。 尝试这个: context.write(wordKey, new IntWritable(Integer.parseInt(s))); Yout are missing the new keyword. In the line context.write(wor ... -
InputFormat描述了Map-Reduce作业的输入规范。默认情况下,hadoop使用继承FileInputFormat TextInputFormat来处理输入文件。 我们还可以指定要在客户端或驱动程序代码中使用的输入格式: job.setInputFormatClass(SomeInputFormat.class); 对于TextInputFormat ,文件分为几行。 键是文件中的位置,值是文本行。 在public void map(Object key, Text value, Contex ...
-
你确定你正在使用单个映射器吗? 因为Hadoop创建了许多非常接近输入分割数量的映射器( 更多详细信息 )。 输入拆分的概念也非常重要:它意味着非常大的数据文件被分成几个块,每个块分配给一个映射器。 因此,除非您完全确定只使用了一个映射器,否则您将无法控制您正在处理的文件的哪一部分,并且您将无法控制任何种类的全局索引。 据说,在MapReduce中使用单个映射器与在所有情况下使用MapReduce相同:)也许错误是我的,我假设你只有一个文件需要分析,是这种情况吗? 如果您有几个大数据文件,情景会发生变化,为 ...
-
映射器的输入类型由您怀疑的InputFormat设置。 通常,当您像这样将作业链接在一起时,最好使用SequenceFileOutputFormat并在下一个作业SequenceFileInputFormat 。 这样就可以为您处理类型,并将类型设置为相同,即映射器输入与先前的reducer输出相同。 The input types to your mapper are set by the InputFormat as you suspect. Generally when you're chaining ...
-
首先, ReducerStreaming使用旧的API( org.apache.hadoop.mapred ) - 但mapper和reducer类扩展了新的API类( org.apache.hadoop.mapreduce )。 尝试更改映射器以实现org.apache.hadoop.mapred.Mapper和reducer以实现org.apache.hadoop.mapred.Reducer ,例如: package courseproj.example; // Mapper: emits ("article", 1) ...
相关文章
更多- Professional Android 4 Application Development
- Quitting an application - is that frowned upon?
- 《安卓开发(尚观科技)》(Android Application Professional Development )更新至第27集[MP4]
- 《Android内核剖析》扫描版[PDF]
- Chapter 9 - Securing Your Application -- Professional ASP.NET MVC 1.0
- Android 使用隐藏API 开发应用程序
- Windows Moible, Wince 使用.NET Compact Framework的进行蓝牙(Bluetooth)开发 之 蓝牙虚拟串口 (Bluetooth Virtual Serial Port)
- Android精品软件汇总(不断更新)
- android 集成所有分享平台
- HTML5应用缓存(application cache)【HTML5教程 - 第十二篇】
最新问答
更多- 您如何使用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)