显示标签为“未分类”的博文。显示所有博文
显示标签为“未分类”的博文。显示所有博文

2011年12月29日星期四

2011年12月26日星期一

戴尔 Streak 10 Pro 平板 3.2 root 方法

3.2和3.1的ROOT方法
=============================================================
1、首先开机,打开“设置-应用程序-开发-USB调试”。如果电脑没有自行安装好驱动,那就在开机状态下利用豌豆荚或者91手机助手安装驱动。
2、关机,然后按“重启也+电源键”,使机器进入APX模式。此时屏幕处于黑屏状态,电脑会提示安装APX驱动,驱动在上边提供的强刷包中。
3、执行最上面提供的对应版本的强刷包中的ROOT.BAT,然后就是一个等啊。等着S10自动重启,ROOT.BAT的命令行窗口自行关闭。
4、恭喜您成功了。验证您ROOT成功与否成功方法是看应用程序列表中有没有superuser这个软件的图标。

参考文章:1. http://bbs.gfan.com/android-3033020-1-1.html
2. how-to-root-dell-streak-10-pro-zh.html

2011年12月13日星期二

动态加载jQuery然后处理www.ncl.ucar.edu网页内容


//----- 动态加载jQuery
var j = document.createElement('script');
j.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';

var h = document.getElementsByTagName('head')[0];

h.appendChild(j);

//------ 添加一个div用来保存结果
clear();
$('#wrap').prepend('
');

//------- 处理resource名称
clear();
var dts = $('#general_main > dl >dt');
var titles='';
dts.each(function(){
var title = $(this).children('strong').text();
console.log(title);
titles += title + ',';
})

$('#result').text(titles);

//----- 处理默认值
clear();
var dts = $('#general_main > dl >dd');
var titles='';
dts.each(function(){
if($.trim($(this).text() )=='' ) return;

var title = $(this).find('p').last().text();
console.log(title);
if(title){
titles += title + '##';
}else{
titles += 'novalue##';
}

})

$('#result').text(titles);

2011年11月9日星期三

CPP程序监视plot文件夹并以post方式上传数据


//#include // MFC 核心和标准组件

#include
#include
#include
#include
#include

void display_post_result(std::string result)
{
std::cout<
std::ofstream fout("log-info.txt",std::ios_base::out|std::ios_base::app);
if(!fout.is_open())
{
std::cout<<"打开或创建文件log-info.txt失败!";
return;
}
CTime now = CTime::GetCurrentTime();

fout<}

bool PostHttpPage(const std::string& hostName, const std::string& pathName, const std::string& postData)
{
using namespace std;

CInternetSession session("Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2) Gecko/20100115 Firefox/3.6");

try
{
INTERNET_PORT nPort = 80;
DWORD dwRet = 0;

CHttpConnection* pServer = session.GetHttpConnection(hostName.c_str(), nPort);
CHttpFile* pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, pathName.c_str());

CString strHeaders = "Content-Type: application/x-www-form-urlencoded"; // 请求头

display_post_result("posting data...");

pFile->SendRequest(strHeaders,(LPVOID)postData.c_str(),postData.size());
pFile->QueryInfoStatusCode(dwRet);


if (dwRet == HTTP_STATUS_OK)
{
CString result, newline;

while(pFile->ReadString(newline))
{
result += newline+"\r\n";
}

display_post_result(("back:"+result).GetBuffer());
}
else
{
display_post_result("post 失败!");
return false;
}
delete pFile;
delete pServer;

}
catch (CInternetException* pEx)
{
//catch errors from WinInet
TCHAR pszError[200];
pEx->GetErrorMessage(pszError, 200);

display_post_result(pszError);
return false;
}
session.Close();

return true;
}

bool deal_plot_file(std::string orgine_name, std::string &result)
{
std::ifstream fin(orgine_name.c_str());
if(!fin.is_open())
{
display_post_result("打开文件"+orgine_name+"失败!");
return false;
}

display_post_result("dealing "+orgine_name+"...");

result = "";
std::string linestr, number;

std::istringstream stringin;
while(std::getline(fin,linestr))
{
stringin.clear();
stringin.str(linestr);
if(stringin>>number)
{
if(number.size() == 5)
{
result += number;
//读取并丢弃经纬度高度和站点级别信息
stringin>>number>>number>>number>>number;

while(stringin>>number)
{
result += ' ' + number;
}
//result += "\r\n";

}
else
{
result += linestr + "\r\n";
}
}
}

return true;
}

CTime get_last_time()
{
int year,month,day,hour,minute,second;

year = GetPrivateProfileInt("lastest","year",1970,"./scan.ini");
month = GetPrivateProfileInt("lastest","month",1,"./scan.ini");
day = GetPrivateProfileInt("lastest","day",2,"./scan.ini");
hour = GetPrivateProfileInt("lastest","hour",0,"./scan.ini");
minute = GetPrivateProfileInt("lastest","minute",0,"./scan.ini");
second = GetPrivateProfileInt("lastest","second",0,"./scan.ini");

return CTime(year,month,day,hour,minute,second);
}

