Tuesday, September 16, 2014

在Eclipse配置SVN/TortoiseSVN

利用Eclipse install new software而链接为SVN - http://download.eclipse.org/releases/helios
选择collaboration->SVN team provider安装

安装好后,右击要checkin的proj->Team->Share project,选SVN




















配置URL和username以及密码即可


























或者用TortoiseSVN来访问,安装以后一定要重启,否则不会出现在右击菜单里



















点击SVN Checkout就会变成这样












如果用Tortoise checkin C#代码的时候,会看到很多dll,obj之类的文件,它们是unversioned(我们也并不想checkin它们)会跟新的CS文件(要checkin)混淆,导致会忘记checkin CS文件。我们可以通过配置Tortoise忽略某类型文件或者某个文件夹来解决。
我的添加为*/bin/* */obj/* *.suo *.user bin obj Debug _Resharper.*
















参考:
http://www.eclipse.org/subversive/documentation/gettingStarted/aboutSubversive/install.php

Monday, September 15, 2014

Android app development

1. 如何引进一个existing Android project:
1. 先新建一个Android hello world project,theme记得选none
2. Import Android project之后修改project.properties为步骤1的内容
比如
target=android-19
android.library.reference.1=../appcompat_v7

2. 常用组件:
Toast:


















Context context = getApplicationContext();
    Toast toast = Toast.makeText(context, "hihi", Toast.LENGTH_SHORT);
    toast.show();

KB: SQL Server DBA queries

Get the running queries:
select r.session_id,r.status,r.start_time,r.total_elapsed_time,r.command,s.text
from sys.dm_exec_requests r
cross apply  sys.dm_exec_sql_text(r.sql_handle) s
--where r.status='running'

Get linked servers:
exec sp_linkedservers

Thursday, September 4, 2014

SSRS

如何写一个SSRS项目:
http://msdn.microsoft.com/zh-cn/library/ms167305.aspx

如果配置本地SSRS server+deploy report:
http://www.cnblogs.com/aspnetx/archive/2013/04/20/3033189.html

创建一个报告:
1.加入report









2. 创建database连接
按edit创建,然后选择分享这个data source,其他报告也可以共享


3. 设计query


4. 最后会自动生成一个dataset,每个报告都会有一个dataset. 右击表格,tablix property可以查看dataset












5. 右击该Dataset1可以使其变成share dataset,以便其他报告使用

















如果其他报告要使用,加入shared dataset后即可使用

6. 输入域:用于输入一些参数,然后生成报告





这些参数还可以在Dataset中作为Parameter输入SP,比如需要输入参数才能产生的report








而Parameter还可以做成一个下拉菜单,这需要让parameter associate到一个dataset



配置本地reporting server:
run SQLServerManager11.msc或者sql server configuration manager


















Example for the link above:
In Google drive books\SSRS\Code\Quotes-simple.rar

Email the report by scheduler:



Wednesday, July 23, 2014

在Linux下载Android源代码

1. Change to root

$ sudo su


2. Installing the JDK:

$ sudo apt-get update (with proxy: sudo env http_proxy=
http://10.1.3.1:8080 apt-get update)

$ sudo apt-get install openjdk-7-jdk

3. curl工具的安装:
sudo apt-get install curl

4. git工具的安装
sudo apt-get install git-core


5. make new dir
mkdir Android
cd Android

6. repo工具的安装
chmod a+x repo
apt-get install phablet-tools

7. 下载源代码

$ repo init -u https://android.googlesource.com/platform/manifest
(proxy: 如果要设置代理,先运行git config --global http.proxy localhost:8080,再运行repo init)
出现错误是补充如下信息:
git config --global user.email "cenjiajie@gmail.com"
git config --global user.name "gary"

最后运行
$ repo sync

运行了一晚后,结果是(这时占用了17G)




8. Build
$ sudo apt-get install git gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

$ . build/envsetup.sh

指定输出路径,这样可以界面交互
export OUT_DIR_COMMON_BASE=/home/gary/Android

root@gary-virtual-machine:~/bin# lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_arm64-eng
     3. aosp_mips-eng
     4. aosp_mips64-eng
     5. aosp_x86-eng
     6. aosp_x86_64-eng
     7. vbox_x86-eng
     8. aosp_manta-userdebug
     9. mini_mips-userdebug
     10. mini_armv7a_neon-userdebug
     11. mini_x86-userdebug
     12. aosp_tilapia-userdebug
     13. aosp_deb-userdebug
     14. aosp_flo-userdebug
     15. aosp_grouper-userdebug
     16. aosp_mako-userdebug
     17. aosp_hammerhead-userdebug


<select 5>

make -j4
--failed
make




http://www.linuxidc.com/Linux/2011-02/32269.htm


官方参考:
https://source.android.com/source/initializing.html
百度经验:

http://jingyan.baidu.com/article/03b2f78c44e2a55ea337ae5b.html

Thursday, July 17, 2014

在windows利用VMware安装Ubuntu

1. 在http://www.ubuntu.com/   下载Ubuntu,我选的是64位系统
2. 下载并安装VMware Workstation 8.0

安装过程注意在bios设置enable visualization technology, 如果要用于下载Android源代码,内存至少2G,硬盘至少100G

百度经验
http://jingyan.baidu.com/article/14bd256e0ca52ebb6d26129c.html
其中,有时可能光盘为空,这时需要把光盘eject再重新按install VMware tools

安装完Ubuntu下一个问题是屏幕不够大,这里需要安装VMware tools来解决,具体见:

百度经验(看前6步即可):
http://jingyan.baidu.com/article/3065b3b6e8dedabecff8a435.html

然后按Ctrl+Alt+T出现terminal的窗口,输入:
cd Desktop
cd vmware-tools-disturib 

sudo ./vmware-install.pl  

安装一直回车即用默认值,一直到安装完毕,然后重启虚拟器
这时候可以见到VMware里面View->Fit Guest now选项可以选了,按一下就全屏了!

















Sunday, June 8, 2014

改变affinity - CPU利用数

由于Android emulator存在bug - 只能单cpu运行,所以我们必须在emulator启动后,改变其affinity,使其可以多CPU运行

PowShell "Get-Process"

PowerShell "Get-Process calc | Select-Object ProcessorAffinity"
PowerShell "$Process = Get-Process calc; $Process.ProcessorAffinity=255"


PowerShell "Get-Process | where-Object {$_.mainWindowTitle} | format-table id,name,mainwindowtitle -AutoSize"

PowerShell "Get-Process | where-Object {$_.mainWindowTitle -like 'calculator'} | format-table id,name,mainwindowtitle -AutoSize"

Id Name MainWindowTitle
-- ---- ---------------
40312 calc Calculator


PowerShell "$Process = Get-Process | where-Object {$_.mainWindowTitle -like 'calculator'}; $Process.ProcessorAffinity=255"



PowerShell "$Process = Get-Process | where-Object {$_.mainWindowTitle -like '5554:test'}; $Process.ProcessorAffinity=255"