Skip to content

Instantly share code, notes, and snippets.

View amelieykw's full-sized avatar

amelieykw amelieykw

  • Sophia Antipolis, France
View GitHub Profile
@amelieykw
amelieykw / 函数的参数.md
Last active March 8, 2018 14:57
[Python 3 函数] #函数 #Python3 #Python内置的常用函数 #数据类型转换函数 #int() #float() #str() #bool()

定义函数的时候,我们把参数的名字和位置确定下来,函数的接口定义就完成了。

对于函数的调用者来说,只需要知道如何传递正确的参数,以及函数将返回什么样的值就够了,函数内部的复杂逻辑被封装起来,调用者无需了解。

Python的函数定义非常简单,但灵活度却非常大。 除了正常定义的必选参数外,还可以使用默认参数可变参数关键字参数,使得函数定义出来的接口,不但能处理复杂的参数,还可以简化调用者的代码。

Contents

参数类型 简介
@amelieykw
amelieykw / HTML简介.md
Last active March 8, 2018 14:56
[Python 3 WEB开发] #web #Python3 #PythonWeb #HTML #HTTP #WSGI #Flask #框架 #模板

网页就是HTML?

这么理解大概没错。 因为网页中不但包含文字,还有图片、视频、Flash小游戏,有复杂的排版、动画效果,所以,HTML定义了一套语法规则,来告诉浏览器如何把一个丰富多彩的页面显示出来。

HTML长什么样?

上次我们看了新浪首页的HTML源码,如果仔细数数,竟然有6000多行!

所以,学HTML,就不要指望从新浪入手了。

@amelieykw
amelieykw / 生成器.md
Last active March 9, 2018 10:13
[Python 3 高级特性] #Python3 #高级特性 #切片#迭代 #列表生成式 #生成器 #迭代器

通过列表生成式,我们可以直接创建一个列表。

但是,受到内存限制,列表容量肯定是有限的。

而且,创建一个包含100万个元素的列表,不仅占用很大的存储空间,如果我们仅仅需要访问前面几个元素,那后面绝大多数元素占用的空间都白白浪费了。

所以,如果列表元素可以按照某种算法推算出来,那我们是否可以在循环的过程中不断推算出后续的元素呢?这样就不必创建完整的list,从而节省大量的空间。

在Python中,这种一边循环一边计算的机制,称为生成器:generator。

@amelieykw
amelieykw / Django Views and URLconfs.md
Last active March 13, 2018 14:57
[Django 02 - Views and URLconfs] #Django #View #URLconf
  • In the previous chapter, I explained how to set up a Django project and run the Django development server.
  • In this chapter, you’ll learn the basics of creating dynamic web pages with Django.

Your First Django-Powered Page: Hello World

As our first goal, let’s create a web page that outputs that famous example message: “Hello world.”

If you were publishing a simple “Hello world” web page without a web framework, you’d simply type “Hello world” into a text file, call it “hello.html“, and upload it to a directory on a web server somewhere. Notice in that process you’ve specified two key pieces of information about that web page:

  1. its contents (the string "Hello world")
  2. its URL (e.g. http://www.example.com/hello.html).
@amelieykw
amelieykw / 01 - What is Power BI?.md
Last active January 24, 2022 21:33
[Power BI] #Microsoft #powerBI #BusinessIntelligence #DataVisualization

Power BI :

  • a collection of software services, apps, and connectors
  • work together to turn your unrelated sources of data into coherent, visually immersive, and interactive insights.
    • Whether your data is :
      • a simple Excel spreadsheet
      • a collection of cloud-based
      • on-premises hybrid data warehouses
    • Power BI lets you easily connect to your data sources, visualize (or discover) what’s important, and share that with anyone or everyone you want.

power BI

@amelieykw
amelieykw / EX01.html
Last active March 19, 2018 09:38
[Highcharts - Gauge series] #GaugeSeries #Highcharts #AmadeusIntern2018
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; max-width: 400px; height: 300px; margin: 0 auto"></div>
@amelieykw
amelieykw / EX01.js
Last active March 19, 2018 13:15
[Highcharts - Spider Web] #SpiderWebChart #Highcharts
Highcharts.chart('container', {
chart: {
polar: true,
type: 'line',
backgroundColor: 'transparent'
},
title: {
text: null,
@amelieykw
amelieykw / EX01.html
Created March 19, 2018 14:43
[HighChart - Basic Bar Chart] #BasicBar #Highchart
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
@amelieykw
amelieykw / EX01.css
Created March 19, 2018 17:00
[HighChart - word cloud] #Highchart #wordCloud
#container {
min-width: 310px;
max-width: 1000px;
max-height: 200px;
margin: 0 auto
}
@amelieykw
amelieykw / Background.md
Last active March 21, 2018 16:20
[A Complete Guide to Flexbox]#flexbox #CSS #Bootstrap

Flexbox Layout

aims at :

providing a more efficient way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic (thus the word "flex").

  • give the container the ability to alter its items' width/height (and order) to best fill the available space
  • A flex container expands items to fill available free space, or shrinks them to prevent overflow.

Note: is most appropriate to