This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; | |
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML: | |
<select name="category_id"> | |
<%= expand_tree_into_select_field(Category.top) %> | |
</select> | |
Ruby helper: | |
def expand_tree_into_select_field(categories) | |
returning(String.new) do |html| | |
categories.each do |category| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML: | |
<select name="category_id"> | |
<%= expand_tree_into_select_field(Category.top) %> | |
</select> | |
Ruby helper: | |
def expand_tree_into_select_field(categories) | |
returning(String.new) do |html| | |
categories.each do |category| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: post | |
title: Scroll Page 表单提交后页面重新滚回原来滚动条所在位置 | |
comments: true | |
date: 2004-09-20 13:55 | |
categories: | |
- ASP.NET | |
- 前端开发 | |
- Asp.net | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MyNetActivityIndicator.h | |
// | |
// | |
// Created by Marble Wu on 12-3-8. | |
// Copyright (c) 2012年. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
--在设计表时将字段的Description加上 | |
--然后执行下面的SQL就可以了 | |
-- | |
DECLARE @table_name NVARCHAR(1000) | |
SET @table_name = 'LuckDrawActivities' | |
SELECT '' AS [Key], | |
sys.columns.name AS 'Field Name', | |
sys.types.name + '(' + CONVERT ( varchar(20) ,sys.columns.max_length ) + ')' AS 'Data Type', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def | |
word_count | |
frequencies = Hash.new(0) | |
downcase.scan(/\w+/) { | word | frequencies[word] += 1} | |
return frequencies | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class IEnumableExtensions | |
{ | |
public static void ForEach<T>(this IEnumerable<T> value, Action<T> action) | |
{ | |
foreach (var v in value) | |
{ | |
action(v); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1、得到私有字段的值: | |
public static T GetPrivateField<T>(this object instance, string fieldname) | |
{ | |
BindingFlags flag = BindingFlags.Instance | BindingFlags.NonPublic; | |
Type type = instance.GetType(); | |
FieldInfo field = type.GetField(fieldname, flag); | |
return (T)field.GetValue(instance); | |
} | |
//2、得到私有属性的值: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp_configure 'max text repl size', 2147483647 | |
Go | |
RECONFIGURE | |
GO | |
--Note: The setting takes effect immediately without a SQL server restart. |