Refer to https://www.youtube.com/watch?v=X22a7vASHsg&t=566s
0. Open earilier so it's cleaner
1. Remove the safety cover (may need pool cover popper)
screw down the anchors
2. Clean large debris
3. Remove plugs (should see bubbles)
4. Remove a gizmo in skimmer, a plug to the filter
5. Put skimmer bucket back
6. For the filter plug installation
Put the drain plug on the filter bottom
Put on the pressure gauage (if there's any)
Put on the sight gauage/glass
Drain plugs for the pump housing
Check the lid O-ring, no cracks, no brittle or dry (may need teflon based lubricant to seal)
Twist the lid
7. Filter operation
Turn the knob to Filter (first waste)
If your pressure gauge shows a sudden spike, shut off your pump immediately.
Turn it on
To clean the water:
1. Shock for the algae
one pound of shock for 10 thousand gallons of water, should be shocking at night
Put the shock into the bucket, stir nice and pour evenly into the pool
Sunday, May 24, 2020
Saturday, May 23, 2020
pywinauto note
1. start and lookup
backend="win32" is default backend, good for MFC, VB6, VCL, simple WinForms controls and most of the old legacy apps
from pywinauto.application import Application
app = Application(backend="uia").start('notepad.exe')
dlg_spec = app.window(title='无标题 - 记事本')
>>> dlg_spec
>>> dlg_spec.wrapper_object()
Actual window lookup is performed by wrapper_object(), it needs the window is on foreground
>>> dlg_spec.print_control_identifiers()
2. magic lookup
app.UntitledNotepad.menu_select("File->SaveAs")
app.SaveAs.ComboBox5.select("UTF-8")
At the 2nd line the SaveAs dialog might not be open by the time this line is executed. So what happens is that we wait until we have a
control to resolve before resolving the dialog. At that point if we can’t find a SaveAs dialog with a ComboBox5 control then we wait a
very short period of time and try again, this is repeated up to a maximum time (currently 5 seconds!)
This is to avoid having to use time.sleep or a “wait” function explicitly.
In some cases, you might prefer disable the magic lookup system, so that Pywinauto immediately raises if you access an attribute
which exists neither on the WindowSpecification object, nor on the underlying element-wrapper object.
In this case, turn off the allow_magic_lookup argument of your Desktop or Application instance:
app = Application(allow_magic_lookup=False)
3. sample notepad in Chinese
from pywinauto import application
app = application.Application()
app.start("Notepad.exe")
app['无标题 - 记事本'].draw_outline()
app['无标题 - 记事本'].menu_select("编辑 -> 替换(&R)...")
app['替换'].print_control_identifiers()
app['替换'].取消.click()
app['无标题 - 记事本'].Edit.type_keys("Hi from Python interactive prompt %s" % str(dir()), with_spaces = True)
app['无标题 - 记事本'].menu_select("文件 -> 退出")
app['记事本'].不保存.click()
4. Huatai
import time
from pywinauto import application
app = application.Application()
app.start("c:/htwt/xiadan.exe")
#app['用户登录'].print_control_identifiers()
app['用户登录'].主站测速.click()
time.sleep(1)
app['<华泰证券>委托连接测试'].开始测速.click()
while True:
try:
app['<华泰证券>委托连接测试'].开始测速.wait("enabled")
break
except RuntimeError:
pass
print(app['<华泰证券>委托连接测试'].开始测速.is_enabled())
app['<华泰证券>委托连接测试'].确定.click()
app['用户登录'].Edit1.set_focus()
app['用户登录'].Edit1.type_keys('******')
5.
dlg = app.window(title_re="Page Setup", class_name="#32770")
app['dlg']['control']
app[u'your dlg title'][u'your ctrl title']
6.
# call ensure_text_changed(ctrl) every 2 sec until it's passed or timeout (4 sec) is expired
@always_wait_until_passes(4, 2)
def ensure_text_changed(ctrl):
if previous_text == ctrl.window_text():
raise ValueError('The ctrl text remains the same while change is expected')
7.
from timings import Timings
Timings.defaults()
Timings.slow() # double all timings (~2x slower script execution)
Timings.fast() # divide all timings by two (~2x faster)
8.
DELAYED RESOLUTION FOR SUCCESS Taking the example
app.dlg.control.action()
Monday, May 18, 2020
Python Flask
Python Flask restful web service
1. Install Python3 and flask (my python is 3.8.0)
2. Make a hello.py accordign to the flask quick start
https://flask.palletsprojects.com/en/1.1.x/quickstart/#quickstart
1. Install Python3 and flask (my python is 3.8.0)
2. Make a hello.py accordign to the flask quick start
https://flask.palletsprojects.com/en/1.1.x/quickstart/#quickstart
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!'
3.On windows, from command line, run "FLASK_APP=hello.py"
and flask run --host=0.0.0.0 --port=80
4. Other computer on the same LAN now is able to access the service (virtualbox needs to be
bridge adapter)
Sunday, May 3, 2020
股票软件比较
股票软件比较:
1. 网季风
下载网季风行情接收器和飞狐交易师,可以全推接收行情,盘后可用免费账号连入。
问题:自己制作的DLL不能使用
2. 飞狐交易师V5.1版
百度搜索 “飞狐交易师V5.1版”并下载
http://www.pc6.com/softview/SoftView_135985.html
安装后点“免费登录”即可连接行情使用(不用额外下载任何行情接收器)
问题:定制的DLL可以使用,但行情接收速度不稳定
3. 大交易师
基于飞狐交易师的现代化图形界面,速度快,对定制DLL和股票公式的支持好
缺点:不能批量导出数据(可用定制DLL一个个导出)
4. 金魔方
和大交易师几乎完全相同,除了速度更慢之外,也不能批量导出数据
总结:
需要一个网季风(虚拟机)和一个大交易师(主机)
1. 网季风
下载网季风行情接收器和飞狐交易师,可以全推接收行情,盘后可用免费账号连入。
问题:自己制作的DLL不能使用
2. 飞狐交易师V5.1版
百度搜索 “飞狐交易师V5.1版”并下载
http://www.pc6.com/softview/SoftView_135985.html
安装后点“免费登录”即可连接行情使用(不用额外下载任何行情接收器)
问题:定制的DLL可以使用,但行情接收速度不稳定
3. 大交易师
基于飞狐交易师的现代化图形界面,速度快,对定制DLL和股票公式的支持好
缺点:不能批量导出数据(可用定制DLL一个个导出)
4. 金魔方
和大交易师几乎完全相同,除了速度更慢之外,也不能批量导出数据
总结:
需要一个网季风(虚拟机)和一个大交易师(主机)
Tuesday, April 28, 2020
Springboot cron example
package com.auspix.satori.auspixMonitor;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import chan.SinaDataMinProvider;
@SpringBootApplication
@EnableScheduling
public class AuspixMonitorApplication {
private static final Logger log = LoggerFactory.getLogger(AuspixMonitorApplication.class);
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
public static final String[] RICS = {"sh000001","sz300234","sz300273","sz300636","sz300669","sz300702"};
public static void main(String[] args) {
SpringApplication.run(AuspixMonitorApplication.class, args);
}
@Scheduled(cron = "0 0,15,30,45 9-14 * * ?")
public void monitorMin15() throws Exception {
monitor();
}
@Scheduled(cron = "0 0,5,10,15,20,25,30,35,40,45,50,55 9-14 * * ?")
public void monitorMin5() throws Exception {
monitor();
}
private void monitor() throws Exception {
log.info("monitorMin15, the time is now {}", dateFormat.format(new Date()));
List<String> diResultList = SinaDataMinProvider.monotorDi(RICS);
log.warn(diResultList.toString());
List<String> dingResultList = SinaDataMinProvider.monotorDing(RICS);
log.warn(dingResultList.toString());
}
}
Friday, April 24, 2020
Python (or other programming language) Home work for kids
Python (or other programming language) Home work:
Unit 1:
1. Write/Print "I'm Paul, I'm learning Python" 10000 times
with blank line, all upper case ...
2. Print all numbers between 1 to 2000
print even numbers only, print even numbers which can divide 3
3. Calculate the sum the event numbers from 1 to 1000
4. How many numbers contain 4 in any digits for the number between 1 to 1000 (good, hard to search)
Unit 2:
1. Same with Day 1 but with functions
2. Calculate Fibonacci
3. Put "Rock Paper Scissors" randomly for 10000 times, are they really random? (good)
4. Print the unrecognized Chinese characters in random order
5. Put the unrecognized Chinese characters in a file, and read the file, print the characters in random order to help review
Unit 3:
1. Make a function to convert fahrenheit to celsius, and vice versa
2. Make a function to calculate min/max/avg/mid for a number array
3. Make a function to convert kilometers to miles, and vice versa
4. Make a function to convert liter to galon, and vice versa
5. Make a function to convert meter to centimeter, and vice versa
6. How to make it a module and call later
Unit 4:
The Three Little Pigs
1. Read a text book file, and tell me how many words in this book, which word appears most?
2. Read a text book file, and tell me how many letters in this book, which letter appears most?
3. Read a text book file, and tell me which line is longest line?
4. Read a text book file, and add line length to every line's beginning.
Unit 5:
How to make unit 4 smarter (AI), the input could be
convert 12 km to miles, or convert 3 liter to galon or 300 centimeter to meter
Unit 6:
1. greatest common factor
2. least common multiple
Unit 7:
Frog jumping
How many Friday and 13 during the latest 1000 years?
Unit 8 (File read/write):
Read stock daily data file, add name to every line
Read stock daily data file, calculate percentage, ma5, ma10 and write back to the file
Unit 9 (network and library):
Retrieve all League of Legends champions skins picture and write them into local hard disk, the folder name is organized by the champion name
Unit 10 (database):
1. Save the daily data file of Unit 8 to MongoDB
2. Save all League of Legends skins of Unit 9 to MongoDB
Unit 1:
1. Write/Print "I'm Paul, I'm learning Python" 10000 times
with blank line, all upper case ...
2. Print all numbers between 1 to 2000
print even numbers only, print even numbers which can divide 3
3. Calculate the sum the event numbers from 1 to 1000
4. How many numbers contain 4 in any digits for the number between 1 to 1000 (good, hard to search)
Unit 2:
1. Same with Day 1 but with functions
2. Calculate Fibonacci
3. Put "Rock Paper Scissors" randomly for 10000 times, are they really random? (good)
4. Print the unrecognized Chinese characters in random order
5. Put the unrecognized Chinese characters in a file, and read the file, print the characters in random order to help review
Unit 3:
1. Make a function to convert fahrenheit to celsius, and vice versa
2. Make a function to calculate min/max/avg/mid for a number array
3. Make a function to convert kilometers to miles, and vice versa
4. Make a function to convert liter to galon, and vice versa
5. Make a function to convert meter to centimeter, and vice versa
6. How to make it a module and call later
Unit 4:
The Three Little Pigs
1. Read a text book file, and tell me how many words in this book, which word appears most?
2. Read a text book file, and tell me how many letters in this book, which letter appears most?
3. Read a text book file, and tell me which line is longest line?
4. Read a text book file, and add line length to every line's beginning.
Unit 5:
How to make unit 4 smarter (AI), the input could be
convert 12 km to miles, or convert 3 liter to galon or 300 centimeter to meter
Unit 6:
1. greatest common factor
2. least common multiple
Unit 7:
Frog jumping
How many Friday and 13 during the latest 1000 years?
Unit 8 (File read/write):
Read stock daily data file, add name to every line
Read stock daily data file, calculate percentage, ma5, ma10 and write back to the file
Unit 9 (network and library):
Retrieve all League of Legends champions skins picture and write them into local hard disk, the folder name is organized by the champion name
Unit 10 (database):
1. Save the daily data file of Unit 8 to MongoDB
2. Save all League of Legends skins of Unit 9 to MongoDB
Thursday, April 16, 2020
Remove a file within the dependency jar from moven ear
https://stackoverflow.com/questions/2830837/remove-file-from-dependency-jar-using-maven
Parent pom has multiple children and all children refers to a scheduler task except 1. Child 1 is deployed to VM1 JBoss, child 2 is deployed to VM2 JBoss ..
For JBoss configuration, it contains the item for scheduler tasks (like cron information) which is not needed on child 3. In this case, needs exclude the spring-tasks.xml from the core*.jar.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>remove-****</id>
<goals>
<goal>remove</goal>
</goals>
<phase>package</phase>
<configuration>
<fileset>
<directory>target/***_MDB-${revision}/lib/**Core-${revision}.jar/META-INF/spring/context</directory>
<includes>
<include>**/spring-tasks.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
Parent pom has multiple children and all children refers to a scheduler task except 1. Child 1 is deployed to VM1 JBoss, child 2 is deployed to VM2 JBoss ..
For JBoss configuration, it contains the item for scheduler tasks (like cron information) which is not needed on child 3. In this case, needs exclude the spring-tasks.xml from the core*.jar.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>remove-****</id>
<goals>
<goal>remove</goal>
</goals>
<phase>package</phase>
<configuration>
<fileset>
<directory>target/***_MDB-${revision}/lib/**Core-${revision}.jar/META-INF/spring/context</directory>
<includes>
<include>**/spring-tasks.xml</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
Subscribe to:
Posts (Atom)