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. redis学习之——redis.conf配置(基本)文件学习

    # Redis configuration file example # Note on units: when memory size is needed, it is possible to sp ...

  2. 8、Spring Cloud Zuul

    1.Zuul简介 Zuul包含了对请求的路由和过滤两个最主要的功能. 路由功能负责将外部请求转发到具体的微服务实例上,是实现外部访问统一入口的基础. 过滤器功能则负责对请求的处理过程进行干预,是实现请 ...

  3. IOS中使用.xib文件封装一个自定义View

    1.新建一个继承UIView的自定义view,假设类名叫做 MyAppVew #import <UIKit/UIKit.h> @class MyApp; @interface MyAppV ...

  4. vue 事件基本用法

    事件基本用法 事件的函数都定义在VUE实例中的methods中,当然也可以直接写在元素内,但是这并不利于后期的维护,需要注意的是:在methods定义的函数内想要引用插值内容,需要使用this,不然就 ...

  5. Ubuntu系统升级

    转自:Ubuntu14.04升级到18.04 查看当前版本 lsb_release -a 执行更新 apt-get update apt-get upgrade apt dist-upgrade 重启 ...

  6. Centos7__Scrapy + Scrapy_redis 用Docker 实现分布式爬虫

    原理:其实就是用到redis的优点及特性,好处自己查--- 1,scrapy 分布式爬虫配置: settings.py BOT_NAME = 'first' SPIDER_MODULES = ['fi ...

  7. WPF应用程序管理

    WPF应用程序管理(更多资源:http://cleopard.download.csdn.net/) 一.WPF应用程序由System.Windows.Application类进行管理 二.创建WPF ...

  8. 简单介绍下各种 JavaScript 解析器

    作者:沧海 各种js解析器是前端工程化的基石,可以说如果没有它,很多工程化都无法正常执行,我们每天用到的babel.webpack.eslint.TypeScript背后都需要一套对应的js解析器,今 ...

  9. Java学习日报7.13

    /** * *//** * @author 86152 * */package Employee;import java.util.Scanner;public class Employee{ pri ...

  10. 【分布式锁】Redis实现可重入的分布式锁

    一.前言 之前写的一篇文章<细说分布式锁>介绍了分布式锁的三种实现方式,但是Redis实现分布式锁关于Lua脚本实现.自定义分布式锁注解以及需要注意的问题都没描述.本文就是详细说明如何利用 ...