【随记】小白日常代码笔记

一些无聊的编程笔记

Java


带 Jar 运行 Java 文件

情景:用 beautyeye 美化自己的 Swing 程序时需要带 Jar 包运行代码

https://github.com/JackJiang2011/beautyeye
http://openmob.net/forum.php?mod=viewthread&tid=26
javac -cp beautyeye_lnf.jar SimpleEx.java
java -cp beautyeye_lnf.jar;. SimpleEx
import java.awt.EventQueue;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

public class SimpleEx extends JFrame {
    public SimpleEx() {
        initUI();
    }`

    private void initUI() {
        JButton quitButton = new JButton("Quit");
        quitButton.setMnemonic(KeyEvent.VK_B);

        quitButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                System.exit(0);
            }
        });

        creatLayout(quitButton);

        setTitle("Simple Example");
        setSize(300,200);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public void creatLayout(JComponent... arg) {
        Container pane = getContentPane();
        GroupLayout gl = new GroupLayout(pane);
        pane.setLayout(gl);
        // pane.setToolTipText("Content pane");

        gl.setAutoCreateContainerGaps(true);

        gl.setHorizontalGroup(gl.createSequentialGroup()
            .addComponent(arg[0])
        );

        gl.setVerticalGroup(gl.createSequentialGroup()
            .addComponent(arg[0])
        );
    }

    public static void main(String[] args) {
        try
        {
            // org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
            BeautyEyeLNFHelper.launchBeautyEyeLNF();
        }
        catch(Exception e)
        {
            //TODO exception
        }        
        EventQueue.invokeLater(new Runnable(){
            @Override
            public void run() {
                SimpleEx ex = new SimpleEx();
                ex.setVisible(true);
            }
        });
    }
}

自定义 NetBeans 的界面风格,这里使用Mac风

"D:\JavaIDE\NetBeans 8.1\bin\netbeans64.exe" --cp:p "D:\Project\JavaStudy\beautyeye-3.7\dist\beautyeye_lnf.jar" --laf org.jb2011.lnf.beautyeye.BeautyEyeLookAndFeelWin

这里写图片描述

Android

给手机激活GoogleNow

    安装好全部组件并删除Google全部应用的数据
    fqrouter2或者Shadowsocks自启动设置
    总之使手机处于全球网络下
    位置服务使用网络模式
    卸载并钛备份Google Play servers 
    重启
    开启google app
    钛备份还原Google Play servers 
    开启google app
    开启Google Now

Android ADB 截图

adb shell /system/bin/screencap -p /sdcard/screenshot.png & adb pull /sdcard/screenshot.png I:\

Browser

各种浏览器的Cookie位置

IE      %APPDATA%\Microsoft\Windows\Cookies\
Firefox     %APPDATA%\Mozilla\Firefox\Profiles\xxx.default目录 cookies.sqlite
Chrome      %LOCALAPPDATA%\Google\Chrome\User Data\Default\cookies
360         D:\Users\Administrator\AppData\Roaming\360se6\User Data\Default\cookies
360极速浏览器    D:\Users\Administrator\AppData\Local\360Chrome\Chrome\User Data\Default\cookies
linux
Firefox的Cookie路径为:$HOME/.mozilla/firefox/xxxx.default/目录下的cookie.sqlite文件。
UC浏览器       C:\Users\Administrator\AppData\Local\UCBrowser\User Data\Default\cookies

Editor

Sublime C++编译设置

新建一个编译选项 cpp.sublime-build,可以加上快捷键

{
    "cmd": ["g++", "${file}", "-o","${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:?(.*)$",
    "working_dir": "${file_path}",
    "encoding":"cp936",
    "selector": "source.c",
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["cmd", "/c", "gcc", "-Wall","${file}", "-o", "${file_path}/${file_base_name}", "&&", "start", "cmd", "/c", "${file_path}/${file_base_name} & echo.&pause"]
        }
    ]
}

Else 其他

Matlab复制Sumlink仿真图

先打开一个Figure仿真图
在matlab里面输入下面神秘代码并回车,Figure就会出现菜单

shh = get(0,'ShowHiddenHandles');
set(0,'ShowHiddenHandles','On')
set(gcf,'menubar','figure')
set(gcf,'CloseRequestFcn','closereq')
set(gcf,'DefaultLineClipping','Off')
set(0,'ShowHiddenHandles',shh)

点击菜单Edit Figure Properties

Windows里面的软链接

之前C盘不够大,故先安装大型软件到C盘后手动复制安装好的大型文件复制到D盘,并建立软链接,如:

mklink /d "C:\Users\harry159821\AppData\Local\Google" "D:\Android\Google"

还可以吧Windows默认的下载文件夹重置位置

mklink /d "C:\Users\harry\Downloads" "D:\DownLoad"

删除 Win10 文件管理器 里面默认的六个库文件夹

复制代码保存 reg 文件运行

Windows Registry Editor Version 5.00

;Created by Vishal Gupta for AskVG.com

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag]
"ThisPCPolicy"="Hide"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值