码迷,mamicode.com
首页 >  
搜索关键字:food    ( 436个结果
重写equals方法发现的一点问题
这里假设有一个父类为Food,其子类为Apple,现在我们要在Apple中重写equals方法,但是测试的时候,我们会控制一些其他的因素来发现比较结果的不同。 情况1: // 父类 Food1 public class Food { 2 public void sayName(){ 3 System ...
分类:其他好文   时间:2020-06-04 01:11:06    阅读次数:54
Class
Class 怎么声明也一个类 //ES5 let Animal=function(type){ this.type=type; this.eat=function(){ console.log('i am eat food'); } } let dog=new Animal('dog'); let ...
分类:其他好文   时间:2020-06-01 22:20:12    阅读次数:92
pandas常用语法
常见的一些pandas的使用方法 import pandas as pd food_info = pd.read_csv('food_info.csv') print(type(food_info)) print(food_info.dtypes) # print(help(pd.read_csv) ...
分类:其他好文   时间:2020-05-30 10:47:33    阅读次数:97
观察者模式
// 被观察者 class Subject{ // 定义一个对象 constructor(){ // 构造器 可以实例一个对象 this.subs = [] // 存储观察者 } addsub(sub){ // 添加观察者 this.subs.push(sub) } notify(food){ // ...
分类:其他好文   时间:2020-05-20 20:24:33    阅读次数:56
使用js实现贪吃蛇小游戏
//1.写食物 ; (function (w) { //声明一个数组用来保存食物 var list = []; //1.1.创建食物的构造函数:宽、高、颜色、x、y function Food(width, height, bgcolor, x, y) { this.width = width || ...
分类:Web程序   时间:2020-05-19 18:02:12    阅读次数:67
贪心算法
贪心策略 总是做出当前做好的选择。 贪心策略:将问题分成多个子问题;子问题求局部最优解;局部最优解组合成原问题的解。 分类:简单贪心 区间贪心 咖啡豆问题 题目描述FatMouse prepared M pounds of cat food, ready to trade with the cats ...
分类:编程语言   时间:2020-05-14 11:07:53    阅读次数:78
生产者消费者模型
from multiprocessing import Process, JoinableQueueimport timeimport randomdef producer(name, food, q): for i in range(5): data = '%s生产了%s%s' % (name, ...
分类:其他好文   时间:2020-04-23 18:59:40    阅读次数:38
leetcode-1418-点菜展示表
题目描述: 自己的提交: class Solution: def displayTable(self, orders: List[List[str]]) -> List[List[str]]: table = set() table_l = [] food = set() food_l = [] f ...
分类:其他好文   时间:2020-04-20 22:07:14    阅读次数:84
全选、全不选、反选
<div class="tit"> 你爱好的美食是? <form action=""> <input type="checkbox" name="quan" value="quan" id="quan">全选/全不选 <br> <input type="checkbox" name="food" v ...
分类:其他好文   时间:2020-04-04 20:33:36    阅读次数:65
Python学习之yield表达式、三元表达式与生成式
一.yield表达式的应用 在函数内可以采用表达式形式的yield。 >>> def eater(): ... print('Ready to eat') ... while True: ... food=yield ... print('get the food: %s, and start to ...
分类:编程语言   时间:2020-03-25 21:39:07    阅读次数:91
436条   上一页 1 2 3 4 ... 44 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!