Wednesday, August 18, 2010

穷养儿子富养女

转载
最近读了一篇《穷养儿子富养女》的文章,本人感觉很有道理,把它贴出来,让有兴趣的家长也读一读,或许能得到一点启发。
“穷养儿子富养女”是民间一句古训,对古训的理解,不能一概而论,要从哲学和广义上去领会,不能从狭隘的角度去接受。否则,每条谚语与古训都有偏正。古训,通常言简意赅,寓意深刻,需要我们时刻品味!不能小看! 也有人说男孩放养猛如虎,女孩家养秀如花。我以为,穷是磨练,男孩是泥土身,将来得成长为男人,所以得经摔经得起风雨。富是呵护,女孩是莲藕身,磕不起,得娇贵着点养。穷与富非物质之比,实乃轻重之分。

从来富贵多淑女,自古纨绔少伟男,应当“穷养儿子富养女”。富养的女儿不贪小 利, 气 质非凡;生活的磨砺让穷养的儿子意志更坚强;男孩子以后要走上社会,承担社会责任与家庭责任,所以要穷养以励其志,否则大手大脚,纨绔子弟一个,如何上奉父母,下养妻儿!

富 养的女孩,从小会被带着出入各种场合,增加阅世能力,等到花般年纪,再到尘世里艰难成长,便不易被各种浮华和虚荣所迷惑,一个没见过大世面的女孩,在纨绔 子弟的糖衣炮弹下,很可能被花言巧语所击败。富养的女孩,因为见识多,独立,有主见,明智,很清楚自己真正追求的东 西. 富养女,其实是一种教育投资,教育的富足;穷养男,更是一种挫折教育,男儿当自强,而没有经历过失败挫折的男孩是长不大的。

男生将来是要奋斗的,必须让他知道钱来之不易;女孩是要嫁人的,必须培养她鉴别事物的眼光,别将来被人的一块蛋糕就给哄走了。

富 养女更浪漫。女孩称为千金,估计也有这方面的渊源。虽说相貌由天而生,可也需要后天的精心呵护,需要平日的精致雕琢,这显然需要一定的物质基础。从另一个 角度来说,除了给予较好的物质条件外,更需要开阔女孩的视野与见识。富也是“丰富”的意思。懂得美,懂得欣赏,懂得辨别,也就懂得了自我保护,而不会被外 界的种种所诱惑。

穷 养男更实在。做个真正的男人,这一生要蒙受的磨难、冷眼、屈辱、挫折不知要多少。古人说,天将降大任于斯人,必先劳其筋骨,饿其体肤,苦其心志,如此才能 修身齐家治国平天下。男孩从小就应培养艰苦朴素、吃苦耐劳的作风,仁义孝道的思想,尤其在物质上不能过多给予,否则容易成为又一个纨绔子。

富养20年,芙蓉出水;穷养20载,宝剑出炉。

女孩子不那么担心物质条件,才容易培养出从容的气质,男孩子对物质条件上心一点,才不会散漫。跟天性有关?女孩子天生善于注重细节,再灌输“小气”的思想就容易市侩了。男孩子反之。这是生活的智慧吧?

男孩要意志坚定,女孩要知书达礼。穷养富养大概是这个意思吧。

家养小子,就要从小培养孩子坚强不屈的性格,吃苦耐劳的精神,孝义德善的品质。否则,树木不刷不成材,一味的娇惯、放任、纵容,只会培养出一个不成气的纨绔子弟来。
家有娇女,就要从小多给于疼爱、适度满足物质需求,以达到丰富内心与意识品德。这样,使其懂得美善、学会辨别和自我保护,走上社会才不至于受种种物欲诱惑,避免上当受骗。

这 个题目不是说穷的家庭才养儿子,富家才养女儿,而是指男孩要“穷”养:吃苦受罪,历尽沧桑,日后方能有所作为有担当;女孩要“富”养:生活精致、无忧无 虑,优越的生活就像一针强劲的免疫针,使她以后会对抗诱惑,明辨真伪,成为知情识趣优雅美丽的女子

Friday, August 6, 2010