bool set_latest_time(const CTime &latest)
{
BOOL year,month,day,hour,minute,second;

year = WritePrivateProfileString("lastest","year",latest.Format("%Y"),"./scan.ini");
month = WritePrivateProfileString("lastest","month",latest.Format("%#m"),"./scan.ini");
day = WritePrivateProfileString("lastest","day",latest.Format("%#d"),"./scan.ini");
hour = WritePrivateProfileString("lastest","hour",latest.Format("%#H"),"./scan.ini");
minute = WritePrivateProfileString("lastest","minute",latest.Format("%#M"),"./scan.ini");
second = WritePrivateProfileString("lastest","second",latest.Format("%#S"),"./scan.ini");

return year && month && day && hour && minute && second;
}

std::string get_plot_dir()
{
char dir_buf[1024] ;
DWORD result = GetPrivateProfileString("path","plotdir","Z:/surface/plot/",dir_buf,1000,"./scan.ini");

return dir_buf;
}

bool scan_plot_dir()
{
CTime last_time = get_last_time();

CFileFind finder;

std::string dir = get_plot_dir();
if('\\' != dir[dir.size()-1 ] && '/' != dir[dir.size()-1 ] )
{
dir += '/';
}
BOOL bWorking = finder.FindFile( (dir+ "*.000").c_str() );

CTime lastest(1), ftime;
std::string result;
//

while (bWorking)
{
bWorking = finder.FindNextFile();

if(finder.GetLastWriteTime(ftime)
&& ftime > last_time
&& deal_plot_file(finder.GetFilePath().GetBuffer(), result)
)
{
bool is_post_success =
PostHttpPage("current.sinaapp.com","update-mysql-from-post.php","app-content="+result);

if(!is_post_success)
{//有一次post不成功就返回本次dir scan
display_post_result("post maybe failure...");
return false;
}

lastest = ftime > lastest ? ftime : lastest;

display_post_result("wait 2 minute...");
Sleep(2*1000*60);//post成功时等待2分钟
display_post_result("continue next file find...");
}
}

if(CTime(1) != lastest )
{
return set_latest_time(lastest);
}

return false;
}

int main(void)
{
std::cout<<"version 1.1 2011-11-09\n"
<<"-------------------------------------\n";
while(true)
{
scan_plot_dir();

display_post_result("wait 5 minute...");
Sleep(5*1000*60);//每次dir scan完成时等待5分钟
display_post_result("continue next plot dir scan...");
}

}

2011年10月31日星期一

NCEP FNL 介绍

[原文链接] dss.ucar.edu/datasets/ds083.2/

SUPPLEMENTARY DOCUMENTATION

Background information about this type of data may be found in An Introduction to Atmospheric and Oceanographic Datasets.

INFORMATION ABOUT THE NCEP GDAS FNL 1.0 DEGREE 6-HOURLY ANALYSIS UPDATES

The CISL/DSS archived FNL analysis filenames have the form fnl_yymmdd_hh_00[_c] , the yymmdd_hh is in Coordinated Universal Time (UTC, UT, GMT or Z). The _00 in this form indicates that the file is an analysis, not a forecast. Files published on the CISL/DSS web site are grib1. Beginning 2008.09.30.12, when filename is appended with "_c", it means CISL/DSS converted it from grib2 to grib1.

The CISL/DSS FNL files originated as downloads of the near-real time analysis files on an NCEP Nomads server directory: http://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gdas.YYYYMMDD , and the files are named gdas1.thhz.pgrbf00.grib2 where hh is the analysis time and f00 indicates an analysis. pgrb files with other fnn values are forecasts nn hours into the future. Numerous other files are in these directories. The NCEP directories are emptied after about 30 hours, and aged off after about 48 hours.

CISL/DSS selects the FNL analysis over all others because it uses the most complete set of observations and is run last in the sequence of operational global models. The FNL is likely the best option for a long-term operational model archive from NCEP. Please see the NCEP EMC Model Documentation for more details.

As with any high volume operational model production system there are times when late file postings and network outages interrupt data acquisition and processing for the archive. The CISL/DSS makes a "best" effort to sustain a complete archive time series. Recoveries from short-term problems are handled systematically. For longer-term problems we obtain assistance from NCEP staff.

VARIABLES:

Land skin temperature and sea surface temperature are in one field.

LEVELS:
1000mb 975mb 925mb 900mb 850mb 800mb 700mb 650mb 600mb 550mb 500mb 450mb 400mb 350mb 300mb 250mb 200mb 150mb 100mb 70mb 50mb 30mb 20mb 10mb
surface upper-air troposphere mandatory tropopause stratosphere

FORMAT AND USAGE:

General

To see the WMO's GRIB Documentation click here.
To see NCEP's GRIB1 Documentation click here.
To see NCEP's GRIB2 Documentation click here.
To see FAQs about FNL and ADP data click here.

Tools to manipulate GRIB data

For support using NCAR/CISL's NCL click here.
For support using COLA's GrADS click here.

Models

For support using NCAR/MMM's WRF click here.
For support using NCAR/MMM's MM5 click here.
For support using ATMET's RAMS click here.

2011年10月8日星期六

iPad 天气图查看网站设想

