nxt

java eclipse: failed to load nxt usb comm driver

寵の児 提交于 2019-12-13 01:29:38
问题 I have problems with java eclipse indigo, the plugin lejos for the nxt brick. The problem is that i have installed the hole software/drivers which i need to program it. operating system: windows 7 But the console say following: Linking ... Program has been linked successfully Uploading ... leJOS NXJ> Error: Failed to load USB comms driver. leJOS NXJ> Caused by lejos.pc.comm.NXTCommException: Cannot load NXTComm driver leJOS NXJ> at lejos.pc.comm.NXTCommFactory.newNXTCommInstance

How to make local USB port to work with Azure virtual machine

风格不统一 提交于 2019-12-10 18:05:33
问题 I am new to Azure, I want to connect my local USB port to Azure VM (for debugging apps), how can I do this? If I can connect local USB (USB of my PC) to Azure VM , I can make 100% use of Azure as PC, and I can run apps without any problem. Please help out doing this. 回答1: simply right click on the rdp file and click on edit and select local resource there you can find option called ports 回答2: Expanding on the answer above - you can also configure under Drives the option so that all new USBs

How to calibrate the Lego NXT color sensor with LeJos NXJ?

寵の児 提交于 2019-12-10 11:29:12
问题 I'm currently writing on a program about detecting different colored balls and sorting them with the Lego NXT and its color sensor. At the beginning it worked quite good but now, the color sensor always returnes the color ID "7" (white), no matter what i do. On the documentation page i found something about a calibration (calibrateHigh() and calibrateLow()). Does anybody know how to use this calibration or is my color sensor broken? I tried it with this code: package com.mydomain; import

Luogu2375 [NOI2014]动物园 (KMP)

纵然是瞬间 提交于 2019-12-09 13:03:40
写炸,上网,不同KMP形态。 无力,照该,一换写法就过。 横批:我是垃圾 求 \(next\) 时 \(DP\) 出 \(num\) ,路径压缩防卡 \(n^2\) AC #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define R(a,b,c) for(register int a = (b); a <= (c); ++ a) #define nR(a,b,c) for(register int a = (b); a >= (c); -- a) #define Max(a,b) ((a) > (b) ? (a) : (b)) #define Min(a,b) ((a) < (b) ? (a) : (b)) #define Fill(a,b) memset(a, b, sizeof(a)) #define Abs(a) ((a) < 0 ? -(a) : (a)) #define Swap(a,b) a^=b^=a^=b #define ll long long #define ON_DEBUG #ifdef ON_DEBUG #define D_e_Line printf("\n\n----------\n\n") #define D

HDUNumber Sequence(KMP)

妖精的绣舞 提交于 2019-12-08 12:55:39
传送门 题目大意:b在a第一次出现的位置 题解:KMP 代码: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define N 1000008 #define M 10009 using namespace std; int T; int a[N],b[M]; int nxt[M]; int lena,lenb; void getnext() { memset(nxt,0,sizeof(nxt)); for(int i=2,j=0;i<=lenb;i++) { while(b[i]!=b[j+1]&&j) j=nxt[j]; if(b[i]==b[j+1]) nxt[i]=++j; } } int KMP() { getnext(); // for(int i=0;i<=lenb;i++) cout<<i<<"---"<<nxt[i]<<endl; for(int i=1,k=0;i<=lena;i++) { for(;a[i]!=b[k+1]&&k;k=nxt[k]); if(a[i]==b[k+1])++k; if(k==lenb) return i-lenb+1; } return -1; } int main() { scanf("%d",&T); while(T--)

Lego Mindstorm NXT 2.0: “Error: NXT Bluetooth passkey confirmation failed”

不羁岁月 提交于 2019-12-07 18:48:23
问题 Running Windows 7 and the Lego Mindstorms NXT 2.0 IDE. The Windows bluetooth manager shows the NXT is connected and the NXT shows up in the Windows list of bluetooth devices. When I try to connect from the Lego IDE, however, I get a message that says "Error: NXT Bluetooth passkey confirmation failed". I entered the pairing key on the NXT and within Windows with no problems. The problem is when I am in the IDE trying to connect to the NXT. Any suggestions? Update - January 8, 2010 I have it