Tomcat file structure in Eclipse

  • WebContent.
    Regular Web files (HTML, JavaScript, CSS, JSP, images, etc.)
  • WebContent/some-subdirectory
    Web files in subdirectory.
  • WebContent/WEB-INF
    web.xml (used for servlet mappings)
  • WebContent/WEB-INF/lib
    JAR files specific to application.
  • src/(default package)
    Unpackaged (default package) Java code. Using the default package is generally a bad choice in Web apps.
  • src/somePackage
    Java code in somePackage package.
  • Note:
    You can cut/paste or drag/drop existing files into appropriate locations, but it is hard to drag files into a Java package until you create at least one class first.

Thursday, August 5, 2010

XSSearchEngine do not go to result page (open search)

In the skin file of the search module reference, setup a proper result page id.

Monday, July 19, 2010

log error in DotNetNuke

(new DotNetNuke.Services.Log.EventLog.EventLogController())
.AddLog("Exception", ex.ToString(), DotNetNuke.Entities.Portals.PortalSettings.Current,
-1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);


or


catch (Exception ex)
{
DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
//throw;
}

Generate a self-signed certificate

makecert -pe -n "cn= www.domain.co.nz " -ss my -sr LocalMachine -r " www.domain.co.nz " -sky exchange

Thursday, July 8, 2010

Dotnetnuke Logging to the EventLog

First, create an instance of the EventLogViewer...

Dim objEventLog As New DotNetNuke.Services.Log.EventLog.EventLogController

Next, log the event you wish to trap...

objEventLog.AddLog("Sample Message", "Something Interesting Happened!", PortalSettings, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT)

Friday, July 2, 2010

Blackra1n ASL. dll Error

Go to: C:\ program files\common files\apple\apple application support


Than copy blackra1n into that folder.

Iphone restore error 3194 fix

Navigate to “c:\windows\system32\drivers\etc\” and open the ‘hosts’ file in notepad. To do so, right click on the file and select Open With->Notepad. At the end of the document, add this string “74.208.10.249 gs.apple.com”.

Wednesday, June 30, 2010

DNN programmatically login user

PortalSettings currentPortal = PortalController.GetCurrentPortalSettings();

UserLoginStatus loginStatus = new UserLoginStatus();

UserInfo objUser = UserController.ValidateUser(
currentPortal.PortalId,
ConfigurationSettings.AppSettings["DnnLoginUser"],
ConfigurationSettings.AppSettings["DnnLoginPassword"],
"DNN", "",
currentPortal.PortalName, HttpContext.Current.Request.UserHostAddress, ref loginStatus);

if (loginStatus == UserLoginStatus.LOGIN_SUCCESS)
{
UserController.UserLogin
(currentPortal.PortalId,
objUser, currentPortal.PortalName,
HttpContext.Current.Request.UserHostAddress, false);
}

Monday, June 28, 2010

disable enter key

<asp:TextBox onKeyPress="return disableEnterKey(event)" runat="server" name="txtUserName" ID="txtUserName" MaxLength="20" Width="135px"></asp:TextBox>

