解决:Google搜索结果经ecosia.org跳转

问题描述

通过Google搜索网页的时候,打开搜索结果的时候,会首先跳转到一个ecosia.org,然后才跳转到真正的网址。

下面看图:

图1:

googlesearchresult1
image-1981

图2:

googlesearchresult2
image-1982

解决方案

猜测就是某个扩展导致的.解决方案如下:

在Chrome上安装了Window Resizer这个扩展的就会有这个问题.

  1. 在chrome打开:chrome-extension://kkelicaakdanhinjdeammmilcgefonfh/ecosia.html
  2. Enable EcoLinks :取消掉复选框.
  3. 就可以了.

googlesearchresult3
image-1983

部分资料来自网络.

C++:vector元素转换大小写

题目

  1. 读取一段文本到vector
  2. 每个单词存储为vector的一个元素.
  3. 把vector中每个单词转化为大写字母.
  4. 输出vector对象中转化后的元素.
  5. 每八个单词为一行输出

分析

  1. 第一,二不解释.
  2. C++里面的toupper(c)和Java里面的toUpperCase()最大的区别是:C++是转换单个字符,而Java的则是转换一个字符串
  3. 后面的不解释了.

C++.
image-1979

源代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*************************************************************************
    > File Name: test.3.14.cpp
    > Author: puruidong
    > Mail: 1@w1520.com
    > Created Time: 2013年12月22日 星期日 00时52分56秒
 ************************************************************************/

#include<iostream>
#include<vector>
#include<string>
using namespace std;
using std::string;

int main()
{
    vector<string> message;
    cout << "input message?" << endl;
    string mess ;
    while(cin >> mess){
        message.push_back(mess);
    }
    if(message.size()<7){
        cout << " error , >8 character " << endl;
        return -1;
    }
    for(vector<string>::size_type index=0;index!=message.size();++index){
        for (vector<string>::size_type toup = 0;toup<message[index].size();++toup){    
           
        ((message[index])[toup])=toupper((message[index])[toup]);
        cout <<   ((message[index])[toup]);
        }
        cout << "\t" ;
        if(index==7){
            cout <<  "\n" << endl;
        }
    }
    return 0;
}

C++:vector头尾数字相加

题目

  1. 将所有数据读入到vector;
  2. 使用循环对数字进行添加,并且输出.
  3. 当数字为奇数时,输出没有被加的那个数字.

分析

  1. 第一个简单.
  2. 第二个需要做的是,让首尾相加,不能多加,也不能少加.因此可以判断是否循环已经到了整个vector的数字的一半.
  3. 另外一个比较复杂的问题是:当整个vector的总数是奇数时,中间的那个数字就没有可以加的数字了,就直接输出就行.

C++.
image-1977

源代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*************************************************************************
    > File Name: test.3.13.1.cpp
    > Author: puruidong
    > Mail: 1@w1520.com
    > Created Time: 2013年12月21日 星期六 22时40分05秒
 ************************************************************************/

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int var ;
    vector<int> ivec;
    cout << "input number?" << endl;
    while(cin >> var ){
        ivec.push_back(var);
    }
    for (vector<int>::size_type index=0;index<(ivec.size()+1)/2;++index){//前后相加.
        if(index!=ivec.size()/2){  
        cout <<
        "\njieguo?\n" <<
         ivec[index] + ivec[ivec.size()-(index+1)] << endl;
        }else{
        cout << "is one number :" <<
        ivec[ivec.size()/2] << endl;
        }
    }

    return 0;
}