2018年1月27日星期六

XMR挖矿教程

XMR挖矿教程

XMR介绍

门罗币(Monero,代号XMR)是一个创建于2014年4月开源加密货币,它着重于隐私、分权和可扩展性。与自比特币衍生的许多加密货币不同,Monero基于CryptoNote协议,并在区块链模糊化方面有显著的算法差异。Monero的模块化代码结构得到了比特币核心维护者之一的Wladimir J. van der Laan的赞赏。Monero在2016年经历了市值(从5百万美元至1.85亿美元)和交易量的快速增长,这部分是因为它在2016年夏季末期得到了主要的暗网市场AlphaBay的采用。截至2017年,Monero是交易量排行第六的加密货币,市值 超过3亿美元。

官网链接请点此处
本地钱包支持Windows 6432、Mac OS x 64、Linux 64、Freebsd 64、ARM等。
源代码请访问GitHub仓库

开始挖矿

CUDA ccminer (tsiv)

源代码地址见GitHub

ccminer -q -o stratum+tcp://xmr-usa.dwarfpool.com:8050 -u YOUR_WALLET -p x

ATI miner by Claymore 5% dev-fee

挖矿软件仅支持Windows 64Bit下载

NsGpuCNMiner.exe -o stratum+tcp://xmr-eu.dwarfpool.com:8050 -u WALLET -p x

CPU矿工(wolf提供)

源代码 Windows64 no AES Windows64 AES

XMrig

源代码

xmrig -o xmr-usa.dwarfpool.com:8005 -u YOUR_WALLET -p x -k -o xmr-eu.dwarfpool.com:8080 -u YOUR_WALLET -p x -k

CPU矿工(yvg1900提供)

百度网盘下载
配置文件下载

./yam -c yam-xmr.cfg

建议使用本地钱包

交易所

hitbtc

XMR捐赠地址: 4ECF1KeJu2afvTJiswKYtxKvKMzbF4N1tgpgAExDcgzTHkdrzLcdWvh4BQKW9jPMyHZLYn1nSyop6AAw5UsRW14q1BtBV6j2RheSb4BmpN

2018年1月23日星期二

如何把一本书扫描入库

如何把一本书扫描入库?

见标题。

先谈方法

  • 切书
  • 打印机托盘入纸自动扫描成pdf
  • 导出图片
  • ocr识别文字
  • 校对

再谈下成本

  • 打印社扫描的成本是一面5毛
  • 我扫的书比较多,不舍得花钱,让小助手用公司打印机扫描的
    • 人力成本一天大概2小时(不经常卡纸的话,含导出pdf并转图片的时间)
    • 识别成本:使用服务器,一页识别大概在13秒钟,定时批量处理即可

扫描时的注意事项

  • 分辨率不低于300dpi,我用的是400dpi
  • 黑白
  • 双面拼接

OCR识别方法

使用tesseract工具识别,命令行用法如下:

#!/bin/bash
# linux操作系统下运行哦

page='page_1.jpg' # 页码
page_name='page_1' # 输出文件名称,后辍固定为txt
tesseract ${page} ${page_name} -l chi_sim -c chop_enable=0 -c tessedit_write_images=1

如果不是技术人员,可以联系我(liangtaohy@gmail.com)。我可以帮提取文字,但要是需要校对的话,那要给小助理工时费了,哈哈。

2011年1月20日星期四

Android 分析杂记

1. If system server process crashed, the zgnote would be killed and restart. And then, the system server will be restart in init process.
1. Service Died
void do_add_service    (server_manager.c)
void binder_link_to_death(struct binder_state *bs, void *ptr, struct binder_death *death) (binder.c)

2. Problem opening device files - Is your kernel compatible?
status_t AudioHardware::AudioStreamOutTegra::set    AudioHardware.cpp

3. FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager
private static class UncaughtHandler    RuntimeInit.java

4.
public static void main        ZygoteInit.java
VMRuntime.getRuntime().setMinimumHeapSize(5 * 1024 * 1024);
preloadClasses();
preloadResources();
startSystemServer();
Zygote.forkSystemServer
handleSystemServerProcess [For Child Process]
RuntimeInit.zygoteInit(parsedArgs.remainingArgs);

5.
void android_os_Process_sendSignal(JNIEnv* env, jobject clazz, jint pid, jint sig)    android_util_Process.cpp
android/os/Process.sendSignal

2010年12月7日星期二

Android VideoCamera Analysis

I wanted to know how to use camera recording. So I checked the file "VideoCamera" in android source code. The following was what it did.


