RSS
 

Archive for 二月, 2009

iTextSharp生成PDF文档

28
<%@ Page language="c#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="iTextSharp.text" %>
<%@ Import Namespace="iTextSharp.text.pdf" %>
<%
	// step 1
	// need to write to memory first due to IE wanting
	// to know the length of the pdf beforehand
	MemoryStream m = new MemoryStream();
	Document document = new Document();
	try {
		// step 2: we set the ContentType and create an instance of the Writer
		Response.ContentType = "application/pdf";
		PdfWriter.getInstance(document, m);

		// step 3
		document.Open();

		// step 4
		document.Add(new Paragraph(DateTime.Now.ToString()));
	} catch (DocumentException ex) {
		Console.Error.WriteLine(ex.StackTrace);
		Console.Error.WriteLine(ex.Message);
	}
	// step 5: Close document
	document.Close();

	// step 6: Write pdf bytes to outputstream
	Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
	Response.OutputStream.Flush();
	Response.OutputStream.Close();
%>
 
 

ASP.net的安全性问题

28

ASP.net本身可以保证通过Gridview和DetailView的主键id作为识别号时,该识别号码不会被恶意篡改,因此此时可以假设客户端传入的id是正确无误的。因此目前代码中很多部分的legalCheck是不需要的。

需要自行做好验证工作的是:如通过自行显示传递的id信息(比如删除Command传入显示的id参数),比如页面的参数信息等。

 
 

买了个蓝牙耳机

26

结果发现原来蓝牙耳机要立体声的才能听音乐(可是立体声的还是有耳机线,于是买无线耳机的意义在哪?),于是这个耳机就只能打电话了。。悲哀

应该买之前多看看询问的。。

网友:Jacksyy    注册会员 2008-09-14 09:24
咨询内容:
该蓝牙耳机能否用来听音乐
京东回复:
您好!抱歉不可以,感谢您对京东的支持!祝您购物愉快!
网友:a356gj    注册会员 2008-08-01 17:06
咨询内容:
支持立体声音乐播放吗?
京东回复:
您好!支持通话不支持听音乐,感谢您对京东的支持!祝您购物愉快!
 
 

[转]Inside North Korea

24

httpv://www.youtube.com/watch?v=kjiLVgQ34i0
httpv://www.youtube.com/watch?v=Aw8fJsV-bQA
httpv://www.youtube.com/watch?v=XhvHTOSsFDU
httpv://www.youtube.com/watch?v=HVFy5o0mDZE
httpv://www.youtube.com/watch?v=NE3wBgSQTOg
httpv://www.youtube.com/watch?v=r-sAFfUmV_4
httpv://www.youtube.com/watch?v=FZRB_bNmwDc

 
 

[转]值得推荐的免费网上课程

24

每个周末,褪墨上都将介绍一些摄影/软件/演讲技巧

如果你是在尝试寻找一些不错的网上课程的话,那么这篇文章可能会对你有些帮助。

麻省的网上学院涵盖的范围非常之广,总计有超过1800门的免费课程,所有的课程都是以多媒体的形式呈现的。当然了,如果你对某些课程的资料感兴趣,你也会找到想要的文本资料,更惊喜的是相当一部分文本资料是以多语言形式提供的,语言在这里并不是问题。

公开学院是英国最大的学术机构,每一个注册的学生都能在里面找到自己想要的资料,无论是历史还是艺术,或者教育和信息技术。

卡耐基学院通过一个名为“开放学习原动力”的计划为所有感兴趣的学生提供详尽的课程介绍和资料共享,不仅如此,卡耐基学院还设有专门的指导人员为学生提供在线的答疑解惑。

和麻省有相似之处,图夫也是对所有人开放并且提供各专业的学习资料,课堂笔记,作业展示等等,所有的资料都是按学院划分,这样在搜索的时候会很方便。

作为全球最强的大学之一,斯坦福选择了和业界巨头苹果合作,这样所有在斯坦福网络得到的资料都可以直接传入iPod和Mac播放,用户更是可以在自己的iTunes中为斯坦福专门建立一个分类。

伯克利在网络教学方面起步较早了,2001年开始他们就将很多课程的教学资料,课堂笔记等内容同步地放到了网络上,如今在伯克利的网络教学中心,更是可以轻而易举地找到上百种课程的资料,基本涵盖了所有的专业和课程。

犹他大学将几乎所有的课程资料都放在了网上,而且提供即时的资料下载。

科茨城的小型商务发展中心是互联网上资料最全面的小型商务资料库,涵盖了概念内的所有方面,并且提供文本,幻灯片,图片和视频等多种形式的展示手段,对于一些不熟悉小型商务的人来说是很有帮助的。

