码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
OC原理之多线程(二)
对于如下代码的,它的打印结果是什么 NSThread *thread = [[NSThread alloc] initWithBlock:^{ NSLog(@"1"); }]; [thread start]; [self performSelector:@selector(testhaha) onT ...
分类:编程语言   时间:2021-02-24 13:19:34    阅读次数:0
2 sqlite 数据库操作封装
import sqlite3 class SqliteUtil(): def __init__(self, file): # 连接到 SQlite数据库 # 数据库文件是 api_test.s3db,不存在,则自动创建 self.conn = sqlite3.connect('api_test.s3 ...
分类:数据库   时间:2021-02-23 14:22:09    阅读次数:0
php几种设计模式
创建型-单例模式 class SingletonOne { private static $singletonOne = null; public function ok() { echo 'ok'; } public static function getInstance(){ if (self: ...
分类:Web程序   时间:2021-02-23 14:14:02    阅读次数:0
一些自定义 PostgreSQL 随机数据生成器 —— Some self-defined PostgreSQL random data generators
1. 生成随机整数 —— Generate a random integer -- Function: -- Generate a random integer -- Parameters: -- min_value: Minimum value -- max_value: Maximum valu ...
分类:数据库   时间:2021-02-22 12:26:33    阅读次数:0
汽车模块
cat car.py 1 #! /usr/bin/python 2 # -*- coding:utf-8 -*- 3 4 5 class Car(object): 6 """ 7 模拟汽车 8 """ 9 def __init__(self, make, model, year): 10 """初始 ...
分类:其他好文   时间:2021-02-19 13:20:12    阅读次数:0
爬虫:之下载QQ音乐(我还没有搞定,等我学了爬虫回来写你)
import requests import re import os import json import time as t class QQmusic(): """代码仅供学习""" def __init__(self): """初始化""" self.headers = { 'Accept- ...
分类:其他好文   时间:2021-02-15 12:44:00    阅读次数:0
力扣34. 在排序数组中查找元素的第一个和最后一个位置
原题 1 class Solution: 2 def searchRange(self, nums: List[int], target: int) -> List[int]: 3 ans,lens = [-1,-1],len(nums) 4 left,right,flag = 0,lens - 1 ...
分类:编程语言   时间:2021-02-15 12:26:30    阅读次数:0
力扣228. 汇总区间
原题 1 class Solution: 2 def summaryRanges(self, nums: List[int]) -> List[str]: 3 left,right,lens,ans = 0,0,len(nums),[] 4 while left < lens: 5 right = ...
分类:其他好文   时间:2021-02-15 11:47:09    阅读次数:0
力扣350. 两个数组的交集 II
原题 1 class Solution: 2 def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: 3 dic1,dic2 = {},{} 4 def helper(nums,dic): 5 for n in nu ...
分类:编程语言   时间:2021-02-10 12:50:25    阅读次数:0
1. 两数之和
给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 你可以按任意顺序返回答案。 个人答案: class Solution: def twoSum ...
分类:其他好文   时间:2021-02-09 12:29:32    阅读次数:0
14215条   上一页 1 ... 10 11 12 13 14 ... 1422 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!