function disableEnterKey(e) {
var key;
if (window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
return (key != 13);
}

Monday, June 14, 2010

Setup Ubuntu as web server

http://www.securenetwork.it/ricerca/whitepaper/download/Debian-Ubuntu_hardening_guide.pdf

SELinux for Ubuntu Server:
http://selinuxproject.org/files/2008_selinux_developer_summit/2008_summit_brindle_ubuntu.pdf

The installation is as simple as:
Sudo apt-get install selinux

SELinux disables AppArmour

Wednesday, June 2, 2010

POST in asp.NET page without nesting forms

if (!IsPostBack)
{
ScriptManager.RegisterStartupScript(Page, this.GetType(), "postback", "function doExternalPost(targetUrl) { theForm.__VIEWSTATE.value = ''; theForm.encoding = 'application/x-www-form-urlencoded'; theForm.action = targetUrl; theForm.submit(); }", true);
}

litText.Text = string.Format("<input name="postInfo" value="{0}" type="hidden"><a onclick="\"javascript:doExternalPost('{1}');\"">clickme</a>", "prodABC" , "postURL");

Tuesday, June 1, 2010

reference jQuery in Visual Studio

<%if (false) { %>

<script language="javascript" type="text/javascript" src="../../Resources/Shared/scripts/jquery/jquery-1.4.2.js"></script>

<script language="javascript" type="text/javascript" src="../../Resources/Shared/scripts/jquery/jquery-1.4.2-vsdoc.js"></script>

<%} %>

<script language="javascript" type="text/javascript"><br /><br /> $(document).ready(function() {<br /><br /> });<br /><br /></script>

Saturday, May 22, 2010

iPhone unlock

Firmware: current version 3.1.3, can be jailbroken easily now. Unlock has nothing to do with jailbreak. If update the firmware, baseband will be automatically updated.

Baseband: control the GSM frequency. This is how Apple lock iPhone to stop people use it under other GSM network rather than AT&T. Due to T-mobile has similar frequency, locked iPhone can be used under T-mobile some how. The latest baseband 5.12.01 hasn't been unlocked yet (except some videos on YouTube), so hacker need to downgrade it to 5.11 to unlock iPhone. However, the latest bootloader 5.9 has fix the bug which allows people downgrade baseband from 5.12.01.

Bootloader: it is a hardware, can't be upgrade/downgrade unless modify the iPhone hardware, just like the camera. Only the bootloader before 5.9 has the bug to allow people downgrade baseband. However, most of the new iPhone 3G/3GS is using the bootloader 5.9.

Friday, May 7, 2010

Loading UserControl Dynamically in UpdatePanel

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:updatepanel id="pnl1" runat="server">
<contenttemplate>
<asp:placeholder id="plh1" runat="server"></asp:PlaceHolder>
</contenttemplate>
</asp:UpdatePanel>

private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}

private void LoadUserControl()
{
string controlPath = LastLoadedControl;

if (!string.IsNullOrEmpty(controlPath))
{
plh1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
plh1.Controls.Add(uc);
}
}

protected void Page_Load(object sender, EventArgs e)
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();

string controlPath = string.Empty;

if (Settings.ContainsKey("ddl1"))
controlPath = Settings["ddl1"] + ".ascx";
else
controlPath = "Expired.ascx";

LastLoadedControl = controlPath;
LoadUserControl();
}

Comparison of Android vs iPhone vs Nokia vs BlackBerry vs Windows Mobile 7

