k*y
2 楼
刚买的x220,用displayport口转HDMI接到电视上可以输出图像,但就是没有声音。
大家有类似问题吗?
大家有类似问题吗?
d*e
3 楼
请教一个C++ 的 iterator 问题。
假设有多个 streams, 找到那些至少有k 个stream 有的数。
我设了个Stream 类, 但是那个 bool move() 有问题,
iterator 到了尾部后, it != nums.end() 还是 true;
给的例子应该输出 3, 然后停止,但是运行却不是想象的。
谢谢。
#include
#include
#include
using namespace std;
class Stream{
private:
vector nums;
public:
vector::iterator it;
Stream(vector v): nums(v) {
it = nums.begin();
}
bool move(){
return it != nums.end();
}
int getValue(){
++it;
return *it;
}
};
class Comp{
public:
bool operator()(Stream& s1, Stream& s2){
return *(s1.it) > *(s2.it);
}
};
class Merge_stream{
private:
priority_queue, Comp> pq;
public:
vector find_nums(vector streams, int k){
vector res;
if (streams.size() == 0) return res;
for (int i = 0; i < streams.size(); ++i){
if (streams[i].move())
pq.push(streams[i]);
}
while (!pq.empty()){
Stream cur_s = pq.top();
pq.pop();
int cur_val = *(cur_s.it);
int count = 1;
while (cur_s.move() && cur_s.getValue() == cur_val);
if (cur_s.move())
pq.push(cur_s);
// deal with other streams with the same vals
while (!pq.empty() && cur_val == *(pq.top().it)){
++count;
Stream cur_top = pq.top();
pq.pop();
while (cur_top.move() && cur_top.getValue() == cur_val);
if (cur_top.move())
pq.push(cur_top);
}
if (count >= k)
res.push_back(cur_val);
}
return res;
}
};
int main(){
vector v1 = {1, 2, 2, 3};
vector v2 = {0, 1, 3};
vector v3 = {0, 2, 3};
Stream s1(v1);
Stream s2(v2);
int a = -1;
for (int i = 0; i < 4; ++i){
if (s2.move())
a = s2.getValue();
}
Stream s3(v3);
vector s = {s1, s2, s3};
Merge_stream m;
vector res;
res = m.find_nums(s, 3);
return 0;
}
假设有多个 streams, 找到那些至少有k 个stream 有的数。
我设了个Stream 类, 但是那个 bool move() 有问题,
iterator 到了尾部后, it != nums.end() 还是 true;
给的例子应该输出 3, 然后停止,但是运行却不是想象的。
谢谢。
#include
#include
#include
using namespace std;
class Stream{
private:
vector
public:
vector
Stream(vector
it = nums.begin();
}
bool move(){
return it != nums.end();
}
int getValue(){
++it;
return *it;
}
};
class Comp{
public:
bool operator()(Stream& s1, Stream& s2){
return *(s1.it) > *(s2.it);
}
};
class Merge_stream{
private:
priority_queue
public:
vector
vector
if (streams.size() == 0) return res;
for (int i = 0; i < streams.size(); ++i){
if (streams[i].move())
pq.push(streams[i]);
}
while (!pq.empty()){
Stream cur_s = pq.top();
pq.pop();
int cur_val = *(cur_s.it);
int count = 1;
while (cur_s.move() && cur_s.getValue() == cur_val);
if (cur_s.move())
pq.push(cur_s);
// deal with other streams with the same vals
while (!pq.empty() && cur_val == *(pq.top().it)){
++count;
Stream cur_top = pq.top();
pq.pop();
while (cur_top.move() && cur_top.getValue() == cur_val);
if (cur_top.move())
pq.push(cur_top);
}
if (count >= k)
res.push_back(cur_val);
}
return res;
}
};
int main(){
vector
vector
vector
Stream s1(v1);
Stream s2(v2);
int a = -1;
for (int i = 0; i < 4; ++i){
if (s2.move())
a = s2.getValue();
}
Stream s3(v3);
vector
Merge_stream m;
vector
res = m.find_nums(s, 3);
return 0;
}
n*7
5 楼
试试重装声卡驱动
h*e
7 楼
我这里也挂了。不知道TXBB还能不能找到合适的源。Sigh.
k*y
8 楼
刚重装了最新的声卡驱动,还是不行。好像网上很多人都有类似问题。
还有其他方法吗?
还有其他方法吗?
t*e
9 楼
When the iterator points to the last element in vector, not vector.end() in
move, the move() function returns true; then in getValue(), iterator points
to vector.end() after ++iterator, then getValue() will try to return vector.
end().
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 请教一个C++ 的 iterator 问题。
: 假设有多个 streams, 找到那些至少有k 个stream 有的数。
: 我设了个Stream 类, 但是那个 bool move() 有问题,
: iterator 到了尾部后, it != nums.end() 还是 true;
: 给的例子应该输出 3, 然后停止,但是运行却不是想象的。
: 谢谢。
: #include
: #include
: #include
: using namespace std;
move, the move() function returns true; then in getValue(), iterator points
to vector.end() after ++iterator, then getValue() will try to return vector.
end().
【在 d******e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 请教一个C++ 的 iterator 问题。
: 假设有多个 streams, 找到那些至少有k 个stream 有的数。
: 我设了个Stream 类, 但是那个 bool move() 有问题,
: iterator 到了尾部后, it != nums.end() 还是 true;
: 给的例子应该输出 3, 然后停止,但是运行却不是想象的。
: 谢谢。
: #include
: #include
: #include
: using namespace std;
t*b
10 楼
新闻台我修复了。
挖节目源主要就是时间问题。现在cntv不让人随便用了,地址经常的变。
挖节目源主要就是时间问题。现在cntv不让人随便用了,地址经常的变。
n*7
11 楼
我是一用msn就没声音了,然后删了声卡,让系统自己找到驱动就好了。
你这个不清楚了。
你这个不清楚了。
m*o
12 楼
int getValue(){
return *it++;
}
return *it++;
}
h*e
13 楼
谢谢TXBB。至少能看新闻台了。
我还是不清楚怎么找这种直播的节目源。
我还是不清楚怎么找这种直播的节目源。
k*y
14 楼
谢谢!我用msn倒是没有出现声音的问题。
刚才google了下,貌似很多人有类似的问题,但还没有解决方法。
刚才google了下,貌似很多人有类似的问题,但还没有解决方法。
d*e
15 楼
c*7
16 楼
display port能输出呻吟?
s*n
18 楼
所以叫displayport嘛。就是不带声音只有display。
lenovo变态。。搞这个接口,没有外设用。
lenovo变态。。搞这个接口,没有外设用。
s*9
19 楼
T420s评测中说“SIIG DisplayPort to HDMI Adapter adapter works”
http://www.wfu.edu/~yipcw/lenovo/2011/T420s/review/
估计X220也一样
http://www.wfu.edu/~yipcw/lenovo/2011/T420s/review/
估计X220也一样
d*i
21 楼
看这个帖子:
http://forum.notebookreview.com/lenovo-ibm/578530-x220-video-au
through-displayport.html
【在 k******y 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 谢谢!我用msn倒是没有出现声音的问题。
: 刚才google了下,貌似很多人有类似的问题,但还没有解决方法。
http://forum.notebookreview.com/lenovo-ibm/578530-x220-video-au
through-displayport.html
【在 k******y 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 谢谢!我用msn倒是没有出现声音的问题。
: 刚才google了下,貌似很多人有类似的问题,但还没有解决方法。
相关阅读
Delphi/Object Pascal杀回来了?scala也花样作死问wdong一个问题,学习openGL从哪儿开始学好大家看看这样一个工作值多少钱?准备开始练scala[bssd]Functional programming的一个好处现在下载电影最好的方式lightroom请科普下双路deep learning人类的灵感都是从已知的内容中来的吧Is your password safe?变量就是个酱油瓶子安全数据传输的自动处理Kaggle速度好慢啊,还总掉线weidong, Jianxiong Xiao是你一个实验室?好牛啊nkw,nowhere7, 请问你们用F#是做什么应用的?[bssd]教小孩计算机最难的地方...大家平时工作之余怎么学习技术,什么时候学维护一个热门视频榜单的apipython JIT还是没有能实用的啊板上非科班的码农多吗