1. If you want to start recording, you need Camera and MediaRecorder.
2. Decide when to open a camera device, how to set parameters of the camera and set the previewDisplay always before starting previewing.
3. Decide when to close a camera device.
4. Stop the camera and media recording in onPause() and resume them in onResume().
5. in callback method surfaceCreated, mSurfaceHolder is set.
6. in callback method surfaceDestroy, mSurfaceHolder is destroyed.
7. in callback method surfaceChanged, mSurfaceHolder is set again. But if the state of the Activity is Pausing, do nothing just return. Restart previewing and recording.


The following is an example.

vim+ctags+cscope+java

How to let cscope to support JAVA?
1. find . -name "*.java" >> cscope.files
2. cscope -b  (Refresh the database)
3. cscope

2010年12月5日星期日

Activity orientation | Activity Restart

The values of Orientation are ORIENTATION_PORTRAIT and
ORIENTATION_LANDSCAPE.


When orientation is changed, the default action is to restart the Activtiy.

If you don’t want your Activity to restart, you should do the following thing:


Config your Activity with the Activity Element
     android:configChanges="keyboardHidden|orientation"
Rewrite the callback method
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    if (this.getResources().getConfiguration().orientation ==
    Configuration.ORIENTATION_LANDSCAPE) {
    Log.d(TAG, "++ ORIENTATION_LANDSCAPE ++");
   
    } else if (this.getResources().getConfiguration().orientation
    == Configuration.ORIENTATION_PORTRAIT){
    Log.d(TAG, "++ ORIENTATION_PORTRAIT ++");
    }
}

2010年12月2日星期四

Android Bluetooth

Android Bluetooth

Bluetooth is a communication protocol designed for short-range, low-bandwidth, peer-to-peer communications.
Bluetooth devices and connections are only managed by the following classes:
l         BluetoothAdapter local Bluetooth adapter
l         BluetoothDevice remote Bluetooth device
l         BluetoothSocket
l         BluetoothServerSocket

Accessing the local BT adapter

BluetoothAdapter mBTAdapter = BluetoothAdapter.getDefaultAdapter();
In order to access the local BT adapter, you should include the Bluetooth manifest permission.
"android.permission.BLUETOOTH" />
"android.permission.BLUETOOTH_ADMIN" />

Managing BT Properties and State

The most useful properties are friendly name and MAC address:
mBTAdapter.getName()
mBTAdapter.getAddress()
The current BT Adpater’s state:
l         STATE_TURNING_ON
l         STATE_ON
l         STATE_TURNING_OFF
l         STATE_OFF

Turning on local BT Adapter

private static final int RQUEST_ENABLE_BT = 0;
Intent enalbeIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, RQUEST_ENABLE_BT);
A sub-activity will be pop-up. The result code of the sub-activity will be returned on the callback method onActivityResult(int requestCode, int resultCode, Intent data).

Being discoverable

The BT Discoverability is indicated by the scan mode.
There are three scan modes (getScanMode()).
SCAN_MODE_CONNECTABLE_DISCOVERABLE
SCAN_MODE_CONNECTABLE
SCAN_MODE_NONE
To turn on discovery you need to obtain permission from the user by starting an Activity:
String dis = BluetoothAdapter.ACTION_RQUEST_DISCOVERABLE;
Intent mDis = new Intent(dis);
StartActivityForResult(mDis, DISCOVERY_REQUEST);
To start discovery process, you should call function
mAdapter.startDiscovery();
To cancel discovery process, you should call function
mAdapter.cancelDiscovery();
To get the remote bluetooth device discovered, you should use the BroadcastReceiver,
registerReceiver(discoveryResult, new IntentFilter(BluetoothDevice.ACTION_FOUND));
BroadcastReceiver discoveryResult = new BroadcastReceiver(){
public void onReceiver(Context ct, Intent intent){
   String mRemoteDeviceName = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
   BluetoothDevice mRemoteDevice;
   mRemoteDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
}
}

Bluetooth Communications

The communication channel is a RFCOMM channel.
To establish the bidirectional communications, you should use the following classes:
l         BluetoothServerSocket  A bluetooth server socket is used to listen for incoming Bluetooth Socket connection request from remote Bluetooth Devices.
l         BluetoothSocket
The server socket is created by listenUsingRfcommWithServiceRecord method on mAdapter. The server socket is identified by a name and a UUID.
To start listening for connections call accept on the server.

Transmitting Data Using Bluetooth Sockets

Once a channel is established, the two peers can talk with each other by BluetoothSocket.