Android (Open Handset Alliance)
* open platform
* can compile custom firmwares - good for hackers and other
* good framework, extended on each new firmware
* supports multitasking
* nice GUI - Eclipse
* development SDK is free
* easy to debug, can send logs to developers
* Android uses a version of Linux as its kernel (albeit tweaked by Google to fit Android needs and separated from the main Linux kernel tree), but it is not a conventional Linux distribution; it does not have a native X Window System, neither does it support the full set of standard GNU libraries like its system libraries (GNU C Library). This makes it difficult to reuse existing Linux applications or libraries on Android. Android does not use established Java standards, i.e. Java SE and ME. This prevents compatibility among Java applications written for those platforms and those for the Android platform. Android only reuses the Java language syntax, but does not provide the full-class libraries and APIs bundled with Java SE or ME. However, Myriad's J2Android, launched on 19 March 2010, allows seamless conversion of Java MIDlets into Android applications.
* programming language is Java but bridges from other languages exist (C# .net - Mono, etc)
* Android supports Java 1.5 and translates the byte code to its own custom Dalvik byte code optimized for mobile devices.
* for the hardcore programmers, Android offers the possibility of programming in C using the native dev kit NDK
* can run script languages like LUA, Perl, Python, etc
* can install third party applications from sdcard, random sites - not locked to a specific market
* applications can hook and override everything - email interface, SMS sending, custom keyboards, etc
* supports widgets
* can publish applications on the Android market instantly - initial one time registration fee is 25E
* user has access to the sdcard and can use it as a USB disk
* native Adobe Flash support after 2.1

Symbian (Nokia)
* opened Symbian and says the future will be QT and WRT - they will cut support to any other environment including J2ME
* Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code. (C++)
* One Developer License Qt Desktop Single Operating System $3 695
* QT runs on Maemo, MeeGo, BlackBerry, Symbian, Windows Mobile, desktop PC, consumer electronics, car entertainment, etc
* QT is available stand along IDE, or Integration/Add-in for Eclipse and Visual Studio
* WRT - web runtime - a cool feature that allows users to write applications in HTML, JS and CS. You build the app like a normal web page, and you interact with the phone platform/hardware using the WRT bridge. Just HTML, JS and CS. Very important: JS can call native code, but also the other way around. It seems you can call WRT JS with native code.
* supports Adobe Flash Lite
* nice GUI - Eclipse
* development SDK is free

MeeGo (Nokia and Intel)
* MeeGo applications are written in C++ using the MeeGo SDK, including Qt.
* nice GUI - Eclipse
* development SDK is free


iPhone (Apple)
* closed platform
* development kit costs
* programming language only allow Objective C (appeared in 1986)
* applications are not allowed to duplicate the iPhone functionality - ie no custom email interface, etc
* NO sd card
* third party applications can only be installed from the Apple store. publishing on the store is a very lengthy and tiresome process. Apple has many and bizarre rules. Many applications were rejected for strange reasons.
* no Adobe Flash support

WebOS (HP)
* hope HP will not kill the brilliant WebOS
* web program (Html, CSS, JavaScript)

BlackBerry (Research In Motion)
* Java native (J2ME) and web development
* the new OS 6 is coming


Windows Mobile 7 (Microsoft)
* break compatibility with WM 6.x
* programming environment is Silverlight and XNA
* no native programming ie no hooking and overriding keyboard, etc - they removed PInvoke
* nice GUI - Visual Studio 2010
* MS marketplace
* no Adobe Flash support


Windows Mobile 6.x (Microsoft)
* native C, C# with PInvoke

Bada (Samsung)
* The Bada operating system has a kernel configurable architecture, which allows the use of either the Linux kernel, or another Real-time operating system (RTOS) kernel. The Linux kernel is the preferred choice for smartphones, while RTOS is used for cheaper feature-phones, due to its smaller memory footprint.



Ref: http://adrianvintu.com/blogengine/post/Comparison-of-Android-vs-IPhone-vs-Nokia-vs-BlackBerry-vs-Windows-Mobile-7.aspx
http://en.wikipedia.org/wiki/Android_(operating_system)

GRUB 2 modification

/etc/default/grub

sudo update-grub




+++++++++++++++++++++++
http://ubuntuforums.org/showthread.php?t=1195275

Find kernel:
uname -a : print all information

uname -r : print the kernel release

uname -v : print the kernel version

uname -o : print the operating system

In Synaptic package manager, search "linux-image"

===================================

How to add a splashmage in GRUB2
http://members.iinet.net/~herman546/p20/GRUB2%20Splashimages.html

sudo apt-get install grub2-splashimages
sudo cp /usr/share/images/grub/*.tga /boot/grub/
gksudo gedit /etc/grub.d/05_debian_theme
scroll down in the file and find line 16 or 17
change the following code in line 16 or 17 from:
for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do

to replace 'moreblue-orbit-grub' with the name of the splashimage of your choice)
for i in {/boot/grub,/usr/share/images/desktop-base}/Windbuchencom.{png,tga} ; do

Ubuntu Sudo command

========sudo open file browser, and then Ctrl+H to show hidden files
gksu nautilus

========Clean up past installation of Flash:
sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper


========install flash (Shockwave flash 10)
When you go to a site by firefox that requires flash you will see a bar appear with a button on the right side labeled “Install Missing Plugins”.Choose the Adobe version and click Next. You will then be warned that the Adobe Flash Player will download and install another application. This is okay. You will be required to enter your user password to continue.

OR

sudo apt-get install flashplugin-nonfree

========map iphone
mkdir /mnt/iPhone
mount.fuse.ifuse --afc2 /dev/hda /mnt/iphone/ -s

========current running kernel version
uname -r

========create symbolicLink dir1 into dir2
ln -s /dir1 /dir2

========list all of the usb devices
lsusb


========.tar.gz Source Installation/Compilation
tar -xzvf /home/bob/compressedfile.tar.gz
./configure
make
su
make install

========Binary install tar.gz
tar -xzvf /home/bob/compressedfile.tar.gz

========.Binary install tar.bz2
tar -xjvf /home/bob/compressedfile.tar.bz2


========Support RAR
sudo apt-get install unrar

========Install DEB OpenOffice
sudo apt-get remove openoffice*.*
tar -vxzf filename
cd OOo_inst_folder/DEBS
sudo dpkg -i *.deb
cd desktop-integration
sudo dpkg -i *.deb

Install Netbook remix to Desktop Ubuntu

sudo gedit /etc/apt/sources.list

ADD:
deb http://ppa.launchpad.net/netbook-remix-team/ubuntu intrepid main
deb-src http://ppa.launchpad.net/netbook-remix-team/ubuntu intrepid main
Save and exit the file.

sudo apt-get update
sudo apt-get install go-home-applet human-netbook-theme maximus netbook-launcher window-picker-applet

run:
netbook-launcher
maximus

Tuesday, May 4, 2010

iPhone CPU

Original & 3G: Samsung 32-bit RISC ARM 620 MHz underclocked to 412 MHz
3GS: Samsung S5PC100 ARM Cortex-A8 833 MHz underclocked to 600 MHz

Quote of the day

If you find a job you love, you never have to work a day in your life.
知之者不如好之者,好之者不如乐之者

最奢侈的事情

盯着时钟, 欣赏秒针一格一格的滑过...

Ubuntu auto mount NTFS drive by fstab, solve the can't be moved to trash problem

===step 1===
Find out uid and gid:
type id in terminal

===step 2===
modify file: /etc/fstab

/dev/sda2 /home/ProgDoc auto defaults,umask=007,uid=1000,gid=1000 0 0

===step 3===
symbolicLink (sudo)

ln -s /home/ProgDoc/Documents /home/username

Monday, April 19, 2010

call javascript function every time when the page load

//call javascript function every time when the page load
//include the partial page post back

ScriptManager sm = ScriptManager.GetCurrent(Page);
if (sm.IsInAsyncPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "CheckingCostDiv();", true);
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "Sys.Application.add_load(CheckingCostDiv);", true);
}

Wednesday, April 14, 2010

Comparison of wireless data standards






































































Comparison of Mobile Internet Access methods
StandardFamilyPrimary UseRadio TechDownlink (Mbit/s)Uplink (Mbit/s)Notes
LTEUMTS/4GSMGeneral 4GOFDMA/MIMO/SC-FDMA36080LTE-Advanced update expected to offer peak rates of at least 1 Gbit/s fixed speeds and 100 Mbit/s to mobile users.
WiMAX802.16eMobile InternetMIMO-SOFDMA14435WiMAX update IEEE 802.16m expected offer up to 1 Gbit/s fixed speeds.
Wi-Fi802.11

(11n)
Mobile InternetOFDM/MIMO288.9

(Supports 600Mbps @ 40MHz channel width)

Antenna, RF front end enhancements and minor protocol timer tweaks have helped deploy long range P2P networks compromising on radial coverage, throughput and/or spectra efficiency (310km & 382km).


EDGE EvolutionGSMMobile InternetTDMA/FDD1.90.93GPP Release 7
UMTS W-CDMA

HSDPA+HSUPA

HSPA+
UMTS/3GSMGeneral 3GCDMA/FDD



CDMA/FDD/MIMO
0.384

14.4

56
0.384

5.76

22
HSDPA widely deployed. Typical downlink rates today 2 Mbit/s, ~200 kbit/s uplink; HSPA+ downlink up to 56 Mbit/s.
EV-DO 1x Rev. 0

EV-DO 1x Rev.A

EV-DO Rev.B
CDMA2000Mobile InternetCDMA/FDD2.45

3.1

4.9xN
0.15

1.8

1.8xN
Rev B note: N is the number of 1.25 MHz chunks of spectrum used. Not yet deployed.

http://en.wikipedia.org/wiki/Comparison_of_wireless_data_standards

Tuesday, April 13, 2010

Get URL parameters & values with jQuery

http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html

// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}

http://www.example.com/?me=myValue&name2=SomeOtherValue

var second = getUrlVars()["name2"];

$.extend({
getUrlVars: function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function(name){
return $.getUrlVars()[name];
}
});

// Get object of URL parameters
var allVars = $.getUrlVars();

// Getting URL var by its nam
var byName = $.getUrlVar('name');

Wednesday, April 7, 2010

ASP.NET AJAX UpdatePanels post less data by JSON

http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

OLD style:
<asp:ScriptManager ID="ScriptManager1" runat="server" />

<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<asp:Label runat="server" ID="Label1" Text="Update Me!" /><br />
<asp:Button runat="server" ID="Button1"
Text="Postback Update" OnClick="Button1_Click" />
ContentTemplate>
asp:UpdatePanel>

protected void Button1_Click(object sender, EventArgs e)

{
Label1.Text = DateTime.Now.ToLongDateString();
}

NEW style:
<asp:ScriptManager ID="ScriptManager1" runat="server"

EnablePageMethods="true" />
<script language="javascript">
function UpdateTime() {
PageMethods.GetCurrentDate(OnSucceeded, OnFailed);
}

function OnSucceeded(result, userContext, methodName) {
$get('Label1').innerHTML = result;
}

function OnFailed(error, userContext, methodName) {
$get('Label1').innerHTML = "An error occured.";
}
script>
<asp:Label runat="server" ID="Label1" Text="Update Me!" /><br />
<input type="button" id="Button2" value="Web Method Update"
onclick="UpdateTime();" />

[WebMethod]

public static string GetCurrentDate()
{
return DateTime.Now.ToLongDateString();
}

Saturday, April 3, 2010

List of countries by GDP (PPP) per capita - International Monetary Fund (2009)

Do you think your country is rich? have a look this:

Rank Country Intl. $
1 Qatar 87,717
5 Singapore 49,433
6 United States 46,443
7 Hong Kong 42,574
12 Canada 38,290
14 Australia 37,302
20 United Kingdom 35,165
22 Germany 34,219
23 France 33,744
24 Japan 32,817
27 Republic of China (Taiwan) 29,829
29 Italy 29,290
32 Korea, South 27,791
34 New Zealand 26,625
51 Russia 15,039
— World[5] 10,348
79 Saint Vincent and the Grenadines 10,198
80 South Africa 9,961
97 China, People's Republic of 6,546
128 India 2,932

Ref:http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%28PPP%29

Friday, March 26, 2010

jQuery scrollto page

ScriptManager.RegisterStartupScript(this.Parent.Page, this.GetType(), "ScrollDown2Result",
"$(document).ready(function() {$" +
"('html,body').animate({ scrollTop: 800}, 'slow');" +
"});", true);

Saturday, March 20, 2010

javascript execution after asynchronous postbacks

If you are in a user control you have to reference the parent in RegisterStartupScript.

ScriptManager.RegisterStartupScript(this.Parent.Page, this.GetType(), "foo", "document.getElementById('" + this.ad_display.ClientID + "').innerHTML = ('" + DateTime.Now.ToString("yyyyMMddhhmmss") + "');", true);

Thursday, January 7, 2010

转载 2010年1月Twitter经典语录

* 某人上餐厅用餐,结果菜令他很不满意。对服务生说:"你们的菜怎麽这麽难吃,叫经理来。”服务生:"经理到路对面餐厅吃 午饭还没回来。”
* 看护照是美国人;看长相是日本人;听口音是台湾人;一开口,原来是Dang的人!——网友评阮次山

* 境界:一个好记者只有一件事要做——说出真相(克朗凯特语)。一份好报纸只有一件事要做——不惹 麻烦(清远日报总编辑潘伟语)

* 冯小刚评《阿凡达》:“很好看的电影。但我也听到很多声音说中国导演需要检讨,这个 我不同意。中美的差距,各个方面都存在,人家的战斗机比我们也先进很多啊。”

* 我吃饭的时候,饭否没了;我唱歌的时候,谷歌没了;我坐公交的时候,博 客大巴没了;我在想我要不要申请入党…

* 革命以前,我是做奴隶;革命以后不多久,就是受了奴隶的 骗,变成他们的奴隶了。——鲁迅

* 曹操出土后答记者问:你死在洛阳,为何选在安 阳建墓穴? 曹:首都房价太贵,二线城市便宜。问:陪你沉睡千年的女人到底是谁?答:嘘,她是貂蝉,字海藻。问:最后可否谈谈你对这个新时代的看法?答:孤已用名字回 复

* 黄先生热爱革命,为纪念红军,给 儿子取名为'军',一天送儿子上课,见公交 8路进站, 于是冲儿子大喊:黄军快跑,八路来了!

* 互联网就是我们的潘 多拉星球,所有的文字一旦上网,就会马上变成无数的阿凡达。 你可以在某一时刻消灭一个阿凡达,也可以在某个地区消灭一些阿凡达,但你永远也不可能在所有的地区消灭所有的阿凡达。

* 百度一 下,你就知道;Google一下,你丫知道太多了

* 10 年后我们再次相见。姑娘神秘问我:”生活过得有意思吗?“我说:”没。“她让我第二天早上7点去宾馆。我一夜没睡,早起冲到宾馆,她迎我进去,问道:”你 听说过安利吗?“

* 山 寨是山寨者的通行证,被山寨是被山寨者的墓志铭。

* 子 在川上曰:我是老二

* 北 京移动澄清黄色短信处理结果,仅关闭短信功能,未宣布将此类情况停机 -- 网友评论: 只能禁黄色短信,不能禁黄色通话,革命尚未成功,傻逼还须努力。

* 网 易网友评论《CN域名数量剧减 中国拟恢复个人注册》:你叫我滚,我滚了,你叫我回来,对不起,已经滚远了。

* 香 港是什么都可以做,除了法律不允许的;新加坡是什么都不能做,除了法律允许的;台湾是什么都可以做,包括法律不允许的;大陆是什么都不能做,包括法律允许 的。——唐从圣在《全民大闷锅》里模仿李敖

* 阿 凡达被停映的三个理由:(1)阿拉伯人对美国提出诉讼,说是片名侵犯了阿凡提的名字权。(2)影片动静太大,影响地球构造,间接造成了海地的地震;(3) 孔子曰,“述而不作,停而不说”。

* 韩 寒:从今天起,做一个低俗的人/劈腿翻墙 周游世界 /从今天起,污染粮食和蔬菜/我有一个房子 面向大海 却被强拆

* 扫 黄时代的短信:亻尔 女马 白勺 纟工 火尧 肉 木奉 木及 了!

* 马 云评论谷歌退出中国:这是失败者爱找借口。网友Zs评论马云:感觉他像IT界的成龙。

* 通 向朝鲜之路岂是一小小谷歌可以阻挡的!

* 在 我向你们发表讲话之际,某些**的审查人员正忙着将我的话从历史记录中删除。但是历史早就谴责这种伎俩。——希拉里

* 那 个从废墟下活过来的女孩将会活下去、并长大,因为网络可以把被掩埋的声音传出来,让我们一起为后代创造所有我们可以提供的机会。

* 刚才新闻联播说:作为一个基层干部, 人民的事就是自己的事。然后紧接着又说:自己的事再大都是小事。//我也听到了,默然良久,曰:“牛!”

* 最新消息,上海10086因为发送宣 传短信“一次性 交纳五百元送话费”,被移动自己给封了

* 教育部六拜:一拜壮美河山污染,二拜 炎黄始祖蒙羞,三拜历代英杰不耻,四拜革命先烈糊涂,五拜英雄模范演戏,六拜亿兆黎民遭殃。

* 同学们,努力让韩寒占领全世界李克强前阵子参观阿里巴巴 到了技术部,看到一个程序员正编程。此人看到李克强一直看着他,还继续写程序。接待人员怕尴尬,就问他,你知不知道他是谁啊? 他说,不认识。 接待人员无奈提醒他,这可是我们国家的总理啊 他马上站起来,深深鞠了一躬,说 温总理

* 非常不小心说:全国票房重镇上海今天 才卖出几百张孔子的票,上海影迷抵制得太彻底了,某些人慌了,经紧急协商,全国没有3D的影院可以继续上映2D版阿凡达,晚上开始部分影院就可拿到拷贝

* 韩寒同学在办杂志受挫之后,频繁使用 博客发泄自己的满心兽欲。上海的文化监管部门这是何苦呢?你就让他办一份杂志好了,现在也不会每天那么尴尬,眼睁睁看他弄得烽烟四起,天下大乱。

* 敏感词进化史:我爱北京天安门--》 我爱北京敏感词--》我爱敏感词敏感词--》我敏感词敏感词敏感词--》对不起,该页无法显示。

* 个体活得开心一点、自由一点、求知欲 强一点、对他人的胁迫少一点、宽容一点,对群体来说,就是了不起的贡献了。

* 世界流量最大的20个网站中,中国无 法访问的只有5个(facebook,youtube,blogger,twitter,wordpress),可见中国的互联网至少有四分之三是自由和 开放的。

* 在国内被地震砸死只是屁民一个,在国 外被地震砸死就成了烈士。看来不仅是“谁叫你不幸生在中国”,且还是“谁叫你不幸死在中国”。

* 扫黄是中国最大的闹剧,谁不知道,各 种黄色场所是谁开的,最有资格黄,最黄的人是谁。包二奶的人惩治发黄段子的人……

* 《低俗》小时候/低俗是一盘小小的磁 带 /我在这头/ 丽君在那头;后来啊/ 低俗是一团窄窄的纸条 /我在后头/ 女生在前头;长大后/ 低俗是一张薄薄的光盘 /我在这头/ 电视在那头; 而现在/ 低俗是一条短短的信息 /我在里头/ 警察在外头。

* 中新社:联合国确认海地遇难维和人员 没有中国人。公安部海地观光团把九常委都忽悠了,还搞国葬,欺君大罪啊。

* 风在吼. 狗在叫. 谷歌在咆哮. 谷歌在咆哮. 马勒戈壁万丈高. 卧槽泥马 高也疯了. 绿霸丛中, 抗日英雄真不少! 互联网里, 草泥马们逞英豪! 端起了手机电脑, 挥动着键盘鼠标, 保卫推特! 保卫谷歌! 保卫博客! 保卫全搜索!

* 明天你是否会想起,昨天你下的日剧;明天你是否还惦记,曾经红火的《越狱》。网友们都已想不起,下载了多少个G;我也是偶然翻硬盘,才想起 CHINABT。谁封了你的服务器?谁锁了你的IP?谁把你的资源清洗?谁给你做的寿衣!

* 最早的时候,我的twitter上有 两群人:搞技术的和谈政治的。后来谈政治的也时不时搞搞技术;搞技术的会时不时谈谈政治。因为,不会点技术的话,谈政治的就没法谈政治;搞技术的时常被政 治搞,所以不得不骂两句政治。

* 『曹操墓里惊现两个头盖骨,经考古学 家鉴定,其中一个是曹操的,另一个是曹操小时候的。』转自人民网。

* 1949,只有**才能救中 国;1989,只有中国才能救**;2009,只有中国才能救资本主义;2012,只有中国才能救地球

* Facebook的原罪是它能让人认识想认识的人。Twitter的原罪是它能让人说出想说的话。Google的原罪是它能让人知道想知道的东西。 Youtube的原罪是它能让人证明需要证明的现实。所以它们都被干掉了。

* 我想有一所房子,面朝大海,春暖花 开,4M宽带,能叫外卖,快递直达,不还房贷。

* 我在马路边撞倒一青年,把他交到警察 叔叔手里边, 叔叔拿了钱, 才判我3年, 我高兴地的说了声, 叔叔再见 //好亮啊

* 狂赞,某豆友在谷歌中国门前献花的祝福卡片留言:“HTTP 404 Page Not Found 根据当地法律法规,部分祝福未能显示”

* 有记者问秦刚:北京白昼天黑,网民戏称 是不祥之兆,你有何评价?秦刚说:我可以告诉你两点,一、我们**人是无神论者,不信邪!二、请人民放心,**风水很好!三、北京艳阳高照。

* Sorry Chinese heroes, but they are not on UN list .

* 中国有 个党建出版社,中组部的,这个出版社出的书,都走组织途径。直接打电话给各地组织部,要求订购。一律有求必应,连书都不要。你要订多少册,我就直接把钱打 过去,货就不用发了。《孔子》可以走这个路线,让组织上直接买单。

* 新华网:推特杀死知名博客,国外网站风险多多。

* 土 摩托日记:说实话,中国真正的改革开放才30多年,进步够快了。很多东西根本不是依靠对话能够解决的,大家受到的教育太不一样了。只有耐心等待,直到一批 人死光之后,才有可能看到实质性的进展。不信咱们走着瞧。

* 要像白居易一样坚定:野火烧不尽,春风吹又生。像杜布切克一样牛逼:你可以掐掉鲜花,却无法消灭整个春天。像罗素一样从 容:对苦难有着不可忍受的同情心。像《圣经》一样祈祷:出来如花,又被摘下。像阿垅一样愤怒:我们要这样宣告,我们无罪,然后凋谢。

* 当层层审查墙把一些人与人类大家庭隔离开来的时候,我们不能袖手旁观。我们不能因为听不到那些人的呼喊就对这些问题保持 沉默。——希拉里