KMP算法模板

拟墨画扇 提交于 2019-12-07 12:53:24
1.啥是KMP算法? KMP算法是一种改进的字符串匹配算法,由D.E.Knuth,J.H.Morris和V.R.Pratt提出的,因此人们称它为克努特—莫里斯—普拉特操作(简称KMP算法)。KMP算法的核心是利用匹配失败后的信息,尽量减少模式串与主串的匹配次数以达到快速匹配的目的。具体实现就是通过一个next()函数实现,函数本身包含了模式串的局部匹配信息。KMP算法的时间复杂度O(m+n)。(源自 百度百科 ) 2.代码 #include<bits/stdc++.h> using namespace std; int nxt[1005]; void GetNext(string p) { int pLen=p.length(); nxt[0]=-1; int k=-1; int j=0; while (j<pLen-1) { if(k==-1||p[j]==p[k]) { ++k; ++j; nxt[j] = k; } else k=nxt[k]; } } int KMP1(string s,string p)//返回位置 { int i=0,j=0,sLen=s.length(),pLen=p.length(); GetNext(p); while(i<sLen&&j<pLen) { if(j==-1||s[i]==p[j]) { i++; j++; } else j=nxt

Lego Mindstorm NXT 2.0: “Error: NXT Bluetooth passkey confirmation failed”

只愿长相守 提交于 2019-12-06 13:20:23
Running Windows 7 and the Lego Mindstorms NXT 2.0 IDE. The Windows bluetooth manager shows the NXT is connected and the NXT shows up in the Windows list of bluetooth devices. When I try to connect from the Lego IDE, however, I get a message that says "Error: NXT Bluetooth passkey confirmation failed". I entered the pairing key on the NXT and within Windows with no problems. The problem is when I am in the IDE trying to connect to the NXT. Any suggestions? Update - January 8, 2010 I have it working on one computer. It's a desktop PC running Windows 7 Ultimate 32-bit. Same BT adapter, I just

How to calibrate the Lego NXT color sensor with LeJos NXJ?

孤街醉人 提交于 2019-12-06 11:09:49
I'm currently writing on a program about detecting different colored balls and sorting them with the Lego NXT and its color sensor. At the beginning it worked quite good but now, the color sensor always returnes the color ID "7" (white), no matter what i do. On the documentation page i found something about a calibration (calibrateHigh() and calibrateLow()). Does anybody know how to use this calibration or is my color sensor broken? I tried it with this code: package com.mydomain; import lejos.nxt.*; public class HelloWorld { public static void main(String[] args) throws Exception {

洛谷 UVA1328 Period

匆匆过客 提交于 2019-12-05 20:26:27
洛谷 UVA1328 Period 洛谷传送门 题目描述 PDF 输入格式 无 输出格式 无 题意翻译 题意描述 对于给定字符串S的每个 前缀 ,我们想知道它是否为周期串。也就还是说,它是否为某一字符串重复连接而成(必须至少重复2次)(即循环节)。 输入 多组数据。每组数据,第一行一个数字表示长度,第二行一个字符串S。 输出 输出前缀长度与循环节数量。 说明 字符串长度不超过1000000,仅由小写字母组成。 对于每个前缀,只要输出 长度最小的 循环节 输入输出样例 无 一道KMP算法的练手好题。 大体的题目大意是这样的: 题目大意: 如果一个字符串S是由一个字符串T重复K次形成的,则称T是S的循环元。使K最大的字符串T称为S的最小循环元,此时的K称为最大循环次数。 现给一个给定长度为N的字符串S,对S的每一个前缀S[1~i],如果它的最大循环次数大于1,则输出该前缀的最小循环元长度和最大循环次数。 题解: 一道KMP算法的题目,如果对KMP算法还是没有什么深刻的理解或者还没学KMP算法的,请移步我的这篇博客,讲解还算详细: KMP算法详解 一开始拿到题没什么思路(我还是太菜了) 后来发现,对给出的串 \(S\) 自匹配求出 \(nxt\) 数组之后,对于每一个 \(i\) ,一定会有这么一个结论: \[ S[1\,\,to\,\,nxt[i]]=S[i-nxt[i]+1\,\