Skip to content

Instantly share code, notes, and snippets.

View neo125874's full-sized avatar

Jim neo125874

View GitHub Profile
@neo125874
neo125874 / TapeEquilibrium.cs
Created July 22, 2016 07:00
Codility Lesson 3-1 Time Complexity
using System;
using System.Linq;
// you can also use other imports, for example:
// using System.Collections.Generic;
// you can write to stdout for debugging purposes, e.g.
// Console.WriteLine("this is a debug message");
class Solution {
public int solution(int[] A) {
@neo125874
neo125874 / OddOccurrencesInArray.cs
Created July 22, 2016 06:13
Codility Lesson 2-2 Arrays
using System;
// you can also use other imports, for example:
// using System.Collections.Generic;
// you can write to stdout for debugging purposes, e.g.
// Console.WriteLine("this is a debug message");
class Solution {
public int solution(int[] A) {
int result = 0;
@neo125874
neo125874 / CyclicRotation.cs
Last active July 22, 2016 06:12
Codility Lesson 2-1 Arrays
using System;
using System.Linq;
// you can also use other imports, for example:
// using System.Collections.Generic;
// you can write to stdout for debugging purposes, e.g.
// Console.WriteLine("this is a debug message");
class Solution {
public int[] solution(int[] A, int K) {
@neo125874
neo125874 / BinaryGap.cs
Created July 22, 2016 02:59
Codility Lesson 1 Iterations
using System;
using System.Linq;
// you can also use other imports, for example:
// using System.Collections.Generic;
// you can write to stdout for debugging purposes, e.g.
// Console.WriteLine("this is a debug message");
class Solution {
public int solution(int N) {
@neo125874
neo125874 / DataTable-filter-for-field-and-row
Last active August 29, 2015 14:18
pass dt & conditions to get the filtered data(For Data Column&Row)
public static DataTable GetReportFilter(List<TEUserObjectReportFilterModel> _ModelField, List<TEUserObjectReportFilterModel> _ModelContent, DataTable DtReport)
{
DataTable _dt = DtReport.Clone();
DataTable _dtreturn = new DataTable();
try
{
foreach (TEUserObjectReportFilterModel _ObjTmp in _ModelField)
{
try
@neo125874
neo125874 / DataTable-filter-for-row
Last active August 29, 2015 14:18
pass dt & conditions to get the filtered data(For Data Row)
/// <summary>
/// return filtered data
/// </summary>
/// <param name="receivedDt">original data</param>
/// <param name="contentCondition">filter condition</param>
/// <returns>new data table</returns>
public static DataTable GetDataFilter(DataTable receivedDt, List<TEUserObjectReportFilterModel> contentCondition)
{
DataTable newDt = null;
try
@neo125874
neo125874 / ImageBundle-move-pics-to-images-folder
Last active August 29, 2015 14:18
moving image from Dll's image at BundleConfig(For MvcContrib portable area)
public class ImageBundle
{
private readonly Assembly assembly;
private readonly HashSet<string> resourceNames = new HashSet<string>();
//constructor
public ImageBundle(Assembly assembly)
{
this.assembly = assembly;
}
@neo125874
neo125874 / Rebundler-with-css-url-rewrite
Last active August 29, 2015 14:17 — forked from spooky/rebundler
bundle files from Dll's content & scripts(For MvcContrib portable area)
public class Rebundler
{
private readonly Assembly assembly;
private readonly string virtualPath;
private readonly HashSet<string> resourceNames = new HashSet<string>();
//constructor
public Rebundler(Assembly assembly, string virtualPath)
{
this.assembly = assembly;