CSS spinners
- Leanest spinner
- Circle spinner
- Bidimensional spinner
CSS spinners
| namespace BloomFilter | |
| { | |
| using System; | |
| using System.Collections; | |
| /// <summary> | |
| /// Bloom filter. | |
| /// </summary> | |
| /// <typeparam name="T">Item type </typeparam> | |
| public class Filter<T> |
| function interval(func, wait, times){ | |
| var interv = function(w, t){ | |
| return function(){ | |
| if(typeof t === "undefined" || t-- > 0){ | |
| setTimeout(interv, w); | |
| try{ | |
| func.call(null); | |
| } | |
| catch(e){ | |
| t = 0; |
| try | |
| { | |
| RuntimeHelpers.EnsureSufficientExecutionStack(); | |
| // call recursion | |
| } | |
| catch (InsufficientExecutionStackException) | |
| { | |
| // catch recursion stackoverflow exception | |
| } | |
| catch |
| /// <summary> | |
| /// Computate Levenshtein distance, not a normal returns format. | |
| /// It returns the percentage difference. | |
| /// </summary> | |
| /// <param name="expected"> expected word </param> | |
| /// <param name="actual"> actual word </param> | |
| /// <returns> Value between 0 - 100 | |
| /// 0==perfect match 100==totaly different </returns> | |
| public static byte GetLevenshteinDistance(string expected, string actual) | |
| { |
| /// <summary> | |
| /// Get Sift3 distance from two words. | |
| /// (eg: spell checking) | |
| /// </summary> | |
| /// <param name="source"> source string </param> | |
| /// <param name="actual"> actual string </param> | |
| /// <param name="maxOffset"> max offset </param> | |
| /// <returns> The distance of the two words. </returns> | |
| public static float GetSift3Distance(string source, string actual, int maxOffset) | |
| { |
| // define cache | |
| var cache = {}; | |
| // ... | |
| // within the AJAX callback | |
| cache[url] = data; | |
| // ... | |
| // within callback that would set forth a request | |
| if(cache[url]) { |
| jQuery.fn.rVal = function () { | |
| if (this[0]) { | |
| var ele = $(this[0]); | |
| if (ele.attr('placeholder') != '' && ele.val() == ele.attr('placeholder')) { | |
| return ''; | |
| } else { | |
| return ele.val(); | |
| } | |
| } | |
| return undefined; |
| namespace Common.Extension | |
| { | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| public static class GenericEvaulatingOrderBy | |
| { | |
| private static IOrderedQueryable<T> OrderingHelper<T>(IQueryable<T> source, string propertyName, bool descending, bool anotherLevel) | |
| { | |
| var param = Expression.Parameter(typeof(T), "p"); |
| /// <summary> | |
| /// Extension method for the "Page" class | |
| /// </summary> | |
| public static class PageHelper | |
| { | |
| /// <summary> | |
| /// Find control in the page | |
| /// </summary> | |
| /// <typeparam name="T">return control type(eg. TextBox)</typeparam> | |
| /// <param name="page">Actual Page</param> |