Elvuel

善战者无赫赫之功

  • Home
  • Atom
  • About Elvuel
« Previous 1 2 Next »

ruby windows服务管理

戊子[鼠]年 七月廿六

&am

require 'gem_plugin'
#svc_name,host=nil,option
def service_create(svc_name,option={})
 gem 'win32-service', '〉= 0.5.2', '〈 0.6.0'
 require 'win32/service'
 svc = Win32::Service.new
 begin
 svc.create_service{ |s|
 s.service_name = svc_name # =〉 String
 #s.host = nil
 s.display_name = option[:display_name] # =〉 String
 s.service_type = option[:service_type] # =
read more >>

Tags: ruby   Posted in Ruby & Rails

rails验证码实现

戊子[鼠]年 五月廿八

参考:A:http://babo.javaeye.com/blog/72298

B:http://hi.baidu.com/jspring/blog/item/c8cf441e6eae72f71bd576a2.html(原文出于ZHOU‘S BLOG)

一、下载安装RMagick(本地使用WINDOWS系统,所以我下载WIN32的RMagick)

下载地址: http://rubyforge.org/projects/rmagick/ rmagick-win32

解压安装EXE 以及 目录下的RMagick 的gem

二、在APP/

read more >>

Tags: rails 验证码 rmagick   Posted in Ruby & Rails

ruby中range作为布尔表达式

戊子[鼠]年 五月初五

Ruby的Range实现3种不同特性:序列、条件、间隔。

Range操作符:.. 以及 ...(两点和三点)

两点形式创建闭合区间(包括右端值)

1..10000 'a'..'z'

三点形式创建半开闭区间(不包括右端值) elvuel_array=%w(www.elvuel.com elvuel.com elvuel)

0...elvuel_array.length

可根据自定义的对象创建区间,限制是自定义对象必

read more >>

Tags: ruby range   Posted in Ruby & Rails

C# 从WebBrowser中取得Cookie

戊子[鼠]年 四月初八

CookieContainer cookieContainer = new CookieContainer();

string cookieStr = IEBrowser..Document.Cookie;
string[] cookstr = cookieStr.Split(';');
foreach (string str in cookstr)
{
 string[] cookieNameValue = str.Split('=');
 Cookie cookie = new Cookie(cookieNameValue[0].Trim ().ToString(), cookieNameValue[1].Trim ().ToString());
 cookie.Domain = "www.elvuel.com";
 cookieContainer
read more >>

Tags: c# WebBrowser   Posted in Ruby & Rails

C# WebBrowser控件中提取图片至剪切板

戊子[鼠]年 四月初四

这段时间elvuel在对某系统博客进行自动注册激活的工作中,由于目标系统,做了一些限制。用c#的WebRequest或引用XMLHTTP两种方法无法完成工作。没办法只有采用WebBrowser组件来完成工作,但网页中的验证码图片如何提取呢?网上搜索参考了一些文章,今晚就试了一下,将图片COPY到CLIPBOARD中。这样就可以使用

read more >>

Tags: c# WebBrowser   Posted in Uncategorized

asp记录输出为excel

戊子[鼠]年 三月十九


〈 % Response.Buffer = False
' Response.Charset = "UTF-8"
 Response.AddHeader "Content-Disposition", "attachment;filename=key.xls"
' Response.ContentType = "application/octet-stream"
 Response.ContentType = "application/vnd.ms-excel"
 
 Dim Sql 
 Sql = "select * from www_elvuel_com papalaladadafafa...."
 If Trim(sql) = "" Then
 BinaryOutPut("No Commander") 
 Else
 Dim Rs,
read more >>

Tags: asp   Posted in Uncategorized

asp将汉字在网页上转换为黑格式

戊子[鼠]年 二月初十

有段时间没用ASP了,今天有朋友问,ASP中如何将汉字在网页上转换为 黑这种格式。

代码如下:

〈%

Response.Write(Hex(Ascw("黑") + 65536))

Response.Write(Hex(Ascw("空") + 65536))

Response.Write(Hex(Ascw("寻") + 65536))

Response.Write(Hex(Ascw("光") + 65536))

%〉

取出字符的Ascw 如果ASCII码值在255以内 则无需加65536,汉

read more >>

Tags: asp   Posted in Uncategorized

网页页面中的区域控制

戊子[鼠]年 四月初三

〈script language="Javascript"〉
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"nleft="+l);
}
〈/script〉

网页可见区域宽:"+ document.body.clientWidth;// n表示换行,相当于按下回车键 r CR 回车不换行
网页可见区域高:"+ document.body.clientHeight;
网页可见区域宽

read more >>

Tags: javascript   Posted in Uncategorized

重设vss admin的密码

戊子[鼠]年 一月廿四

用UltraEdit打开 um.dat文件。经本人使用后,证实方法有效

以下是转来的内容:

the secret is to hack the um.dat file to remove the Admin password

from offset 80 the bytes are (all numbers are hex)

0:80 55 55 bc 7f 41 64 6d 69 6e 00 00 00 00 00 00 00
0:90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0:a0 00 00 00 00 90 6e 00 00 a8 01 00 00 00 00 00 00

Just load the um.dat

read more >>

Tags: vss   Posted in Uncategorized

rails rake db:migrate说明

戊子[鼠]年 一月廿三

命令 rake db:migrate 作用 将所有未实施的迁移任务都实施到目标数据库上。

命令 rake db:migrate VERSION=编号 作用 撤销迁移任务

db:migrate 的迁移版本信息可以在所创建库 如(elvuel_deployment数据库)下schema_info表中查看到相关记录信息。

read more >>

Tags: rails migrate   Posted in Ruby & Rails

« Previous 1 2 Next »
  • Search

  • Categories

    • Ruby & Rails
    • Jobs
    • Uncategorized
  • Recent Posts

    • Prawn使用Annotation坐...
    • ejabberd mod_archive
    • Capybara get session in ...
    • Juggernaut & Rails
    • RottenEgg发布
    • ruby rmagick 生成DM
    • ActiveResource for no r...
    • Rails生成Model文档
    • 转-Method triggers:inst...
    • 招聘-Ruby on Rails软件...
  • Links

    • RailsCasts
    • The Ruby Reflector
    • Alltop Ruby
    • Command Line Refer
    • Ruby Code Snippets
    • GitHub
    • API Dock
    • OpenSourceRails
    • RailsPlugins
    • RailsLab
    • 15DaysOfJQuery
  • Archives

    • 2012年(1)

    • 2012年01月(1)
    • 2011年(10)

    • 2011年12月(1)
    • 2011年11月(1)
    • 2011年08月(2)
    • 2011年04月(2)
    • 2011年03月(1)
    • 2011年01月(3)
    • 2010年(27)

    • 2010年12月(1)
    • 2010年11月(2)
    • 2010年10月(4)
    • 2010年09月(7)
    • 2010年08月(1)
    • 2010年07月(5)
    • 2010年06月(1)
    • 2010年04月(6)
    • 2009年(13)

    • 2009年10月(1)
    • 2009年05月(2)
    • 2009年04月(1)
    • 2009年03月(2)
    • 2009年02月(7)
    • 2008年(19)

    • 2008年08月(1)
    • 2008年07月(1)
    • 2008年06月(1)
    • 2008年05月(3)
    • 2008年04月(1)
    • 2008年03月(2)
    • 2008年02月(10)

Copyright © 2010 elvuel.com Powered by Elvuel.