绝大部分的课程资料都可以在网上获得,而且南昆大还提供在线的即时咨询。

埃尔文是近期才加入加州大网络学校的,所以暂时只能提供部分的专业课程和资料下载,不过鉴于加州大的雄厚实力,埃尔文的发展前景和增长速度会很快弥补缺陷的。

原文:Universities With the Best Free Online Courses

译者:铁灰色

 
 

Argument No.8

20

The following appeared in a memorandum issued by the strategic planning department at Omni Inc.

“Mesa Foods, a manufacturer of snack foods that currently markets its products within a relatively small region of the country, has strong growth potential. Mesa enjoyed a 20 percent increase in profits last year, and its best-selling product, Diabolique Salsa, has had increased sales over each of the past three years. Since Omni Inc. is interested in reaching 14-to-25 year olds, the age group that consumes the most snack food, we should buy Mesa Foods, and concentrate in particular on marketing Diabolique Salsa throughout the country.” 


Refined Version

It is recommended in a memorandum of Omni that the company buy snack-food manufacure Mesa Foods and aggressively promote its brand of salsa nationwide. In order to support this recommendation, the memo indicates: (1)Mesa’s salsa’s sales has increased in last three years and its profits were up for 20% last year.(2)Omni is interested in  reaching 14-to-25 year-old age group which comsumes the most snack food, while Mesa is a snack food manufactor in a small region whose product is profitable to be promoted in nationwide. However, several unfounded assmption and dubious evidence has prevented the recommendation to be convincing as it stands.

First of all,  the memo indicates Omni is interested in reaching 14-to-25 year olds. The argument rests on the assumption that Mesa’s snack foods appeal to this age group. However the 14-to 25 year-old age group comsumes the most snack food does not mean people in this age group will like Mesa’s products. It is entirely possible that Mesa’s snack food appeals to other age groups, in that case the recommendion will not serve Omni’s goal.

Secondly, the author overlooks the 20% increase in profits. In this memo, the arguer fails to demonstrate the absolute profit of Mesa, therefore 20%, only a percentage, is just to vague to support the upgoing of the company. It is absolutely possible that there’s only a little fraction of amount of profits that were made by Mesa. In addtion, the increasing sales of its product were also to vague to lend strong support to the success of Mesa’s products.

Finally, the arguments rests on the assumption that a popular food brand in a small region will continue its success after promoted to the whole nation. However, it maybe not this case. People in different areas may have different interests, and succeed in a nationwide campain is also much more difficult.

In sum, this author fails to support his recommendation in this memo. In order to convince me that the Mesa Foods acquisition would be profitable,  the author should have provided the statistical evidence that Mesa and its products are popular in 14-to-25 years age. In addtion, the author should have included the absolute data of the profit and sales condition of Mesa Foods. Finally, it is also suggested a survey nationwide should be conducted to ensure that Mesa’s products appeal to people nationwide. If the author has included the information disscussed above, the recommendation should have been more convincing.


Initial Version

It is suggested that the company should buy Mesa Foods, a manufacturer of snack foods,  in the memorandum issued by the strategic planning department of Omni. Inc. In order to support the conclusion, several evidences are included in the memo: (1)Mesa enjoyed a 20% increase in profits last year, and Diabolique Salsa, its best-selling products has increased sales for three years (2)Mesa is currently a snack food manufactor in a small region, while Omni is interested in reaching 14-to-25 year olds which age group consumes the most snack food, while . However, there are several logical flaws in this memo, so it does not that convicing as the author claims.

First of all, it is true that Omni is interested in reaching 14-to-25 year olds which age group consumes the most snack food, however it does not mean that Mesa’s products or Diabolique Salsa will be popular in the arg group 14-to-25 year olds, maybe Mesa’s snack food is most popular in the aged people, in that case it is no more an evidence that Omni should buy Mesa Inc. Without ruling out such possiblities, the author cannot conclude that Mesa will help targeting its main customers.

Secondly, the author over looks the 20% increase in profits. In the memo, there’s a lack of statistics of the acual profit of Mesa inc last year. Maybe the company has suffered from difficulties during the past several years, while 2 years ago it began to earn money, in that case a 20% increase in profit last year was not a big case. And the product whose sales are increased for three year may not be sold as it appears, in other words, an increasing market does not mean anything to the success unless the author gives more macket information. The data is far to vague to be convicing, therefore the conclusing based on it is also meaningless.

Finally, even it is a very good idea to buy Mesa inc, it may not be very successful to promote its product in the nation wide. As we can see, even it sells quite good in a small region, it is difficult to operate in a large one. People in different ares may have different interest, and it is also much more difficult for the operation of both marcketing and sales.