1. 显示高空地面图 云图 欧洲预报等
2. 双指放大缩小
3. 在图片上进行简单画线分析并保存为个人分析集合 下次可直接打开分析集合
4. 各种对比显示 按时间对比 按不同层次对比
5. 显示历史相似形势的资料

2011年10月2日星期日

迅雷离线下载Javascript代码分析


function download_check(obj,arg){
if(typeof(g_isfree)!='undefined' && g_isfree){//判断免费用户
if(obj!=bt_task_down && obj!=thunder_download && obj!=batch_down_bt && obj!=rm_saveas && obj!=rm_saveas_bt){
alert('免费用户不支持批量下载,请单个下载!');
return false;
}
var bid = -1;
if(obj==thunder_download){
if(typeof(arg[1])=='undefined'){
var taskid = arg[0];
}
else{//BT子任务,获取
var taskid = $("#bttaskid"+arg[0].toString()).val();
bid = arg[0];
}
}
else if(obj == batch_down_bt){
var taskid = $('#view_bt_taskid').val();
}
else if(obj == rm_saveas){
var taskid = arg[0];
}
else if(obj == rm_saveas_bt){
var bid = arg[0];
var taskid = $("#bttaskid"+arg[0].toString()).val();
}
else{
var taskid = arg[1];
}
var t = 0;
var api = $('#free_down').pop({
onHide:function(){
try{
clearInterval(t);
}
catch(e){}
}
});
$('#free_topicbox_2').hide().find('div').removeClass('bg_why');
$('#free_conlist_2').hide();
$('#free_topicbox_1').show();
$('#free_conlist_1').show();
$('#free_down_xz').show();
$('#free_down_hy').hide();
var hasclick = false;

var that = $('#free_down_todown').html('普通下载').removeClass('btn_noit')
.unbind('click')
.bind('click',function(){
if(hasclick) return;
hasclick = true;
var i=30;
$.getScript(INTERFACE_URL + "/get_wait_time?callback=download_check_respo&taskid="+taskid+'&t='+new Date());
window.download_check_respo = function(res){
hasclick = false;
if(res && res.result==0){
i=res.wait_time;
that.unbind('click');
}
else{
alert('出现异常,请刷新页面重试');
return false;
}
$('#free_topicbox_1,#free_conlist_1').hide();
$('#free_topicbox_2,#free_conlist_2').show();
$('#free_topicbox_2').find('div').addClass('bg_why');
that.html('还剩'+i.toString()+'秒').addClass('btn_noit');
t = setInterval(function(){
i--;
if(i<=0){
try{
clearInterval(t);
}
catch(e){}
that.html('获取地址中...');
//function d(){
if(obj==bt_task_down){//下载BT任务
$.getJSON(INTERFACE_URL + '/get_wait_time?callback=?&t='+new Date(),{key:res.key,taskid:taskid,t:new Date()},function(process){
if(process.result!=0){
alert('出现异常,请刷新页面重试');
return;
}
start_get_free_download_url();
});
}
else if(obj==batch_down_bt || obj==rm_saveas_bt){//bt_list
$.getJSON(INTERFACE_URL + "/free_get_url?callback=?&t="+new Date(),{key:res.key,list:taskid,bt_list:taskid,uid:getCookie('userid'),t:new Date()},function(process){
if(process.result!=0){
alert('出现异常,请刷新页面重试');
return;
}
var o = process.list;
$.each(o,function(i,v){
$('input[name=btdownurl'+v.tid.toString()+']').val(v.lixian_url);
});
start_get_free_download_url();
});
}
else{
$.getJSON(INTERFACE_URL + "/free_get_url?callback=?&t="+new Date(),{key:res.key,list:taskid,nm_list:taskid,uid:getCookie('userid'),t:new Date()},function(process){
if(process.result!=0){
alert('出现异常,请刷新页面重试');
return;
}
var o = process.list[0];
if(bid==-1){
$('#dl_url'+arg[0]).val(o.lixian_url);
}
else{//BT子任务
$('#btdownurl'+bid.toString()).val(o.lixian_url);
$('#bt_list'+bid.toString()).val(o.lixian_url);
}
start_get_free_download_url();
});
}
//}
//d();
function hasError(){
}
function start_get_free_download_url(){
that.html('开始下载').removeClass('btn_noit');
that.bind('click',function(){
api.hide();
todo();
return false;
});
}
}
else{
that.html('还剩'+i.toString()+'秒');
}
},1*1000);
}
return false;
});
return false;
}
else{
todo();
}
function todo(){
var _a = [];
for(var i=0;i _a.push(arg[i]);
}
_a.push('download');
obj.apply(this,_a);
}
}

2011年4月12日星期二

//判断点point是否在区域rgn内部 1--内部 -1--边界 0--外部


//判断点point是否在区域rgn内部 1--内部 -1--边界 0--外部
template <typename T>
int isPointInRgn(const mVector<T> &point, const std::vector<mVector<T> > &rgn)




//判断区域B是否在区域A内部
template <typename T>
bool isRgnInRgn(const std::vector<mVector<T> > &rgnB, const std::vector<mVector<T> > &rgnA)