Skip to content

Instantly share code, notes, and snippets.

View kkurni's full-sized avatar

Kurniawan Kurniawan kkurni

  • Microsoft
  • Redmond
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using Microsoft.CSharp.RuntimeBinder;
using System.Runtime.CompilerServices;
namespace ConsoleApplication2
{
class Program
@kkurni
kkurni / GetSchemaMockup.cs
Last active January 26, 2016 06:52
GetSchemaMockup
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace SchemaMockup.Console
{
using System.Data.Common;
using System.Data.SqlClient;
using PostgreClient;
using System;
using System.Data;
using System.Data.SqlClient;
public class Program
{
public static void Main()
{
Console.WriteLine("Run");
TestConnectionString("your connection string");
01:01:19 - Execute Reader 1
01:01:19 - Execute Reader 2
01:01:49 - ERROR : System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.ComponentModel.Win32Exception: The wait operation timed out
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in ...src\System.Data.SqlClient\System\Data\SqlClient\SqlConnection.cs:line 1848
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in ...src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnection.cs:line 786
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean
= Car manufacturers 2013
This is a graph of all the major car manufacturers and their earnings in 2013, alongside all of their main suppliers.
It also shows the relationships between the various manufactures: cooperations, jointventuress and stock ownership. and the type of those
relationships.(For example a cooperation can be of the type: research/development)
//hide
@kkurni
kkurni / job.me
Created May 25, 2014 11:15 — forked from MPiunti/job.me
= jOB.me =
As a global player in IT, Reply is shaped over a network organizational model which is actually spread over 3 continents. The group partnership is natively conceived over multidisciplinary skills and resources, tackling multifaceted markets, technologies and IT domains thanks to the tremendous competencies of its employees. The same competencies which are are well suited and represented over _TamTamy_, more and more constituting the real backbone, the _Ark of the Covenant_ where each of the corporate assets dwell.
*jOB.me* is conceived as a *social crawler*, aiming at promoting and reinforcing the links between different companies inside the group: its basic idea is that knowledge, people and their relationships stand as _FIRST CLASS ENTITIES_ inside the corporate network. jOB.me promotes the organizational structure to scale horizontally - in-the-large - towards an evolutionary network where processes, organizations and people are oriented to the natural diffusion and exchange of knowledge and c
@kkurni
kkurni / angular-scroll.js
Created May 21, 2014 05:53
angular-scroll with duration which work with accordion mobile scroll
/* customised from angular-scroll lib, to support scrolling to moving element... */
/**
* x is a value between 0 and 1, indicating where in the animation you are.
*/
var duScrollDefaultEasing = function (x) {
if (x < 0.5) {
return Math.pow(x * 2, 2) / 2;
}
return 1 - Math.pow((1 - x) * 2, 2) / 2;
@kkurni
kkurni / errorceptionHandler.js
Created May 1, 2014 12:44
errorception handler for angularjs
app.factory('$exceptionHandler', function ($log) {
return function (exception, cause) {
exception.message += ' (caused by "' + cause + '")';
$log.error(exception);
throw exception;
};
});
@kkurni
kkurni / scroll-helper.js
Last active August 29, 2015 13:59
scroll helper will recursively try to scroll into your element. this will be very useful in angularjs
'use strict';
commonLib.factory('scrollHelper', ['$timeout', function ($timeout) {
//scroll to element recursively until found
function scrollToElement(scrollToId, maxRetry) {
var counter = 0;
function tryScroll() {
counter ++;