Ubuntu_Gedit配置

  • 为了换Ubuntu的时候能够更加方便,不用再用手重新打一遍代码,丢几个Gedit配置……

External Tools

  1. gdb compile (F2)

    #!/bin/sh
    fullname=$GEDIT_CURRENT_DOCUMENT_NAME
    name=`echo $fullname | cut -d. -f1`
    g++ -o $name $fullname -g -Wall -Wextra -D LOCAL
    gnome-terminal -x bash -c "gdb $name -silent;echo 'Nobody knows you better than I know...';read"
  2. compile (F3)

    #!/bin/sh
    fullname=$GEDIT_CURRENT_DOCUMENT_NAME
    name=`echo $fullname | cut -d. -f1`
    g++ $fullname -o $name -Wall -Wextra -D LOCAL
  3. run (F4)

    #!/bin/sh
    fullname=$GEDIT_CURRENT_DOCUMENT_NAME
    name=`echo $fullname | cut -d. -f1`
    dir=$GEDIT_CURRENT_DOCUMENT_DIR
    gnome-terminal -x bash -c "time $dir/$name; echo;echo 'Nobody knows you better than I know...';read"

Snippets

  1. fast read (Ctrl+R)

    namespace IO {
    const int N=1<<20;
    char buf[N],*l=buf,*r=buf;
    inline char gc() {
    if(l==r) r=(l=buf)+fread(buf,1,N,stdin);
    return l==r ? EOF : *(l++);
    }
    inline int read() {
    int x=0,s=1;
    char ch=gc();
    while(!isdigit(ch)) {if(ch=='-') s=-1;ch=gc();}
    while(isdigit(ch)) {x=x*10+(ch^48);ch=gc();}
    return x*s;
    }
    template <typename T>
    inline void read(T &x) {
    bool s=false;x=0;
    char ch=gc();
    while(!isdigit(ch)) {if(ch=='-') s=true;ch=gc();}
    while(isdigit(ch)) {x=x*10+(ch^48);ch=gc();}
    if(s) x=-x;
    }
    inline char readc() {
    char ch=gc();
    while(ch==' '||ch=='\n') ch=gc();
    return ch;
    }
    inline int reads(char *s) {
    char *point=s;*point=gc();
    while(*point==' '||*point=='\n') *point=gc();
    while(*point!=' '&&*point!='\n') *(++point)=gc();
    *point='\0';
    return point-s;
    }
    }
  2. fast basic code (Tab:include,Ctrl+B)

    #include <iostream>
    #include <cstdio> namespace IO {
    const int N=1<<20;
    char buf[N],*l=buf,*r=buf;
    inline char gc() {
    if(l==r) r=(l=buf)+fread(buf,1,N,stdin);
    return l==r ? EOF : *(l++);
    }
    inline int read() {
    int x=0,s=1;
    char ch=gc();
    while(!isdigit(ch)) {if(ch=='-') s=-1;ch=gc();}
    while(isdigit(ch)) {x=x*10+(ch^48);ch=gc();}
    return x*s;
    }
    template <typename T>
    inline void read(T &x) {
    bool s=false;x=0;
    char ch=gc();
    while(!isdigit(ch)) {if(ch=='-') s=true;ch=gc();}
    while(isdigit(ch)) {x=x*10+(ch^48);ch=gc();}
    if(s) x=-x;
    }
    inline char readc() {
    char ch=gc();
    while(ch==' '||ch=='\n') ch=gc();
    return ch;
    }
    inline int reads(char *s) {
    char *point=s;*point=gc();
    while(*point==' '||*point=='\n') *point=gc();
    while(*point!=' '&&*point!='\n') *(++point)=gc();
    *point='\0';
    return point-s;
    }
    } using namespace std;
    using IO::read;
    using IO::readc;
    using IO::reads; int main() {
    //#ifndef ONLINE_JUDGE
    #ifdef LOCAL
    freopen("c.in","r",stdin);
    //freopen("c.out","w",stdout);
    #endif
    //ios::sync_with_stdio(false);
    //cin.tie(0);cout.tie(0);
    $0
    return 0;
    } // by pycr
  3. read (Ctrl+Shift+R)

    inline int read() {
    int x=0,s=1;
    char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') s=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=x*10+(ch^48);ch=getchar();}
    return x*s;
    }
  4. basic code (Ctrl+Shift+B)

    #include <iostream>
    #include <cstdio> using namespace std; inline int read() {
    int x=0,s=1;
    char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') s=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') {x=x*10+(ch^48);ch=getchar();}
    return x*s;
    } int main() {
    //#ifndef ONLINE_JUDGE
    #ifdef LOCAL
    freopen("c.in","r",stdin);
    //freopen("c.out","w",stdout);
    #endif
    //ios::sync_with_stdio(false);
    //cin.tie(0);cout.tie(0);
    $0
    return 0;
    } // by pycr
  5. test code (Tab:test)

    #include <iostream>
    #include <cstdio> using namespace std; inline int read() {
    int x=0,s=1;
    char ch=getchar();
    while(!isdigit(ch)) {if(ch=='-') s=-1;ch=getchar();}
    while(isdigit(ch)) {x=x*10+(ch^48);ch=getchar();}
    return x*s;
    } int main() {
    #ifdef LOCAL
    freopen("c.in","r",stdin);
    #else
    freopen("$1.in","r",stdin);
    freopen("$2.out","w",stdout);
    #endif
    $0
    return 0;
    }

