Skip to content

Instantly share code, notes, and snippets.

View benck's full-sized avatar

benck

  • Taipei, Taiwan
View GitHub Profile
//
//
// NTSolar.swift
//
// Created by Neil Tiffin on 5/8/19.
// Copyright © 2019 Performance Champions, Inc.
// Copyright © 2019 Neil Tiffin.
//
// Released to the public domain by Neil Tiffin, May 2019
// Released to the public domain by Performance Champions, Inc., May 2019
@benck
benck / x-editable-bs4.js
Last active January 21, 2021 08:44
A fix for x-editable to be compatible with bootstrap 4.0.0 alpha 5 and jQuery 3.1.1. Make sure you include Tether for bootstrap 4. (The button is changed to Fontawesome, you may change the $.fn.editableform.buttons to your desired buttons.)
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
// in appDelegate.m
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
// add app-specific handling code here
return wasHandled;
if(location.href.indexOf('http://preorder.emome.net')!==0 && location.href.indexOf('http://preorder.emome.net')!==0){gEid('gw').parentElement.removeChild(gEid('gw'));}else{if(gEid('pageframe')){if(gEid('pageframe').parentElement){gEid('pageframe').parentElement.removeChild(gEid('pageframe'));}else{gEid('pageframe').parentNode.removeChild(gEid('pageframe'));}}var frameURL="<iframe id='pageframe' src='' style='width:100%;height:100%; border:none;' scrolling='no' frameborder='0' marginheight=0 marginwidth=0 allowtransparency onload='abc();'></iframe>";et= Math.round(new Date()/1000);var frameSrc="http://m9"+domainsuffix+"/Order/join?eid=iPhone5s&a=8&key=e430b262fbd0275a9437fb29fcf91927291b03ca&et="+et;gEid('chk').value="1";preg_busy_show('頁面載入中...請稍後.....');if(gEid('frame_content')){gEid('frame_content').style.overflow="hidden";gEid('frame_content').style.height=0;gEid('frame_content').innerHTML="";gEid('frame_content').innerHTML=frameURL;gEid('pageframe').src=frameSrc;}else{alert('該系統不支援您的瀏覽器');}}function abc(
#include <omp.h>
#include <stdlib.h>
#include <stdio.h>
#define MAX_N 100
#define X 0
#define Y 1
int N;
int map[MAX_N][2];
#include <omp.h>
#include <stdlib.h>
#include <stdio.h>
#define MAX_N 26
#define X 0
#define Y 1
int N;
int map[MAX_N][2];