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 int count (String line, char c) | |
{ | |
int len = line.length(); | |
if ((len == 0) || (c == '\0')){ | |
return 0; | |
} | |
String rest = line.substring(1); | |
if (line.charAt(0) == c) | |
{ | |
return count(rest, c) + 1; |
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
INSERT INTO `users` (`id`, `role_id`, `is_published`, `date_added`, `created_by`, `created_by_user`, `date_modified`, `modified_by`, `modified_by_user`, `checked_out`, `checked_out_by`, `checked_out_by_user`, `username`, `password`, `first_name`, `last_name`, `email`, `position`, `timezone`, `locale`, `last_login`, `last_active`, `online_status`, `preferences`) | |
VALUES | |
(2, 1, 1, '2015-04-01 15:15:07', 1, 'Nobody', NULL, NULL, NULL, NULL, NULL, NULL, 'madmin', '$2y$13$VkE7UjFetqAM13oT4v/VYOfRCGrJ4hbr0zuwRZo6KVfDnNb16WFwy', 'Administrator', 'Uuser', '[email protected]', NULL, NULL, NULL, NULL, NULL, 'offline', 'N;'); |
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
/* | |
Given two words, beginWord and endWord, and a wordlist of approved words, find the length of the shortest transformation sequence from beginWord to endWord such that: | |
Only one letter can be changed at a time | |
Each transformed word must exist in the wordList. | |
Return the length of the shortest transformation sequence, or 0 if no such transformation sequence exists. | |
Note: beginWord does not count as a transformed word. You can assume that beginWord and endWord are not empty and are not the same. | |
Example |
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
//I wanted a more elegant linkedlist example than the others, so purely for academic purposes I created one. | |
var LinkedList = function(e){ | |
var that = {}, first, last; | |
that.push = function(value){ | |
var node = new Node(value); | |
if(first == null){ | |
first = last = node; |
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
//Remover el modal | |
function removeModal( hasPerspective ) { | |
classie.remove( modal, 'ecp-show' ); | |
if( hasPerspective ) { | |
classie.remove( document.documentElement, 'ecp-perspective' ); | |
} | |
} | |
function removeModalHandler() { |
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
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" data-source="mautic"></script> | |
<script data-source="mautic"> | |
var OneSignal = OneSignal || []; | |
OneSignal.push(["init", { | |
appId: "27787d27-d2fd-4492-9265-580124367491", | |
safari_web_id: "", | |
subdomainName: 'https://inboundfelicident.onesignal.com', |
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
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorListener; | |
import android.hardware.SensorManager; | |
import android.util.Log; | |
import android.widget.Toast; | |
import android.content.Context; | |
import java.lang.UnsupportedOperationException; |
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
// Create tab group | |
var tabGroup = Titanium.UI.createTabGroup({ | |
barColor: "black" | |
}); | |
// Create home tab. | |
var win = Ti.UI.createWindow({ | |
title: "Record" | |
}); | |
// Tab for the recording pane. |
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
var states = new Bloodhound({ | |
datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.num); }, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
remote: { | |
url: Metronic.getAJAXURL() + "general/general/BuscarCiudades?query=%QUERY", | |
filter: function (ciudades) { | |
return $.map(ciudades, function (ciudad) { | |
return { | |
num: ciudad.id_ciudad, | |
nombre: ciudad.ciudad_nombre.toLowerCase(), |
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
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.6.0" /> | |
<a href="#" onclick="window.open('http://design.ubuntu.com/wp-content/uploads/ubuntu-logo32.png', '_system', 'location=no'); return false;">_system</a> |