Ubuntu_Gedit配置的更多相关文章

  1. 配置android sdk 环境

    1:下载adnroid sdk安装包 官方下载地址无法打开,没有vpn,使用下面这个地址下载,地址:http://www.android-studio.org/

  2. Android Studio配置 AndroidAnnotations——Hi_博客 Android App 开发笔记

    以前用Eclicps 用习惯了现在 想学学 用Android Studio 两天的钻研终于 在我电脑上装了一个Android Studio 并完成了AndroidAnnotations 的配置. An ...

  3. react-router 组件式配置与对象式配置小区别

    1. react-router 对象式配置 和 组件式配置    组件式配置(Redirect) ----对应---- 对象式配置(onEnter钩子) IndexRedirect -----对应-- ...

  4. 总结:Mac前端开发环境的搭建(配置)

    新年新气象,在2016年的第一天,我入手了人生中第一台自己的电脑(大一时好友赠送的电脑在一次无意中烧坏了主板,此后便不断借用别人的或者网站的).macbook air,身上已无分文...接下来半年的房 ...

  5. Android Studio 多个编译环境配置 多渠道打包 APK输出配置

    看完这篇你学到什么: 熟悉gradle的构建配置 熟悉代码构建环境的目录结构,你知道的不仅仅是只有src/main 开发.生成环境等等环境可以任意切换打包 多渠道打包 APK输出文件配置 需求 一般我 ...

  6. Virtual Box配置CentOS7网络(图文教程)

    之前很多次安装CentOS7虚拟机,每次配置网络在网上找教程,今天总结一下,全图文配置,方便以后查看. Virtual Box可选的网络接入方式包括: NAT 网络地址转换模式(NAT,Network ...

  7. [linux]阿里云主机的免登陆安全SSH配置与思考

    公司服务器使用的第三方云端服务,即阿里云,而本地需要经常去登录到服务器做相应的配置工作,鉴于此,每次登录都要使用密码是比较烦躁的,本着极速思想,我们需要配置我们的免登陆. 一 理论概述 SSH介绍 S ...

  8. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

  9. Swift3.0服务端开发(一) 完整示例概述及Perfect环境搭建与配置(服务端+iOS端)

    本篇博客算是一个开头,接下来会持续更新使用Swift3.0开发服务端相关的博客.当然,我们使用目前使用Swift开发服务端较为成熟的框架Perfect来实现.Perfect框架是加拿大一个创业团队开发 ...

随机推荐

  1. AcWing 362. 区间

    听书上说有贪心 + 数据结构的做法,研究了一下. 朴素贪心 考虑把所有线段按照右端点 \(b\) 从小到大排序,依次考虑每一条线段的要求: 如果已经满足要求则跳过 否则尽量选择靠后的数(因为之后的线段 ...

  2. 九、TestNG超时测试

    "超时"表示如果单元测试花费的时间超过指定的毫秒数,那么TestNG将会中止它并将其标记为失败. 使用属性 timeOut = 参数(1s*1000) package com.lc ...

  3. 解决python3 ,ModuleNotFoundError: No module named 'pip'问题

    今天想要装一下PyYmal第三方库来写一下Python的desired_caps.yaml文件,候发现cmd窗口下无法执行pip命令, 出现了:ModuleNotFoundError: No modu ...

  4. collectd+infludb+grafana实现tomcat JVM监控

    前提条件:已安装好java环境,tomcat,influxdb和collectd.本文暂不提供以上内容的安装步骤 系统环境:centos7 原理:开启tomcat的jmx端口,使用collectd的c ...

  5. druid数据源yml配置

    application.yml配置 spring: datasource: username: root password: 123456 url: jdbc:mysql://localhost:33 ...

  6. C# 海量数据瞬间插入到数据库的方法

    C# 海量数据瞬间插入到数据库的方法 当我们在数据库中进行大量的数据追加时,是不是经常因为数据量过大而苦恼呢?而所谓的海量数据,一般也是上万级的数据,比如我们要添加一百万条数据,应该如何提高它的效率呢 ...

  7. java.net.BindException:Problem binding to [hostname:8088]地址已在使用

    异常提示端口号被占用 查找被占用的端口 netstat -tln netstat -tln | grep 8083 netstat -tln ## 查看端口使用情况,而netstat -tln | g ...

  8. 死磕以太坊源码分析之Ethash共识算法

    死磕以太坊源码分析之Ethash共识算法 代码分支:https://github.com/ethereum/go-ethereum/tree/v1.9.9 引言 目前以太坊中有两个共识算法的实现:cl ...

  9. 被 Pandas read_csv 坑了

    被 Pandas read_csv 坑了 -- 不怕前路坎坷,只怕从一开始就走错了方向 Pandas 是python的一个数据分析包,纳入了大量库和一些标准的数据模型,提供了高效地操作大型数据集所需的 ...

  10. Java线程池二:线程池原理

    最近精读Netty源码,读到NioEventLoop部分的时候,发现对Java线程&线程池有些概念还有困惑, 所以深入总结一下 Java线程池一:线程基础 为什么需要使用线程池 Java线程映 ...