2012年8月29日

salesforce 琐碎知识,问题总结 初学者 (一)

salesforce 琐碎知识,问题总结(一)


最近公司一直做salesforce的项目,虽然参与了几个大项目。但感觉很多东西还是一知半解。从今天起开始整理博客。一方面整理一些知识,另一方面把一些经验和问题分享给大家。

从什么地方开始呢?今天看到其他人的博客,也是salesforce 相关,先拿来说说。

Developer Console 

要说Developer  Console 就必须从Debugging 说起。任何编程语言都一样,要想写应用。必须学会调试。

官方的说明地址:http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_debugging_system_log_console.htm|StartTopic=Content%2Fapex_debugging_system_log_console.htm|SkinName=webhelp

初学者最简单的方法就是当出现问题的时候把需要查看的变量打印出来,就像java有system.out ... php有echo 等

在salesforce 中和 System.debug(你要打印的变量)

然后运行Apex页面你将发现 console 里边会多了一条记录。双击后 就会显示该记录的信息了。然后查找DEBUG就能找到你要的变量。

数据类型

Apex是强数据类型的语言,所以做好记住都有什么类型,如果你会java感觉很自如。如果你会php就得小心了。

还有如果你不知道什么是map, 和 list 数据结构。一定想搞清楚,记捞。不过这个已经部署于salesforce 知识范围了。那些是你早该学会的东西。

官方数觉类型地址:http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_primitives.htm

官方数据结构地址:http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_methods_system_map.htm|StartTopic=Content%2Fapex_methods_system_map.htm|SkinName=webhelp


2011年5月13日

Javascript: Einfacher Spamschutz für E-Mail-Adressen 网页开发邮件处理,避免垃圾邮件

使用jquery
<script type=
"text/javascript" src="jquery.js"></script>
<script type="text/javascript">
 
$(function(){
$('.email').each(function(index) {
var s = $(this).text().replace(" [at] ", "&#64;");
$(this).html("<a href=\"mailto:" + s + "\">" + s + "</a>");
});
});
 
</script>

通用javascript
<script type="text/javascript">
 
function convertMailAddress() {
var emailElements;
if (document.getElementsByClassName)
emailElements = document.getElementsByClassName("email");
else
emailElements = document.getElementsByClassNameForOldies("email");
var elementContent, replaceContent;
for (var i=0; i<emailElements.length; i++) {
elementContent = emailElements[i].innerHTML;
replaceContent = elementContent.replace(" [at] ", "&#64;");
emailElements[i].innerHTML =
"<a href=\"mailto:" + replaceContent + "\">" + replaceContent + "</a>";
}
}
 
document.getElementsByClassNameForOldies = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};
 
window.onload = convertMailAddress;
 
</script>

把邮箱写成这样就好了
<span class="email">info [at] domain.com</span>
避免了垃圾邮件

来源 unckel.de




2011年5月11日

JFLAP 工具 形式语言,图灵机,文法,语法分析,L系统软件 (一 JFLAP 工具介绍)

JFLAP is software for experimenting with formal languages topics including nondeterministic finite automata, nondeterministic pushdown automata, multi-tape Turing machines, several types of grammars, parsing, and L-systems. In addition to constructing and testing examples for these, JFLAP allows one to experiment with construction proofs from one form to another, such as converting an NFA to a DFA to a minimal state DFA to a regular expression or regular grammar. Click here for more information on what one can do with JFLAP.

JFLAP实验形式语言,主题包括非确定性有限自动机,非确定下推自动机,图灵机,多种类型文法,语法分析,而L-系统软件。除了构建和测试这些例子JFLAP允许一个实验证明,与建筑形式从一个到另一个,例如将NFA到一个DFA到最小状态DFA的正则表达式正规文法
链接http://www.jflap.org/


2011年5月5日

PHP 基本資料型別

PHP 基本資料型別

  • 4 種 scalar (純量型別)

    • boolean

    • integer

    • floating (double)

    • string

  • 2 種 compound (複合型別)

    • arrays

    • objects

  • 2 種 special type (特殊型別)

    • Resource

    • NULL

提示 scalar (純量) :
只有大小(magnitude),
例如:質量(mass),體積(volume),長度(length), 速率(speed),時間(time),溫度(temperature)

primitive types and ckecking functions in PHP

Type Checking
Function
Type Description
is_bool()
Boolean
one of the two special values true or false
is_integer()
Integer
A whole number
is_double()
Double
A floating point number (a number with a decimal point)
is_string()
String
Character data
is_object()
Object
An object
is_array()
Array
An Array
is_resource()
Resource
A handle for identifying and working with external resources such as databases or files
is_null()
NULL
an unassigned value


How to Configure PHP to Use a Remote SMTP Server for Sending Mail

 

 Configure PHP to Use a Remote SMTP Server for Sending Mail

Note that setting up the internal mail function to use SMTP is
only available on Windows. On other platforms, PHP should use the
locally available sendmail or sendmail drop-in just fine. Alternatively,
you can use the PEAR Mail Package.


A typical configuration might look like:


[mail function]

SMTP = smtp.isp.net

sendmail_from = me@isp.net

2011年5月3日

小技巧为Firefox提速!

想提高你的Firefox的速度?这里教你一招。

越来越多的人已经熟悉了通过修改config文件来使你的Firefox更加强大。不管你是高手还是菜鸟,Gnoted教大家体验更完美的Firefox。即使那些忠实簇拥也不得不承认,Firefox有时会变得很慢——特别是当你尝试在4个窗口中打开35个标签栏时,它会让你感受到什么是绝望。不过,通过改善Firefox的缓存设置,你可以有效加快页面加载速度并减少它对系统资源的消耗。

如果你不了解如何修改config文件,也不要担心。按这里的指导做就万事大吉啦。当然如果你不放心,完全可以记下每一步所做的改动,必要时可以还原所做的修改。好了,不再废话了,现在就开始加速你的Firefox吧。

减少缓存文件所占用的内存:

1.在地址栏中输入“about:config",回车

2.找到"browser.sessionhistory.max_total_viewer"

3.将其值设为 0

加快Firefox加载页面的速度:

1.在地址栏中输入“about:config",回车

通常浏览器加载一个页面只连接一个线程,而如果你启用“pipelining",它会多线程加载,这将加快记得浏览器速)。

2.将”network.http.pipelining"值设为"true"

将”network.http.proxy.pipelining"值设为"true"

将”network.http.pipelining.maxrequests"值设为一个数字,比如 10 (表示同时允许10个线程)

3.最后,右键单击空白处,选择"New(新建)–> Integer(整数)"。将它命名为"nglayout.initialpaint.delay",并将其值 设为 0

(这个值表示浏览器在接受到数据后隔多少秒再进行运算,如果你使用的是宽带,这项设置会使你感到Firefox速度便快了)

可选操作:这些修改同样是在"about:config"下完成的,其中的一些项目需要你通过右键"New(新建)–>Integer(整数)或 String(字串)"。

“network.dns.disableIPv6” 设为 “false”

“content.notify.backoffcount” 设为 5

“plugin.expose_full_path” 设为 “true”

“ui.submenuDelay” 设为 0

当Firefox最小化时,减少内存占用量:

这项设置可以当Firefox最小化时释放10Mb的内存。

1.打开Firefox,在地址栏内输入“about:config”,回车

2.在页面内右键选择“New(新建)-> Boolean”

3.在弹出的窗口中输入"config.trim_on_minimize",回车

4.选择"True",回车

5.重启Firefox