This file contains 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
Titanium.Media.showCamera({ | |
allowEditing: true, | |
success: function(event) { | |
var image = event.media; | |
var pxhr = Titanium.Network.createHTTPClient(); | |
pxhr.onerror = function() { | |
Ti.UI.createNotification({ | |
message:'Upload failed, please try again.' | |
}).show(); | |
} |
This file contains 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
/* The images for this example can be downloaded from http://j.mp/loadingimagesforti */ | |
var win = Ti.UI.createWindow({ backgroundColor: '#f00'}); | |
var loading = Ti.UI.createImageView({ | |
images: [ | |
'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png', | |
'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png', | |
'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png', | |
'images/loading/10.png', 'images/loading/11.png' | |
], | |
width: 33, height: 33 |
This file contains 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 mySockets = []; | |
var server = net.createServer(function (socket) { | |
socket.write("Echo server\r\n"); | |
mySockets.push(socket); | |
socket.on('data',function(data){ | |
mySockets.forEach(function(s){ | |
s.write(data); | |
}); | |
}); |
This file contains 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
package com.centralway.numbrs.numbrsapp.views; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.support.design.widget.TextInputLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.EditText; |
This file contains 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
package com.centralway.numbrs.numbrsapp.views; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.support.design.widget.TextInputLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.EditText; |
This file contains 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
fetch('https://cors.io/?https://www.duolingo.com/users/CashLo') | |
.then(response => response.json()) | |
.then(json => console.log(json)) |
This file contains 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
# Definition for singly-linked list. | |
# class ListNode(object): | |
# def __init__(self, x): | |
# self.val = x | |
# self.next = None | |
class Solution(object): | |
def addTwoNumbers(self, l1, l2): | |
""" | |
:type l1: ListNode |
This file contains 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
class Solution(object): | |
def lengthOfLongestSubstring(self, s): | |
""" | |
:type s: str | |
:rtype: int | |
""" | |
max_length = 0 | |
seen_dict = {} | |
sub_start = 0 | |
for i, c in enumerate(s): |
This file contains 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
class Solution(object): | |
def lengthOfLongestSubstring(self, s): | |
""" | |
:type s: str | |
:rtype: int | |
""" | |
max_length = 0 | |
seen_dict = {} | |
sub_start = 0 | |
for i, c in enumerate(s): |
This file contains 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
class Solution(object): | |
def find_number_after(self, nums1, nums2, left, take_numbers): | |
if len(nums1) + len(nums2) <= 10 or len(nums1) < 2 or not len(nums2) < 2: | |
jointed = [] | |
jointed.extend(nums1) | |
jointed.extend(nums2) | |
jointed.sort() | |
return jointed[left:left+take_numbers] | |
left1 = len(nums1) * left / ( len(nums1) + len(nums2) ) | |
left1 = max(left1, left - len(nums2) + 1) |
OlderNewer