In sum, this author of this memo fails to convince me of the conclusing to buy Mesa Inc due to the lack of statistics and some logicaless assumptions. In order to make this suggestion more convincing, the author should have included the actual data of the profit of Mesa Inc and its marcketing information each year.  And also a survey should have been conducted to know the customer diversion of Mesa’s products. Finally, before sell its products in a nation wide, another suvery should be conducted to ensure that people all over the nation are interested to buy its products. If the author has included the data or statisticions above, and conducted the suverys suggested before, based on such data, the conclusion should have been more meaningful.

 
 

Google Sync: 支持同步的手机都可以(索爱已测试)

10

同步Gmail中的联系人和手机通讯录
Google Sync把手机的通讯录之类的和Google 服务器同步。中国移动有个收费的服务(号簿管家?)类似的。不过Google 是免费的,这玩意不错,要是手机丢了也问题不大,号码不会丢了 ,而且和google 的联系人是一起的,有空可以整理整理。

使用前请先整理Gmail通讯录,否则通讯录中乱七八糟的人出现在手机号码簿中概不负责!

记得不要用wap连接,要用internet连接(Jerry说wap没问题,看来我多虑了)

具体请见http://www.google.com/support/mobile/bin/topic.py?topic=13584
大部分牌子的手机其实都可以

To set up Google Sync on a Sony Ericsson W800i phone, please follow these steps:

  1. Click the ‘Menu’ key and open the ‘Organizer’.
  2. Select ‘Synchronization’.
  3. Select ‘New Account’ and enter ‘Google Sync’ or any name of your choice.
  4. Enter the following values:
    • Server address: https://m.google .com/syncml
    • Username: your Google Account username, e.g. you@googlemail.com
    • Password: your Google password
    • Connection: select the Internet access point for your carrier
    • Applications: mark ‘Contacts’ only and click ‘OK’
    • App. settings: open ‘Contacts’ and for ‘Database name’ enter ‘contacts’ (lower case), leave other fields blank
    • Sync. interval: choose how frequently you would like to synchronize with Google
    • Leave other settings unchanged
  5. Click ‘Save’ to exit this screen and save your Sync profile.
  6. Highlight your new Sync profile and press ‘Start’.

To set up Google Sync on a Sony Ericsson phone, please follow these steps:

  1. Click the ‘Menu’ key and open the ‘Organizer’.
  2. Select ‘Synchronization’.
  3. Select ‘New Account’ and enter ‘Google Sync’ or any name of your choice.
  4. Enter the following values:
    • Server address: https://m.google .com/syncml
    • Username: your Google Account username, e.g. you@googlemail.com
    • Password: your Google password
    • Connection: select the Internet access point for your carrier
    • Applications: mark ‘Contacts’ only and click ‘OK’
    • App. settings: open ‘Contacts’ and for ‘Database name’ enter ‘contacts’ (lower case), leave other fields blank
    • Sync. interval: choose how frequently you would like to synchronize with Google
    • Leave other settings unchanged
  5. Click ‘Save’ to exit this screen and save your Sync profile.
  6. Highlight your new Sync profile and press ‘Start’.
 
 

GRE单词百日强化计划

01

一、具体方法

  • 每天早上学习新单词,每天晚上复习
  • 大约每天学习新单词1List总计1小时(分为2个单元学习,每个单元约6-7页)每页大约花费5分钟学习,后大约花30秒立即复习然后开始新的一 页,记忆1个单元后也需花2-3分钟立即全部复习。
  • 需在12小时,第二天,第四天,第八天,第十五天,第三十天晚上进行复习,每次复习每个List大约花费15分钟。
  • 复习时,看页底复习区域(或用卡片遮住红宝书右侧中文释义),只看英文单词,试图回忆,对比答案是否正确,如果错误迅速强化该词记忆,并标记 一个△记号。针对带△较多的单词可多复习一遍。超过5个△记号的单词需单独摘录强化记忆。 复习尽可能不按照学习顺序复习。

时间安排表

  • 中期是最艰难的时刻,如真的无法坚持可考虑拆分,无论何时,每天必须保证时间复习或学习单词,不可间断一天。
  • 若某天如果无足够时间学习新单词或复习旧单词,则该天任务拆成2天,该天根据先复习后学习,先就近复习后就远复习的方式<但不包括复习当天单词,因为当天单词尚未学习>优先“学习”。以尽可能多复习为最终法则(把学习的时间挪用为复习)。
    以第18天为例,该天的计划为:L18 R18 R17 R15 R11 R4如无足够时间学习,则优先执行R17 R15 R11,第二天进行L18 R18 R4。
  • 第30天才开始的最后一遍巩固可适当加快速度。

template

template

 
1 Comment

Posted in 未分类